mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-12 15:42:52 +00:00
refactor(lcd_i2c): Remove legacy driver version used in lcd driver
This commit is contained in:
@@ -14,8 +14,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef uint32_t esp_lcd_i2c_bus_handle_t; /*!< Type of LCD I2C bus handle */
|
||||
|
||||
/**
|
||||
* @brief Panel IO configuration structure, for I2C interface
|
||||
*
|
||||
@@ -35,22 +33,6 @@ typedef struct {
|
||||
} flags; /*!< Extra flags to fine-tune the I2C device */
|
||||
} esp_lcd_panel_io_i2c_config_t;
|
||||
|
||||
/**
|
||||
* @brief Create LCD panel IO handle, for I2C interface in legacy implementation
|
||||
*
|
||||
* @param[in] bus I2C bus handle, (in uint32_t)
|
||||
* @param[in] io_config IO configuration, for I2C interface
|
||||
* @param[out] ret_io Returned IO handle
|
||||
*
|
||||
* @note Please don't call this function in your project directly. Please call `esp_lcd_new_panel_to_i2c` instead.
|
||||
*
|
||||
* @return
|
||||
* - ESP_ERR_INVALID_ARG if parameter is invalid
|
||||
* - ESP_ERR_NO_MEM if out of memory
|
||||
* - ESP_OK on success
|
||||
*/
|
||||
esp_err_t esp_lcd_new_panel_io_i2c_v1(uint32_t bus, const esp_lcd_panel_io_i2c_config_t *io_config, esp_lcd_panel_io_handle_t *ret_io);
|
||||
|
||||
/**
|
||||
* @brief Create LCD panel IO handle, for I2C interface in new implementation
|
||||
*
|
||||
@@ -65,58 +47,8 @@ esp_err_t esp_lcd_new_panel_io_i2c_v1(uint32_t bus, const esp_lcd_panel_io_i2c_c
|
||||
* - ESP_ERR_NO_MEM if out of memory
|
||||
* - ESP_OK on success
|
||||
*/
|
||||
esp_err_t esp_lcd_new_panel_io_i2c_v2(i2c_master_bus_handle_t bus, const esp_lcd_panel_io_i2c_config_t *io_config, esp_lcd_panel_io_handle_t *ret_io);
|
||||
esp_err_t esp_lcd_new_panel_io_i2c(i2c_master_bus_handle_t bus, const esp_lcd_panel_io_i2c_config_t *io_config, esp_lcd_panel_io_handle_t *ret_io);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
/**
|
||||
* @brief Create LCD panel IO handle
|
||||
*
|
||||
* @param[in] bus I2C bus ID, indicates which I2C port to use
|
||||
* @param[in] io_config IO configuration, for I2C interface
|
||||
* @param[out] ret_io Returned IO handle
|
||||
* @return
|
||||
* - ESP_ERR_INVALID_ARG if parameter is invalid
|
||||
* - ESP_ERR_NO_MEM if out of memory
|
||||
* - ESP_OK on success
|
||||
*/
|
||||
static inline esp_err_t esp_lcd_new_panel_io_i2c(uint32_t bus, const esp_lcd_panel_io_i2c_config_t *io_config, esp_lcd_panel_io_handle_t *ret_io)
|
||||
{
|
||||
return esp_lcd_new_panel_io_i2c_v1(bus, io_config, ret_io);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Create LCD panel IO handle
|
||||
*
|
||||
* @param[in] bus I2C bus handle, returned from `i2c_new_master_bus`
|
||||
* @param[in] io_config IO configuration, for I2C interface
|
||||
* @param[out] ret_io Returned IO handle
|
||||
* @return
|
||||
* - ESP_ERR_INVALID_ARG if parameter is invalid
|
||||
* - ESP_ERR_NO_MEM if out of memory
|
||||
* - ESP_OK on success
|
||||
*/
|
||||
static inline esp_err_t esp_lcd_new_panel_io_i2c(i2c_master_bus_handle_t bus, const esp_lcd_panel_io_i2c_config_t *io_config, esp_lcd_panel_io_handle_t *ret_io)
|
||||
{
|
||||
return esp_lcd_new_panel_io_i2c_v2(bus, io_config, ret_io);
|
||||
}
|
||||
#else
|
||||
/**
|
||||
* @brief Create LCD panel IO handle
|
||||
*
|
||||
* @param[in] bus I2C bus handle
|
||||
* @param[in] io_config IO configuration, for I2C interface
|
||||
* @param[out] ret_io Returned IO handle
|
||||
* @return
|
||||
* - ESP_ERR_INVALID_ARG if parameter is invalid
|
||||
* - ESP_ERR_NO_MEM if out of memory
|
||||
* - ESP_OK on success
|
||||
*/
|
||||
#define esp_lcd_new_panel_io_i2c(bus, io_config, ret_io) _Generic((bus), \
|
||||
i2c_master_bus_handle_t : esp_lcd_new_panel_io_i2c_v2, \
|
||||
default : esp_lcd_new_panel_io_i2c_v1) (bus, io_config, ret_io)
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user