// // Created by robtor on 09.12.22. // #ifndef FLOATPUMP_LCD_I2C_DRIVER_H #define FLOATPUMP_LCD_I2C_DRIVER_H #include "stm32f4xx_hal.h" namespace floatpump{ class LCD_I2C_Driver { public: LCD_I2C_Driver(I2C_HandleTypeDef &handle, uint16_t displayAddr, uint8_t rows = 4, uint8_t cols = 20) : m_handle(handle), m_displayAddr(displayAddr), m_rows(rows), m_cols(cols) {}; // Functions sending text void LCDSendCString(char *str); // Functions for configuration void LCDInitialize(void); void LCDClearDisplay(void); void LCDSetBacklight(bool enabled); void LCDPower(bool enabled); void LCDCursor(bool enabled); void LCDCursorBlink(bool enabled); // These configurations are normally not necessary to change void LCDCursorIncDec(bool enabled); void LCDDisplayShift(bool enabled); // Move Cursor void LCDSetCursor(uint8_t x, uint8_t y); private: I2C_HandleTypeDef m_handle; uint16_t m_displayAddr; bool m_backlight{}; bool m_cursor{}; bool m_cursorBlink{}; bool m_incrementDecrement{}; bool m_autoShift{}; bool m_powered; uint8_t m_posx, m_posy; void m_lcdSendData(char data); void m_lcdSendCmnd(char cmnd); }; } // floatpump #endif //FLOATPUMP_LCD_I2C_DRIVER_H