@@ -50,13 +50,13 @@ typedef struct
50
50
bool init ; ///< True if struct has been initialised, otherwise false
51
51
smbus_info_t * smbus_info ; ///< Pointer to associated SMBus info
52
52
uint8_t backlight_flag ; ///< Non-zero if backlight is to be enabled, otherwise zero
53
+ uint8_t num_rows ; ///< Number of configured columns
54
+ uint8_t num_columns ; ///< Number of configured columns, including offscreen columns
55
+ uint8_t num_visible_columns ; ///< Number of visible columns
53
56
uint8_t display_control_flags ; ///< Currently active display control flags
54
57
uint8_t entry_mode_flags ; ///< Currently active entry mode flags
55
58
} i2c_lcd1602_info_t ;
56
59
57
- #define I2C_LCD1602_NUM_ROWS 2 ///< Maximum number of supported rows for this device
58
- #define I2C_LCD1602_NUM_COLUMNS 40 ///< Maximum number of supported columns for this device
59
- #define I2C_LCD1602_NUM_VISIBLE_COLUMNS 16 ///< Number of columns visible at any one time
60
60
61
61
// Special characters for ROM Code A00
62
62
@@ -127,9 +127,14 @@ void i2c_lcd1602_free(i2c_lcd1602_info_t ** tsl2561_info);
127
127
*
128
128
* @param[in] i2c_lcd1602_info Pointer to I2C-LCD1602 info instance.
129
129
* @param[in] smbus_info Pointer to SMBus info instance.
130
+ * @param[in] backlight Initial backlight state.
131
+ * @param[in] num_rows Maximum number of supported rows for this device. Typical values include 2 (1602) or 4 (2004).
132
+ * @param[in] num_columns Maximum number of supported columns for this device. Typical values include 40 (1602, 2004).
133
+ * @param[in] num_visible_columns Number of columns visible at any one time. Typical values include 16 (1602) or 20 (2004).
130
134
* @return ESP_OK if successful, otherwise an error constant.
131
135
*/
132
- esp_err_t i2c_lcd1602_init (i2c_lcd1602_info_t * i2c_lcd1602_info , smbus_info_t * smbus_info , bool backlight );
136
+ esp_err_t i2c_lcd1602_init (i2c_lcd1602_info_t * i2c_lcd1602_info , smbus_info_t * smbus_info ,
137
+ bool backlight , uint8_t num_rows , uint8_t num_columns , uint8_t num_visible_columns );
133
138
134
139
/**
135
140
* @brief Reset the display. Custom characters will be cleared.
@@ -142,6 +147,7 @@ esp_err_t i2c_lcd1602_reset(const i2c_lcd1602_info_t * i2c_lcd1602_info);
142
147
/**
143
148
* @brief Clears entire display (clears DDRAM) and returns cursor to home position.
144
149
* DDRAM content is cleared, CGRAM content is not changed.
150
+ *
145
151
* @param[in] i2c_lcd1602_info Pointer to initialised I2C-LCD1602 info instance.
146
152
* @return ESP_OK if successful, otherwise an error constant.
147
153
*/
0 commit comments