AceSegment
0.7.0
A framework for rendering seven segment LED displays using the TM1637, MAX7219, HT16K33, or 74HC595 controller chips
|
A software I2C implementation for sending LED segment patterns over I2C. More...
#include <SimpleWireInterface.h>
Public Member Functions | |
SimpleWireInterface (uint8_t addr, uint8_t dataPin, uint8_t clockPin, uint8_t delayMicros) | |
Constructor. More... | |
void | begin () const |
Initialize the clock and data pins. | |
void | end () const |
Set clock and data pins to INPUT mode. | |
void | beginTransmission () const |
Send start condition. | |
void | endTransmission () const |
Send stop condition. | |
uint8_t | write (uint8_t data) const |
Send the data byte on the data bus, with MSB first as specified by I2C. More... | |
A software I2C implementation for sending LED segment patterns over I2C.
This has the same API has TwoWireInterface so it can be a drop-in replacement.
The implementation is very similar to SoftTmiInterface because the TM1637 protocol is very similar to I2C. To keep everything simple, so the beginTransmission(), write() and endTransimision() methods are blocking calls because interrupts are not used. This means that we can eliminate the send buffer, saving static memory.
Definition at line 43 of file SimpleWireInterface.h.
|
inline |
Constructor.
addr | I2C address of slave device |
dataPin | SDA pin |
clockPin | SCL pin |
delayMicros | delay after each bit transition (full cycle = 2 * delayMicros) |
Definition at line 53 of file SimpleWireInterface.h.
|
inline |
Send the data byte on the data bus, with MSB first as specified by I2C.
Definition at line 108 of file SimpleWireInterface.h.