Files
blinky/inc/settings_ui.h

57 lines
1.2 KiB
C
Raw Normal View History

#ifndef BLINKY_SETTINGS_UI_H_
#define BLINKY_SETTINGS_UI_H_
#include <stdbool.h>
#include <stdint.h>
#include "theme_color.h"
#ifdef __cplusplus
extern "C" {
#endif
#define SETTINGS_UI_ROOT_ITEM_COUNT 2U
#define SETTINGS_UI_BLE_SLOT_COUNT 3U
#define SETTINGS_UI_BLE_ITEM_COUNT 4U
#define SETTINGS_UI_THEME_OPTION_COUNT 6U
#define SETTINGS_UI_TITLE_MAX 20U
#define SETTINGS_UI_VALUE_MAX 24U
#define SETTINGS_UI_THEME_NAME_MAX 16U
enum settings_ui_page {
SETTINGS_UI_PAGE_ROOT = 0,
SETTINGS_UI_PAGE_BLE,
SETTINGS_UI_PAGE_THEME,
};
struct settings_ui_list_item {
char title[SETTINGS_UI_TITLE_MAX];
char value[SETTINGS_UI_VALUE_MAX];
};
struct settings_ui_theme_option {
char name[SETTINGS_UI_THEME_NAME_MAX];
struct theme_rgb color;
};
struct settings_ui_state {
bool active;
enum settings_ui_page page;
uint8_t root_selected;
uint8_t ble_selected;
uint8_t theme_selected;
uint8_t active_ble_slot;
struct theme_rgb accent;
struct settings_ui_list_item root_items[SETTINGS_UI_ROOT_ITEM_COUNT];
struct settings_ui_list_item ble_items[SETTINGS_UI_BLE_ITEM_COUNT];
struct settings_ui_theme_option
theme_options[SETTINGS_UI_THEME_OPTION_COUNT];
uint8_t theme_option_count;
};
#ifdef __cplusplus
}
#endif
#endif /* BLINKY_SETTINGS_UI_H_ */