diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9e72b908..06be4cf1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,17 @@
# ChangeLog
+## v0.1.4 - 2024-06-17
+
+### Enhancements:
+
+* feat(docs): add resolution column in board instructions by @lboue (#51)
+
+### Bugfixes:
+
+* fix(conf): fix error when include inside file (#52)
+* fix(docs): switch M5Stack doc links to english by @lboue (#50)
+* fix(board): fix m5stack coreS3 power issue (#54)
+
## v0.1.3 - 2024-06-14
### Enhancements:
diff --git a/library.properties b/library.properties
index f11e6231..b6c65ba5 100644
--- a/library.properties
+++ b/library.properties
@@ -1,5 +1,5 @@
name=ESP32_Display_Panel
-version=0.1.3
+version=0.1.4
author=espressif
maintainer=espressif
sentence=ESP32_Display_Panel is an Arduino library designed for ESP SoCs to drive display panels and facilitate rapid GUI development.
diff --git a/src/ESP_PanelVersions.h b/src/ESP_PanelVersions.h
index 8788bc1f..ab79d86c 100644
--- a/src/ESP_PanelVersions.h
+++ b/src/ESP_PanelVersions.h
@@ -11,7 +11,7 @@
/* Library Version */
#define ESP_PANEL_VERSION_MAJOR 0
#define ESP_PANEL_VERSION_MINOR 1
-#define ESP_PANEL_VERSION_PATCH 3
+#define ESP_PANEL_VERSION_PATCH 4
/* File `ESP_Panel_Conf.h` */
#define ESP_PANEL_CONF_VERSION_MAJOR 0
diff --git a/src/ESP_Panel_Conf_Internal.h b/src/ESP_Panel_Conf_Internal.h
index ea03cf2e..d45f004c 100644
--- a/src/ESP_Panel_Conf_Internal.h
+++ b/src/ESP_Panel_Conf_Internal.h
@@ -48,7 +48,7 @@
#endif
#endif
-#if !ESP_PANEL_CONF_INCLUDE_INSIDE
+#ifndef ESP_PANEL_CONF_INCLUDE_INSIDE
/* Supplement macro definitions based on sdkconfig, use default values if not defined */
/*-------------------------------- Debug configurations --------------------------------*/
#ifndef ESP_PANEL_CHECK_RESULT_ASSERT
diff --git a/src/board/Board_Instructions.md b/src/board/Board_Instructions.md
index 46f0db8a..c9142313 100644
--- a/src/board/Board_Instructions.md
+++ b/src/board/Board_Instructions.md
@@ -4,33 +4,33 @@
### [Espressif](https://www.espressif.com/en/products/devkits)
-| **Picture** | **Name** | **LCD Bus** | **LCD Controller** | **Touch Bus** | **Touch Controller** |
-| :--------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------: | :--------------: | :----------------: | :-----------: | :------------------: |
-|
| [ESP32-C3-LCDkit](https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32c3/esp32-c3-lcdkit/index.html) | SPI | GC9A01 | - | - |
-|
| [ESP32-S3-Box](https://github.com/espressif/esp-box/tree/master) | SPI | ILI9342 | I2C | TT21100 |
-|
|[ESP32-S3-Box-3](https://github.com/espressif/esp-box/tree/master) | SPI | ILI9342 | I2C | GT911 |
-
|[ESP32-S3-Box-3(beta)](https://github.com/espressif/esp-box/tree/c4c954888e11250423f083df0067d99e22d59fbe) | SPI | ILI9342 | I2C | TT21100 |
-|
| [ESP32-S3-Box-Lite](https://github.com/espressif/esp-box/tree/master) | SPI | ST7789 | - | - |
-|
| [ESP32-S3-EYE](https://github.com/espressif/esp-who/blob/master/docs/en/get-started/ESP32-S3-EYE_Getting_Started_Guide.md) | SPI | ST7789 | - | - |
-|
| [ESP32-S3-Korvo-2](https://docs.espressif.com/projects/esp-adf/en/latest/design-guide/dev-boards/user-guide-esp32-s3-korvo-2.html) | SPI | ILI9342 | I2C | TT21100 |
-|
| [ESP32-S3-LCD-EV-Board](https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32s3/esp32-s3-lcd-ev-board/index.html) | 3-wire SPI + RGB | GC9503 | I2C | FT5x06 |
-|
| [ESP32-S3-LCD-EV-Board-2](https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32s3/esp32-s3-lcd-ev-board/index.html) | RGB | ST7262E43 | I2C | GT1151 |
-|
| [ESP32-S3-USB-OTG](https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32s3/esp32-s3-usb-otg/index.html) | SPI | ST7789 | - | - |
+| **Picture** | **Name** | **LCD Bus** | **LCD Controller** | **LCD resolution** | **Touch Bus** | **Touch Controller** |
+| :--------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------: | :--------------: | :----------------: | :----------------: | :-----------: | :------------------: |
+|
| [ESP32-C3-LCDkit](https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32c3/esp32-c3-lcdkit/index.html) | SPI | GC9A01 | 240x240 | - | - |
+|
| [ESP32-S3-Box](https://github.com/espressif/esp-box/tree/master) | SPI | ILI9342 | 320x240 | I2C | TT21100 |
+|
|[ESP32-S3-Box-3](https://github.com/espressif/esp-box/tree/master) | SPI | ILI9342 | 320x240 | I2C | GT911 |
+
|[ESP32-S3-Box-3(beta)](https://github.com/espressif/esp-box/tree/c4c954888e11250423f083df0067d99e22d59fbe) | SPI | ILI9342 | 320x240 | I2C | TT21100 |
+|
| [ESP32-S3-Box-Lite](https://github.com/espressif/esp-box/tree/master) | SPI | ST7789 | 320x240 | - | - |
+|
| [ESP32-S3-EYE](https://github.com/espressif/esp-who/blob/master/docs/en/get-started/ESP32-S3-EYE_Getting_Started_Guide.md) | SPI | ST7789 | 240x240 | - | - |
+|
| [ESP32-S3-Korvo-2](https://docs.espressif.com/projects/esp-adf/en/latest/design-guide/dev-boards/user-guide-esp32-s3-korvo-2.html) | SPI | ILI9342 | 320x240 | I2C | TT21100 |
+|
| [ESP32-S3-LCD-EV-Board](https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32s3/esp32-s3-lcd-ev-board/index.html) | 3-wire SPI + RGB | GC9503 | 480x480 | I2C | FT5x06 |
+|
| [ESP32-S3-LCD-EV-Board-2](https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32s3/esp32-s3-lcd-ev-board/index.html) | RGB | ST7262E43 | 800x480 | I2C | GT1151 |
+|
| [ESP32-S3-USB-OTG](https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32s3/esp32-s3-usb-otg/index.html) | SPI | ST7789 | 240x240 | - | - |
### [M5Stack](https://m5stack.com/)
-| **Picture** | **Name** | **LCD Bus** | **LCD Controller** | **Touch Bus** | **Touch Controller** |
-| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------: | :--------------: | :----------------: | :-----------: | :------------------: |
-|
| [M5STACK_M5CORE2](https://docs.m5stack.com/zh_CN/core/core2) | SPI | ILI9342C | I2C | FT6336U |
-|
| [M5STACK_M5DIAL](https://docs.m5stack.com/zh_CN/core/M5Dial) | SPI | GC9A01 | I2C | FT5x06 |
-|
| [M5STACK_M5CORES3](https://docs.m5stack.com/zh_CN/core/CoreS3) | SPI | ILI9342C | I2C | FT6336U |
+| **Picture** | **Name** | **LCD Bus** | **LCD Controller** | **LCD resolution** | **Touch Bus** | **Touch Controller** |
+|--------- |------------------ |--------- |---------------- |---------------- |----------- |------------------ |
+|
| [M5STACK_M5CORE2](https://docs.m5stack.com/en/core/core2) | SPI | ILI9342C | 320x240 | I2C | FT6336U |
+|
| [M5STACK_M5DIAL](https://docs.m5stack.com/en/core/M5Dial) | SPI | GC9A01 | 240x240 | I2C | FT5x06 |
+|
| [M5STACK_M5CORES3](https://docs.m5stack.com/en/core/CoreS3) | SPI | ILI9342C | 320x240 | I2C | FT6336U |
### [Shenzhen Jingcai Intelligent](https://www.displaysmodule.com/)
-| **Picture** | **Name** | **LCD Bus** | **LCD Controller** | **Touch Bus** | **Touch Controller** |
-| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------: | :--------------: | :----------------: | :-----------: | :------------------: |
-| [
](https://www.displaysmodule.com/sale-41828962-experience-the-power-of-the-esp32-display-module-sku-esp32-4848s040c-i-y-3.html) | [ESP32-4848S040C_I_Y_3](http://pan.jczn1688.com/directlink/1/ESP32%20module/4.0inch_ESP32-4848S040.zip) | 3-wire SPI + RGB | ST7701 | I2C | GT911 |
+| **Picture** | **Name** | **LCD Bus** | **LCD Controller** | **LCD resolution** | **Touch Bus** | **Touch Controller** |
+| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------: | :--------------: | :--------------: | :----------------: | :-----------: | :------------------: |
+| [
](https://www.displaysmodule.com/sale-41828962-experience-the-power-of-the-esp32-display-module-sku-esp32-4848s040c-i-y-3.html) | [ESP32-4848S040C_I_Y_3](http://pan.jczn1688.com/directlink/1/ESP32%20module/4.0inch_ESP32-4848S040.zip) | 3-wire SPI + RGB | ST7701 | 480x480 | I2C | GT911 |
## Recommended Configurations in the Arduino IDE
diff --git a/src/board/m5stack/M5CORES3.h b/src/board/m5stack/M5CORES3.h
index d44cb007..06e4f6a5 100644
--- a/src/board/m5stack/M5CORES3.h
+++ b/src/board/m5stack/M5CORES3.h
@@ -17,13 +17,7 @@
#if ESP_PANEL_USE_LCD
/**
- * LCD Controller Name. Choose one of the following:
- * - GC9A01, GC9B71, GC9503
- * - ILI9341
- * - NV3022B
- * - SH8601
- * - SPD2010
- * - ST7262, ST7701, ST7789, ST7796, ST77916, ST77922
+ * LCD Controller Name.
* LCD Controller of M5CoreS3 is ILI9342C, but the driver is compatible with ILI9341.
*/
#define ESP_PANEL_LCD_NAME ILI9341
@@ -41,12 +35,7 @@
*/
#define ESP_PANEL_LCD_BUS_SKIP_INIT_HOST (0) // 0/1
/**
- * LCD Bus Type. Choose one of the following:
- * - ESP_PANEL_BUS_TYPE_I2C (not ready)
- * - ESP_PANEL_BUS_TYPE_SPI
- * - ESP_PANEL_BUS_TYPE_QSPI
- * - ESP_PANEL_BUS_TYPE_I80 (not ready)
- * - ESP_PANEL_BUS_TYPE_RGB (only supported for ESP32-S3)
+ * LCD Bus Type.
*/
#define ESP_PANEL_LCD_BUS_TYPE (ESP_PANEL_BUS_TYPE_SPI)
/**
@@ -73,83 +62,6 @@
#define ESP_PANEL_LCD_SPI_CMD_BITS (8) // Typically set to 8
#define ESP_PANEL_LCD_SPI_PARAM_BITS (8) // Typically set to 8
-#elif ESP_PANEL_LCD_BUS_TYPE == ESP_PANEL_BUS_TYPE_QSPI
-
- #define ESP_PANEL_LCD_BUS_HOST_ID (1) // Typically set to 1
- #define ESP_PANEL_LCD_SPI_IO_CS (5)
-#if !ESP_PANEL_LCD_BUS_SKIP_INIT_HOST
- #define ESP_PANEL_LCD_SPI_IO_SCK (9)
- #define ESP_PANEL_LCD_SPI_IO_DATA0 (10)
- #define ESP_PANEL_LCD_SPI_IO_DATA1 (11)
- #define ESP_PANEL_LCD_SPI_IO_DATA2 (12)
- #define ESP_PANEL_LCD_SPI_IO_DATA3 (13)
-#endif
- #define ESP_PANEL_LCD_SPI_MODE (0) // 0/1/2/3, typically set to 0
- #define ESP_PANEL_LCD_SPI_CLK_HZ (40 * 1000 * 1000)
- // Should be an integer divisor of 80M, typically set to 40M
- #define ESP_PANEL_LCD_SPI_TRANS_QUEUE_SZ (10) // Typically set to 10
- #define ESP_PANEL_LCD_SPI_CMD_BITS (32) // Typically set to 32
- #define ESP_PANEL_LCD_SPI_PARAM_BITS (8) // Typically set to 8
-
-#elif ESP_PANEL_LCD_BUS_TYPE == ESP_PANEL_BUS_TYPE_RGB
-
- #define ESP_PANEL_LCD_RGB_CLK_HZ (16 * 1000 * 1000)
- #define ESP_PANEL_LCD_RGB_HPW (10)
- #define ESP_PANEL_LCD_RGB_HBP (10)
- #define ESP_PANEL_LCD_RGB_HFP (20)
- #define ESP_PANEL_LCD_RGB_VPW (10)
- #define ESP_PANEL_LCD_RGB_VBP (10)
- #define ESP_PANEL_LCD_RGB_VFP (10)
- #define ESP_PANEL_LCD_RGB_PCLK_ACTIVE_NEG (0) // 0: rising edge, 1: falling edge
- #define ESP_PANEL_LCD_RGB_DATA_WIDTH (16) // 8 | 16
- #define ESP_PANEL_LCD_RGB_PIXEL_BITS (16) // 24 | 16
- #define ESP_PANEL_LCD_RGB_FRAME_BUF_NUM (1) // 1/2/3
- #define ESP_PANEL_LCD_RGB_BOUNCE_BUF_SIZE (0) // Bounce buffer size in bytes. This function is used to avoid screen drift.
- // To enable the bounce buffer, set it to a non-zero value. Typically set to `ESP_PANEL_LCD_WIDTH * 10`
- // The size of the Bounce Buffer must satisfy `width_of_lcd * height_of_lcd = size_of_buffer * N`,
- // where N is an even number.
- #define ESP_PANEL_LCD_RGB_IO_HSYNC (46)
- #define ESP_PANEL_LCD_RGB_IO_VSYNC (3)
- #define ESP_PANEL_LCD_RGB_IO_DE (17) // -1 if not used
- #define ESP_PANEL_LCD_RGB_IO_PCLK (9)
- #define ESP_PANEL_LCD_RGB_IO_DISP (-1) // -1 if not used
- #define ESP_PANEL_LCD_RGB_IO_DATA0 (10)
- #define ESP_PANEL_LCD_RGB_IO_DATA1 (11)
- #define ESP_PANEL_LCD_RGB_IO_DATA2 (12)
- #define ESP_PANEL_LCD_RGB_IO_DATA3 (13)
- #define ESP_PANEL_LCD_RGB_IO_DATA4 (14)
- #define ESP_PANEL_LCD_RGB_IO_DATA5 (21)
- #define ESP_PANEL_LCD_RGB_IO_DATA6 (47)
- #define ESP_PANEL_LCD_RGB_IO_DATA7 (48)
-#if ESP_PANEL_LCD_RGB_DATA_WIDTH > 8
- #define ESP_PANEL_LCD_RGB_IO_DATA8 (45)
- #define ESP_PANEL_LCD_RGB_IO_DATA9 (38)
- #define ESP_PANEL_LCD_RGB_IO_DATA10 (39)
- #define ESP_PANEL_LCD_RGB_IO_DATA11 (40)
- #define ESP_PANEL_LCD_RGB_IO_DATA12 (41)
- #define ESP_PANEL_LCD_RGB_IO_DATA13 (42)
- #define ESP_PANEL_LCD_RGB_IO_DATA14 (2)
- #define ESP_PANEL_LCD_RGB_IO_DATA15 (1)
-#endif
-#if !ESP_PANEL_LCD_BUS_SKIP_INIT_HOST
- #define ESP_PANEL_LCD_3WIRE_SPI_IO_CS (0)
- #define ESP_PANEL_LCD_3WIRE_SPI_IO_SCK (1)
- #define ESP_PANEL_LCD_3WIRE_SPI_IO_SDA (2)
- #define ESP_PANEL_LCD_3WIRE_SPI_CS_USE_EXPNADER (0) // 0/1
- #define ESP_PANEL_LCD_3WIRE_SPI_SCL_USE_EXPNADER (0) // 0/1
- #define ESP_PANEL_LCD_3WIRE_SPI_SDA_USE_EXPNADER (0) // 0/1
- #define ESP_PANEL_LCD_3WIRE_SPI_SCL_ACTIVE_EDGE (0) // 0: rising edge, 1: falling edge
- #define ESP_PANEL_LCD_FLAGS_AUTO_DEL_PANEL_IO (0) // Delete the panel IO instance automatically if set to 1.
- // If the 3-wire SPI pins are sharing other pins of the RGB interface to save GPIOs,
- // Please set it to 1 to release the panel IO and its pins (except CS signal).
- #define ESP_PANEL_LCD_FLAGS_MIRROR_BY_CMD (!ESP_PANEL_LCD_FLAGS_AUTO_DEL_PANEL_IO)
- // The `mirror()` function will be implemented by LCD command if set to 1.
-#endif
-
-#else
-
-#error "The function is not ready and will be implemented in the future."
-
#endif /* ESP_PANEL_LCD_BUS_TYPE */
/**
@@ -207,13 +119,7 @@
#define ESP_PANEL_USE_TOUCH (1) // 0/1
#if ESP_PANEL_USE_TOUCH
/**
- * Touch controller name. Choose one of the following:
- * - CST816S
- * - FT5x06
- * - GT911, GT1151
- * - ST1633, ST7123
- * - TT21100
- * - XPT2046
+ * Touch controller name.
* Touch Controller of M5CoreS3 is FT6336U, but the driver is compatible with FT5x06.
*/
#define ESP_PANEL_TOUCH_NAME FT5x06
@@ -229,9 +135,7 @@
*/
#define ESP_PANEL_TOUCH_BUS_SKIP_INIT_HOST (0) // 0/1
/**
- * Touch panel bus type. Choose one of the following:
- * - ESP_PANEL_BUS_TYPE_I2C
- * - ESP_PANEL_BUS_TYPE_SPI
+ * Touch panel bus type.
*/
#define ESP_PANEL_TOUCH_BUS_TYPE (ESP_PANEL_BUS_TYPE_I2C)
/* Touch panel bus parameters */
@@ -248,22 +152,6 @@
#define ESP_PANEL_TOUCH_I2C_IO_SDA (12)
#endif
-#elif ESP_PANEL_TOUCH_BUS_TYPE == ESP_PANEL_BUS_TYPE_SPI
-
- #define ESP_PANEL_TOUCH_BUS_HOST_ID (1) // Typically set to 1
- #define ESP_PANEL_TOUCH_SPI_IO_CS (5)
-#if !ESP_PANEL_TOUCH_BUS_SKIP_INIT_HOST
- #define ESP_PANEL_TOUCH_SPI_IO_SCK (7)
- #define ESP_PANEL_TOUCH_SPI_IO_MOSI (6)
- #define ESP_PANEL_TOUCH_SPI_IO_MISO (9)
-#endif
- #define ESP_PANEL_TOUCH_SPI_CLK_HZ (1 * 1000 * 1000)
- // Should be an integer divisor of 80M, typically set to 1M
-
-#else
-
-#error "The function is not ready and will be implemented in the future."
-
#endif /* ESP_PANEL_TOUCH_BUS_TYPE */
/* Touch Transformation Flags */
@@ -285,94 +173,53 @@
///////////////////////////// Please update the following macros to configure the backlight ////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#define ESP_PANEL_USE_BACKLIGHT (0) // 0/1
-#if ESP_PANEL_USE_BACKLIGHT
-/* IO num of backlight pin */
-#define ESP_PANEL_BACKLIGHT_IO (45)
-#define ESP_PANEL_BACKLIGHT_ON_LEVEL (1) // 0: low level, 1: high level
-
-/* Set to 1 if you want to turn off the backlight after initializing the panel; otherwise, set it to turn on */
-#define ESP_PANEL_BACKLIGHT_IDLE_OFF (0) // 0: on, 1: off
-
-/* Set to 1 if use PWM for brightness control */
-#define ESP_PANEL_LCD_BL_USE_PWM (1) // 0/1
-#endif /* ESP_PANEL_USE_BACKLIGHT */
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////// Please update the following macros to configure the IO expander //////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* Set to 0 if not using IO Expander */
#define ESP_PANEL_USE_EXPANDER (0) // 0/1
-#if ESP_PANEL_USE_EXPANDER
-/**
- * IO expander name. Choose one of the following:
- * - CH422G
- * - HT8574
- * - TCA95xx_8bit
- * - TCA95xx_16bit
- */
-#define ESP_PANEL_EXPANDER_NAME TCA95xx_8bit
-
-/* IO expander Settings */
-/**
- * If set to 1, the driver will skip to initialize the corresponding host. Users need to initialize the host in advance.
- * It is useful if other devices use the same host. Please ensure that the host is initialized only once.
- */
-#define ESP_PANEL_EXPANDER_SKIP_INIT_HOST (0) // 0/1
-/* IO expander parameters */
-#define ESP_PANEL_EXPANDER_I2C_ADDRESS (0x20) // The actual I2C address. Even for the same model of IC,
- // the I2C address may be different, and confirmation based on
- // the actual hardware connection is required
-#if !ESP_PANEL_EXPANDER_SKIP_INIT_HOST
- #define ESP_PANEL_EXPANDER_HOST_ID (0) // Typically set to 0
- #define ESP_PANEL_EXPANDER_I2C_CLK_HZ (400 * 1000)
- // Typically set to 400K
- #define ESP_PANEL_EXPANDER_I2C_SCL_PULLUP (1) // 0/1
- #define ESP_PANEL_EXPANDER_I2C_SDA_PULLUP (1) // 0/1
- #define ESP_PANEL_EXPANDER_I2C_IO_SCL (18)
- #define ESP_PANEL_EXPANDER_I2C_IO_SDA (8)
-#endif
-#endif /* ESP_PANEL_USE_EXPANDER */
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////// Please utilize the following macros to execute any additional code if required. //////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-#define ESP_PANEL_BEGIN_START_FUNCTION( panel ) \
- { \
- Serial.println("in function ESP_PANEL_BEGIN_END_FUNCTION\n"); \
- static const uint8_t AXP_ADDR = 0x34; \
- static const uint8_t I2C_MASTER_TIMEOUT_MS = 0; \
- static i2c_port_t i2c_master_port = I2C_NUM_0; \
- \
- uint8_t read_value = 0; \
- uint8_t write_value = 0; \
- uint8_t reg_addr = 0; \
- uint8_t write_buf[2] = {0}; \
- \
- write_buf[0] = 0x90; \
- write_buf[1] = 0xBF; \
- i2c_master_write_to_device(i2c_master_port, AXP_ADDR, write_buf, sizeof(write_buf), I2C_MASTER_TIMEOUT_MS / portTICK_PERIOD_MS); \
- write_buf[0] = 0x02; \
- write_buf[1] = 0b00000101; \
- i2c_master_write_to_device(i2c_master_port, 0x58, write_buf, sizeof(write_buf), I2C_MASTER_TIMEOUT_MS / portTICK_PERIOD_MS); \
- write_buf[0] = 0x03; \
- write_buf[1] = 0b00000011; \
- i2c_master_write_to_device(i2c_master_port, 0x58, write_buf, sizeof(write_buf), I2C_MASTER_TIMEOUT_MS / portTICK_PERIOD_MS); \
- write_buf[0] = 0x04; \
- write_buf[1] = 0b00011000; \
- i2c_master_write_to_device(i2c_master_port, 0x58, write_buf, sizeof(write_buf), I2C_MASTER_TIMEOUT_MS / portTICK_PERIOD_MS); \
- write_buf[0] = 0x05; \
- write_buf[1] = 0b00001100; \
- i2c_master_write_to_device(i2c_master_port, 0x58, write_buf, sizeof(write_buf), I2C_MASTER_TIMEOUT_MS / portTICK_PERIOD_MS); \
- write_buf[0] = 0x11; \
- write_buf[1] = 0b00010000; \
- i2c_master_write_to_device(i2c_master_port, 0x58, write_buf, sizeof(write_buf), I2C_MASTER_TIMEOUT_MS / portTICK_PERIOD_MS); \
- write_buf[0] = 0x12; \
- write_buf[1] = 0b11111111; \
- i2c_master_write_to_device(i2c_master_port, 0x58, write_buf, sizeof(write_buf), I2C_MASTER_TIMEOUT_MS / portTICK_PERIOD_MS); \
- write_buf[0] = 0x13; \
- write_buf[1] = 0b11111111; \
- i2c_master_write_to_device(i2c_master_port, 0x58, write_buf, sizeof(write_buf), I2C_MASTER_TIMEOUT_MS / portTICK_PERIOD_MS); \
- \
+#define ESP_PANEL_BEGIN_START_FUNCTION( panel ) \
+ { \
+ const uint8_t AXP_ADDR = 0x34; \
+ const uint8_t I2C_MASTER_TIMEOUT_MS = 1000; \
+ const i2c_port_t i2c_master_port = I2C_NUM_0; \
+ \
+ uint8_t read_value = 0; \
+ uint8_t write_value = 0; \
+ uint8_t reg_addr = 0; \
+ uint8_t write_buf[2] = {0}; \
+ \
+ ESP_LOGD(TAG, "Start AXP2101 Power"); \
+ write_buf[0] = 0x90; \
+ write_buf[1] = 0xBF; \
+ i2c_master_write_to_device(i2c_master_port, AXP_ADDR, write_buf, sizeof(write_buf), pdMS_TO_TICKS(I2C_MASTER_TIMEOUT_MS)); \
+ write_buf[0] = 0x02; \
+ write_buf[1] = 0b00000101; \
+ i2c_master_write_to_device(i2c_master_port, 0x58, write_buf, sizeof(write_buf), pdMS_TO_TICKS(I2C_MASTER_TIMEOUT_MS)); \
+ write_buf[0] = 0x03; \
+ write_buf[1] = 0b00000011; \
+ i2c_master_write_to_device(i2c_master_port, 0x58, write_buf, sizeof(write_buf), pdMS_TO_TICKS(I2C_MASTER_TIMEOUT_MS)); \
+ write_buf[0] = 0x04; \
+ write_buf[1] = 0b00011000; \
+ i2c_master_write_to_device(i2c_master_port, 0x58, write_buf, sizeof(write_buf), pdMS_TO_TICKS(I2C_MASTER_TIMEOUT_MS)); \
+ write_buf[0] = 0x05; \
+ write_buf[1] = 0b00001100; \
+ i2c_master_write_to_device(i2c_master_port, 0x58, write_buf, sizeof(write_buf), pdMS_TO_TICKS(I2C_MASTER_TIMEOUT_MS)); \
+ write_buf[0] = 0x11; \
+ write_buf[1] = 0b00010000; \
+ i2c_master_write_to_device(i2c_master_port, 0x58, write_buf, sizeof(write_buf), pdMS_TO_TICKS(I2C_MASTER_TIMEOUT_MS)); \
+ write_buf[0] = 0x12; \
+ write_buf[1] = 0b11111111; \
+ i2c_master_write_to_device(i2c_master_port, 0x58, write_buf, sizeof(write_buf), pdMS_TO_TICKS(I2C_MASTER_TIMEOUT_MS)); \
+ write_buf[0] = 0x13; \
+ write_buf[1] = 0b11111111; \
+ i2c_master_write_to_device(i2c_master_port, 0x58, write_buf, sizeof(write_buf), pdMS_TO_TICKS(I2C_MASTER_TIMEOUT_MS)); \
+ \
}
// #define ESP_PANEL_BEGIN_EXPANDER_START_FUNCTION( panel )
// #define ESP_PANEL_BEGIN_EXPANDER_END_FUNCTION( panel )