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

HT1622 LCD segment display driver. More...

#include <SegDriver_HT1622.h>

Inheritance diagram for SegDriver_HT1622:
SegDriver_3Wire SegLCDLib SegLCD_HT1622_10Dig16Seg SegLCD_HT1622_Raw

Public Member Functions

 SegDriver_HT1622 (uint8_t chipselect, uint8_t data, uint8_t write, uint8_t read=-1)
 Constructor for HT1622 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 init () override
 Initialize GPIO pins for communication.
 
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.
 
virtual size_t write (uint8_t ch)
 
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.
 

Protected Member Functions

void _writeRam (uint8_t data, uint8_t address=0)
 Override _writeRam to implement HT1622-specific timing requirements.
 
void _writeRam (uint8_t *data, size_t length, uint8_t address=0) override
 Write multiple bytes to RAM starting at specified address.
 
void _sendBits (uint16_t data, uint8_t bitCount=8) override
 Override _sendBits to implement HT1622-specific timing requirements.
 
- 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.
 
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.
 

Additional Inherited Members

- Public Types inherited from SegLCDLib
enum  BacklightMode { BACKLIGHT_DIGITAL , BACKLIGHT_PWM }
 Backlight mode for GPIO control. More...
 
- 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

HT1622 LCD segment display driver.

This driver extends the 3-wire base driver with HT1622-specific features and stricter timing requirements.

Constructor & Destructor Documentation

◆ SegDriver_HT1622()

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

Constructor for HT1622 segment driver.

Parameters
chipselectChip select pin for the display
dataData pin for the display
writeWrite clock pin for the display
readRead clock pin for the display (optional, default is -1)

Member Function Documentation

◆ _sendBits()

void SegDriver_HT1622::_sendBits ( uint16_t  data,
uint8_t  bitCount = 8 
)
overrideprotectedvirtual

Override _sendBits to implement HT1622-specific timing requirements.

Reimplemented from SegDriver_3Wire.

◆ _writeRam() [1/2]

void SegDriver_HT1622::_writeRam ( uint8_t *  data,
size_t  length,
uint8_t  address = 0 
)
overrideprotectedvirtual

Write multiple bytes to RAM starting at specified address.

Parameters
dataPointer to data array
lengthNumber of bytes to write
addressStarting RAM address (0-based)

Reimplemented from SegDriver_3Wire.

◆ _writeRam() [2/2]

void SegDriver_HT1622::_writeRam ( uint8_t  data,
uint8_t  address = 0 
)
protectedvirtual

Override _writeRam to implement HT1622-specific timing requirements.

Reimplemented from SegDriver_3Wire.

◆ clear()

void SegDriver_HT1622::clear ( )
overridevirtual

Clear all visible segments on the display.

Reimplemented from SegLCDLib.

◆ flush() [1/3]

void SegLCDLib::flush ( )
virtual

Flush all buffered changes to the display.

Writes the entire display buffer to the hardware. This is useful when autoflush is disabled to batch multiple write() calls into a single hardware update cycle.

Safe to call even when autoflush is enabled (no effect).

See also
setAutoFlush()

Reimplemented from SegLCDLib.

◆ flush() [2/3]

void SegLCDLib::flush ( uint8_t  startAddr,
uint8_t  length 
)
virtual

Flush specific range of buffered changes to the display.

Writes a specific address range from the display buffer to hardware. This is an advanced API for optimizing updates when only part of the display needs to be refreshed.

For example, to update only the first row of a multi-row display:

lcd.flush(0, 6); // Update first 6 bytes (row 0)

Safe to call even when autoflush is enabled (no effect).

Parameters
startAddrStarting buffer address in bytes (RAM buffer index)
lengthNumber of bytes to flush
See also
setAutoFlush()

Reimplemented from SegLCDLib.

◆ flush() [3/3]

void SegDriver_HT1622::flush ( uint8_t  startAddr,
uint8_t  length 
)
overridevirtual

Flush specific range of buffered changes to the display.

Optimized implementation for HT1622 that loops through each address since the 3-wire protocol doesn't support bulk write.

Parameters
startAddrStarting buffer address in bytes (RAM buffer index)
lengthNumber of bytes to flush

Reimplemented from SegLCDLib.


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