Class implements i2c software interface for AVR platform.
More...
#include <i2c_embedded.h>
|
| | SoftwareI2c (int8_t scl=-1, int8_t sda=-1, uint8_t sa=0x00) |
| | Creates i2c interface instance for SDL Emulation mode. More...
|
| |
|
void | begin () |
| | Initializes i2c interface.
|
| |
|
void | end () |
| | Closes i2c interface.
|
| |
|
void | start () |
| | Starts communication with slave device.
|
| |
| void | start (uint8_t sa, bool read_op=false) |
| | Starts communication with slave device. More...
|
| |
|
void | stop () |
| | Ends communication with slave display.
|
| |
| void | send (uint8_t data) |
| | Sends byte to slave device. More...
|
| |
| uint8_t | receive (bool last=false) |
| | Receives byte from remote device. More...
|
| |
| void | sendBuffer (const uint8_t *buffer, uint16_t size) |
| | Sends bytes to SSD1306 device. More...
|
| |
| void | setAddr (uint8_t addr) |
| | Sets i2c address for communication This API is required for some led displays having multiple i2c addresses for different types of data. More...
|
| |
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) |
◆ 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()
| 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 |
The documentation for this class was generated from the following file: