#include <i2c_embedded.h>
Class implements i2c software interface for AVR platform
Definition at line 38 of file i2c_embedded.h.
◆ SoftwareI2c()
SoftwareI2c::SoftwareI2c |
( |
int8_t |
scl = -1 , |
|
|
int8_t |
sda = -1 , |
|
|
uint8_t |
sa = 0x00 |
|
) |
| |
|
explicit |
Creates i2c interface instance for SDL Emulation mode
- Parameters
-
scl | pin number to use as clock |
sda | pin number to use as data line |
sa | i2c address of the display (7 bits) |
◆ begin()
void SoftwareI2c::begin |
( |
| ) |
|
Initializes i2c interface
◆ end()
void SoftwareI2c::end |
( |
| ) |
|
◆ receive()
uint8_t SoftwareI2c::receive |
( |
bool |
last = false | ) |
|
Receives byte from remote device
- Parameters
-
last | set to true, if last byte is requested from i2c slave |
- Returns
- byte read from slave device
◆ send()
void SoftwareI2c::send |
( |
uint8_t |
data | ) |
|
Sends byte to slave device
- Parameters
-
◆ sendBuffer()
void SoftwareI2c::sendBuffer |
( |
const uint8_t * |
buffer, |
|
|
uint16_t |
size |
|
) |
| |
Sends bytes to SSD1306 device.
Sends bytes to SSD1306 device. This functions gives ~ 30% performance increase than ssd1306_intf.send.
- Parameters
-
buffer | - bytes to send |
size | - number of bytes to send |
◆ setAddr()
void SoftwareI2c::setAddr |
( |
uint8_t |
addr | ) |
|
|
inline |
Sets i2c address for communication This API is required for some led displays having multiple i2c addresses for different types of data.
- Parameters
-
addr | i2c address to set (7 bits) |
Definition at line 110 of file i2c_embedded.h.
◆ start() [1/2]
void SoftwareI2c::start |
( |
| ) |
|
Starts communication with slave device.
◆ start() [2/2]
void SoftwareI2c::start |
( |
uint8_t |
sa, |
|
|
bool |
read_op = false |
|
) |
| |
Starts communication with slave device.
- Parameters
-
sa | slave address (low 7 bits) |
read_op | set it to true, if read operation is requested, otherwise set it to false |
◆ stop()
void SoftwareI2c::stop |
( |
| ) |
|
Ends communication with slave display.
The documentation for this class was generated from the following file: