C++ DevKit
C++ set of OOP library
Loading...
Searching...
No Matches
SSD1306 Class Reference

SSD1306 128x64 pixel OLED display device driver with I2C interface. More...

#include <ssd1306.h>

Inheritance diagram for SSD1306:
Inheritance graph
Collaboration diagram for SSD1306:
Collaboration graph

Public Member Functions

void check_display_device_compatibility (struct_ConfigGraphicWidget framebuffer_cfg, CanvasFormat canvas_format)
 A pure virtual member function. Each device must implement this method and check the compatibility of the widget parameter with the its physical limitations.
 
 SSD1306 (HW_I2C_Master *master, struct_ConfigSSD1306 device_config)
 
void show (Canvas *canvas, const uint8_t anchor_x, const uint8_t anchor_y)
 
virtual void show_render_area (uint8_t *data_buffer, struct_RenderArea screen_area, uint8_t addressing_mode=0)
 when we need to show a render area with a given framebuffer
 
virtual void fill_pattern_and_show_GDDRAM (uint8_t pattern, struct_RenderArea area)
 fill a pattern in the device framebuffer. this make it visible as soon as the device transfer the framebuffer to the pixels. The pattern is a vertical byte representing 8 vertical pixels (refer to MONO_VLSB framebuffer format)
 
void clear_device_screen_buffer ()
 write 0x00 directly into the device framebuffer. Uses fill_pattern_and_show_GDDRAM command.
 
void set_contrast (uint8_t value)
 Set the contrast object. refer to datasheet of SSD1306 device.
 
void set_display_from_RAM ()
 Set the display from RAM object.
 
void set_all_pixel_ON ()
 Set the all pixel ON.
 
void set_inverse_color (bool inverse)
 Set the inverse color object.
 
void set_display_OFF ()
 Set the display OFF object.
 
void set_display_ON ()
 Set the display ON object.
 
void horizontal_scroll (bool on, struct_ConfigScrollSSD1306 scroll_data)
 
void vertical_scroll (bool on, struct_ConfigScrollSSD1306 scroll_data)
 
- Public Member Functions inherited from GraphicDisplayDevice
 GraphicDisplayDevice (size_t screen_width, size_t screen_height)
 Construct a new Display Device object.
 
virtual ~GraphicDisplayDevice ()
 Destroy the Display Device object.
 

Static Public Member Functions

static struct_RenderArea compute_render_area (uint8_t start_col, uint8_t end_col, uint8_t start_line, uint8_t end_line)
 A static member function that converts the area we want to display into device specific parameters.
 

Protected Member Functions

void init ()
 the master init function that calls all others
 
void init_MUX_ratio (uint8_t value)
 refer to SSD1306 data sheet for more details
 
void init_display_vertical_shift (uint8_t value)
 refer to SSD1306 data sheet for more details
 
void init_RAM_start_line (uint8_t value)
 refer to SSD1306 data sheet for more details
 
void init_SEG_scan_inverse_direction (bool inverse)
 refer to SSD1306 data sheet for more details
 
void init_COM_scan_inverse_direction (bool inverse)
 refer to SSD1306 data sheet for more details
 
void init_COM_cfg (bool sequentialCOM, bool enableCOMLRremap)
 refer to SSD1306 data sheet for more details
 
void init_clock_frequency (uint8_t divide_ratio, uint8_t frequency_factor)
 refer to SSD1306 data sheet for more details
 
void init_charge_pump_enabled (bool enabled)
 refer to SSD1306 data sheet for more details
 
void send_cmd (uint8_t cmd)
 refer to SSD1306 data sheet for more details
 
void send_cmd_list (uint8_t *cmd_list, int num)
 refer to SSD1306 data sheet for more details
 

Protected Attributes

HW_I2C_Masteri2c_master
 the I2C master that control the SSD1306 display
 
struct_ConfigSSD1306 device_config
 the SSD1306 device configuration
 

Additional Inherited Members

- Public Attributes inherited from GraphicDisplayDevice
size_t TFT_panel_width_in_pixel
 the physical width of the screen (in pixel)
 
size_t TFT_panel_height_in_pixel
 the physical height of the screen (in pixel)
 

Detailed Description

SSD1306 128x64 pixel OLED display device driver with I2C interface.

Constructor & Destructor Documentation

◆ SSD1306()

SSD1306::SSD1306 ( HW_I2C_Master * master,
struct_ConfigSSD1306 device_config )
Parameters
masterthe I2C master interface driver HW_I2C_Master
device_configthe configuration according to struct_ConfigSSD1306
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ check_display_device_compatibility()

void SSD1306::check_display_device_compatibility ( struct_ConfigGraphicWidget framebuffer_cfg,
CanvasFormat canvas_format )
virtual

A pure virtual member function. Each device must implement this method and check the compatibility of the widget parameter with the its physical limitations.

Parameters
framebuffer_cfgthe widget configuration data
canvas_formatthe format of the canvas

Implements GraphicDisplayDevice.

◆ compute_render_area()

struct_RenderArea SSD1306::compute_render_area ( uint8_t start_col,
uint8_t end_col,
uint8_t start_line,
uint8_t end_line )
static

A static member function that converts the area we want to display into device specific parameters.

Parameters
start_col
end_col
start_line
end_line
Returns
struct_RenderArea
Here is the caller graph for this function:

◆ fill_pattern_and_show_GDDRAM()

void SSD1306::fill_pattern_and_show_GDDRAM ( uint8_t pattern,
struct_RenderArea area )
virtual

fill a pattern in the device framebuffer. this make it visible as soon as the device transfer the framebuffer to the pixels. The pattern is a vertical byte representing 8 vertical pixels (refer to MONO_VLSB framebuffer format)

Bug
// FIXME : PAGE_ADDRESSING_MODE seems misbehave depending on what was executed before
Parameters
patternthe vertical pattern to copy in a set of 8 vertical pixel
areathe location of the area to copy the pattern
Here is the call graph for this function:
Here is the caller graph for this function:

◆ horizontal_scroll()

void SSD1306::horizontal_scroll ( bool on,
struct_ConfigScrollSSD1306 scroll_data )
Parameters
on
scroll_data
Here is the call graph for this function:

◆ init_charge_pump_enabled()

void SSD1306::init_charge_pump_enabled ( bool enabled)
protected

refer to SSD1306 data sheet for more details

Parameters
enabledrefer to SSD1306 data sheet for more details
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_clock_frequency()

void SSD1306::init_clock_frequency ( uint8_t divide_ratio,
uint8_t frequency_factor )
protected

refer to SSD1306 data sheet for more details

Parameters
divide_ratiorefer to SSD1306 data sheet for more details
frequency_factorrefer to SSD1306 data sheet for more details
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_COM_cfg()

void SSD1306::init_COM_cfg ( bool sequentialCOM,
bool enableCOMLRremap )
protected

refer to SSD1306 data sheet for more details

Parameters
sequentialCOMrefer to SSD1306 data sheet for more details
enableCOMLRremaprefer to SSD1306 data sheet for more details
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_COM_scan_inverse_direction()

void SSD1306::init_COM_scan_inverse_direction ( bool inverse)
protected

refer to SSD1306 data sheet for more details

Parameters
inverserefer to SSD1306 data sheet for more details
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_display_vertical_shift()

void SSD1306::init_display_vertical_shift ( uint8_t value)
protected

refer to SSD1306 data sheet for more details

Parameters
valuerefer to SSD1306 data sheet for more details
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_MUX_ratio()

void SSD1306::init_MUX_ratio ( uint8_t value)
protected

refer to SSD1306 data sheet for more details

Parameters
valuerefer to SSD1306 data shhet for more details
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_RAM_start_line()

void SSD1306::init_RAM_start_line ( uint8_t value)
protected

refer to SSD1306 data sheet for more details

Parameters
valuerefer to SSD1306 data sheet for more details
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_SEG_scan_inverse_direction()

void SSD1306::init_SEG_scan_inverse_direction ( bool inverse)
protected

refer to SSD1306 data sheet for more details

Parameters
inverserefer to SSD1306 data sheet for more details
Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_cmd()

void SSD1306::send_cmd ( uint8_t cmd)
protected

refer to SSD1306 data sheet for more details

Parameters
cmdrefer to SSD1306 data sheet for more details
Here is the caller graph for this function:

◆ send_cmd_list()

void SSD1306::send_cmd_list ( uint8_t * cmd_list,
int num )
protected

refer to SSD1306 data sheet for more details

Parameters
cmd_listrefer to SSD1306 data sheet for more details
numrefer to SSD1306 data sheet for more details
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_contrast()

void SSD1306::set_contrast ( uint8_t value)

Set the contrast object. refer to datasheet of SSD1306 device.

Parameters
value
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_inverse_color()

void SSD1306::set_inverse_color ( bool inverse)

Set the inverse color object.

Parameters
inverse
Here is the call graph for this function:
Here is the caller graph for this function:

◆ show()

void SSD1306::show ( Canvas * canvas,
const uint8_t anchor_x,
const uint8_t anchor_y )
virtual
Parameters
canvasa pointer to the Canvas that contains the buffer to be displayed
anchor_xwhere we want to position (x) the frambuffer
anchor_ywhere we want to position (y) the frambuffer

Implements GraphicDisplayDevice.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ show_render_area()

void SSD1306::show_render_area ( uint8_t * data_buffer,
struct_RenderArea screen_area,
uint8_t addressing_mode = 0 )
virtual

when we need to show a render area with a given framebuffer

Parameters
data_buffer
screen_area
addressing_mode

Reimplemented in rtos_SSD1306.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ vertical_scroll()

void SSD1306::vertical_scroll ( bool on,
struct_ConfigScrollSSD1306 scroll_data )
Parameters
on
scroll_data
Here is the call graph for this function:

The documentation for this class was generated from the following files: