@@ -50,13 +50,13 @@ typedef struct
5050 bool init ; ///< True if struct has been initialised, otherwise false
5151 smbus_info_t * smbus_info ; ///< Pointer to associated SMBus info
5252 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
5356 uint8_t display_control_flags ; ///< Currently active display control flags
5457 uint8_t entry_mode_flags ; ///< Currently active entry mode flags
5558} i2c_lcd1602_info_t ;
5659
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
6060
6161// Special characters for ROM Code A00
6262
@@ -127,9 +127,14 @@ void i2c_lcd1602_free(i2c_lcd1602_info_t ** tsl2561_info);
127127 *
128128 * @param[in] i2c_lcd1602_info Pointer to I2C-LCD1602 info instance.
129129 * @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).
130134 * @return ESP_OK if successful, otherwise an error constant.
131135 */
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 );
133138
134139/**
135140 * @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);
142147/**
143148 * @brief Clears entire display (clears DDRAM) and returns cursor to home position.
144149 * DDRAM content is cleared, CGRAM content is not changed.
150+ *
145151 * @param[in] i2c_lcd1602_info Pointer to initialised I2C-LCD1602 info instance.
146152 * @return ESP_OK if successful, otherwise an error constant.
147153 */
0 commit comments