37#define SBK_HT16K33_IS_DEFINED
43#define HT16K33_CMD_RAM 0x00
44#define HT16K33_CMD_KEYS 0x40
45#define HT16K33_CMD_SETUP 0x80
46#define HT16K33_CMD_ROWINT 0xA0
47#define HT16K33_CMD_DIMMING 0xE0
49#define HT16K33_DISPLAY_OFF 0x00
50#define HT16K33_DISPLAY_ON 0x01
51#define HT16K33_BLINK_OFF 0x00
52#define HT16K33_BLINK_1HZ 0x02
53#define HT16K33_BLINK_2HZ 0x04
54#define HT16K33_BLINK_0HZ5 0x06
92 if (devIdx >= 8 || (rowsCount != 8 && rowsCount != 12 && rowsCount != 16))
95 _maxRows[devIdx] = rowsCount;
114 uint8_t
maxRows(uint8_t devIdx)
const {
return _maxRows[devIdx]; }
156 uint8_t
setAddress(uint8_t devIdx, uint8_t addr);
171 void clear(uint8_t devIdx);
224 void setLed(uint8_t devIdx, uint8_t rowIdx, uint8_t colIdx,
bool state);
241 bool getLed(uint8_t devIdx, uint8_t rowIdx, uint8_t colIdx)
const;
253 void show(uint8_t devIdx);
264 uint8_t _devsNum = 1;
265 uint8_t _i2c_addr[8];
268 static constexpr uint8_t _defaultRowBufferSize = 8;
269 static constexpr uint8_t _defaultColBufferSize = 8;
271 void _write(uint8_t devIdx);
272 inline uint8_t _colIndex(uint8_t devIdx, uint8_t colIdx)
const;
uint8_t maxRows(uint8_t devIdx) const
Returns the number of active row lines (anode outputs) for a specific HT16K33 device.
Definition SBK_HT16K33.h:114
uint8_t maxSegments(uint8_t devIdx) const
Returns the total number of addressable LED segments for the specified device.
Definition SBK_HT16K33.h:144
void setLed(uint8_t devIdx, uint8_t rowIdx, uint8_t colIdx, bool state)
Set the state of an individual LED for a specific device.
Definition SBK_HT16K33.cpp:126
void setBrightness(uint8_t devIdx, uint8_t brightness)
Set the brightness level (0–15) for a specific device.
Definition SBK_HT16K33.cpp:103
SBK_HT16K33(uint8_t devsNum=1)
Construct a new SBK_HT16K33 instance.
Definition SBK_HT16K33.cpp:23
~SBK_HT16K33()
Destructor. Frees allocated buffer memory.
Definition SBK_HT16K33.cpp:34
uint8_t setAddress(uint8_t devIdx, uint8_t addr)
Set the I2C address for a specific HT16K33 device.
Definition SBK_HT16K33.cpp:43
void setDriverRows(uint8_t devIdx, uint8_t rowsCount=8)
Set the number of active rows (anode outputs) for a specific HT16K33 device.
Definition SBK_HT16K33.h:90
uint8_t devsNum() const
Returns the number of active HT16K33 devices managed by this driver instance.
Definition SBK_HT16K33.h:207
bool getLed(uint8_t devIdx, uint8_t rowIdx, uint8_t colIdx) const
Get the current state of an LED from the internal display buffer.
Definition SBK_HT16K33.cpp:148
uint8_t maxColumns() const
Returns the number of active column lines (cathode outputs = C0–C7) configured for this instance.
Definition SBK_HT16K33.h:124
void clear()
Clear the display buffers for all devices.
Definition SBK_HT16K33.cpp:94
void begin()
Initialize the HT16K33 device at a given I2C address.
Definition SBK_HT16K33.cpp:52
void show()
Push the internal display buffer to all devices.
Definition SBK_HT16K33.cpp:180