ZEReader 0.1.0
A Zephyr-based E-Book-Reader
Loading...
Searching...
No Matches
ui.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2025 Anna-Lena Marx <mail@marx.engineer>
3 *
4 * SPDX-License-Identifier: MPL-2.0
5 */
6
7#ifndef _UI_H_
8#define _UI_H_
9
10#include <lvgl.h>
11#include <lvgl_input_device.h>
12#include <zephyr/drivers/adc.h>
13#include <zephyr/drivers/display.h>
14#include <zephyr/devicetree.h>
15
16#include <ui/context/context.h>
17
25
26#define UI_BOOK_LIST_STR_SIZE 1000
27#define UI_SCREEN_REFRESH_PAGES 8
28
29typedef enum
30{
31 UI_SUCCESS = 0,
32 UI_ERROR_DISPLAY_NOT_READY = -1,
33 UI_ERROR_LVGL_INPUT_NOT_READY = -2,
34 UI_ERROR_ADC_CONTROLLER_NOT_READY = -3,
35 UI_ERROR_ADC_CHANNEL_SETUP_FAILED = -4
36} ui_error_code_t;
37
43void ui_init(context_t *context);
44
49
55void zereader_print_page(const char *page);
56
63void zereader_recreate_page(const char *content, size_t page);
64
70
76
80void zereader_show_bookmenu(context_t *context, const char *booklist);
81
86
91
96
101
103
104#endif
The UI's context.
context_t
UI context definition.
Definition context.h:22
void zereader_show_shutdown_screen()
Show a clean shutdown screen.
void zereader_ui_unlock(void)
Unlock the LVGL mutex.
void zereader_ui_lock(void)
Lock the LVGL mutex.
void zereader_clean_page()
Clean out the page contents.
void zereader_print_page(const char *page)
Render a page with the given input.
void zereader_scroll_up(void)
Scroll up in the text view.
void zereader_scroll_down(void)
Scroll down in the text view.
void zereader_recreate_page(const char *content, size_t page)
Recreate the page with new content and scroll position.
void zereader_show_logo()
Show the configured logo.
void zereader_show_bookmenu(context_t *context, const char *booklist)
Show the book selection menu.
void ui_init(context_t *context)
Initialize the UI.