LCDGFX LCD display driver  1.1.5
This library is developed to control SSD1306/SSD1325/SSD1327/SSD1331/SSD1351/IL9163/PCD8554 RGB i2c/spi LED displays
SoftwareI2c Class Reference

#include <i2c_embedded.h>

Public Member Functions

 SoftwareI2c (int8_t scl=-1, int8_t sda=-1, uint8_t sa=0x00)
 
void begin ()
 
void end ()
 
void start ()
 
void start (uint8_t sa, bool read_op=false)
 
void stop ()
 
void send (uint8_t data)
 
uint8_t receive (bool last=false)
 
void sendBuffer (const uint8_t *buffer, uint16_t size)
 Sends bytes to SSD1306 device. More...
 
void setAddr (uint8_t addr)
 

Detailed Description

Class implements i2c software interface for AVR platform

Definition at line 38 of file i2c_embedded.h.

Constructor & Destructor Documentation

◆ 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
sclpin number to use as clock
sdapin number to use as data line
sai2c address of the display (7 bits)

Member Function Documentation

◆ begin()

void SoftwareI2c::begin ( )

Initializes i2c interface

◆ end()

void SoftwareI2c::end ( )

Closes i2c interface

◆ receive()

uint8_t SoftwareI2c::receive ( bool  last = false)

Receives byte from remote device

Parameters
lastset 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
data- byte to send

◆ 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
addri2c 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
saslave address (low 7 bits)
read_opset 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: