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

Multi-zone T1/T2 LCD with clock display (PCF85176). More...

#include <SegLCD_PCF85176_T1T2Lcd.h>

Inheritance diagram for SegLCD_PCF85176_T1T2Lcd:
SegDriver_PCF85176 SegDriver_PCx85 SegLCDLib

Public Types

enum  LabelFlags { LABEL_T1_C_UP = 0x80 , LABEL_T1_C_DOWN = 0x40 , LABEL_T2_C = 0x20 , LABEL_T2_HUM = 0x10 }
 
enum  LabelT1T2Enum { LABEL_T1 = 0x01 , LABEL_T2 = 0x02 }
 
- Public Types inherited from SegDriver_PCx85
enum  ModeStatus { MODE_STATUS_BLANK = 0 , MODE_STATUS_ENABLED = 1 }
 Enable/disable display. More...
 
enum  BlinkFrequency { BLINK_FREQUENCY_OFF = 0 , BLINK_FREQUENCY_1 = 1 , BLINK_FREQUENCY_2 = 2 , BLINK_FREQUENCY_3 = 3 }
 Set blink frequency. More...
 
enum  BlinkMode { BLINK_MODE_NORMAL = 0 , BLINK_MODE_ALTRAM = 1 }
 Set blink mode. More...
 
- Public Types inherited from SegLCDLib
enum  BacklightMode { BACKLIGHT_DIGITAL , BACKLIGHT_PWM }
 Backlight mode for GPIO control. More...
 

Public Member Functions

 SegLCD_PCF85176_T1T2Lcd (TwoWire &i2c, uint8_t address=DEFAULT_PCF85176_I2C_ADDRESS, uint8_t subaddress=DEFAULT_SUBADDRESS)
 
void init () override
 Logical display sections that can be targeted by higher-level rendering logic.
 
void setBatteryLevel (uint8_t value)
 
void setSignalLevel (uint8_t value)
 
void setClockSymbol (bool status, uint8_t index=0)
 
void setLabels (uint8_t labels)
 
void setT1T2Labels (uint8_t t1t2)
 
void clearLabels (uint8_t labels)
 
void clearT1T2Labels (uint8_t t1t2)
 
void setCursor (uint8_t row, uint8_t col) override
 Set cursor on exact digit.
 
size_t write (uint8_t ch) override
 
- Public Member Functions inherited from SegDriver_PCF85176
 SegDriver_PCF85176 (TwoWire &i2c, uint8_t address=DEFAULT_PCF85176_I2C_ADDRESS, uint8_t subaddress=DEFAULT_SUBADDRESS)
 Constructor for PCF85176 segment driver.
 
- Public Member Functions inherited from SegDriver_PCx85
 SegDriver_PCx85 (TwoWire &i2c, uint8_t address, uint8_t subaddress)
 Constructor for PCx85 segment driver.
 
void bankSelect (uint8_t input, uint8_t output)
 Select bank for input and output.
 
void blink (BlinkFrequency blink=BLINK_FREQUENCY_OFF, BlinkMode mode=BLINK_MODE_NORMAL)
 Set blink frequency and mode.
 
void clear () override
 Clear all visible segments on the display.
 
void on () override
 Turn the display on.
 
void off () override
 Turn the display off.
 
void command (uint8_t command) override
 Send RAW command to controller.
 
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 SegLCDLib
virtual ~SegLCDLib ()
 Virtual destructor to ensure proper cleanup in derived classes.
 
void home ()
 Set cursor to 0, 0 without clear display.
 
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 _setDecimal (uint8_t row, uint8_t col, bool state) override
 Virtual method for setting decimal point.
 
uint8_t _mapSegments (uint8_t val)
 

Static Private Attributes

static constexpr uint8_t ADDR_SIGNAL_CLOCK = 0
 
static constexpr uint8_t ADDR_BATT = 2
 
static constexpr uint8_t ADDR_LABELS = 4
 
static constexpr uint8_t ADDR_CLOCK_T1T2_LABELS_SEGS = 6
 
static constexpr uint8_t ADDR_DAY_SEG = 14
 
static constexpr uint8_t ADDR_T1_SEGS = 16
 
static constexpr uint8_t ADDR_T2_SEGS = 24
 
static constexpr uint8_t RAM_SIZE = 16
 
static constexpr uint8_t OFFSET_SIGCLK = 0
 
static constexpr uint8_t OFFSET_BATT = 1
 
static constexpr uint8_t OFFSET_LABELS = 2
 
static constexpr uint8_t OFFSET_CLOCK = 3
 
static constexpr uint8_t OFFSET_DAY = 7
 
static constexpr uint8_t OFFSET_T1 = 8
 
static constexpr uint8_t OFFSET_T2 = 12
 
static constexpr uint8_t FLAG_COLON_CLOCK = 0x01
 
static constexpr uint8_t ROW_CLOCK = 0
 
static constexpr uint8_t ROW_T1 = 1
 
static constexpr uint8_t ROW_T2 = 2
 
static constexpr uint8_t DECIMAL_POINT_BIT = 0x01
 
static constexpr uint8_t DECIMAL_MIN_ROW = 1
 
static constexpr uint8_t DECIMAL_MAX_ROW = 2
 
static constexpr uint8_t DECIMAL_MIN_COL = 0
 
static constexpr uint8_t DECIMAL_MAX_COL = 3
 
static constexpr int8_t DECIMAL_COL_OFFSET = -1
 
static constexpr uint8_t SYMBOL_CLOCK_MASK = 0x04
 
static constexpr uint8_t SYMBOL_T1T2_MASK = 0x01
 
static constexpr uint8_t MAX_BATTERY_LEVEL = 4
 
static constexpr uint8_t BATTERY_MASK = 0xF0
 
static constexpr uint8_t BATTERY_LEVEL_SEG [MAX_BATTERY_LEVEL] = {0x10, 0x80, 0x40, 0x20}
 
static constexpr uint8_t MAX_SIGNAL_LEVEL = 5
 
static constexpr uint8_t SIGNAL_MASK = 0xF8
 
static constexpr uint8_t SIGNAL_LEVEL_BITS [MAX_SIGNAL_LEVEL] = {0x80, 0x40, 0x20, 0x10, 0x08}
 

Additional Inherited Members

- Protected Member Functions inherited from SegDriver_PCx85
void _setMode (ModeStatus status, ModeDrive drive=MODE_DRIVE_14, ModeBias bias=MODE_BIAS_13)
 Set the mode of the display.
 
void _writeRam (uint8_t data, uint8_t address=0) override
 Low-level method to write a single byte to display RAM.
 
void _writeRam (uint8_t *data, size_t length, uint8_t address=0) override
 Low-level method to write a data buffer to display RAM.
 
- 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.
 
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 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 SegDriver_PCx85
static constexpr uint8_t DEFAULT_PCF85176_I2C_ADDRESS = 0x38
 
static constexpr uint8_t DEFAULT_SUBADDRESS = 0x00
 
- 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

Multi-zone T1/T2 LCD with clock display (PCF85176).

3-row display: clock, T1 zone, T2 zone. Signal/battery indicators. I2C interface (SA0 pin sets address, A0-A2 are subaddresses).

See also
examples/PCF85176/T1T2Lcd/T1T2Lcd.ino

Member Enumeration Documentation

◆ LabelFlags

Enumerator
LABEL_T1_C_UP 
LABEL_T1_C_DOWN 
LABEL_T2_C 
LABEL_T2_HUM 

◆ LabelT1T2Enum

Enumerator
LABEL_T1 
LABEL_T2 

Constructor & Destructor Documentation

◆ SegLCD_PCF85176_T1T2Lcd()

SegLCD_PCF85176_T1T2Lcd::SegLCD_PCF85176_T1T2Lcd ( TwoWire &  i2c,
uint8_t  address = DEFAULT_PCF85176_I2C_ADDRESS,
uint8_t  subaddress = DEFAULT_SUBADDRESS 
)

Member Function Documentation

◆ _mapSegments()

uint8_t SegLCD_PCF85176_T1T2Lcd::_mapSegments ( uint8_t  val)
private

◆ _setColon()

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

Virtual method for setting colon.

Default implementation is empty (no-op).

Reimplemented from SegLCDLib.

◆ _setDecimal()

void SegLCD_PCF85176_T1T2Lcd::_setDecimal ( uint8_t  row,
uint8_t  col,
bool  state 
)
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.

◆ clearLabels()

void SegLCD_PCF85176_T1T2Lcd::clearLabels ( uint8_t  labels)

◆ clearT1T2Labels()

void SegLCD_PCF85176_T1T2Lcd::clearT1T2Labels ( uint8_t  t1t2)

◆ init()

void SegLCD_PCF85176_T1T2Lcd::init ( )
overridevirtual

Logical display sections that can be targeted by higher-level rendering logic.

Initialize the display driver, clear display and set position to 0,0.

Reimplemented from SegDriver_PCx85.

◆ setBatteryLevel()

void SegLCD_PCF85176_T1T2Lcd::setBatteryLevel ( uint8_t  value)

◆ setClockSymbol()

void SegLCD_PCF85176_T1T2Lcd::setClockSymbol ( bool  status,
uint8_t  index = 0 
)

◆ setCursor()

void SegLCD_PCF85176_T1T2Lcd::setCursor ( uint8_t  row,
uint8_t  col 
)
overridevirtual

Set cursor on exact digit.

Because LCD API is mainly used for character displays in this segment displays this function will be littlebit confusing. Because most of Segment LCD has only one row, thus this will be like row 0 and column will represent actual digit.

But if there is LCD like T1T2 LCD. Row 0 will be clock part, Row 1 will be T1: part and Row 2 will be T2: part of LCD

Parameters
rowRow, where 0-MAXROWS
colColumn 0-MAXDIGITS in current row

Reimplemented from SegLCDLib.

◆ setLabels()

void SegLCD_PCF85176_T1T2Lcd::setLabels ( uint8_t  labels)

◆ setSignalLevel()

void SegLCD_PCF85176_T1T2Lcd::setSignalLevel ( uint8_t  value)

◆ setT1T2Labels()

void SegLCD_PCF85176_T1T2Lcd::setT1T2Labels ( uint8_t  t1t2)

◆ write()

size_t SegLCD_PCF85176_T1T2Lcd::write ( uint8_t  ch)
overridevirtual

Reimplemented from SegLCDLib.

Field Documentation

◆ ADDR_BATT

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::ADDR_BATT = 2
staticconstexprprivate

◆ ADDR_CLOCK_T1T2_LABELS_SEGS

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::ADDR_CLOCK_T1T2_LABELS_SEGS = 6
staticconstexprprivate

◆ ADDR_DAY_SEG

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::ADDR_DAY_SEG = 14
staticconstexprprivate

◆ ADDR_LABELS

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::ADDR_LABELS = 4
staticconstexprprivate

◆ ADDR_SIGNAL_CLOCK

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::ADDR_SIGNAL_CLOCK = 0
staticconstexprprivate

◆ ADDR_T1_SEGS

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::ADDR_T1_SEGS = 16
staticconstexprprivate

◆ ADDR_T2_SEGS

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::ADDR_T2_SEGS = 24
staticconstexprprivate

◆ BATTERY_LEVEL_SEG

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::BATTERY_LEVEL_SEG[MAX_BATTERY_LEVEL] = {0x10, 0x80, 0x40, 0x20}
staticconstexprprivate

◆ BATTERY_MASK

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::BATTERY_MASK = 0xF0
staticconstexprprivate

◆ DECIMAL_COL_OFFSET

constexpr int8_t SegLCD_PCF85176_T1T2Lcd::DECIMAL_COL_OFFSET = -1
staticconstexprprivate

◆ DECIMAL_MAX_COL

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::DECIMAL_MAX_COL = 3
staticconstexprprivate

◆ DECIMAL_MAX_ROW

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::DECIMAL_MAX_ROW = 2
staticconstexprprivate

◆ DECIMAL_MIN_COL

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::DECIMAL_MIN_COL = 0
staticconstexprprivate

◆ DECIMAL_MIN_ROW

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::DECIMAL_MIN_ROW = 1
staticconstexprprivate

◆ DECIMAL_POINT_BIT

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::DECIMAL_POINT_BIT = 0x01
staticconstexprprivate

◆ FLAG_COLON_CLOCK

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::FLAG_COLON_CLOCK = 0x01
staticconstexprprivate

◆ MAX_BATTERY_LEVEL

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::MAX_BATTERY_LEVEL = 4
staticconstexprprivate

◆ MAX_SIGNAL_LEVEL

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::MAX_SIGNAL_LEVEL = 5
staticconstexprprivate

◆ OFFSET_BATT

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::OFFSET_BATT = 1
staticconstexprprivate

◆ OFFSET_CLOCK

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::OFFSET_CLOCK = 3
staticconstexprprivate

◆ OFFSET_DAY

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::OFFSET_DAY = 7
staticconstexprprivate

◆ OFFSET_LABELS

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::OFFSET_LABELS = 2
staticconstexprprivate

◆ OFFSET_SIGCLK

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::OFFSET_SIGCLK = 0
staticconstexprprivate

◆ OFFSET_T1

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::OFFSET_T1 = 8
staticconstexprprivate

◆ OFFSET_T2

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::OFFSET_T2 = 12
staticconstexprprivate

◆ RAM_SIZE

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::RAM_SIZE = 16
staticconstexprprivate

◆ ROW_CLOCK

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::ROW_CLOCK = 0
staticconstexprprivate

◆ ROW_T1

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::ROW_T1 = 1
staticconstexprprivate

◆ ROW_T2

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::ROW_T2 = 2
staticconstexprprivate

◆ SIGNAL_LEVEL_BITS

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::SIGNAL_LEVEL_BITS[MAX_SIGNAL_LEVEL] = {0x80, 0x40, 0x20, 0x10, 0x08}
staticconstexprprivate

◆ SIGNAL_MASK

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::SIGNAL_MASK = 0xF8
staticconstexprprivate

◆ SYMBOL_CLOCK_MASK

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::SYMBOL_CLOCK_MASK = 0x04
staticconstexprprivate

◆ SYMBOL_T1T2_MASK

constexpr uint8_t SegLCD_PCF85176_T1T2Lcd::SYMBOL_T1T2_MASK = 0x01
staticconstexprprivate

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