#include <esp32_i2c.h>
|
| EspI2c (int8_t busId=-1, uint8_t sa=0x00, int8_t scl=-1, int8_t sda=-1, uint32_t frequency=400000) |
|
void | begin () |
|
void | end () |
|
void | start () |
|
void | stop () |
|
void | send (uint8_t data) |
|
void | sendBuffer (const uint8_t *buffer, uint16_t size) |
| Sends bytes to SSD1306 device. More...
|
|
void | setAddr (uint8_t addr) |
|
Class implements I2c interface for ESP32 controllers
Definition at line 39 of file esp32_i2c.h.
◆ EspI2c()
EspI2c::EspI2c |
( |
int8_t |
busId = -1 , |
|
|
uint8_t |
sa = 0x00 , |
|
|
int8_t |
scl = -1 , |
|
|
int8_t |
sda = -1 , |
|
|
uint32_t |
frequency = 400000 |
|
) |
| |
|
explicit |
Creates instance of I2C interface for ESP32 controllers.
- Parameters
-
busId | bus number to use, -1 defaults to I2C_NUM_1 |
sa | address to use for oled device (7-bits, highest bit should be 0) |
scl | pin number to use as SCL pin, or -1 if default is used |
sda | pin number to use as SDA pin, or -1 if default is used |
frequency | frequency in HZ to run i2c bus on, defaults to 400kHz |
◆ begin()
Initializes i2c interface
◆ end()
◆ send()
void EspI2c::send |
( |
uint8_t |
data | ) |
|
Sends byte to SSD1306 device
- Parameters
-
◆ sendBuffer()
void EspI2c::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 EspI2c::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 98 of file esp32_i2c.h.
◆ start()
Starts communication with SSD1306 display.
◆ stop()
Ends communication with SSD1306 display.
The documentation for this class was generated from the following file: