14#include "pico/stdlib.h"
20#define _2_FRAMES 0b111
22#define _3_FRAMES 0b100
24#define _4_FRAMES 0b101
26#define _5_FRAMES 0b000
28#define _25_FRAMES 0b110
30#define _64_FRAMES 0b001
32#define _128_FRAMES 0b010
34#define _256_FRAMES 0b011
38#define HORIZONTAL_ADDRESSING_MODE 0
40#define VERTICAL_ADDRESSING_MODE 1
42#define PAGE_ADDRESSING_MODE 2
150 void init_COM_cfg(
bool sequentialCOM,
bool enableCOMLRremap);
200 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:4
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:128
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:126
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 send_clear_device_command(QueueHandle_t display_queue, SemaphoreHandle_t sending_done)
Send a clear screen command to the display gate keeper task.
Definition ssd1306.cpp:291
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:333
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:305
void show_from_display_queue(struct_DataToShow data_to_show)
Show data from the display queue.
Definition ssd1306.cpp:300
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:38
#define _2_FRAMES
refer to SSD1306 data sheet
Definition ssd1306.h:20
configuration data for SSD1306 OLED display. refer to datasheet for more details.
Definition ssd1306.h:50
bool sequential_COM
refer to SSD1306 datasheet for more details.
Definition ssd1306.h:64
uint8_t frequency_divider
refer to SSD1306 datasheet for more details.
Definition ssd1306.h:70
uint8_t vertical_offset
refer to SSD1306 datasheet for more details.
Definition ssd1306.h:56
uint8_t contrast
refer to SSD1306 datasheet for more details.
Definition ssd1306.h:68
bool scan_COM_inverse_direction
refer to SSD1306 datasheet for more details.
Definition ssd1306.h:62
bool enable_COM_L_R_remap
refer to SSD1306 datasheet for more details.
Definition ssd1306.h:66
uint8_t frequency_factor
refer to SSD1306 datasheet for more details.
Definition ssd1306.h:72
uint8_t GDDRAM_start_line
refer to SSD1306 datasheet for more details.
Definition ssd1306.h:58
bool scan_SEG_inverse_direction
refer to SSD1306 datasheet for more details.
Definition ssd1306.h:60
uint8_t mux_ratio_value
multiplex ratio
Definition ssd1306.h:54
uint8_t i2c_address
the i2c address, usually 0x3C, may be 0x3D
Definition ssd1306.h:52
data structure used to queue data to send to the display task
Definition display_device.h:77
data used to compute the render area position in the display framebuffer reference,...
Definition ssd1306.h:101
size_t height
the eight of the copy area
Definition ssd1306.h:113
size_t buflen
the size of the graphic buffer
Definition ssd1306.h:115
uint8_t end_col
the pixel x where to end copy of the graphic framebuffer
Definition ssd1306.h:105
uint8_t start_col
the pixel x where to start copy of the graphic framebuffer
Definition ssd1306.h:103
uint8_t start_page
the page number where to start copy of the graphic framebuffer
Definition ssd1306.h:107
size_t width
the width of the copy area
Definition ssd1306.h:111
uint8_t end_page
the page number where to end copy of the graphic framebuffer
Definition ssd1306.h:109