VSF Documented
lvgl.h
Go to the documentation of this file.
1
2
8#ifndef _LVGL_H
9#define _LVGL_H
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
15/*********************
16 * DEFINES
17 *********************/
18/*Current version of LVGL*/
19#define LVGL_VERSION_MAJOR 7
20#define LVGL_VERSION_MINOR 0
21#define LVGL_VERSION_PATCH 1
22#define LVGL_VERSION_INFO "dev"
23
24
25#ifndef NULL
26 #define NULL ((void*) 0)
27#endif
28
29#include <stdbool.h>
30
31#define FALSE 0
32#define TRUE 1
33//#define false 0
34//#define true 1
35
36//typedef unsigned char u8, bool, BOOL, bit1, uint8_t, BaseType_t;
37
38typedef signed char int8_t;
39//typedef unsigned char bool;
40typedef unsigned char u8, uint8_t;
41typedef unsigned short u16, uint16_t;
42typedef signed short s16, int16_t;
43typedef unsigned int u32, tu8, tu16, tbool, tu32, uint32_t;
44typedef signed int s32,int32_t;
45/* -------------------------------------------------------------------------------- */
46/* -- TYPEDEFS -- */
47/* -------------------------------------------------------------------------------- */
48
51
52//lv_font_fmt_txt.h
54typedef struct {
62
63
65enum {
70};
71
73
74/* Map codepoints to a `glyph_dsc`s
75 * Several formats are supported to optimize memory usage
76 * See https://github.com/lvgl/lv_font_conv/blob/master/doc/font_spec.md
77 */
78typedef struct {
81
85
88
90
94 const void * glyph_id_ofs_list;
95
98
102
103
104//lv_font_fmt_txt.h
105/*Describe store additional data for fonts */
106typedef struct {
107 /*The bitmaps os all glyphs*/
109
110 /*Describe the glyphs*/
112
113 /* Map the glyphs to Unicode characters.
114 * Array of `lv_font_cmap_fmt_txt_t` variables*/
116
117 /* Store kerning values.
118 * Can be `lv_font_fmt_txt_kern_pair_t * or `lv_font_kern_classes_fmt_txt_t *`
119 * depending on `kern_classes`
120 */
121 const void * kern_dsc;
122
123 /*Scale kern values in 12.4 format*/
125
126 /*Number of cmap tables*/
128
129 /*Bit per pixel: 1, 2, 3, 4, 8*/
131
132 /*Type of `kern_dsc`*/
134
135 /*
136 * storage format of the bitmap
137 * from `lv_font_fmt_txt_bitmap_format_t`
138 */
140
141 /*Cache the last letter and is glyph id*/
144
146
148typedef struct {
156
157//lv_font.h
159typedef struct _lv_font_struct {
161 bool (*get_glyph_dsc)(const struct _lv_font_struct *, lv_font_glyph_dsc_t *, uint32_t letter, uint32_t letter_next);
162
164 const uint8_t * (*get_glyph_bitmap)(const struct _lv_font_struct *, uint32_t);
165
166 /*Pointer to the font in a font pack (must have the same line height)*/
170 void * dsc;
173/**********************
174 * TYPEDEFS
175 **********************/
176
177/**********************
178 * GLOBAL PROTOTYPES
179 **********************/
180
181/**********************
182 * MACROS
183 **********************/
184
206#define LV_VERSION_CHECK(x,y,z) (x == LVGL_VERSION_MAJOR && (y < LVGL_VERSION_MINOR || (y == LVGL_VERSION_MINOR && z <= LVGL_VERSION_PATCH)))
207
208
209#ifdef __cplusplus
210
211}
212#endif
213
214#endif /*LVGL_H*/
bool
Definition type.h:60
signed int s32
Definition lvgl.h:44
unsigned int u32
Definition lvgl.h:43
signed short int16_t
Definition lvgl.h:42
unsigned short uint16_t
Definition lvgl.h:41
unsigned int tu16
Definition lvgl.h:43
unsigned int uint32_t
Definition lvgl.h:43
@ LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
Definition lvgl.h:66
@ LV_FONT_FMT_TXT_CMAP_FORMAT0_FULL
Definition lvgl.h:67
@ LV_FONT_FMT_TXT_CMAP_SPARSE_TINY
Definition lvgl.h:68
@ LV_FONT_FMT_TXT_CMAP_SPARSE_FULL
Definition lvgl.h:69
uint8_t lv_font_fmt_txt_cmap_type_t
Definition lvgl.h:72
signed short s16
Definition lvgl.h:42
uint32_t lv_uintptr_t
Definition lvgl.h:50
struct _lv_font_struct lv_font_t
unsigned int tu8
Definition lvgl.h:43
unsigned short u16
Definition lvgl.h:41
signed int int32_t
Definition lvgl.h:44
unsigned char uint8_t
Definition lvgl.h:40
unsigned int tbool
Definition lvgl.h:43
int16_t lv_coord_t
Definition lvgl.h:49
unsigned int tu32
Definition lvgl.h:43
unsigned char u8
Definition lvgl.h:40
signed char int8_t
Definition lvgl.h:38
Definition lvgl.h:159
bool(* get_glyph_dsc)(const struct _lv_font_struct *, lv_font_glyph_dsc_t *, uint32_t letter, uint32_t letter_next)
Definition lvgl.h:161
void * dsc
Definition lvgl.h:170
lv_coord_t base_line
Definition lvgl.h:168
lv_coord_t line_height
Definition lvgl.h:167
uint8_t subpx
Definition lvgl.h:169
Definition lvgl.h:78
uint16_t range_length
Definition lvgl.h:84
const uint16_t * unicode_list
Definition lvgl.h:89
uint32_t range_start
Definition lvgl.h:80
uint16_t glyph_id_start
Definition lvgl.h:87
const void * glyph_id_ofs_list
Definition lvgl.h:94
uint16_t list_length
Definition lvgl.h:97
lv_font_fmt_txt_cmap_type_t type
Definition lvgl.h:100
Definition lvgl.h:106
uint16_t kern_classes
Definition lvgl.h:133
const lv_font_fmt_txt_cmap_t * cmaps
Definition lvgl.h:115
uint32_t last_glyph_id
Definition lvgl.h:143
const lv_font_fmt_txt_glyph_dsc_t * glyph_dsc
Definition lvgl.h:111
const void * kern_dsc
Definition lvgl.h:121
uint16_t bitmap_format
Definition lvgl.h:139
uint16_t kern_scale
Definition lvgl.h:124
uint32_t last_letter
Definition lvgl.h:142
uint16_t cmap_num
Definition lvgl.h:127
uint16_t bpp
Definition lvgl.h:130
const uint8_t * glyph_bitmap
Definition lvgl.h:108
Definition lvgl.h:54
uint8_t box_h
Definition lvgl.h:58
int8_t ofs_x
Definition lvgl.h:59
uint32_t bitmap_index
Definition lvgl.h:55
int8_t ofs_y
Definition lvgl.h:60
uint32_t adv_w
Definition lvgl.h:56
uint8_t box_w
Definition lvgl.h:57
Definition lvgl.h:148
uint16_t box_w
Definition lvgl.h:150
int16_t ofs_x
Definition lvgl.h:152
int16_t ofs_y
Definition lvgl.h:153
uint8_t bpp
Definition lvgl.h:154
uint16_t box_h
Definition lvgl.h:151
uint16_t adv_w
Definition lvgl.h:149