File syn_oled.c¶
FileList > display > syn_oled.c
Go to the source code of this file
Generic Monochrome OLED Display Driver (SSD1306, SH1106, SSD1309 over I2C).
#include "syn_oled.h"#include "../util/syn_assert.h"#include <string.h>
Public Functions¶
| Type | Name |
|---|---|
| void | syn_oled_canvas_flush_cb (const uint8_t * buf, size_t len, void * ctx) Canvas flush callback matching SYN_Canvas_FlushFn signature. |
| void | syn_oled_flush_canvas (SYN_OLED * oled, const SYN_Canvas * c) Flush canvas pixel buffer to physical OLED display screen. |
| SYN_Status | syn_oled_init (SYN_OLED * oled, SYN_GPIO_Pin scl, SYN_GPIO_Pin sda, uint8_t i2c_addr, uint16_t w, uint16_t h, SYN_OLEDType type) Initialize Monochrome OLED display context. |
| void | syn_oled_set_contrast (SYN_OLED * oled, uint8_t contrast) Set display contrast level. |
| void | syn_oled_set_display_on (SYN_OLED * oled, bool on) Turn display ON or OFF (power save mode). |
| void | syn_oled_set_invert (SYN_OLED * oled, bool invert) Set display color inversion. |
Public Static Functions¶
| Type | Name |
|---|---|
| bool | get_canvas_pixel (const SYN_Canvas * c, uint16_t x, uint16_t y) |
| void | send_command (SYN_OLED * oled, uint8_t cmd) |
| void | write_i2c_reg (SYN_SoftI2C * i2c, uint8_t dev_addr, uint8_t reg, uint8_t val) |
Public Functions Documentation¶
function syn_oled_canvas_flush_cb¶
Canvas flush callback matching SYN_Canvas_FlushFn signature.
Parameters:
bufFramebuffer byte array.lenByte array length.ctxContext pointer (SYN_OLED instance).
function syn_oled_flush_canvas¶
Flush canvas pixel buffer to physical OLED display screen.
Parameters:
oledOLED context.cSource Canvas context.
function syn_oled_init¶
Initialize Monochrome OLED display context.
SYN_Status syn_oled_init (
SYN_OLED * oled,
SYN_GPIO_Pin scl,
SYN_GPIO_Pin sda,
uint8_t i2c_addr,
uint16_t w,
uint16_t h,
SYN_OLEDType type
)
Parameters:
oledOLED context.sclI2C SCL GPIO pin.sdaI2C SDA GPIO pin.i2c_addrI2C slave address (e.g. 0x3C or 0x3D).wWidth in pixels (e.g. 128).hHeight in pixels (e.g. 64 or 32).typeOLED IC Controller type (SSD1306, SH1106, SSD1309).
Returns:
SYN_OK on success.
function syn_oled_set_contrast¶
Set display contrast level.
Parameters:
oledOLED context.contrastContrast level (0 to 255).
function syn_oled_set_display_on¶
Turn display ON or OFF (power save mode).
Parameters:
oledOLED context.onTrue for display ON.
function syn_oled_set_invert¶
Set display color inversion.
Parameters:
oledOLED context.invertTrue for inverted display (black on white).
Public Static Functions Documentation¶
function get_canvas_pixel¶
function send_command¶
function write_i2c_reg¶
The documentation for this class was generated from the following file src/syntropic/display/syn_oled.c