|
SegLCDLib
|
LCM88128 LCD (HT1621). More...
#include <SegLCD_HT1621_LCM88128.h>
Data Structures | |
| struct | AddressMapping |
| struct | FlagBit |
Public Types | |
| enum | UnitFlags : uint32_t { UNIT_LEFT_KILO_PREFIX = (1UL << 0) , UNIT_LEFT_HZ = (1UL << 1) , UNIT_LEFT_WATT = (1UL << 2) , UNIT_LEFT_AMPERE = (1UL << 3) , UNIT_LEFT_VOLT = (1UL << 4) , UNIT_LEFT_DEGREE_SLASH = (1UL << 5) , UNIT_LEFT_DEGREE = (1UL << 6) , UNIT_LEFT_CELSIUS = (1UL << 7) , UNIT_LEFT_PERCENT = UNIT_LEFT_DEGREE_SLASH | UNIT_LEFT_DEGREE , UNIT_LEFT_DEGREE_CELSIUS = UNIT_LEFT_DEGREE | UNIT_LEFT_CELSIUS , UNIT_CENTER_HOUR = (1UL << 8) , UNIT_CENTER_MINUTE = (1UL << 9) , UNIT_RIGHT_KILO_PREFIX = (1UL << 10) , UNIT_RIGHT_HZ = (1UL << 11) , UNIT_RIGHT_WATT = (1UL << 12) , UNIT_RIGHT_AMPERE = (1UL << 13) , UNIT_RIGHT_VOLT = (1UL << 14) , UNIT_RIGHT_PERCENT = (1UL << 15) } |
| enum | LabelFlags : uint32_t { LABEL_AC = (1UL << 0) , LABEL_PV = (1UL << 1) , LABEL_INV = (1UL << 2) , LABEL_INPUT = (1UL << 3) , LABEL_LEFT_BATT = (1UL << 4) , LABEL_WP = (1UL << 5) , LABEL_TEMP = (1UL << 6) , LABEL_OUTPUT = (1UL << 7) , LABEL_RIGHT_BATT = (1UL << 8) , LABEL_LOAD = (1UL << 9) , LABEL_ERROR = (1UL << 10) , LABEL_OVERLOAD = (1UL << 11) , LABEL_BYPASS = (1UL << 12) , LABEL_BATT_SLA = (1UL << 13) , LABEL_BATT_LI = (1UL << 14) , LABEL_ECO = (1UL << 15) , LABEL_P = (1UL << 17) , LABEL_CHARGING = (1UL << 18) } |
| enum | SymbolFlags : uint32_t { SYMBOL_CLOCK = (1UL << 0) , SYMBOL_MAINTENANCE = (1UL << 1) , SYMBOL_WARNING_TRIANGLE = (1UL << 2) , SYMBOL_UNDERLINES = (1UL << 3) , SYMBOL_MUTE = (1UL << 4) , SYMBOL_CENTER_FRAME = (1UL << 5) , SYMBOL_BULB = (1UL << 6) , SYMBOL_LINE_DCAC_TO_LOAD = (1UL << 7) , SYMBOL_LINE_ACDC_TO_DCAC = (1UL << 8) , SYMBOL_LINE_ACDC_TO_BATT = (1UL << 9) , SYMBOL_LINE_BATT_TO_DCAC = (1UL << 10) , SYMBOL_LINE_AC_TO_LOAD = (1UL << 11) , SYMBOL_DC_AC_SYMBOL = (1UL << 12) , SYMBOL_LINE_PV_TO_ACDC = (1UL << 13) , SYMBOL_AC_DC_SYMBOL = (1UL << 14) , SYMBOL_LINE_WIND_TO_ACDC = (1UL << 15) , SYMBOL_LINE_AC_TO_ACDC = (1UL << 16) , SYMBOL_AC_SYMBOL = (1UL << 17) , SYMBOL_WIND = (1UL << 18) } |
Public Types inherited from SegLCDLib | |
| enum | BacklightMode { BACKLIGHT_DIGITAL , BACKLIGHT_PWM } |
| Backlight mode for GPIO control. More... | |
Public Member Functions | |
| SegLCD_HT1621_LCM88128 (uint8_t chipselect, uint8_t data, uint8_t write, uint8_t read=-1) | |
| void | init () override |
| Initialize GPIO pins for communication. | |
| void | setBatteryLevel (uint8_t level) |
| void | setLoadLevel (uint8_t level) |
| void | setPVLevel (uint8_t level) |
| void | setUnits (uint32_t units) |
| void | clearUnits (uint32_t units) |
| void | setLabels (uint32_t labels) |
| void | clearLabels (uint32_t labels) |
| void | setSymbols (uint32_t symbols) |
| void | clearSymbols (uint32_t symbols) |
| void | setClockSymbol (bool state, uint8_t index=0) |
| void | setMaintenanceSymbol (bool state, uint8_t index=0) |
| void | setWarningSymbol (bool state, uint8_t index=0) |
| void | setMuteSymbol (bool state, uint8_t index=0) |
| size_t | write (uint8_t ch) override |
Public Member Functions inherited from SegDriver_HT1621 | |
| SegDriver_HT1621 (uint8_t chipselect, uint8_t data, uint8_t write, uint8_t read=-1) | |
| Constructor for HT1621 segment driver. | |
| void | clear () override |
| Clear all visible segments on the display. | |
| void | flush (uint8_t startAddr, uint8_t length) override |
| Flush specific range of buffered changes to the display. | |
| virtual void | flush () |
| Flush all buffered changes to the display. | |
| virtual void | flush (uint8_t startAddr, uint8_t length) |
| Flush specific range of buffered changes to the display. | |
Public Member Functions inherited from SegDriver_3Wire | |
| SegDriver_3Wire (uint8_t chipselect, uint8_t data, uint8_t write, uint8_t read=-1) | |
| Constructor for 3-wire serial LCD driver. | |
| void | on () override |
| Turn the display on. | |
| void | off () override |
| Turn the display off. | |
| void | command (uint8_t command) override |
| Send command to the controller. | |
Public Member Functions inherited from SegLCDLib | |
| virtual | ~SegLCDLib () |
| Virtual destructor to ensure proper cleanup in derived classes. | |
| void | home () |
| Set cursor to 0, 0 without clear display. | |
| virtual void | setCursor (uint8_t row, uint8_t col) |
| Set cursor on exact digit. | |
| void | initBacklight (int8_t backlightPin, BacklightMode backlightMode=BACKLIGHT_DIGITAL, bool backlightActiveHigh=true) |
| Initialize GPIO backlight control. | |
| virtual void | setBacklight (bool state) |
| Set backlight state (on/off). | |
| virtual void | setBacklight (int brightness) |
| Set backlight brightness (0-255). | |
| void | setAutoFlush (bool enable) |
| Enable or disable autoflush mode. | |
| bool | getAutoFlush () const |
| Get current autoflush state. | |
| const uint8_t * | getRamBuffer () const |
| Get pointer to internal RAM buffer (read-only). | |
| size_t | getRamBufferSize () const |
| Get size of internal RAM buffer in bytes. | |
Private Member Functions | |
| void | _setDecimal (uint8_t row, uint8_t col, bool state) override |
| Virtual method for setting decimal point. | |
| void | _updateUnits (uint32_t units, bool set) |
| void | _updateLabels (uint32_t labels, bool set) |
| void | _updateSymbols (uint32_t symbols, bool set) |
| uint8_t | _mapSegments (uint8_t val) |
Static Private Member Functions | |
| static const AddressMapping * | _getUnitMap (size_t &count) |
| static const AddressMapping * | _getLabelMap (size_t &count) |
| static const AddressMapping * | _getSymbolMap (size_t &count) |
Static Private Attributes | |
| static constexpr uint8_t | UNIT_BIT_LEFT_KILO_PREFIX = 0x01 |
| static constexpr uint8_t | UNIT_BIT_LEFT_HZ = 0x01 |
| static constexpr uint8_t | UNIT_BIT_LEFT_WATT = 0x80 |
| static constexpr uint8_t | UNIT_BIT_LEFT_AMPERE = 0x40 |
| static constexpr uint8_t | UNIT_BIT_LEFT_VOLT = 0x20 |
| static constexpr uint8_t | UNIT_BIT_LEFT_DEGREE_SLASH = 0x10 |
| static constexpr uint8_t | UNIT_BIT_LEFT_DEGREE = 0x02 |
| static constexpr uint8_t | UNIT_BIT_LEFT_CELSIUS = 0x01 |
| static constexpr uint8_t | UNIT_BIT_CENTER_HOUR = 0x08 |
| static constexpr uint8_t | UNIT_BIT_CENTER_MINUTE = 0x04 |
| static constexpr uint8_t | UNIT_BIT_LEFT_PERCENT = UNIT_BIT_LEFT_DEGREE_SLASH | UNIT_BIT_LEFT_DEGREE |
| static constexpr uint8_t | UNIT_BIT_LEFT_DEG_CELSIUS = UNIT_BIT_LEFT_DEGREE | UNIT_BIT_LEFT_CELSIUS |
| static constexpr uint8_t | UNIT_BIT_RIGHT_KILO_PREFIX = 0x01 |
| static constexpr uint8_t | UNIT_BIT_RIGHT_HZ = 0x01 |
| static constexpr uint8_t | UNIT_BIT_RIGHT_WATT = 0x80 |
| static constexpr uint8_t | UNIT_BIT_RIGHT_AMPERE = 0x40 |
| static constexpr uint8_t | UNIT_BIT_RIGHT_VOLT = 0x20 |
| static constexpr uint8_t | UNIT_BIT_RIGHT_PERCENT = 0x10 |
| static constexpr uint8_t | LABEL_BIT_TEMP = 0x02 |
| static constexpr uint8_t | LABEL_BIT_AC = 0x40 |
| static constexpr uint8_t | LABEL_BIT_PV = 0x20 |
| static constexpr uint8_t | LABEL_BIT_INV = 0x10 |
| static constexpr uint8_t | LABEL_BIT_INPUT = 0x08 |
| static constexpr uint8_t | LABEL_BIT_LEFT_BATT = 0x04 |
| static constexpr uint8_t | LABEL_BIT_WP = 0x80 |
| static constexpr uint8_t | LABEL_BIT_OUTPUT = 0x08 |
| static constexpr uint8_t | LABEL_BIT_RIGHT_BATT = 0x04 |
| static constexpr uint8_t | LABEL_BIT_LOAD = 0x02 |
| static constexpr uint8_t | LABEL_BIT_ERROR = 0x40 |
| static constexpr uint8_t | LABEL_BIT_OVERLOAD = 0x08 |
| static constexpr uint8_t | LABEL_BIT_BYPASS = 0x02 |
| static constexpr uint8_t | LABEL_BIT_BATT_SLA = 0x40 |
| static constexpr uint8_t | LABEL_BIT_BATT_LI = 0x80 |
| static constexpr uint8_t | LABEL_BIT_ECO = 0x01 |
| static constexpr uint8_t | LABEL_BIT_P = 0x10 |
| static constexpr uint8_t | LABEL_BIT_CHARGING = 0x80 |
| static constexpr uint8_t | SYMBOL_BIT_CLOCK = 0x10 |
| static constexpr uint8_t | SYMBOL_BIT_MAINTENANCE = 0x20 |
| static constexpr uint8_t | SYMBOL_BIT_WARNING_TRIANGLE = 0x80 |
| static constexpr uint8_t | SYMBOL_BIT_UNDERLINES = 0x01 |
| static constexpr uint8_t | SYMBOL_BIT_MUTE = 0x04 |
| static constexpr uint8_t | SYMBOL_BIT_CENTER_FRAME = 0x01 |
| static constexpr uint8_t | SYMBOL_BIT_BULB = 0x40 |
| static constexpr uint8_t | SYMBOL_BIT_LINE_DCAC_TO_LOAD = 0x20 |
| static constexpr uint8_t | SYMBOL_BIT_LINE_ACDC_TO_DCAC = 0x02 |
| static constexpr uint8_t | SYMBOL_BIT_LINE_ACDC_TO_BATT = 0x04 |
| static constexpr uint8_t | SYMBOL_BIT_LINE_BATT_TO_DCAC = 0x08 |
| static constexpr uint8_t | SYMBOL_BIT_LINE_AC_TO_LOAD = 0x10 |
| static constexpr uint8_t | SYMBOL_BIT_DC_AC_SYMBOL = 0x20 |
| static constexpr uint8_t | SYMBOL_BIT_LINE_PV_TO_ACDC = 0x10 |
| static constexpr uint8_t | SYMBOL_BIT_AC_DC_SYMBOL = 0x20 |
| static constexpr uint8_t | SYMBOL_BIT_LINE_WIND_TO_ACDC = 0x10 |
| static constexpr uint8_t | SYMBOL_BIT_LINE_AC_TO_ACDC = 0x20 |
| static constexpr uint8_t | SYMBOL_BIT_WIND = 0x40 |
| static constexpr uint8_t | SYMBOL_BIT_AC_SYMBOL = 0x80 |
| static constexpr uint8_t | RAM_SIZE = 16 |
| static constexpr uint8_t | DIGITS = 8 |
| static constexpr uint8_t | DECIMAL_DIGITS [5] = {0, 1, 3, 5, 6} |
| static constexpr uint8_t | DECIMAL_POINT_BIT = 0x01 |
| static constexpr int8_t | DECIMAL_COL_OFFSET = -1 |
| static constexpr uint8_t | MAX_BATTERY_LEVEL = 5 |
| static constexpr uint8_t | BATTERY_MASK = 0x4F |
| static constexpr uint8_t | BATTERY_LEVEL_ADR = 0x1C |
| static constexpr uint8_t | MAX_LOAD_LEVEL = 5 |
| static constexpr uint8_t | LOAD_MASK = 0x8F |
| static constexpr uint8_t | LOAD_LEVEL_ADR = 0x18 |
| static constexpr uint8_t | MAX_PV_LEVEL = 4 |
| static constexpr uint8_t | PV_MASK = 0x0F |
| static constexpr uint8_t | PV_LEVEL_ADR = 0x1E |
Additional Inherited Members | |
Protected Member Functions inherited from SegDriver_HT1621 | |
| void | _setMode (ModeDrive drive=MODE_DRIVE_14, ModeBias bias=MODE_BIAS_13) |
| Set the mode of the display. | |
Protected Member Functions inherited from SegDriver_3Wire | |
| void | _writeRam (uint8_t data, uint8_t address) |
| Write single byte to RAM at specified address. | |
| virtual void | _writeRam (uint8_t *data, size_t length, uint8_t address) |
| Write multiple bytes to RAM starting at specified address. | |
| virtual void | _sendBits (uint16_t data, uint8_t bitCount=8) |
| Send bits to the controller. | |
Protected Member Functions inherited from SegLCDLib | |
| void | _setFlag (uint8_t mask) |
| Set a specific flag bit. | |
| void | _clearFlag (uint8_t mask) |
| Clear a specific flag bit. | |
| bool | _isFlagSet (uint8_t mask) const |
| Check if a specific flag bit is set. | |
| void | _clearAllFlags () |
| Clear all flags. | |
| bool | _dotWrite (uint8_t ch, int8_t minCol, int8_t maxCol, int8_t ramOffset) |
| Write decimal point. | |
| void | _dotClearCur (int8_t minCol, int8_t maxCol) |
| Clear current decimal (overwrite). | |
| void | _colonClearIfNotFlagged (uint8_t ch, uint8_t colonCol, uint8_t colonFlag) |
| Clear colon if its flag is not set. | |
| virtual void | _setColon (uint8_t row, uint8_t col, bool state) |
| Virtual method for setting colon. | |
| void | _allocateBuffer (size_t size) |
| Allocate RAM buffer for display data. | |
| void | _writeRamMasked (uint8_t data, uint8_t address, uint8_t mask=0xFF) |
| Write to display RAM with nibble-aware masking support. | |
| uint8_t | _get_char_value (char ch) |
| Helper method to convert a character to its segment representation. | |
| uint16_t | _get_16char_value (char ch) |
| Helper method to convert a character to its 16-segment representation. | |
Protected Attributes inherited from SegDriver_3Wire | |
| uint8_t | _wr |
| Write clock pin for the display. | |
| uint8_t | _rd |
| Read clock pin for the display. | |
| uint8_t | _data |
| Data pin for the display. | |
| uint8_t | _cs |
| Chip select pin for the display. | |
| uint8_t | _maxAddress |
| Maximum address for this controller. | |
Protected Attributes inherited from SegLCDLib | |
| bool | _autoFlush = true |
| Autoflush mode enabled flag (default: true for LCD API 1.0 compatibility). | |
| int8_t | _backlightPin = -1 |
| Backlight GPIO pin (-1 if disabled) | |
| BacklightMode | _backlightMode = BACKLIGHT_DIGITAL |
| Backlight mode (DIGITAL or PWM) | |
| bool | _backlightActiveHigh = true |
| Backlight active high flag. | |
| uint8_t | _backlightBrightness = 0 |
| Cached backlight brightness. | |
| uint8_t | _displayFlags = 0 |
| LEDC channel for old ESP32 Arduino Core (2.0.x) | |
| uint8_t * | _ramBuffer = nullptr |
| Dynamic RAM buffer for display data (allocated by derived classes). | |
| size_t | _ramBufferSize = 0 |
| Size of allocated RAM buffer in bytes. | |
| uint8_t | _cursorRow = 0 |
| Current Row. | |
| uint8_t | _cursorCol = 0 |
| Current Column. | |
Static Protected Attributes inherited from SegLCDLib | |
| static constexpr uint8_t | FLAG_PENDING_DOT = 0x80 |
| Common flag for decimal handling when RAM offset is 0. | |
LCM88128 LCD (HT1621).
Integrated HT1621 controller, 3-wire serial protocol. Address-compatible with LCM0844 (same digit layout), but different icons/labels/symbols.
| enum SegLCD_HT1621_LCM88128::LabelFlags : uint32_t |
| enum SegLCD_HT1621_LCM88128::SymbolFlags : uint32_t |
| enum SegLCD_HT1621_LCM88128::UnitFlags : uint32_t |
| SegLCD_HT1621_LCM88128::SegLCD_HT1621_LCM88128 | ( | uint8_t | chipselect, |
| uint8_t | data, | ||
| uint8_t | write, | ||
| uint8_t | read = -1 |
||
| ) |
|
inlinestaticprivate |
|
inlinestaticprivate |
|
inlinestaticprivate |
|
private |
|
overrideprivatevirtual |
Virtual method for setting decimal point.
Each LCD has its own implementation with HW specifics. Default implementation is empty (no-op).
Reimplemented from SegLCDLib.
|
private |
|
private |
|
private |
| void SegLCD_HT1621_LCM88128::clearLabels | ( | uint32_t | labels | ) |
| void SegLCD_HT1621_LCM88128::clearSymbols | ( | uint32_t | symbols | ) |
| void SegLCD_HT1621_LCM88128::clearUnits | ( | uint32_t | units | ) |
|
overridevirtual |
Initialize GPIO pins for communication.
Reimplemented from SegDriver_3Wire.
| void SegLCD_HT1621_LCM88128::setBatteryLevel | ( | uint8_t | level | ) |
| void SegLCD_HT1621_LCM88128::setClockSymbol | ( | bool | state, |
| uint8_t | index = 0 |
||
| ) |
| void SegLCD_HT1621_LCM88128::setLabels | ( | uint32_t | labels | ) |
| void SegLCD_HT1621_LCM88128::setLoadLevel | ( | uint8_t | level | ) |
| void SegLCD_HT1621_LCM88128::setMaintenanceSymbol | ( | bool | state, |
| uint8_t | index = 0 |
||
| ) |
| void SegLCD_HT1621_LCM88128::setMuteSymbol | ( | bool | state, |
| uint8_t | index = 0 |
||
| ) |
| void SegLCD_HT1621_LCM88128::setPVLevel | ( | uint8_t | level | ) |
| void SegLCD_HT1621_LCM88128::setSymbols | ( | uint32_t | symbols | ) |
| void SegLCD_HT1621_LCM88128::setUnits | ( | uint32_t | units | ) |
| void SegLCD_HT1621_LCM88128::setWarningSymbol | ( | bool | state, |
| uint8_t | index = 0 |
||
| ) |
|
overridevirtual |
Reimplemented from SegLCDLib.
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |
|
staticconstexprprivate |