oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
Loading...
Searching...
No Matches
lvgl_internal.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2026 Kamil Lulko <kamil.lulko@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 *
6 * This file is part of oveRTOS.
7 */
8
9#ifndef OVE_LVGL_INTERNAL_H
10#define OVE_LVGL_INTERNAL_H
11
30#include "ove/types.h"
31#include "ove_config.h"
32
33#include <stdbool.h>
34#include <stdint.h>
35
36#ifdef __cplusplus
37extern "C" {
38#endif
39
40#ifdef CONFIG_OVE_LVGL
41
53typedef bool (*ove_lvgl_keypad_read_fn_t)(uint32_t *key, bool *pressed);
54
65typedef bool (*ove_lvgl_encoder_read_fn_t)(int16_t *diff, bool *pressed);
66
82
90
102
108
118
124void ove_lvgl_lock(void);
125
132
141void ove_lvgl_tick(uint32_t ms);
142
151
152#else /* !CONFIG_OVE_LVGL */
153
154typedef bool (*ove_lvgl_keypad_read_fn_t)(uint32_t *key, bool *pressed);
155typedef bool (*ove_lvgl_encoder_read_fn_t)(int16_t *diff, bool *pressed);
156
157static inline int ove_lvgl_init(void)
158{
160}
161static inline void ove_lvgl_lock(void)
162{
163}
164static inline void ove_lvgl_unlock(void)
165{
166}
167static inline void ove_lvgl_tick(uint32_t ms)
168{
169 (void)ms;
170}
171static inline void ove_lvgl_handler(void)
172{
173}
175{
176 (void)cb;
178}
180{
181 (void)cb;
183}
184static inline void *ove_lvgl_get_keypad_indev(void)
185{
186 return (void *)0;
187}
188static inline void *ove_lvgl_get_encoder_indev(void)
189{
190 return (void *)0;
191}
192
193#endif /* CONFIG_OVE_LVGL */
194
195#ifdef __cplusplus
196}
197#endif
198
201#endif /* OVE_LVGL_INTERNAL_H */
void ove_lvgl_tick(uint32_t ms)
Advance the LVGL internal tick counter.
bool(* ove_lvgl_encoder_read_fn_t)(int16_t *diff, bool *pressed)
Encoder read callback — the user implements this to deliver rotation/click events to LVGL.
Definition lvgl_internal.h:65
int ove_lvgl_register_encoder(ove_lvgl_encoder_read_fn_t cb)
Register an encoder input device with LVGL.
int ove_lvgl_register_keypad(ove_lvgl_keypad_read_fn_t cb)
Register a keypad input device with LVGL.
void ove_lvgl_lock(void)
Acquire the LVGL mutex before calling any LVGL API.
bool(* ove_lvgl_keypad_read_fn_t)(uint32_t *key, bool *pressed)
Keypad read callback — the user implements this to deliver key events to LVGL via ove_lvgl_register_k...
Definition lvgl_internal.h:53
void ove_lvgl_handler(void)
Process pending LVGL tasks (rendering, input, animations).
void * ove_lvgl_get_encoder_indev(void)
Returns the encoder LVGL input device handle as void*, or NULL if none has been registered.
void * ove_lvgl_get_keypad_indev(void)
Returns the keypad LVGL input device handle (lv_indev_t * as void*) or NULL if none has been register...
void ove_lvgl_unlock(void)
Release the LVGL mutex after calling LVGL APIs.
int ove_lvgl_init(void)
Initialise the LVGL library and register the board's display driver.
@ OVE_ERR_NOT_SUPPORTED
Definition types.h:98