uGUI adapter

The PocketSprite SDK comes with a version of uGUI. This is a library to easily render text and GUI elements to a screen on an embedded device. The SDK comes with some adapter logic to easily integrate this library into a PocketSprite application.

Functions

void kcugui_cls()

Clear the uGUI framebuffer to black.

void kcugui_flush()

Flush the uGUI framebuffer to the OLED screen.

void kcugui_init()

Initialize uGUI and this connector.

void kcugui_deinit()

De-initialize uGUI, release associated memory.

uint16_t *kcugui_get_fb()

Get pointer to framebuffer used by uGUI.

For this, uGUI needs to be initialized using kcugui_init. The framebuffer returned will be KC_SCREEN_W*KC_SCREEN_H (normally 80*64) 16-bit words.

Return
Pointer to framebuffer

static uint16_t kchal_ugui_rgb(uint8_t r, uint8_t g, uint8_t b)

Convert an RGB value into a color usable by uGUI.

Return
uGUI color value
Parameters
  • r: Red value (0-255)
  • g: Green value (0-255)
  • b: Blue value (0-255)