CardSight 0.1.0
C API reference for the CardSight firmware and application
Loading...
Searching...
No Matches
lvgl_port.h File Reference

LVGL on this board: the display flush, the touch screen as the input device, and a way for other tasks to ask the LVGL task to run a function. More...

#include <stdbool.h>
#include <drm/sunxi_display.h>

Go to the source code of this file.

Typedefs

typedef void(* lvgl_port_callback_t) (void *argument)
 Function another task asks the LVGL task to run.

Functions

int lvgl_port_post (lvgl_port_callback_t callback, void *argument)
 Run callback from the LVGL task.
bool lvgl_port_ready (void)
 Whether the display and the input device are up.
void lvgl_port_wait_idle (void)
 Wait, inside the LVGL task, until the panel has taken the last flush.
int lvgl_port_check_buffer (void)
 Check the guard word after the SRAM draw buffer.
int lvgl_port_last_error (void)
 The last error recorded by the LVGL task.

Detailed Description

LVGL on this board: the display flush, the touch screen as the input device, and a way for other tasks to ask the LVGL task to run a function.

Function Documentation

◆ lvgl_port_check_buffer()

int lvgl_port_check_buffer ( void )

Check the guard word after the SRAM draw buffer.

Returns
0 when intact, or -1 (with a log message) when the guard word was overwritten.

◆ lvgl_port_last_error()

int lvgl_port_last_error ( void )

The last error recorded by the LVGL task.

Returns
The error, or 0 when there was none.

◆ lvgl_port_post()

int lvgl_port_post ( lvgl_port_callback_t callback,
void * argument )

Run callback from the LVGL task.

The request is queued without waiting; the LVGL task drains the queue on every iteration, so the callback may touch LVGL.

Parameters
callbackFunction to run; must not be NULL.
argumentOpaque value passed to callback.
Returns
0 when queued, -EINVAL for a NULL callback, -EAGAIN before the port is up, or -ETIMEDOUT when the request queue is full.

◆ lvgl_port_ready()

bool lvgl_port_ready ( void )

Whether the display and the input device are up.

Returns
true once both devices are ready.

◆ lvgl_port_wait_idle()

void lvgl_port_wait_idle ( void )

Wait, inside the LVGL task, until the panel has taken the last flush.

Sleeps in short steps while the asynchronous write is still in flight.