File syn_oled.h¶
FileList > display > syn_oled.h
Go to the source code of this file
Generic Monochrome OLED Display Driver (SSD1306, SH1106, SSD1309 over I2C).
#include "../common/syn_defs.h"#include "../display/syn_canvas.h"#include "../drivers/syn_soft_i2c.h"#include <stdbool.h>#include <stddef.h>#include <stdint.h>
Classes¶
| Type | Name |
|---|---|
| struct | SYN_OLED Generic OLED Display Instance Context. |
Public Types¶
| Type | Name |
|---|---|
| enum | SYN_OLEDType OLED Controller IC Type. |
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 Types Documentation¶
enum SYN_OLEDType¶
OLED Controller IC Type.
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).
The documentation for this class was generated from the following file src/syntropic/display/syn_oled.h