SRA Board Components
ESP-IDF component for SRA Board
|
Macros | |
#define | TAG "lvgl_helpers_ssd1306" |
#define | BIT_SET(a, b) ((a) |= (1U << (b))) |
#define | BIT_CLEAR(a, b) ((a) &= ~(1U << (b))) |
Functions | |
void | ssd1306_init (void) |
Initialize ssd1306 device. More... | |
void | ssd1306_set_px_cb (lv_disp_drv_t *disp_drv, uint8_t *buf, lv_coord_t buf_w, lv_coord_t x, lv_coord_t y, lv_color_t color, lv_opa_t opa) |
Draw a pixel into the buffer. More... | |
void | ssd1306_flush (lv_disp_drv_t *disp_drv, const lv_area_t *area, lv_color_t *color_p) |
Flush the buffer on the screen. More... | |
void | ssd1306_rounder (lv_disp_drv_t *disp_drv, lv_area_t *area) |
Round the area that needs to be updated. More... | |
void | ssd1306_sleep_in (void) |
Turn off the display. More... | |
void | ssd1306_sleep_out (void) |
Turn on the display. More... | |
bool | lvgl_i2c_driver_init (int sda_pin, int scl_pin, int speed_hz) |
Initialize LVGL I2C Master. More... | |
#define BIT_CLEAR | ( | a, | |
b | |||
) | ((a) &= ~(1U << (b))) |
#define BIT_SET | ( | a, | |
b | |||
) | ((a) |= (1U << (b))) |
#define TAG "lvgl_helpers_ssd1306" |
Code from https://github.com/yanbe/ssd1306-esp-idf-i2c.git is used as a starting point, in addition to code from https://github.com/espressif/esp-iot-solution.
Definitions are borrowed from: http://robotcantalk.blogspot.com/2015/03/interfacing-arduino-with-ssd1306-driven.html
For LVGL the forum has been used, in particular: https://blog.littlevgl.com/2019-05-06/oled
bool lvgl_i2c_driver_init | ( | int | sda_pin, |
int | scl_pin, | ||
int | speed_hz | ||
) |
Initialize LVGL I2C Master.
sda_pin | gpio number for I2C master data |
scl_pin | gpio number for I2C master clock |
speed_hz | I2C master clock frequency |
void ssd1306_flush | ( | lv_disp_drv_t * | drv, |
const lv_area_t * | area, | ||
lv_color_t * | color_map | ||
) |
Flush the buffer on the screen.
drv | pointer to the display driver structure |
area | represents an area on the screen |
color_map | represents the color map |
void ssd1306_init | ( | void | ) |
Initialize ssd1306 device.
void ssd1306_rounder | ( | lv_disp_drv_t * | disp_drv, |
lv_area_t * | area | ||
) |
Round the area that needs to be updated.
drv | pointer to the display driver structure |
area | represents an area on the screen |
void ssd1306_set_px_cb | ( | lv_disp_drv_t * | disp_drv, |
uint8_t * | buf, | ||
lv_coord_t | buf_w, | ||
lv_coord_t | x, | ||
lv_coord_t | y, | ||
lv_color_t | color, | ||
lv_opa_t | opa | ||
) |
Draw a pixel into the buffer.
disp_drv | pointer to the display driver structure |
buf | pointer to the memory range where you want to update the data |
buf_w | width of the range where you want to update the data |
x | x co-ordinate of pixel to update |
y | y co-ordinate of pixel to update |
color | monochrome color setting, either full or clear |
opa | opacity value |
void ssd1306_sleep_in | ( | void | ) |
Turn off the display.
void ssd1306_sleep_out | ( | void | ) |
Turn on the display.