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

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

Classes

struct  ssd1306_platform_i2cConfig_t
 

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, ssd1306_platform_i2cConfig_t *cfg)
 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,
ssd1306_platform_i2cConfig_t cfg 
)

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 several platforms busId is not used. 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.
cfgSpecify scl and sda for the platform. If you want to use default pin numbers, please pass -1 for both members.

◆ 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.