14#include "pico/stdlib.h"
21#define _2_FRAMES 0b111
23#define _3_FRAMES 0b100
25#define _4_FRAMES 0b101
27#define _5_FRAMES 0b000
29#define _25_FRAMES 0b110
31#define _64_FRAMES 0b001
33#define _128_FRAMES 0b010
35#define _256_FRAMES 0b011
39#define HORIZONTAL_ADDRESSING_MODE 0
41#define VERTICAL_ADDRESSING_MODE 1
43#define PAGE_ADDRESSING_MODE 2
151 void init_COM_cfg(
bool sequentialCOM,
bool enableCOMLRremap);
197 void show(
Canvas *canvas,
const uint8_t anchor_x,
const uint8_t anchor_y);
CanvasFormat
the format of the canvas
Definition canvas.h:61
The canvas is a virtual memory in which the widget draws.
Definition canvas.h:129
GraphicDisplayDevice(size_t screen_width, size_t screen_height)
Construct a new Display Device object.
Definition display_device.cpp:14
this is a C++ wrapper for the original pico SDK i2c master API
Definition hw_i2c.h:137
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.
Definition ssd1306.cpp:29
void show(Canvas *canvas, const uint8_t anchor_x, const uint8_t anchor_y)
Definition ssd1306.cpp:157
void init_SEG_scan_inverse_direction(bool inverse)
refer to SSD1306 data sheet for more details
Definition ssd1306.cpp:179
void vertical_scroll(bool on, struct_ConfigScrollSSD1306 scroll_data)
Definition ssd1306.cpp:257
void horizontal_scroll(bool on, struct_ConfigScrollSSD1306 scroll_data)
Definition ssd1306.cpp:237
void init()
the master init function that calls all others
Definition ssd1306.cpp:83
void init_COM_scan_inverse_direction(bool inverse)
refer to SSD1306 data sheet for more details
Definition ssd1306.cpp:187
SSD1306(HW_I2C_Master *master, struct_ConfigSSD1306 device_config)
Definition ssd1306.cpp:17
void clear_device_screen_buffer()
write 0x00 directly into the device framebuffer. Uses fill_pattern_and_show_GDDRAM command.
Definition ssd1306.cpp:77
void set_display_OFF()
Set the display OFF object.
Definition ssd1306.cpp:60
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 fra...
Definition ssd1306.cpp:70
void init_RAM_start_line(uint8_t value)
refer to SSD1306 data sheet for more details
Definition ssd1306.cpp:172
void init_clock_frequency(uint8_t divide_ratio, uint8_t frequency_factor)
refer to SSD1306 data sheet for more details
Definition ssd1306.cpp:213
void set_inverse_color(bool inverse)
Set the inverse color object.
Definition ssd1306.cpp:52
void init_charge_pump_enabled(bool enabled)
refer to SSD1306 data sheet for more details
Definition ssd1306.cpp:222
void set_display_from_RAM()
Set the display from RAM object.
Definition ssd1306.cpp:42
struct_ConfigSSD1306 device_config
the SSD1306 device configuration
Definition ssd1306.h:129
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...
Definition ssd1306.cpp:144
void send_cmd_list(uint8_t *cmd_list, int num)
refer to SSD1306 data sheet for more details
Definition ssd1306.cpp:11
HW_I2C_Master * i2c_master
the I2C master that control the SSD1306 display
Definition ssd1306.h:127
void init_COM_cfg(bool sequentialCOM, bool enableCOMLRremap)
refer to SSD1306 data sheet for more details
Definition ssd1306.cpp:195
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
Definition ssd1306.cpp:115
void send_cmd(uint8_t cmd)
refer to SSD1306 data sheet for more details
Definition ssd1306.cpp:4
void set_display_ON()
Set the display ON object.
Definition ssd1306.cpp:65
void set_contrast(uint8_t value)
Set the contrast object. refer to datasheet of SSD1306 device.
Definition ssd1306.cpp:206
void init_MUX_ratio(uint8_t value)
refer to SSD1306 data sheet for more details
Definition ssd1306.cpp:108
void set_all_pixel_ON()
Set the all pixel ON.
Definition ssd1306.cpp:47
void init_display_vertical_shift(uint8_t value)
refer to SSD1306 data sheet for more details
Definition ssd1306.cpp:165
This is a C++ wrapper for the original pico SDK i2c master API, adapted to FreeRTOS environment.
Definition rtos_hw_i2c.h:29
rtos_SSD1306(rtos_HW_I2C_Master *master, struct_ConfigSSD1306 device_config)
constructor for FreeRTOS compliant SSD1306 device driver.
Definition ssd1306.cpp:276
void check_rtos_display_device_compatibility(struct_ConfigGraphicWidget framebuffer_cfg, CanvasFormat canvas_format)
Check the compatibility of the framebuffer configuration with the display device physical limitations...
Definition ssd1306.cpp:285
void fill_GDDRAM_with_pattern(uint8_t pattern, struct_RenderArea area, uint8_t addressing_mode=0)
fill a pattern in the device framebuffer (GDDRAM). This is shown on display as soon as the GDDRAM buf...
Definition ssd1306.cpp:329
void clear_device_screen_buffer()
Clear the device screen buffer.
Definition ssd1306.cpp:290
void show_render_area(uint8_t *data_buffer, struct_RenderArea display_area, uint8_t addressing_mode=0)
when we need to show a render area with a given framebuffer
Definition ssd1306.cpp:301
void show_widget(rtos_Widget *widget)
Show the widget on the display device.
Definition ssd1306.cpp:296
This file contains all the defineition of SSD1306 commands.
#define SSD1306_HEIGHT
the height in pixel of SSD1306, can be either 32 or 64
Definition commands_SSD1306.h:19
#define SSD1306_NUM_PAGES
Related to FramebufferFormat, SSD1306_WIDTH divided by the font height.
Definition commands_SSD1306.h:25
#define SSD1306_BUF_LEN
size of the pixel_buffer of the associated framebuffer
Definition commands_SSD1306.h:27
#define SSD1306_WIDTH
the width in pixel of SSD1306
Definition commands_SSD1306.h:21
#define HORIZONTAL_ADDRESSING_MODE
refer to SSD1306 data sheet
Definition ssd1306.h:39
#define _2_FRAMES
refer to SSD1306 data sheet
Definition ssd1306.h:21
configuration data for SSD1306 OLED display. refer to datasheet for more details.
Definition ssd1306.h:51
bool sequential_COM
refer to SSD1306 datasheet for more details.
Definition ssd1306.h:65
uint8_t frequency_divider
refer to SSD1306 datasheet for more details.
Definition ssd1306.h:71
uint8_t vertical_offset
refer to SSD1306 datasheet for more details.
Definition ssd1306.h:57
uint8_t contrast
refer to SSD1306 datasheet for more details.
Definition ssd1306.h:69
bool scan_COM_inverse_direction
refer to SSD1306 datasheet for more details.
Definition ssd1306.h:63
bool enable_COM_L_R_remap
refer to SSD1306 datasheet for more details.
Definition ssd1306.h:67
uint8_t frequency_factor
refer to SSD1306 datasheet for more details.
Definition ssd1306.h:73
uint8_t GDDRAM_start_line
refer to SSD1306 datasheet for more details.
Definition ssd1306.h:59
bool scan_SEG_inverse_direction
refer to SSD1306 datasheet for more details.
Definition ssd1306.h:61
uint8_t mux_ratio_value
multiplex ratio
Definition ssd1306.h:55
uint8_t i2c_address
the i2c address, usually 0x3C, may be 0x3D
Definition ssd1306.h:53
data used to compute the render area position in the display framebuffer reference,...
Definition ssd1306.h:102
size_t height
the eight of the copy area
Definition ssd1306.h:114
size_t buflen
the size of the graphic buffer
Definition ssd1306.h:116
uint8_t end_col
the pixel x where to end copy of the graphic framebuffer
Definition ssd1306.h:106
uint8_t start_col
the pixel x where to start copy of the graphic framebuffer
Definition ssd1306.h:104
uint8_t start_page
the page number where to start copy of the graphic framebuffer
Definition ssd1306.h:108
size_t width
the width of the copy area
Definition ssd1306.h:112
uint8_t end_page
the page number where to end copy of the graphic framebuffer
Definition ssd1306.h:110