SSD1306 OLED display driver  1.4.10
This library is developed to control SSD1306/SSD1331 RGB i2c/spi OLED displays and spi PCD8544 LED display
Functions
LCD Display control functions

Functions

void pcd8544_84x48_init (void)
 Inits 84x48 LED display (based on PCD8544 controller). More...
 
void pcd8544_84x48_spi_init (int8_t rstPin, int8_t cesPin, int8_t dcPin)
 
void sh1106_128x64_init (void)
 Inits 128x64 OLED display (based on SH1106 controller). More...
 
void sh1106_128x64_i2c_init (void)
 Inits 128x64 OLED display over i2c (based on SH1106 controller). More...
 
void sh1106_128x64_spi_init (int8_t rstPin, int8_t cesPin, int8_t dcPin)
 Inits 128x64 OLED display over spi (based on SH1106 controller). More...
 
void ssd1306_128x32_i2c_init (void)
 Inits 128x32 OLED display over i2c (based on SSD1306 controller). More...
 
void ssd1306_128x32_init (void)
 Inits 128x32 OLED display (based on ssd1306 controller). More...
 
void ssd1306_128x64_init (void)
 Inits 128x64 OLED display (based on SSD1306 controller). More...
 
void ssd1306_128x64_i2c_init (void)
 Inits 128x64 OLED display over i2c (based on SSD1306 controller). More...
 
void ssd1306_128x64_i2c_initEx (int8_t scl, int8_t sda, int8_t sa)
 Inits 128x64 OLED display over i2c (based on SSD1306 controller). More...
 
void ssd1306_128x64_spi_init (int8_t rstPin, int8_t cesPin, int8_t dcPin)
 Inits 128x64 OLED display over spi (based on SSD1306 controller). More...
 
void ssd1306_init (void) __attribute__((deprecated))
 Inits 128x64 OLED display over i2c (based on SSD1306 controller). More...
 
void ssd1331_96x64_init (void)
 Inits 96x64 RGB OLED display (based on SSD1331 controller). More...
 
void ssd1331_96x64_spi_init (int8_t rstPin, int8_t cesPin, int8_t dcPin)
 Inits 96x64 RGB OLED display over spi (based on SSD1331 controller). More...
 
void ssd1306_displayOff (void)
 
void ssd1306_displayOn (void)
 
void ssd1306_setContrast (uint8_t contrast)
 
void ssd1306_invertMode (void)
 
void ssd1306_normalMode (void)
 
void ssd1306_flipHorizontal (uint8_t mode)
 performs horizontal flip More...
 
void ssd1306_flipVertical (uint8_t mode)
 performs vertical flip More...
 
uint8_t ssd1306_displayHeight (void)
 
uint8_t ssd1306_displayWidth (void)
 

Detailed Description

Function Documentation

◆ pcd8544_84x48_init()

void pcd8544_84x48_init ( void  )

Inits 84x48 LED display (based on PCD8544 controller).

Inits 84x48 LED display (based on PCD8544 controller). User must init communication interface (i2c, spi) prior to calling this function.

See also
ssd1306_i2cInit()
ssd1306_spiInit()

Definition at line 68 of file pcd8544_84x48.c.

◆ pcd8544_84x48_spi_init()

void pcd8544_84x48_spi_init ( int8_t  rstPin,
int8_t  cesPin,
int8_t  dcPin 
)

Inits 84x48 LED display over spi (based on PCD8544 controller)

Parameters
rstPin- pin controlling LCD reset (-1 if not used)
cesPin- chip enable pin to LCD slave (-1 if not used)
dcPin- data/command pin to control LCD dc (required)

Definition at line 84 of file pcd8544_84x48.c.

◆ sh1106_128x64_i2c_init()

void sh1106_128x64_i2c_init ( void  )

Inits 128x64 OLED display over i2c (based on SH1106 controller).

Inits 128x64 OLED display over i2c (based on SH1106 controller) This function uses hardcoded pins for i2c communication, depending on your hardware. If you use non-standard pins in your project, please perform call ssd1306_i2cInitEx() and sh1106_128x64_init().

Definition at line 88 of file sh1106_128x64.c.

◆ sh1106_128x64_init()

void sh1106_128x64_init ( void  )

Inits 128x64 OLED display (based on SH1106 controller).

Inits 128x64 OLED display (based on SH1106 controller). User must init communication interface (i2c or spi) prior to calling this function.

Definition at line 74 of file sh1106_128x64.c.

◆ sh1106_128x64_spi_init()

void sh1106_128x64_spi_init ( int8_t  rstPin,
int8_t  cesPin,
int8_t  dcPin 
)

Inits 128x64 OLED display over spi (based on SH1106 controller).

Inits 128x64 OLED display over spi (based on SH1106 controller)

Parameters
rstPin- pin controlling LCD reset (-1 if not used)
cesPin- chip enable pin to LCD slave (-1 if not used)
dcPin- data/command pin to control LCD dc (required)

Definition at line 94 of file sh1106_128x64.c.

◆ ssd1306_128x32_i2c_init()

void ssd1306_128x32_i2c_init ( void  )

Inits 128x32 OLED display over i2c (based on SSD1306 controller).

Inits 128x32 OLED display over i2c (based on SSD1306 controller) This function uses hardcoded pins for i2c communication, depending on your hardware. If you use non-standard pins in your project, please perform call ssd1306_i2cInitEx() and ssd1306_128x32_init().

Definition at line 97 of file ssd1306_128x32.c.

◆ ssd1306_128x32_init()

void ssd1306_128x32_init ( void  )

Inits 128x32 OLED display (based on ssd1306 controller).

Inits 128x32 OLED display (based on ssd1306 controller) spi or i2c bus must be initialized prior to calling this function.

See also
ssd1306_i2cInit()
ssd1306_spiInit()

Definition at line 82 of file ssd1306_128x32.c.

◆ ssd1306_128x64_i2c_init()

void ssd1306_128x64_i2c_init ( void  )

Inits 128x64 OLED display over i2c (based on SSD1306 controller).

Inits 128x64 OLED display over i2c (based on SSD1306 controller) This function uses hardcoded pins for i2c communication, depending on your hardware. If you use non-standard pins in your project, please perform call ssd1306_i2cInitEx() and ssd1306_128x64_init(), or you can use ssd1306_128x64_i2c_initEx().

Definition at line 102 of file ssd1306_128x64.c.

◆ ssd1306_128x64_i2c_initEx()

void ssd1306_128x64_i2c_initEx ( int8_t  scl,
int8_t  sda,
int8_t  sa 
)

Inits 128x64 OLED display over i2c (based on SSD1306 controller).

Inits 128x64 OLED display over i2c (based on SSD1306 controller) This function uses hardcoded pins for i2c communication, depending on your hardware.

Parameters
scl- i2c clock pin. Use -1 if you don't need to change default pin number
sda- i2c data pin. Use -1 if you don't need to change default pin number
sa- i2c address of lcd display. Use 0 to leave default
Note
scl and sda parameters depend on used hardware. For many hardware boards these parameters do not have any effect. ESP8266 allows to specify these parameters
scl and sda for Linux systems should be the same, and should contain i2c bus id.

Definition at line 108 of file ssd1306_128x64.c.

◆ ssd1306_128x64_init()

void ssd1306_128x64_init ( void  )

Inits 128x64 OLED display (based on SSD1306 controller).

Inits 128x64 OLED display (based on SSD1306 controller). User must init communication interface (i2c, spi) prior to calling this function.

See also
ssd1306_i2cInit()
ssd1306_spiInit()

Definition at line 88 of file ssd1306_128x64.c.

◆ ssd1306_128x64_spi_init()

void ssd1306_128x64_spi_init ( int8_t  rstPin,
int8_t  cesPin,
int8_t  dcPin 
)

Inits 128x64 OLED display over spi (based on SSD1306 controller).

Inits 128x64 OLED display over spi (based on SSD1306 controller)

Parameters
rstPin- pin controlling LCD reset (-1 if not used)
cesPin- chip enable pin to LCD slave (-1 if not used)
dcPin- data/command pin to control LCD dc (required)

Definition at line 114 of file ssd1306_128x64.c.

◆ ssd1306_displayHeight()

uint8_t ssd1306_displayHeight ( void  )

Returns display height in pixels

Definition at line 45 of file ssd1306.c.

◆ ssd1306_displayOff()

void ssd1306_displayOff ( void  )

Turns off display

Definition at line 87 of file ssd1306.c.

◆ ssd1306_displayOn()

void ssd1306_displayOn ( void  )

Turns on display

Definition at line 93 of file ssd1306.c.

◆ ssd1306_displayWidth()

uint8_t ssd1306_displayWidth ( void  )

Returns display width in pixels

Definition at line 50 of file ssd1306.c.

◆ ssd1306_flipHorizontal()

void ssd1306_flipHorizontal ( uint8_t  mode)

performs horizontal flip

Performs horizontal flip. If you need to turn display by 180 degree, please use both ssd1306_flipHorizontal() and ssd1306_flipVertical().

Parameters
mode- 0 to disable horizontal flip 1 to enable horizontal flip

Definition at line 864 of file ssd1306.c.

◆ ssd1306_flipVertical()

void ssd1306_flipVertical ( uint8_t  mode)

performs vertical flip

Performs vertical flip. If you need to turn display by 180 degree, please use both ssd1306_flipHorizontal() and ssd1306_flipVertical().

Parameters
mode- 0 to disable vertical flip 1 to enable vertical flip

Definition at line 872 of file ssd1306.c.

◆ ssd1306_init()

void ssd1306_init ( void  )

Inits 128x64 OLED display over i2c (based on SSD1306 controller).

Inits 128x64 OLED display over i2c (based on SSD1306 controller) This function uses hardcoded pins for i2c communication, depending on your hardware. If you use non-standard pins in your project, please perform call ssd1306_i2cInitEx() and ssd1306_128x64_init(), or you can use ssd1306_128x64_i2c_initEx().

Definition at line 82 of file ssd1306_128x64.c.

◆ ssd1306_invertMode()

void ssd1306_invertMode ( void  )

Switches display to inverse mode. LCD will display 0-pixels as white, and 1-pixels as black.

Note
Not supported for SSD1331

Definition at line 848 of file ssd1306.c.

◆ ssd1306_normalMode()

void ssd1306_normalMode ( void  )

Switches display to normal mode.

Note
Not supported for SSD1331

Definition at line 856 of file ssd1306.c.

◆ ssd1306_setContrast()

void ssd1306_setContrast ( uint8_t  contrast)

Set display contrast, ie light intensity

Parameters
contrast- contrast value to see, refer to ssd1306 datasheet

Definition at line 98 of file ssd1306.c.

◆ ssd1331_96x64_init()

void ssd1331_96x64_init ( void  )

Inits 96x64 RGB OLED display (based on SSD1331 controller).

Inits 96x64 RGB OLED display (based on SSD1331 controller). User must init communication interface (i2c, spi) prior to calling this function.

See also
ssd1306_i2cInit()
ssd1306_spiInit()

Definition at line 107 of file ssd1331_96x64.c.

◆ ssd1331_96x64_spi_init()

void ssd1331_96x64_spi_init ( int8_t  rstPin,
int8_t  cesPin,
int8_t  dcPin 
)

Inits 96x64 RGB OLED display over spi (based on SSD1331 controller).

Inits 96x64 RGB OLED display over spi (based on SSD1331 controller)

Parameters
rstPin- pin controlling LCD reset (-1 if not used)
cesPin- chip enable pin to LCD slave (-1 if not used)
dcPin- data/command pin to control LCD dc (required)

Definition at line 121 of file ssd1331_96x64.c.