Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Devices/xteink-x4/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
file(GLOB_RECURSE SOURCE_FILES source/*.c*)

idf_component_register(
SRCS ${SOURCE_FILES}
INCLUDE_DIRS "source"
REQUIRES TactilityKernel driver
)
36 changes: 36 additions & 0 deletions Devices/xteink-x4/bindings/xteink,x4-power.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
description: >
Xteink X4 charge/power control: USB VBUS detection, battery-latch power off and the
GPIO3 power button (deep-sleep wake source and long-press sleep, mirroring the
M5Paper's power button in the reference firmware).
Battery voltage/capacity are handled separately by a generic battery-sense node.

compatible: "xteink,x4-power"

properties:
pin-usb-detect:
type: phandles
required: true
description: USB VBUS detect pin (1 = USB connected). Doubles as the charge indicator as the charge IC exposes no status pin.
pin-power-off:
type: phandles
required: true
description: Battery MOSFET latch pin, is driven HIGH at boot to keep the rail on, driven LOW and held to power off on battery
pin-power-button:
type: phandles
required: true
description: Power button pin (active-low, pulled up). Arms the deep-sleep GPIO wake source and triggers sleep when held.
power-button-hold-ms:
type: int
default: 400
description: How long the power button must be held (ms) before the device sleeps. Matches the reference firmware's default long-press duration.
wake-hold-ms:
type: int
default: 0
description: >
Battery cold-boot wake verification. On battery the only boot path is the power
button re-engaging the latch, so the driver polls the button for this many ms after
it starts: a boot that never shows a press is treated as a stray tap and the device
returns to sleep. USB-powered boots (flash, plug-in) and deep-sleep GPIO wakes are
always accepted regardless of this value. 0 (default) disables the check - enable
only once the firmware is confirmed stable, since a boot that fails verification
powers back off immediately.
22 changes: 22 additions & 0 deletions Devices/xteink-x4/device.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
general.vendor=Xteink
general.name=X4

apps.launcherAppId=Launcher

hardware.target=ESP32C3
hardware.flashSize=16MB
hardware.flashMode=DIO
hardware.spiRam=false
hardware.tinyUsb=true
hardware.bluetooth=true

storage.userDataLocation=SD

display.size=4.26"
display.shape=rectangle
display.dpi=230

lvgl.colorDepth=8
lvgl.theme=Mono

sdkconfig.CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y
6 changes: 6 additions & 0 deletions Devices/xteink-x4/devicetree.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- Platforms/platform-esp32
- Drivers/button-adc-control-module
- Drivers/esp-epaper-module
bindings: bindings
dts: xteink,x4.dts
14 changes: 14 additions & 0 deletions Devices/xteink-x4/source/bindings/xteink_x4_power.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#pragma once

#ifdef __cplusplus
extern "C" {
#endif

#include <tactility/bindings/bindings.h>
#include <drivers/xteink_x4_power.h>

DEFINE_DEVICETREE(x4_power, struct XteinkX4PowerConfig)

#ifdef __cplusplus
}
#endif
Loading
Loading