Skip to content

daisy::UiCanvasDescriptor

Module: LIBDAISY / UI

A descriptor for a canvas in the UI system. More...

#include <UI.h>

Public Types

Name
using void(*)(const UiCanvasDescriptor &canvasToClear) ClearFuncPtr
using void(*)(const UiCanvasDescriptor &canvasToFlush) FlushFuncPtr

Public Attributes

Name
uint8_t id_
void * handle_
uint32_t updateRateMs_
uint32_t screenSaverTimeOut
bool screenSaverOn
ClearFuncPtr clearFunction_
FlushFuncPtr flushFunction_

Detailed Description

struct daisy::UiCanvasDescriptor;

A descriptor for a canvas in the UI system.

Author: jelliesen

A descriptor for a generic display / led / output device that's used in the UI system.

Public Types Documentation

using ClearFuncPtr

using daisy::UiCanvasDescriptor::ClearFuncPtr =  void (*)(const UiCanvasDescriptor& canvasToClear);

A function to clear the display before the UiPages are drawn.

using FlushFuncPtr

using daisy::UiCanvasDescriptor::FlushFuncPtr =  void (*)(const UiCanvasDescriptor& canvasToFlush);

A function to call when all UIPages have finished the drawing procedure and the results can be flushed out to the device.

Public Attributes Documentation

variable id_

uint8_t id_;

An id number to tell apart various types of canvases that are used concurrently in your system.

variable handle_

void * handle_;

A pointer to some object that allows to draw to the canvas. In your UI pages, you will use the id_ to identify which canvas this is, and then cast this pointer to whatever object it represents, e.g. OledDisplay.

variable updateRateMs_

uint32_t updateRateMs_;

The desired update rate in ms

variable screenSaverTimeOut

uint32_t screenSaverTimeOut = 0;

The desired timeout in ms before a display will shut off. This defaults to 0, which will keep the display on all the time. Nonzero values are useful for displays that can suffer from burn-in, such as OLEDs.

variable screenSaverOn

bool screenSaverOn = false;

variable clearFunction_

ClearFuncPtr clearFunction_;

variable flushFunction_

FlushFuncPtr flushFunction_;

Updated on 2024-01-03 at 19:41:01 +0000