SegLCDLib
Loading...
Searching...
No Matches
SegLCD_HT1621_LCM59011 Class Reference

LCM59011 LCD (HT1621). More...

#include <SegLCD_HT1621_LCM59011.h>

Inheritance diagram for SegLCD_HT1621_LCM59011:
SegDriver_HT1621 SegDriver_3Wire SegLCDLib

Data Structures

struct  AddressMapping
 
struct  FlagBit
 

Public Types

enum  UnitFlags : uint8_t { UNIT_A = (1 << 0) , UNIT_M = (1 << 1) , UNIT_PERCENT = (1 << 2) , UNIT_H = (1 << 3) }
 
enum  LabelFlags : uint8_t { LABEL_MCB = (1 << 0) }
 
enum  SymbolFlags : uint32_t {
  SYMBOL_WHEEL = (1UL << 0) , SYMBOL_ECO = (1UL << 1) , SYMBOL_UPS = (1UL << 2) , SYMBOL_GSM = (1UL << 3) ,
  SYMBOL_BLUETOOTH = (1UL << 4) , SYMBOL_SUN = (1UL << 5) , SYMBOL_LIGHTNING = (1UL << 6) , SYMBOL_PLUG = (1UL << 7) ,
  SYMBOL_WARNING = (1UL << 8) , SYMBOL_OUTLINE = (1UL << 9)
}
 
- Public Types inherited from SegLCDLib
enum  BacklightMode { BACKLIGHT_DIGITAL , BACKLIGHT_PWM }
 Backlight mode for GPIO control. More...
 

Public Member Functions

 SegLCD_HT1621_LCM59011 (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 setSignalLevel (uint8_t level)
 
void setUnits (uint8_t units)
 
void clearUnits (uint8_t units)
 
void setLabels (uint8_t labels)
 
void clearLabels (uint8_t labels)
 
void setSymbols (uint32_t symbols)
 
void clearSymbols (uint32_t symbols)
 
void setWarningSymbol (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 _setColon (uint8_t row, uint8_t col, bool state) override
 Virtual method for setting colon.
 
void _updateUnits (uint8_t units, bool set)
 
void _updateLabels (uint8_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_getSymbolMap (size_t &count)
 

Static Private Attributes

static constexpr uint8_t RAM_SIZE = 7
 
static constexpr uint8_t DIGITS = 4
 
static constexpr uint8_t COLON_ADDRESS = 0x04
 
static constexpr uint8_t COLON_BIT = 0x80
 
static constexpr uint8_t COLON_COL = 2
 
static constexpr uint8_t FLAG_COLON_DISPLAYED = 0x01
 
static constexpr uint8_t MAX_BATTERY_LEVEL = 6
 
static constexpr uint8_t MAX_SIGNAL_LEVEL = 4
 
static constexpr uint8_t SIGNAL_ADDRESS = 0x08
 
static constexpr uint8_t SIGNAL_MASK = 0x0F
 
static constexpr uint8_t UNIT_BIT_A = 0x80
 
static constexpr uint8_t UNIT_BIT_M = 0x80
 
static constexpr uint8_t UNIT_BIT_PERCENT = 0x10
 
static constexpr uint8_t UNIT_BIT_H = 0x08
 
static constexpr uint8_t LABEL_BIT_MCB = 0x80
 
static constexpr uint8_t SYMBOL_BIT_WHEEL = 0x20
 
static constexpr uint8_t SYMBOL_BIT_ECO = 0x40
 
static constexpr uint8_t SYMBOL_BIT_UPS = 0x80
 
static constexpr uint8_t SYMBOL_BIT_GSM = 0x10
 
static constexpr uint8_t SYMBOL_BIT_BLUETOOTH = 0x20
 
static constexpr uint8_t SYMBOL_BIT_SUN = 0x01
 
static constexpr uint8_t SYMBOL_BIT_LIGHTNING = 0x02
 
static constexpr uint8_t SYMBOL_BIT_PLUG = 0x04
 
static constexpr uint8_t SYMBOL_BIT_WARNING = 0x08
 
static constexpr uint8_t SYMBOL_BIT_OUTLINE = 0x80
 

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 _setDecimal (uint8_t row, uint8_t col, bool state)
 Virtual method for setting decimal point.
 
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.
 

Detailed Description

LCM59011 LCD (HT1621).

4-digit 7-segment display with colon, wifi signal, battery, and misc symbols. Integrated HT1621 controller, 3-wire serial protocol.

Memory map:

  • 0x00: Digit 1 (7seg) + 0x80=MCB label
  • 0x02: Digit 2 (7seg) + 0x80=A unit
  • 0x04: Digit 3 (7seg) + 0x80=Colon between D2-D3
  • 0x06: Digit 4 (7seg) + 0x80=M unit
  • 0x08: wifi1-4, percent, wheel, ECO, UPS
  • 0x0A: battery outline+1+2, H, GSM SIM, BT
  • 0x0C: Sun, Thunder, Plug, Warning, bat5+4+3, lines glyph

Member Enumeration Documentation

◆ LabelFlags

Enumerator
LABEL_MCB 

◆ SymbolFlags

Enumerator
SYMBOL_WHEEL 
SYMBOL_ECO 
SYMBOL_UPS 
SYMBOL_GSM 
SYMBOL_BLUETOOTH 
SYMBOL_SUN 
SYMBOL_LIGHTNING 
SYMBOL_PLUG 
SYMBOL_WARNING 
SYMBOL_OUTLINE 

◆ UnitFlags

Enumerator
UNIT_A 
UNIT_M 
UNIT_PERCENT 
UNIT_H 

Constructor & Destructor Documentation

◆ SegLCD_HT1621_LCM59011()

SegLCD_HT1621_LCM59011::SegLCD_HT1621_LCM59011 ( uint8_t  chipselect,
uint8_t  data,
uint8_t  write,
uint8_t  read = -1 
)

Member Function Documentation

◆ _getSymbolMap()

static const AddressMapping * SegLCD_HT1621_LCM59011::_getSymbolMap ( size_t &  count)
inlinestaticprivate

◆ _getUnitMap()

static const AddressMapping * SegLCD_HT1621_LCM59011::_getUnitMap ( size_t &  count)
inlinestaticprivate

◆ _mapSegments()

uint8_t SegLCD_HT1621_LCM59011::_mapSegments ( uint8_t  val)
private

◆ _setColon()

void SegLCD_HT1621_LCM59011::_setColon ( uint8_t  row,
uint8_t  col,
bool  state 
)
overrideprivatevirtual

Virtual method for setting colon.

Default implementation is empty (no-op).

Reimplemented from SegLCDLib.

◆ _updateLabels()

void SegLCD_HT1621_LCM59011::_updateLabels ( uint8_t  labels,
bool  set 
)
private

◆ _updateSymbols()

void SegLCD_HT1621_LCM59011::_updateSymbols ( uint32_t  symbols,
bool  set 
)
private

◆ _updateUnits()

void SegLCD_HT1621_LCM59011::_updateUnits ( uint8_t  units,
bool  set 
)
private

◆ clearLabels()

void SegLCD_HT1621_LCM59011::clearLabels ( uint8_t  labels)

◆ clearSymbols()

void SegLCD_HT1621_LCM59011::clearSymbols ( uint32_t  symbols)

◆ clearUnits()

void SegLCD_HT1621_LCM59011::clearUnits ( uint8_t  units)

◆ init()

void SegLCD_HT1621_LCM59011::init ( )
overridevirtual

Initialize GPIO pins for communication.

Reimplemented from SegDriver_3Wire.

◆ setBatteryLevel()

void SegLCD_HT1621_LCM59011::setBatteryLevel ( uint8_t  level)

◆ setLabels()

void SegLCD_HT1621_LCM59011::setLabels ( uint8_t  labels)

◆ setSignalLevel()

void SegLCD_HT1621_LCM59011::setSignalLevel ( uint8_t  level)

◆ setSymbols()

void SegLCD_HT1621_LCM59011::setSymbols ( uint32_t  symbols)

◆ setUnits()

void SegLCD_HT1621_LCM59011::setUnits ( uint8_t  units)

◆ setWarningSymbol()

void SegLCD_HT1621_LCM59011::setWarningSymbol ( bool  state,
uint8_t  index = 0 
)

◆ write()

size_t SegLCD_HT1621_LCM59011::write ( uint8_t  ch)
overridevirtual

Reimplemented from SegLCDLib.

Field Documentation

◆ COLON_ADDRESS

constexpr uint8_t SegLCD_HT1621_LCM59011::COLON_ADDRESS = 0x04
staticconstexprprivate

◆ COLON_BIT

constexpr uint8_t SegLCD_HT1621_LCM59011::COLON_BIT = 0x80
staticconstexprprivate

◆ COLON_COL

constexpr uint8_t SegLCD_HT1621_LCM59011::COLON_COL = 2
staticconstexprprivate

◆ DIGITS

constexpr uint8_t SegLCD_HT1621_LCM59011::DIGITS = 4
staticconstexprprivate

◆ FLAG_COLON_DISPLAYED

constexpr uint8_t SegLCD_HT1621_LCM59011::FLAG_COLON_DISPLAYED = 0x01
staticconstexprprivate

◆ LABEL_BIT_MCB

constexpr uint8_t SegLCD_HT1621_LCM59011::LABEL_BIT_MCB = 0x80
staticconstexprprivate

◆ MAX_BATTERY_LEVEL

constexpr uint8_t SegLCD_HT1621_LCM59011::MAX_BATTERY_LEVEL = 6
staticconstexprprivate

◆ MAX_SIGNAL_LEVEL

constexpr uint8_t SegLCD_HT1621_LCM59011::MAX_SIGNAL_LEVEL = 4
staticconstexprprivate

◆ RAM_SIZE

constexpr uint8_t SegLCD_HT1621_LCM59011::RAM_SIZE = 7
staticconstexprprivate

◆ SIGNAL_ADDRESS

constexpr uint8_t SegLCD_HT1621_LCM59011::SIGNAL_ADDRESS = 0x08
staticconstexprprivate

◆ SIGNAL_MASK

constexpr uint8_t SegLCD_HT1621_LCM59011::SIGNAL_MASK = 0x0F
staticconstexprprivate

◆ SYMBOL_BIT_BLUETOOTH

constexpr uint8_t SegLCD_HT1621_LCM59011::SYMBOL_BIT_BLUETOOTH = 0x20
staticconstexprprivate

◆ SYMBOL_BIT_ECO

constexpr uint8_t SegLCD_HT1621_LCM59011::SYMBOL_BIT_ECO = 0x40
staticconstexprprivate

◆ SYMBOL_BIT_GSM

constexpr uint8_t SegLCD_HT1621_LCM59011::SYMBOL_BIT_GSM = 0x10
staticconstexprprivate

◆ SYMBOL_BIT_LIGHTNING

constexpr uint8_t SegLCD_HT1621_LCM59011::SYMBOL_BIT_LIGHTNING = 0x02
staticconstexprprivate

◆ SYMBOL_BIT_OUTLINE

constexpr uint8_t SegLCD_HT1621_LCM59011::SYMBOL_BIT_OUTLINE = 0x80
staticconstexprprivate

◆ SYMBOL_BIT_PLUG

constexpr uint8_t SegLCD_HT1621_LCM59011::SYMBOL_BIT_PLUG = 0x04
staticconstexprprivate

◆ SYMBOL_BIT_SUN

constexpr uint8_t SegLCD_HT1621_LCM59011::SYMBOL_BIT_SUN = 0x01
staticconstexprprivate

◆ SYMBOL_BIT_UPS

constexpr uint8_t SegLCD_HT1621_LCM59011::SYMBOL_BIT_UPS = 0x80
staticconstexprprivate

◆ SYMBOL_BIT_WARNING

constexpr uint8_t SegLCD_HT1621_LCM59011::SYMBOL_BIT_WARNING = 0x08
staticconstexprprivate

◆ SYMBOL_BIT_WHEEL

constexpr uint8_t SegLCD_HT1621_LCM59011::SYMBOL_BIT_WHEEL = 0x20
staticconstexprprivate

◆ UNIT_BIT_A

constexpr uint8_t SegLCD_HT1621_LCM59011::UNIT_BIT_A = 0x80
staticconstexprprivate

◆ UNIT_BIT_H

constexpr uint8_t SegLCD_HT1621_LCM59011::UNIT_BIT_H = 0x08
staticconstexprprivate

◆ UNIT_BIT_M

constexpr uint8_t SegLCD_HT1621_LCM59011::UNIT_BIT_M = 0x80
staticconstexprprivate

◆ UNIT_BIT_PERCENT

constexpr uint8_t SegLCD_HT1621_LCM59011::UNIT_BIT_PERCENT = 0x10
staticconstexprprivate

The documentation for this class was generated from the following files: