SSD1306 OLED display driver  1.7.12
This library is developed to control SSD1306/SSD1331/SSD1351/IL9163/PCD8554 RGB i2c/spi LED displays
Macros | Typedefs | Functions
HAL: ssd1306 library hardware abstraction layer

i2c/spi ssd1306 library hardware abstraction layer More...

Macros

#define LCDINT_TYPES_DEFINED
 
#define ssd1306_swap_data(a, b, type)   { type t = a; a = b; b = t; }
 

Typedefs

typedef int lcdint_t
 
typedef unsigned int lcduint_t
 

Functions

void ssd1306_platform_i2cInit (int8_t busId, uint8_t addr, int8_t arg)
 Initializes i2c interface for platform being used. More...
 
void ssd1306_platform_spiInit (int8_t busId, int8_t cesPin, int8_t dcPin)
 Initializes spi interface for platform being used. More...
 

Detailed Description

i2c/spi ssd1306 library hardware abstraction layer

ssd1306 library hardware abstraction layer

Macro Definition Documentation

◆ LCDINT_TYPES_DEFINED

#define LCDINT_TYPES_DEFINED

Macro informs if lcdint_t type is defined

Definition at line 61 of file io.h.

◆ ssd1306_swap_data

#define ssd1306_swap_data (   a,
  b,
  type 
)    { type t = a; a = b; b = t; }

swaps content of a and b variables of type type

Definition at line 69 of file io.h.

Typedef Documentation

◆ lcdint_t

typedef int lcdint_t

internal int type, used by ssd1306 library. Important for uC with low SRAM

Definition at line 63 of file io.h.

◆ lcduint_t

typedef unsigned int lcduint_t

internal int type, used by ssd1306 library. Important for uC with low SRAM

Definition at line 65 of file io.h.

Function Documentation

◆ ssd1306_platform_i2cInit()

void ssd1306_platform_i2cInit ( int8_t  busId,
uint8_t  addr,
int8_t  arg 
)

Initializes i2c interface for platform being used.

Initializes i2c interface for platform being used. i2c implementation depends on platform.

Parameters
busIdi2c bus number. Some platforms have several i2c buses. so, this argument identifies bus to use. For AVR platforms busId is used as scl pin number. If you want to use default i2c bus for specific platform, please pass -1.
addri2c address of oled driver, connected to i2c bus. If you want to use default i2c display address, please, pass 0.
argadditional parameter for i2c interface. Not used on many platforms, while for AVR it is used as sda pin number. If you want to use default pin number, please pass -1.

◆ ssd1306_platform_spiInit()

void ssd1306_platform_spiInit ( int8_t  busId,
int8_t  cesPin,
int8_t  dcPin 
)

Initializes spi interface for platform being used.

Initializes spi interface for platform being used. spi implementation depends on platform.

Parameters
busIdspi bus number if device has several spi buses. For most AVR platforms busId is not used. If you want to use default spi bus for specific platform, please pass -1.
cesPinchip select (chip enable) pin number. If you want to use default pin, hard coded by ssd1306 library, please, pass -1. For Linux platform cesPin means second number in spidev device.
dcPindata/command pin number. For most oled displays this pin number is used to select data or command mode for the bus. If you want to use default pin number, please pass -1.