pub struct Aw9523bDriver { /* private fields */ }Implementations§
Source§impl Aw9523bDriver
impl Aw9523bDriver
pub fn new(res: Aw9523bResources) -> Self
Sourcepub async fn arm_touch_interrupt(&mut self) -> Result<(), Aw9523bError>
pub async fn arm_touch_interrupt(&mut self) -> Result<(), Aw9523bError>
Let ONLY the touch line pull INTN low, and clear anything pending.
INTN reaches the ESP32-S3 on GPIO21, so this is what makes a touch end
a deep sleep. Two halves, both needed:
- Mask everything else. The mask defaults to all-enabled, so any
input pin changing would assert
INTNand wake the board for something that is not a touch. - Read both input ports.
INTNlatches until an input register is read. A sleep entered with it already asserted ends immediately — esp-hal wakes on the level, not on the edge — which reads exactly like a board that refuses to sleep.
Call it immediately before sleeping, not at init: anything that touches
the panel in between re-asserts INTN.
Sourcepub async fn touch_asserted(&mut self) -> Result<bool, Aw9523bError>
pub async fn touch_asserted(&mut self) -> Result<bool, Aw9523bError>
Is the touch line asserted right now? (P1_2 is active-LOW.)
Reading the port also clears INTN, so this doubles as the “is the pad
at its wake level?” check a caller needs before sleeping.
Sourcepub async fn init(&mut self) -> Result<(), Aw9523bError>
pub async fn init(&mut self) -> Result<(), Aw9523bError>
Set LEDMODE to GPIO, configure P1 outputs, set up P0_0 (TOUCH_RST) via RMW.
Sourcepub async fn lcd_rst_pulse(&mut self) -> Result<(), Aw9523bError>
pub async fn lcd_rst_pulse(&mut self) -> Result<(), Aw9523bError>
Pulse LCD_RST (P1_1) low for ≥10 µs, then wait 120 ms for ILI9342C stabilisation.
Sourcepub async fn enable_bus_5v(&mut self) -> Result<(), Aw9523bError>
pub async fn enable_bus_5v(&mut self) -> Result<(), Aw9523bError>
Enable the M-Bus / Grove 5 V output that powers an attached M5GO bottom’s RGB LEDs on CoreS3 (their supply is the M-Bus 5 V rail, pin 28).
Asserts both BOOST_EN (P1_7, the SY7088 boost) and BUS_OUT_EN (P0_1,
the load switch) HIGH — matching M5Unified’s setExtOutput(true).
CALLER GUARD: M5Unified only enables this when a battery is present or USB is absent — enabling the bus output with no battery while on USB contends the shared VBUS rail. The caller must enforce that (see the CoreS3 example). Drives the two pins as push-pull GPIO outputs, latched high (RMW — other bits preserved).
Sourcepub async fn touch_rst_pulse(&mut self) -> Result<(), Aw9523bError>
pub async fn touch_rst_pulse(&mut self) -> Result<(), Aw9523bError>
Pulse TOUCH_RST (P0_0) low for 5 ms, then wait 300 ms for FT6336U boot.