RadioSet: Massive GUI improvements, RX and TX confirmed working on LoRa

This commit is contained in:
Dominic Höglinger 2025-10-08 17:43:07 +02:00
parent d0878ba031
commit cf57d9e65f
7 changed files with 1629 additions and 5 deletions

View File

@ -17,6 +17,8 @@ void scrollbar_highlight(lv_event_t * e) {
void RadioSet::onShow(AppHandle appHandle, lv_obj_t* parent) {
lvglMutex = tt_mutex_alloc(MUTEX_TYPE_RECURSIVE);
lv_obj_remove_flag(parent, LV_OBJ_FLAG_SCROLLABLE);
lv_obj_set_flex_flow(parent, LV_FLEX_FLOW_COLUMN);
lv_obj_set_style_pad_row(parent, 0, LV_STATE_DEFAULT);
@ -26,7 +28,7 @@ void RadioSet::onShow(AppHandle appHandle, lv_obj_t* parent) {
uiDropDownMenu = lv_dropdown_create(toolbar);
lv_dropdown_set_options(uiDropDownMenu, LV_SYMBOL_ENVELOPE " Terminal\n" LV_SYMBOL_SETTINGS " Settings");
lv_dropdown_set_options(uiDropDownMenu, LV_SYMBOL_ENVELOPE " Terminal\n" LV_SYMBOL_SETTINGS " Packet\n" LV_SYMBOL_SETTINGS " Modems");
lv_dropdown_set_text(uiDropDownMenu, "Menu");
lv_dropdown_set_symbol(uiDropDownMenu, LV_SYMBOL_DOWN);
lv_dropdown_set_selected_highlight(uiDropDownMenu, true);
@ -46,12 +48,12 @@ void RadioSet::onShow(AppHandle appHandle, lv_obj_t* parent) {
lv_obj_set_style_border_width(wrapper, 0, 0);
lv_obj_remove_flag(wrapper, LV_OBJ_FLAG_SCROLLABLE);
termView = new TermView(wrapper);
termView = new TermView(lvglMutex, wrapper);
settingsView = new SettingsView(wrapper);
auto presetMtEu868LongFast = new Preset("MT EU868 LongFast", MODULATION_LORA);
presetMtEu868LongFast->addParameter(RADIO_FREQUENCY, 869.525);
presetMtEu868LongFast->addParameter(RADIO_POWER, 22.0);
presetMtEu868LongFast->addParameter(RADIO_POWER, /*22.0*/ 0);
presetMtEu868LongFast->addParameter(RADIO_BOOSTEDGAIN, true);
presetMtEu868LongFast->addParameter(RADIO_BANDWIDTH, 250.0);
presetMtEu868LongFast->addParameter(RADIO_SPREADFACTOR, 11);
@ -75,7 +77,7 @@ void RadioSet::onShow(AppHandle appHandle, lv_obj_t* parent) {
case 0:
self->showView(View::Terminal);
break;
case 1:
case 2:
self->showView(View::Settings);
break;
default:
@ -95,6 +97,7 @@ RadioSet::~RadioSet() {
}
void RadioSet::showView(View view) {
tt_mutex_lock(lvglMutex, portMAX_DELAY);
termView->setVisible(false);
settingsView->setVisible(false);
switch (view) {
@ -107,6 +110,7 @@ void RadioSet::showView(View view) {
default:
break;
}
tt_mutex_unlock(lvglMutex);
}

View File

@ -13,6 +13,7 @@ class RadioSet {
Settings
};
MutexHandle lvglMutex;
lv_obj_t* mainView = nullptr;
lv_obj_t* uiDropDownMenu = nullptr;
lv_obj_t* progressBar = nullptr;

View File

@ -880,6 +880,7 @@ void SettingsView::initUi(lv_obj_t *parent) {
lv_obj_align(mainPanel, LV_ALIGN_TOP_MID, 0, 0);
lv_obj_set_style_border_width(mainPanel, 0, 0);
lv_obj_set_style_pad_all(mainPanel, 0, 0);
make_scrollable(mainPanel);
deviceForm = initDeviceForm(mainPanel);
}

View File

@ -80,6 +80,25 @@ char *const toString(RadioParameter p) {
return "Unknown";
}
char *const toString(RadioTxState state) {
switch (state) {
case RADIO_TX_QUEUED:
return "QUEUED";
case RADIO_TX_PENDING_TRANSMIT:
return "TRANSMIT";
case RADIO_TX_TRANSMITTED:
return "SENT";
case RADIO_TX_TIMEOUT:
return "TIMEOUT";
case RADIO_TX_ERROR:
return "ERROR";
default:
break;
}
crash("Unknown parameter passed.");
return "Unknown";
}
void clownvomit(lv_obj_t *obj) {
static auto rng = []() {
static int color = 0xCCC0FE;
@ -91,7 +110,8 @@ void clownvomit(lv_obj_t *obj) {
const int darken = 0x0E0E0E;
const int lighten = 0xFEFEFE;
lv_obj_set_style_bg_color(obj, lv_color_hex(rng() & darken), 0);
auto bg = lv_color_darken(lv_color_hex(rng()), 100);
lv_obj_set_style_bg_color(obj, bg, 0);
uint32_t i;
for(i = 0; i < lv_obj_get_child_count(obj); i++) {
@ -104,3 +124,43 @@ void clownvomit(lv_obj_t *obj) {
clownvomit(child);
}
}
static void apply_scroll_styles(lv_obj_t* obj) {
static bool init = false;
static lv_style_t style_scroll_focus;
static lv_style_t style_scrolling;
if (!init) {
// Style which applies if scrollbar is focused
lv_style_init(&style_scroll_focus);
lv_style_set_bg_color(&style_scroll_focus, lv_color_make(0x40,0xA0,0xFF));
lv_style_set_bg_opa(&style_scroll_focus, LV_OPA_COVER);
lv_style_set_border_width(&style_scroll_focus, 1);
lv_style_set_border_color(&style_scroll_focus, lv_theme_get_color_primary(nullptr));
// Style which applies if scrollbar is clicked enough that it defocuses
lv_style_init(&style_scrolling);
lv_style_set_bg_color(&style_scrolling, lv_color_make(0x40,0xA0,0xFF));
lv_style_set_bg_opa(&style_scrolling, LV_OPA_COVER);
lv_style_set_border_width(&style_scrolling, 1);
auto lightprimary = lv_color_lighten(lv_theme_get_color_primary(nullptr), 50);
lv_style_set_border_color(&style_scrolling, lightprimary);
init = true;
}
lv_obj_add_style(obj, &style_scroll_focus, (lv_style_selector_t)(LV_PART_SCROLLBAR | LV_STATE_FOCUSED));
lv_obj_add_style(obj, &style_scrolling, (lv_style_selector_t)(LV_PART_SCROLLBAR | LV_STATE_PRESSED));
}
void make_scrollable(lv_obj_t* obj) {
// Make the object interactive, i.e focusable
lv_obj_add_flag(obj, (lv_obj_flag_t)(LV_OBJ_FLAG_CLICKABLE | LV_OBJ_FLAG_SCROLL_ON_FOCUS));
// Add to default group to get it into the focus list
auto* group = lv_group_get_default();
lv_group_add_obj(group, obj);
// Apply style to scrollbar to make it visible if focused
apply_scroll_styles(obj);
}

View File

@ -23,7 +23,10 @@ bool isPrintable(const uint8_t* data, size_t size);
char *const toString(Modulation m);
char *const toString(RadioParameter p);
char *const toString(RadioTxState state);
// Debug function which colors all children randomly
// TODO: Remove before flight
void clownvomit(lv_obj_t *obj);
void make_scrollable(lv_obj_t* obj);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,466 @@
/*******************************************************************************
* Size: 8 px
* Bpp: 1
* Opts: --no-compress --no-prefilter --bpp 1 --size 8 --font unscii-8.ttf -r 0x20-0x7F --format lvgl -o lv_font_unscii_8.c --force-fast-kern-format
******************************************************************************/
#include "lvgl.h"
/*-----------------
* BITMAPS
*----------------*/
/*Store the image of the glyphs*/
static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = {
/* U+0020 " " */
0x0,
/* U+0021 "!" */
0xff, 0xcc,
/* U+0022 "\"" */
0xcf, 0x3c, 0xc0,
/* U+0023 "#" */
0x6c, 0xdb, 0xfb, 0x6f, 0xed, 0x9b, 0x0,
/* U+0024 "$" */
0x31, 0xfc, 0x1e, 0xf, 0xe3, 0x0,
/* U+0025 "%" */
0xc7, 0x98, 0x61, 0x86, 0x78, 0xc0,
/* U+0026 "&" */
0x38, 0xd8, 0xe3, 0xbd, 0xd9, 0x9d, 0x80,
/* U+0027 "'" */
0x6f, 0x0,
/* U+0028 "(" */
0x36, 0xcc, 0xc6, 0x30,
/* U+0029 ")" */
0xc6, 0x33, 0x36, 0xc0,
/* U+002A "*" */
0x66, 0x3c, 0xff, 0x3c, 0x66,
/* U+002B "+" */
0x30, 0xcf, 0xcc, 0x30,
/* U+002C "," */
0x6f, 0x0,
/* U+002D "-" */
0xfc,
/* U+002E "." */
0xf0,
/* U+002F "/" */
0x3, 0x6, 0xc, 0x18, 0x30, 0x60, 0xc0,
/* U+0030 "0" */
0x7b, 0x3d, 0xfb, 0xcf, 0x37, 0x80,
/* U+0031 "1" */
0x31, 0xc3, 0xc, 0x30, 0xcf, 0xc0,
/* U+0032 "2" */
0x7b, 0x31, 0x8c, 0x63, 0xf, 0xc0,
/* U+0033 "3" */
0x7b, 0x30, 0xce, 0xf, 0x37, 0x80,
/* U+0034 "4" */
0x1c, 0x79, 0xb6, 0x6f, 0xe1, 0x83, 0x0,
/* U+0035 "5" */
0xff, 0xf, 0x83, 0xf, 0x37, 0x80,
/* U+0036 "6" */
0x39, 0x8c, 0x3e, 0xcf, 0x37, 0x80,
/* U+0037 "7" */
0xfc, 0x30, 0xc6, 0x30, 0xc3, 0x0,
/* U+0038 "8" */
0x7b, 0x3c, 0xde, 0xcf, 0x37, 0x80,
/* U+0039 "9" */
0x7b, 0x3c, 0xdf, 0xc, 0x67, 0x0,
/* U+003A ":" */
0xf0, 0xf0,
/* U+003B ";" */
0x6c, 0x6, 0xf0,
/* U+003C "<" */
0x19, 0x99, 0x86, 0x18, 0x60,
/* U+003D "=" */
0xfc, 0xf, 0xc0,
/* U+003E ">" */
0xc3, 0xc, 0x33, 0x33, 0x0,
/* U+003F "?" */
0x7b, 0x30, 0xc6, 0x30, 0x3, 0x0,
/* U+0040 "@" */
0x7d, 0x8f, 0x7e, 0xfd, 0xf8, 0x1f, 0x0,
/* U+0041 "A" */
0x31, 0xec, 0xf3, 0xff, 0x3c, 0xc0,
/* U+0042 "B" */
0xfb, 0x3c, 0xfe, 0xcf, 0x3f, 0x80,
/* U+0043 "C" */
0x7b, 0x3c, 0x30, 0xc3, 0x37, 0x80,
/* U+0044 "D" */
0xf3, 0x6c, 0xf3, 0xcf, 0x6f, 0x0,
/* U+0045 "E" */
0xff, 0xc, 0x3e, 0xc3, 0xf, 0xc0,
/* U+0046 "F" */
0xff, 0xc, 0x3e, 0xc3, 0xc, 0x0,
/* U+0047 "G" */
0x7b, 0x3c, 0x37, 0xcf, 0x37, 0xc0,
/* U+0048 "H" */
0xcf, 0x3c, 0xff, 0xcf, 0x3c, 0xc0,
/* U+0049 "I" */
0xfc, 0xc3, 0xc, 0x30, 0xcf, 0xc0,
/* U+004A "J" */
0xc, 0x30, 0xc3, 0xf, 0x37, 0x80,
/* U+004B "K" */
0xc7, 0x9b, 0x67, 0x8d, 0x99, 0xb1, 0x80,
/* U+004C "L" */
0xc3, 0xc, 0x30, 0xc3, 0xf, 0xc0,
/* U+004D "M" */
0xc7, 0xdf, 0xfe, 0xbc, 0x78, 0xf1, 0x80,
/* U+004E "N" */
0xc7, 0xcf, 0xde, 0xfc, 0xf8, 0xf1, 0x80,
/* U+004F "O" */
0x7b, 0x3c, 0xf3, 0xcf, 0x37, 0x80,
/* U+0050 "P" */
0xfb, 0x3c, 0xfe, 0xc3, 0xc, 0x0,
/* U+0051 "Q" */
0x7b, 0x3c, 0xf3, 0xcf, 0x66, 0xc0,
/* U+0052 "R" */
0xfb, 0x3c, 0xfe, 0xdb, 0x3c, 0xc0,
/* U+0053 "S" */
0x7b, 0x3c, 0x1e, 0xf, 0x37, 0x80,
/* U+0054 "T" */
0xfc, 0xc3, 0xc, 0x30, 0xc3, 0x0,
/* U+0055 "U" */
0xcf, 0x3c, 0xf3, 0xcf, 0x37, 0x80,
/* U+0056 "V" */
0xcf, 0x3c, 0xf3, 0xcd, 0xe3, 0x0,
/* U+0057 "W" */
0xc7, 0x8f, 0x1e, 0xbf, 0xfd, 0xf1, 0x80,
/* U+0058 "X" */
0xc3, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0xc3,
/* U+0059 "Y" */
0xc3, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18,
/* U+005A "Z" */
0xfc, 0x31, 0x8c, 0x63, 0xf, 0xc0,
/* U+005B "[" */
0xfc, 0xcc, 0xcc, 0xf0,
/* U+005C "\\" */
0xc0, 0x60, 0x30, 0x18, 0xc, 0x6, 0x3,
/* U+005D "]" */
0xf3, 0x33, 0x33, 0xf0,
/* U+005E "^" */
0x10, 0x71, 0xb6, 0x30,
/* U+005F "_" */
0xff,
/* U+0060 "`" */
0xc6, 0x30,
/* U+0061 "a" */
0x78, 0x37, 0xf3, 0x7c,
/* U+0062 "b" */
0xc3, 0xf, 0xb3, 0xcf, 0x3f, 0x80,
/* U+0063 "c" */
0x7e, 0x31, 0x87, 0x80,
/* U+0064 "d" */
0xc, 0x37, 0xf3, 0xcf, 0x37, 0xc0,
/* U+0065 "e" */
0x7b, 0x3f, 0xf0, 0x78,
/* U+0066 "f" */
0x3b, 0x3e, 0xc6, 0x31, 0x80,
/* U+0067 "g" */
0x7f, 0x3c, 0xdf, 0xf, 0xe0,
/* U+0068 "h" */
0xc3, 0xf, 0xb3, 0xcf, 0x3c, 0xc0,
/* U+0069 "i" */
0x60, 0x38, 0xc6, 0x31, 0xe0,
/* U+006A "j" */
0x18, 0x6, 0x31, 0x8c, 0x7e,
/* U+006B "k" */
0xc3, 0xc, 0xf6, 0xf3, 0x6c, 0xc0,
/* U+006C "l" */
0xe3, 0x18, 0xc6, 0x31, 0xe0,
/* U+006D "m" */
0xcd, 0xff, 0x5e, 0xbc, 0x60,
/* U+006E "n" */
0xfb, 0x3c, 0xf3, 0xcc,
/* U+006F "o" */
0x7b, 0x3c, 0xf3, 0x78,
/* U+0070 "p" */
0xfb, 0x3c, 0xfe, 0xc3, 0x0,
/* U+0071 "q" */
0x7f, 0x3c, 0xdf, 0xc, 0x30,
/* U+0072 "r" */
0xfb, 0x3c, 0x30, 0xc0,
/* U+0073 "s" */
0x7f, 0x7, 0x83, 0xf8,
/* U+0074 "t" */
0x61, 0x8f, 0xd8, 0x61, 0x83, 0xc0,
/* U+0075 "u" */
0xcf, 0x3c, 0xf3, 0x7c,
/* U+0076 "v" */
0xcf, 0x3c, 0xde, 0x30,
/* U+0077 "w" */
0xc7, 0x8f, 0x5b, 0xe6, 0xc0,
/* U+0078 "x" */
0xc6, 0xd8, 0xe3, 0x6c, 0x60,
/* U+0079 "y" */
0xcf, 0x3c, 0xdf, 0xd, 0xe0,
/* U+007A "z" */
0xfc, 0x63, 0x18, 0xfc,
/* U+007B "{" */
0x1c, 0xc3, 0x38, 0x30, 0xc1, 0xc0,
/* U+007C "|" */
0xff, 0xfc,
/* U+007D "}" */
0xe0, 0xc3, 0x7, 0x30, 0xce, 0x0,
/* U+007E "~" */
0x77, 0xb8,
/* U+007F "" */
0xc1, 0x42, 0xbd, 0x2c, 0x40, 0x81, 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 = 128, .box_w = 1, .box_h = 1, .ofs_x = 0, .ofs_y = 8},
{.bitmap_index = 1, .adv_w = 128, .box_w = 2, .box_h = 7, .ofs_x = 3, .ofs_y = 1},
{.bitmap_index = 3, .adv_w = 128, .box_w = 6, .box_h = 3, .ofs_x = 1, .ofs_y = 5},
{.bitmap_index = 6, .adv_w = 128, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 13, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 19, .adv_w = 128, .box_w = 7, .box_h = 6, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 25, .adv_w = 128, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 32, .adv_w = 128, .box_w = 3, .box_h = 3, .ofs_x = 2, .ofs_y = 5},
{.bitmap_index = 34, .adv_w = 128, .box_w = 4, .box_h = 7, .ofs_x = 2, .ofs_y = 1},
{.bitmap_index = 38, .adv_w = 128, .box_w = 4, .box_h = 7, .ofs_x = 2, .ofs_y = 1},
{.bitmap_index = 42, .adv_w = 128, .box_w = 8, .box_h = 5, .ofs_x = 0, .ofs_y = 2},
{.bitmap_index = 47, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 2},
{.bitmap_index = 51, .adv_w = 128, .box_w = 3, .box_h = 3, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 53, .adv_w = 128, .box_w = 6, .box_h = 1, .ofs_x = 1, .ofs_y = 4},
{.bitmap_index = 54, .adv_w = 128, .box_w = 2, .box_h = 2, .ofs_x = 3, .ofs_y = 1},
{.bitmap_index = 55, .adv_w = 128, .box_w = 8, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 62, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 68, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 74, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 80, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 86, .adv_w = 128, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 93, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 99, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 105, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 111, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 117, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 123, .adv_w = 128, .box_w = 2, .box_h = 6, .ofs_x = 3, .ofs_y = 1},
{.bitmap_index = 125, .adv_w = 128, .box_w = 3, .box_h = 7, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 128, .adv_w = 128, .box_w = 5, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 133, .adv_w = 128, .box_w = 6, .box_h = 3, .ofs_x = 1, .ofs_y = 3},
{.bitmap_index = 136, .adv_w = 128, .box_w = 5, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 141, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 147, .adv_w = 128, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 154, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 160, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 166, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 172, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 178, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 184, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 190, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 196, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 202, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 208, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 214, .adv_w = 128, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 221, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 227, .adv_w = 128, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 234, .adv_w = 128, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 241, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 247, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 253, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 259, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 265, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 271, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 277, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 283, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 289, .adv_w = 128, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 296, .adv_w = 128, .box_w = 8, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 303, .adv_w = 128, .box_w = 8, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 310, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 316, .adv_w = 128, .box_w = 4, .box_h = 7, .ofs_x = 2, .ofs_y = 1},
{.bitmap_index = 320, .adv_w = 128, .box_w = 8, .box_h = 7, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 327, .adv_w = 128, .box_w = 4, .box_h = 7, .ofs_x = 2, .ofs_y = 1},
{.bitmap_index = 331, .adv_w = 128, .box_w = 7, .box_h = 4, .ofs_x = 0, .ofs_y = 4},
{.bitmap_index = 335, .adv_w = 128, .box_w = 8, .box_h = 1, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 336, .adv_w = 128, .box_w = 4, .box_h = 3, .ofs_x = 3, .ofs_y = 5},
{.bitmap_index = 338, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 342, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 348, .adv_w = 128, .box_w = 5, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 352, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 358, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 362, .adv_w = 128, .box_w = 5, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 367, .adv_w = 128, .box_w = 6, .box_h = 6, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 372, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 378, .adv_w = 128, .box_w = 5, .box_h = 7, .ofs_x = 2, .ofs_y = 1},
{.bitmap_index = 383, .adv_w = 128, .box_w = 5, .box_h = 8, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 388, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 394, .adv_w = 128, .box_w = 5, .box_h = 7, .ofs_x = 2, .ofs_y = 1},
{.bitmap_index = 399, .adv_w = 128, .box_w = 7, .box_h = 5, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 404, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 408, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 412, .adv_w = 128, .box_w = 6, .box_h = 6, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 417, .adv_w = 128, .box_w = 6, .box_h = 6, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 422, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 426, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 430, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 436, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 440, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 444, .adv_w = 128, .box_w = 7, .box_h = 5, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 449, .adv_w = 128, .box_w = 7, .box_h = 5, .ofs_x = 0, .ofs_y = 1},
{.bitmap_index = 454, .adv_w = 128, .box_w = 6, .box_h = 6, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 459, .adv_w = 128, .box_w = 6, .box_h = 5, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 463, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 469, .adv_w = 128, .box_w = 2, .box_h = 7, .ofs_x = 3, .ofs_y = 1},
{.bitmap_index = 471, .adv_w = 128, .box_w = 6, .box_h = 7, .ofs_x = 1, .ofs_y = 1},
{.bitmap_index = 477, .adv_w = 128, .box_w = 7, .box_h = 2, .ofs_x = 0, .ofs_y = 6},
{.bitmap_index = 479, .adv_w = 128, .box_w = 7, .box_h = 7, .ofs_x = 0, .ofs_y = 1}
};
/*---------------------
* CHARACTER MAPPING
*--------------------*/
/*Collect the unicode lists and glyph_id offsets*/
static const lv_font_fmt_txt_cmap_t cmaps[] = {
{
.range_start = 32, .range_length = 96, .glyph_id_start = 1,
.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 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 = 1,
.bpp = 1,
.kern_classes = 0,
.bitmap_format = 0,
};
/*-----------------
* PUBLIC FONT
*----------------*/
/*Initialize a public general font descriptor*/
#if LVGL_VERSION_MAJOR >= 8
const lv_font_t lv_font_unscii_8 = {
#else
lv_font_t lv_font_unscii_8 = {
#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 = 9, /*The maximum line height required by the font*/
.base_line = 0, /*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 = 0,
.underline_thickness = 0,
#endif
.dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};