Firmware SDK
twr_ssd1306

Driver for SSD1306 Monochrome OLED graphic display. More...

Data Structures

struct  twr_ssd1306_framebuffer_t
 
struct  twr_ssd1306_t
 Instance. More...
 

Macros

#define TWR_SSD1306_ADDRESS_I2C_ADDRESS_DEFAULT   0x3C
 
#define TWR_SSD1306_ADDRESS_I2C_ADDRESS_ALTERNATE   0x3D
 
#define TWR_SSD1306_FRAMEBUFFER(NAME, WIDTH, HEIGHT)
 

Functions

bool twr_ssd1306_init (twr_ssd1306_t *self, twr_i2c_channel_t i2c_channel, uint8_t i2c_address, const twr_ssd1306_framebuffer_t *framebuffer)
 Initialize lcd driver. More...
 
twr_gfx_caps_t twr_ssd1306_get_caps (twr_ssd1306_t *self)
 Get capabilities. More...
 
bool twr_ssd1306_is_ready (twr_ssd1306_t *self)
 Check if lcd is ready for commands. More...
 
void twr_ssd1306_clear (twr_ssd1306_t *self)
 Clear. More...
 
void twr_ssd1306_draw_pixel (twr_ssd1306_t *self, int x, int y, uint32_t color)
 Lcd draw pixel. More...
 
uint32_t twr_ssd1306_get_pixel (twr_ssd1306_t *self, int x, int y)
 Lcd get pixel. More...
 
bool twr_ssd1306_update (twr_ssd1306_t *self)
 Lcd update, send data. More...
 
const twr_gfx_driver_ttwr_ssd1306_get_driver (void)
 Get Lcd driver.
 

Detailed Description

Driver for SSD1306 Monochrome OLED graphic display.

Macro Definition Documentation

◆ TWR_SSD1306_FRAMEBUFFER

#define TWR_SSD1306_FRAMEBUFFER (   NAME,
  WIDTH,
  HEIGHT 
)
Value:
uint8_t NAME##_buffer[WIDTH * HEIGHT / 8]; \
twr_ssd1306_framebuffer_t NAME = { \
.buffer = NAME##_buffer, \
.width = WIDTH, \
.height = HEIGHT, \
.length = sizeof(NAME##_buffer), \
.pages = HEIGHT / 8 \
};

Definition at line 15 of file twr_ssd1306.h.

Function Documentation

◆ twr_ssd1306_clear()

void twr_ssd1306_clear ( twr_ssd1306_t self)

Clear.

Parameters
[in]selfInstance

Definition at line 68 of file twr_ssd1306.c.

Referenced by twr_ssd1306_get_driver().

Here is the caller graph for this function:

◆ twr_ssd1306_draw_pixel()

void twr_ssd1306_draw_pixel ( twr_ssd1306_t self,
int  x,
int  y,
uint32_t  color 
)

Lcd draw pixel.

Parameters
[in]selfInstance
[in]leftPixels from left edge
[in]topPixels from top edge
[in]colorPixels state

Definition at line 73 of file twr_ssd1306.c.

Referenced by twr_ssd1306_get_driver().

Here is the caller graph for this function:

◆ twr_ssd1306_get_caps()

twr_gfx_caps_t twr_ssd1306_get_caps ( twr_ssd1306_t self)

Get capabilities.

Parameters
[in]selfInstance

Definition at line 51 of file twr_ssd1306.c.

Referenced by twr_ssd1306_get_driver().

Here is the caller graph for this function:

◆ twr_ssd1306_get_pixel()

uint32_t twr_ssd1306_get_pixel ( twr_ssd1306_t self,
int  x,
int  y 
)

Lcd get pixel.

Parameters
[in]selfInstance
[in]leftPixels from left edge
[in]topPixels from top edge
[in]colorPixels state

Definition at line 94 of file twr_ssd1306.c.

Referenced by twr_ssd1306_get_driver().

Here is the caller graph for this function:

◆ twr_ssd1306_init()

bool twr_ssd1306_init ( twr_ssd1306_t self,
twr_i2c_channel_t  i2c_channel,
uint8_t  i2c_address,
const twr_ssd1306_framebuffer_t framebuffer 
)

Initialize lcd driver.

Parameters
[in]selfInstance
[in]i2c_channelI2C channel
[in]i2c_addressI2C device address
[in]framebuffer

Definition at line 34 of file twr_ssd1306.c.

Here is the call graph for this function:

◆ twr_ssd1306_is_ready()

bool twr_ssd1306_is_ready ( twr_ssd1306_t self)

Check if lcd is ready for commands.

Parameters
[in]selfInstance
Returns
true If ready
false If not ready

Definition at line 58 of file twr_ssd1306.c.

Referenced by twr_ssd1306_get_driver().

Here is the caller graph for this function:

◆ twr_ssd1306_update()

bool twr_ssd1306_update ( twr_ssd1306_t self)

Lcd update, send data.

Parameters
[in]selfInstance
Returns
true On success
false On failure

Definition at line 103 of file twr_ssd1306.c.

Referenced by twr_ssd1306_get_driver().

Here is the caller graph for this function: