Skip to main content

Module aw9523b

Module aw9523b 

Source
Expand description

AW9523B I2C GPIO expander driver for M5Stack CoreS3 (I2C 0x58).

Register map (AW9523B English datasheet V1.5, §5 “Register Description”): 0x02 Output P0 output latch for port 0 (default 0x00) 0x03 Output P1 output latch for port 1 (default 0x00) 0x04 Config P0 direction: 0=output, 1=input (default 0xFF = all input) 0x05 Config P1 direction: 0=output, 1=input (default 0xFF = all input) 0x12 LEDMODE P0 0=LED current mode, 1=GPIO push-pull (default 0x00) 0x13 LEDMODE P1 0=LED current mode, 1=GPIO push-pull (default 0x00)

Pin assignment (CoreS3 schematic v1.0 + M5Unified Power_Class.cpp): P0_0 TOUCH_RST active-LOW reset for FT6336U P0_1 BUS_OUT_EN active-HIGH — enables the M-Bus/Grove 5V output (load switch) P0_2 AW_RST self-reset (active-LOW) P0_5 USB_OTG_EN active-HIGH — enables USB OTG (kills USB-JTAG if asserted) P1_0 CAM_RST camera reset (active-LOW) P1_1 LCD_RST ILI9342C reset (active-LOW) P1_2 TOUCH_INT FT6336U interrupt (input) P1_3 AW_INT AW9523B interrupt output (active-LOW, open-drain) P1_7 BOOST_EN active-HIGH — enables the SY7088 5V boost converter

NOTE: the BUS_OUT_EN polarity was verified active-HIGH against M5Unified (setExtOutput(true) sets the P0_1 bit) and the ME1502 load-switch topology — an earlier revision of this file wrongly documented it active-LOW.

SAFETY: init() modifies P0 via read-modify-write touching ONLY P0_0 (TOUCH_RST), preserving all other P0 bits at their power-on defaults so BUS_OUT_EN / USB_OTG_EN stay deasserted. The 5V output is brought up only by an explicit enable_bus_5v call.

Datasheet: https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/docs/products/core/CoreS3/AW9523B-EN.pdf CoreS3 schematic: https://m5stack-doc.oss-cn-shenzhen.aliyuncs.com/490/Sch_M5_CoreS3_v1.0.pdf M5Unified: https://github.com/m5stack/M5Unified/blob/master/src/utility/Power_Class.cpp

Structs§

Aw9523bDriver
Aw9523bResources

Enums§

Aw9523bError

Constants§

ADDR
P0_AW_RST
P0_BUS_OUT_EN
P0_TOUCH_RST
P1_AW_INT
P1_BOOST_EN
P1_CAM_RST
P1_LCD_RST
P1_TOUCH_INT