Initial commit
This commit is contained in:
commit
f519ba2140
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
build/
|
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "lvgl"]
|
||||
path = lvgl
|
||||
url = https://github.com/lvgl/lvgl.git
|
74
Makefile
Normal file
74
Makefile
Normal file
@ -0,0 +1,74 @@
|
||||
include lv_dirs.mk
|
||||
|
||||
LVGL_PATH ?= lvgl
|
||||
SRC_DIRS := src src/fbd src/lvgl_port src/ui src/fonts $(LVGL_DIRS)
|
||||
INC_DIRS := inc inc/fbd inc/lvgl_port inc/ui . $(LVGL_PATH)
|
||||
|
||||
|
||||
BIN_NAME := calzone_ui
|
||||
BUILD_DIR := build
|
||||
OFILE_DIR := $(BUILD_DIR)/objects
|
||||
INSTALL_DIR ?= /usr/local/bin
|
||||
|
||||
|
||||
INCLUDES := $(addprefix -I, $(INC_DIRS))
|
||||
C_SOURCES := $(foreach dir, $(SRC_DIRS), $(wildcard $(dir)/*.c))
|
||||
|
||||
|
||||
OFILES := $(addprefix $(OFILE_DIR)/, $(notdir $(C_SOURCES:.c=.o)))
|
||||
|
||||
|
||||
OPT := -O2
|
||||
CPPFLAGS := $(INCLUDES) -MMD
|
||||
CFLAGS := $(OPT) -Wall -Wextra -Wpedantic
|
||||
|
||||
|
||||
LDFLAGS :=
|
||||
LDLIBS := -pthread
|
||||
LD := $(CC)
|
||||
|
||||
|
||||
DEPENDS := $(OFILES:.o=.d)
|
||||
|
||||
|
||||
DIRS := $(BUILD_DIR) $(OFILE_DIR) $(PCH_DIR)
|
||||
|
||||
|
||||
|
||||
.PHONY: all run clean
|
||||
|
||||
all: $(BUILD_DIR)/$(BIN_NAME)
|
||||
|
||||
run: all
|
||||
@printf "[ EXEC ] $@\n"
|
||||
@$(BUILD_DIR)/$(BIN_NAME)
|
||||
|
||||
install: all | $(INSTALL_DIR)
|
||||
@printf "[ CP ] $(BUILD_DIR)/$(BIN_NAME) -> $(INSTALL_DIR)/$(BIN_NAME)\r"
|
||||
@cp $(BUILD_DIR)/$(BIN_NAME) $(INSTALL_DIR)/$(BIN_NAME)
|
||||
@printf "[ \e[32mCP\e[0m ]\n"
|
||||
|
||||
clean:
|
||||
$(RM) -r $(DIRS)
|
||||
|
||||
|
||||
-include $(DEPENDS)
|
||||
|
||||
|
||||
|
||||
$(BUILD_DIR)/$(BIN_NAME): $(OFILES) | $(BUILD_DIR)
|
||||
@printf "[ LD ] $@\r"
|
||||
@$(LD) $^ $(LDFLAGS) $(LDLIBS) -o $@
|
||||
@printf "[ \e[32mLD\e[0m ]\n"
|
||||
|
||||
$(OFILE_DIR)/%.o: %.c | $(OFILE_DIR)
|
||||
@printf "[ CC ] $@\r"
|
||||
@$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
|
||||
@printf "[ \e[32mCC\e[0m ]\n"
|
||||
|
||||
|
||||
$(DIRS) $(INSTALL_DIR):
|
||||
@mkdir -p $@
|
||||
|
||||
|
||||
vpath %.c $(SRC_DIRS)
|
6360
compile_commands.json
Normal file
6360
compile_commands.json
Normal file
File diff suppressed because it is too large
Load Diff
11
enumerate_lv_dirs.sh
Executable file
11
enumerate_lv_dirs.sh
Executable file
@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
LVGL_PATH="lvgl"
|
||||
OUT_FILE="lv_dirs.mk"
|
||||
|
||||
printf "LVGL_PATH := ${LVGL_PATH}\n\n" > "${OUT_FILE}"
|
||||
|
||||
printf "LVGL_DIRS := " >> "${OUT_FILE}"
|
||||
find lvgl/src -type d | tr "\n" " " >> "${OUT_FILE}"
|
||||
|
29
inc/date_utils.h
Normal file
29
inc/date_utils.h
Normal file
@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
|
||||
#define MAX_DAYS_IN_MONTH 31
|
||||
|
||||
|
||||
typedef enum {
|
||||
JANUARY = 0,
|
||||
FEBRUARY,
|
||||
MARCH,
|
||||
APRIL,
|
||||
MAY,
|
||||
JUNE,
|
||||
JULY,
|
||||
AUGUST,
|
||||
SEPTEMBER,
|
||||
OCTOBER,
|
||||
NOVEMBER,
|
||||
DECEMBER,
|
||||
} MONTH;
|
||||
|
||||
|
||||
bool isLeapYear(int year);
|
||||
uint8_t firstDayOfMonth(MONTH month, int year);
|
||||
uint8_t daysInMonth(MONTH month, int year);
|
||||
|
54
inc/events.h
Normal file
54
inc/events.h
Normal file
@ -0,0 +1,54 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
#include "date_utils.h"
|
||||
|
||||
|
||||
#define MAX_NAME_LEN 100
|
||||
#define STR_MAX_NAME_LEN "99"
|
||||
|
||||
|
||||
typedef enum {
|
||||
EVENTS_MEETING = 0,
|
||||
EVENTS_CASCADE,
|
||||
EVENTS_SETUP,
|
||||
EVENTS_APPOINTMENT,
|
||||
EVENTS_OTHER,
|
||||
EVENTS_COUNT,
|
||||
} EVENT_TYPE;
|
||||
|
||||
typedef struct {
|
||||
uint8_t counts[EVENTS_COUNT];
|
||||
// uint8_t other;
|
||||
// uint8_t meetings;
|
||||
// uint8_t ram_upgrades;
|
||||
// uint8_t cascades;
|
||||
// uint8_t setups;
|
||||
// uint8_t appointments
|
||||
} event_type_counts_t;
|
||||
|
||||
typedef struct {
|
||||
int s_hour;
|
||||
int s_min;
|
||||
int e_hour;
|
||||
int e_min;
|
||||
EVENT_TYPE type;
|
||||
char name[MAX_NAME_LEN];
|
||||
} event_t;
|
||||
|
||||
typedef struct {
|
||||
event_t* events;
|
||||
size_t size;
|
||||
size_t capacity;
|
||||
} events_t;
|
||||
|
||||
|
||||
|
||||
void unregisterAllUpdates(void);
|
||||
void registerUpdateOnEventChange(uint8_t day, lv_obj_t* object);
|
||||
void register_update_on_detailed_events_change(lv_obj_t* object);
|
||||
void updateEvents(uint8_t today, MONTH month, uint32_t year);
|
||||
|
19
inc/fbd/fbd.h
Normal file
19
inc/fbd/fbd.h
Normal file
@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
struct framebuf {
|
||||
uint32_t xres;
|
||||
uint32_t yres;
|
||||
uint32_t size;
|
||||
|
||||
int fd;
|
||||
uint16_t* buf;
|
||||
};
|
||||
|
||||
int open_fb(struct framebuf* fb, const char* const dev);
|
||||
void close_fb(struct framebuf* fb);
|
||||
void clear_fb(struct framebuf* fb);
|
||||
void set_pixel(struct framebuf* fb, uint32_t x, uint32_t y, uint16_t color);
|
||||
|
11
inc/fonts.h
Normal file
11
inc/fonts.h
Normal file
@ -0,0 +1,11 @@
|
||||
#include <lvgl.h>
|
||||
|
||||
|
||||
#define NF_SYMBOL_CAMERA "\xEF\x80\xBD"
|
||||
#define NF_SYMBOL_CALENDAR "\xF3\xB0\x83\xAD"
|
||||
#define NF_SYMBOL_LAPTOP "\xF3\xB0\x8C\xA2"
|
||||
#define NF_SYMBOL_UPDATE "\xF3\xB0\x9A\xB0"
|
||||
#define NF_SYMBOL_CALENDAR_QUESTION "\xF3\xB0\x9A\x92"
|
||||
|
||||
LV_FONT_DECLARE(nerdfonts_arimo_14)
|
||||
|
16
inc/lvgl_port/lvgl_fb_port.h
Normal file
16
inc/lvgl_port/lvgl_fb_port.h
Normal file
@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
|
||||
extern uint32_t disp_height;
|
||||
extern uint32_t disp_width;
|
||||
|
||||
|
||||
void fb_flush_cb(lv_display_t* display, const lv_area_t* area, uint8_t* px_map);
|
||||
uint32_t disp_hpercent_to_px(uint32_t percent);
|
||||
uint32_t disp_vpercent_to_px(uint32_t percent);
|
||||
int lvgl_fb_run(const char* const fb_dev);
|
||||
|
40
inc/ui/calendar.h
Normal file
40
inc/ui/calendar.h
Normal file
@ -0,0 +1,40 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
#include "events.h"
|
||||
|
||||
|
||||
#define DAYS_IN_WEEK 7
|
||||
#define CALENDAR_ROWS 5
|
||||
|
||||
|
||||
typedef struct lvc_calendar_box {
|
||||
lv_obj_t* box;
|
||||
lv_obj_t* label;
|
||||
|
||||
lv_obj_t* event_count_labels[EVENTS_COUNT];
|
||||
} lvc_calendar_box_t;
|
||||
|
||||
typedef struct lvc_calendar_row {
|
||||
lvc_calendar_box_t* boxes[DAYS_IN_WEEK];
|
||||
} lvc_calendar_row_t;
|
||||
|
||||
typedef struct lvc_calendar {
|
||||
lv_obj_t* calendar;
|
||||
lv_obj_t* title_bar;
|
||||
lv_obj_t* title_label;
|
||||
lvc_calendar_row_t* rows[CALENDAR_ROWS];
|
||||
|
||||
uint32_t width;
|
||||
uint32_t box_width;
|
||||
uint32_t box_height;
|
||||
|
||||
} lvc_calendar_t;
|
||||
|
||||
|
||||
|
||||
lvc_calendar_t* create_calendar(lv_obj_t* parent, uint32_t width);
|
||||
void destroy_calendar(lvc_calendar_t* cal);
|
13
inc/ui/events_panel.h
Normal file
13
inc/ui/events_panel.h
Normal file
@ -0,0 +1,13 @@
|
||||
#include <lvgl.h>
|
||||
|
||||
|
||||
typedef struct {
|
||||
lv_obj_t* panel;
|
||||
lv_obj_t* header;
|
||||
lv_obj_t** event_labels;
|
||||
uint16_t event_labels_count;
|
||||
} lvc_events_panel_t;
|
||||
|
||||
|
||||
lvc_events_panel_t* create_events_panel(lv_obj_t* parent);
|
||||
void destroy_events_panel(lvc_events_panel_t* panel);
|
5
inc/ui/ui.h
Normal file
5
inc/ui/ui.h
Normal file
@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
void create_widgets(void);
|
||||
void destroy_widgets(void);
|
957
lv_conf.h
Normal file
957
lv_conf.h
Normal file
@ -0,0 +1,957 @@
|
||||
/**
|
||||
* @file lv_conf.h
|
||||
* Configuration file for v9.0.0
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copy this file as `lv_conf.h`
|
||||
* 1. simply next to the `lvgl` folder
|
||||
* 2. or any other places and
|
||||
* - define `LV_CONF_INCLUDE_SIMPLE`
|
||||
* - add the path as include path
|
||||
*/
|
||||
|
||||
/* clang-format off */
|
||||
#if 1 /*Set it to "1" to enable content*/
|
||||
|
||||
#ifndef LV_CONF_H
|
||||
#define LV_CONF_H
|
||||
|
||||
/*====================
|
||||
COLOR SETTINGS
|
||||
*====================*/
|
||||
|
||||
/*Color depth: 8 (A8), 16 (RGB565), 24 (RGB888), 32 (XRGB8888)*/
|
||||
#define LV_COLOR_DEPTH 16
|
||||
|
||||
/*=========================
|
||||
STDLIB WRAPPER SETTINGS
|
||||
*=========================*/
|
||||
|
||||
/* Possible values
|
||||
* - LV_STDLIB_BUILTIN: LVGL's built in implementation
|
||||
* - LV_STDLIB_CLIB: Standard C functions, like malloc, strlen, etc
|
||||
* - LV_STDLIB_MICROPYTHON: MicroPython implementation
|
||||
* - LV_STDLIB_RTTHREAD: RT-Thread implementation
|
||||
* - LV_STDLIB_CUSTOM: Implement the functions externally
|
||||
*/
|
||||
#define LV_USE_STDLIB_MALLOC LV_STDLIB_BUILTIN
|
||||
#define LV_USE_STDLIB_STRING LV_STDLIB_BUILTIN
|
||||
#define LV_USE_STDLIB_SPRINTF LV_STDLIB_BUILTIN
|
||||
|
||||
|
||||
#if LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN
|
||||
/*Size of the memory available for `lv_malloc()` in bytes (>= 2kB)*/
|
||||
#define LV_MEM_SIZE (64 * 1024U) /*[bytes]*/
|
||||
|
||||
/*Size of the memory expand for `lv_malloc()` in bytes*/
|
||||
#define LV_MEM_POOL_EXPAND_SIZE 0
|
||||
|
||||
/*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/
|
||||
#define LV_MEM_ADR 0 /*0: unused*/
|
||||
/*Instead of an address give a memory allocator that will be called to get a memory pool for LVGL. E.g. my_malloc*/
|
||||
#if LV_MEM_ADR == 0
|
||||
#undef LV_MEM_POOL_INCLUDE
|
||||
#undef LV_MEM_POOL_ALLOC
|
||||
#endif
|
||||
#endif /*LV_USE_MALLOC == LV_STDLIB_BUILTIN*/
|
||||
|
||||
/*====================
|
||||
HAL SETTINGS
|
||||
*====================*/
|
||||
|
||||
/*Default display refresh, input device read and animation step period.*/
|
||||
#define LV_DEF_REFR_PERIOD 33 /*[ms]*/
|
||||
|
||||
/*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings.
|
||||
*(Not so important, you can adjust it to modify default sizes and spaces)*/
|
||||
#define LV_DPI_DEF 130 /*[px/inch]*/
|
||||
|
||||
/*=================
|
||||
* OPERATING SYSTEM
|
||||
*=================*/
|
||||
/*Select an operating system to use. Possible options:
|
||||
* - LV_OS_NONE
|
||||
* - LV_OS_PTHREAD
|
||||
* - LV_OS_FREERTOS
|
||||
* - LV_OS_CMSIS_RTOS2
|
||||
* - LV_OS_RTTHREAD
|
||||
* - LV_OS_WINDOWS
|
||||
* - LV_OS_CUSTOM */
|
||||
#define LV_USE_OS LV_OS_NONE
|
||||
|
||||
#if LV_USE_OS == LV_OS_CUSTOM
|
||||
#define LV_OS_CUSTOM_INCLUDE <stdint.h>
|
||||
#endif
|
||||
|
||||
/*========================
|
||||
* RENDERING CONFIGURATION
|
||||
*========================*/
|
||||
|
||||
/*Align the stride of all layers and images to this bytes*/
|
||||
#define LV_DRAW_BUF_STRIDE_ALIGN 1
|
||||
|
||||
/*Align the start address of draw_buf addresses to this bytes*/
|
||||
#define LV_DRAW_BUF_ALIGN 4
|
||||
|
||||
#define LV_USE_DRAW_SW 1
|
||||
#if LV_USE_DRAW_SW == 1
|
||||
/* Set the number of draw unit.
|
||||
* > 1 requires an operating system enabled in `LV_USE_OS`
|
||||
* > 1 means multiply threads will render the screen in parallel */
|
||||
#define LV_DRAW_SW_DRAW_UNIT_CNT 1
|
||||
|
||||
/* Use Arm-2D to accelerate the sw render */
|
||||
#define LV_USE_DRAW_ARM2D_SYNC 0
|
||||
|
||||
/* If a widget has `style_opa < 255` (not `bg_opa`, `text_opa` etc) or not NORMAL blend mode
|
||||
* it is buffered into a "simple" layer before rendering. The widget can be buffered in smaller chunks.
|
||||
* "Transformed layers" (if `transform_angle/zoom` are set) use larger buffers
|
||||
* and can't be drawn in chunks. */
|
||||
|
||||
/*The target buffer size for simple layer chunks.*/
|
||||
#define LV_DRAW_SW_LAYER_SIMPLE_BUF_SIZE (24 * 1024) /*[bytes]*/
|
||||
|
||||
/* 0: use a simple renderer capable of drawing only simple rectangles with gradient, images, texts, and straight lines only
|
||||
* 1: use a complex renderer capable of drawing rounded corners, shadow, skew lines, and arcs too */
|
||||
#define LV_DRAW_SW_COMPLEX 1
|
||||
|
||||
#if LV_DRAW_SW_COMPLEX == 1
|
||||
/*Allow buffering some shadow calculation.
|
||||
*LV_DRAW_SW_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius`
|
||||
*Caching has LV_DRAW_SW_SHADOW_CACHE_SIZE^2 RAM cost*/
|
||||
#define LV_DRAW_SW_SHADOW_CACHE_SIZE 0
|
||||
|
||||
/* Set number of maximally cached circle data.
|
||||
* The circumference of 1/4 circle are saved for anti-aliasing
|
||||
* radius * 4 bytes are used per circle (the most often used radiuses are saved)
|
||||
* 0: to disable caching */
|
||||
#define LV_DRAW_SW_CIRCLE_CACHE_SIZE 4
|
||||
#endif
|
||||
|
||||
#define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_NONE
|
||||
|
||||
#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM
|
||||
#define LV_DRAW_SW_ASM_CUSTOM_INCLUDE ""
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Use NXP's VG-Lite GPU on iMX RTxxx platforms. */
|
||||
#define LV_USE_DRAW_VGLITE 0
|
||||
|
||||
#if LV_USE_DRAW_VGLITE
|
||||
/* Enable blit quality degradation workaround recommended for screen's dimension > 352 pixels. */
|
||||
#define LV_USE_VGLITE_BLIT_SPLIT 0
|
||||
|
||||
#if LV_USE_OS
|
||||
/* Enable VGLite draw async. Queue multiple tasks and flash them once to the GPU. */
|
||||
#define LV_USE_VGLITE_DRAW_ASYNC 1
|
||||
#endif
|
||||
|
||||
/* Enable VGLite asserts. */
|
||||
#define LV_USE_VGLITE_ASSERT 0
|
||||
#endif
|
||||
|
||||
/* Use NXP's PXP on iMX RTxxx platforms. */
|
||||
#define LV_USE_DRAW_PXP 0
|
||||
|
||||
#if LV_USE_DRAW_PXP
|
||||
/* Enable PXP asserts. */
|
||||
#define LV_USE_PXP_ASSERT 0
|
||||
#endif
|
||||
|
||||
/* Use Renesas Dave2D on RA platforms. */
|
||||
#define LV_USE_DRAW_DAVE2D 0
|
||||
|
||||
/* Draw using cached SDL textures*/
|
||||
#define LV_USE_DRAW_SDL 0
|
||||
|
||||
/* Use VG-Lite GPU. */
|
||||
#define LV_USE_DRAW_VG_LITE 0
|
||||
|
||||
#if LV_USE_DRAW_VG_LITE
|
||||
/* Enable VG-Lite custom external 'gpu_init()' function */
|
||||
#define LV_VG_LITE_USE_GPU_INIT 0
|
||||
|
||||
/* Enable VG-Lite assert. */
|
||||
#define LV_VG_LITE_USE_ASSERT 0
|
||||
|
||||
/* VG-Lite flush commit trigger threshold. GPU will try to batch these many draw tasks. */
|
||||
#define LV_VG_LITE_FLUSH_MAX_COUNT 8
|
||||
|
||||
#endif
|
||||
|
||||
/*=======================
|
||||
* FEATURE CONFIGURATION
|
||||
*=======================*/
|
||||
|
||||
/*-------------
|
||||
* Logging
|
||||
*-----------*/
|
||||
|
||||
/*Enable the log module*/
|
||||
#define LV_USE_LOG 1
|
||||
#if LV_USE_LOG
|
||||
|
||||
/*How important log should be added:
|
||||
*LV_LOG_LEVEL_TRACE A lot of logs to give detailed information
|
||||
*LV_LOG_LEVEL_INFO Log important events
|
||||
*LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem
|
||||
*LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail
|
||||
*LV_LOG_LEVEL_USER Only logs added by the user
|
||||
*LV_LOG_LEVEL_NONE Do not log anything*/
|
||||
#define LV_LOG_LEVEL LV_LOG_LEVEL_WARN
|
||||
|
||||
/*1: Print the log with 'printf';
|
||||
*0: User need to register a callback with `lv_log_register_print_cb()`*/
|
||||
#define LV_LOG_PRINTF 1
|
||||
|
||||
/*1: Enable print timestamp;
|
||||
*0: Disable print timestamp*/
|
||||
#define LV_LOG_USE_TIMESTAMP 1
|
||||
|
||||
/*1: Print file and line number of the log;
|
||||
*0: Do not print file and line number of the log*/
|
||||
#define LV_LOG_USE_FILE_LINE 1
|
||||
|
||||
/*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs*/
|
||||
#define LV_LOG_TRACE_MEM 1
|
||||
#define LV_LOG_TRACE_TIMER 1
|
||||
#define LV_LOG_TRACE_INDEV 1
|
||||
#define LV_LOG_TRACE_DISP_REFR 1
|
||||
#define LV_LOG_TRACE_EVENT 1
|
||||
#define LV_LOG_TRACE_OBJ_CREATE 1
|
||||
#define LV_LOG_TRACE_LAYOUT 1
|
||||
#define LV_LOG_TRACE_ANIM 1
|
||||
#define LV_LOG_TRACE_CACHE 1
|
||||
|
||||
#endif /*LV_USE_LOG*/
|
||||
|
||||
/*-------------
|
||||
* Asserts
|
||||
*-----------*/
|
||||
|
||||
/*Enable asserts if an operation is failed or an invalid data is found.
|
||||
*If LV_USE_LOG is enabled an error message will be printed on failure*/
|
||||
#define LV_USE_ASSERT_NULL 1 /*Check if the parameter is NULL. (Very fast, recommended)*/
|
||||
#define LV_USE_ASSERT_MALLOC 1 /*Checks is the memory is successfully allocated or no. (Very fast, recommended)*/
|
||||
#define LV_USE_ASSERT_STYLE 0 /*Check if the styles are properly initialized. (Very fast, recommended)*/
|
||||
#define LV_USE_ASSERT_MEM_INTEGRITY 0 /*Check the integrity of `lv_mem` after critical operations. (Slow)*/
|
||||
#define LV_USE_ASSERT_OBJ 0 /*Check the object's type and existence (e.g. not deleted). (Slow)*/
|
||||
|
||||
/*Add a custom handler when assert happens e.g. to restart the MCU*/
|
||||
#define LV_ASSERT_HANDLER_INCLUDE <stdlib.h>
|
||||
#define LV_ASSERT_HANDLER exit(-8); /*Halt by default*/
|
||||
|
||||
/*-------------
|
||||
* Debug
|
||||
*-----------*/
|
||||
|
||||
/*1: Draw random colored rectangles over the redrawn areas*/
|
||||
#define LV_USE_REFR_DEBUG 0
|
||||
|
||||
/*1: Draw a red overlay for ARGB layers and a green overlay for RGB layers*/
|
||||
#define LV_USE_LAYER_DEBUG 0
|
||||
|
||||
/*1: Draw overlays with different colors for each draw_unit's tasks.
|
||||
*Also add the index number of the draw unit on white background.
|
||||
*For layers add the index number of the draw unit on black background.*/
|
||||
#define LV_USE_PARALLEL_DRAW_DEBUG 0
|
||||
|
||||
/*-------------
|
||||
* Others
|
||||
*-----------*/
|
||||
|
||||
#define LV_ENABLE_GLOBAL_CUSTOM 0
|
||||
#if LV_ENABLE_GLOBAL_CUSTOM
|
||||
/*Header to include for the custom 'lv_global' function"*/
|
||||
#define LV_GLOBAL_CUSTOM_INCLUDE <stdint.h>
|
||||
#endif
|
||||
|
||||
/*Default cache size in bytes.
|
||||
*Used by image decoders such as `lv_lodepng` to keep the decoded image in the memory.
|
||||
*If size is not set to 0, the decoder will fail to decode when the cache is full.
|
||||
*If size is 0, the cache function is not enabled and the decoded mem will be released immediately after use.*/
|
||||
#define LV_CACHE_DEF_SIZE 0
|
||||
|
||||
/*Default number of image header cache entries. The cache is used to store the headers of images
|
||||
*The main logic is like `LV_CACHE_DEF_SIZE` but for image headers.*/
|
||||
#define LV_IMAGE_HEADER_CACHE_DEF_CNT 0
|
||||
|
||||
/*Number of stops allowed per gradient. Increase this to allow more stops.
|
||||
*This adds (sizeof(lv_color_t) + 1) bytes per additional stop*/
|
||||
#define LV_GRADIENT_MAX_STOPS 2
|
||||
|
||||
/* Adjust color mix functions rounding. GPUs might calculate color mix (blending) differently.
|
||||
* 0: round down, 64: round up from x.75, 128: round up from half, 192: round up from x.25, 254: round up */
|
||||
#define LV_COLOR_MIX_ROUND_OFS 0
|
||||
|
||||
/* Add 2 x 32 bit variables to each lv_obj_t to speed up getting style properties */
|
||||
#define LV_OBJ_STYLE_CACHE 0
|
||||
|
||||
/* Add `id` field to `lv_obj_t` */
|
||||
#define LV_USE_OBJ_ID 0
|
||||
|
||||
/* Use lvgl builtin method for obj ID */
|
||||
#define LV_USE_OBJ_ID_BUILTIN 0
|
||||
|
||||
/*Use obj property set/get API*/
|
||||
#define LV_USE_OBJ_PROPERTY 0
|
||||
|
||||
/* VG-Lite Simulator */
|
||||
/*Requires: LV_USE_THORVG_INTERNAL or LV_USE_THORVG_EXTERNAL */
|
||||
#define LV_USE_VG_LITE_THORVG 0
|
||||
|
||||
#if LV_USE_VG_LITE_THORVG
|
||||
|
||||
/*Enable LVGL's blend mode support*/
|
||||
#define LV_VG_LITE_THORVG_LVGL_BLEND_SUPPORT 0
|
||||
|
||||
/*Enable YUV color format support*/
|
||||
#define LV_VG_LITE_THORVG_YUV_SUPPORT 0
|
||||
|
||||
/*Enable 16 pixels alignment*/
|
||||
#define LV_VG_LITE_THORVG_16PIXELS_ALIGN 1
|
||||
|
||||
/*Enable multi-thread render*/
|
||||
#define LV_VG_LITE_THORVG_THREAD_RENDER 0
|
||||
|
||||
#endif
|
||||
|
||||
/*=====================
|
||||
* COMPILER SETTINGS
|
||||
*====================*/
|
||||
|
||||
/*For big endian systems set to 1*/
|
||||
#define LV_BIG_ENDIAN_SYSTEM 0
|
||||
|
||||
/*Define a custom attribute to `lv_tick_inc` function*/
|
||||
#define LV_ATTRIBUTE_TICK_INC
|
||||
|
||||
/*Define a custom attribute to `lv_timer_handler` function*/
|
||||
#define LV_ATTRIBUTE_TIMER_HANDLER
|
||||
|
||||
/*Define a custom attribute to `lv_display_flush_ready` function*/
|
||||
#define LV_ATTRIBUTE_FLUSH_READY
|
||||
|
||||
/*Required alignment size for buffers*/
|
||||
#define LV_ATTRIBUTE_MEM_ALIGN_SIZE 1
|
||||
|
||||
/*Will be added where memories needs to be aligned (with -Os data might not be aligned to boundary by default).
|
||||
* E.g. __attribute__((aligned(4)))*/
|
||||
#define LV_ATTRIBUTE_MEM_ALIGN
|
||||
|
||||
/*Attribute to mark large constant arrays for example font's bitmaps*/
|
||||
#define LV_ATTRIBUTE_LARGE_CONST
|
||||
|
||||
/*Compiler prefix for a big array declaration in RAM*/
|
||||
#define LV_ATTRIBUTE_LARGE_RAM_ARRAY
|
||||
|
||||
/*Place performance critical functions into a faster memory (e.g RAM)*/
|
||||
#define LV_ATTRIBUTE_FAST_MEM
|
||||
|
||||
/*Export integer constant to binding. This macro is used with constants in the form of LV_<CONST> that
|
||||
*should also appear on LVGL binding API such as Micropython.*/
|
||||
#define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning /*The default value just prevents GCC warning*/
|
||||
|
||||
/*Prefix all global extern data with this*/
|
||||
#define LV_ATTRIBUTE_EXTERN_DATA
|
||||
|
||||
/* Use `float` as `lv_value_precise_t` */
|
||||
#define LV_USE_FLOAT 0
|
||||
|
||||
/*==================
|
||||
* FONT USAGE
|
||||
*===================*/
|
||||
|
||||
/*Montserrat fonts with ASCII range and some symbols using bpp = 4
|
||||
*https://fonts.google.com/specimen/Montserrat*/
|
||||
#define LV_FONT_MONTSERRAT_8 0
|
||||
#define LV_FONT_MONTSERRAT_10 0
|
||||
#define LV_FONT_MONTSERRAT_12 0
|
||||
#define LV_FONT_MONTSERRAT_14 1
|
||||
#define LV_FONT_MONTSERRAT_16 1
|
||||
#define LV_FONT_MONTSERRAT_18 1
|
||||
#define LV_FONT_MONTSERRAT_20 0
|
||||
#define LV_FONT_MONTSERRAT_22 0
|
||||
#define LV_FONT_MONTSERRAT_24 1
|
||||
#define LV_FONT_MONTSERRAT_26 0
|
||||
#define LV_FONT_MONTSERRAT_28 0
|
||||
#define LV_FONT_MONTSERRAT_30 0
|
||||
#define LV_FONT_MONTSERRAT_32 0
|
||||
#define LV_FONT_MONTSERRAT_34 0
|
||||
#define LV_FONT_MONTSERRAT_36 1
|
||||
#define LV_FONT_MONTSERRAT_38 0
|
||||
#define LV_FONT_MONTSERRAT_40 0
|
||||
#define LV_FONT_MONTSERRAT_42 0
|
||||
#define LV_FONT_MONTSERRAT_44 0
|
||||
#define LV_FONT_MONTSERRAT_46 0
|
||||
#define LV_FONT_MONTSERRAT_48 1
|
||||
|
||||
/*Demonstrate special features*/
|
||||
#define LV_FONT_MONTSERRAT_28_COMPRESSED 0 /*bpp = 3*/
|
||||
#define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 0 /*Hebrew, Arabic, Persian letters and all their forms*/
|
||||
#define LV_FONT_SIMSUN_16_CJK 0 /*1000 most common CJK radicals*/
|
||||
|
||||
/*Pixel perfect monospace fonts*/
|
||||
#define LV_FONT_UNSCII_8 0
|
||||
#define LV_FONT_UNSCII_16 0
|
||||
|
||||
/*Optionally declare custom fonts here.
|
||||
*You can use these fonts as default font too and they will be available globally.
|
||||
*E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2)*/
|
||||
#define LV_FONT_CUSTOM_DECLARE
|
||||
|
||||
/*Always set a default font*/
|
||||
#define LV_FONT_DEFAULT &lv_font_montserrat_14
|
||||
|
||||
/*Enable handling large font and/or fonts with a lot of characters.
|
||||
*The limit depends on the font size, font face and bpp.
|
||||
*Compiler error will be triggered if a font needs it.*/
|
||||
#define LV_FONT_FMT_TXT_LARGE 0
|
||||
|
||||
/*Enables/disables support for compressed fonts.*/
|
||||
#define LV_USE_FONT_COMPRESSED 0
|
||||
|
||||
/*Enable drawing placeholders when glyph dsc is not found*/
|
||||
#define LV_USE_FONT_PLACEHOLDER 1
|
||||
|
||||
/*=================
|
||||
* TEXT SETTINGS
|
||||
*=================*/
|
||||
|
||||
/**
|
||||
* Select a character encoding for strings.
|
||||
* Your IDE or editor should have the same character encoding
|
||||
* - LV_TXT_ENC_UTF8
|
||||
* - LV_TXT_ENC_ASCII
|
||||
*/
|
||||
#define LV_TXT_ENC LV_TXT_ENC_UTF8
|
||||
|
||||
/*Can break (wrap) texts on these chars*/
|
||||
#define LV_TXT_BREAK_CHARS " ,.;:-_)]}"
|
||||
|
||||
/*If a word is at least this long, will break wherever "prettiest"
|
||||
*To disable, set to a value <= 0*/
|
||||
#define LV_TXT_LINE_BREAK_LONG_LEN 0
|
||||
|
||||
/*Minimum number of characters in a long word to put on a line before a break.
|
||||
*Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/
|
||||
#define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3
|
||||
|
||||
/*Minimum number of characters in a long word to put on a line after a break.
|
||||
*Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/
|
||||
#define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 3
|
||||
|
||||
/*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts.
|
||||
*The direction will be processed according to the Unicode Bidirectional Algorithm:
|
||||
*https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/
|
||||
#define LV_USE_BIDI 0
|
||||
#if LV_USE_BIDI
|
||||
/*Set the default direction. Supported values:
|
||||
*`LV_BASE_DIR_LTR` Left-to-Right
|
||||
*`LV_BASE_DIR_RTL` Right-to-Left
|
||||
*`LV_BASE_DIR_AUTO` detect texts base direction*/
|
||||
#define LV_BIDI_BASE_DIR_DEF LV_BASE_DIR_AUTO
|
||||
#endif
|
||||
|
||||
/*Enable Arabic/Persian processing
|
||||
*In these languages characters should be replaced with an other form based on their position in the text*/
|
||||
#define LV_USE_ARABIC_PERSIAN_CHARS 0
|
||||
|
||||
/*==================
|
||||
* WIDGETS
|
||||
*================*/
|
||||
|
||||
/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/
|
||||
|
||||
#define LV_WIDGETS_HAS_DEFAULT_VALUE 1
|
||||
|
||||
#define LV_USE_ANIMIMG 1
|
||||
|
||||
#define LV_USE_ARC 1
|
||||
|
||||
#define LV_USE_BAR 1
|
||||
|
||||
#define LV_USE_BUTTON 1
|
||||
|
||||
#define LV_USE_BUTTONMATRIX 1
|
||||
|
||||
#define LV_USE_CALENDAR 1
|
||||
#if LV_USE_CALENDAR
|
||||
#define LV_CALENDAR_WEEK_STARTS_MONDAY 0
|
||||
#if LV_CALENDAR_WEEK_STARTS_MONDAY
|
||||
#define LV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"}
|
||||
#else
|
||||
#define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"}
|
||||
#endif
|
||||
|
||||
#define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}
|
||||
#define LV_USE_CALENDAR_HEADER_ARROW 1
|
||||
#define LV_USE_CALENDAR_HEADER_DROPDOWN 1
|
||||
#endif /*LV_USE_CALENDAR*/
|
||||
|
||||
#define LV_USE_CANVAS 1
|
||||
|
||||
#define LV_USE_CHART 1
|
||||
|
||||
#define LV_USE_CHECKBOX 1
|
||||
|
||||
#define LV_USE_DROPDOWN 1 /*Requires: lv_label*/
|
||||
|
||||
#define LV_USE_IMAGE 1 /*Requires: lv_label*/
|
||||
|
||||
#define LV_USE_IMAGEBUTTON 1
|
||||
|
||||
#define LV_USE_KEYBOARD 1
|
||||
|
||||
#define LV_USE_LABEL 1
|
||||
#if LV_USE_LABEL
|
||||
#define LV_LABEL_TEXT_SELECTION 1 /*Enable selecting text of the label*/
|
||||
#define LV_LABEL_LONG_TXT_HINT 1 /*Store some extra info in labels to speed up drawing of very long texts*/
|
||||
#define LV_LABEL_WAIT_CHAR_COUNT 3 /*The count of wait chart*/
|
||||
#endif
|
||||
|
||||
#define LV_USE_LED 1
|
||||
|
||||
#define LV_USE_LINE 1
|
||||
|
||||
#define LV_USE_LIST 1
|
||||
|
||||
#define LV_USE_MENU 1
|
||||
|
||||
#define LV_USE_MSGBOX 1
|
||||
|
||||
#define LV_USE_ROLLER 1 /*Requires: lv_label*/
|
||||
|
||||
#define LV_USE_SCALE 1
|
||||
|
||||
#define LV_USE_SLIDER 1 /*Requires: lv_bar*/
|
||||
|
||||
#define LV_USE_SPAN 1
|
||||
#if LV_USE_SPAN
|
||||
/*A line text can contain maximum num of span descriptor */
|
||||
#define LV_SPAN_SNIPPET_STACK_SIZE 64
|
||||
#endif
|
||||
|
||||
#define LV_USE_SPINBOX 1
|
||||
|
||||
#define LV_USE_SPINNER 1
|
||||
|
||||
#define LV_USE_SWITCH 1
|
||||
|
||||
#define LV_USE_TEXTAREA 1 /*Requires: lv_label*/
|
||||
#if LV_USE_TEXTAREA != 0
|
||||
#define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /*ms*/
|
||||
#endif
|
||||
|
||||
#define LV_USE_TABLE 1
|
||||
|
||||
#define LV_USE_TABVIEW 1
|
||||
|
||||
#define LV_USE_TILEVIEW 1
|
||||
|
||||
#define LV_USE_WIN 1
|
||||
|
||||
/*==================
|
||||
* THEMES
|
||||
*==================*/
|
||||
|
||||
/*A simple, impressive and very complete theme*/
|
||||
#define LV_USE_THEME_DEFAULT 1
|
||||
#if LV_USE_THEME_DEFAULT
|
||||
|
||||
/*0: Light mode; 1: Dark mode*/
|
||||
#define LV_THEME_DEFAULT_DARK 0
|
||||
|
||||
/*1: Enable grow on press*/
|
||||
#define LV_THEME_DEFAULT_GROW 1
|
||||
|
||||
/*Default transition time in [ms]*/
|
||||
#define LV_THEME_DEFAULT_TRANSITION_TIME 80
|
||||
#endif /*LV_USE_THEME_DEFAULT*/
|
||||
|
||||
/*A very simple theme that is a good starting point for a custom theme*/
|
||||
#define LV_USE_THEME_SIMPLE 1
|
||||
|
||||
/*A theme designed for monochrome displays*/
|
||||
#define LV_USE_THEME_MONO 1
|
||||
|
||||
/*==================
|
||||
* LAYOUTS
|
||||
*==================*/
|
||||
|
||||
/*A layout similar to Flexbox in CSS.*/
|
||||
#define LV_USE_FLEX 1
|
||||
|
||||
/*A layout similar to Grid in CSS.*/
|
||||
#define LV_USE_GRID 1
|
||||
|
||||
/*====================
|
||||
* 3RD PARTS LIBRARIES
|
||||
*====================*/
|
||||
|
||||
/*File system interfaces for common APIs */
|
||||
|
||||
/*API for fopen, fread, etc*/
|
||||
#define LV_USE_FS_STDIO 0
|
||||
#if LV_USE_FS_STDIO
|
||||
#define LV_FS_STDIO_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
|
||||
#define LV_FS_STDIO_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/
|
||||
#define LV_FS_STDIO_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
|
||||
#endif
|
||||
|
||||
/*API for open, read, etc*/
|
||||
#define LV_USE_FS_POSIX 0
|
||||
#if LV_USE_FS_POSIX
|
||||
#define LV_FS_POSIX_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
|
||||
#define LV_FS_POSIX_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/
|
||||
#define LV_FS_POSIX_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
|
||||
#endif
|
||||
|
||||
/*API for CreateFile, ReadFile, etc*/
|
||||
#define LV_USE_FS_WIN32 0
|
||||
#if LV_USE_FS_WIN32
|
||||
#define LV_FS_WIN32_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
|
||||
#define LV_FS_WIN32_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/
|
||||
#define LV_FS_WIN32_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
|
||||
#endif
|
||||
|
||||
/*API for FATFS (needs to be added separately). Uses f_open, f_read, etc*/
|
||||
#define LV_USE_FS_FATFS 0
|
||||
#if LV_USE_FS_FATFS
|
||||
#define LV_FS_FATFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
|
||||
#define LV_FS_FATFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
|
||||
#endif
|
||||
|
||||
/*API for memory-mapped file access. */
|
||||
#define LV_USE_FS_MEMFS 0
|
||||
#if LV_USE_FS_MEMFS
|
||||
#define LV_FS_MEMFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
|
||||
#endif
|
||||
|
||||
/*LODEPNG decoder library*/
|
||||
#define LV_USE_LODEPNG 0
|
||||
|
||||
/*PNG decoder(libpng) library*/
|
||||
#define LV_USE_LIBPNG 0
|
||||
|
||||
/*BMP decoder library*/
|
||||
#define LV_USE_BMP 0
|
||||
|
||||
/* JPG + split JPG decoder library.
|
||||
* Split JPG is a custom format optimized for embedded systems. */
|
||||
#define LV_USE_TJPGD 0
|
||||
|
||||
/* libjpeg-turbo decoder library.
|
||||
* Supports complete JPEG specifications and high-performance JPEG decoding. */
|
||||
#define LV_USE_LIBJPEG_TURBO 0
|
||||
|
||||
/*GIF decoder library*/
|
||||
#define LV_USE_GIF 0
|
||||
#if LV_USE_GIF
|
||||
/*GIF decoder accelerate*/
|
||||
#define LV_GIF_CACHE_DECODE_DATA 0
|
||||
#endif
|
||||
|
||||
|
||||
/*Decode bin images to RAM*/
|
||||
#define LV_BIN_DECODER_RAM_LOAD 0
|
||||
|
||||
/*RLE decompress library*/
|
||||
#define LV_USE_RLE 0
|
||||
|
||||
/*QR code library*/
|
||||
#define LV_USE_QRCODE 0
|
||||
|
||||
/*Barcode code library*/
|
||||
#define LV_USE_BARCODE 0
|
||||
|
||||
/*FreeType library*/
|
||||
#define LV_USE_FREETYPE 0
|
||||
#if LV_USE_FREETYPE
|
||||
/*Memory used by FreeType to cache characters in kilobytes*/
|
||||
#define LV_FREETYPE_CACHE_SIZE 768
|
||||
|
||||
/*Let FreeType to use LVGL memory and file porting*/
|
||||
#define LV_FREETYPE_USE_LVGL_PORT 0
|
||||
|
||||
/* Maximum number of opened FT_Face/FT_Size objects managed by this cache instance. */
|
||||
/* (0:use system defaults) */
|
||||
#define LV_FREETYPE_CACHE_FT_FACES 8
|
||||
#define LV_FREETYPE_CACHE_FT_SIZES 8
|
||||
#define LV_FREETYPE_CACHE_FT_GLYPH_CNT 256
|
||||
#endif
|
||||
|
||||
/* Built-in TTF decoder */
|
||||
#define LV_USE_TINY_TTF 0
|
||||
#if LV_USE_TINY_TTF
|
||||
/* Enable loading TTF data from files */
|
||||
#define LV_TINY_TTF_FILE_SUPPORT 0
|
||||
#endif
|
||||
|
||||
/*Rlottie library*/
|
||||
#define LV_USE_RLOTTIE 0
|
||||
|
||||
/*Enable Vector Graphic APIs*/
|
||||
#define LV_USE_VECTOR_GRAPHIC 0
|
||||
|
||||
/* Enable ThorVG (vector graphics library) from the src/libs folder */
|
||||
#define LV_USE_THORVG_INTERNAL 0
|
||||
|
||||
/* Enable ThorVG by assuming that its installed and linked to the project */
|
||||
#define LV_USE_THORVG_EXTERNAL 0
|
||||
|
||||
/*Enable LZ4 compress/decompress lib*/
|
||||
#define LV_USE_LZ4 0
|
||||
|
||||
/*Use lvgl built-in LZ4 lib*/
|
||||
#define LV_USE_LZ4_INTERNAL 0
|
||||
|
||||
/*Use external LZ4 library*/
|
||||
#define LV_USE_LZ4_EXTERNAL 0
|
||||
|
||||
/*FFmpeg library for image decoding and playing videos
|
||||
*Supports all major image formats so do not enable other image decoder with it*/
|
||||
#define LV_USE_FFMPEG 0
|
||||
#if LV_USE_FFMPEG
|
||||
/*Dump input information to stderr*/
|
||||
#define LV_FFMPEG_DUMP_FORMAT 0
|
||||
#endif
|
||||
|
||||
/*==================
|
||||
* OTHERS
|
||||
*==================*/
|
||||
|
||||
/*1: Enable API to take snapshot for object*/
|
||||
#define LV_USE_SNAPSHOT 0
|
||||
|
||||
/*1: Enable system monitor component*/
|
||||
#define LV_USE_SYSMON 0
|
||||
#if LV_USE_SYSMON
|
||||
/*Get the idle percentage. E.g. uint32_t my_get_idle(void);*/
|
||||
#define LV_SYSMON_GET_IDLE lv_timer_get_idle
|
||||
|
||||
/*1: Show CPU usage and FPS count
|
||||
* Requires `LV_USE_SYSMON = 1`*/
|
||||
#define LV_USE_PERF_MONITOR 0
|
||||
#if LV_USE_PERF_MONITOR
|
||||
#define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT
|
||||
|
||||
/*0: Displays performance data on the screen, 1: Prints performance data using log.*/
|
||||
#define LV_USE_PERF_MONITOR_LOG_MODE 0
|
||||
#endif
|
||||
|
||||
/*1: Show the used memory and the memory fragmentation
|
||||
* Requires `LV_USE_BUILTIN_MALLOC = 1`
|
||||
* Requires `LV_USE_SYSMON = 1`*/
|
||||
#define LV_USE_MEM_MONITOR 0
|
||||
#if LV_USE_MEM_MONITOR
|
||||
#define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT
|
||||
#endif
|
||||
|
||||
#endif /*LV_USE_SYSMON*/
|
||||
|
||||
/*1: Enable the runtime performance profiler*/
|
||||
#define LV_USE_PROFILER 0
|
||||
#if LV_USE_PROFILER
|
||||
/*1: Enable the built-in profiler*/
|
||||
#define LV_USE_PROFILER_BUILTIN 1
|
||||
#if LV_USE_PROFILER_BUILTIN
|
||||
/*Default profiler trace buffer size*/
|
||||
#define LV_PROFILER_BUILTIN_BUF_SIZE (16 * 1024) /*[bytes]*/
|
||||
#endif
|
||||
|
||||
/*Header to include for the profiler*/
|
||||
#define LV_PROFILER_INCLUDE "lvgl/src/misc/lv_profiler_builtin.h"
|
||||
|
||||
/*Profiler start point function*/
|
||||
#define LV_PROFILER_BEGIN LV_PROFILER_BUILTIN_BEGIN
|
||||
|
||||
/*Profiler end point function*/
|
||||
#define LV_PROFILER_END LV_PROFILER_BUILTIN_END
|
||||
|
||||
/*Profiler start point function with custom tag*/
|
||||
#define LV_PROFILER_BEGIN_TAG LV_PROFILER_BUILTIN_BEGIN_TAG
|
||||
|
||||
/*Profiler end point function with custom tag*/
|
||||
#define LV_PROFILER_END_TAG LV_PROFILER_BUILTIN_END_TAG
|
||||
#endif
|
||||
|
||||
/*1: Enable Monkey test*/
|
||||
#define LV_USE_MONKEY 0
|
||||
|
||||
/*1: Enable grid navigation*/
|
||||
#define LV_USE_GRIDNAV 0
|
||||
|
||||
/*1: Enable lv_obj fragment*/
|
||||
#define LV_USE_FRAGMENT 0
|
||||
|
||||
/*1: Support using images as font in label or span widgets */
|
||||
#define LV_USE_IMGFONT 0
|
||||
|
||||
/*1: Enable an observer pattern implementation*/
|
||||
#define LV_USE_OBSERVER 1
|
||||
|
||||
/*1: Enable Pinyin input method*/
|
||||
/*Requires: lv_keyboard*/
|
||||
#define LV_USE_IME_PINYIN 0
|
||||
#if LV_USE_IME_PINYIN
|
||||
/*1: Use default thesaurus*/
|
||||
/*If you do not use the default thesaurus, be sure to use `lv_ime_pinyin` after setting the thesauruss*/
|
||||
#define LV_IME_PINYIN_USE_DEFAULT_DICT 1
|
||||
/*Set the maximum number of candidate panels that can be displayed*/
|
||||
/*This needs to be adjusted according to the size of the screen*/
|
||||
#define LV_IME_PINYIN_CAND_TEXT_NUM 6
|
||||
|
||||
/*Use 9 key input(k9)*/
|
||||
#define LV_IME_PINYIN_USE_K9_MODE 1
|
||||
#if LV_IME_PINYIN_USE_K9_MODE == 1
|
||||
#define LV_IME_PINYIN_K9_CAND_TEXT_NUM 3
|
||||
#endif /*LV_IME_PINYIN_USE_K9_MODE*/
|
||||
#endif
|
||||
|
||||
/*1: Enable file explorer*/
|
||||
/*Requires: lv_table*/
|
||||
#define LV_USE_FILE_EXPLORER 0
|
||||
#if LV_USE_FILE_EXPLORER
|
||||
/*Maximum length of path*/
|
||||
#define LV_FILE_EXPLORER_PATH_MAX_LEN (128)
|
||||
/*Quick access bar, 1:use, 0:not use*/
|
||||
/*Requires: lv_list*/
|
||||
#define LV_FILE_EXPLORER_QUICK_ACCESS 1
|
||||
#endif
|
||||
|
||||
/*==================
|
||||
* DEVICES
|
||||
*==================*/
|
||||
|
||||
/*Use SDL to open window on PC and handle mouse and keyboard*/
|
||||
#define LV_USE_SDL 0
|
||||
#if LV_USE_SDL
|
||||
#define LV_SDL_INCLUDE_PATH <SDL2/SDL.h>
|
||||
#define LV_SDL_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT /*LV_DISPLAY_RENDER_MODE_DIRECT is recommended for best performance*/
|
||||
#define LV_SDL_BUF_COUNT 1 /*1 or 2*/
|
||||
#define LV_SDL_FULLSCREEN 0 /*1: Make the window full screen by default*/
|
||||
#define LV_SDL_DIRECT_EXIT 1 /*1: Exit the application when all SDL windows are closed*/
|
||||
#endif
|
||||
|
||||
/*Use X11 to open window on Linux desktop and handle mouse and keyboard*/
|
||||
#define LV_USE_X11 0
|
||||
#if LV_USE_X11
|
||||
#define LV_X11_DIRECT_EXIT 1 /*Exit the application when all X11 windows have been closed*/
|
||||
#define LV_X11_DOUBLE_BUFFER 1 /*Use double buffers for endering*/
|
||||
/*select only 1 of the following render modes (LV_X11_RENDER_MODE_PARTIAL preferred!)*/
|
||||
#define LV_X11_RENDER_MODE_PARTIAL 1 /*Partial render mode (preferred)*/
|
||||
#define LV_X11_RENDER_MODE_DIRECT 0 /*direct render mode*/
|
||||
#define LV_X11_RENDER_MODE_FULL 0 /*Full render mode*/
|
||||
#endif
|
||||
|
||||
/*Driver for /dev/fb*/
|
||||
#define LV_USE_LINUX_FBDEV 0
|
||||
#if LV_USE_LINUX_FBDEV
|
||||
#define LV_LINUX_FBDEV_BSD 0
|
||||
#define LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_PARTIAL
|
||||
#define LV_LINUX_FBDEV_BUFFER_COUNT 0
|
||||
#define LV_LINUX_FBDEV_BUFFER_SIZE 60
|
||||
#endif
|
||||
|
||||
/*Use Nuttx to open window and handle touchscreen*/
|
||||
#define LV_USE_NUTTX 0
|
||||
|
||||
#if LV_USE_NUTTX
|
||||
#define LV_USE_NUTTX_LIBUV 0
|
||||
|
||||
/*Use Nuttx custom init API to open window and handle touchscreen*/
|
||||
#define LV_USE_NUTTX_CUSTOM_INIT 0
|
||||
|
||||
/*Driver for /dev/lcd*/
|
||||
#define LV_USE_NUTTX_LCD 0
|
||||
#if LV_USE_NUTTX_LCD
|
||||
#define LV_NUTTX_LCD_BUFFER_COUNT 0
|
||||
#define LV_NUTTX_LCD_BUFFER_SIZE 60
|
||||
#endif
|
||||
|
||||
/*Driver for /dev/input*/
|
||||
#define LV_USE_NUTTX_TOUCHSCREEN 0
|
||||
|
||||
#endif
|
||||
|
||||
/*Driver for /dev/dri/card*/
|
||||
#define LV_USE_LINUX_DRM 0
|
||||
|
||||
/*Interface for TFT_eSPI*/
|
||||
#define LV_USE_TFT_ESPI 0
|
||||
|
||||
/*Driver for evdev input devices*/
|
||||
#define LV_USE_EVDEV 0
|
||||
|
||||
/*Drivers for LCD devices connected via SPI/parallel port*/
|
||||
#define LV_USE_ST7735 0
|
||||
#define LV_USE_ST7789 0
|
||||
#define LV_USE_ST7796 0
|
||||
#define LV_USE_ILI9341 0
|
||||
|
||||
#define LV_USE_GENERIC_MIPI (LV_USE_ST7735 | LV_USE_ST7789 | LV_USE_ST7796 | LV_USE_ILI9341)
|
||||
|
||||
/* LVGL Windows backend */
|
||||
#define LV_USE_WINDOWS 0
|
||||
|
||||
/*==================
|
||||
* EXAMPLES
|
||||
*==================*/
|
||||
|
||||
/*Enable the examples to be built with the library*/
|
||||
#define LV_BUILD_EXAMPLES 1
|
||||
|
||||
/*===================
|
||||
* DEMO USAGE
|
||||
====================*/
|
||||
|
||||
/*Show some widget. It might be required to increase `LV_MEM_SIZE` */
|
||||
#define LV_USE_DEMO_WIDGETS 0
|
||||
#if LV_USE_DEMO_WIDGETS
|
||||
#define LV_DEMO_WIDGETS_SLIDESHOW 0
|
||||
#endif
|
||||
|
||||
/*Demonstrate the usage of encoder and keyboard*/
|
||||
#define LV_USE_DEMO_KEYPAD_AND_ENCODER 0
|
||||
|
||||
/*Benchmark your system*/
|
||||
#define LV_USE_DEMO_BENCHMARK 0
|
||||
|
||||
/*Render test for each primitives. Requires at least 480x272 display*/
|
||||
#define LV_USE_DEMO_RENDER 0
|
||||
|
||||
/*Stress test for LVGL*/
|
||||
#define LV_USE_DEMO_STRESS 0
|
||||
|
||||
/*Music player demo*/
|
||||
#define LV_USE_DEMO_MUSIC 0
|
||||
#if LV_USE_DEMO_MUSIC
|
||||
#define LV_DEMO_MUSIC_SQUARE 0
|
||||
#define LV_DEMO_MUSIC_LANDSCAPE 0
|
||||
#define LV_DEMO_MUSIC_ROUND 0
|
||||
#define LV_DEMO_MUSIC_LARGE 0
|
||||
#define LV_DEMO_MUSIC_AUTO_PLAY 0
|
||||
#endif
|
||||
|
||||
/*Flex layout demo*/
|
||||
#define LV_USE_DEMO_FLEX_LAYOUT 0
|
||||
|
||||
/*Smart-phone like multi-language demo*/
|
||||
#define LV_USE_DEMO_MULTILANG 0
|
||||
|
||||
/*Widget transformation demo*/
|
||||
#define LV_USE_DEMO_TRANSFORM 0
|
||||
|
||||
/*Demonstrate scroll settings*/
|
||||
#define LV_USE_DEMO_SCROLL 0
|
||||
|
||||
/*Vector graphic demo*/
|
||||
#define LV_USE_DEMO_VECTOR_GRAPHIC 0
|
||||
/*--END OF LV_CONF_H--*/
|
||||
|
||||
#endif /*LV_CONF_H*/
|
||||
|
||||
#endif /*End of "Content enable"*/
|
3
lv_dirs.mk
Normal file
3
lv_dirs.mk
Normal file
@ -0,0 +1,3 @@
|
||||
LVGL_PATH := lvgl
|
||||
|
||||
LVGL_DIRS := lvgl/src lvgl/src/layouts lvgl/src/layouts/grid lvgl/src/layouts/flex lvgl/src/display lvgl/src/indev lvgl/src/widgets lvgl/src/widgets/spinbox lvgl/src/widgets/keyboard lvgl/src/widgets/checkbox lvgl/src/widgets/tabview lvgl/src/widgets/led lvgl/src/widgets/image lvgl/src/widgets/line lvgl/src/widgets/tileview lvgl/src/widgets/chart lvgl/src/widgets/switch lvgl/src/widgets/buttonmatrix lvgl/src/widgets/arc lvgl/src/widgets/span lvgl/src/widgets/list lvgl/src/widgets/slider lvgl/src/widgets/spinner lvgl/src/widgets/label lvgl/src/widgets/menu lvgl/src/widgets/objx_templ lvgl/src/widgets/animimage lvgl/src/widgets/button lvgl/src/widgets/roller lvgl/src/widgets/calendar lvgl/src/widgets/textarea lvgl/src/widgets/win lvgl/src/widgets/scale lvgl/src/widgets/canvas lvgl/src/widgets/bar lvgl/src/widgets/msgbox lvgl/src/widgets/dropdown lvgl/src/widgets/table lvgl/src/widgets/imagebutton lvgl/src/core lvgl/src/themes lvgl/src/themes/mono lvgl/src/themes/default lvgl/src/themes/simple lvgl/src/stdlib lvgl/src/stdlib/micropython lvgl/src/stdlib/builtin lvgl/src/stdlib/clib lvgl/src/stdlib/rtthread lvgl/src/draw lvgl/src/draw/renesas lvgl/src/draw/renesas/dave2d lvgl/src/draw/sdl lvgl/src/draw/sw lvgl/src/draw/sw/arm2d lvgl/src/draw/sw/blend lvgl/src/draw/sw/blend/arm2d lvgl/src/draw/sw/blend/neon lvgl/src/draw/nxp lvgl/src/draw/nxp/vglite lvgl/src/draw/nxp/pxp lvgl/src/draw/vg_lite lvgl/src/others lvgl/src/others/fragment lvgl/src/others/vg_lite_tvg lvgl/src/others/gridnav lvgl/src/others/snapshot lvgl/src/others/ime lvgl/src/others/sysmon lvgl/src/others/file_explorer lvgl/src/others/observer lvgl/src/others/imgfont lvgl/src/others/monkey lvgl/src/misc lvgl/src/misc/cache lvgl/src/osal lvgl/src/font lvgl/src/tick lvgl/src/drivers lvgl/src/drivers/display lvgl/src/drivers/display/tft_espi lvgl/src/drivers/display/lcd lvgl/src/drivers/display/st7796 lvgl/src/drivers/display/ili9341 lvgl/src/drivers/display/drm lvgl/src/drivers/display/st7789 lvgl/src/drivers/display/st7735 lvgl/src/drivers/display/fb lvgl/src/drivers/evdev lvgl/src/drivers/windows lvgl/src/drivers/x11 lvgl/src/drivers/sdl lvgl/src/drivers/nuttx lvgl/src/libs lvgl/src/libs/fsdrv lvgl/src/libs/libpng lvgl/src/libs/lodepng lvgl/src/libs/qrcode lvgl/src/libs/barcode lvgl/src/libs/lz4 lvgl/src/libs/libjpeg_turbo lvgl/src/libs/thorvg lvgl/src/libs/tiny_ttf lvgl/src/libs/gif lvgl/src/libs/rlottie lvgl/src/libs/bin_decoder lvgl/src/libs/bmp lvgl/src/libs/ffmpeg lvgl/src/libs/freetype lvgl/src/libs/rle lvgl/src/libs/tjpgd
|
1
lvgl
Submodule
1
lvgl
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 51b8d8e4ea7ed4cb7a4ad295234740b81fc46e6b
|
40
src/date_utils.c
Normal file
40
src/date_utils.c
Normal file
@ -0,0 +1,40 @@
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "date_utils.h"
|
||||
|
||||
|
||||
|
||||
static const int century_start[] = { 0, 6, 4, 2 };
|
||||
static const int offsets[] = { 0, 3, 3, 6, 1, 4, 6, 2, 5, 0, 3, 5 };
|
||||
static const int leap_offsets[] = { 0, 3, 4, 0, 2, 5, 0, 3, 6, 1, 4, 6 };
|
||||
static const int days_in_month[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
|
||||
static const int leap_days_in_month[] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
|
||||
|
||||
|
||||
|
||||
bool isLeapYear(int year)
|
||||
{
|
||||
return (year % 4 == 0) && (year % 100 != 0 || year % 400 == 0);
|
||||
}
|
||||
|
||||
uint8_t firstDayOfMonth(MONTH month, int year)
|
||||
{
|
||||
int d = year % 100;
|
||||
uint8_t first_of_year = (century_start[(year / 100) % 4] + d + (d / 4) - isLeapYear(year) + 7) % 7;
|
||||
|
||||
if (isLeapYear(year)) {
|
||||
return (first_of_year + leap_offsets[month]) % 7;
|
||||
}
|
||||
return (first_of_year + offsets[month]) % 7;
|
||||
}
|
||||
|
||||
uint8_t daysInMonth(MONTH month, int year)
|
||||
{
|
||||
if (isLeapYear(year))
|
||||
{
|
||||
return leap_days_in_month[month];
|
||||
}
|
||||
return days_in_month[month];
|
||||
}
|
||||
|
197
src/events.c
Normal file
197
src/events.c
Normal file
@ -0,0 +1,197 @@
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
#include "date_utils.h"
|
||||
#include "events.h"
|
||||
|
||||
|
||||
#define MAX_FILE_NAME_LEN 36
|
||||
#define MAX_LINE_LEN 200
|
||||
#define FILE_PATH_FMT "/var/lib/calzone/%02d_%d.csv"
|
||||
#define FILE_LINE_FMT "%d,%d,%d,%d,%d,%u,%" STR_MAX_NAME_LEN "[^\t\n]"
|
||||
#define FILE_LINE_FMT_QUOTE "%d,%d,%d,%d,%d,%u,\"%" STR_MAX_NAME_LEN "[^\t\n\"]\""
|
||||
|
||||
|
||||
|
||||
static time_t modified_time = 0;
|
||||
static event_type_counts_t event_counts[MAX_DAYS_IN_MONTH];
|
||||
static lv_obj_t* objects_to_update[MAX_DAYS_IN_MONTH];
|
||||
static lv_obj_t* detailed_events_object = NULL;
|
||||
static events_t event_array;
|
||||
|
||||
|
||||
void clearEvents(void);
|
||||
void sendEventsToObjects(void);
|
||||
bool wasModified(const char* const file_name);
|
||||
int readEventsFromFile(const char* const file_name, int today);
|
||||
int addEvent(event_t* event);
|
||||
|
||||
|
||||
void registerUpdateOnEventChange(uint8_t day, lv_obj_t* object)
|
||||
{
|
||||
day -= 1;
|
||||
if (day >= MAX_DAYS_IN_MONTH) {
|
||||
return;
|
||||
}
|
||||
|
||||
objects_to_update[day] = object;
|
||||
}
|
||||
|
||||
void register_update_on_detailed_events_change(lv_obj_t* object)
|
||||
{
|
||||
detailed_events_object = object;
|
||||
}
|
||||
|
||||
void unregisterAllUpdates(void)
|
||||
{
|
||||
for (size_t i = 0; i < MAX_DAYS_IN_MONTH; i++) {
|
||||
objects_to_update[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void updateEvents(uint8_t today, MONTH month, uint32_t year)
|
||||
{
|
||||
// No real reason to have the limit at year 100 000 000 since the pi zero's time will die in 2038,
|
||||
// but I just pushed nine a bunch of times and now this is how it is
|
||||
if (today < 1 || today > MAX_DAYS_IN_MONTH || month > 11 || year > 99999999) {
|
||||
return;
|
||||
}
|
||||
|
||||
char file_name[MAX_FILE_NAME_LEN];
|
||||
sprintf(file_name, FILE_PATH_FMT, month + 1, year);
|
||||
|
||||
// Check if file exists
|
||||
if (access(file_name, F_OK) != 0) {
|
||||
clearEvents();
|
||||
sendEventsToObjects();
|
||||
return;
|
||||
}
|
||||
|
||||
if (wasModified(file_name)) {
|
||||
clearEvents();
|
||||
if (readEventsFromFile(file_name, today) != 0) {
|
||||
sendEventsToObjects();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sendEventsToObjects(void)
|
||||
{
|
||||
for (size_t i = 0; i < MAX_DAYS_IN_MONTH; i++) {
|
||||
if (objects_to_update[i] != NULL) {
|
||||
lv_obj_send_event(objects_to_update[i], LV_EVENT_REFRESH, &event_counts[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (detailed_events_object != NULL) {
|
||||
lv_obj_send_event(detailed_events_object, LV_EVENT_REFRESH, &event_array);
|
||||
}
|
||||
}
|
||||
|
||||
bool wasModified(const char* const file_name)
|
||||
{
|
||||
struct stat file_stats;
|
||||
|
||||
if (stat(file_name, &file_stats) != 0) {
|
||||
printf("Failed to acces file %s\n", file_name);
|
||||
return false;
|
||||
}
|
||||
|
||||
return file_stats.st_mtim.tv_sec > modified_time;
|
||||
}
|
||||
|
||||
void clearEvents(void)
|
||||
{
|
||||
event_array.size = 0;
|
||||
modified_time = 0;
|
||||
|
||||
for (size_t i = 0; i < MAX_DAYS_IN_MONTH; i++) {
|
||||
for (size_t j = 0; j < EVENTS_COUNT; j++) {
|
||||
event_counts[i].counts[j] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int readEventsFromFile(const char* const file_name, int today)
|
||||
{
|
||||
FILE* f = fopen(file_name, "r");
|
||||
if (f == NULL) {
|
||||
printf("Failed to acces file %s\n", file_name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
char buf[MAX_LINE_LEN];
|
||||
|
||||
int day;
|
||||
int num_events = 0;
|
||||
event_t event;
|
||||
|
||||
while (1) {
|
||||
char* b = fgets(buf, MAX_LINE_LEN, f);
|
||||
if (b == NULL) {
|
||||
// Error or EOF
|
||||
break;
|
||||
}
|
||||
|
||||
if (buf[0] == '\n') {
|
||||
// Empty line
|
||||
continue;
|
||||
}
|
||||
|
||||
int num = sscanf(buf, FILE_LINE_FMT_QUOTE,
|
||||
&event.s_hour, &event.s_min, &event.e_hour, &event.e_min, &day, &event.type, event.name);
|
||||
if (num != 7) {
|
||||
num = sscanf(buf, FILE_LINE_FMT,
|
||||
&event.s_hour, &event.s_min, &event.e_hour, &event.e_min, &day, &event.type, event.name);
|
||||
if (num != 7) {
|
||||
printf("Malformed line in events list file\n");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (day < 1 || day > MAX_DAYS_IN_MONTH) {
|
||||
printf("Invalid day %d\n", day);
|
||||
}
|
||||
|
||||
if (event.type >= EVENTS_COUNT) {
|
||||
event.type = EVENTS_OTHER;
|
||||
}
|
||||
|
||||
if (day == today) {
|
||||
addEvent(&event);
|
||||
}
|
||||
|
||||
event_counts[day - 1].counts[event.type] += 1;
|
||||
num_events++;
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
|
||||
return num_events;
|
||||
}
|
||||
|
||||
int addEvent(event_t* event)
|
||||
{
|
||||
if (event_array.size + 1 > event_array.capacity) {
|
||||
size_t newCapacity = event_array.capacity < 2 ? 4 : event_array.capacity * 2;
|
||||
event_t* newMem = reallocarray(event_array.events, newCapacity, sizeof(event_t));
|
||||
if (newMem == NULL) {
|
||||
printf("Call to reallocarray failed. Unable to load more event_array");
|
||||
return -1;
|
||||
}
|
||||
event_array.events = newMem;
|
||||
event_array.capacity = newCapacity;
|
||||
}
|
||||
|
||||
memcpy(&event_array.events[event_array.size++], event, sizeof(event_t));
|
||||
return 0;
|
||||
}
|
||||
|
61
src/fbd/fbd.c
Normal file
61
src/fbd/fbd.c
Normal file
@ -0,0 +1,61 @@
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <linux/fb.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "fbd.h"
|
||||
|
||||
int open_fb(struct framebuf* fb, const char* const dev)
|
||||
{
|
||||
fb->fd = open(dev, O_RDWR);
|
||||
if (fb->fd < 0) {
|
||||
printf("Failed to open framebuffer device\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// struct fb_fix_screeninfo fix_info;
|
||||
// ioctl(fd, FBIOGET_FSCREENINFO, &fix_info);
|
||||
|
||||
struct fb_var_screeninfo var_info;
|
||||
ioctl(fb->fd, FBIOGET_VSCREENINFO, &var_info);
|
||||
|
||||
fb->xres = var_info.xres;
|
||||
fb->yres = var_info.yres;
|
||||
fb->size = fb->xres * fb->yres * (var_info.bits_per_pixel / 8);
|
||||
|
||||
fb->buf = mmap(0, fb->size, PROT_READ | PROT_WRITE, MAP_SHARED, fb->fd, 0);
|
||||
if (fb->buf == MAP_FAILED) {
|
||||
printf("Failed to map framebuf\n");
|
||||
return -2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void close_fb(struct framebuf* fb)
|
||||
{
|
||||
// memset(fb->buf, 0, fb->size);
|
||||
munmap(fb->buf, fb->size);
|
||||
close(fb->fd);
|
||||
|
||||
fb->xres = 0;
|
||||
fb->yres = 0;
|
||||
fb->size = 0;
|
||||
fb->buf = 0;
|
||||
fb->fd = -1;
|
||||
}
|
||||
|
||||
void clear_fb(struct framebuf* fb)
|
||||
{
|
||||
memset(fb->buf, 0, fb->size);
|
||||
}
|
||||
|
||||
void set_pixel(struct framebuf* fb, uint32_t x, uint32_t y, uint16_t color)
|
||||
{
|
||||
uint32_t idx = (y * fb->xres) + x;
|
||||
|
||||
fb->buf[idx] = color;
|
||||
}
|
860
src/fonts/nerdfonts_0xproto_14.c
Executable file
860
src/fonts/nerdfonts_0xproto_14.c
Executable file
@ -0,0 +1,860 @@
|
||||
/*******************************************************************************
|
||||
* Size: 14 px
|
||||
* Bpp: 4
|
||||
* Opts:
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
|
||||
#include "lvgl.h"
|
||||
#else
|
||||
#include "lvgl/lvgl.h"
|
||||
#endif
|
||||
|
||||
#ifndef NERDFONTS_0XPROTO_14
|
||||
#define NERDFONTS_0XPROTO_14 1
|
||||
#endif
|
||||
|
||||
#if NERDFONTS_0XPROTO_14
|
||||
|
||||
/*-----------------
|
||||
* BITMAPS
|
||||
*----------------*/
|
||||
|
||||
/*Store the image of the glyphs*/
|
||||
static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = {
|
||||
/* U+0020 " " */
|
||||
|
||||
/* U+0021 "!" */
|
||||
0xcf, 0x7b, 0xf6, 0xaf, 0x59, 0xf4, 0x8f, 0x37,
|
||||
0xf1, 0x5f, 0x1, 0x50, 0x8f, 0x37, 0xe3,
|
||||
|
||||
/* U+0022 "\"" */
|
||||
0xeb, 0xf, 0x9c, 0x90, 0xe7, 0xa6, 0xc, 0x57,
|
||||
0x40, 0x82,
|
||||
|
||||
/* U+0023 "#" */
|
||||
0x0, 0x8, 0xb0, 0xd7, 0x0, 0xd, 0x71, 0xf2,
|
||||
0x7, 0xff, 0xff, 0xff, 0x1, 0x7f, 0x3b, 0xb3,
|
||||
0x0, 0x7c, 0xc, 0x70, 0x0, 0xb9, 0xf, 0x40,
|
||||
0x0, 0xe6, 0x2f, 0x10, 0x5f, 0xff, 0xff, 0xf1,
|
||||
0x18, 0xe3, 0xba, 0x30, 0xa, 0x90, 0xe5, 0x0,
|
||||
|
||||
/* U+0024 "$" */
|
||||
0x0, 0x2, 0xd0, 0x0, 0x1, 0x8c, 0xfa, 0x40,
|
||||
0xc, 0xe9, 0xe9, 0xf3, 0x1f, 0x42, 0xd0, 0x86,
|
||||
0xd, 0xb3, 0xd0, 0x0, 0x1, 0xaf, 0xe5, 0x0,
|
||||
0x0, 0x3, 0xed, 0xd2, 0x14, 0x2, 0xd0, 0xca,
|
||||
0x2f, 0x62, 0xd0, 0xca, 0x6, 0xfd, 0xfe, 0xe2,
|
||||
0x0, 0x17, 0xe5, 0x0, 0x0, 0x1, 0x80, 0x0,
|
||||
|
||||
/* U+0025 "%" */
|
||||
0x1c, 0xfb, 0x0, 0x79, 0x8, 0xa0, 0xc6, 0x1d,
|
||||
0x10, 0x8a, 0xc, 0x6a, 0x50, 0x1, 0xce, 0xa5,
|
||||
0xc0, 0x0, 0x0, 0x0, 0xd2, 0x0, 0x0, 0x0,
|
||||
0x88, 0x0, 0x0, 0x0, 0x2d, 0x3d, 0xe9, 0x0,
|
||||
0xc, 0x4b, 0x81, 0xf3, 0x6, 0xa0, 0xb6, 0xe,
|
||||
0x31, 0xd1, 0x3, 0xcc, 0x90,
|
||||
|
||||
/* U+0026 "&" */
|
||||
0x0, 0x7e, 0xfb, 0x10, 0x0, 0x4f, 0x75, 0xe9,
|
||||
0x0, 0x5, 0xf0, 0x4, 0x50, 0x0, 0xd, 0x80,
|
||||
0x0, 0x0, 0x0, 0x9f, 0x50, 0x2a, 0x0, 0xbc,
|
||||
0x8f, 0x37, 0xc0, 0x4f, 0x10, 0x8e, 0xd6, 0x5,
|
||||
0xf0, 0x0, 0xbf, 0x10, 0x1f, 0xb4, 0x6e, 0xf9,
|
||||
0x0, 0x3c, 0xfe, 0x93, 0xb0,
|
||||
|
||||
/* U+0027 "'" */
|
||||
0x7f, 0x25, 0xf0, 0x3e, 0x1, 0xa0,
|
||||
|
||||
/* U+0028 "(" */
|
||||
0x0, 0x0, 0x80, 0x0, 0x1d, 0xf3, 0x0, 0xce,
|
||||
0x20, 0x7, 0xf3, 0x0, 0xe, 0xa0, 0x0, 0x2f,
|
||||
0x50, 0x0, 0x3f, 0x30, 0x0, 0x2f, 0x50, 0x0,
|
||||
0xf, 0x90, 0x0, 0x9, 0xf1, 0x0, 0x1, 0xec,
|
||||
0x0, 0x0, 0x3e, 0xd2, 0x0, 0x2, 0xb1,
|
||||
|
||||
/* U+0029 ")" */
|
||||
0x35, 0x0, 0x8, 0xf9, 0x0, 0x6, 0xf8, 0x0,
|
||||
0x8, 0xf2, 0x0, 0xf, 0x90, 0x0, 0xad, 0x0,
|
||||
0x9, 0xe0, 0x0, 0xad, 0x0, 0xe, 0xa0, 0x6,
|
||||
0xf4, 0x3, 0xfa, 0x6, 0xfc, 0x0, 0x58, 0x0,
|
||||
0x0,
|
||||
|
||||
/* U+002A "*" */
|
||||
0x0, 0x5, 0xf0, 0x0, 0x1, 0x3, 0xe0, 0x1,
|
||||
0xe, 0xc7, 0xd7, 0xe9, 0x3, 0x6d, 0xfa, 0x51,
|
||||
0x0, 0x2e, 0xab, 0x0, 0x0, 0xd9, 0xe, 0x90,
|
||||
0x0, 0x61, 0x4, 0x30,
|
||||
|
||||
/* U+002B "+" */
|
||||
0x0, 0x4f, 0x0, 0x0, 0x4, 0xf0, 0x0, 0x0,
|
||||
0x4f, 0x0, 0xf, 0xff, 0xff, 0xfa, 0x33, 0x7f,
|
||||
0x33, 0x20, 0x4, 0xf0, 0x0, 0x0, 0x4f, 0x0,
|
||||
0x0, 0x0, 0x10, 0x0,
|
||||
|
||||
/* U+002C "," */
|
||||
0x8, 0xe2, 0xa, 0xf3, 0xc, 0xa0, 0x2f, 0x10,
|
||||
0x77, 0x0,
|
||||
|
||||
/* U+002D "-" */
|
||||
0x0, 0x0, 0x0, 0xb, 0xff, 0xff, 0xf6, 0x23,
|
||||
0x33, 0x33, 0x10,
|
||||
|
||||
/* U+002E "." */
|
||||
0x14, 0xb, 0xf6, 0x8e, 0x30,
|
||||
|
||||
/* U+002F "/" */
|
||||
0x0, 0x0, 0xe8, 0x0, 0x3, 0xf3, 0x0, 0x8,
|
||||
0xe0, 0x0, 0xd, 0x90, 0x0, 0x2f, 0x40, 0x0,
|
||||
0x7f, 0x0, 0x0, 0xbb, 0x0, 0x1, 0xf6, 0x0,
|
||||
0x5, 0xf1, 0x0, 0xa, 0xc0, 0x0, 0xe, 0x80,
|
||||
0x0, 0x3f, 0x30, 0x0, 0x37, 0x0, 0x0,
|
||||
|
||||
/* U+0030 "0" */
|
||||
0x0, 0x7e, 0xfd, 0x40, 0x7, 0xf7, 0x4a, 0xf3,
|
||||
0xe, 0x80, 0xa, 0xf9, 0x1f, 0x30, 0x4d, 0x9c,
|
||||
0x3f, 0x20, 0xd3, 0x7d, 0x3f, 0x27, 0xa0, 0x7d,
|
||||
0x1f, 0x5e, 0x10, 0x9c, 0xd, 0xf6, 0x0, 0xc8,
|
||||
0x7, 0xf7, 0x49, 0xf2, 0x0, 0x8e, 0xfd, 0x50,
|
||||
|
||||
/* U+0031 "1" */
|
||||
0x0, 0x4f, 0x40, 0x2, 0x9f, 0xf4, 0x0, 0x9e,
|
||||
0x9f, 0x40, 0x0, 0x2, 0xf4, 0x0, 0x0, 0x2f,
|
||||
0x40, 0x0, 0x2, 0xf4, 0x0, 0x0, 0x2f, 0x40,
|
||||
0x0, 0x2, 0xf4, 0x0, 0x24, 0x5f, 0x74, 0x2b,
|
||||
0xff, 0xff, 0xf9,
|
||||
|
||||
/* U+0032 "2" */
|
||||
0x18, 0xdf, 0xd4, 0x9, 0xd6, 0x4b, 0xf2, 0x0,
|
||||
0x0, 0xf, 0x60, 0x0, 0x0, 0xf6, 0x0, 0x0,
|
||||
0x7f, 0x10, 0x0, 0x5f, 0x50, 0x0, 0x6f, 0x60,
|
||||
0x0, 0x6f, 0x70, 0x0, 0x6f, 0xb4, 0x44, 0x3a,
|
||||
0xff, 0xff, 0xfc,
|
||||
|
||||
/* U+0033 "3" */
|
||||
0x19, 0xef, 0xc4, 0x7, 0xd6, 0x4b, 0xf1, 0x0,
|
||||
0x0, 0x2f, 0x30, 0x0, 0x19, 0xe0, 0x0, 0xdf,
|
||||
0xf4, 0x0, 0x2, 0x4b, 0xe1, 0x0, 0x0, 0xf,
|
||||
0x60, 0x0, 0x0, 0xf6, 0xab, 0x54, 0xbf, 0x13,
|
||||
0xae, 0xfc, 0x40,
|
||||
|
||||
/* U+0034 "4" */
|
||||
0x0, 0x9e, 0x0, 0x0, 0x1f, 0x70, 0x0, 0x6,
|
||||
0xf1, 0x11, 0x0, 0xda, 0xd, 0x80, 0x2f, 0x40,
|
||||
0xd8, 0x7, 0xf0, 0xd, 0x80, 0xda, 0x0, 0xd8,
|
||||
0xf, 0xff, 0xff, 0xfc, 0x33, 0x33, 0xda, 0x20,
|
||||
0x0, 0xd, 0x80,
|
||||
|
||||
/* U+0035 "5" */
|
||||
0x7f, 0xff, 0xff, 0x7, 0xd3, 0x33, 0x30, 0x7c,
|
||||
0x0, 0x0, 0x7, 0xdb, 0xfd, 0x40, 0x4b, 0x64,
|
||||
0xaf, 0x10, 0x0, 0x0, 0xf6, 0x0, 0x0, 0xe,
|
||||
0x70, 0x0, 0x1, 0xf5, 0x8d, 0x64, 0xce, 0x1,
|
||||
0x9e, 0xfc, 0x20,
|
||||
|
||||
/* U+0036 "6" */
|
||||
0x0, 0x0, 0x0, 0x0, 0x2, 0xe4, 0x0, 0x1,
|
||||
0xec, 0x0, 0x0, 0x9e, 0x10, 0x0, 0x2f, 0x60,
|
||||
0x0, 0x8, 0xfb, 0xfe, 0x60, 0xbf, 0x73, 0x8f,
|
||||
0x4d, 0xb0, 0x0, 0xca, 0xbb, 0x0, 0xc, 0xa4,
|
||||
0xf8, 0x49, 0xf4, 0x5, 0xdf, 0xd5, 0x0,
|
||||
|
||||
/* U+0037 "7" */
|
||||
0xff, 0xff, 0xff, 0xbf, 0x93, 0x34, 0xf7, 0xf7,
|
||||
0x0, 0x6f, 0x22, 0x10, 0xb, 0xc0, 0x0, 0x1,
|
||||
0xf7, 0x0, 0x0, 0x6f, 0x10, 0x0, 0xb, 0xc0,
|
||||
0x0, 0x0, 0xf7, 0x0, 0x0, 0x4f, 0x40, 0x0,
|
||||
0x7, 0xf0, 0x0,
|
||||
|
||||
/* U+0038 "8" */
|
||||
0x0, 0x9e, 0xfd, 0x40, 0x8, 0xf6, 0x4a, 0xf2,
|
||||
0xb, 0xa0, 0x0, 0xf5, 0x7, 0xe4, 0x17, 0xf1,
|
||||
0x0, 0xaf, 0xff, 0x40, 0x8, 0xe7, 0x4a, 0xf2,
|
||||
0xf, 0x60, 0x0, 0xc9, 0x1f, 0x50, 0x0, 0xca,
|
||||
0xb, 0xe6, 0x48, 0xf4, 0x1, 0x9e, 0xfd, 0x50,
|
||||
|
||||
/* U+0039 "9" */
|
||||
0x0, 0x8e, 0xfb, 0x20, 0x9, 0xe6, 0x5c, 0xe0,
|
||||
0xf, 0x70, 0x1, 0xf5, 0xf, 0x60, 0x0, 0xf7,
|
||||
0xa, 0xd3, 0x19, 0xf6, 0x1, 0xcf, 0xfc, 0xf4,
|
||||
0x0, 0x2, 0x26, 0xe0, 0x0, 0x0, 0x3f, 0x60,
|
||||
0x0, 0x2, 0xea, 0x0, 0x0, 0xd, 0xb0, 0x0,
|
||||
0x0, 0x2, 0x0, 0x0,
|
||||
|
||||
/* U+003A ":" */
|
||||
0x7e, 0x28, 0xf3, 0x1, 0x0, 0x0, 0x0, 0x0,
|
||||
0x10, 0x8f, 0x37, 0xe3,
|
||||
|
||||
/* U+003B ";" */
|
||||
0x5, 0xf4, 0x6, 0xf5, 0x0, 0x10, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x10, 0x6, 0xf5, 0x6, 0xf5,
|
||||
0x9, 0xd0, 0xe, 0x40, 0x4b, 0x0,
|
||||
|
||||
/* U+003C "<" */
|
||||
0x0, 0x0, 0x1, 0x0, 0x0, 0x6, 0xe2, 0x0,
|
||||
0x3c, 0xf7, 0x1, 0x9f, 0x91, 0x0, 0xbc, 0x20,
|
||||
0x0, 0x8, 0xf8, 0x0, 0x0, 0x4, 0xde, 0x50,
|
||||
0x0, 0x0, 0x7f, 0xc1, 0x0, 0x0, 0x2b, 0x20,
|
||||
|
||||
/* U+003D "=" */
|
||||
0x0, 0x0, 0x0, 0xf, 0xff, 0xff, 0xfa, 0x33,
|
||||
0x33, 0x33, 0x20, 0x0, 0x0, 0x0, 0xff, 0xff,
|
||||
0xff, 0xa3, 0x33, 0x33, 0x32,
|
||||
|
||||
/* U+003E ">" */
|
||||
0x10, 0x0, 0x0, 0x7, 0xc3, 0x0, 0x0, 0x1a,
|
||||
0xf9, 0x10, 0x0, 0x3, 0xce, 0x60, 0x0, 0x0,
|
||||
0x5e, 0x60, 0x0, 0x2a, 0xf4, 0x0, 0x8f, 0xb2,
|
||||
0x3, 0xed, 0x40, 0x0, 0x68, 0x0, 0x0, 0x0,
|
||||
|
||||
/* U+003F "?" */
|
||||
0x1, 0x8d, 0xfd, 0x70, 0x1, 0xee, 0x86, 0x9f,
|
||||
0x90, 0x5, 0x0, 0x0, 0x7f, 0x0, 0x0, 0x0,
|
||||
0x1c, 0xc0, 0x0, 0x0, 0x5f, 0xc2, 0x0, 0x0,
|
||||
0x2f, 0x80, 0x0, 0x0, 0x4, 0xc0, 0x0, 0x0,
|
||||
0x0, 0x1, 0x0, 0x0, 0x0, 0x8, 0xf4, 0x0,
|
||||
0x0, 0x0, 0x6f, 0x30, 0x0,
|
||||
|
||||
/* U+0040 "@" */
|
||||
0x5, 0xbf, 0xfb, 0x20, 0x5, 0xf9, 0x55, 0xde,
|
||||
0x10, 0x1, 0x0, 0x1, 0xe7, 0x0, 0x3e, 0xee,
|
||||
0x48, 0xc0, 0xe, 0x75, 0xf3, 0x5e, 0x5, 0xc0,
|
||||
0xd, 0x33, 0xf0, 0x89, 0x0, 0xe2, 0x3f, 0x8,
|
||||
0x90, 0xe, 0x15, 0xd0, 0x5e, 0x37, 0xf6, 0xb9,
|
||||
0x0, 0xbf, 0xa5, 0xed, 0x10,
|
||||
|
||||
/* U+0041 "A" */
|
||||
0x0, 0x9, 0xf4, 0x0, 0x0, 0x1, 0xfc, 0xb0,
|
||||
0x0, 0x0, 0x6e, 0x3f, 0x10, 0x0, 0xb, 0x80,
|
||||
0xd6, 0x0, 0x1, 0xf3, 0x8, 0xb0, 0x0, 0x5e,
|
||||
0x0, 0x4f, 0x0, 0x9, 0xff, 0xff, 0xf4, 0x0,
|
||||
0xd8, 0x33, 0x3c, 0x80, 0x1f, 0x30, 0x0, 0x8c,
|
||||
0x5, 0xf0, 0x0, 0x5, 0xf0,
|
||||
|
||||
/* U+0042 "B" */
|
||||
0xf, 0xff, 0xfc, 0x50, 0xf, 0x83, 0x4a, 0xf2,
|
||||
0xf, 0x50, 0x0, 0xf5, 0xf, 0x60, 0x17, 0xe1,
|
||||
0xf, 0xff, 0xff, 0x40, 0xf, 0x73, 0x47, 0xe4,
|
||||
0xf, 0x50, 0x0, 0x8d, 0xf, 0x50, 0x0, 0x8d,
|
||||
0xf, 0x84, 0x46, 0xf8, 0xf, 0xff, 0xfd, 0x70,
|
||||
|
||||
/* U+0043 "C" */
|
||||
0x0, 0x7d, 0xfd, 0x70, 0x0, 0x8f, 0x95, 0x7f,
|
||||
0x80, 0x1f, 0x80, 0x0, 0x56, 0x5, 0xf1, 0x0,
|
||||
0x0, 0x0, 0x7e, 0x0, 0x0, 0x0, 0x7, 0xe0,
|
||||
0x0, 0x0, 0x0, 0x5f, 0x10, 0x0, 0x0, 0x1,
|
||||
0xf8, 0x0, 0x0, 0x0, 0x7, 0xf9, 0x56, 0xad,
|
||||
0x0, 0x6, 0xcf, 0xfb, 0x30,
|
||||
|
||||
/* U+0044 "D" */
|
||||
0x2f, 0xff, 0xea, 0x20, 0x2, 0xf6, 0x36, 0xdf,
|
||||
0x20, 0x2f, 0x40, 0x0, 0xdb, 0x2, 0xf4, 0x0,
|
||||
0x7, 0xf0, 0x2f, 0x40, 0x0, 0x5f, 0x2, 0xf4,
|
||||
0x0, 0x6, 0xf0, 0x2f, 0x40, 0x0, 0x9d, 0x2,
|
||||
0xf4, 0x0, 0x1e, 0x80, 0x2f, 0x74, 0x6d, 0xd0,
|
||||
0x2, 0xff, 0xfe, 0x91, 0x0,
|
||||
|
||||
/* U+0045 "E" */
|
||||
0xbf, 0xff, 0xff, 0x8b, 0xb3, 0x33, 0x31, 0xba,
|
||||
0x0, 0x0, 0xb, 0xa0, 0x0, 0x0, 0xbf, 0xff,
|
||||
0xff, 0x3b, 0xb3, 0x33, 0x30, 0xba, 0x0, 0x0,
|
||||
0xb, 0xa0, 0x0, 0x0, 0xbb, 0x44, 0x44, 0x2b,
|
||||
0xff, 0xff, 0xfa,
|
||||
|
||||
/* U+0046 "F" */
|
||||
0xbf, 0xff, 0xff, 0x9b, 0xb3, 0x33, 0x32, 0xba,
|
||||
0x0, 0x0, 0xb, 0xa0, 0x0, 0x0, 0xbf, 0xff,
|
||||
0xff, 0xb, 0xb3, 0x33, 0x30, 0xba, 0x0, 0x0,
|
||||
0xb, 0xa0, 0x0, 0x0, 0xba, 0x0, 0x0, 0xb,
|
||||
0xa0, 0x0, 0x0,
|
||||
|
||||
/* U+0047 "G" */
|
||||
0x0, 0x5c, 0xfe, 0xb3, 0x0, 0x7f, 0x94, 0x59,
|
||||
0x40, 0xf, 0x80, 0x0, 0x0, 0x4, 0xf2, 0x0,
|
||||
0x0, 0x0, 0x6f, 0x0, 0x0, 0x0, 0x6, 0xf0,
|
||||
0x8, 0xff, 0xf0, 0x4f, 0x20, 0x13, 0x7f, 0x0,
|
||||
0xf9, 0x0, 0x5, 0xf0, 0x6, 0xfa, 0x55, 0xbf,
|
||||
0x0, 0x5, 0xcf, 0xfb, 0x40,
|
||||
|
||||
/* U+0048 "H" */
|
||||
0xe7, 0x0, 0xd, 0x9e, 0x70, 0x0, 0xd9, 0xe7,
|
||||
0x0, 0xd, 0x9e, 0x80, 0x0, 0xd9, 0xef, 0xff,
|
||||
0xff, 0x9e, 0x93, 0x33, 0xd9, 0xe7, 0x0, 0xd,
|
||||
0x9e, 0x70, 0x0, 0xd9, 0xe7, 0x0, 0xd, 0x9e,
|
||||
0x70, 0x0, 0xd9,
|
||||
|
||||
/* U+0049 "I" */
|
||||
0xaf, 0xff, 0xff, 0x52, 0x37, 0xf4, 0x31, 0x0,
|
||||
0x5f, 0x0, 0x0, 0x5, 0xf0, 0x0, 0x0, 0x5f,
|
||||
0x0, 0x0, 0x5, 0xf0, 0x0, 0x0, 0x5f, 0x0,
|
||||
0x0, 0x5, 0xf0, 0x0, 0x24, 0x8f, 0x44, 0x1b,
|
||||
0xff, 0xff, 0xf6,
|
||||
|
||||
/* U+004A "J" */
|
||||
0x7, 0xff, 0xff, 0x60, 0x13, 0x33, 0xf6, 0x0,
|
||||
0x0, 0xf, 0x60, 0x0, 0x0, 0xf6, 0x0, 0x0,
|
||||
0xf, 0x60, 0x0, 0x0, 0xf6, 0x0, 0x0, 0xf,
|
||||
0x60, 0x0, 0x1, 0xf5, 0x79, 0x54, 0xbf, 0x13,
|
||||
0xad, 0xfd, 0x40,
|
||||
|
||||
/* U+004B "K" */
|
||||
0xf6, 0x0, 0x4f, 0x50, 0xf6, 0x3, 0xf8, 0x0,
|
||||
0xf6, 0x1e, 0xa0, 0x0, 0xf7, 0xdc, 0x0, 0x0,
|
||||
0xff, 0xf2, 0x0, 0x0, 0xff, 0xeb, 0x0, 0x0,
|
||||
0xf7, 0x3f, 0x80, 0x0, 0xf6, 0x6, 0xf4, 0x0,
|
||||
0xf6, 0x0, 0xaf, 0x20, 0xf6, 0x0, 0xd, 0xd0,
|
||||
|
||||
/* U+004C "L" */
|
||||
0x9c, 0x0, 0x0, 0x9, 0xc0, 0x0, 0x0, 0x9c,
|
||||
0x0, 0x0, 0x9, 0xc0, 0x0, 0x0, 0x9c, 0x0,
|
||||
0x0, 0x9, 0xc0, 0x0, 0x0, 0x9c, 0x0, 0x0,
|
||||
0x9, 0xc0, 0x0, 0x0, 0x9d, 0x44, 0x44, 0x29,
|
||||
0xff, 0xff, 0xf8,
|
||||
|
||||
/* U+004D "M" */
|
||||
0x8f, 0x40, 0x0, 0x9f, 0x38, 0xfc, 0x0, 0x2f,
|
||||
0xf3, 0x8e, 0xf4, 0x9, 0xdf, 0x38, 0xd8, 0xb1,
|
||||
0xf6, 0xf3, 0x8d, 0x1f, 0xab, 0x2f, 0x38, 0xd0,
|
||||
0x9f, 0x42, 0xf3, 0x8d, 0x1, 0x50, 0x2f, 0x38,
|
||||
0xd0, 0x0, 0x2, 0xf3, 0x8d, 0x0, 0x0, 0x2f,
|
||||
0x38, 0xd0, 0x0, 0x2, 0xf3,
|
||||
|
||||
/* U+004E "N" */
|
||||
0x3f, 0xb0, 0x0, 0x7e, 0x3f, 0xf4, 0x0, 0x7e,
|
||||
0x3f, 0xec, 0x0, 0x7e, 0x3f, 0x6f, 0x50, 0x7e,
|
||||
0x3f, 0x2b, 0xd0, 0x7e, 0x3f, 0x22, 0xf6, 0x7e,
|
||||
0x3f, 0x20, 0x9e, 0x8e, 0x3f, 0x20, 0x1f, 0xee,
|
||||
0x3f, 0x20, 0x8, 0xfe, 0x3f, 0x20, 0x1, 0xee,
|
||||
|
||||
/* U+004F "O" */
|
||||
0x0, 0x8e, 0xfd, 0x50, 0x0, 0x8f, 0x74, 0xaf,
|
||||
0x30, 0xf, 0x60, 0x0, 0xcb, 0x4, 0xf1, 0x0,
|
||||
0x6, 0xf0, 0x6f, 0x0, 0x0, 0x4f, 0x16, 0xf0,
|
||||
0x0, 0x4, 0xf1, 0x4f, 0x10, 0x0, 0x6f, 0x0,
|
||||
0xf6, 0x0, 0xb, 0xb0, 0x9, 0xf6, 0x49, 0xf4,
|
||||
0x0, 0x8, 0xef, 0xd5, 0x0,
|
||||
|
||||
/* U+0050 "P" */
|
||||
0x2f, 0xff, 0xfe, 0x90, 0x2f, 0x63, 0x36, 0xe9,
|
||||
0x2f, 0x30, 0x0, 0x7e, 0x2f, 0x30, 0x0, 0x6e,
|
||||
0x2f, 0x40, 0x3, 0xda, 0x2f, 0xff, 0xff, 0xc1,
|
||||
0x2f, 0x63, 0x31, 0x0, 0x2f, 0x30, 0x0, 0x0,
|
||||
0x2f, 0x30, 0x0, 0x0, 0x2f, 0x30, 0x0, 0x0,
|
||||
|
||||
/* U+0051 "Q" */
|
||||
0x0, 0x8e, 0xfc, 0x40, 0x0, 0x9f, 0x64, 0xaf,
|
||||
0x20, 0xf, 0x60, 0x0, 0xc9, 0x4, 0xf0, 0x0,
|
||||
0x7, 0xd0, 0x6e, 0x0, 0x0, 0x6f, 0x7, 0xe0,
|
||||
0x0, 0x5, 0xf0, 0x6f, 0x7d, 0xd5, 0x7e, 0x3,
|
||||
0xfe, 0x45, 0xfd, 0xb0, 0xd, 0xc0, 0x8, 0xf5,
|
||||
0x0, 0x2e, 0xec, 0xff, 0x90, 0x0, 0x5, 0x75,
|
||||
0x3f, 0x10, 0x0, 0x0, 0x0, 0x20,
|
||||
|
||||
/* U+0052 "R" */
|
||||
0x1f, 0xff, 0xfd, 0x70, 0x1, 0xf7, 0x34, 0x7f,
|
||||
0x50, 0x1f, 0x40, 0x0, 0xba, 0x1, 0xf4, 0x0,
|
||||
0xa, 0xa0, 0x1f, 0x40, 0x4, 0xf7, 0x1, 0xff,
|
||||
0xff, 0xfa, 0x0, 0x1f, 0x73, 0xcb, 0x0, 0x1,
|
||||
0xf4, 0x2, 0xf6, 0x0, 0x1f, 0x40, 0x6, 0xf2,
|
||||
0x1, 0xf4, 0x0, 0xb, 0xd0,
|
||||
|
||||
/* U+0053 "S" */
|
||||
0x0, 0x7d, 0xfd, 0x80, 0x0, 0x8f, 0x85, 0x7e,
|
||||
0x80, 0xe, 0x80, 0x0, 0x0, 0x0, 0xbd, 0x10,
|
||||
0x0, 0x0, 0x1, 0xbf, 0xa3, 0x0, 0x0, 0x0,
|
||||
0x3a, 0xfb, 0x10, 0x0, 0x0, 0x1, 0xbd, 0x0,
|
||||
0x30, 0x0, 0x5, 0xf0, 0x1f, 0xd6, 0x46, 0xec,
|
||||
0x0, 0x29, 0xef, 0xe9, 0x10,
|
||||
|
||||
/* U+0054 "T" */
|
||||
0x4f, 0xff, 0xff, 0xff, 0x13, 0x37, 0xf4, 0x33,
|
||||
0x0, 0x5, 0xf0, 0x0, 0x0, 0x5, 0xf0, 0x0,
|
||||
0x0, 0x5, 0xf0, 0x0, 0x0, 0x5, 0xf0, 0x0,
|
||||
0x0, 0x5, 0xf0, 0x0, 0x0, 0x5, 0xf0, 0x0,
|
||||
0x0, 0x5, 0xf0, 0x0, 0x0, 0x5, 0xf0, 0x0,
|
||||
|
||||
/* U+0055 "U" */
|
||||
0x3f, 0x20, 0x0, 0x7e, 0x3f, 0x20, 0x0, 0x7e,
|
||||
0x3f, 0x20, 0x0, 0x7e, 0x3f, 0x20, 0x0, 0x7e,
|
||||
0x3f, 0x20, 0x0, 0x7e, 0x3f, 0x20, 0x0, 0x7e,
|
||||
0x2f, 0x30, 0x0, 0x8d, 0xf, 0x80, 0x0, 0xda,
|
||||
0x8, 0xf9, 0x6b, 0xf3, 0x0, 0x7d, 0xfc, 0x40,
|
||||
|
||||
/* U+0056 "V" */
|
||||
0x5f, 0x10, 0x0, 0x6f, 0x1, 0xf4, 0x0, 0x9,
|
||||
0xc0, 0xd, 0x80, 0x0, 0xd8, 0x0, 0x9c, 0x0,
|
||||
0x1f, 0x40, 0x5, 0xf0, 0x5, 0xf0, 0x0, 0x1f,
|
||||
0x40, 0xab, 0x0, 0x0, 0xb9, 0xe, 0x60, 0x0,
|
||||
0x6, 0xe4, 0xf1, 0x0, 0x0, 0xf, 0xdb, 0x0,
|
||||
0x0, 0x0, 0x9f, 0x40, 0x0,
|
||||
|
||||
/* U+0057 "W" */
|
||||
0x9c, 0x0, 0x0, 0x1f, 0x48, 0xc0, 0x0, 0x1,
|
||||
0xf3, 0x8c, 0x0, 0x0, 0x2f, 0x38, 0xd0, 0x3a,
|
||||
0x2, 0xf2, 0x6e, 0x9, 0xf3, 0x3f, 0x15, 0xf0,
|
||||
0xdf, 0x85, 0xf0, 0x3f, 0x2f, 0x9c, 0x6e, 0x1,
|
||||
0xf9, 0xe3, 0xf9, 0xc0, 0xe, 0xfa, 0xe, 0xf9,
|
||||
0x0, 0xbf, 0x60, 0xbf, 0x50,
|
||||
|
||||
/* U+0058 "X" */
|
||||
0x1f, 0x70, 0x0, 0xdb, 0x8, 0xf1, 0x6, 0xf2,
|
||||
0x0, 0xe9, 0xe, 0x90, 0x0, 0x5f, 0xaf, 0x10,
|
||||
0x0, 0xc, 0xf7, 0x0, 0x0, 0xc, 0xf7, 0x0,
|
||||
0x0, 0x5f, 0xaf, 0x10, 0x0, 0xe9, 0xe, 0x90,
|
||||
0x7, 0xf1, 0x5, 0xf3, 0x1f, 0x70, 0x0, 0xcc,
|
||||
|
||||
/* U+0059 "Y" */
|
||||
0x4f, 0x50, 0x0, 0xae, 0x0, 0xbc, 0x0, 0x2f,
|
||||
0x60, 0x3, 0xf4, 0x9, 0xd0, 0x0, 0xa, 0xc2,
|
||||
0xf5, 0x0, 0x0, 0x2f, 0xcd, 0x0, 0x0, 0x0,
|
||||
0xaf, 0x50, 0x0, 0x0, 0x5, 0xf0, 0x0, 0x0,
|
||||
0x0, 0x5f, 0x0, 0x0, 0x0, 0x5, 0xf0, 0x0,
|
||||
0x0, 0x0, 0x5f, 0x0, 0x0,
|
||||
|
||||
/* U+005A "Z" */
|
||||
0xf, 0xff, 0xff, 0xf9, 0x3, 0x33, 0x37, 0xf5,
|
||||
0x0, 0x0, 0xe, 0xb0, 0x0, 0x0, 0x9e, 0x10,
|
||||
0x0, 0x4, 0xf5, 0x0, 0x0, 0xe, 0xb0, 0x0,
|
||||
0x0, 0x9e, 0x10, 0x0, 0x4, 0xf5, 0x0, 0x0,
|
||||
0xe, 0xd4, 0x44, 0x43, 0x2f, 0xff, 0xff, 0xfc,
|
||||
|
||||
/* U+005B "[" */
|
||||
0x5f, 0xff, 0x95, 0xf3, 0x31, 0x5f, 0x0, 0x5,
|
||||
0xf0, 0x0, 0x5f, 0x0, 0x5, 0xf0, 0x0, 0x5f,
|
||||
0x0, 0x5, 0xf0, 0x0, 0x5f, 0x0, 0x5, 0xf0,
|
||||
0x0, 0x5f, 0x0, 0x5, 0xff, 0xf9, 0x3, 0x33,
|
||||
0x10,
|
||||
|
||||
/* U+005C "\\" */
|
||||
0xf, 0x70, 0x0, 0x0, 0xac, 0x0, 0x0, 0x5,
|
||||
0xf1, 0x0, 0x0, 0x1f, 0x60, 0x0, 0x0, 0xca,
|
||||
0x0, 0x0, 0x7, 0xf0, 0x0, 0x0, 0x2f, 0x40,
|
||||
0x0, 0x0, 0xd9, 0x0, 0x0, 0x9, 0xe0, 0x0,
|
||||
0x0, 0x4f, 0x20, 0x0, 0x0, 0xf7, 0x0, 0x0,
|
||||
0xa, 0xc0, 0x0, 0x0, 0x37, 0x0,
|
||||
|
||||
/* U+005D "]" */
|
||||
0xef, 0xff, 0x23, 0x7f, 0x0, 0x5f, 0x0, 0x5f,
|
||||
0x0, 0x5f, 0x0, 0x5f, 0x0, 0x5f, 0x0, 0x5f,
|
||||
0x0, 0x5f, 0x0, 0x5f, 0x0, 0x5f, 0xef, 0xff,
|
||||
0x23, 0x33,
|
||||
|
||||
/* U+005E "^" */
|
||||
0x0, 0x47, 0x0, 0x0, 0xe, 0xf6, 0x0, 0x8,
|
||||
0xc5, 0xe0, 0x1, 0xf4, 0xd, 0x80, 0x9c, 0x0,
|
||||
0x5f, 0x10,
|
||||
|
||||
/* U+005F "_" */
|
||||
0x0, 0x0, 0x0, 0x0, 0x1f, 0xff, 0xff, 0xfb,
|
||||
0x3, 0x33, 0x33, 0x32,
|
||||
|
||||
/* U+0060 "`" */
|
||||
0x58, 0x20, 0x3f, 0x80, 0x8, 0xe0, 0x0, 0xc4,
|
||||
|
||||
/* U+0061 "a" */
|
||||
0x4, 0xbe, 0xfd, 0x50, 0x4, 0x95, 0x4c, 0xf0,
|
||||
0x0, 0x0, 0x4, 0xf1, 0x0, 0x7d, 0xef, 0xf1,
|
||||
0xa, 0xc4, 0x26, 0xf1, 0xf, 0x40, 0x4, 0xf1,
|
||||
0xd, 0xb3, 0x4e, 0xf5, 0x2, 0xcf, 0xe8, 0x9d,
|
||||
|
||||
/* U+0062 "b" */
|
||||
0xbf, 0xe0, 0x0, 0x0, 0x7, 0xe0, 0x0, 0x0,
|
||||
0x7, 0xe0, 0x0, 0x0, 0x7, 0xe7, 0xfe, 0x50,
|
||||
0x7, 0xfc, 0x48, 0xf3, 0x7, 0xf1, 0x0, 0xca,
|
||||
0x7, 0xe0, 0x0, 0x8c, 0x7, 0xe0, 0x0, 0x7d,
|
||||
0x7, 0xe0, 0x0, 0xba, 0x7, 0xfa, 0x26, 0xf4,
|
||||
0x7, 0xe8, 0xee, 0x60,
|
||||
|
||||
/* U+0063 "c" */
|
||||
0x0, 0x6d, 0xfd, 0x50, 0x5, 0xf8, 0x48, 0xf2,
|
||||
0xd, 0x90, 0x0, 0x10, 0xf, 0x50, 0x0, 0x0,
|
||||
0xf, 0x50, 0x0, 0x0, 0xd, 0x90, 0x0, 0x0,
|
||||
0x5, 0xf8, 0x45, 0xc4, 0x0, 0x6d, 0xfe, 0x91,
|
||||
|
||||
/* U+0064 "d" */
|
||||
0x0, 0x0, 0x4, 0xf1, 0x0, 0x0, 0x4, 0xf1,
|
||||
0x0, 0x0, 0x4, 0xf1, 0x0, 0x8e, 0xeb, 0xf1,
|
||||
0x8, 0xf7, 0x4b, 0xf1, 0xe, 0x70, 0x4, 0xf1,
|
||||
0x1f, 0x30, 0x4, 0xf1, 0x1f, 0x30, 0x4, 0xf1,
|
||||
0xe, 0x80, 0x4, 0xf1, 0x5, 0xf6, 0x37, 0xf6,
|
||||
0x0, 0x5d, 0xfd, 0xbe,
|
||||
|
||||
/* U+0065 "e" */
|
||||
0x0, 0x7e, 0xfc, 0x30, 0x7, 0xf7, 0x4a, 0xf1,
|
||||
0xf, 0x80, 0x0, 0xc7, 0x1f, 0x30, 0x0, 0x8a,
|
||||
0x2f, 0xff, 0xff, 0xfa, 0xe, 0x73, 0x33, 0x31,
|
||||
0x7, 0xe6, 0x34, 0x70, 0x0, 0x6d, 0xfe, 0xb2,
|
||||
|
||||
/* U+0066 "f" */
|
||||
0x0, 0x0, 0x9f, 0xeb, 0x20, 0x0, 0x5f, 0x74,
|
||||
0x92, 0x0, 0x7, 0xd0, 0x0, 0x0, 0x0, 0x7d,
|
||||
0x0, 0x0, 0x1f, 0xff, 0xff, 0xf8, 0x0, 0x33,
|
||||
0x9d, 0x33, 0x10, 0x0, 0x7, 0xd0, 0x0, 0x0,
|
||||
0x0, 0x7d, 0x0, 0x0, 0x0, 0x7, 0xd0, 0x0,
|
||||
0x0, 0x0, 0x7d, 0x0, 0x0, 0x0, 0x7, 0xd0,
|
||||
0x0, 0x0, 0x0, 0x8c, 0x0, 0x0, 0x4, 0x4d,
|
||||
0xb0, 0x0, 0x0, 0xff, 0xe4, 0x0, 0x0,
|
||||
|
||||
/* U+0067 "g" */
|
||||
0x0, 0x0, 0x0, 0xad, 0x0, 0x8e, 0xfc, 0xe7,
|
||||
0x8, 0xf6, 0x4b, 0xe0, 0xd, 0x80, 0x1, 0xf4,
|
||||
0xa, 0xc1, 0x6, 0xf2, 0x1, 0xdf, 0xfe, 0x60,
|
||||
0x9, 0xc4, 0x10, 0x0, 0x6, 0xff, 0xfe, 0xa1,
|
||||
0x0, 0x2, 0x34, 0xcb, 0x5, 0x0, 0x0, 0x7d,
|
||||
0xe, 0xb4, 0x35, 0xe8, 0x1, 0xae, 0xfd, 0x70,
|
||||
|
||||
/* U+0068 "h" */
|
||||
0x9f, 0xe0, 0x0, 0x0, 0x6, 0xe0, 0x0, 0x0,
|
||||
0x6, 0xe0, 0x0, 0x0, 0x6, 0xe5, 0xcf, 0xb0,
|
||||
0x6, 0xfe, 0x87, 0xf7, 0x6, 0xf0, 0x0, 0xd9,
|
||||
0x6, 0xe0, 0x0, 0xc9, 0x6, 0xe0, 0x0, 0xc9,
|
||||
0x6, 0xe0, 0x0, 0xc9, 0x6, 0xe0, 0x0, 0xc9,
|
||||
0x6, 0xe0, 0x0, 0xc9,
|
||||
|
||||
/* U+0069 "i" */
|
||||
0x0, 0x8e, 0x20, 0x0, 0xb, 0xf4, 0x0, 0x0,
|
||||
0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0xe, 0xff,
|
||||
0x50, 0x0, 0x33, 0xf5, 0x0, 0x0, 0xf, 0x50,
|
||||
0x0, 0x0, 0xf5, 0x0, 0x0, 0xf, 0x50, 0x2,
|
||||
0x44, 0xf8, 0x42, 0xaf, 0xff, 0xff, 0x90,
|
||||
|
||||
/* U+006A "j" */
|
||||
0x0, 0x1d, 0xb0, 0x0, 0x2f, 0xd0, 0x0, 0x2,
|
||||
0x10, 0x0, 0x0, 0x0, 0xf, 0xff, 0xf8, 0x3,
|
||||
0x33, 0xe8, 0x0, 0x0, 0xd8, 0x0, 0x0, 0xd8,
|
||||
0x0, 0x0, 0xd8, 0x0, 0x0, 0xd8, 0x0, 0x0,
|
||||
0xd8, 0x0, 0x0, 0xe7, 0x34, 0x46, 0xf6, 0xdf,
|
||||
0xff, 0xc1,
|
||||
|
||||
/* U+006B "k" */
|
||||
0xab, 0x0, 0x0, 0x0, 0xab, 0x0, 0x0, 0x0,
|
||||
0xab, 0x0, 0x0, 0x0, 0xab, 0x0, 0x9f, 0x20,
|
||||
0xab, 0x8, 0xf3, 0x0, 0xab, 0x6f, 0x50, 0x0,
|
||||
0xae, 0xfa, 0x0, 0x0, 0xaf, 0xaf, 0x50, 0x0,
|
||||
0xac, 0x8, 0xf2, 0x0, 0xab, 0x0, 0xbd, 0x10,
|
||||
0xab, 0x0, 0xd, 0xb0,
|
||||
|
||||
/* U+006C "l" */
|
||||
0xaf, 0xf5, 0x0, 0x0, 0x1f, 0x50, 0x0, 0x0,
|
||||
0xf5, 0x0, 0x0, 0xf, 0x50, 0x0, 0x0, 0xf5,
|
||||
0x0, 0x0, 0xf, 0x50, 0x0, 0x0, 0xf5, 0x0,
|
||||
0x0, 0xf, 0x50, 0x0, 0x0, 0xf5, 0x0, 0x0,
|
||||
0xe, 0xb4, 0x40, 0x0, 0x6f, 0xff, 0x20,
|
||||
|
||||
/* U+006D "m" */
|
||||
0x8c, 0xbe, 0x99, 0xea, 0x8, 0xe2, 0x6f, 0x42,
|
||||
0xf2, 0x8c, 0x4, 0xf0, 0x1f, 0x39, 0xb0, 0x4f,
|
||||
0x0, 0xf3, 0x9b, 0x5, 0xf0, 0x1f, 0x48, 0xc0,
|
||||
0x5f, 0x1, 0xf4, 0x8c, 0x5, 0xf0, 0x1f, 0x37,
|
||||
0xd0, 0x5f, 0x2, 0xf3,
|
||||
|
||||
/* U+006E "n" */
|
||||
0xc8, 0x8d, 0xf9, 0xc, 0xfa, 0x47, 0xf4, 0xc9,
|
||||
0x0, 0xf, 0x6c, 0x90, 0x0, 0xf7, 0xc9, 0x0,
|
||||
0xf, 0x7c, 0x90, 0x0, 0xf7, 0xc9, 0x0, 0xf,
|
||||
0x7c, 0x90, 0x0, 0xf7,
|
||||
|
||||
/* U+006F "o" */
|
||||
0x0, 0x7e, 0xfc, 0x40, 0x7, 0xf6, 0x49, 0xf2,
|
||||
0xe, 0x80, 0x0, 0xd8, 0xf, 0x40, 0x0, 0xab,
|
||||
0xf, 0x40, 0x0, 0xab, 0xe, 0x80, 0x0, 0xd8,
|
||||
0x7, 0xf6, 0x49, 0xf2, 0x0, 0x7e, 0xfc, 0x40,
|
||||
|
||||
/* U+0070 "p" */
|
||||
0x9f, 0xe8, 0xee, 0x80, 0x0, 0x6f, 0xb3, 0x4e,
|
||||
0x70, 0x6, 0xf0, 0x0, 0x8d, 0x0, 0x6e, 0x0,
|
||||
0x7, 0xe0, 0x6, 0xe0, 0x0, 0x9d, 0x0, 0x6e,
|
||||
0x0, 0xe, 0x80, 0x6, 0xf8, 0x4b, 0xe1, 0x0,
|
||||
0x6f, 0xdf, 0xb2, 0x0, 0x6, 0xe0, 0x0, 0x0,
|
||||
0x0, 0x6e, 0x0, 0x0, 0x0, 0x6, 0xe0, 0x0,
|
||||
0x0, 0x0,
|
||||
|
||||
/* U+0071 "q" */
|
||||
0x0, 0xaf, 0xd6, 0xf1, 0x0, 0x9e, 0x55, 0xef,
|
||||
0x10, 0xf, 0x60, 0x5, 0xf1, 0x2, 0xf2, 0x0,
|
||||
0x3f, 0x10, 0x2f, 0x20, 0x3, 0xf1, 0x0, 0xf6,
|
||||
0x0, 0x6f, 0x10, 0x9, 0xe5, 0x5e, 0xf1, 0x0,
|
||||
0xa, 0xfd, 0x7f, 0x10, 0x0, 0x0, 0x3, 0xf1,
|
||||
0x0, 0x0, 0x0, 0x1f, 0x81, 0x0, 0x0, 0x0,
|
||||
0x9f, 0x70,
|
||||
|
||||
/* U+0072 "r" */
|
||||
0xa, 0xfc, 0x6e, 0xe8, 0x0, 0x8, 0xfc, 0x46,
|
||||
0x50, 0x0, 0x8e, 0x0, 0x0, 0x0, 0x8, 0xe0,
|
||||
0x0, 0x0, 0x0, 0x8e, 0x0, 0x0, 0x0, 0x8,
|
||||
0xe0, 0x0, 0x0, 0x4, 0xae, 0x44, 0x30, 0x1,
|
||||
0xff, 0xff, 0xfd, 0x0,
|
||||
|
||||
/* U+0073 "s" */
|
||||
0x6, 0xdf, 0xd6, 0x5, 0xf7, 0x47, 0xc0, 0x7f,
|
||||
0x20, 0x0, 0x0, 0x9f, 0xa4, 0x0, 0x0, 0x17,
|
||||
0xeb, 0x0, 0x0, 0x1, 0xf6, 0x8d, 0x74, 0x7f,
|
||||
0x51, 0x9e, 0xfd, 0x70,
|
||||
|
||||
/* U+0074 "t" */
|
||||
0x0, 0x64, 0x0, 0x0, 0xd, 0x80, 0x0, 0xff,
|
||||
0xff, 0xff, 0x64, 0x4e, 0xa4, 0x41, 0x0, 0xd8,
|
||||
0x0, 0x0, 0xd, 0x80, 0x0, 0x0, 0xd8, 0x0,
|
||||
0x0, 0xd, 0x80, 0x0, 0x0, 0xbd, 0x54, 0x10,
|
||||
0x3, 0xef, 0xf5,
|
||||
|
||||
/* U+0075 "u" */
|
||||
0xe7, 0x0, 0x1f, 0x40, 0xe7, 0x0, 0x1f, 0x40,
|
||||
0xe7, 0x0, 0x1f, 0x40, 0xe7, 0x0, 0x1f, 0x40,
|
||||
0xe7, 0x0, 0x1f, 0x40, 0xe9, 0x0, 0x2f, 0x40,
|
||||
0xae, 0x57, 0xef, 0x90, 0x2d, 0xfc, 0x37, 0xf0,
|
||||
|
||||
/* U+0076 "v" */
|
||||
0x1f, 0x50, 0x0, 0xac, 0xd, 0x90, 0x0, 0xe8,
|
||||
0x9, 0xd0, 0x3, 0xf3, 0x4, 0xf2, 0x7, 0xe0,
|
||||
0x0, 0xf7, 0xc, 0xa0, 0x0, 0x9d, 0x2f, 0x40,
|
||||
0x0, 0x2f, 0xcd, 0x0, 0x0, 0xa, 0xf5, 0x0,
|
||||
|
||||
/* U+0077 "w" */
|
||||
0x6e, 0x0, 0x0, 0x4f, 0x15, 0xf0, 0x0, 0x4,
|
||||
0xf0, 0x4f, 0x2, 0x70, 0x5f, 0x3, 0xf1, 0x8f,
|
||||
0x36, 0xe0, 0x1f, 0x2d, 0xc8, 0x8c, 0x0, 0xf7,
|
||||
0xe4, 0xd9, 0xa0, 0xc, 0xea, 0xf, 0xe7, 0x0,
|
||||
0x9f, 0x60, 0xbf, 0x30,
|
||||
|
||||
/* U+0078 "x" */
|
||||
0x9e, 0x0, 0x4f, 0x31, 0xe8, 0xd, 0xa0, 0x6,
|
||||
0xf9, 0xf1, 0x0, 0xc, 0xf7, 0x0, 0x0, 0xdf,
|
||||
0x80, 0x0, 0x7f, 0x7f, 0x20, 0x1f, 0x70, 0xcb,
|
||||
0xa, 0xd0, 0x3, 0xf5,
|
||||
|
||||
/* U+0079 "y" */
|
||||
0x5f, 0xf2, 0x0, 0xd8, 0x4, 0xf2, 0x0, 0xd8,
|
||||
0x3, 0xf2, 0x0, 0xd8, 0x3, 0xf2, 0x0, 0xd8,
|
||||
0x3, 0xf2, 0x0, 0xd8, 0x2, 0xf4, 0x0, 0xd8,
|
||||
0x0, 0xec, 0x6c, 0xf8, 0x0, 0x4e, 0xe9, 0xd8,
|
||||
0x0, 0x0, 0x0, 0xd8, 0x0, 0x24, 0x5a, 0xf4,
|
||||
0x0, 0x9f, 0xfe, 0x80,
|
||||
|
||||
/* U+007A "z" */
|
||||
0xbf, 0xff, 0xff, 0x42, 0x44, 0x4d, 0xe1, 0x0,
|
||||
0x7, 0xf4, 0x0, 0x4, 0xf7, 0x0, 0x1, 0xeb,
|
||||
0x0, 0x0, 0xcd, 0x10, 0x0, 0x9f, 0x64, 0x44,
|
||||
0x1d, 0xff, 0xff, 0xf7,
|
||||
|
||||
/* U+007B "{" */
|
||||
0x0, 0x5c, 0xe5, 0x0, 0xf9, 0x41, 0x0, 0xf2,
|
||||
0x0, 0x0, 0xb7, 0x0, 0x0, 0x8a, 0x0, 0x3,
|
||||
0xe4, 0x0, 0xef, 0x90, 0x0, 0x25, 0xe4, 0x0,
|
||||
0x0, 0x8a, 0x0, 0x0, 0xc5, 0x0, 0x0, 0xf5,
|
||||
0x10, 0x0, 0xaf, 0xf5, 0x0, 0x0, 0x21,
|
||||
|
||||
/* U+007C "|" */
|
||||
0x5f, 0x5, 0xf0, 0x5f, 0x5, 0xf0, 0x5f, 0x5,
|
||||
0xf0, 0x5f, 0x5, 0xf0, 0x5f, 0x5, 0xf0, 0x5f,
|
||||
0x5, 0xf0, 0x5f, 0x0,
|
||||
|
||||
/* U+007D "}" */
|
||||
0xae, 0xa2, 0x0, 0x35, 0xca, 0x0, 0x0, 0x7a,
|
||||
0x0, 0x0, 0xd5, 0x0, 0x0, 0xf3, 0x0, 0x0,
|
||||
0x9b, 0x10, 0x0, 0xd, 0xf9, 0x0, 0x9c, 0x41,
|
||||
0x0, 0xf3, 0x0, 0x0, 0xa7, 0x0, 0x1, 0xab,
|
||||
0x0, 0xaf, 0xf5, 0x0, 0x22, 0x0, 0x0,
|
||||
|
||||
/* U+007E "~" */
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x3d, 0xc2, 0x0,
|
||||
0x50, 0x2e, 0x89, 0xe5, 0xac, 0x0, 0x60, 0x6,
|
||||
0xfb, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
|
||||
/* U+F035B "" */
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0xc5, 0x3e, 0x0, 0x0, 0x0, 0x8e, 0xfe, 0xef,
|
||||
0xeb, 0x0, 0x0, 0xe6, 0x33, 0x33, 0x3f, 0x30,
|
||||
0x3, 0xf3, 0x23, 0x33, 0xe, 0x61, 0x1f, 0xf3,
|
||||
0xcf, 0xfe, 0xe, 0xf6, 0x0, 0xe3, 0xc5, 0x4e,
|
||||
0xe, 0x30, 0x1f, 0xf3, 0xcf, 0xfe, 0xe, 0xf6,
|
||||
0x0, 0xe3, 0x0, 0x0, 0xe, 0x40, 0x0, 0xce,
|
||||
0xee, 0xee, 0xef, 0x20, 0x0, 0x13, 0xd8, 0x6f,
|
||||
0x32, 0x0, 0x0, 0x0, 0x52, 0x16, 0x0, 0x0
|
||||
};
|
||||
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
|
||||
static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
|
||||
{.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */,
|
||||
{.bitmap_index = 0, .adv_w = 139, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 0, .adv_w = 139, .box_w = 3, .box_h = 10, .ofs_x = 3, .ofs_y = 0},
|
||||
{.bitmap_index = 15, .adv_w = 139, .box_w = 5, .box_h = 4, .ofs_x = 2, .ofs_y = 6},
|
||||
{.bitmap_index = 25, .adv_w = 139, .box_w = 8, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 65, .adv_w = 139, .box_w = 8, .box_h = 12, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 113, .adv_w = 139, .box_w = 9, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 158, .adv_w = 139, .box_w = 9, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 203, .adv_w = 139, .box_w = 3, .box_h = 4, .ofs_x = 3, .ofs_y = 6},
|
||||
{.bitmap_index = 209, .adv_w = 139, .box_w = 6, .box_h = 13, .ofs_x = 1, .ofs_y = -2},
|
||||
{.bitmap_index = 248, .adv_w = 139, .box_w = 5, .box_h = 13, .ofs_x = 2, .ofs_y = -2},
|
||||
{.bitmap_index = 281, .adv_w = 139, .box_w = 8, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
|
||||
{.bitmap_index = 309, .adv_w = 139, .box_w = 7, .box_h = 8, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 337, .adv_w = 139, .box_w = 4, .box_h = 5, .ofs_x = 2, .ofs_y = -3},
|
||||
{.bitmap_index = 347, .adv_w = 139, .box_w = 7, .box_h = 3, .ofs_x = 1, .ofs_y = 3},
|
||||
{.bitmap_index = 358, .adv_w = 139, .box_w = 3, .box_h = 3, .ofs_x = 3, .ofs_y = 0},
|
||||
{.bitmap_index = 363, .adv_w = 139, .box_w = 6, .box_h = 13, .ofs_x = 1, .ofs_y = -2},
|
||||
{.bitmap_index = 402, .adv_w = 139, .box_w = 8, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 442, .adv_w = 139, .box_w = 7, .box_h = 10, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 477, .adv_w = 139, .box_w = 7, .box_h = 10, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 512, .adv_w = 139, .box_w = 7, .box_h = 10, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 547, .adv_w = 139, .box_w = 7, .box_h = 10, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 582, .adv_w = 139, .box_w = 7, .box_h = 10, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 617, .adv_w = 139, .box_w = 7, .box_h = 11, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 656, .adv_w = 139, .box_w = 7, .box_h = 10, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 691, .adv_w = 139, .box_w = 8, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 731, .adv_w = 139, .box_w = 8, .box_h = 11, .ofs_x = 0, .ofs_y = -1},
|
||||
{.bitmap_index = 775, .adv_w = 139, .box_w = 3, .box_h = 8, .ofs_x = 3, .ofs_y = 0},
|
||||
{.bitmap_index = 787, .adv_w = 139, .box_w = 4, .box_h = 11, .ofs_x = 2, .ofs_y = -3},
|
||||
{.bitmap_index = 809, .adv_w = 139, .box_w = 7, .box_h = 9, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 841, .adv_w = 139, .box_w = 7, .box_h = 6, .ofs_x = 1, .ofs_y = 2},
|
||||
{.bitmap_index = 862, .adv_w = 139, .box_w = 7, .box_h = 9, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 894, .adv_w = 139, .box_w = 9, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 939, .adv_w = 139, .box_w = 9, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 984, .adv_w = 139, .box_w = 9, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 1029, .adv_w = 139, .box_w = 8, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 1069, .adv_w = 139, .box_w = 9, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 1114, .adv_w = 139, .box_w = 9, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 1159, .adv_w = 139, .box_w = 7, .box_h = 10, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 1194, .adv_w = 139, .box_w = 7, .box_h = 10, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 1229, .adv_w = 139, .box_w = 9, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 1274, .adv_w = 139, .box_w = 7, .box_h = 10, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 1309, .adv_w = 139, .box_w = 7, .box_h = 10, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 1344, .adv_w = 139, .box_w = 7, .box_h = 10, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 1379, .adv_w = 139, .box_w = 8, .box_h = 10, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 1419, .adv_w = 139, .box_w = 7, .box_h = 10, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 1454, .adv_w = 139, .box_w = 9, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 1499, .adv_w = 139, .box_w = 8, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 1539, .adv_w = 139, .box_w = 9, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 1584, .adv_w = 139, .box_w = 8, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 1624, .adv_w = 139, .box_w = 9, .box_h = 12, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 1678, .adv_w = 139, .box_w = 9, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 1723, .adv_w = 139, .box_w = 9, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 1768, .adv_w = 139, .box_w = 8, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 1808, .adv_w = 139, .box_w = 8, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 1848, .adv_w = 139, .box_w = 9, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 1893, .adv_w = 139, .box_w = 9, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 1938, .adv_w = 139, .box_w = 8, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 1978, .adv_w = 139, .box_w = 9, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 2023, .adv_w = 139, .box_w = 8, .box_h = 10, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 2063, .adv_w = 139, .box_w = 5, .box_h = 13, .ofs_x = 2, .ofs_y = -2},
|
||||
{.bitmap_index = 2096, .adv_w = 139, .box_w = 7, .box_h = 13, .ofs_x = 1, .ofs_y = -2},
|
||||
{.bitmap_index = 2142, .adv_w = 139, .box_w = 4, .box_h = 13, .ofs_x = 2, .ofs_y = -2},
|
||||
{.bitmap_index = 2168, .adv_w = 139, .box_w = 7, .box_h = 5, .ofs_x = 1, .ofs_y = 6},
|
||||
{.bitmap_index = 2186, .adv_w = 139, .box_w = 8, .box_h = 3, .ofs_x = 0, .ofs_y = -2},
|
||||
{.bitmap_index = 2198, .adv_w = 139, .box_w = 4, .box_h = 4, .ofs_x = 2, .ofs_y = 7},
|
||||
{.bitmap_index = 2206, .adv_w = 139, .box_w = 8, .box_h = 8, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 2238, .adv_w = 139, .box_w = 8, .box_h = 11, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 2282, .adv_w = 139, .box_w = 8, .box_h = 8, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 2314, .adv_w = 139, .box_w = 8, .box_h = 11, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 2358, .adv_w = 139, .box_w = 8, .box_h = 8, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 2390, .adv_w = 139, .box_w = 9, .box_h = 14, .ofs_x = 0, .ofs_y = -3},
|
||||
{.bitmap_index = 2453, .adv_w = 139, .box_w = 8, .box_h = 12, .ofs_x = 0, .ofs_y = -3},
|
||||
{.bitmap_index = 2501, .adv_w = 139, .box_w = 8, .box_h = 11, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 2545, .adv_w = 139, .box_w = 7, .box_h = 11, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 2584, .adv_w = 139, .box_w = 6, .box_h = 14, .ofs_x = 1, .ofs_y = -3},
|
||||
{.bitmap_index = 2626, .adv_w = 139, .box_w = 8, .box_h = 11, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 2670, .adv_w = 139, .box_w = 7, .box_h = 11, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 2709, .adv_w = 139, .box_w = 9, .box_h = 8, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 2745, .adv_w = 139, .box_w = 7, .box_h = 8, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 2773, .adv_w = 139, .box_w = 8, .box_h = 8, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 2805, .adv_w = 139, .box_w = 9, .box_h = 11, .ofs_x = 0, .ofs_y = -3},
|
||||
{.bitmap_index = 2855, .adv_w = 139, .box_w = 9, .box_h = 11, .ofs_x = 0, .ofs_y = -3},
|
||||
{.bitmap_index = 2905, .adv_w = 139, .box_w = 9, .box_h = 8, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 2941, .adv_w = 139, .box_w = 7, .box_h = 8, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 2969, .adv_w = 139, .box_w = 7, .box_h = 10, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 3004, .adv_w = 139, .box_w = 8, .box_h = 8, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 3036, .adv_w = 139, .box_w = 8, .box_h = 8, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 3068, .adv_w = 139, .box_w = 9, .box_h = 8, .ofs_x = 0, .ofs_y = 0},
|
||||
{.bitmap_index = 3104, .adv_w = 139, .box_w = 7, .box_h = 8, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 3132, .adv_w = 139, .box_w = 8, .box_h = 11, .ofs_x = 0, .ofs_y = -3},
|
||||
{.bitmap_index = 3176, .adv_w = 139, .box_w = 7, .box_h = 8, .ofs_x = 1, .ofs_y = 0},
|
||||
{.bitmap_index = 3204, .adv_w = 139, .box_w = 6, .box_h = 13, .ofs_x = 1, .ofs_y = -2},
|
||||
{.bitmap_index = 3243, .adv_w = 139, .box_w = 3, .box_h = 13, .ofs_x = 3, .ofs_y = -2},
|
||||
{.bitmap_index = 3263, .adv_w = 139, .box_w = 6, .box_h = 13, .ofs_x = 2, .ofs_y = -2},
|
||||
{.bitmap_index = 3302, .adv_w = 139, .box_w = 9, .box_h = 5, .ofs_x = 0, .ofs_y = 2},
|
||||
{.bitmap_index = 3325, .adv_w = 139, .box_w = 12, .box_h = 12, .ofs_x = -1, .ofs_y = 0}
|
||||
};
|
||||
|
||||
/*---------------------
|
||||
* CHARACTER MAPPING
|
||||
*--------------------*/
|
||||
|
||||
|
||||
|
||||
/*Collect the unicode lists and glyph_id offsets*/
|
||||
static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
{
|
||||
{
|
||||
.range_start = 32, .range_length = 95, .glyph_id_start = 1,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
},
|
||||
{
|
||||
.range_start = 983899, .range_length = 1, .glyph_id_start = 96,
|
||||
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*--------------------
|
||||
* ALL CUSTOM DATA
|
||||
*--------------------*/
|
||||
|
||||
#if LVGL_VERSION_MAJOR == 8
|
||||
/*Store all the custom data of the font*/
|
||||
static lv_font_fmt_txt_glyph_cache_t cache;
|
||||
#endif
|
||||
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
static const lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#else
|
||||
static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#endif
|
||||
.glyph_bitmap = glyph_bitmap,
|
||||
.glyph_dsc = glyph_dsc,
|
||||
.cmaps = cmaps,
|
||||
.kern_dsc = NULL,
|
||||
.kern_scale = 0,
|
||||
.cmap_num = 2,
|
||||
.bpp = 4,
|
||||
.kern_classes = 0,
|
||||
.bitmap_format = 0,
|
||||
#if LVGL_VERSION_MAJOR == 8
|
||||
.cache = &cache
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
|
||||
/*Initialize a public general font descriptor*/
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
const lv_font_t nerdfonts_0xproto_14 = {
|
||||
#else
|
||||
lv_font_t nerdfonts_0xproto_14 = {
|
||||
#endif
|
||||
.get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/
|
||||
.get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/
|
||||
.line_height = 15, /*The maximum line height required by the font*/
|
||||
.base_line = 3, /*Baseline measured from the bottom of the line*/
|
||||
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
|
||||
.subpx = LV_FONT_SUBPX_NONE,
|
||||
#endif
|
||||
#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8
|
||||
.underline_position = -1,
|
||||
.underline_thickness = 1,
|
||||
#endif
|
||||
.dsc = &font_dsc, /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
.fallback = NULL,
|
||||
.user_data = NULL
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /*#if NERDFONTS_0XPROTO_14*/
|
||||
|
1043
src/fonts/nerdfonts_arimo_14.c
Executable file
1043
src/fonts/nerdfonts_arimo_14.c
Executable file
File diff suppressed because it is too large
Load Diff
139
src/lvgl_port/lvgl_fb_port.c
Normal file
139
src/lvgl_port/lvgl_fb_port.c
Normal file
@ -0,0 +1,139 @@
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <pthread.h>
|
||||
#include <sched.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
#include "fbd.h"
|
||||
#include "ui.h"
|
||||
|
||||
|
||||
uint32_t disp_width = 0;
|
||||
uint32_t disp_height = 0;
|
||||
|
||||
|
||||
static volatile sig_atomic_t running = 1;
|
||||
|
||||
|
||||
static void sig_handler(int sig);
|
||||
void* tick_thread(void* arg);
|
||||
|
||||
|
||||
void fb_flush_cb(lv_display_t* display, const lv_area_t* area, uint8_t* px_map)
|
||||
{
|
||||
struct framebuf* fb = (struct framebuf*)lv_display_get_user_data(display);
|
||||
|
||||
int32_t area_width_b = (area->x2 - area->x1 + 1) * 2; // Two bytes per pixel
|
||||
|
||||
|
||||
for (int32_t y = area->y1; y <= area->y2; y++) {
|
||||
// memcpy is faster than copying manually
|
||||
memcpy(fb->buf + (y * fb->xres) + area->x1, px_map, area_width_b);
|
||||
px_map += area_width_b;
|
||||
}
|
||||
|
||||
lv_display_flush_ready(display);
|
||||
}
|
||||
|
||||
uint32_t disp_hpercent_to_px(uint32_t percent)
|
||||
{
|
||||
return (disp_width * percent) / 100;
|
||||
}
|
||||
|
||||
uint32_t disp_vpercent_to_px(uint32_t percent)
|
||||
{
|
||||
return (disp_height * percent) / 100;
|
||||
}
|
||||
|
||||
int lvgl_fb_run(const char* const fb_dev)
|
||||
{
|
||||
struct sigaction act;
|
||||
act.sa_handler = sig_handler;
|
||||
sigaction(SIGINT, &act, NULL);
|
||||
|
||||
|
||||
struct framebuf fb;
|
||||
int ret = open_fb(&fb, fb_dev);
|
||||
if (ret != 0) {
|
||||
printf("Failed to open framebuf. Error: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
clear_fb(&fb);
|
||||
|
||||
disp_width = fb.xres;
|
||||
disp_height = fb.yres;
|
||||
|
||||
printf("Opened framebuffer %s with dimensions %dx%d\n", fb_dev, disp_width, disp_height);
|
||||
|
||||
lv_init();
|
||||
|
||||
lv_display_t* display = lv_display_create(disp_width, disp_height);
|
||||
lv_display_set_flush_cb(display, fb_flush_cb);
|
||||
lv_display_set_user_data(display, &fb);
|
||||
|
||||
uint16_t* buf1 = (uint16_t*)malloc(fb.size);
|
||||
lv_display_set_buffers(display, buf1, NULL, fb.size, LV_DISPLAY_RENDER_MODE_PARTIAL);
|
||||
|
||||
|
||||
create_widgets();
|
||||
|
||||
// Copied from https://stackoverflow.com/a/27558789
|
||||
pthread_attr_t attr;
|
||||
struct sched_param param;
|
||||
|
||||
pthread_attr_init(&attr);
|
||||
pthread_attr_getschedparam(&attr, ¶m);
|
||||
(param.sched_priority)++;
|
||||
pthread_attr_setschedparam(&attr, ¶m);
|
||||
|
||||
running = true;
|
||||
|
||||
pthread_t thread_id;
|
||||
pthread_create(&thread_id, &attr, tick_thread, NULL);
|
||||
|
||||
|
||||
while (running) {
|
||||
uint32_t time_till_next = lv_task_handler();
|
||||
usleep(time_till_next * 1000);
|
||||
}
|
||||
|
||||
printf("\nStopping gracefully\n");
|
||||
|
||||
|
||||
pthread_join(thread_id, NULL);
|
||||
|
||||
destroy_widgets();
|
||||
|
||||
free(buf1);
|
||||
|
||||
close_fb(&fb);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void* tick_thread(void* arg)
|
||||
{
|
||||
(void) arg;
|
||||
|
||||
while (running) {
|
||||
usleep(5 * 1000);
|
||||
lv_tick_inc(5);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void sig_handler(int sig)
|
||||
{
|
||||
(void) sig;
|
||||
|
||||
running = 0;
|
||||
}
|
||||
|
9
src/main.c
Normal file
9
src/main.c
Normal file
@ -0,0 +1,9 @@
|
||||
#include "lvgl_port/lvgl_fb_port.h"
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
return lvgl_fb_run("/dev/fb0");
|
||||
}
|
||||
|
279
src/ui/calendar.c
Normal file
279
src/ui/calendar.c
Normal file
@ -0,0 +1,279 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
#include "date_utils.h"
|
||||
#include "calendar.h"
|
||||
#include "fonts.h"
|
||||
|
||||
|
||||
static lv_style_t box_style;
|
||||
static lv_style_t box_style_active;
|
||||
static lv_style_t box_style_inactive;
|
||||
|
||||
static const char* const month_list[] = {
|
||||
"January",
|
||||
"February",
|
||||
"March",
|
||||
"April",
|
||||
"May",
|
||||
"June",
|
||||
"July",
|
||||
"August",
|
||||
"September",
|
||||
"October",
|
||||
"November",
|
||||
"December",
|
||||
};
|
||||
|
||||
static const char* const event_format_strs[] = {
|
||||
NF_SYMBOL_CAMERA " %d meeting(s)",
|
||||
NF_SYMBOL_UPDATE " %d cascade(s)",
|
||||
NF_SYMBOL_LAPTOP " %d setup(s)",
|
||||
NF_SYMBOL_CALENDAR " %d appointment(s)",
|
||||
NF_SYMBOL_CALENDAR_QUESTION " %d other event(s)",
|
||||
};
|
||||
|
||||
|
||||
lvc_calendar_row_t* create_row(lv_obj_t* parent);
|
||||
lvc_calendar_box_t* create_box(lv_obj_t* parent);
|
||||
void destroy_row(lvc_calendar_row_t* row);
|
||||
void destroy_box(lvc_calendar_box_t* row);
|
||||
void style_calendar(lvc_calendar_t* cal, const struct tm* const ct);
|
||||
int style_row(lvc_calendar_row_t* row, lv_obj_t* last_row, uint32_t box_width, uint32_t box_height, int day, int current_day, int days_in_month);
|
||||
void style_box(lvc_calendar_box_t* box, uint32_t width, uint32_t height, int day, int wday, bool today, int days_in_month);
|
||||
void draw_event_list_cb(lv_event_t* event);
|
||||
void calendar_refresh_event(lv_event_t* event);
|
||||
|
||||
|
||||
|
||||
static inline void init_style(uint32_t box_width, uint32_t box_height)
|
||||
{
|
||||
lv_style_init(&box_style);
|
||||
lv_style_set_width(&box_style, box_width);
|
||||
lv_style_set_height(&box_style, box_height);
|
||||
lv_style_set_radius(&box_style, 0);
|
||||
lv_style_set_bg_color(&box_style, lv_color_hex(0xffffff));
|
||||
lv_style_set_bg_opa(&box_style, LV_OPA_COVER);
|
||||
lv_style_set_border_width(&box_style, 2);
|
||||
lv_style_set_border_color(&box_style, lv_color_hex(0x333333));
|
||||
lv_style_set_pad_all(&box_style, 5);
|
||||
|
||||
lv_style_init(&box_style_active);
|
||||
lv_style_set_bg_color(&box_style_active, lv_color_hex(0xbbbbbb));
|
||||
lv_style_set_text_color(&box_style_active, lv_color_hex(0x000000));
|
||||
|
||||
lv_style_init(&box_style_inactive);
|
||||
lv_style_set_bg_color(&box_style_inactive, lv_color_hex(0x646464));
|
||||
}
|
||||
|
||||
lvc_calendar_t* create_calendar(lv_obj_t* parent, uint32_t width)
|
||||
{
|
||||
time_t t = time(NULL);
|
||||
struct tm* ct = localtime(&t);
|
||||
|
||||
lvc_calendar_t* cal = malloc(sizeof(lvc_calendar_t));
|
||||
cal->calendar = lv_obj_create(parent);
|
||||
cal->title_bar = lv_obj_create(cal->calendar);
|
||||
cal->title_label = lv_label_create(cal->title_bar);
|
||||
cal->width = width - (width % 7);
|
||||
cal->box_width = cal->width / 7;
|
||||
cal->box_height = cal->box_width * 0.8;
|
||||
|
||||
init_style(cal->box_width, cal->box_height);
|
||||
|
||||
for (uint8_t i = 0; i < CALENDAR_ROWS; i++) {
|
||||
cal->rows[i] = create_row(cal->calendar);
|
||||
}
|
||||
|
||||
style_calendar(cal, ct);
|
||||
|
||||
lv_obj_add_event_cb(cal->calendar, calendar_refresh_event, LV_EVENT_REFRESH, cal);
|
||||
|
||||
return cal;
|
||||
}
|
||||
|
||||
lvc_calendar_row_t* create_row(lv_obj_t* parent)
|
||||
{
|
||||
lvc_calendar_row_t* row = malloc(sizeof(lvc_calendar_row_t));
|
||||
|
||||
for (uint8_t i = 0; i < DAYS_IN_WEEK; i++) {
|
||||
row->boxes[i] = create_box(parent);
|
||||
}
|
||||
|
||||
return row;
|
||||
}
|
||||
|
||||
lvc_calendar_box_t* create_box(lv_obj_t* parent)
|
||||
{
|
||||
lvc_calendar_box_t* box = malloc(sizeof(lvc_calendar_box_t));
|
||||
|
||||
box->box = lv_obj_create(parent);
|
||||
box->label = lv_label_create(box->box);
|
||||
|
||||
for (size_t i = 0; i < EVENTS_COUNT; i++) {
|
||||
box->event_count_labels[i] = lv_label_create(box->box);
|
||||
}
|
||||
|
||||
return box;
|
||||
}
|
||||
|
||||
void destroy_calendar(lvc_calendar_t* cal)
|
||||
{
|
||||
for (uint8_t i = 0; i < CALENDAR_ROWS; i++) {
|
||||
destroy_row(cal->rows[i]);
|
||||
}
|
||||
|
||||
lv_obj_delete(cal->title_label);
|
||||
lv_obj_delete(cal->title_bar);
|
||||
lv_obj_delete(cal->calendar);
|
||||
|
||||
free(cal);
|
||||
}
|
||||
|
||||
void destroy_row(lvc_calendar_row_t* row)
|
||||
{
|
||||
for (uint8_t i = 0; i < DAYS_IN_WEEK; i++) {
|
||||
destroy_box(row->boxes[i]);
|
||||
}
|
||||
|
||||
free(row);
|
||||
}
|
||||
|
||||
void destroy_box(lvc_calendar_box_t* box)
|
||||
{
|
||||
lv_obj_delete(box->label);
|
||||
|
||||
for (size_t i = 0; i < EVENTS_COUNT; i++) {
|
||||
lv_obj_delete(box->event_count_labels[i]);
|
||||
}
|
||||
|
||||
lv_obj_delete(box->box);
|
||||
|
||||
free(box);
|
||||
}
|
||||
|
||||
void style_calendar(lvc_calendar_t* cal, const struct tm* const ct)
|
||||
{
|
||||
int days = daysInMonth(ct->tm_mon, ct->tm_year + 1900);
|
||||
int start_day = 1 - firstDayOfMonth(ct->tm_mon, ct->tm_year + 1900);
|
||||
|
||||
if (start_day == -5 && days == 31) {
|
||||
start_day += 7;
|
||||
}
|
||||
|
||||
lv_obj_set_size(cal->calendar, cal->width, cal->box_height * 6);
|
||||
lv_obj_set_style_pad_all(cal->calendar, 0, LV_PART_MAIN);
|
||||
lv_obj_set_style_border_width(cal->calendar, 0, LV_PART_MAIN);
|
||||
|
||||
lv_obj_remove_style_all(cal->title_bar);
|
||||
lv_obj_set_size(cal->title_bar, cal->width, cal->box_height);
|
||||
lv_obj_align(cal->title_bar, LV_ALIGN_TOP_MID, 0, 0);
|
||||
lv_obj_set_style_pad_all(cal->title_bar, 0, LV_PART_MAIN);
|
||||
lv_obj_add_style(cal->title_bar, &box_style, LV_PART_MAIN);
|
||||
|
||||
lv_obj_remove_style_all(cal->title_label);
|
||||
lv_label_set_text_fmt(cal->title_label, "%s %d", month_list[ct->tm_mon], ct->tm_year + 1900);
|
||||
lv_obj_set_style_text_font(cal->title_label, &lv_font_montserrat_48, LV_PART_MAIN);
|
||||
lv_obj_center(cal->title_label);
|
||||
|
||||
unregisterAllUpdates();
|
||||
|
||||
lv_obj_t* last_row = cal->title_bar;
|
||||
for (uint8_t r = 0; r < CALENDAR_ROWS; r++) {
|
||||
start_day = style_row(cal->rows[r], last_row, cal->box_width, cal->box_height, start_day, ct->tm_mday, days);
|
||||
last_row = cal->rows[r]->boxes[0]->box;
|
||||
}
|
||||
|
||||
// Update events, so it will call our callbacks set in style_box to show the list of events
|
||||
updateEvents(ct->tm_mday, ct->tm_mon, ct->tm_year + 1900);
|
||||
}
|
||||
|
||||
int style_row(lvc_calendar_row_t* row, lv_obj_t* last_row, uint32_t box_width, uint32_t box_height, int day, int current_day, int days_in_month)
|
||||
{
|
||||
style_box(row->boxes[0], box_width, box_height, day, 0, day == current_day, days_in_month);
|
||||
lv_obj_align_to(row->boxes[0]->box, last_row, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 0);
|
||||
day++;
|
||||
|
||||
lv_obj_t* last = row->boxes[0]->box;
|
||||
for (uint8_t i = 1; i < DAYS_IN_WEEK; i++) {
|
||||
style_box(row->boxes[i], box_width, box_height, day, i, day == current_day, days_in_month);
|
||||
lv_obj_align_to(row->boxes[i]->box, last, LV_ALIGN_OUT_RIGHT_TOP, 0, 0);
|
||||
last = row->boxes[i]->box;
|
||||
day++;
|
||||
}
|
||||
|
||||
return day;
|
||||
}
|
||||
|
||||
void style_box(lvc_calendar_box_t* box, uint32_t width, uint32_t height, int day, int wday, bool today, int days_in_month)
|
||||
{
|
||||
lv_obj_remove_style_all(box->box);
|
||||
lv_obj_set_size(box->box, width, height);
|
||||
|
||||
lv_obj_add_style(box->box, &box_style, LV_PART_MAIN);
|
||||
if (today) {
|
||||
lv_obj_add_style(box->box, &box_style_active, LV_PART_MAIN);
|
||||
}
|
||||
|
||||
if (wday == 6) {
|
||||
lv_obj_set_style_border_side(box->box, LV_BORDER_SIDE_BOTTOM | LV_BORDER_SIDE_LEFT | LV_BORDER_SIDE_RIGHT, LV_PART_MAIN);
|
||||
} else {
|
||||
lv_obj_set_style_border_side(box->box, LV_BORDER_SIDE_BOTTOM | LV_BORDER_SIDE_LEFT, LV_PART_MAIN);
|
||||
}
|
||||
|
||||
|
||||
lv_obj_align(box->label, LV_ALIGN_TOP_LEFT, 0, 0);
|
||||
|
||||
if (day > 0 && day <= days_in_month) {
|
||||
lv_label_set_text_fmt(box->label, "%d", day);
|
||||
lv_obj_set_style_pad_bottom(box->label, 8, LV_PART_MAIN);
|
||||
lv_obj_add_event_cb(box->box, draw_event_list_cb, LV_EVENT_REFRESH, box);
|
||||
registerUpdateOnEventChange(day, box->box);
|
||||
} else {
|
||||
lv_obj_add_style(box->box, &box_style_inactive, LV_PART_MAIN);
|
||||
lv_label_set_text(box->label, "");
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < EVENTS_COUNT; i++) {
|
||||
lv_label_set_text(box->event_count_labels[i], "");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void draw_event_list_cb(lv_event_t* event)
|
||||
{
|
||||
event_type_counts_t* counts = lv_event_get_param(event);
|
||||
lvc_calendar_box_t* box = lv_event_get_user_data(event);
|
||||
|
||||
int c = 0;
|
||||
lv_obj_t* label = NULL;
|
||||
lv_obj_t* last = box->label;
|
||||
|
||||
for (size_t i = 0; i < EVENTS_COUNT; i++) {
|
||||
c = counts->counts[i];
|
||||
label = box->event_count_labels[i];
|
||||
|
||||
if (c != 0) {
|
||||
lv_label_set_text_fmt(label, event_format_strs[i], c);
|
||||
lv_obj_align_to(label, last, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 0);
|
||||
lv_obj_set_style_text_font(label, &nerdfonts_arimo_14, LV_PART_MAIN);
|
||||
last = label;
|
||||
} else {
|
||||
lv_label_set_text(label, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void calendar_refresh_event(lv_event_t* event)
|
||||
{
|
||||
struct tm* ct = lv_event_get_param(event);
|
||||
lvc_calendar_t* cal = lv_event_get_user_data(event);
|
||||
|
||||
style_calendar(cal, ct);
|
||||
}
|
||||
|
123
src/ui/events_panel.c
Normal file
123
src/ui/events_panel.c
Normal file
@ -0,0 +1,123 @@
|
||||
#include <unistd.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
#include "events.h"
|
||||
#include "events_panel.h"
|
||||
|
||||
|
||||
int add_event_labels(lvc_events_panel_t* panel, unsigned int count);
|
||||
void draw_events_list_cb(lv_event_t* event);
|
||||
void event_label_set_text(lv_obj_t* label, event_t* event);
|
||||
|
||||
|
||||
lvc_events_panel_t* create_events_panel(lv_obj_t* parent)
|
||||
{
|
||||
lvc_events_panel_t* panel = malloc(sizeof(lvc_events_panel_t));
|
||||
|
||||
panel->panel = lv_obj_create(parent);
|
||||
panel->header = lv_label_create(panel->panel);
|
||||
panel->event_labels = NULL;
|
||||
panel->event_labels_count = 0;
|
||||
|
||||
lv_obj_set_style_pad_all(panel->panel, 10, LV_PART_MAIN);
|
||||
lv_obj_set_scrollbar_mode(panel->panel, LV_SCROLLBAR_MODE_OFF);
|
||||
|
||||
lv_label_set_text(panel->header, "Events");
|
||||
lv_obj_set_style_text_font(panel->header, &lv_font_montserrat_36, LV_PART_MAIN);
|
||||
lv_obj_align(panel->header, LV_ALIGN_TOP_LEFT, 0, 0);
|
||||
|
||||
lv_obj_add_event_cb(panel->panel, draw_events_list_cb, LV_EVENT_REFRESH, panel);
|
||||
|
||||
register_update_on_detailed_events_change(panel->panel);
|
||||
|
||||
return panel;
|
||||
}
|
||||
|
||||
void destroy_events_panel(lvc_events_panel_t* panel)
|
||||
{
|
||||
lv_obj_delete(panel->header);
|
||||
|
||||
for (size_t i = 0; i < panel->event_labels_count; i++) {
|
||||
lv_obj_delete(panel->event_labels[i]);
|
||||
}
|
||||
|
||||
lv_obj_delete(panel->panel);
|
||||
|
||||
free(panel);
|
||||
}
|
||||
|
||||
int add_event_labels(lvc_events_panel_t* panel, unsigned int count)
|
||||
{
|
||||
uint16_t newCapacity = panel->event_labels_count + count;
|
||||
lv_obj_t** newMem = reallocarray(panel->event_labels, newCapacity, sizeof(lv_obj_t*));
|
||||
if (newMem == NULL) {
|
||||
printf("Call to reallocarray failed. Unable to create more labels to display events");
|
||||
return -1;
|
||||
}
|
||||
|
||||
panel->event_labels = newMem;
|
||||
for (size_t i = panel->event_labels_count; i < newCapacity; i++) {
|
||||
panel->event_labels[i] = lv_label_create(panel->panel);
|
||||
}
|
||||
panel->event_labels_count = newCapacity;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void draw_events_list_cb(lv_event_t* event)
|
||||
{
|
||||
lvc_events_panel_t* panel = lv_event_get_user_data(event);
|
||||
events_t* events = lv_event_get_param(event);
|
||||
|
||||
if (panel->event_labels_count < events->size) {
|
||||
// More events than labels. Create new labels for events
|
||||
if (add_event_labels(panel, events->size - panel->event_labels_count) != 0) {
|
||||
printf("Failed to create new labels for event panel\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
lv_obj_t* last = panel->header;
|
||||
size_t i = 0;
|
||||
for (; i < events->size; i++) {
|
||||
event_label_set_text(panel->event_labels[i], &events->events[i]);
|
||||
lv_obj_set_style_text_font(panel->event_labels[i], &lv_font_montserrat_18, LV_PART_MAIN);
|
||||
lv_obj_align_to(panel->event_labels[i], last, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 10);
|
||||
last = panel->event_labels[i];
|
||||
}
|
||||
|
||||
const uint16_t len = panel->event_labels_count;
|
||||
for (;i < len; i++) {
|
||||
lv_obj_delete(panel->event_labels[i]);
|
||||
panel->event_labels_count -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
void event_label_set_text(lv_obj_t* label, event_t* event)
|
||||
{
|
||||
int s_hour = event->s_hour;
|
||||
const char* const s_time_suffix = s_hour >= 12 ? "PM" : "AM";
|
||||
|
||||
if (s_hour > 12) {
|
||||
s_hour -= 12;
|
||||
}
|
||||
|
||||
if (event->e_hour < 0) {
|
||||
lv_label_set_text_fmt(label, "%s\n%d:%02d %s",
|
||||
event->name, s_hour, event->s_min, s_time_suffix);
|
||||
} else {
|
||||
int e_hour = event->e_hour;
|
||||
const char* const e_time_suffix = e_hour >= 12 ? "PM" : "AM";
|
||||
|
||||
if (e_hour > 12) {
|
||||
e_hour -= 12;
|
||||
}
|
||||
|
||||
lv_label_set_text_fmt(label, "%s\n%d:%02d %s - %d:%02d %s",
|
||||
event->name, s_hour, event->s_min, s_time_suffix, e_hour, event->e_min, e_time_suffix);
|
||||
}
|
||||
}
|
||||
|
185
src/ui/ui.c
Normal file
185
src/ui/ui.c
Normal file
@ -0,0 +1,185 @@
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
#include <ifaddrs.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
#include "lvgl_port/lvgl_fb_port.h"
|
||||
#include "events_panel.h"
|
||||
#include "calendar.h"
|
||||
#include "events.h"
|
||||
|
||||
|
||||
#define TIME_BUF_LEN 12
|
||||
|
||||
|
||||
static lv_obj_t* screen;
|
||||
static lv_obj_t* time_label;
|
||||
static lv_obj_t* ip_label;
|
||||
static lvc_calendar_t* calendar;
|
||||
static lvc_events_panel_t* events_panel;
|
||||
static lv_style_t test_style;
|
||||
|
||||
static char ip_addr[INET_ADDRSTRLEN];
|
||||
|
||||
|
||||
void check_time_timer(lv_timer_t* timer);
|
||||
void update_events_timer(lv_timer_t* timer);
|
||||
void update_time_label(lv_event_t* event);
|
||||
void get_ip(char* buf, size_t len);
|
||||
|
||||
|
||||
void create_styles(void)
|
||||
{
|
||||
lv_style_init(&test_style);
|
||||
lv_style_set_bg_color(&test_style, lv_color_hex(0x00ff66));
|
||||
lv_style_set_bg_opa(&test_style, LV_OPA_COVER);
|
||||
}
|
||||
|
||||
void create_widgets(void)
|
||||
{
|
||||
get_ip(ip_addr, INET_ADDRSTRLEN);
|
||||
printf("IP: %s\n", ip_addr);
|
||||
|
||||
create_styles();
|
||||
|
||||
|
||||
screen = lv_obj_create(NULL);
|
||||
lv_obj_set_style_bg_color(screen, lv_color_hex(0xffffff), LV_PART_MAIN);
|
||||
|
||||
time_label = lv_label_create(screen);
|
||||
lv_label_set_text(time_label, "Time goes here");
|
||||
lv_obj_align(time_label, LV_ALIGN_TOP_LEFT, 5, 5);
|
||||
|
||||
ip_label = lv_label_create(screen);
|
||||
lv_label_set_text_fmt(ip_label, "IP: %s", ip_addr);
|
||||
lv_obj_align(ip_label, LV_ALIGN_BOTTOM_LEFT, 5, -5);
|
||||
|
||||
events_panel = create_events_panel(screen);
|
||||
lv_obj_set_size(events_panel->panel, disp_hpercent_to_px(20), disp_height);
|
||||
lv_obj_align(events_panel->panel, LV_ALIGN_RIGHT_MID, 0, 0);
|
||||
lv_obj_set_style_border_width(events_panel->panel, 2, LV_PART_MAIN);
|
||||
lv_obj_set_style_border_side(events_panel->panel, LV_BORDER_SIDE_LEFT, LV_PART_MAIN);
|
||||
lv_obj_set_style_radius(events_panel->panel, 0, LV_PART_MAIN);
|
||||
|
||||
// Calendar must be created last. It calls the function to update the events
|
||||
uint32_t cal_width = disp_hpercent_to_px(70);
|
||||
calendar = create_calendar(screen, cal_width);
|
||||
lv_obj_align(calendar->calendar, LV_ALIGN_LEFT_MID, disp_hpercent_to_px(5), 0);
|
||||
|
||||
|
||||
lv_screen_load(screen);
|
||||
|
||||
|
||||
lv_obj_add_event_cb(time_label, update_time_label, LV_EVENT_REFRESH, NULL);
|
||||
|
||||
lv_timer_create(check_time_timer, 100, NULL);
|
||||
// lv_timer_create(update_events_timer, 1 * 60 * 1000, NULL);
|
||||
}
|
||||
|
||||
void destroy_widgets(void)
|
||||
{
|
||||
destroy_calendar(calendar);
|
||||
destroy_events_panel(events_panel);
|
||||
|
||||
lv_obj_clean(screen);
|
||||
}
|
||||
|
||||
|
||||
void check_time_timer(lv_timer_t* timer)
|
||||
{
|
||||
(void) timer;
|
||||
|
||||
static int8_t secs = -1;
|
||||
static int8_t min = -1;
|
||||
static int8_t day = -1;
|
||||
|
||||
time_t t = time(NULL);
|
||||
struct tm* ct = localtime(&t);
|
||||
|
||||
// Prevent the calendar from being redrawn on the first call of this timer
|
||||
if (day == -1) {
|
||||
day = ct->tm_mday;
|
||||
min = ct->tm_min;
|
||||
}
|
||||
|
||||
if (secs != ct->tm_sec) {
|
||||
secs = ct->tm_sec;
|
||||
lv_obj_send_event(time_label, LV_EVENT_REFRESH, ct);
|
||||
}
|
||||
|
||||
if (day != ct->tm_mday) {
|
||||
day = ct->tm_mday;
|
||||
min = ct->tm_min;
|
||||
lv_obj_send_event(calendar->calendar, LV_EVENT_REFRESH, ct);
|
||||
} else if (min != ct->tm_min) {
|
||||
min = ct->tm_min;
|
||||
updateEvents(ct->tm_mday, ct->tm_mon, ct->tm_year + 1900);
|
||||
|
||||
get_ip(ip_addr, INET_ADDRSTRLEN);
|
||||
lv_label_set_text_fmt(ip_label, "IP: %s", ip_addr);
|
||||
}
|
||||
}
|
||||
|
||||
void update_events_timer(lv_timer_t* timer)
|
||||
{
|
||||
(void) timer;
|
||||
|
||||
time_t t = time(NULL);
|
||||
struct tm* ct = localtime(&t);
|
||||
|
||||
updateEvents(ct->tm_mday, ct->tm_mon, ct->tm_year + 1900);
|
||||
}
|
||||
|
||||
|
||||
void update_time_label(lv_event_t* event)
|
||||
{
|
||||
struct tm* ct = lv_event_get_param(event);
|
||||
|
||||
char time_str[TIME_BUF_LEN];
|
||||
strftime(time_str, TIME_BUF_LEN, "%I:%M:%S %p", ct);
|
||||
lv_label_set_text(time_label, time_str);
|
||||
}
|
||||
|
||||
void get_ip(char* buf, size_t len)
|
||||
{
|
||||
struct ifaddrs* ifAddrStruct = NULL;
|
||||
struct ifaddrs* ifa = NULL;
|
||||
bool addrFound = false;
|
||||
|
||||
getifaddrs(&ifAddrStruct);
|
||||
|
||||
for (ifa = ifAddrStruct; ifa != NULL; ifa = ifa->ifa_next) {
|
||||
if (!ifa->ifa_addr) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// I only want IPv4
|
||||
if (ifa->ifa_addr->sa_family == AF_INET) {
|
||||
void* tmpAddrPtr = &((struct sockaddr_in*)ifa->ifa_addr)->sin_addr;
|
||||
inet_ntop(AF_INET, tmpAddrPtr, buf, len);
|
||||
|
||||
// Skip loopback addresses
|
||||
if (buf[0] == '1' && buf[1] == '2' && buf[2] == '7') {
|
||||
continue;
|
||||
}
|
||||
|
||||
addrFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!addrFound) {
|
||||
buf[0] = '\0';
|
||||
}
|
||||
|
||||
if (ifAddrStruct != NULL) {
|
||||
freeifaddrs(ifAddrStruct);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user