Skip to content

Commit 927b1a6

Browse files
CSTxxx touch: allow build if using custom I2C address
1 parent 92b790e commit 927b1a6

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

src/drivers/touch/port/esp_lcd_touch_cst816s.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,24 @@ esp_err_t esp_lcd_touch_new_i2c_cst816s(const esp_lcd_panel_io_handle_t io, cons
5656
} \
5757
}
5858

59+
/**
60+
* @brief Touch IO configuration structure with input address
61+
*
62+
* @param[in] addr I2C address of the touch panel
63+
*
64+
*/
65+
#define ESP_LCD_TOUCH_IO_I2C_CST816S_CONFIG_WITH_ADDR(addr) \
66+
{ \
67+
.dev_addr = addr, \
68+
.control_phase_bytes = 1, \
69+
.dc_bit_offset = 0, \
70+
.lcd_cmd_bits = 8, \
71+
.flags = \
72+
{ \
73+
.disable_control_phase = 1, \
74+
} \
75+
}
76+
5977
#ifdef __cplusplus
6078
}
6179
#endif

src/drivers/touch/port/esp_lcd_touch_cst820.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,24 @@ esp_err_t esp_lcd_touch_new_i2c_cst820(const esp_lcd_panel_io_handle_t io, const
5757
} \
5858
}
5959

60+
/**
61+
* @brief Touch IO configuration structure with input address
62+
*
63+
* @param[in] addr I2C address of the touch panel
64+
*
65+
*/
66+
#define ESP_LCD_TOUCH_IO_I2C_CST820_CONFIG_WITH_ADDR(addr) \
67+
{ \
68+
.dev_addr = addr, \
69+
.control_phase_bytes = 1, \
70+
.dc_bit_offset = 0, \
71+
.lcd_cmd_bits = 8, \
72+
.flags = \
73+
{ \
74+
.disable_control_phase = 1, \
75+
} \
76+
}
77+
6078
#ifdef __cplusplus
6179
}
6280
#endif

0 commit comments

Comments
 (0)