Compare commits

..

107 Commits

Author SHA1 Message Date
Kiss-Vamosi Gabor
1fc4c9a1f7 release v4.1.0 2017-07-09 15:40:26 +02:00
Kiss-Vamosi Gabor
7b98b1e7a7 header udated with __cplusplus define 2017-07-09 15:40:26 +02:00
Kiss-Vamosi Gabor
6f1d63bf42 LV_CONT_LAYOUT_PRETTY with LV_PROTECT_FOLLOW bugfix 2017-07-09 15:40:26 +02:00
Kiss-Vamosi Gabor
ca3f4e1a7c LV_PROTECT_FOLLOW added to 'line break' to LV_CONT_LAYOUT_PRETTY 2017-07-09 15:40:26 +02:00
Kiss-Vamosi Gabor
574033a5ba lv_app_benchmark: skeleton added 2017-07-09 15:40:26 +02:00
Kiss-Vamosi Gabor
1eec8e425d lv_refr: solve warnings 2017-07-09 15:40:26 +02:00
Kiss-Vamosi Gabor
9af40d76cd lv_refr: comment update 2017-07-09 15:40:26 +02:00
Kiss-Vamosi Gabor
f6c459d2d7 lv_refr: refresh time monitor added 2017-07-09 15:40:26 +02:00
Gabor
b4c877c0ea lv_ta: pwd_mode added, lv_label:pwd_mode deleted 2017-07-09 15:40:26 +02:00
Gabor
0087faf3c3 lv_draw_vbasic: upscales img draw optimization 2017-07-09 15:40:26 +02:00
Gabor
f3f7664300 lv_list: lv_list_set_element_text_roll() added 2017-07-09 15:40:26 +02:00
Gabor
712feae198 Hw. accelerator API updated 2017-07-09 15:40:26 +02:00
Gabor
f641b70343 lv_list: label ROLL bugfix 2017-07-09 15:40:26 +02:00
Gabor
643d7ffe36 lv_app_gsm: added 2017-07-09 15:40:26 +02:00
Gabor
c67f558131 follow wifi modifications 2017-07-09 15:40:26 +02:00
Gabor
ac3b7631d0 lv_app_wifi: minor update 2017-07-09 15:40:26 +02:00
Gabor
2774d52043 lv_obj_del: reset the dispi-s only if it is really required 2017-07-09 15:40:26 +02:00
Gabor
08ee1c9736 lv_list: text height bugfix 2017-07-09 15:40:26 +02:00
Gabor
56f266749f Update function calls with LV_IMG_ENABLE_SYMBOLS 1 2017-07-09 15:40:26 +02:00
Kiss-Vamosi Gabor
e53dc381c5 lv_label: LV_LABEL_LONG_ROLL addad to scroll the text not the object 2017-07-09 15:40:26 +02:00
Kiss-Vamosi Gabor
de8f294244 img. draw bugfix 2017-07-09 15:40:26 +02:00
Kiss-Vamosi Gabor
79b07f8493 lv_mbox set_btn_styles: bugfix if set styles with still no button created 2017-07-09 15:40:25 +02:00
Kiss-Vamosi Gabor
5d29302627 lv_cont pretty layout: bugfix if there is 1 too long object in a row 2017-07-09 15:40:25 +02:00
Kiss-Vamosi Gabor
4b33645805 lv_refr: disable exectuion time monitor by default 2017-07-09 15:40:25 +02:00
Kiss-Vamosi Gabor
86b6cf78e7 Exection time monitor added (printf the result) 2017-07-09 15:40:25 +02:00
Kiss-Vamosi Gabor
91b9bea35b Error check for too small VDB 2017-07-09 15:40:25 +02:00
Kiss-Vamosi Gabor
2b6b3aec91 Draw: make ready to use hw. accelerator 2017-07-09 15:40:25 +02:00
Gabor
752a7aa7b5 ta: lv_ta_get_label() added 2017-07-09 15:40:25 +02:00
Gabor
f931d759bb lv_app_kb MODE_ANIM -> ANIM_IN, ANIM_OUT 2017-07-09 15:40:25 +02:00
Gabor
57453a1f41 label pwd mode added 2017-07-09 15:40:25 +02:00
Gabor
349109a4b5 lv_app_kb: LV_APP_KB_MODE_ANIM added 2017-07-09 15:40:25 +02:00
Gabor
b7445f2346 WiFi app added 2017-07-09 15:40:25 +02:00
Gabor Kiss-Vamosi
a02fb7bf82 Update README.md 2017-07-09 14:39:28 +02:00
Gabor Kiss-Vamosi
6b2ff57559 Update README.md 2017-05-15 15:22:03 +02:00
Gabor Kiss-Vamosi
48a227b5ed Update README.md 2017-05-15 15:09:22 +02:00
Gabor Kiss-Vamosi
7ab323cd33 Update README.md 2017-05-15 14:12:42 +02:00
Gabor Kiss-Vamosi
55a5d46fb9 Update README.md 2017-05-15 14:11:12 +02:00
Gabor
f42611d17b release v4.0.0 2017-05-15 09:49:36 +02:00
Gabor
8c35ff3c3b Updates before release 2017-05-15 09:48:48 +02:00
Gabor
91c28e5f44 Merge beta to release v4.0 2017-05-15 09:17:36 +02:00
Gabor
7e65d8e757 Merge branch 'master' of https://github.com/littlevgl/lvgl 2017-05-15 09:17:20 +02:00
Gabor
813a8e5476 Minor updates 2017-05-15 09:15:14 +02:00
Kiss-Vamosi Gabor
50d30e8d88 comments update 2017-05-14 18:49:44 +02:00
Kiss-Vamosi Gabor
cc10990d64 shadow bugfix 2017-05-13 11:03:08 +02:00
Kiss-Vamosi Gabor
20af407203 Minor object updates with some object types 2017-05-13 11:03:08 +02:00
Gabor
da1f4e8e2f minor updates 2017-05-12 16:09:37 +02:00
Gabor
3a9a23b350 minor style updates 2017-05-10 16:12:03 +02:00
Gabor
20f4685541 Solve warnings 2017-05-10 16:11:20 +02:00
Gabor
3f0323192c lv_conf_tmpl update 2017-05-08 11:23:16 +02:00
Gabor
2abc9b214b Minor update 2017-05-08 11:21:33 +02:00
Gabor
1277a805c8 Minor updates 2017-05-08 10:09:47 +02:00
Gabor
6591da5917 minor bugfixes 2017-05-03 15:06:32 +02:00
Gabor
e50be12eca lv_dispi: LV_DISPI_TP_MARKER now set the size of the marker point (0: turn off) 2017-05-03 14:59:36 +02:00
Kiss-Vamosi Gabor
69876763e2 animation: add more control over object animations (e.g. ddlist open/close anim time set by func. instead of define) 2017-05-02 00:16:48 +02:00
Kiss-Vamosi Gabor
c72a16147c lv_app style: minor updates 2017-05-01 22:36:35 +02:00
Kiss-Vamosi Gabor
082eb2dad3 lv_obj: minor updates, typo errors 2017-05-01 18:09:31 +02:00
Gabor
9edaf13c68 minor updates during tests 2017-04-28 16:12:35 +02:00
Gabor
24128ae325 Cleaning the code 2017-04-24 16:16:36 +02:00
Gabor
dadb8973bf shadow draw iprovments 2017-04-24 14:12:32 +02:00
Gabor
d1bec14de8 shadow bottom added 2017-04-24 12:08:24 +02:00
Kiss-Vamosi Gabor
462244684e lv_draw: new shadow drawing algorithm (filter based) introduced 2017-04-23 21:28:24 +02:00
Gabor
373bf2de84 lv_lmeter: added 2017-04-21 17:11:47 +02:00
Gabor
e07abd8ad6 review: bugfixes, minor updates 2017-04-21 09:15:39 +02:00
Gabor
330893ac6a lv_icon: removed, use symbol fonts instead 2017-04-18 10:28:30 +02:00
Gabor
2a1ace1f81 lv_misc moved to misc/gfx 2017-04-18 10:27:59 +02:00
Gabor
d93844bdd8 lv_rect renamed to lv_cont (container) 2017-04-13 16:12:03 +02:00
Gabor
092c0da4b5 updates according to the new style system 2017-04-13 15:57:02 +02:00
Gabor
f431f262be Apply the new style system on the applications too 2017-04-13 13:34:57 +02:00
Gabor
6116e83815 New style system introduced! Still not applied to apps 2017-04-13 10:20:35 +02:00
Gabor
09967f66f2 lv_slider added 2017-04-11 10:51:31 +02:00
Gabor
c4f3838b1e further renames 2017-04-11 10:50:57 +02:00
Gabor
4c14c4c762 BIG UPDTAE: Style renames in the whole library 2017-04-10 11:33:38 +02:00
Gabor
7bb849f4eb solve conflicts 2017-03-27 09:29:47 +02:00
Gabor
ad89961737 lv_ddlist: bugfix with font antialiassing 2017-03-27 09:27:45 +02:00
Gabor
5b7559ea76 Further draw speed optimizations 2017-03-20 10:47:41 +01:00
Kiss-Vamosi Gabor
7f49404d62 LV_FONT_ANTIALIAS added 2017-03-20 07:07:27 +01:00
Gabor Kiss-Vamosi
c26f3b000d Update README.md 2017-03-19 03:33:17 +01:00
Gabor
1696d77516 lv_app_files: sned bugfix (first chunk was not sent) 2017-03-09 14:25:26 +01:00
Gabor
92e63fbb46 Draw speed optimalizations 2017-03-09 11:23:28 +01:00
Gabor
c05ebc075f dispi: if a drag can not move the object (e.g. layout) still consider it as drag (reverted) 2017-03-07 17:13:24 +01:00
Gabor
e98aa0f6e6 Draw speed optimalization 2017-03-07 17:11:39 +01:00
Gabor
48ecbf4f5d lv_obj.h: remove an incorrect include of <sys/types.h> 2017-02-22 10:17:30 +01:00
Gabor
615eceb94b lv_app_visual: skeleton added 2017-02-17 11:31:26 +01:00
Gabor
1cce542cd5 lv_draw: triangle draw added for experimental usage 2017-02-17 11:31:26 +01:00
Kiss-Vamosi Gabor
b5b38ec642 lv_pb: remove phantom bar when set 2017-02-11 20:27:35 +01:00
Gabor
e1fe92ffe7 icon_settigns added 2017-02-06 16:10:47 +01:00
Gabor
ef591b7af1 app conf: app configuration added (terminal, files) 2017-02-06 16:10:47 +01:00
Gabor
a2173ea4fe lv_ddlist: imporvement and bugfixes 2017-02-06 16:10:47 +01:00
Gabor
ca9b423f70 Minor updates after ddlist added 2017-02-06 16:10:47 +01:00
Gabor
5da17ebf50 lv_ddlist: drop down list new object type added 2017-02-06 16:10:47 +01:00
Gabor
6abcbe01cd lv_win: lv_win_close_action bugfix 2017-02-06 16:10:47 +01:00
Gabor
bff43f09a0 anim: template anim_t initilizaton added in anim.h 2017-02-06 16:10:47 +01:00
Gabor
253fbe0ee5 lv_label: lv_label_append_text added 2017-02-06 16:10:47 +01:00
Kiss-Vamosi Gabor
13f75de6ee lv_app_notice: max notice num added 2017-02-03 21:48:13 +01:00
Kiss-Vamosi Gabor
7c77ebe6e5 lv_pb: set default click = false 2017-02-03 21:47:11 +01:00
Kiss-Vamosi Gabor
7f79910092 lv_pb: slider function added 2017-02-03 12:48:22 +01:00
Kiss-Vamosi Gabor
a97d4b6af5 lv_dispi: consider an object dragged only if it is really moved 2017-02-03 12:48:03 +01:00
Gabor
f189307b9c Merge branch 'master' into beta 2017-02-01 11:40:12 +01:00
Gabor
014d0a3842 txt_recolor: text recolor option added, text size function are exteded with a falg paramter 2017-02-01 11:39:48 +01:00
Kiss-Vamosi Gabor
a0c35464ef lv_mbox: mem. usage optimization (create title and btnh only if necessary) 2017-01-17 00:49:16 +01:00
Gabor
2de1f4363c symbols: define the simbols in symbol_def.h instead of font.h 2017-01-16 13:53:39 +01:00
Gabor Kiss-Vamosi
4f3e26b616 Merge pull request #9 from ajaybhargav/font_icon
lv_misc: Add icons as fonts
2017-01-16 13:48:47 +01:00
Gabor Kiss-Vamosi
f47f999480 Merge branch 'master' into font_icon 2017-01-16 13:47:39 +01:00
Ajay Bhargav
ac39928a01 lv_misc: Move SYMBOL definition to font.h for easy access
Signed-off-by: Ajay Bhargav <contact@rickeyworld.info>
2017-01-13 10:34:19 +05:30
Ajay Bhargav
ba093a8d80 lv_misc: Add new font FONT_SYMBOL_60 of size 60px
New font added with similar symbol to that of symbol_30 but of double
height.

Signed-off-by: Ajay Bhargav <contact@rickeyworld.info>
2017-01-13 10:29:12 +05:30
Ajay Bhargav
215da26097 lv_misc: Rename FONT_ICONS to FONT_SYMBOL_30
Define USE_FONT_SYMBOL_30 to enable symbol fonts of 30px.

FONT_ICONS renamed to FONT_SYMBOL_30

Signed-off-by: Ajay Bhargav <contact@rickeyworld.info>
2017-01-13 10:19:40 +05:30
Ajay Bhargav
510e8b8992 lv_misc: Add icons as fonts
Using icons as font uses less space. Font size is 30px.

Signed-off-by: Ajay Bhargav <contact@rickeyworld.info>
2017-01-09 13:16:36 +05:30
137 changed files with 9939 additions and 73956 deletions

View File

@@ -1,16 +1,89 @@
# LittleV Graphical Libraray Core
# LittleV Graphics Libraray
LittleV Graphical Library is C written software libraray which helps you to add modern and innovative graphical user interface to your embedded application.
![LittlevGL cover](http://www.gl.littlev.hu/home/main_cover.png)
The library supports high level graphical effects, like anialaiasing, opacity, color fade etc.
The LittlevGL is a graphics library which allows you to create graphical user interfaces (GUI) from the most simple monochrome designs to amazing GUIs for high resolution TFTs. No double buffering is required to use transparency and smooth animations.
The GUI can be built from simle objects like screens, buttons labels, images etc.
The graphics library is written in C and it is completely hardware independent. You can even run it in a PC simulator without any embedded hardware.
The "misc" modul is required to use use the library. (https://github.com/littlevgl/misc)
Visit the http://gl.littlev.hu
Check littlev.hu for more information!
## Key features
* Hardware independent
* Support any modern microcontroller
* No external RAM, FPU or GPU required
* High resolution TFTs and monochrome displays are also supported
* Scalable and modular
* Clear and well-structured source code
* Color depth options: 24 bit, 16 bit, 8 bot or 1 bit
* Build GUI from simple graphical objects
* Buttons, Labels, Images
* Charts, Lists, Bars, Sliders, Text areas etc.
* High level graphical features:
* Antialiassing (font or full screen)
* Animations
* Transparency
* Gradient colors
* Smooth dragging and scrolling
* Layers
* Customizable appearance with styles
* Applications for complex tasks
* Can run in a PC simulator
* Actively developed
There are two branches: master and beta. In beta you will find the newest features which are not released yet.
## Porting
The following functions has to be provided
* hal/disp `disp_fill(x1, y1, x2, y2, color)` to fill area with a color
* hal/disp `disp_map(x1, y1, x2, y2, &color_array)` copy a color map to an area
* hal/indev `indev_get(id, &x, &y)` get the *x* and *y* coordinates from an input device (e.g. touch pad)
* hal/systick `systick_get()` get a system tick with 1 ms resolution
* hal/systick `systick_elapse(prev_time)` get the elapsed milliseconds sience *prev_time*
See the [example HAL](https://github.com/littlevgl/hal) repository!
## Requirements
* [Misc. library](https://github.com/littlevgl/misc) is used by the graphics library
## Project set-up
1. Clone or download the following repositories:
* lvgl:`git clone https://github.com/littlevgl/lvgl.git`
* misc: `git clone https://github.com/littlevgl/misc.git`
* hal: `git clone https://github.com/littlevgl/hal.git`
2. Create project with your prefered IDE and add the **lvgl**, **misc** and **hal** folders
3. Add your projects **root directory as include path**
4. Write your display, touch pad and system tick **drivers in hal**
5. Copy *lvgl/lv_conf_templ.h* as **lv_conf.h** and *misc/misc_conf_templ.h* as **misc_conf.h** to the projects root folder
6. In the *_conf.h files delete the first `#if 0` and its `#endif`. Let the default configurations at first.
7. In your *main.c* include:
* #include "misc/misc.h"
* #include "misc/os/ptask.h"
* #include "lvgl/lvgl.h"
8. In your *main.c* intialize:
* **misc_init()**;
* your_systick_init();
* your_disp_init();
* your_indev_init();
* **lvgl_init()**;
10. To **test** create a label: `lv_obj_t * label = lv_label_create(lv_scr_act(), NULL);`
11. In the main *while(1)* call `ptask_handler();` and make a few milliseconds delay (e.g. `your_delay_ms(5);`)
12. Compile the code and load it to your embedded hardware
## PC Simulator
If you don't have got an embedded hardware you can test the graphics library in a PC simulator. The simulator uses [SDL2](https://www.libsdl.org/) to emulate a display on your monitor and a touch pad with your mouse.
There is a pre-configured PC project for **Eclipse CDT** in this repository: https://github.com/littlevgl/proj_pc
## Contributing
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request!
If you find an issue, please report it via GitHub!
## Donate
If you are pleased with the graphics library and found it useful pleas support its further development:
[![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=GJV3SC5EHDANS)

File diff suppressed because it is too large Load Diff

View File

@@ -6,6 +6,10 @@
#ifndef LV_APP_H
#define LV_APP_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
@@ -17,6 +21,18 @@
/*********************
* DEFINES
*********************/
/*Check dependencies*/
#if LV_OBJ_FREE_P == 0
#error "lv_app: Free pointer is required for application. Enable it lv_conf.h: LV_OBJ_FREE_P 1"
#endif
#if LV_OBJ_FREE_NUM == 0
#error "lv_app: Free number is required for application. Enable it lv_conf.h: LV_OBJ_FREE_NUM 1"
#endif
#if DM_CUSTOM == 0 && DM_MEM_SIZE < (2 * 1024)
#error "lv_app: not enough dynamic memory. Increase it in misc_conf.h: DM_MEM_SIZE"
#endif
/**********************
* TYPEDEFS
@@ -30,7 +46,7 @@ typedef enum
typedef enum
{
LV_APP_COM_TYPE_CHAR, /*Stream of characters. Always '\0' terminated*/
LV_APP_COM_TYPE_CHAR, /*Stream of characters. Not '\0' terminated*/
LV_APP_COM_TYPE_INT, /*Stream of 'int32_t' numbers*/
LV_APP_COM_TYPE_LOG, /*String about an event to log*/
LV_APP_COM_TYPE_TRIG, /*A trigger to do some specific action (data is ignored)*/
@@ -47,6 +63,7 @@ typedef struct
lv_obj_t * sc;
lv_obj_t * sc_title;
lv_obj_t * win;
lv_obj_t * conf_win;
void * app_data;
void * sc_data;
void * win_data;
@@ -63,38 +80,27 @@ typedef struct __LV_APP_DSC_T
void (*sc_close) (lv_app_inst_t *);
void (*win_open) (lv_app_inst_t *, lv_obj_t *);
void (*win_close) (lv_app_inst_t *);
void (*conf_open) (lv_app_inst_t *, lv_obj_t * );
uint16_t app_data_size;
uint16_t sc_data_size;
uint16_t win_data_size;
}lv_app_dsc_t;
typedef struct {
lv_rects_t menu_style;
lv_btns_t menu_btn_style;
lv_labels_t menu_btn_label_style;
lv_imgs_t menu_btn_img_style;
lv_lists_t app_list_style;
lv_pages_t sc_page_style;
lv_labels_t win_txt_style;
lv_wins_t win_style;
lv_btns_t sc_style;
lv_btns_t sc_send_style;
lv_btns_t sc_rec_style;
lv_labels_t sc_title_style;
lv_labels_t sc_txt_style;
opa_t menu_opa;
opa_t menu_btn_opa;
opa_t sc_opa;
cord_t menu_h;
cord_t app_list_w;
cord_t app_list_h;
cord_t sc_title_margin;
/*Calculated values, do not set them!*/
cord_t win_useful_w;
cord_t win_useful_h;
lv_style_t menu;
lv_style_t menu_btn_rel;
lv_style_t menu_btn_pr;
lv_style_t sc_rel;
lv_style_t sc_pr;
lv_style_t sc_send_rel;
lv_style_t sc_send_pr;
lv_style_t sc_rec_rel;
lv_style_t sc_rec_pr;
lv_style_t sc_title;
lv_style_t win_header;
lv_style_t win_scrl;
lv_style_t win_cbtn_rel;
lv_style_t win_cbtn_pr;
}lv_app_style_t;
@@ -215,10 +221,6 @@ lv_app_inst_t * lv_app_get_next(lv_app_inst_t * prev, lv_app_dsc_t * dsc);
*/
lv_app_dsc_t ** lv_app_dsc_get_next(lv_app_dsc_t ** prev);
/**
* Refresh the style of the applications
* */
void lv_app_style_refr(void);
/**
* Get a pointer to the application style structure. If modified then 'lv_app_refr_style' should be called
@@ -230,6 +232,26 @@ lv_app_style_t * lv_app_style_get(void);
* MACROS
**********************/
#endif /*LV_APP_ENABLE != 0*/
/**********************
* POST-INCLUDES
*********************/
#include "lvgl/lv_app/lv_app_util/lv_app_kb.h"
#include "lvgl/lv_app/lv_app_util/lv_app_fsel.h"
#include "lvgl/lv_app/lv_app_util/lv_app_notice.h"
#include "lvgl/lv_appx/lv_app_example.h"
#include "lvgl/lv_appx/lv_app_phantom.h"
#include "lvgl/lv_appx/lv_app_sysmon.h"
#include "lvgl/lv_appx/lv_app_terminal.h"
#include "lvgl/lv_appx/lv_app_files.h"
#include "lvgl/lv_appx/lv_app_wifi.h"
#include "lvgl/lv_appx/lv_app_gsm.h"
#include "lvgl/lv_appx/lv_app_benchmark.h"
#endif /*LV_APP_ENABLE*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_APP_H*/

View File

@@ -7,7 +7,7 @@
* INCLUDES
*********************/
#include "lv_app_fsel.h"
#if LV_APP_ENABLE != 0
#if USE_LV_APP_FSEL != 0
#include <stdio.h>
#include "lv_app_notice.h"
@@ -15,9 +15,6 @@
/*********************
* DEFINES
*********************/
#define LV_APP_FSEL_FN_MAX_LEN 128
#define LV_APP_FSEL_PATH_MAX_LEN 256
#define LV_APP_FSEL_PAGE_SIZE 8
/**********************
* TYPEDEFS
@@ -45,9 +42,9 @@ static char fsel_path[LV_APP_FSEL_PATH_MAX_LEN];
static uint16_t fsel_file_cnt;
static lv_obj_t * fsel_win;
static lv_obj_t * fsel_list;
static lv_lists_t fsel_lists;
static void * fsel_param;
static void (*fsel_ok_action)(void *, const char *);
static lv_style_t style_btn_symbol;
/**********************
* MACROS
@@ -62,7 +59,8 @@ static void (*fsel_ok_action)(void *, const char *);
*/
void lv_app_fsel_init(void)
{
lv_lists_get(LV_LISTS_TRANSP, &fsel_lists);
lv_style_get(LV_STYLE_BTN_REL, &style_btn_symbol);
style_btn_symbol.font = font_get(LV_IMG_DEF_SYMBOL_FONT);
}
/**
@@ -91,13 +89,15 @@ void lv_app_fsel_open(const char * path, const char * filter, void * param, void
/*Check filter: NULL and "" mean no filtering*/
if(fsel_filter == NULL) fsel_filter = "";
/*Create a window for the File selector*/
lv_app_style_t * app_style = lv_app_style_get();
/*Create a window for the File selector*/
fsel_win = lv_win_create(lv_scr_act(), NULL);
lv_obj_set_size(fsel_win, LV_HOR_RES, LV_VER_RES);
lv_obj_set_style(fsel_win, &app_style->win_style);
lv_win_set_styles_cbtn(fsel_win, &app_style->win_cbtn_rel, &app_style->win_cbtn_pr);
lv_obj_set_style(lv_win_get_header(fsel_win), &app_style->menu);
lv_win_add_ctrl_btn(fsel_win, "U:/icon_close", fsel_close_action);
lv_win_add_cbtn(fsel_win, SYMBOL_CLOSE, fsel_close_action);
fsel_refr(); /*Refresh the list*/
@@ -139,34 +139,34 @@ static void fsel_refr(void)
lv_win_set_title(fsel_win, fsel_path);
/*Create a new list*/
lv_app_style_t * app_style = lv_app_style_get();
fsel_list = lv_list_create(fsel_win, NULL);
lv_obj_set_width(fsel_list, app_style->win_useful_w);
lv_obj_set_style(fsel_list, lv_lists_get(LV_LISTS_TRANSP, NULL));
lv_obj_set_width(fsel_list, lv_win_get_width(fsel_win));
lv_list_set_style_img(fsel_list, &style_btn_symbol);
lv_obj_set_style(lv_page_get_scrl(fsel_list), lv_style_get(LV_STYLE_TRANSP_TIGHT, NULL));
lv_obj_set_drag_parent(fsel_list, true);
lv_obj_set_drag_parent(lv_page_get_scrl(fsel_list), true);
lv_rect_set_fit(fsel_list, false, true);
lv_cont_set_fit(fsel_list, false, true);
fs_res_t res = FS_RES_OK;
lv_obj_t * liste;
/*At empty path show the drivers */
if(fsel_path[0] == '\0') {
char drv[16];
char buf[2];
lv_obj_t * liste;
fs_get_letters(drv);
uint8_t i;
for(i = 0; drv[i] != '\0'; i++) {
buf[0] = drv[i];
buf[1] = '\0';
liste = lv_list_add(fsel_list, "U:/icon_driver", buf, fsel_drv_action);
liste = lv_list_add(fsel_list, SYMBOL_DRIVE, buf, fsel_drv_action);
/*Add long press action to choose the driver as a folder*/
if(fsel_filter[0] == '/') lv_btn_set_lpr_action(liste, fsel_drv_lpr_action);
}
}
/*List the files/folders with fs interface*/
else {
lv_list_add(fsel_list, "U:/icon_up", "Up", fsel_up_action);
liste = lv_list_add(fsel_list, SYMBOL_UP, "Up", fsel_up_action);
fs_readdir_t rd;
res = fs_readdir_init(&rd, fsel_path);
@@ -177,7 +177,7 @@ static void fsel_refr(void)
/*At not first page add prev. page button */
if(fsel_file_cnt != 0) {
lv_list_add(fsel_list, "U:/icon_left", "Previous page", fsel_prev_action);
liste = lv_list_add(fsel_list, SYMBOL_LEFT, "Previous page", fsel_prev_action);
}
char fn[LV_APP_FSEL_FN_MAX_LEN];
@@ -186,7 +186,7 @@ static void fsel_refr(void)
uint16_t file_cnt = 0;
while(file_cnt <= fsel_file_cnt) {
res = fs_readdir(&rd, fn);
if(res != FS_RES_OK || fn[0] == '\0'){
if(res != FS_RES_OK){
lv_app_notice_add("Can not read the path\nin File selector");
return;
}
@@ -197,7 +197,7 @@ static void fsel_refr(void)
while(res == FS_RES_OK && fn[0] != '\0') {
if(fn[0] == '/') { /*Add a folder*/
lv_obj_t * liste;
liste = lv_list_add(fsel_list, "U:/icon_folder", &fn[1], fsel_folder_action);
liste = lv_list_add(fsel_list, SYMBOL_FOLDER, &fn[1], fsel_folder_action);
/*Add long press action to choose a folder*/
if(fsel_filter[0] == '/') lv_btn_set_lpr_action(liste, fsel_folder_lpr_action);
@@ -208,7 +208,7 @@ static void fsel_refr(void)
else if(fsel_filter[0] == '\0' || /*No filtering or ...*/
(strcmp(fs_get_ext(fn), fsel_filter) == 0 && /*.. the filter matches*/
fsel_filter[0] != '/')) {
lv_list_add(fsel_list, "U:/icon_file", fn, fsel_file_action);
liste = lv_list_add(fsel_list, SYMBOL_FILE, fn, fsel_file_action);
fsel_file_cnt ++;
file_cnt ++;
}
@@ -218,7 +218,7 @@ static void fsel_refr(void)
/*Show only LV_APP_FSEL_MAX_FILE elements and add a Next page button*/
if(fsel_file_cnt != 0 && fsel_file_cnt % LV_APP_FSEL_PAGE_SIZE == 0) {
lv_list_add(fsel_list, "U:/icon_right", "Next page", fsel_next_action);
liste = lv_list_add(fsel_list, SYMBOL_RIGHT, "Next page", fsel_next_action);
break;
}
}
@@ -301,7 +301,7 @@ static lv_action_res_t fsel_prev_action(lv_obj_t * prev, lv_dispi_t * dispi)
*/
static lv_action_res_t fsel_drv_action(lv_obj_t * drv, lv_dispi_t * dispi)
{
sprintf(fsel_path, "%s:", lv_list_element_get_txt(drv));
sprintf(fsel_path, "%s:", lv_list_get_element_text(drv));
fsel_file_cnt = 0;
fsel_refr();
return LV_ACTION_RES_INV;
@@ -315,7 +315,7 @@ static lv_action_res_t fsel_drv_action(lv_obj_t * drv, lv_dispi_t * dispi)
*/
static lv_action_res_t fsel_drv_lpr_action(lv_obj_t * drv, lv_dispi_t * dispi)
{
sprintf(fsel_path, "%s:", lv_list_element_get_txt(drv));
sprintf(fsel_path, "%s:", lv_list_get_element_text(drv));
if(fsel_ok_action != NULL) {
fsel_ok_action(fsel_param, fsel_path);
@@ -334,7 +334,7 @@ static lv_action_res_t fsel_drv_lpr_action(lv_obj_t * drv, lv_dispi_t * dispi)
*/
static lv_action_res_t fsel_folder_action(lv_obj_t * folder, lv_dispi_t * dispi)
{
sprintf(fsel_path, "%s/%s", fsel_path, lv_list_element_get_txt(folder));
sprintf(fsel_path, "%s/%s", fsel_path, lv_list_get_element_text(folder));
fsel_file_cnt = 0;
fsel_refr();
return LV_ACTION_RES_INV;
@@ -348,7 +348,7 @@ static lv_action_res_t fsel_folder_action(lv_obj_t * folder, lv_dispi_t * dispi)
*/
static lv_action_res_t fsel_folder_lpr_action(lv_obj_t * folder, lv_dispi_t * dispi)
{
sprintf(fsel_path, "%s/%s", fsel_path, lv_list_element_get_txt(folder));
sprintf(fsel_path, "%s/%s", fsel_path, lv_list_get_element_text(folder));
if(fsel_ok_action != NULL) {
fsel_ok_action(fsel_param, fsel_path);
@@ -367,7 +367,7 @@ static lv_action_res_t fsel_folder_lpr_action(lv_obj_t * folder, lv_dispi_t * di
*/
static lv_action_res_t fsel_file_action(lv_obj_t * file, lv_dispi_t * dispi)
{
sprintf(fsel_path, "%s/%s", fsel_path, lv_list_element_get_txt(file));
sprintf(fsel_path, "%s/%s", fsel_path, lv_list_get_element_text(file));
if(fsel_ok_action != NULL) {
fsel_ok_action(fsel_param, fsel_path);

View File

@@ -6,15 +6,32 @@
#ifndef LV_APP_FSEL_H
#define LV_APP_FSEL_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "../lv_app.h"
#if LV_APP_ENABLE != 0
#if USE_LV_APP_FSEL != 0
/*********************
* DEFINES
*********************/
/*Add the required configurations*/
#ifndef LV_APP_FSEL_FN_MAX_LEN
#define LV_APP_FSEL_FN_MAX_LEN 128
#endif
#ifndef LV_APP_FSEL_PATH_MAX_LEN
#define LV_APP_FSEL_PATH_MAX_LEN 256
#endif
#ifndef LV_APP_FSEL_PAGE_SIZE
#define LV_APP_FSEL_PAGE_SIZE 8
#endif
/**********************
* TYPEDEFS
@@ -35,7 +52,7 @@ void lv_app_fsel_init(void);
* @param filter show only files with a specific extension, e.g. "wav".
* "/" means filter to folders.
* @param param a free parameter which will be added to 'ok_action'
* @param ok_action an action to call when a file or folder is chosen
* @param ok_action an action to call when a file or folder is chosen (give 'param' and the path as parameters)
*/
void lv_app_fsel_open(const char * path, const char * filter, void * param,
void (*ok_action)(void *, const char *));
@@ -49,6 +66,10 @@ void lv_app_fsel_close(void);
* MACROS
**********************/
#endif /*LV_APP_ENABLE != 0*/
#endif /*LV_APP_ENABLE*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_APP_FSEL_H*/

View File

@@ -7,7 +7,7 @@
* INCLUDES
*********************/
#include "lv_app_kb.h"
#if LV_APP_ENABLE != 0
#if USE_LV_APP_KB != 0
#include "lvgl/lv_objx/lv_btnm.h"
#include "lvgl/lv_objx/lv_ta.h"
@@ -15,6 +15,9 @@
/*********************
* DEFINES
*********************/
#ifndef LV_APP_KB_ANIM_TIME
#define LV_APP_KB_ANIM_TIME 300 /*ms*/
#endif
/**********************
* TYPEDEFS
@@ -33,23 +36,23 @@ static lv_obj_t * kb_win;
static lv_obj_t * kb_ta;
static const char * kb_map_lc[] = {
"\0051#", "\004q", "\004w", "\004e", "\004r", "\004t", "\004y", "\004u", "\004i", "\004o", "\004p", "\007Del", "\n",
"\007ABC", "\004a", "\004s", "\004d", "\004f", "\004g", "\004h", "\004j", "\004k", "\004l", "\010Enter", "\n",
"\006ABC", "\003a", "\003s", "\003d", "\003f", "\003g", "\003h", "\003j", "\003k", "\003l", "\010Enter", "\n",
"_", "-", "z", "x", "c", "v", "b", "n", "m", ".", ",", ":", "\n",
"\002Hide", "\002Left", "\006 ", "\002Right", "\002Ok", ""
"\003Hide", "\003Left", "\006 ", "\003Right", "\003Ok", ""
};
static const char * kb_map_uc[] = {
"\0051#", "\004Q", "\004W", "\004E", "\004R", "\004T", "\004Y", "\004U", "\004I", "\004O", "\004P", "\007Del", "\n",
"\007abc", "\004A", "\004S", "\004D", "\004F", "\004G", "\004H", "\004J", "\004K", "\004L", "\010Enter", "\n",
"\006abc", "\003A", "\003S", "\003D", "\003F", "\003G", "\003H", "\003J", "\003K", "\003L", "\010Enter", "\n",
"_", "-", "Z", "X", "C", "V", "B", "N", "M", ".", ",", ":", "\n",
"\002Hide", "\002Left", "\006 ", "\002Right", "\002Ok", ""
"\003Hide", "\003Left", "\006 ", "\003Right", "\003Ok", ""
};
static const char * kb_map_spec[] = {
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "\002Del", "\n",
"\002abc", "+", "-", "/", "*", "=", "%", "!", "?", "#", "<", ">", "\n",
"\\", "@", "$", "(", ")", "{", "}", "[", "]", ";", "\"", "'", "\n",
"\002Hide", "\002Left", "\006 ", "\002Right", "\002Ok", ""
"\003Hide", "\003Left", "\006 ", "\003Right", "\003Ok", ""
};
static const char * kb_map_num[] = {
@@ -63,8 +66,9 @@ static cord_t kb_ta_ori_size;
static uint8_t kb_mode;
static void (*kb_close_action)(lv_obj_t *);
static void (*kb_ok_action)(lv_obj_t *);
static lv_btnms_t kb_btnms;
static lv_style_t style_bg;
static lv_style_t style_btn_rel;
static lv_style_t style_btn_pr;
/**********************
* MACROS
**********************/
@@ -78,17 +82,21 @@ static lv_btnms_t kb_btnms;
*/
void lv_app_kb_init(void)
{
lv_btnms_get(LV_BTNMS_DEF, &kb_btnms);
kb_btnms.rects.gcolor = COLOR_WHITE;
kb_btnms.rects.objs.color = COLOR_WHITE;
kb_btnms.rects.opad = 4 + LV_DOWNSCALE;
kb_btnms.rects.vpad = 3 + LV_DOWNSCALE;
kb_btnms.rects.hpad = 3 + LV_DOWNSCALE;
kb_btnms.rects.round = 0;
kb_btnms.rects.bwidth = 0;
lv_app_style_t * app_style = lv_app_style_get();
kb_btnms.btns.rects.bwidth = 0;
kb_btnms.btns.rects.round = 0;
memcpy(&style_bg, &app_style->menu, sizeof(lv_style_t));
style_bg.opa = OPA_COVER;
style_bg.hpad = 0;
style_bg.vpad = 0;
style_bg.opad = 0;
memcpy(&style_btn_rel, &app_style->menu_btn_rel, sizeof(lv_style_t));
style_btn_rel.radius = 0;
style_btn_rel.bwidth = 1;
memcpy(&style_btn_pr, &app_style->menu_btn_pr, sizeof(lv_style_t));
style_btn_pr.radius = 0;
style_btn_pr.bwidth = 1;
}
/**
@@ -97,8 +105,9 @@ void lv_app_kb_init(void)
* @param mode 'OR'd values of 'lv_app_kb_mode_t' enum
* @param close a function to call when the keyboard is closed
* @param ok a function to called when the "Ok" button is pressed
* @return the created button matrix objects
*/
void lv_app_kb_open(lv_obj_t * ta, lv_app_kb_mode_t mode, void (*close)(lv_obj_t *), void (*ok)(lv_obj_t *))
lv_obj_t * lv_app_kb_open(lv_obj_t * ta, lv_app_kb_mode_t mode, void (*close)(lv_obj_t *), void (*ok)(lv_obj_t *))
{
/*Close the previous keyboard*/
if(kb_btnm != NULL) {
@@ -113,39 +122,51 @@ void lv_app_kb_open(lv_obj_t * ta, lv_app_kb_mode_t mode, void (*close)(lv_obj_t
/*Create a button matrix for the keyboard */
kb_btnm = lv_btnm_create(lv_scr_act(), NULL);
lv_obj_set_style(kb_btnm, &style_bg);
lv_obj_set_size(kb_btnm, LV_HOR_RES, LV_VER_RES / 2);
lv_obj_align(kb_btnm, NULL, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
lv_btnm_set_cb(kb_btnm, lv_app_kb_action);
lv_btnm_set_action(kb_btnm, lv_app_kb_action);
if(mode & LV_APP_KB_MODE_TXT) {
kb_btnms.labels.font = LV_APP_FONT_MEDIUM;
style_btn_rel.font = font_get(LV_APP_FONT_MEDIUM);
style_btn_pr.font = font_get(LV_APP_FONT_MEDIUM);
lv_btnm_set_map(kb_btnm, kb_map_lc);
}
else if(mode & LV_APP_KB_MODE_NUM) {
kb_btnms.labels.font = LV_APP_FONT_LARGE;
style_btn_rel.font = font_get(LV_APP_FONT_LARGE);
style_btn_pr.font = font_get(LV_APP_FONT_LARGE);
lv_btnm_set_map(kb_btnm, kb_map_num);
}
lv_obj_set_style(kb_btnm, &kb_btnms);
lv_btnm_set_styles_btn(kb_btnm, &style_btn_rel, &style_btn_pr);
/*Reduce teh size of the window and align it to the top*/
kb_win = lv_app_win_get_from_obj(kb_ta);
lv_obj_set_height(kb_win, LV_VER_RES / 2);
lv_obj_set_y(kb_win, 0);
kb_win = NULL;
kb_ta_ori_size = 0;
if(mode & LV_APP_KB_MODE_WIN_RESIZE) {
/*Reduce the size of the window and align it to the top*/
kb_win = lv_app_win_get_from_obj(kb_ta);
lv_obj_set_height(kb_win, LV_VER_RES / 2);
lv_obj_set_y(kb_win, 0);
/*If the text area is higher then the new size of the window redus its size too*/
lv_app_style_t * app_style = lv_app_style_get();
cord_t win_h = lv_obj_get_height(kb_win) - 2 * app_style->win_style.pages.scrl_rects.vpad;
kb_ta_ori_size = lv_obj_get_height(kb_ta);
if(lv_obj_get_height(kb_ta) > win_h) {
lv_obj_set_height(kb_ta, win_h);
/*If the text area is higher then the new size of the window reduce its size too*/
cord_t cont_h = lv_obj_get_height(kb_win) - lv_obj_get_height(lv_win_get_header(kb_win));
kb_ta_ori_size = lv_obj_get_height(kb_ta);
if(lv_obj_get_height(kb_ta) > cont_h - LV_DPI / 10) {
lv_obj_set_height(kb_ta, cont_h - LV_DPI / 10);
}
lv_page_focus(lv_win_get_page(kb_win), kb_ta, 0);
}
lv_ta_set_cursor_pos(kb_ta, LV_TA_CUR_LAST);
if(kb_mode & LV_APP_KB_MODE_CUR_MANAGE) {
lv_ta_set_cursor_show(kb_ta, true);
}
if(kb_mode & LV_APP_KB_MODE_ANIM_IN) {
lv_obj_anim(kb_btnm, LV_ANIM_FLOAT_BOTTOM | ANIM_IN, LV_APP_KB_ANIM_TIME, 0, NULL);
}
return kb_btnm;
#if LV_APP_ANIM_LEVEL != 0
lv_page_focus(lv_win_get_content(kb_win), kb_ta, true);
#else
lv_page_focus(kb_win, kb_ta, false);
#endif
}
/**
@@ -163,19 +184,26 @@ void lv_app_kb_close(bool ok)
}
/*Reset the modified sizes*/
if((kb_mode & LV_APP_KB_MODE_WIN_RESIZE) && kb_win != NULL) {
lv_obj_set_height(kb_ta, kb_ta_ori_size);
lv_obj_set_size(kb_win, LV_HOR_RES, LV_VER_RES);
kb_win = NULL;
}
if(kb_mode & LV_APP_KB_MODE_CUR_MANAGE) {
lv_ta_set_cursor_show(kb_ta, false);
}
lv_obj_set_height(kb_ta, kb_ta_ori_size);
if(kb_mode & LV_APP_KB_MODE_ANIM_OUT) {
lv_obj_anim(kb_btnm, LV_ANIM_FLOAT_BOTTOM | ANIM_OUT, LV_APP_KB_ANIM_TIME, 0, lv_obj_del);
} else {
lv_obj_del(kb_btnm);
}
lv_obj_set_size(kb_win, LV_HOR_RES, LV_VER_RES);
kb_win = NULL;
lv_obj_del(kb_btnm);
kb_btnm = NULL;
kb_ta = NULL;
}
/**********************
* STATIC FUNCTIONS
**********************/
@@ -237,11 +265,13 @@ static lv_action_res_t lv_app_kb_action(lv_obj_t * btnm, uint16_t i)
lv_ta_add_text(kb_ta, txt);
}
if(kb_mode & LV_APP_KB_MODE_WIN_RESIZE) {
#if LV_APP_ANIM_LEVEL != 0
lv_page_focus(lv_win_get_content(kb_win), kb_ta, true);
lv_page_focus(lv_win_get_content(kb_win), kb_ta, true);
#else
lv_page_focus(kb_win, kb_ta, false);
lv_page_focus(lv_win_get_page(kb_win), kb_ta, 0);
#endif
}
return LV_ACTION_RES_OK;
}

View File

@@ -6,11 +6,15 @@
#ifndef LV_APP_KB_H
#define LV_APP_KB_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "../lv_app.h"
#if LV_APP_ENABLE != 0
#if USE_LV_APP_KB != 0
/*********************
* DEFINES
@@ -21,8 +25,12 @@
**********************/
typedef enum
{
LV_APP_KB_MODE_TXT = 0x01,
LV_APP_KB_MODE_NUM = 0x02,
LV_APP_KB_MODE_TXT = 0x0001,
LV_APP_KB_MODE_NUM = 0x0002,
LV_APP_KB_MODE_WIN_RESIZE = 0x0004,
LV_APP_KB_MODE_CUR_MANAGE = 0x0008,
LV_APP_KB_MODE_ANIM_IN = 0x0010,
LV_APP_KB_MODE_ANIM_OUT = 0x0020,
}lv_app_kb_mode_t;
/**********************
@@ -40,8 +48,9 @@ void lv_app_kb_init(void);
* @param mode 'OR'd values of 'lv_app_kb_mode_t' enum
* @param close a function to call when the keyboard is closed
* @param ok a function to called when the "Ok" button is pressed
* @return the created button matrix objects
*/
void lv_app_kb_open(lv_obj_t * ta, lv_app_kb_mode_t mode, void (*close)(lv_obj_t *), void (*ok)(lv_obj_t *));
lv_obj_t * lv_app_kb_open(lv_obj_t * ta, lv_app_kb_mode_t mode, void (*close)(lv_obj_t *), void (*ok)(lv_obj_t *));
/**
* Close the keyboard
@@ -52,6 +61,11 @@ void lv_app_kb_close(bool ok);
/**********************
* MACROS
**********************/
#endif /*LV_APP_ENABLE != 0*/
#endif /*LV_APP_ENABLE*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_APP_KB_H*/

View File

@@ -7,12 +7,12 @@
* INCLUDES
*********************/
#include "lv_app_notice.h"
#if LV_APP_ENABLE != 0
#if USE_LV_APP_NOTICE != 0
#include "lvgl/lv_objx/lv_rect.h"
#include <lvgl/lv_objx/lv_cont.h>
#include "lvgl/lv_objx/lv_label.h"
#include "lvgl/lv_misc/anim.h"
#include "misc/gfx/anim.h"
#include <stdio.h>
/*********************
@@ -44,14 +44,12 @@ static lv_obj_t * notice_h;
*/
void lv_app_notice_init(void)
{
lv_app_style_t * app_style = lv_app_style_get();
notice_h = lv_rect_create(lv_scr_act(), NULL);
lv_obj_set_size(notice_h, LV_HOR_RES, LV_VER_RES - app_style->menu_h);
lv_obj_set_y(notice_h, app_style->menu_h);
notice_h = lv_cont_create(lv_scr_act(), NULL);
lv_obj_set_size(notice_h, LV_HOR_RES, LV_VER_RES - LV_DPI / 8);
lv_obj_set_y(notice_h, LV_DPI / 8);
lv_obj_set_click(notice_h, false);
lv_obj_set_style(notice_h, lv_rects_get(LV_RECTS_TRANSP, NULL));
lv_rect_set_layout(notice_h, LV_RECT_LAYOUT_COL_R);
lv_obj_set_style(notice_h, lv_style_get(LV_STYLE_TRANSP, NULL));
lv_cont_set_layout(notice_h, LV_CONT_LAYOUT_COL_R);
}
/**
@@ -68,19 +66,23 @@ lv_obj_t * lv_app_notice_add(const char * format, ...)
vsprintf(txt,format, va);
va_end(va);
lv_app_style_t * app_style = lv_app_style_get();
lv_obj_t * mbox;
mbox = lv_mbox_create(notice_h, NULL);
lv_obj_set_style(mbox, lv_mboxs_get(LV_MBOXS_INFO, NULL));
lv_mbox_set_title(mbox, "");
lv_mbox_set_text(mbox, txt);
lv_obj_set_opa(mbox, app_style->menu_opa);
lv_mbox_set_anim_close_time(mbox, LV_APP_NOTICE_CLOSE_ANIM_TIME);
#if LV_APP_NOTICE_SHOW_TIME != 0
lv_mbox_start_auto_close(mbox, LV_APP_NOTICE_SHOW_TIME);
#endif
/*Delete the last children if there are too many*/
uint32_t child_num = lv_obj_get_child_num(notice_h);
if(child_num > LV_APP_NOTICE_MAX_NUM) {
lv_obj_t * last_child = ll_get_tail(&notice_h->child_ll);
lv_obj_del(last_child);
}
/*make sure the notices are on the top*/
lv_obj_set_parent(notice_h, lv_scr_act());
return mbox;

View File

@@ -6,16 +6,37 @@
#ifndef LV_APP_NOTICE_H
#define LV_APP_NOTICE_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "../lv_app.h"
#include <stdarg.h>
#if LV_APP_ENABLE != 0
#if USE_LV_APP_NOTICE != 0
/*********************
* DEFINES
*********************/
/*Add the required configurations*/
#ifndef LV_APP_NOTICE_SHOW_TIME
#define LV_APP_NOTICE_SHOW_TIME 4000
#endif
#ifndef LV_APP_NOTICE_CLOSE_ANIM_TIME
#define LV_APP_NOTICE_CLOSE_ANIM_TIME 300
#endif
#ifndef LV_APP_NOTICE_MAX_NUM
#define LV_APP_NOTICE_MAX_NUM 6
#endif
#ifndef LV_APP_NOTICE_MAX_LEN
#define LV_APP_NOTICE_MAX_LEN 256
#endif
/**********************
* TYPEDEFS
@@ -41,6 +62,11 @@ lv_obj_t * lv_app_notice_add(const char * format, ...);
* MACROS
**********************/
#endif /*LV_APP_ENABLE*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_APP_NOTICE_H*/
#endif

580
lv_appx/lv_app_benchmark.c Normal file
View File

@@ -0,0 +1,580 @@
/**
* @file lv_app_benchmark.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_app_benchmark.h"
#if LV_APP_ENABLE != 0 && USE_LV_APP_BENCHMARK != 0
#include "../lv_app/lv_app_util/lv_app_kb.h"
#include "lvgl/lv_obj/lv_refr.h"
#include <stdio.h>
/*********************
* DEFINES
*********************/
#define SHADOW_WIDTH (LV_DPI / 4)
#define IMG_RECOLOR OPA_30
#define OPACITY OPA_60
/**********************
* TYPEDEFS
**********************/
/*Application specific data for an instance of this application*/
typedef struct
{
uint8_t wp :1;
uint8_t recolor :1;
uint8_t upscalse :1;
uint8_t shadow :1;
uint8_t opa :1;
}my_app_data_t;
/*Application specific data a window of this application*/
typedef struct
{
lv_obj_t * wp;
lv_obj_t * value_l;
lv_style_t style_wp;
lv_style_t style_value_l;
lv_style_t style_btn_rel;
lv_style_t style_btn_pr;
lv_style_t style_btn_trel;
lv_style_t style_btn_tpr;
lv_style_t style_btn_ina;
}my_win_data_t;
/*Application specific data for a shortcut of this application*/
typedef struct
{
lv_obj_t * label;
}my_sc_data_t;
/**********************
* STATIC PROTOTYPES
**********************/
static void my_app_run(lv_app_inst_t * app, void * conf);
static void my_app_close(lv_app_inst_t * app);
static void my_com_rec(lv_app_inst_t * app_send, lv_app_inst_t * app_rec, lv_app_com_type_t type , const void * data, uint32_t size);
static void my_sc_open(lv_app_inst_t * app, lv_obj_t * sc);
static void my_sc_close(lv_app_inst_t * app);
static void my_win_open(lv_app_inst_t * app, lv_obj_t * win);
static void my_win_close(lv_app_inst_t * app);
static void refr_monitor(uint32_t time_ms, uint32_t px_num);
static lv_action_res_t run_rel_action(lv_obj_t * btn, lv_dispi_t * dispi);
static lv_action_res_t wp_rel_action(lv_obj_t * btn, lv_dispi_t * dispi);
static lv_action_res_t recolor_rel_action(lv_obj_t * btn, lv_dispi_t * dispi);
static lv_action_res_t upscale_rel_action(lv_obj_t * btn, lv_dispi_t * dispi);
static lv_action_res_t shadow_rel_action(lv_obj_t * btn, lv_dispi_t * dispi);
static lv_action_res_t opa_rel_action(lv_obj_t * btn, lv_dispi_t * dispi);
/**********************
* STATIC VARIABLES
**********************/
static lv_app_dsc_t my_app_dsc =
{
.name = "Benchmark",
.mode = LV_APP_MODE_NONE,
.app_run = my_app_run,
.app_close = my_app_close,
.com_rec = my_com_rec,
.win_open = my_win_open,
.win_close = my_win_close,
.sc_open = my_sc_open,
.sc_close = my_sc_close,
.app_data_size = sizeof(my_app_data_t),
.sc_data_size = sizeof(my_sc_data_t),
.win_data_size = sizeof(my_win_data_t),
};
static lv_style_t style_win_scrl;
static lv_style_t style_sc_btn_rel;
static lv_style_t style_sc_btn_pr;
static bool caputre_next;
LV_IMG_DECLARE(img_bg);
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/**
* Initialize the application
* @return pointer to the application descriptor of this application
*/
const lv_app_dsc_t * lv_app_benchmark_init(void)
{
lv_refr_set_monitor_cb(refr_monitor);
lv_img_create_file("app_bm_wp", img_bg);
lv_style_get(LV_STYLE_TRANSP, &style_win_scrl);
style_win_scrl.opad = 2 * SHADOW_WIDTH + SHADOW_WIDTH / 8 ;
style_win_scrl.hpad = SHADOW_WIDTH;
style_win_scrl.vpad = SHADOW_WIDTH;
lv_style_get(LV_STYLE_BTN_REL, &style_sc_btn_rel);
style_sc_btn_rel.font = font_get(LV_IMG_DEF_SYMBOL_FONT);
lv_style_get(LV_STYLE_BTN_PR, &style_sc_btn_pr);
style_sc_btn_pr.font = font_get(LV_IMG_DEF_SYMBOL_FONT);
return &my_app_dsc;
}
/**********************
* STATIC FUNCTIONS
**********************/
/**
* Run an application according to 'app_dsc'
* @param app_dsc pointer to an application descriptor
* @param conf pointer to a lv_app_benchmark_conf_t structure with configuration data or NULL if unused
* @return pointer to the opened application or NULL if any error occurred
*/
static void my_app_run(lv_app_inst_t * app, void * conf)
{
/*Initialize the application*/
}
/**
* Close a running application.
* Close the Window and the Shortcut too if opened.
* Free all the allocated memory by this application.
* @param app pointer to an application
*/
static void my_app_close(lv_app_inst_t * app)
{
/*No dynamically allocated data in 'my_app_data'*/
}
/**
* Read the data have been sent to this application
* @param app_send pointer to an application which sent the message
* @param app_rec pointer to an application which is receiving the message
* @param type type of data from 'lv_app_com_type_t' enum
* @param data pointer to the sent data
* @param size length of 'data' in bytes
*/
static void my_com_rec(lv_app_inst_t * app_send, lv_app_inst_t * app_rec,
lv_app_com_type_t type , const void * data, uint32_t size)
{
if(type == LV_APP_COM_TYPE_CHAR) { /*data: string*/
my_sc_data_t * sc_data = app_rec->sc_data;
if (sc_data->label != NULL) {
lv_label_set_text_array(sc_data->label, data, size);
lv_obj_align(sc_data->label , NULL,LV_ALIGN_CENTER, 0, 0);
}
}
}
/**
* Open a shortcut for an application
* @param app pointer to an application
* @param sc pointer to an object where the application
* can create content of the shortcut
*/
static void my_sc_open(lv_app_inst_t * app, lv_obj_t * sc)
{
my_sc_data_t * sc_data = app->sc_data;
lv_cont_set_layout(sc, LV_CONT_LAYOUT_CENTER);
sc_data->label = lv_label_create(sc, NULL);
lv_label_set_text(sc_data->label, "N/A ms");
lv_obj_t * btn = lv_btn_create(sc, NULL);
lv_btn_set_rel_action(btn, run_rel_action);
lv_cont_set_fit(btn, true, true);
lv_btn_set_styles(btn, &style_sc_btn_rel, &style_sc_btn_pr, NULL, NULL, NULL);
lv_obj_t * btn_l = lv_label_create(btn, NULL);
lv_label_set_text(btn_l, SYMBOL_PLAY);
}
/**
* Close the shortcut of an application
* @param app pointer to an application
*/
static void my_sc_close(lv_app_inst_t * app)
{
/*No dynamically allocated data in 'my_sc_data'*/
}
/**
* Open the application in a window
* @param app pointer to an application
* @param win pointer to a window object where
* the application can create content
*/
static void my_win_open(lv_app_inst_t * app, lv_obj_t * win)
{
my_win_data_t * wdata = app->win_data;
my_app_data_t * adata = app->app_data;
lv_style_get(LV_STYLE_BTN_INA, &wdata->style_value_l);
wdata->style_value_l.ccolor = COLOR_BLACK;
lv_style_get(LV_STYLE_BTN_REL, &wdata->style_btn_rel);
lv_style_get(LV_STYLE_BTN_PR, &wdata->style_btn_pr);
lv_style_get(LV_STYLE_BTN_TREL, &wdata->style_btn_trel);
lv_style_get(LV_STYLE_BTN_TPR, &wdata->style_btn_tpr);
lv_style_get(LV_STYLE_BTN_INA, &wdata->style_btn_ina);
lv_style_get(LV_STYLE_PLAIN, &wdata->style_wp);
wdata->style_wp.ccolor = COLOR_RED;//MAKE(0x10, 0x20, 0x30);
if(adata->opa == 0) {
wdata->style_btn_rel.opa = OPA_COVER;
wdata->style_btn_pr.opa = OPA_COVER;
wdata->style_btn_trel.opa =OPA_COVER;
wdata->style_btn_tpr.opa = OPA_COVER;
wdata->style_btn_ina.opa = OPA_COVER;
} else {
wdata->style_btn_rel.opa = OPACITY;
wdata->style_btn_pr.opa = OPACITY;
wdata->style_btn_trel.opa =OPACITY;
wdata->style_btn_tpr.opa = OPACITY;
wdata->style_btn_ina.opa = OPACITY;
}
if(adata->shadow == 0) {
wdata->style_btn_rel.swidth = 0;
wdata->style_btn_pr.swidth = 0;
wdata->style_btn_trel.swidth = 0;
wdata->style_btn_tpr.swidth = 0;
wdata->style_btn_ina.swidth = 0;
} else {
wdata->style_btn_rel.swidth = SHADOW_WIDTH;
wdata->style_btn_pr.swidth = SHADOW_WIDTH;
wdata->style_btn_trel.swidth = SHADOW_WIDTH;
wdata->style_btn_tpr.swidth = SHADOW_WIDTH;
wdata->style_btn_ina.swidth = SHADOW_WIDTH;
}
if(adata->recolor == 0) {
wdata->style_wp.img_recolor = OPA_TRANSP;
} else {
wdata->style_wp.img_recolor = IMG_RECOLOR;
}
lv_obj_set_style(lv_page_get_scrl(lv_win_get_page(win)), &style_win_scrl);
wdata->wp = lv_img_create(win, NULL);
lv_obj_set_protect(wdata->wp, LV_PROTECT_PARENT);
lv_obj_set_parent(wdata->wp, lv_win_get_page(win));
lv_img_set_file(wdata->wp, "U:/app_bm_wp");
lv_obj_set_size(wdata->wp, LV_HOR_RES, LV_VER_RES - lv_obj_get_height(lv_win_get_header(win)));
lv_obj_set_pos(wdata->wp, 0, 0);
lv_obj_set_style(wdata->wp, &wdata->style_wp);
if(adata->wp == 0) lv_obj_set_hidden(wdata->wp, true);
if(adata->upscalse != 0) lv_img_set_upscale(wdata->wp, true);
/* The order is changed because the wallpaper's parent change
* Therefore add the scrollable again */
lv_obj_set_parent(lv_page_get_scrl(lv_win_get_page(win)), lv_win_get_page(win));
lv_cont_set_layout(lv_page_get_scrl(lv_win_get_page(win)), LV_CONT_LAYOUT_PRETTY);
lv_obj_t * holder;
holder = lv_cont_create(win, NULL);
lv_cont_set_fit(holder, true, true);
lv_obj_set_style(holder, &wdata->style_btn_ina);
lv_page_glue_obj(holder, true);
wdata->value_l = lv_label_create(holder, NULL);
lv_obj_set_style(wdata->value_l, &wdata->style_value_l);
lv_label_set_text(wdata->value_l, "Screen load: N/A ms\nN/A px/ms");
lv_obj_t * btn;
btn = lv_btn_create(win, NULL);
lv_obj_set_free_p(btn, app);
lv_page_glue_obj(btn, true);
lv_cont_set_fit(btn, true, true);
lv_btn_set_styles(btn, &wdata->style_btn_rel, &wdata->style_btn_pr, &wdata->style_btn_trel, &wdata->style_btn_tpr, NULL);
lv_btn_set_rel_action(btn, run_rel_action);
lv_obj_t * btn_l;
btn_l = lv_label_create(btn, NULL);
lv_label_set_text(btn_l, "Run\ntest!");
lv_obj_set_protect(btn, LV_PROTECT_FOLLOW);
btn = lv_btn_create(win, btn);
lv_btn_set_tgl(btn, true);
lv_obj_clr_protect(btn, LV_PROTECT_FOLLOW);
if(adata->wp != 0) lv_btn_set_state(btn, LV_BTN_STATE_TREL);
else lv_btn_set_state(btn, LV_BTN_STATE_REL);
lv_btn_set_rel_action(btn, wp_rel_action);
btn_l = lv_label_create(btn, btn_l);
lv_label_set_text(btn_l, "Wallpaper");
btn = lv_btn_create(win, btn);
if(adata->recolor != 0) lv_btn_set_state(btn, LV_BTN_STATE_TREL);
else lv_btn_set_state(btn, LV_BTN_STATE_REL);
lv_btn_set_rel_action(btn, recolor_rel_action);
btn_l = lv_label_create(btn, btn_l);
lv_label_set_text(btn_l, "Wp. recolor!");
btn = lv_btn_create(win, btn);
if(adata->upscalse != 0) lv_btn_set_state(btn, LV_BTN_STATE_TREL);
else lv_btn_set_state(btn, LV_BTN_STATE_REL);
lv_btn_set_rel_action(btn, upscale_rel_action);
btn_l = lv_label_create(btn, btn_l);
lv_label_set_text(btn_l, "Wp. upscalse!");
btn = lv_btn_create(win, btn);
if(adata->shadow != 0) lv_btn_set_state(btn, LV_BTN_STATE_TREL);
lv_btn_set_rel_action(btn, shadow_rel_action);
btn_l = lv_label_create(btn, btn_l);
lv_label_set_text(btn_l, "Shadow");
btn = lv_btn_create(win, btn);
if(adata->opa != 0) lv_btn_set_state(btn, LV_BTN_STATE_TREL);
else lv_btn_set_state(btn, LV_BTN_STATE_REL);
lv_btn_set_rel_action(btn, opa_rel_action);
btn_l = lv_label_create(btn, btn_l);
lv_label_set_text(btn_l, "Opacity");
}
/**
* Close the window of an application
* @param app pointer to an application
*/
static void my_win_close(lv_app_inst_t * app)
{
}
/*--------------------
* OTHER FUNCTIONS
---------------------*/
static void refr_monitor(uint32_t time_ms, uint32_t px_num)
{
if(caputre_next != false) {
lv_app_inst_t * app = NULL;
app = lv_app_get_next(app, &my_app_dsc);
char w_buf[256];
if(time_ms != 0) sprintf(w_buf, "Screen load: %d ms\n%d px/ms", time_ms, px_num/time_ms);
else sprintf(w_buf, "Screen load: %d ms\nN/A px/ms", time_ms);
char s_buf[16];
sprintf(s_buf, "%d ms", time_ms);
while(app != NULL) {
if(app->win_data != NULL) {
my_win_data_t * wdata = app->win_data;
lv_label_set_text(wdata->value_l, w_buf);
}
if(app->sc_data != NULL) {
my_sc_data_t * sdata = app->sc_data;
lv_label_set_text(sdata->label, s_buf);
}
app = lv_app_get_next(app, &my_app_dsc);
}
caputre_next = false;
}
}
static lv_action_res_t run_rel_action(lv_obj_t * btn, lv_dispi_t * dispi)
{
lv_obj_inv(lv_scr_act());
caputre_next = true;
return LV_ACTION_RES_OK;
}
static lv_action_res_t wp_rel_action(lv_obj_t * btn, lv_dispi_t * dispi)
{
lv_app_inst_t * app = lv_obj_get_free_p(btn);
my_win_data_t * wdata = app->win_data;
my_app_data_t * adata = app->app_data;
if(lv_btn_get_state(btn) == LV_BTN_STATE_TREL) {
adata->wp = 1;
lv_obj_set_hidden(wdata->wp, false);
} else {
adata->wp = 0;
lv_obj_set_hidden(wdata->wp, true);
}
return LV_ACTION_RES_OK;
}
static lv_action_res_t recolor_rel_action(lv_obj_t * btn, lv_dispi_t * dispi)
{
lv_app_inst_t * app = lv_obj_get_free_p(btn);
my_win_data_t * wdata = app->win_data;
my_app_data_t * adata = app->app_data;
if(lv_btn_get_state(btn) == LV_BTN_STATE_TREL) {
adata->recolor = 1;
wdata->style_wp.img_recolor = IMG_RECOLOR;
} else {
adata->recolor = 0;
wdata->style_wp.img_recolor = OPA_TRANSP;
}
lv_obj_refr_style(wdata->wp);
return LV_ACTION_RES_OK;
}
static lv_action_res_t upscale_rel_action(lv_obj_t * btn, lv_dispi_t * dispi)
{
lv_app_inst_t * app = lv_obj_get_free_p(btn);
my_win_data_t * wdata = app->win_data;
my_app_data_t * adata = app->app_data;
if(lv_btn_get_state(btn) == LV_BTN_STATE_TREL) {
adata->upscalse = 1;
lv_img_set_upscale(wdata->wp, true);
} else {
adata->upscalse = 0;
lv_img_set_upscale(wdata->wp, false);
}
lv_obj_set_size(wdata->wp, LV_HOR_RES, LV_VER_RES - lv_obj_get_height(lv_win_get_header(app->win)));
return LV_ACTION_RES_OK;
}
static lv_action_res_t shadow_rel_action(lv_obj_t * btn, lv_dispi_t * dispi)
{
lv_app_inst_t * app = lv_obj_get_free_p(btn);
my_win_data_t * wdata = app->win_data;
my_app_data_t * adata = app->app_data;
if(lv_btn_get_state(btn) == LV_BTN_STATE_TREL) {
adata->shadow = 1;
wdata->style_btn_rel.swidth = SHADOW_WIDTH;
wdata->style_btn_pr.swidth = SHADOW_WIDTH;
wdata->style_btn_trel.swidth = SHADOW_WIDTH;
wdata->style_btn_tpr.swidth = SHADOW_WIDTH;
wdata->style_btn_ina.swidth = SHADOW_WIDTH;
} else {
adata->opa = 0;
wdata->style_btn_rel.swidth = 0;
wdata->style_btn_pr.swidth = 0;
wdata->style_btn_trel.swidth =0;
wdata->style_btn_tpr.swidth = 0;
wdata->style_btn_ina.swidth = 0;
}
lv_style_refr_objs(&wdata->style_btn_rel);
lv_style_refr_objs(&wdata->style_btn_pr);
lv_style_refr_objs(&wdata->style_btn_trel);
lv_style_refr_objs(&wdata->style_btn_tpr);
lv_style_refr_objs(&wdata->style_btn_ina);
return LV_ACTION_RES_OK;
}
static lv_action_res_t opa_rel_action(lv_obj_t * btn, lv_dispi_t * dispi)
{
lv_app_inst_t * app = lv_obj_get_free_p(btn);
my_win_data_t * wdata = app->win_data;
my_app_data_t * adata = app->app_data;
if(lv_btn_get_state(btn) == LV_BTN_STATE_TREL) {
adata->opa = 1;
wdata->style_btn_rel.opa = OPACITY;
wdata->style_btn_pr.opa = OPACITY;
wdata->style_btn_trel.opa =OPACITY;
wdata->style_btn_tpr.opa = OPACITY;
wdata->style_btn_ina.opa = OPACITY;
} else {
adata->opa = 0;
wdata->style_btn_rel.opa = OPA_COVER;
wdata->style_btn_pr.opa = OPA_COVER;
wdata->style_btn_trel.opa =OPA_COVER;
wdata->style_btn_tpr.opa = OPA_COVER;
wdata->style_btn_ina.opa = OPA_COVER;
}
lv_style_refr_objs(&wdata->style_btn_rel);
lv_style_refr_objs(&wdata->style_btn_pr);
lv_style_refr_objs(&wdata->style_btn_trel);
lv_style_refr_objs(&wdata->style_btn_tpr);
lv_style_refr_objs(&wdata->style_btn_ina);
return LV_ACTION_RES_OK;
}
/*Exceptionally store the data because the big array would be bothering*/
const color_int_t img_bg[] = {
/*HEADER
Width = 40
Height = 40
Transp: 0
Color depth: 24*/
100827176,
/*IMAGE DATA*/
263172, 460551, 460551, 526344, 723723, 1447446, 1644825, 1447446, 1447446, 1052688, 1052688, 921102, 1052688, 723723, 263172, 197379, 131586, 65793, 65793, 0, 65793, 0, 65793, 65793, 65793, 65793, 65793, 328965, 789516, 855309, 1250067, 1052688, 1052688, 1184274, 1184274, 986895, 394758, 394758, 394758, 328965,
131586, 460551, 526344, 394758, 1776411, 2631720, 2105376, 1447446, 1250067, 1052688, 855309, 1052688, 1579032, 1250067, 460551, 65793, 65793, 65793, 65793, 65793, 0, 65793, 65793, 0, 0, 0, 328965, 986895, 1184274, 789516, 921102, 1250067, 1052688, 1052688, 1842204, 1644825, 1052688, 328965, 263172, 328965,
394758, 460551, 526344, 1052688, 2434341, 2434341, 2236962, 1907997, 1052688, 855309, 1052688, 1315860, 1381653, 1447446, 855309, 263172, 0, 0, 131586, 131586, 131586, 131586, 131586, 65793, 0, 263172, 855309, 1052688, 1052688, 1052688, 1118481, 921102, 986895, 1052688, 1579032, 1513239, 1513239, 1118481, 394758, 328965,
263172, 460551, 1447446, 1842204, 2171169, 1973790, 1973790, 1776411, 1052688, 986895, 1184274, 1250067, 921102, 1118481, 1118481, 723723, 263172, 0, 65793, 131586, 197379, 263172, 131586, 131586, 328965, 657930, 921102, 855309, 921102, 1052688, 1052688, 1052688, 855309, 1250067, 1579032, 1250067, 1842204, 1710618, 986895, 263172,
657930, 921102, 1842204, 1776411, 1250067, 1118481, 1052688, 1118481, 1315860, 1381653, 1052688, 855309, 1052688, 855309, 921102, 1184274, 1381653, 394758, 65793, 131586, 131586, 131586, 65793, 526344, 1579032, 1052688, 723723, 789516, 855309, 921102, 1052688, 1184274, 1315860, 1052688, 1315860, 1447446, 1513239, 1710618, 1644825, 855309,
1052688, 1315860, 1710618, 1250067, 1052688, 986895, 921102, 921102, 1052688, 1052688, 1184274, 855309, 855309, 921102, 1052688, 1776411, 2302755, 1644825, 394758, 0, 131586, 131586, 657930, 1776411, 1907997, 1710618, 855309, 723723, 855309, 986895, 1052688, 1052688, 1184274, 1184274, 1052688, 1184274, 1250067, 1513239, 1447446, 1184274,
1184274, 1052688, 986895, 1052688, 921102, 986895, 1184274, 1052688, 921102, 1052688, 1052688, 1052688, 986895, 1118481, 1907997, 1907997, 1973790, 2171169, 1513239, 394758, 65793, 657930, 1973790, 1973790, 1842204, 1776411, 1579032, 855309, 789516, 1052688, 986895, 986895, 986895, 1250067, 1315860, 1118481, 1250067, 1118481, 986895, 1118481,
1250067, 986895, 1052688, 855309, 986895, 1250067, 1184274, 1052688, 1052688, 1052688, 986895, 921102, 1315860, 1973790, 2105376, 1842204, 1842204, 1973790, 2171169, 1579032, 789516, 1710618, 2105376, 1973790, 1776411, 1907997, 1973790, 1710618, 1118481, 855309, 855309, 855309, 921102, 986895, 1315860, 1381653, 986895, 855309, 789516, 986895,
1250067, 855309, 1052688, 657930, 986895, 1118481, 1315860, 1118481, 986895, 986895, 855309, 1381653, 1907997, 2105376, 1842204, 1776411, 1842204, 1907997, 2105376, 2171169, 1776411, 2105376, 2236962, 2105376, 1842204, 1973790, 2171169, 2236962, 1776411, 1052688, 855309, 986895, 921102, 921102, 1118481, 1513239, 921102, 657930, 921102, 855309,
986895, 855309, 657930, 855309, 1052688, 1118481, 1118481, 986895, 855309, 657930, 1052688, 1776411, 1907997, 1907997, 1973790, 1907997, 1907997, 2171169, 1973790, 2236962, 2171169, 1973790, 2105376, 2105376, 1776411, 1973790, 2236962, 2236962, 2302755, 1842204, 1118481, 855309, 1052688, 1052688, 1052688, 1184274, 1118481, 1052688, 921102, 1052688,
1250067, 1250067, 855309, 1052688, 1052688, 986895, 1052688, 855309, 657930, 855309, 1710618, 1907997, 1907997, 2105376, 2171169, 2302755, 2368548, 2105376, 1973790, 1907997, 1842204, 1842204, 1907997, 1907997, 1842204, 1907997, 1973790, 1973790, 2171169, 2302755, 1776411, 855309, 855309, 1052688, 1052688, 986895, 1184274, 1184274, 855309, 1052688,
986895, 1052688, 1315860, 855309, 855309, 855309, 723723, 789516, 1052688, 1710618, 1973790, 1842204, 1973790, 2302755, 2434341, 2434341, 2302755, 1973790, 1842204, 1842204, 1842204, 1973790, 1907997, 2236962, 1907997, 1776411, 1907997, 1907997, 1973790, 2105376, 2236962, 1776411, 1052688, 855309, 855309, 1184274, 1052688, 986895, 1184274, 986895,
328965, 657930, 1052688, 1052688, 855309, 855309, 723723, 921102, 2105376, 2236962, 1907997, 1973790, 1710618, 2368548, 2434341, 2434341, 2368548, 2236962, 1842204, 1710618, 1842204, 1842204, 1907997, 1973790, 1907997, 1842204, 1776411, 1710618, 1776411, 1776411, 2171169, 2368548, 1907997, 855309, 986895, 1052688, 986895, 1118481, 1052688, 723723,
131586, 131586, 855309, 1118481, 1052688, 1118481, 1447446, 1907997, 1842204, 2105376, 1907997, 1776411, 1776411, 2171169, 2500134, 2171169, 2171169, 2236962, 1907997, 1907997, 2105376, 2105376, 2171169, 1973790, 1842204, 1776411, 1842204, 1776411, 1842204, 1842204, 2171169, 2105376, 2434341, 2105376, 1118481, 1052688, 1381653, 1315860, 657930, 328965,
65793, 131586, 263172, 657930, 855309, 1579032, 2236962, 2171169, 1776411, 1776411, 2105376, 1842204, 1776411, 1973790, 2631720, 2434341, 2302755, 2368548, 2105376, 1842204, 1776411, 2236962, 2171169, 1842204, 1842204, 1776411, 1842204, 1842204, 1842204, 2105376, 2105376, 2105376, 2500134, 2631720, 1907997, 1381653, 1052688, 789516, 263172, 197379,
65793, 131586, 131586, 131586, 526344, 1644825, 2105376, 1842204, 1907997, 1776411, 1907997, 2105376, 1842204, 1973790, 2105376, 2368548, 2236962, 2302755, 2368548, 2171169, 1513239, 2105376, 2171169, 1776411, 1644825, 1710618, 1644825, 1842204, 1973790, 1973790, 1842204, 2105376, 2236962, 2236962, 2565927, 2105376, 657930, 131586, 131586, 328965,
65793, 131586, 197379, 131586, 197379, 1315860, 1973790, 1973790, 1907997, 1907997, 1907997, 1842204, 1842204, 1973790, 2171169, 2236962, 2302755, 2434341, 2302755, 855309, 263172, 1184274, 1842204, 1973790, 1842204, 1710618, 1907997, 1842204, 1842204, 1973790, 1973790, 1842204, 2105376, 2302755, 2105376, 1184274, 328965, 197379, 131586, 263172,
65793, 131586, 131586, 65793, 0, 197379, 1250067, 2105376, 1973790, 1907997, 1973790, 1776411, 1842204, 2236962, 2171169, 2105376, 2500134, 2171169, 789516, 131586, 197379, 197379, 1184274, 2171169, 1907997, 1907997, 1842204, 1710618, 1710618, 1842204, 1907997, 1842204, 2171169, 2368548, 1315860, 65793, 263172, 394758, 263172, 197379,
65793, 131586, 131586, 131586, 65793, 0, 263172, 1315860, 1907997, 1907997, 1842204, 1907997, 1973790, 2302755, 2302755, 2236962, 2171169, 855309, 131586, 131586, 263172, 131586, 197379, 1052688, 1973790, 1907997, 1710618, 1710618, 1907997, 1842204, 1907997, 1973790, 1973790, 986895, 131586, 197379, 394758, 394758, 263172, 131586,
65793, 197379, 65793, 131586, 131586, 131586, 65793, 394758, 1579032, 1907997, 1907997, 1907997, 1973790, 2171169, 2565927, 2171169, 1118481, 263172, 131586, 197379, 197379, 131586, 131586, 197379, 1118481, 1776411, 1776411, 1776411, 1842204, 1907997, 1973790, 1973790, 1052688, 131586, 263172, 328965, 394758, 328965, 197379, 197379,
131586, 131586, 131586, 197379, 131586, 131586, 131586, 592137, 1644825, 1973790, 1842204, 1973790, 1973790, 2236962, 2500134, 2368548, 1447446, 263172, 65793, 197379, 197379, 131586, 131586, 394758, 1447446, 1776411, 1776411, 1842204, 1907997, 1973790, 2105376, 2171169, 1513239, 394758, 328965, 460551, 460551, 328965, 197379, 263172,
197379, 197379, 197379, 328965, 197379, 131586, 592137, 1710618, 2368548, 2302755, 1907997, 1907997, 2236962, 2434341, 2368548, 2434341, 2236962, 1052688, 131586, 65793, 197379, 131586, 328965, 1579032, 2302755, 1973790, 1842204, 1842204, 1842204, 1907997, 2105376, 2302755, 2500134, 1907997, 657930, 394758, 394758, 394758, 394758, 328965,
131586, 131586, 131586, 197379, 131586, 526344, 1776411, 2302755, 2434341, 2368548, 2171169, 1842204, 2302755, 2894892, 2302755, 2236962, 2171169, 1907997, 1118481, 197379, 131586, 394758, 1513239, 2236962, 2171169, 2105376, 2105376, 1842204, 1710618, 1842204, 1907997, 1907997, 2368548, 2565927, 1644825, 592137, 197379, 394758, 328965, 328965,
65793, 131586, 131586, 65793, 526344, 1842204, 2302755, 2236962, 2302755, 2302755, 2105376, 2105376, 2434341, 2894892, 2302755, 2105376, 1973790, 2105376, 2105376, 1381653, 592137, 1644825, 2236962, 2302755, 2105376, 1973790, 2171169, 2171169, 2105376, 2105376, 1973790, 1973790, 2171169, 2565927, 2565927, 1973790, 657930, 460551, 460551, 263172,
0, 65793, 65793, 263172, 855309, 1776411, 2434341, 2105376, 2236962, 2105376, 2302755, 2302755, 2368548, 2368548, 2105376, 2105376, 1973790, 2171169, 2302755, 2829099, 2565927, 2302755, 2500134, 2105376, 2105376, 1842204, 2171169, 2368548, 2302755, 2368548, 2171169, 1907997, 2368548, 2500134, 2894892, 1842204, 1579032, 789516, 197379, 263172,
0, 0, 197379, 789516, 1052688, 921102, 1710618, 2302755, 2105376, 2171169, 2302755, 2236962, 2105376, 2105376, 2302755, 2171169, 2171169, 2302755, 2105376, 2434341, 2302755, 2171169, 2302755, 2105376, 2105376, 1973790, 2105376, 2302755, 2302755, 2368548, 2434341, 2368548, 2500134, 3158064, 1973790, 1118481, 1907997, 1315860, 328965, 131586,
65793, 263172, 986895, 1184274, 1052688, 855309, 921102, 1644825, 2368548, 2631720, 2302755, 2236962, 2171169, 2302755, 2565927, 2368548, 2105376, 2105376, 1907997, 1907997, 1973790, 1776411, 2105376, 2171169, 2171169, 2105376, 1907997, 2302755, 2500134, 2434341, 2236962, 2434341, 2829099, 2434341, 1513239, 1184274, 1644825, 1776411, 921102, 394758,
657930, 1052688, 1381653, 1184274, 1052688, 1052688, 855309, 855309, 2105376, 2368548, 2105376, 1973790, 2171169, 2302755, 2565927, 2302755, 2171169, 1907997, 1776411, 1710618, 1776411, 1973790, 1842204, 2105376, 2236962, 2105376, 1907997, 1842204, 1776411, 2236962, 2368548, 2500134, 1973790, 1184274, 1513239, 1710618, 1250067, 1381653, 1776411, 1118481,
855309, 921102, 1118481, 1118481, 1184274, 1052688, 986895, 855309, 855309, 2631720, 2105376, 2105376, 2105376, 1973790, 2236962, 2302755, 2105376, 1907997, 2171169, 1907997, 1710618, 1842204, 1842204, 1842204, 2236962, 1842204, 1842204, 1710618, 1776411, 1842204, 1842204, 1579032, 1118481, 1513239, 1250067, 1579032, 1579032, 1513239, 1644825, 1052688,
986895, 855309, 723723, 1052688, 1052688, 1052688, 1250067, 1052688, 986895, 1052688, 1644825, 1907997, 1973790, 2302755, 2236962, 2236962, 2236962, 2236962, 1973790, 1907997, 1907997, 1710618, 2105376, 2302755, 2105376, 2105376, 2105376, 2105376, 1973790, 1973790, 1315860, 789516, 1118481, 1513239, 1579032, 1381653, 1513239, 1118481, 1052688, 1315860,
855309, 855309, 855309, 855309, 986895, 1184274, 1052688, 1118481, 1052688, 921102, 855309, 1842204, 2368548, 2302755, 2236962, 2105376, 2105376, 2236962, 2171169, 1973790, 1907997, 1842204, 2105376, 2434341, 2236962, 2171169, 2302755, 2434341, 2500134, 1776411, 986895, 855309, 1118481, 1250067, 1513239, 1776411, 1184274, 855309, 1052688, 1118481,
855309, 789516, 1052688, 1052688, 1052688, 1381653, 1250067, 1315860, 1447446, 1052688, 855309, 1052688, 1973790, 2302755, 2105376, 1973790, 2105376, 2171169, 2302755, 2171169, 1710618, 2105376, 2171169, 2171169, 2500134, 2631720, 2105376, 2434341, 1907997, 1052688, 1118481, 1513239, 1579032, 1579032, 1776411, 1776411, 1184274, 789516, 986895, 1184274,
986895, 855309, 789516, 1052688, 1250067, 1644825, 1776411, 1579032, 1184274, 1052688, 1052688, 986895, 1315860, 1776411, 2171169, 2171169, 2105376, 2302755, 2368548, 1315860, 592137, 1710618, 2236962, 2236962, 2171169, 2500134, 2171169, 1710618, 1315860, 1184274, 1644825, 1776411, 1776411, 1776411, 1644825, 1579032, 1184274, 921102, 855309, 1315860,
921102, 1052688, 1052688, 1184274, 1315860, 1250067, 1842204, 1776411, 1250067, 1184274, 1118481, 1052688, 986895, 1052688, 1710618, 2302755, 2302755, 2302755, 1315860, 263172, 65793, 526344, 1644825, 2368548, 2631720, 2434341, 1644825, 1052688, 1315860, 1644825, 1579032, 1710618, 1579032, 1447446, 1052688, 921102, 1315860, 1118481, 1118481, 1315860,
855309, 1184274, 1513239, 1315860, 1052688, 1118481, 1184274, 1513239, 1579032, 1381653, 1118481, 986895, 986895, 986895, 1052688, 1907997, 2302755, 1184274, 263172, 131586, 131586, 131586, 460551, 1973790, 2829099, 2171169, 1052688, 1184274, 1315860, 1381653, 1644825, 1644825, 1842204, 1250067, 986895, 1184274, 1052688, 1250067, 1513239, 1250067,
394758, 657930, 1644825, 1381653, 1315860, 1184274, 1184274, 1184274, 1315860, 1381653, 1052688, 1052688, 1052688, 1184274, 1118481, 1118481, 1052688, 328965, 131586, 197379, 131586, 131586, 197379, 592137, 2105376, 1710618, 1447446, 1184274, 1052688, 1250067, 1447446, 1579032, 1513239, 1513239, 1250067, 1513239, 1579032, 1513239, 1118481, 592137,
197379, 197379, 657930, 1381653, 1513239, 1315860, 1315860, 1250067, 789516, 855309, 1250067, 1250067, 1052688, 1513239, 1315860, 657930, 328965, 328965, 328965, 263172, 263172, 197379, 328965, 526344, 855309, 1513239, 1973790, 1710618, 1315860, 1579032, 1381653, 1184274, 1447446, 2368548, 1907997, 2105376, 2500134, 1644825, 657930, 131586,
197379, 131586, 131586, 657930, 1710618, 1776411, 1447446, 1052688, 855309, 855309, 921102, 1118481, 1579032, 1447446, 855309, 328965, 328965, 394758, 328965, 263172, 131586, 197379, 263172, 460551, 657930, 789516, 1710618, 2236962, 2105376, 1447446, 1250067, 1381653, 1776411, 2368548, 2631720, 3026478, 2236962, 789516, 263172, 131586,
197379, 197379, 131586, 197379, 1381653, 1973790, 1579032, 1184274, 1052688, 921102, 855309, 1052688, 1447446, 1052688, 328965, 131586, 328965, 460551, 460551, 328965, 131586, 263172, 197379, 328965, 460551, 460551, 921102, 2236962, 2105376, 1447446, 1118481, 1250067, 1513239, 2434341, 2302755, 2565927, 1052688, 131586, 131586, 131586,
197379, 131586, 131586, 131586, 328965, 1052688, 1447446, 1644825, 1250067, 1052688, 1184274, 1052688, 855309, 394758, 263172, 197379, 131586, 263172, 328965, 263172, 197379, 131586, 197379, 197379, 263172, 592137, 657930, 921102, 1118481, 1250067, 1118481, 1118481, 1710618, 1973790, 1250067, 855309, 263172, 131586, 197379, 131586,
};
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_BENCHMARK != 0*/

View File

@@ -0,0 +1,47 @@
/**
* @file lv_app_benchmark.h
*
*/
#ifndef LV_APP_BENCHMARK_H
#define LV_APP_BENCHMARK_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lvgl/lv_app/lv_app.h"
#if LV_APP_ENABLE != 0 && USE_LV_APP_BENCHMARK != 0
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
typedef struct
{
}lv_app_benchmark_conf_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
const lv_app_dsc_t * lv_app_benchmark_init(void);
/**********************
* MACROS
**********************/
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_BENCHMARK != 0*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* LV_APP_BENCHMARK_H */

View File

@@ -143,11 +143,9 @@ static void my_com_rec(lv_app_inst_t * app_send, lv_app_inst_t * app_rec,
static void my_sc_open(lv_app_inst_t * app, lv_obj_t * sc)
{
my_sc_data_t * sc_data = app->sc_data;
lv_app_style_t * app_style = lv_app_style_get();
sc_data->label = lv_label_create(sc, NULL);
lv_label_set_text(sc_data->label, "Empty");
lv_obj_set_style(sc_data->label, &app_style->sc_txt_style);
lv_obj_align(sc_data->label, NULL, LV_ALIGN_CENTER, 0, 0);
}
@@ -200,7 +198,7 @@ static void my_win_close(lv_app_inst_t * app)
static lv_action_res_t ta_rel_action(lv_obj_t * ta, lv_dispi_t * dispi)
{
lv_ta_set_text(ta, ""); /*Clear the ta*/
lv_app_kb_open(ta, LV_APP_KB_MODE_TXT, NULL, kb_ok_action);
lv_app_kb_open(ta, LV_APP_KB_MODE_TXT | LV_APP_KB_MODE_WIN_RESIZE, NULL, kb_ok_action);
return LV_ACTION_RES_OK;
}

View File

@@ -6,6 +6,10 @@
#ifndef LV_APP_EXAMPLE_H
#define LV_APP_EXAMPLE_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
@@ -36,4 +40,9 @@ const lv_app_dsc_t * lv_app_example_init(void);
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_EXAMPLE != 0*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* LV_APP_EXAMPLE_H */

View File

@@ -45,7 +45,6 @@ typedef struct
typedef struct
{
lv_obj_t * file_list;
lv_obj_t * send_set_h;
}my_win_data_t;
/*Application specific data for a shortcut of this application*/
@@ -73,6 +72,7 @@ static void my_sc_open(lv_app_inst_t * app, lv_obj_t * sc);
static void my_sc_close(lv_app_inst_t * app);
static void my_win_open(lv_app_inst_t * app, lv_obj_t * win);
static void my_win_close(lv_app_inst_t * app);
static void my_conf_open(lv_app_inst_t * app, lv_obj_t * conf_win);
static void win_load_file_list(lv_app_inst_t * app);
static void win_create_list(lv_app_inst_t * app);
@@ -83,7 +83,6 @@ static lv_action_res_t win_drv_action(lv_obj_t * drv, lv_dispi_t * dispi);
static lv_action_res_t win_folder_action(lv_obj_t * folder, lv_dispi_t * dispi);
static lv_action_res_t win_file_action(lv_obj_t * file, lv_dispi_t * dispi);
static lv_action_res_t win_send_rel_action(lv_obj_t * send, lv_dispi_t * dispi);
static lv_action_res_t win_send_lpr_action(lv_obj_t * send, lv_dispi_t * dispi);
static lv_action_res_t win_send_settings_element_rel_action(lv_obj_t * element, lv_dispi_t * dispi);
static lv_action_res_t win_back_action(lv_obj_t * back, lv_dispi_t * dispi);
static lv_action_res_t win_del_rel_action(lv_obj_t * del, lv_dispi_t * dispi);
@@ -107,12 +106,14 @@ static lv_app_dsc_t my_app_dsc =
.win_close = my_win_close,
.sc_open = my_sc_open,
.sc_close = my_sc_close,
.conf_open = my_conf_open,
.app_data_size = sizeof(my_app_data_t),
.sc_data_size = sizeof(my_sc_data_t),
.win_data_size = sizeof(my_win_data_t),
};
static lv_labels_t sc_labels;
static lv_style_t style_sc_label;
static lv_style_t style_btn_symbol;
/**********************
@@ -130,10 +131,11 @@ static lv_labels_t sc_labels;
const lv_app_dsc_t * lv_app_files_init(void)
{
lv_app_style_t * app_style = lv_app_style_get();
memcpy(&sc_labels, &app_style->sc_txt_style, sizeof(lv_labels_t));
sc_labels.font = LV_APP_FONT_LARGE;
memcpy(&style_sc_label, &app_style->sc_rec_rel, sizeof(lv_style_t));
style_sc_label.font = font_get(LV_APP_FONT_LARGE);
lv_style_get(LV_STYLE_BTN_REL, &style_btn_symbol);
style_btn_symbol.font = font_get(LV_IMG_DEF_SYMBOL_FONT);
return &my_app_dsc;
}
@@ -219,7 +221,7 @@ static void my_sc_open(lv_app_inst_t * app, lv_obj_t * sc)
sc_data->label = lv_label_create(sc, NULL);
lv_obj_set_style(sc_data->label, &sc_labels);
lv_obj_set_style(sc_data->label, &style_sc_label);
lv_label_set_text(sc_data->label, fs_get_last(app_data->path));
lv_obj_align(sc_data->label, NULL, LV_ALIGN_CENTER, 0, 0);
}
@@ -247,7 +249,6 @@ static void my_win_open(lv_app_inst_t * app, lv_obj_t * win)
app_data->file_cnt = 0;
win_data->file_list = NULL;
win_data->send_set_h = NULL;
lv_win_set_title(win, app_data->path);
@@ -263,6 +264,76 @@ static void my_win_close(lv_app_inst_t * app)
}
/**
* Create objects to configure the applications
* @param app pointer to an application which settings should be created
* @param conf_win pointer to a window where the objects can be created
* (the window has the proper layout)
*/
static void my_conf_open(lv_app_inst_t * app, lv_obj_t * conf_win)
{
my_app_data_t * app_data = app->app_data;
/*Create check boxes*/
lv_obj_t * cb;
/*Send file name check box*/
cb = lv_cb_create(conf_win, NULL);
lv_cb_set_text(cb, "Send file name");
lv_obj_set_free_num(cb, SEND_SETTINGS_FN);
lv_obj_set_free_p(cb, app);
lv_btn_set_rel_action(cb, win_send_settings_element_rel_action);
if(app_data->send_fn != 0) lv_btn_set_state(cb, LV_BTN_STATE_TREL);
else lv_btn_set_state(cb, LV_BTN_STATE_REL);
/*Send size check box*/
cb = lv_cb_create(conf_win, cb);
lv_cb_set_text(cb, "Send size");
lv_obj_set_free_num(cb, SEND_SETTINGS_SIZE);
if(app_data->send_size != 0) lv_btn_set_state(cb, LV_BTN_STATE_TREL);
else lv_btn_set_state(cb, LV_BTN_STATE_REL);
/*Send CRC check box*/
cb = lv_cb_create(conf_win, cb);
lv_cb_set_text(cb, "Send CRC");
lv_obj_set_free_num(cb, SEND_SETTINGS_CRC);
if(app_data->send_crc != 0) lv_btn_set_state(cb, LV_BTN_STATE_TREL);
else lv_btn_set_state(cb, LV_BTN_STATE_REL);
/*Create a text area to type chunk size*/
lv_obj_t * val_set_h;
val_set_h = lv_cont_create(conf_win, NULL);
lv_obj_set_style(val_set_h, lv_style_get(LV_STYLE_PLAIN_COLOR, NULL));
lv_obj_set_click(val_set_h, false);
lv_cont_set_fit(val_set_h, true, true);
lv_cont_set_layout(val_set_h, LV_CONT_LAYOUT_ROW_M);
lv_obj_t * label;
label = lv_label_create(val_set_h, NULL);
lv_label_set_text(label, "Chunk size");
lv_obj_t * ta;
char buf[32];
ta = lv_ta_create(val_set_h, NULL);
lv_cont_set_fit(ta, false, true);
lv_obj_set_free_num(ta, SEND_SETTINGS_CHUNK_SIZE);
lv_obj_set_free_p(ta, app);
lv_page_set_rel_action(ta, win_send_settings_element_rel_action);
sprintf(buf, "%d", app_data->chunk_size);
lv_ta_set_text(ta, buf);
/*Create a text area to type the chunk delay*/
val_set_h = lv_cont_create(conf_win, val_set_h);
label = lv_label_create(val_set_h, NULL);
lv_label_set_text(label, "Inter-chunk delay");
ta = lv_ta_create(val_set_h, ta);
lv_obj_set_free_num(ta, SEND_SETTINGS_CHUNK_DELAY);
sprintf(buf, "%d", app_data->chunk_delay);
lv_ta_set_text(ta, buf);
}
/*--------------------
* OTHER FUNCTIONS
---------------------*/
@@ -272,7 +343,6 @@ static void my_win_close(lv_app_inst_t * app)
*/
static void win_create_list(lv_app_inst_t * app)
{
lv_app_style_t * app_style = lv_app_style_get();
my_win_data_t * win_data = app->win_data;
/*Delete the previous list*/
@@ -282,12 +352,13 @@ static void win_create_list(lv_app_inst_t * app)
/*Create a new list*/
win_data->file_list = lv_list_create(app->win, NULL);
lv_obj_set_width(win_data->file_list, app_style->win_useful_w);
lv_obj_set_style(win_data->file_list, lv_lists_get(LV_LISTS_TRANSP, NULL));
lv_obj_set_width(win_data->file_list, lv_win_get_width(app->win));
lv_list_set_style_img(win_data->file_list, &style_btn_symbol);
lv_obj_set_style(lv_page_get_scrl(win_data->file_list), lv_style_get(LV_STYLE_TRANSP_TIGHT, NULL));
lv_obj_set_drag_parent(win_data->file_list, true);
lv_obj_set_drag_parent(lv_page_get_scrl(win_data->file_list), true);
lv_rect_set_fit(win_data->file_list, false, true);
lv_rect_set_layout(lv_page_get_scrl(win_data->file_list), LV_RECT_LAYOUT_COL_L);
lv_cont_set_fit(win_data->file_list, false, true);
lv_cont_set_layout(lv_page_get_scrl(win_data->file_list), LV_CONT_LAYOUT_COL_L);
}
/**
@@ -314,13 +385,13 @@ static void win_load_file_list(lv_app_inst_t * app)
for(i = 0; drv[i] != '\0'; i++) {
buf[0] = drv[i];
buf[1] = '\0';
liste = lv_list_add(win_data->file_list, "U:/icon_driver", buf, win_drv_action);
liste = lv_list_add(win_data->file_list, SYMBOL_DRIVE, buf, win_drv_action);
lv_obj_set_free_p(liste, app);
}
}
/*List the files/folders with fs interface*/
else {
liste = lv_list_add(win_data->file_list, "U:/icon_up", "Up", win_up_action);
liste = lv_list_add(win_data->file_list, SYMBOL_UP, "Up", win_up_action);
lv_obj_set_free_p(liste, app);
fs_readdir_t rd;
@@ -332,7 +403,7 @@ static void win_load_file_list(lv_app_inst_t * app)
/*At not first page add prev. page button */
if(app_data->file_cnt != 0) {
liste = lv_list_add(win_data->file_list, "U:/icon_left", "Previous page", win_prev_action);
liste = lv_list_add(win_data->file_list, SYMBOL_LEFT, "Previous page", win_prev_action);
lv_obj_set_free_p(liste, app);
}
@@ -342,7 +413,7 @@ static void win_load_file_list(lv_app_inst_t * app)
uint16_t file_cnt = 0;
while(file_cnt <= app_data->file_cnt) {
res = fs_readdir(&rd, fn);
if(res != FS_RES_OK || fn[0] == '\0'){
if(res != FS_RES_OK ){
lv_app_notice_add("Can not read\nthe path in Files");
return;
}
@@ -353,13 +424,13 @@ static void win_load_file_list(lv_app_inst_t * app)
while(res == FS_RES_OK && fn[0] != '\0') {
if(fn[0] == '/') { /*Add a folder*/
lv_obj_t * liste;
liste = lv_list_add(win_data->file_list, "U:/icon_folder", &fn[1], win_folder_action);
liste = lv_list_add(win_data->file_list, SYMBOL_FOLDER, &fn[1], win_folder_action);
lv_obj_set_free_p(liste, app);
app_data->file_cnt ++;
}
/*Add a file*/
else {
liste = lv_list_add(win_data->file_list, "U:/icon_file", fn, win_file_action);
liste = lv_list_add(win_data->file_list, SYMBOL_FILE, fn, win_file_action);
lv_obj_set_free_p(liste, app);
app_data->file_cnt ++;
}
@@ -369,7 +440,7 @@ static void win_load_file_list(lv_app_inst_t * app)
/*Show only LV_APP_FSEL_MAX_FILE elements and add a Next page button*/
if(app_data->file_cnt != 0 && app_data->file_cnt % LV_APP_FILES_PAGE_SIZE == 0) {
liste = lv_list_add(win_data->file_list, "U:/icon_right", "Next page", win_next_action);
liste = lv_list_add(win_data->file_list, SYMBOL_RIGHT, "Next page", win_next_action);
lv_obj_set_free_p(liste, app);
break;
}
@@ -458,7 +529,7 @@ static lv_action_res_t win_drv_action(lv_obj_t * drv, lv_dispi_t * dispi)
{
lv_app_inst_t * app = lv_obj_get_free_p(drv);
my_app_data_t * app_data = app->app_data;
sprintf(app_data->path, "%s:", lv_list_element_get_txt(drv));
sprintf(app_data->path, "%s:", lv_list_get_element_text(drv));
app_data->file_cnt = 0;
lv_win_set_title(app->win, app_data->path);
my_sc_data_t * sc_data = app->sc_data;
@@ -482,7 +553,7 @@ static lv_action_res_t win_folder_action(lv_obj_t * folder, lv_dispi_t * dispi)
{
lv_app_inst_t * app = lv_obj_get_free_p(folder);
my_app_data_t * app_data = app->app_data;
sprintf(app_data->path, "%s/%s", app_data->path, lv_list_element_get_txt(folder));
sprintf(app_data->path, "%s/%s", app_data->path, lv_list_get_element_text(folder));
app_data->file_cnt = 0;
lv_win_set_title(app->win, app_data->path);
@@ -510,7 +581,7 @@ static lv_action_res_t win_file_action(lv_obj_t * file, lv_dispi_t * dispi)
my_app_data_t * app_data = app->app_data;
my_win_data_t * win_data = app->win_data;
sprintf(app_data->fn, "%s", lv_list_element_get_txt(file));
sprintf(app_data->fn, "%s", lv_list_get_element_text(file));
win_create_list(app);
@@ -522,8 +593,6 @@ static lv_action_res_t win_file_action(lv_obj_t * file, lv_dispi_t * dispi)
/*Send button*/
liste = lv_list_add(win_data->file_list, NULL, "Send", win_send_rel_action);
lv_obj_set_free_p(liste, app);
lv_btn_set_lpr_action(liste, win_send_lpr_action);
lv_obj_set_free_p(liste, app);
/*Delete button*/
liste = lv_list_add(win_data->file_list, NULL, "Delete", win_del_rel_action);
@@ -573,100 +642,6 @@ static lv_action_res_t win_send_rel_action(lv_obj_t * send, lv_dispi_t * dispi)
return LV_ACTION_RES_OK;
}
/**
* Called when the Send list element is long pressed to show/hide send settings
* @param send pointer to the Up button
* @param dispi pointer to the caller display input
* @return LV_ACTION_RES_OK because the list is NOT deleted in the function
*/
static lv_action_res_t win_send_lpr_action(lv_obj_t * send, lv_dispi_t * dispi)
{
lv_app_inst_t * app = lv_obj_get_free_p(send);
my_app_data_t * app_data = app->app_data;
my_win_data_t * win_data = app->win_data;
/*Close the settings if it is opened*/
if(win_data->send_set_h != NULL) {
lv_obj_del(win_data->send_set_h);
win_data->send_set_h = NULL;
lv_dispi_wait_release(dispi);
lv_btn_set_state(send, LV_BTN_STATE_REL);
return LV_ACTION_RES_OK;
}
/*Create the settings*/
lv_btn_set_state(send, LV_BTN_STATE_REL);
lv_rect_set_layout(send, LV_RECT_LAYOUT_COL_L);
/*Create holder for the settings*/
win_data->send_set_h = lv_rect_create(send, NULL);
lv_obj_set_style(win_data->send_set_h, lv_rects_get(LV_RECTS_TRANSP, NULL));
lv_obj_set_click(win_data->send_set_h, false);
lv_rect_set_fit(win_data->send_set_h, true, true);
lv_rect_set_layout(win_data->send_set_h, LV_RECT_LAYOUT_COL_L);
/*Create check boxes*/
lv_obj_t * cb;
/*Send file name check box*/
cb = lv_cb_create(win_data->send_set_h, NULL);
lv_cb_set_text(cb, "Send file name");
lv_obj_set_free_num(cb, SEND_SETTINGS_FN);
lv_obj_set_free_p(cb, app);
lv_btn_set_rel_action(cb, win_send_settings_element_rel_action);
if(app_data->send_fn != 0) lv_btn_set_state(cb, LV_BTN_STATE_TGL_REL);
else lv_btn_set_state(cb, LV_BTN_STATE_REL);
/*Send size check box*/
cb = lv_cb_create(win_data->send_set_h, cb);
lv_cb_set_text(cb, "Send size");
lv_obj_set_free_num(cb, SEND_SETTINGS_SIZE);
if(app_data->send_size != 0) lv_btn_set_state(cb, LV_BTN_STATE_TGL_REL);
else lv_btn_set_state(cb, LV_BTN_STATE_REL);
/*Send CRC check box*/
cb = lv_cb_create(win_data->send_set_h, cb);
lv_cb_set_text(cb, "Send CRC");
lv_obj_set_free_num(cb, SEND_SETTINGS_CRC);
if(app_data->send_crc != 0) lv_btn_set_state(cb, LV_BTN_STATE_TGL_REL);
else lv_btn_set_state(cb, LV_BTN_STATE_REL);
/*Create a text area the type chunk size*/
lv_obj_t * val_set_h;
val_set_h = lv_rect_create(win_data->send_set_h, NULL);
lv_obj_set_style(val_set_h, lv_rects_get(LV_RECTS_TRANSP, NULL));
lv_obj_set_click(val_set_h, false);
lv_rect_set_fit(val_set_h, true, true);
lv_rect_set_layout(val_set_h, LV_RECT_LAYOUT_ROW_M);
lv_obj_t * label;
label = lv_label_create(val_set_h, NULL);
lv_label_set_text(label, "Chunk size");
lv_obj_t * ta;
char buf[32];
ta = lv_ta_create(val_set_h, NULL);
lv_obj_set_style(ta, lv_tas_get(LV_TAS_SIMPLE, NULL));
lv_rect_set_fit(ta, false, true);
lv_obj_set_free_num(ta, SEND_SETTINGS_CHUNK_SIZE);
lv_obj_set_free_p(ta, app);
lv_page_set_rel_action(ta, win_send_settings_element_rel_action);
sprintf(buf, "%d", app_data->chunk_size);
lv_ta_set_text(ta, buf);
/*Create a text area to type the chunk delay*/
val_set_h = lv_rect_create(win_data->send_set_h, val_set_h);
label = lv_label_create(val_set_h, NULL);
lv_label_set_text(label, "Inter-chunk delay");
ta = lv_ta_create(val_set_h, ta);
lv_obj_set_free_num(ta, SEND_SETTINGS_CHUNK_DELAY);
sprintf(buf, "%d", app_data->chunk_delay);
lv_ta_set_text(ta, buf);
return LV_ACTION_RES_OK;
}
/**
* Called when a send settings element is released
* @param element pointer to a chekbox or text area
@@ -691,9 +666,9 @@ static lv_action_res_t win_send_settings_element_rel_action(lv_obj_t * element,
lv_app_notice_add("CRC sending is\nnot supported yet");
}
} else if(id == SEND_SETTINGS_CHUNK_SIZE) {
lv_app_kb_open(element, LV_APP_KB_MODE_NUM, send_settings_kb_close_action, send_settings_kb_ok_action);
lv_app_kb_open(element, LV_APP_KB_MODE_NUM | LV_APP_KB_MODE_WIN_RESIZE, send_settings_kb_close_action, send_settings_kb_ok_action);
} else if(id == SEND_SETTINGS_CHUNK_DELAY) {
lv_app_kb_open(element, LV_APP_KB_MODE_NUM, send_settings_kb_close_action, send_settings_kb_ok_action);
lv_app_kb_open(element, LV_APP_KB_MODE_NUM | LV_APP_KB_MODE_WIN_RESIZE, send_settings_kb_close_action, send_settings_kb_ok_action);
}
return LV_ACTION_RES_OK;
@@ -795,41 +770,33 @@ static void start_send(lv_app_inst_t * app, const char * path)
/*Open the file*/
fs_res_t res = fs_open(&app_data->file, path, FS_MODE_RD);
if(res == FS_RES_OK) {
uint32_t rn;
char rd_buf[LV_APP_FILES_CHUNK_MAX_SIZE];
/*Read the first chunk*/
res = fs_read(&app_data->file, rd_buf, app_data->chunk_size, &rn);
if(res == FS_RES_OK) {
app_data->send_in_prog = 1;
/*Send the header*/
if(app_data->send_fn != 0) {
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, app_data->path, strlen(app_data->path));
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, "/", 1);
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, app_data->fn, strlen(app_data->fn));
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, "\n", 1);
}
if(app_data->send_size != 0) {
char buf[64];
uint32_t size;
fs_size(&app_data->file, &size);
sprintf(buf,"%d", (int) size);
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, buf, strlen(buf));
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, "\n", 1);
}
if(app_data->send_crc != 0) {
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, "0x0000", 6);
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, "\n", 1);
}
/*Add an extra \n to separate the header from the file data*/
if(app_data->send_fn != 0 || app_data->send_size != 0 || app_data->send_crc != 0) {
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, "\n", 1);
}
app_data->send_in_prog = 1;
/*Send the header*/
if(app_data->send_fn != 0) {
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, app_data->path, strlen(app_data->path));
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, "/", 1);
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, app_data->fn, strlen(app_data->fn));
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, "\n", 1);
}
if(app_data->send_size != 0) {
char buf[64];
uint32_t size;
fs_size(&app_data->file, &size);
sprintf(buf,"%d", (int) size);
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, buf, strlen(buf));
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, "\n", 1);
}
if(app_data->send_crc != 0) {
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, "0x0000", 6);
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, "\n", 1);
}
/*Add an extra \n to separate the header from the file data*/
if(app_data->send_fn != 0 || app_data->send_size != 0 || app_data->send_crc != 0) {
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, "\n", 1);
}
}
/*If an error occurred close the file*/

View File

@@ -6,6 +6,10 @@
#ifndef LV_APP_FILES_H
#define LV_APP_FILES_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
@@ -36,4 +40,8 @@ const lv_app_dsc_t * lv_app_files_init(void);
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_FILES != 0*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* LV_APP_EXAMPLE_H */

381
lv_appx/lv_app_gsm.c Normal file
View File

@@ -0,0 +1,381 @@
/**
* @file lv_app_gsm.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_app_gsm.h"
#if LV_APP_ENABLE != 0 && USE_LV_APP_GSM != 0
#include "../lv_app/lv_app_util/lv_app_kb.h"
#include "hal/gsm/gsm.h"
#include "misc/os/ptask.h"
#include "hal/systick/systick.h"
#include "misc/comm/gsmmng.h"
#include <stdio.h>
/*********************
* DEFINES
*********************/
#define GSM_MONITOR_PERIOD 1000 /*ms*/
/**********************
* TYPEDEFS
**********************/
/*Application specific data for an instance of this application*/
typedef struct
{
char set_apn[128];
char set_ip[32];
char set_port[16];
}my_app_data_t;
/*Application specific data a window of this application*/
typedef struct
{
lv_obj_t * title;
lv_obj_t * netw_apn_ta;
lv_obj_t * tcp_ip_ta;
lv_obj_t * tcp_port_ta;
}my_win_data_t;
/*Application specific data for a shortcut of this application*/
typedef struct
{
lv_obj_t * label;
}my_sc_data_t;
/**********************
* STATIC PROTOTYPES
**********************/
static void my_app_run(lv_app_inst_t * app, void * conf);
static void my_app_close(lv_app_inst_t * app);
static void my_com_rec(lv_app_inst_t * app_send, lv_app_inst_t * app_rec, lv_app_com_type_t type , const void * data, uint32_t size);
static void my_sc_open(lv_app_inst_t * app, lv_obj_t * sc);
static void my_sc_close(lv_app_inst_t * app);
static void my_win_open(lv_app_inst_t * app, lv_obj_t * win);
static void my_win_close(lv_app_inst_t * app);
static void gsm_state_monitor_task(void * param);
static lv_action_res_t netw_con_rel_action(lv_obj_t * btn, lv_dispi_t * dispi);
static lv_action_res_t netw_apn_rel_action( lv_obj_t * ta, lv_dispi_t * dispi);
static lv_action_res_t tcp_ip_rel_action( lv_obj_t * ta, lv_dispi_t * dispi);
static lv_action_res_t tcp_port_rel_action( lv_obj_t * ta, lv_dispi_t * dispi);
static void netw_apn_kb_ok(lv_obj_t * ta);
static void netw_apn_kb_close(lv_obj_t * ta);
static void tcp_ip_kb_ok(lv_obj_t * ta);
static void tcp_ip_kb_close(lv_obj_t * ta);
static void tcp_port_kb_ok(lv_obj_t * ta);
static void tcp_port_kb_close(lv_obj_t * ta);
static void tcp_transf_cb(gsm_state_t state, const char * txt);
static void win_title_refr(void);
/**********************
* STATIC VARIABLES
**********************/
static lv_app_dsc_t my_app_dsc =
{
.name = "GSM",
.mode = LV_APP_MODE_NONE,
.app_run = my_app_run,
.app_close = my_app_close,
.com_rec = my_com_rec,
.win_open = my_win_open,
.win_close = my_win_close,
.sc_open = my_sc_open,
.sc_close = my_sc_close,
.app_data_size = sizeof(my_app_data_t),
.sc_data_size = sizeof(my_sc_data_t),
.win_data_size = sizeof(my_win_data_t),
};
static lv_app_inst_t * app_act_com;
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/**
* Initialize the application
* @return pointer to the application descriptor of this application
*/
const lv_app_dsc_t * lv_app_gsm_init(void)
{
gsmmng_set_last_apn(LV_APP_GSM_APN_DEF);
gsmmng_set_last_tcp(LV_APP_GSM_IP_DEF, LV_APP_GSM_PORT_DEF);
ptask_create(gsm_state_monitor_task, GSM_MONITOR_PERIOD, PTASK_PRIO_LOW, NULL);
return &my_app_dsc;
}
/**********************
* STATIC FUNCTIONS
**********************/
/**
* Run an application according to 'app_dsc'
* @param app_dsc pointer to an application descriptor
* @param conf pointer to a lv_app_example_conf_t structure with configuration data or NULL if unused
* @return pointer to the opened application or NULL if any error occurred
*/
static void my_app_run(lv_app_inst_t * app, void * conf)
{
/*Initialize the application*/
my_app_data_t * adata = app->app_data;
strcpy(adata->set_apn, LV_APP_GSM_APN_DEF);
strcpy(adata->set_ip, LV_APP_GSM_IP_DEF);
strcpy(adata->set_port, LV_APP_GSM_PORT_DEF);
}
/**
* Close a running application.
* Close the Window and the Shortcut too if opened.
* Free all the allocated memory by this application.
* @param app pointer to an application
*/
static void my_app_close(lv_app_inst_t * app)
{
/*No dynamically allocated data in 'my_app_data'*/
}
/**
* Read the data have been sent to this application
* @param app_send pointer to an application which sent the message
* @param app_rec pointer to an application which is receiving the message
* @param type type of data from 'lv_app_com_type_t' enum
* @param data pointer to the sent data
* @param size length of 'data' in bytes
*/
static void my_com_rec(lv_app_inst_t * app_send, lv_app_inst_t * app_rec,
lv_app_com_type_t type , const void * data, uint32_t size)
{
if(type == LV_APP_COM_TYPE_CHAR) { /*data: string*/
app_act_com = app_rec;
gsm_tcp_transf(data, size, tcp_transf_cb);
}
}
/**
* Open a shortcut for an application
* @param app pointer to an application
* @param sc pointer to an object where the application
* can create content of the shortcut
*/
static void my_sc_open(lv_app_inst_t * app, lv_obj_t * sc)
{
my_sc_data_t * sc_data = app->sc_data;
sc_data->label = lv_label_create(sc, NULL);
lv_label_set_text(sc_data->label, "Empty");
lv_obj_align(sc_data->label, NULL, LV_ALIGN_CENTER, 0, 0);
}
/**
* Close the shortcut of an application
* @param app pointer to an application
*/
static void my_sc_close(lv_app_inst_t * app)
{
/*No dynamically allocated data in 'my_sc_data'*/
}
/**
* Open the application in a window
* @param app pointer to an application
* @param win pointer to a window object where
* the application can create content
*/
static void my_win_open(lv_app_inst_t * app, lv_obj_t * win)
{
my_app_data_t * adata = app->app_data;
my_win_data_t * wdata = app->win_data;
wdata->title = lv_label_create(win, NULL);
lv_obj_t * ta_cont = lv_cont_create(win, NULL);
lv_cont_set_fit(ta_cont, true, true);
lv_cont_set_layout(ta_cont, LV_CONT_LAYOUT_COL_L);
lv_obj_set_style(ta_cont, lv_style_get(LV_STYLE_TRANSP_TIGHT, NULL));
wdata->netw_apn_ta = lv_ta_create(ta_cont, NULL);
lv_cont_set_fit(wdata->netw_apn_ta, false, true);
lv_obj_set_free_p(wdata->netw_apn_ta, app);
lv_obj_set_width(wdata->netw_apn_ta, LV_DPI * 3);
lv_page_set_rel_action(wdata->netw_apn_ta, netw_apn_rel_action);
lv_ta_set_text(wdata->netw_apn_ta, adata->set_apn);
lv_ta_set_cursor_show(wdata->netw_apn_ta, false);
wdata->tcp_ip_ta = lv_ta_create(ta_cont, wdata->netw_apn_ta);
lv_page_set_rel_action(wdata->tcp_ip_ta, tcp_ip_rel_action);
lv_ta_set_text(wdata->tcp_ip_ta, adata->set_ip);
wdata->tcp_port_ta = lv_ta_create(ta_cont, wdata->netw_apn_ta);
lv_page_set_rel_action(wdata->tcp_port_ta, tcp_port_rel_action);
lv_ta_set_text(wdata->tcp_port_ta, adata->set_port);
lv_obj_t * con_btn = lv_btn_create(win, NULL);
lv_obj_set_free_p(con_btn, app);
lv_btn_set_rel_action(con_btn, netw_con_rel_action);
lv_obj_t * label = lv_label_create(con_btn, NULL);
lv_label_set_text(label, "Connect");
lv_cont_set_layout(lv_page_get_scrl(lv_win_get_page(win)), LV_CONT_LAYOUT_PRETTY);
win_title_refr();
}
/**
* Close the window of an application
* @param app pointer to an application
*/
static void my_win_close(lv_app_inst_t * app)
{
}
/*--------------------
* OTHER FUNCTIONS
---------------------*/
static void gsm_state_monitor_task(void * param)
{
static gsmmng_state_t state_prev = GSMMNG_STATE_WAIT;
gsmmng_state_t state_act = gsmmng_get_state();
if(state_prev != state_act && state_act == GSMMNG_STATE_READY) {
lv_app_notice_add("GSM connected to:\n%s\n%s:%s",
gsmmng_get_last_apn(), gsmmng_get_last_ip(), gsmmng_get_last_port());
win_title_refr();
}
state_prev = state_act;
}
static lv_action_res_t netw_con_rel_action(lv_obj_t * btn, lv_dispi_t* dispi)
{
lv_app_inst_t * app = lv_obj_get_free_p(btn);
my_app_data_t * adata = app->app_data;
gsmmng_set_last_apn(adata->set_apn);
gsmmng_set_last_tcp(adata->set_ip, adata->set_port);
gsmmng_reconnect();
lv_app_notice_add("Connecting to GSM network\n%s, %s:%s",
adata->set_apn, adata->set_ip, adata->set_port);
return LV_ACTION_RES_OK;
}
static lv_action_res_t netw_apn_rel_action( lv_obj_t * ta, lv_dispi_t* dispi)
{
lv_app_kb_open(ta, LV_APP_KB_MODE_TXT | LV_APP_KB_MODE_WIN_RESIZE | LV_APP_KB_MODE_CUR_MANAGE, netw_apn_kb_close ,netw_apn_kb_ok);
return LV_ACTION_RES_OK;
}
static lv_action_res_t tcp_ip_rel_action( lv_obj_t * ta, lv_dispi_t* dispi)
{
lv_app_kb_open(ta, LV_APP_KB_MODE_TXT | LV_APP_KB_MODE_WIN_RESIZE | LV_APP_KB_MODE_CUR_MANAGE, tcp_ip_kb_close ,tcp_ip_kb_ok);
return LV_ACTION_RES_OK;
}
static lv_action_res_t tcp_port_rel_action( lv_obj_t * ta, lv_dispi_t* dispi)
{
lv_app_kb_open(ta, LV_APP_KB_MODE_NUM | LV_APP_KB_MODE_WIN_RESIZE | LV_APP_KB_MODE_CUR_MANAGE, tcp_port_kb_close ,tcp_port_kb_ok);
return LV_ACTION_RES_OK;
}
static void netw_apn_kb_ok(lv_obj_t * ta)
{
lv_app_inst_t * app = lv_obj_get_free_p(ta);
my_app_data_t * adata = app->app_data;
strcpy(adata->set_apn, lv_ta_get_txt(ta));
}
static void netw_apn_kb_close(lv_obj_t * ta)
{
lv_app_inst_t * app = lv_obj_get_free_p(ta);
my_app_data_t * adata = app->app_data;
lv_ta_set_text(ta, adata->set_apn);
}
static void tcp_ip_kb_ok(lv_obj_t * ta)
{
lv_app_inst_t * app = lv_obj_get_free_p(ta);
my_app_data_t * adata = app->app_data;
strcpy(adata->set_ip, lv_ta_get_txt(ta));
}
static void tcp_ip_kb_close(lv_obj_t * ta)
{
lv_app_inst_t * app = lv_obj_get_free_p(ta);
my_app_data_t * adata = app->app_data;
lv_ta_set_text(ta, adata->set_ip);
}
static void tcp_port_kb_ok(lv_obj_t * ta)
{
lv_app_inst_t * app = lv_obj_get_free_p(ta);
my_app_data_t * adata = app->app_data;
strcpy(adata->set_port, lv_ta_get_txt(ta));
}
static void tcp_port_kb_close(lv_obj_t * ta)
{
lv_app_inst_t * app = lv_obj_get_free_p(ta);
my_app_data_t * adata = app->app_data;
lv_ta_set_text(ta, adata->set_port);
}
static void tcp_transf_cb(gsm_state_t state, const char * txt)
{
if(state == GSM_STATE_OK) {
uint16_t size = txt[0] + ((txt[1] << 8) & 0xFF00);
char buf[256];
memcpy(buf, &txt[2], size);
buf[size] = '\0';
lv_app_com_send(app_act_com, LV_APP_COM_TYPE_CHAR, &txt[2], size);
}else if(state == GSM_STATE_ERROR) {
lv_app_notice_add("WiFi TCP transfer error\n%s", txt);
lv_app_notice_add("Reconnecting to WiFi...");
gsmmng_reconnect();
}
app_act_com = NULL;
}
static void win_title_refr(void)
{
lv_app_inst_t * app;
app = lv_app_get_next(NULL, &my_app_dsc);
while(app != NULL) {
if(app->win != NULL) {
my_win_data_t * wdata = app->win_data;
if(gsmmng_get_state() != GSMMNG_STATE_READY) lv_label_set_text(wdata->title, "Not connected");
else {
char buf[256];
sprintf(buf, "%s - %s:%s", gsmmng_get_last_apn(), gsmmng_get_last_ip(), gsmmng_get_last_port());
lv_label_set_text(wdata->title, buf);
}
lv_obj_set_width(wdata->title, lv_win_get_width(app->win));
}
app = lv_app_get_next(app, &my_app_dsc);
}
}
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_EXAMPLE != 0*/

47
lv_appx/lv_app_gsm.h Normal file
View File

@@ -0,0 +1,47 @@
/**
* @file lv_app_gsm.h
*
*/
#ifndef LV_APP_GSM_H
#define LV_APP_GSM_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lvgl/lv_app/lv_app.h"
#if LV_APP_ENABLE != 0 && USE_LV_APP_GSM != 0
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
typedef struct
{
}lv_app_gsm_conf_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
const lv_app_dsc_t * lv_app_gsm_init(void);
/**********************
* MACROS
**********************/
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_EXAMPLE != 0*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* LV_APP_EXAMPLE_H */

143
lv_appx/lv_app_phantom.c Normal file
View File

@@ -0,0 +1,143 @@
/**
* @file lv_app_example.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_app_phantom.h"
#if LV_APP_ENABLE != 0 && USE_LV_APP_PHANTOM != 0
#include "../lv_app/lv_app_util/lv_app_kb.h"
#include <stdio.h>
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/*Application specific data for an instance of this application*/
typedef struct
{
void (*com_listen)(lv_app_inst_t * app_send, lv_app_inst_t * app_rec,
lv_app_com_type_t type , const void * data, uint32_t size);
}my_app_data_t;
/*Application specific data a window of this application*/
typedef struct
{
}my_win_data_t;
/*Application specific data for a shortcut of this application*/
typedef struct
{
lv_obj_t * label;
}my_sc_data_t;
/**********************
* STATIC PROTOTYPES
**********************/
static void my_app_run(lv_app_inst_t * app, void * conf);
static void my_app_close(lv_app_inst_t * app);
static void my_com_rec(lv_app_inst_t * app_send, lv_app_inst_t * app_rec,
lv_app_com_type_t type , const void * data, uint32_t size);
/**********************
* STATIC VARIABLES
**********************/
static lv_app_dsc_t my_app_dsc =
{
.name = "Phantom",
.mode = LV_APP_MODE_NONE,
.app_run = my_app_run,
.app_close = my_app_close,
.com_rec = my_com_rec,
.win_open = NULL,
.win_close = NULL,
.sc_open = NULL,
.sc_close = NULL,
.app_data_size = sizeof(my_app_data_t),
.sc_data_size = sizeof(my_sc_data_t),
.win_data_size = sizeof(my_win_data_t),
};
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/**
* Initialize the application
* @return pointer to the application descriptor of this application
*/
const lv_app_dsc_t * lv_app_phantom_init(void)
{
return &my_app_dsc;
}
/**********************
* STATIC FUNCTIONS
**********************/
/**
* Run an application according to 'app_dsc'
* @param app_dsc pointer to an application descriptor
* @param conf pointer to a lv_app_phantom_conf_t structure with configuration data or NULL if unused
* @return pointer to the opened application or NULL if any error occurred
*/
static void my_app_run(lv_app_inst_t * app, void * conf)
{
/*Initialize the application*/
my_app_data_t * app_data = app->app_data;
app_data->com_listen = NULL;
if(conf != NULL) {
lv_app_phantom_conf_t * my_conf = conf;
app_data->com_listen = my_conf->com_listen;
}
}
/**
* Close a running application.
* Close the Window and the Shortcut too if opened.
* Free all the allocated memory by this application.
* @param app pointer to an application
*/
static void my_app_close(lv_app_inst_t * app)
{
/*No dynamically allocated data in 'my_app_data'*/
}
/**
* Read the data have been sent to this application
* @param app_send pointer to an application which sent the message
* @param app_rec pointer to an application which is receiving the message
* @param type type of data from 'lv_app_com_type_t' enum
* @param data pointer to the sent data
* @param size length of 'data' in bytes
*/
static void my_com_rec(lv_app_inst_t * app_send, lv_app_inst_t * app_rec,
lv_app_com_type_t type , const void * data, uint32_t size)
{
my_app_data_t * app_data = app_rec->app_data;
if(app_data->com_listen != NULL) {
app_data->com_listen(app_send, app_rec, type, data, size);
}
}
/*--------------------
* OTHER FUNCTIONS
---------------------*/
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_EXAMPLE != 0*/

50
lv_appx/lv_app_phantom.h Normal file
View File

@@ -0,0 +1,50 @@
/**
* @file lv_app_phantom.h
*
*/
#ifndef LV_APP_PHANTOM_H
#define LV_APP_PHANTOM_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lvgl/lv_app/lv_app.h"
#if LV_APP_ENABLE != 0 && USE_LV_APP_PHANTOM != 0
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
typedef struct
{
void (*com_listen)(lv_app_inst_t * app_send,
lv_app_inst_t * app_rec,
lv_app_com_type_t type ,
const void * data, uint32_t size);
}lv_app_phantom_conf_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
const lv_app_dsc_t * lv_app_phantom_init(void);
/**********************
* MACROS
**********************/
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_PHANTOM != 0*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* LV_APP_PHANTOM_H */

View File

@@ -19,6 +19,8 @@
/*********************
* DEFINES
*********************/
#define CPU_LABEL_COLOR "FF0000"
#define MEM_LABEL_COLOR "0000FF"
/**********************
* TYPEDEFS
@@ -34,16 +36,16 @@ typedef struct
typedef struct
{
lv_obj_t * chart;
cord_t * cpu_dl;
cord_t * mem_dl;
lv_chart_dl_t * cpu_dl;
lv_chart_dl_t * mem_dl;
lv_obj_t * label;
}my_win_data_t;
/*Application specific data for a shortcut of this application*/
typedef struct
{
lv_obj_t * pb_cpu;
lv_obj_t * pb_mem;
lv_obj_t * bar_cpu;
lv_obj_t * bar_mem;
}my_sc_data_t;
/**********************
@@ -81,8 +83,10 @@ static lv_app_dsc_t my_app_dsc =
static uint8_t mem_pct[LV_APP_SYSMON_PNUM];
static uint8_t cpu_pct[LV_APP_SYSMON_PNUM];
static lv_pbs_t cpu_pbs;
static lv_pbs_t mem_pbs;
static lv_style_t cpu_bar_bg;
static lv_style_t mem_bar_bg;
static lv_style_t cpu_bar_indic;
static lv_style_t mem_bar_indic;
#if USE_DYN_MEM != 0 && DM_CUSTOM == 0
static dm_mon_t mem_mon;
#endif
@@ -106,31 +110,31 @@ const lv_app_dsc_t * lv_app_sysmon_init(void)
memset(mem_pct, 0, sizeof(mem_pct));
memset(cpu_pct, 0, sizeof(cpu_pct));
/*Create progress bar styles for the shortcut*/
lv_pbs_get(LV_PBS_DEF, &cpu_pbs);
cpu_pbs.bg.gcolor = COLOR_MAKE(0xFF, 0xE0, 0xE0);
cpu_pbs.bg.objs.color = COLOR_MAKE(0xFF, 0xD0, 0xD0);
cpu_pbs.bg.bcolor = COLOR_MAKE(0xFF, 0x20, 0x20);
cpu_pbs.bg.bwidth = 1 * LV_DOWNSCALE;
/*Create bar styles for the shortcut*/
lv_style_get(LV_STYLE_PRETTY, &cpu_bar_bg);
cpu_bar_bg.ccolor = COLOR_MAKE(0x40, 0x00, 0x00);
cpu_bar_bg.font = font_get(LV_APP_FONT_MEDIUM);
cpu_bar_bg.line_space = 0;
cpu_bar_bg.txt_align = 1;
cpu_bar_bg.hpad = 0;
cpu_bar_bg.vpad = 0;
cpu_pbs.bar.gcolor = COLOR_MARRON;
cpu_pbs.bar.objs.color = COLOR_RED;
cpu_pbs.bar.bwidth = 0;
memcpy(&mem_bar_bg, &cpu_bar_bg, sizeof(lv_style_t));
mem_bar_bg.ccolor = COLOR_MAKE(0x00, 0x40, 0x00);
cpu_pbs.label.objs.color = COLOR_MAKE(0x40, 0x00, 0x00);
cpu_pbs.label.font = LV_APP_FONT_MEDIUM;
cpu_pbs.label.line_space = 0;
cpu_pbs.label.mid = 1;
lv_style_get(LV_STYLE_PRETTY_COLOR, &cpu_bar_indic);
cpu_bar_indic.gcolor = COLOR_MARRON;
cpu_bar_indic.mcolor = COLOR_RED;
cpu_bar_indic.bcolor = COLOR_BLACK;
//cpu_bar_indic.bwidth = 1 * LV_DOWNSCALE;
cpu_bar_indic.bopa = OPA_50;
cpu_bar_indic.hpad = 0 * LV_DOWNSCALE;
cpu_bar_indic.vpad = 0 * LV_DOWNSCALE;
memcpy(&mem_pbs, &cpu_pbs, sizeof(mem_pbs));
mem_pbs.bg.gcolor = COLOR_MAKE(0xD0, 0xFF, 0xD0);
mem_pbs.bg.objs.color = COLOR_MAKE(0xE0, 0xFF, 0xE0);
mem_pbs.bg.bcolor = COLOR_MAKE(0x20, 0xFF, 0x20);
mem_pbs.bar.gcolor = COLOR_GREEN;
mem_pbs.bar.objs.color = COLOR_LIME;
mem_pbs.label.objs.color = COLOR_MAKE(0x00, 0x40, 0x00);
memcpy(&mem_bar_indic, &cpu_bar_indic, sizeof(lv_style_t));
mem_bar_indic.gcolor = COLOR_GREEN;
mem_bar_indic.mcolor = COLOR_LIME;
return &my_app_dsc;
}
@@ -187,19 +191,25 @@ static void my_sc_open(lv_app_inst_t * app, lv_obj_t * sc)
cord_t w = lv_obj_get_width(sc) / 5;
/*Create 2 progress bars fr the CPU and the Memory*/
sc_data->pb_cpu = lv_pb_create(sc, NULL);
lv_obj_set_size(sc_data->pb_cpu, w, 5 * lv_obj_get_height(sc) / 8);
lv_obj_align(sc_data->pb_cpu, NULL, LV_ALIGN_IN_BOTTOM_LEFT, w, - lv_obj_get_height(sc) / 8);
lv_obj_set_style(sc_data->pb_cpu, &cpu_pbs);
lv_obj_set_click(sc_data->pb_cpu, false);
lv_pb_set_min_max_value(sc_data->pb_cpu, 0, 100);
lv_pb_set_format_str(sc_data->pb_cpu, "C\nP\nU");
/*Create 2 bars for the CPU and the Memory*/
sc_data->bar_cpu = lv_bar_create(sc, NULL);
lv_obj_set_size(sc_data->bar_cpu, w, 5 * lv_obj_get_height(sc) / 8);
lv_obj_align(sc_data->bar_cpu, NULL, LV_ALIGN_IN_BOTTOM_LEFT, w, - lv_obj_get_height(sc) / 8);
lv_obj_set_style(sc_data->bar_cpu, &cpu_bar_bg);
lv_bar_set_style_indic(sc_data->bar_cpu, &cpu_bar_indic);
lv_obj_set_click(sc_data->bar_cpu, false);
lv_bar_set_range(sc_data->bar_cpu, 0, 100);
lv_obj_t * label = lv_label_create(sc_data->bar_cpu, NULL);
lv_label_set_text(label, "C\nP\nU");
lv_obj_align(label, NULL, LV_ALIGN_CENTER, 0, 0);
sc_data->pb_mem = lv_pb_create(sc, sc_data->pb_cpu);
lv_obj_align(sc_data->pb_mem, sc_data->pb_cpu, LV_ALIGN_OUT_RIGHT_MID, w, 0);
lv_obj_set_style(sc_data->pb_mem, &mem_pbs);
lv_pb_set_format_str(sc_data->pb_mem, "M\ne\nm");
sc_data->bar_mem = lv_bar_create(sc, sc_data->bar_cpu);
lv_obj_align(sc_data->bar_mem, sc_data->bar_cpu, LV_ALIGN_OUT_RIGHT_MID, w, 0);
lv_obj_set_style(sc_data->bar_mem, &mem_bar_bg);
lv_bar_set_style_indic(sc_data->bar_mem, &mem_bar_indic);
label = lv_label_create(sc_data->bar_mem, NULL);
lv_label_set_text(label, "M\nE\nM");
lv_obj_align(label, NULL, LV_ALIGN_CENTER, 0, 0);
lv_app_sysmon_refr();
}
@@ -223,29 +233,32 @@ static void my_sc_close(lv_app_inst_t * app)
static void my_win_open(lv_app_inst_t * app, lv_obj_t * win)
{
my_win_data_t * win_data = app->win_data;
lv_app_style_t * app_style = lv_app_style_get();
/*Make the window content responsive*/
lv_cont_set_layout(lv_page_get_scrl(lv_win_get_page(win)), LV_CONT_LAYOUT_PRETTY);
/*Create a chart with two data lines*/
win_data->chart = lv_chart_create(win, NULL);
lv_obj_set_size(win_data->chart, LV_HOR_RES / 2, LV_VER_RES / 2);
lv_obj_set_pos(win_data->chart, LV_DPI / 10, LV_DPI / 10);
lv_chart_set_pnum(win_data->chart, LV_APP_SYSMON_PNUM);
lv_chart_set_range(win_data->chart, 0, 100);
lv_chart_set_type(win_data->chart, LV_CHART_LINE);
win_data->cpu_dl = lv_chart_add_dataline(win_data->chart);
win_data->mem_dl = lv_chart_add_dataline(win_data->chart);
lv_chart_set_dl_width(win_data->chart, 2 * LV_DOWNSCALE);
win_data->cpu_dl = lv_chart_add_data_line(win_data->chart, COLOR_RED);
win_data->mem_dl = lv_chart_add_data_line(win_data->chart, COLOR_BLUE);
uint16_t i;
for(i = 0; i < LV_APP_SYSMON_PNUM; i ++) {
win_data->cpu_dl[i] = cpu_pct[i];
win_data->mem_dl[i] = mem_pct[i];
win_data->cpu_dl->points[i] = cpu_pct[i];
win_data->mem_dl->points[i] = mem_pct[i];
}
/*Create a label for the details of Memory and CPU usage*/
cord_t opad = app_style->win_style.pages.scrl_rects.opad;
win_data->label = lv_label_create(win, NULL);
lv_obj_align(win_data->label, win_data->chart, LV_ALIGN_OUT_RIGHT_MID, opad, 0);
lv_obj_set_style(win_data->label, &app_style->win_txt_style);
lv_label_set_recolor(win_data->label, true);
lv_obj_align(win_data->label, win_data->chart, LV_ALIGN_OUT_RIGHT_TOP, LV_DPI / 4, 0);
lv_app_sysmon_refr();
}
@@ -279,8 +292,10 @@ static void sysmon_task(void * param)
/*Get CPU and memory information */
uint8_t cpu_busy = 0;
#if USE_IDLE != 0
#if USE_IDLE != 0 /*Use the more precise idle module if enabled*/
cpu_busy = 100 - idle_get();
#else
cpu_busy = 100 - ptask_get_idle();
#endif
uint8_t mem_used_pct = 0;
@@ -311,8 +326,7 @@ static void sysmon_task(void * param)
static bool mem_warn_report = false;
if(mem_mon.size_free < LV_APP_SYSMON_MEM_WARN && mem_warn_report == false) {
mem_warn_report = true;
lv_obj_t * not = lv_app_notice_add("Critically low memory");
lv_obj_set_style(not, lv_mboxs_get(LV_MBOXS_WARN, NULL));
lv_app_notice_add("Critically low memory");
}
if(mem_mon.size_free > LV_APP_SYSMON_MEM_WARN) mem_warn_report = false;
@@ -321,8 +335,7 @@ static void sysmon_task(void * param)
if(mem_mon.pct_frag > LV_APP_SYSMON_FRAG_WARN) {
if(frag_warn_report == false) {
frag_warn_report = true;
lv_obj_t * not =lv_app_notice_add("Critical memory\nfragmentation");
lv_obj_set_style(not, lv_mboxs_get(LV_MBOXS_WARN, NULL));
lv_app_notice_add("Critical memory\nfragmentation");
dm_defrag(); /*Defrag. if the fragmentation is critical*/
}
@@ -340,29 +353,25 @@ static void lv_app_sysmon_refr(void)
char buf_long[256];
char buf_short[128];
#if USE_IDLE != 0
sprintf(buf_long, "CPU: %d %%\n\n", cpu_pct[LV_APP_SYSMON_PNUM - 1]);
sprintf(buf_long, "%c%s CPU: %d %%%c\n\n",TXT_RECOLOR_CMD, CPU_LABEL_COLOR, cpu_pct[LV_APP_SYSMON_PNUM - 1], TXT_RECOLOR_CMD);
sprintf(buf_short, "CPU: %d %%\n", cpu_pct[LV_APP_SYSMON_PNUM - 1]);
#else
strcpy(buf_long, "CPU: N/A\n\n");
strcpy(buf_short, "CPU: N/A\n");
#endif
#if USE_DYN_MEM != 0 && DM_CUSTOM == 0
sprintf(buf_long, "%sMEMORY: %d %%\nTotal: %d bytes\nUsed: %d bytes\nFree: %d bytes\nFrag: %d %%",
sprintf(buf_long, "%s%c%s MEMORY: %d %%%c\nTotal: %d bytes\nUsed: %d bytes\nFree: %d bytes\nFrag: %d %%",
buf_long,
TXT_RECOLOR_CMD,
MEM_LABEL_COLOR,
mem_pct[LV_APP_SYSMON_PNUM - 1],
mem_mon.size_total,
mem_mon.size_total - mem_mon.size_free, mem_mon.size_free, mem_mon.pct_frag);
TXT_RECOLOR_CMD,
(int)mem_mon.size_total,
(int)mem_mon.size_total - mem_mon.size_free, mem_mon.size_free, mem_mon.pct_frag);
sprintf(buf_short, "%sMem: %d %%\nFrag: %d %%\n",
buf_short, mem_pct[LV_APP_SYSMON_PNUM - 1], mem_mon.pct_frag);
#else
sprintf(buf_long, "%sMEMORY: N/A", buf_long);
sprintf(buf_long, "%s%c%s MEMORY: N/A%c", buf_long, TXT_RECOLOR_CMD, MEM_LABEL_COLOR, TXT_RECOLOR_CMD);
sprintf(buf_short, "%sMem: N/A\nFrag: N/A", buf_short);
#endif
lv_app_style_t * app_style = lv_app_style_get();
cord_t opad = app_style->win_style.pages.scrl_rects.opad;
lv_app_inst_t * app;
app = lv_app_get_next(NULL, &my_app_dsc);
while(app != NULL) {
@@ -370,7 +379,6 @@ static void lv_app_sysmon_refr(void)
my_win_data_t * win_data = app->win_data;
if(win_data != NULL) {
lv_label_set_text(win_data->label, buf_long);
lv_obj_align(win_data->label, win_data->chart, LV_ALIGN_OUT_RIGHT_TOP, opad, 0);
lv_chart_set_next(win_data->chart, win_data->mem_dl, mem_pct[LV_APP_SYSMON_PNUM - 1]);
lv_chart_set_next(win_data->chart, win_data->cpu_dl, cpu_pct[LV_APP_SYSMON_PNUM - 1]);
@@ -379,8 +387,8 @@ static void lv_app_sysmon_refr(void)
/*Refresh the shortcut*/
my_sc_data_t * sc_data = app->sc_data;
if(sc_data != NULL) {
lv_pb_set_value(sc_data->pb_cpu, cpu_pct[LV_APP_SYSMON_PNUM - 1]);
lv_pb_set_value(sc_data->pb_mem, mem_pct[LV_APP_SYSMON_PNUM - 1]);
lv_bar_set_value(sc_data->bar_cpu, cpu_pct[LV_APP_SYSMON_PNUM - 1]);
lv_bar_set_value(sc_data->bar_mem, mem_pct[LV_APP_SYSMON_PNUM - 1]);
}
lv_app_com_send(app, LV_APP_COM_TYPE_CHAR, buf_short, strlen(buf_short));

View File

@@ -6,6 +6,10 @@
#ifndef LV_APP_SYSMON_H
#define LV_APP_SYSMON_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
@@ -36,4 +40,8 @@ const lv_app_dsc_t * lv_app_sysmon_init(void);
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_SYSMON != 0*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* LV_APP_SYSMON_H */

View File

@@ -6,7 +6,23 @@
/*********************
* INCLUDES
*********************/
#include <lv_conf.h>
#include <misc/gfx/area.h>
#include <lvgl/lv_obj/lv_dispi.h>
#include <lvgl/lv_obj/lv_obj.h>
#include <lvgl/lv_objx/lv_btn.h>
#include <lvgl/lv_objx/lv_cont.h>
#include <lvgl/lv_objx/lv_ddlist.h>
#include <lvgl/lv_objx/lv_label.h>
#include <lvgl/lv_objx/lv_page.h>
#include <lvgl/lv_objx/lv_ta.h>
#include <misc/gfx/color.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include "lv_app_terminal.h"
#if LV_APP_ENABLE != 0 && USE_LV_APP_TERMINAL != 0
#include "lvgl/lv_app/lv_app_util/lv_app_kb.h"
@@ -15,16 +31,20 @@
/*********************
* DEFINES
*********************/
#define OBJ_PAD (LV_DPI / 12)
#define AUTO_CONNECT_TCP_DELAY 5000 /*Wait before TCS server connect when the WiFi connect is ready*/
/**********************
* TYPEDEFS
**********************/
/*Application specific data for an instance of this application*/
typedef struct
{
char txt[LV_APP_TERMINAL_LENGTH + 1];
lv_app_com_type_t com_type;
lv_app_terminal_format_t format;
lv_app_inst_t * last_sender;
}my_app_data_t;
@@ -33,7 +53,6 @@ typedef struct
{
lv_obj_t * label;
lv_obj_t * ta;
lv_obj_t * com_type_btn;
lv_obj_t * clear_btn;
}my_win_data_t;
@@ -53,10 +72,12 @@ static void my_sc_open(lv_app_inst_t * app, lv_obj_t * sc);
static void my_sc_close(lv_app_inst_t * app);
static void my_win_open(lv_app_inst_t * app, lv_obj_t * win);
static void my_win_close(lv_app_inst_t * app);
static void my_conf_open(lv_app_inst_t * app, lv_obj_t * conf_win);
static void add_data(lv_app_inst_t * app, const void * data, uint16_t data_len);
static lv_action_res_t win_ta_rel_action(lv_obj_t * ta, lv_dispi_t * dispi);
static lv_action_res_t win_comch_rel_action(lv_obj_t * btn, lv_dispi_t * dispi);
static lv_action_res_t win_comtype_action(lv_obj_t * ddlist, lv_dispi_t * dispi);
static lv_action_res_t win_format_action(lv_obj_t * ddlist, lv_dispi_t * dispi);
static lv_action_res_t win_clear_rel_action(lv_obj_t * btn, lv_dispi_t * dispi);
static void win_ta_kb_ok_action(lv_obj_t * ta);
@@ -74,14 +95,16 @@ static lv_app_dsc_t my_app_dsc =
.win_close = my_win_close,
.sc_open = my_sc_open,
.sc_close = my_sc_close,
.conf_open = my_conf_open,
.app_data_size = sizeof(my_app_data_t),
.sc_data_size = sizeof(my_sc_data_t),
.win_data_size = sizeof(my_win_data_t),
};
const char * com_type_txt [LV_APP_COM_TYPE_NUM];
lv_objs_t sc_txt_bgs;
lv_labels_t sc_txts;
static const char * com_type_list_txt[] = {"Character", "Integer", "Log", "None", ""};
static lv_app_com_type_t com_type_list[] = {LV_APP_COM_TYPE_CHAR, LV_APP_COM_TYPE_INT, LV_APP_COM_TYPE_LOG, LV_APP_COM_TYPE_INV};
static const char * txt_format_list_txt[] = {"ASCII", "Hexadecimal", ""};
static lv_style_t style_sc_term;
/**********************
* MACROS
@@ -97,22 +120,13 @@ lv_labels_t sc_txts;
*/
const lv_app_dsc_t * lv_app_terminal_init(void)
{
com_type_txt[LV_APP_COM_TYPE_INT] = "Ch: Num";
com_type_txt[LV_APP_COM_TYPE_CHAR] = "Ch: Chars";
com_type_txt[LV_APP_COM_TYPE_LOG] = "Ch: Log";
com_type_txt[LV_APP_COM_TYPE_INV] = "Ch: None";
lv_app_style_t * app_style = lv_app_style_get();
memcpy(&sc_txts, &app_style->sc_txt_style, sizeof(lv_labels_t));
sc_txts.line_space = 0;
sc_txts.letter_space = 0;
sc_txts.mid = 0;
sc_txts.objs.color = COLOR_WHITE;
lv_objs_get(LV_OBJS_DEF, &sc_txt_bgs);
sc_txt_bgs.color = COLOR_MAKE(0x20, 0x20, 0x20);
lv_style_get(LV_STYLE_PLAIN, &style_sc_term);
style_sc_term.line_space = 0;
style_sc_term.letter_space = 0;
style_sc_term.txt_align = 0;
style_sc_term.ccolor = COLOR_WHITE;
style_sc_term.mcolor = COLOR_MAKE(0x20, 0x20, 0x20);
style_sc_term.gcolor = COLOR_MAKE(0x20, 0x20, 0x20);
return &my_app_dsc;
}
@@ -131,8 +145,17 @@ static void my_app_run(lv_app_inst_t * app, void * conf)
{
/*Initialize the application*/
my_app_data_t * app_data = app->app_data;
app_data->com_type = LV_APP_COM_TYPE_CHAR;
if(conf != NULL) {
app_data->com_type = ((lv_app_terminal_conf_t * ) conf)->com_type;
app_data->format = ((lv_app_terminal_conf_t * ) conf)->format;
} else {
app_data->com_type = LV_APP_COM_TYPE_CHAR;
app_data->format = LV_APP_TERMINAL_FORMAT_ASCII;
}
app_data->last_sender = NULL;
memset(app_data->txt, 0, sizeof(app_data->txt));
}
@@ -160,17 +183,27 @@ static void my_com_rec(lv_app_inst_t * app_send, lv_app_inst_t * app_rec,
{
my_app_data_t * app_data = app_rec->app_data;
/*Add the recevied data if the type is matches*/
/*Add the received data if the type is matches*/
if(type == app_data->com_type) {
/*Insert the name of the sender application if it is not the last*/
if(app_data->last_sender != app_send) {
if(app_data->txt[0] != '\0') add_data(app_rec, "\n", 1);
add_data(app_rec, "@", 1);
add_data(app_rec, "\n@", 2);
add_data(app_rec, app_send->name, strlen(app_send->name));
add_data(app_rec, "\n", 1);
}
add_data(app_rec, data, size);
if(app_data->format == LV_APP_TERMINAL_FORMAT_HEX) {
char hex_buf[8];
const char * data_buf = data;
uint32_t i;
for(i = 0; i < size; i++) {
sprintf(hex_buf, "%02x", data_buf[i]);
add_data(app_rec, hex_buf, 2);
}
} else {
add_data(app_rec, data, size);
}
}
app_data->last_sender = app_send;
@@ -190,13 +223,12 @@ static void my_sc_open(lv_app_inst_t * app, lv_obj_t * sc)
/*Create a dark background*/
lv_obj_t * txt_bg = lv_obj_create(sc, NULL);
lv_obj_set_size(txt_bg, 7 * LV_APP_SC_WIDTH / 8 , app->sc->cords.y2 - app->sc_title->cords.y2 - 10 * LV_DOWNSCALE);
lv_obj_set_style(txt_bg, &sc_txt_bgs);
lv_obj_set_style(txt_bg, &style_sc_term);
lv_obj_align(txt_bg, app->sc_title, LV_ALIGN_OUT_BOTTOM_MID, 0, 3 * LV_DOWNSCALE);
lv_obj_set_click(txt_bg, false);
/*Add a text with the text of the terminal*/
sc_data->label = lv_label_create(txt_bg, NULL);
lv_obj_set_style(sc_data->label, &sc_txts);
lv_label_set_long_mode(sc_data->label, LV_LABEL_LONG_BREAK);
lv_obj_set_width(sc_data->label, lv_obj_get_width(txt_bg) - LV_APP_SC_WIDTH / 8);
lv_label_set_text_static(sc_data->label, app_data->txt);
@@ -222,53 +254,36 @@ static void my_win_open(lv_app_inst_t * app, lv_obj_t * win)
{
my_win_data_t * win_data = app->win_data;
my_app_data_t * app_data = app->app_data;
lv_app_style_t * app_style = lv_app_style_get();
cord_t opad = app_style->win_style.pages.scrl_rects.opad;
/*Make the window content responsive*/
lv_cont_set_layout(lv_page_get_scrl(lv_win_get_page(win)), LV_CONT_LAYOUT_PRETTY);
/*Create a label for the text of the terminal*/
win_data->label = lv_label_create(win, NULL);
lv_label_set_long_mode(win_data->label, LV_LABEL_LONG_BREAK);
lv_obj_set_width(win_data->label, LV_HOR_RES -
2 * (app_style->win_style.pages.bg_rects.hpad +
app_style->win_style.pages.scrl_rects.hpad));
lv_obj_set_style(win_data->label, &app_style->win_txt_style);
lv_obj_set_width(win_data->label, lv_win_get_width(win));
lv_label_set_text_static(win_data->label, app_data->txt); /*Use the app. data text directly*/
/*Create a text area. Text can be added to the terminal from here by app. keyboard.*/
win_data->ta = lv_ta_create(win, NULL);
lv_obj_set_size(win_data->ta, LV_HOR_RES / 2, LV_VER_RES / 4);
lv_obj_set_size(win_data->ta, 3 * LV_HOR_RES / 5, LV_VER_RES / 4);
lv_obj_set_free_p(win_data->ta, app);
lv_page_set_rel_action(win_data->ta, win_ta_rel_action);
lv_page_glue_obj(win_data->ta, true);
lv_ta_set_text(win_data->ta, "");
lv_obj_set_style(win_data->ta, lv_tas_get(LV_TAS_DEF, NULL));
lv_obj_align(win_data->ta, win_data->label, LV_ALIGN_OUT_BOTTOM_LEFT, 0, opad);
/*Create a button to set the communication type (char, integer etc.)*/
win_data->com_type_btn = lv_btn_create(win, NULL);
lv_rect_set_fit(win_data->com_type_btn, true, true);
lv_obj_set_free_p(win_data->com_type_btn, app);
lv_btn_set_rel_action(win_data->com_type_btn, win_comch_rel_action);
lv_obj_t * btn_label = lv_label_create(win_data->com_type_btn, NULL);
lv_obj_set_style(btn_label, lv_labels_get(LV_LABELS_BTN, NULL));
lv_label_set_text(btn_label, com_type_txt[app_data->com_type]);
lv_obj_align(win_data->com_type_btn, win_data->ta, LV_ALIGN_OUT_RIGHT_TOP, opad, 0);
/*Create a clear button*/
win_data->clear_btn = lv_btn_create(win, win_data->com_type_btn);
win_data->clear_btn = lv_btn_create(win, NULL);
lv_cont_set_fit(win_data->clear_btn, true, true);
lv_obj_set_free_p(win_data->clear_btn, app);
lv_page_glue_obj(win_data->ta, true);
lv_btn_set_rel_action(win_data->clear_btn, win_clear_rel_action);
btn_label = lv_label_create(win_data->clear_btn, NULL);
lv_obj_set_style(btn_label, lv_labels_get(LV_LABELS_BTN, NULL));
lv_obj_t * btn_label = lv_label_create(win_data->clear_btn, NULL);
lv_label_set_text(btn_label, "Clear");
lv_obj_align(win_data->clear_btn, win_data->com_type_btn, LV_ALIGN_OUT_RIGHT_TOP, opad, 0);
/*Align the window to see the text area on the bottom*/
lv_obj_align(lv_page_get_scrl(app->win), NULL, LV_ALIGN_IN_BOTTOM_LEFT, 0,
- app_style->win_style.pages.scrl_rects.vpad);
lv_obj_t * page = lv_win_get_page(app->win);
lv_obj_align(lv_page_get_scrl(page), NULL, LV_ALIGN_IN_BOTTOM_LEFT, 0, - LV_VER_RES);
}
/**
@@ -280,6 +295,35 @@ static void my_win_close(lv_app_inst_t * app)
}
/**
* Create objects to configure the applications
* @param app pointer to an application which settings should be created
* @param conf_win pointer to a window where the objects can be created
* (the window has the proper layout)
*/
static void my_conf_open(lv_app_inst_t * app, lv_obj_t * conf_win)
{
my_app_data_t * app_data = app->app_data;
lv_obj_t * label;
label = lv_label_create(conf_win, NULL);
lv_label_set_text(label, "Communication type");
lv_obj_t * ddl;
ddl = lv_ddlist_create(conf_win, NULL);
lv_obj_set_free_p(ddl, app);
lv_ddlist_set_options(ddl, com_type_list_txt);
lv_ddlist_set_action(ddl, win_comtype_action);
lv_ddlist_set_selected(ddl, app_data->com_type);
label = lv_label_create(conf_win, label);
lv_label_set_text(label, "\nText format"); /*First '\n' keeps space from the list above*/
ddl = lv_ddlist_create(conf_win, ddl);
lv_ddlist_set_options(ddl, txt_format_list_txt);
lv_ddlist_set_selected(ddl, app_data->format);
lv_ddlist_set_action(ddl, win_format_action);
}
/*--------------------
* OTHER FUNCTIONS
---------------------*/
@@ -292,34 +336,50 @@ static void my_win_close(lv_app_inst_t * app)
*/
static lv_action_res_t win_ta_rel_action(lv_obj_t * ta, lv_dispi_t * dispi)
{
lv_app_kb_open(ta, LV_APP_KB_MODE_TXT, NULL, win_ta_kb_ok_action);
lv_app_kb_open(ta, LV_APP_KB_MODE_TXT | LV_APP_KB_MODE_WIN_RESIZE, NULL, win_ta_kb_ok_action);
return LV_ACTION_RES_OK;
}
/**
* Called when the communication type button is released to change the type
* @param btn pointer to the comm. type button
* Called when an option is chosen in the communication type drop down list on the configuration window
* @param ddl pointer to the drop down list
* @param dispi pointer to the caller display input
* @return LV_ACTION_RES_OK because the button is not deleted
* @return LV_ACTION_RES_OK because the list is not deleted
*/
static lv_action_res_t win_comch_rel_action(lv_obj_t * btn, lv_dispi_t * dispi)
static lv_action_res_t win_comtype_action(lv_obj_t * ddlist, lv_dispi_t * dispi)
{
lv_app_inst_t * app = lv_obj_get_free_p(btn);
lv_app_inst_t * app = lv_obj_get_free_p(ddlist);
my_app_data_t * app_data = app->app_data;
my_win_data_t * win_data = app->win_data;
if(app_data->com_type == LV_APP_COM_TYPE_CHAR) app_data->com_type = LV_APP_COM_TYPE_LOG;
else if(app_data->com_type == LV_APP_COM_TYPE_LOG) app_data->com_type = LV_APP_COM_TYPE_INT;
else if(app_data->com_type == LV_APP_COM_TYPE_INT) app_data->com_type = LV_APP_COM_TYPE_INV;
else app_data->com_type = LV_APP_COM_TYPE_CHAR;
app_data->com_type = com_type_list[lv_ddlist_get_selected(ddlist)];
lv_label_set_text(lv_obj_get_child(win_data->com_type_btn, NULL), com_type_txt[app_data->com_type]);
return LV_ACTION_RES_OK;
}
/**
* Called when the Clear button is released to clear the ex od the terminal
* Called when an option is chosen in the format drop down list on the configuration window
* @param ddl pointer to the drop down list
* @param dispi pointer to the caller display input
* @return LV_ACTION_RES_OK because the list is not deleted
*/
static lv_action_res_t win_format_action(lv_obj_t * ddlist, lv_dispi_t * dispi)
{
lv_app_inst_t * app = lv_obj_get_free_p(ddlist);
my_app_data_t * app_data = app->app_data;
uint16_t opt = lv_ddlist_get_selected(ddlist);
if(strcmp(txt_format_list_txt[opt], "Hexadecimal") == 0) {
app_data->format = LV_APP_TERMINAL_FORMAT_HEX;
} else if (strcmp(txt_format_list_txt[opt], "ASCII") == 0) {
app_data->format = LV_APP_TERMINAL_FORMAT_ASCII;
}
return LV_ACTION_RES_OK;
}
/**
* Called when the Clear button is released to clear the text of the terminal
* @param btn pointer to the clear button
* @param dispi pointer to the caller display input
* @return LV_ACTION_RES_OK because the button is not deleted
@@ -339,14 +399,9 @@ static lv_action_res_t win_clear_rel_action(lv_obj_t * btn, lv_dispi_t * dispi)
}
if(win_data != NULL) {
lv_app_style_t * app_style =lv_app_style_get();
cord_t opad = app_style->win_style.pages.scrl_rects.opad;
lv_label_set_text_static(win_data->label, app_data->txt);
lv_obj_align(win_data->ta, win_data->label, LV_ALIGN_OUT_BOTTOM_LEFT, 0, opad);
lv_obj_align(win_data->com_type_btn, win_data->ta, LV_ALIGN_OUT_RIGHT_TOP, opad, 0);
lv_obj_align(win_data->clear_btn, win_data->com_type_btn, LV_ALIGN_OUT_RIGHT_TOP, opad, 0);
lv_obj_align(lv_page_get_scrl(app->win), NULL, LV_ALIGN_IN_BOTTOM_LEFT, 0,
- app_style->win_style.pages.scrl_rects.vpad);
lv_obj_t * page = lv_win_get_page(app->win);
lv_obj_align(lv_page_get_scrl(page), NULL, LV_ALIGN_IN_BOTTOM_LEFT, 0, - LV_VER_RES);
}
return LV_ACTION_RES_OK;
@@ -370,6 +425,8 @@ static void win_ta_kb_ok_action(lv_obj_t * ta)
lv_app_com_send(app, app_data->com_type, ta_txt, ta_txt_len);
lv_ta_set_text(ta, "");
app_data->last_sender = NULL; /*Now the least data in the terminal is from this app*/
}
/**
@@ -424,16 +481,11 @@ static void add_data(lv_app_inst_t * app, const void * data, uint16_t data_len)
my_win_data_t * win_data = app->win_data;
my_sc_data_t * sc_data = app->sc_data;
lv_app_style_t * app_style = lv_app_style_get();
if(win_data != NULL) {
cord_t opad = app_style->win_style.pages.scrl_rects.opad;
lv_label_set_text_static(win_data->label, app_data->txt);
lv_obj_align(win_data->ta, win_data->label, LV_ALIGN_OUT_BOTTOM_LEFT, 0, opad);
lv_obj_align(win_data->com_type_btn, win_data->ta, LV_ALIGN_OUT_RIGHT_TOP, opad, 0);
lv_obj_align(win_data->clear_btn, win_data->com_type_btn, LV_ALIGN_OUT_RIGHT_TOP, opad, 0);
lv_obj_align(lv_page_get_scrl(app->win), NULL, LV_ALIGN_IN_BOTTOM_LEFT, 0,
- app_style->win_style.pages.scrl_rects.vpad);
lv_obj_t * page = lv_win_get_page(app->win);
lv_obj_align(lv_page_get_scrl(page), NULL, LV_ALIGN_IN_BOTTOM_LEFT, 0, - LV_VER_RES);
}
/*Set the last line on the shortcut*/

View File

@@ -6,6 +6,10 @@
#ifndef LV_APP_TERMINAL_H
#define LV_APP_TERMINAL_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
@@ -20,9 +24,16 @@
/**********************
* TYPEDEFS
**********************/
typedef enum
{
LV_APP_TERMINAL_FORMAT_ASCII,
LV_APP_TERMINAL_FORMAT_HEX,
}lv_app_terminal_format_t;
typedef struct
{
lv_app_terminal_format_t format; /*Data display format*/
lv_app_com_type_t com_type; /*The listened communication type (channel) */
}lv_app_terminal_conf_t;
/**********************
@@ -36,4 +47,8 @@ const lv_app_dsc_t * lv_app_terminal_init(void);
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_TERMINAL != 0*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* LV_APP_TERMINAL_H */

485
lv_appx/lv_app_wifi.c Normal file
View File

@@ -0,0 +1,485 @@
/**
* @file lv_app_wifi.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_app_wifi.h"
#if LV_APP_ENABLE != 0 && USE_LV_APP_WIFI != 0
#include "../lv_app/lv_app_util/lv_app_kb.h"
#include "hal/wifi/wifi.h"
#include "misc/os/ptask.h"
#include "hal/systick/systick.h"
#include "misc/comm/wifimng.h"
#include <stdio.h>
/*********************
* DEFINES
*********************/
#define SSID_LIST_MAX_LENGTH 512
#define WIFI_MONITOR_PERIOD 1000 /*ms*/
/**********************
* TYPEDEFS
**********************/
/*Application specific data for an instance of this application*/
typedef struct
{
char set_ssid[64];
char set_pwd[64];
char set_ip[32];
char set_port[16];
}my_app_data_t;
/*Application specific data a window of this application*/
typedef struct
{
lv_obj_t * list;
lv_obj_t * title;
lv_obj_t * netw_ssid_ta;
lv_obj_t * netw_pwd_ta;
lv_obj_t * tcp_ip_ta;
lv_obj_t * tcp_port_ta;
}my_win_data_t;
/*Application specific data for a shortcut of this application*/
typedef struct
{
lv_obj_t * label;
}my_sc_data_t;
/**********************
* STATIC PROTOTYPES
**********************/
static void my_app_run(lv_app_inst_t * app, void * conf);
static void my_app_close(lv_app_inst_t * app);
static void my_com_rec(lv_app_inst_t * app_send, lv_app_inst_t * app_rec, lv_app_com_type_t type , const void * data, uint32_t size);
static void my_sc_open(lv_app_inst_t * app, lv_obj_t * sc);
static void my_sc_close(lv_app_inst_t * app);
static void my_win_open(lv_app_inst_t * app, lv_obj_t * win);
static void my_win_close(lv_app_inst_t * app);
static void wifi_state_monitor_task(void * param);
static lv_action_res_t netw_list_rel_action(lv_obj_t * btn, lv_dispi_t * dispi);
static lv_action_res_t netw_con_rel_action(lv_obj_t * btn, lv_dispi_t* dispi);
static lv_action_res_t netw_ssid_rel_action( lv_obj_t * ta, lv_dispi_t* dispi);
static lv_action_res_t netw_pwd_rel_action( lv_obj_t * ta, lv_dispi_t* dispi);
static lv_action_res_t tcp_ip_rel_action( lv_obj_t * ta, lv_dispi_t* dispi);
static lv_action_res_t tcp_port_rel_action( lv_obj_t * ta, lv_dispi_t* dispi);
static lv_action_res_t wifi_ap_select_action( lv_obj_t * ddlist, lv_dispi_t* dispi);
static void netw_ssid_kb_ok(lv_obj_t * ta);
static void netw_ssid_kb_close(lv_obj_t * ta);
static void netw_pwd_kb_ok(lv_obj_t * ta);
static void netw_pwd_kb_close(lv_obj_t * ta);
static void tcp_ip_kb_ok(lv_obj_t * ta);
static void tcp_ip_kb_close(lv_obj_t * ta);
static void tcp_port_kb_ok(lv_obj_t * ta);
static void tcp_port_kb_close(lv_obj_t * ta);
static void list_cb(wifi_state_t state, const char * txt);
static void tcp_transf_cb(wifi_state_t state, const char * txt);
static void win_title_refr(void);
/**********************
* STATIC VARIABLES
**********************/
static lv_app_dsc_t my_app_dsc =
{
.name = "WiFi",
.mode = LV_APP_MODE_NONE,
.app_run = my_app_run,
.app_close = my_app_close,
.com_rec = my_com_rec,
.win_open = my_win_open,
.win_close = my_win_close,
.sc_open = my_sc_open,
.sc_close = my_sc_close,
.app_data_size = sizeof(my_app_data_t),
.sc_data_size = sizeof(my_sc_data_t),
.win_data_size = sizeof(my_win_data_t),
};
static char ssid_list[SSID_LIST_MAX_LENGTH];
static lv_app_inst_t * app_act_com;
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/**
* Initialize the application
* @return pointer to the application descriptor of this application
*/
const lv_app_dsc_t * lv_app_wifi_init(void)
{
strcpy(ssid_list, "");
wifimng_set_last_netw(LV_APP_WIFI_SSID_DEF, LV_APP_WIFI_PWD_DEF);
wifimng_set_last_tcp(LV_APP_WIFI_IP_DEF, LV_APP_WIFI_PORT_DEF);
ptask_create(wifi_state_monitor_task, WIFI_MONITOR_PERIOD, PTASK_PRIO_LOW, NULL);
return &my_app_dsc;
}
/**********************
* STATIC FUNCTIONS
**********************/
/**
* Run an application according to 'app_dsc'
* @param app_dsc pointer to an application descriptor
* @param conf pointer to a lv_app_example_conf_t structure with configuration data or NULL if unused
* @return pointer to the opened application or NULL if any error occurred
*/
static void my_app_run(lv_app_inst_t * app, void * conf)
{
/*Initialize the application*/
my_app_data_t * adata = app->app_data;
strcpy(adata->set_ssid, LV_APP_WIFI_SSID_DEF);
strcpy(adata->set_pwd, LV_APP_WIFI_PWD_DEF);
strcpy(adata->set_ip, LV_APP_WIFI_IP_DEF);
strcpy(adata->set_port, LV_APP_WIFI_PORT_DEF);
}
/**
* Close a running application.
* Close the Window and the Shortcut too if opened.
* Free all the allocated memory by this application.
* @param app pointer to an application
*/
static void my_app_close(lv_app_inst_t * app)
{
/*No dynamically allocated data in 'my_app_data'*/
}
/**
* Read the data have been sent to this application
* @param app_send pointer to an application which sent the message
* @param app_rec pointer to an application which is receiving the message
* @param type type of data from 'lv_app_com_type_t' enum
* @param data pointer to the sent data
* @param size length of 'data' in bytes
*/
static void my_com_rec(lv_app_inst_t * app_send, lv_app_inst_t * app_rec,
lv_app_com_type_t type , const void * data, uint32_t size)
{
if(type == LV_APP_COM_TYPE_CHAR) { /*data: string*/
app_act_com = app_rec;
wifi_tcp_transf(data, size, tcp_transf_cb);
}
}
/**
* Open a shortcut for an application
* @param app pointer to an application
* @param sc pointer to an object where the application
* can create content of the shortcut
*/
static void my_sc_open(lv_app_inst_t * app, lv_obj_t * sc)
{
my_sc_data_t * sc_data = app->sc_data;
sc_data->label = lv_label_create(sc, NULL);
lv_label_set_text(sc_data->label, "Empty");
lv_obj_align(sc_data->label, NULL, LV_ALIGN_CENTER, 0, 0);
}
/**
* Close the shortcut of an application
* @param app pointer to an application
*/
static void my_sc_close(lv_app_inst_t * app)
{
/*No dynamically allocated data in 'my_sc_data'*/
}
/**
* Open the application in a window
* @param app pointer to an application
* @param win pointer to a window object where
* the application can create content
*/
static void my_win_open(lv_app_inst_t * app, lv_obj_t * win)
{
my_app_data_t * adata = app->app_data;
my_win_data_t * wdata = app->win_data;
wdata->title = lv_label_create(win, NULL);
wdata->list = lv_ddlist_create(win, NULL);
lv_obj_set_free_p(wdata->list, app);
lv_ddlist_set_options_str(wdata->list, ssid_list);
lv_ddlist_set_action(wdata->list, wifi_ap_select_action);
lv_obj_t * list_btn = lv_btn_create(win, NULL);
lv_obj_set_free_p(list_btn, app);
lv_btn_set_rel_action(list_btn, netw_list_rel_action);
lv_obj_t * label = lv_label_create(list_btn, NULL);
lv_label_set_text(label, "List\nrefresh");
lv_obj_t * ta_cont = lv_cont_create(win, NULL);
lv_cont_set_fit(ta_cont, true, true);
lv_cont_set_layout(ta_cont, LV_CONT_LAYOUT_COL_L);
lv_obj_set_style(ta_cont, lv_style_get(LV_STYLE_TRANSP_TIGHT, NULL));
wdata->netw_ssid_ta = lv_ta_create(ta_cont, NULL);
lv_cont_set_fit(wdata->netw_ssid_ta, false, true);
lv_obj_set_free_p(wdata->netw_ssid_ta, app);
lv_page_set_rel_action(wdata->netw_ssid_ta, netw_ssid_rel_action);
lv_ta_set_text(wdata->netw_ssid_ta, adata->set_ssid);
lv_ta_set_cursor_show(wdata->netw_ssid_ta, false);
wdata->netw_pwd_ta = lv_ta_create(ta_cont, wdata->netw_ssid_ta);
lv_page_set_rel_action(wdata->netw_pwd_ta, netw_pwd_rel_action);
lv_ta_set_text(wdata->netw_pwd_ta, adata->set_pwd);
wdata->tcp_ip_ta = lv_ta_create(ta_cont, wdata->netw_ssid_ta);
lv_page_set_rel_action(wdata->tcp_ip_ta, tcp_ip_rel_action);
lv_ta_set_text(wdata->tcp_ip_ta, adata->set_ip);
wdata->tcp_port_ta = lv_ta_create(ta_cont, wdata->netw_ssid_ta);
lv_page_set_rel_action(wdata->tcp_port_ta, tcp_port_rel_action);
lv_ta_set_text(wdata->tcp_port_ta, adata->set_port);
lv_obj_t * con_btn = lv_btn_create(win, NULL);
lv_obj_set_free_p(con_btn, app);
lv_btn_set_rel_action(con_btn, netw_con_rel_action);
label = lv_label_create(con_btn, NULL);
lv_label_set_text(label, "Connect");
lv_cont_set_layout(lv_page_get_scrl(lv_win_get_page(win)), LV_CONT_LAYOUT_PRETTY);
win_title_refr();
}
/**
* Close the window of an application
* @param app pointer to an application
*/
static void my_win_close(lv_app_inst_t * app)
{
}
/*--------------------
* OTHER FUNCTIONS
---------------------*/
static void wifi_state_monitor_task(void * param)
{
static wifimng_state_t state_prev = WIFIMNG_STATE_WAIT;
wifimng_state_t state_act = wifimng_get_state();
if(state_prev != state_act && state_act == WIFIMNG_STATE_READY) {
lv_app_notice_add("WiFi connected to:\n%s\n%s:%s",
wifimng_get_last_ssid(), wifimng_get_last_ip(), wifimng_get_last_port());
win_title_refr();
}
state_prev = state_act;
}
static lv_action_res_t netw_list_rel_action(lv_obj_t * btn, lv_dispi_t* dispi)
{
wifi_state_t ret;
ret = wifi_netw_list(list_cb);
if(ret == WIFI_STATE_OK) {
lv_app_notice_add("Listing WiFi networks");
} else {
lv_app_notice_add("Cannot list networks\nWiFi was busy. Try again");
}
return LV_ACTION_RES_OK;
}
static lv_action_res_t netw_con_rel_action(lv_obj_t * btn, lv_dispi_t* dispi)
{
lv_app_inst_t * app = lv_obj_get_free_p(btn);
my_app_data_t * adata = app->app_data;
wifimng_set_last_netw(adata->set_ssid, adata->set_pwd);
wifimng_set_last_tcp(adata->set_ip, adata->set_port);
wifimng_reconnect();
lv_app_notice_add("Connecting to WiFi network\n%s, %s:%s",
adata->set_ssid, adata->set_ip, adata->set_port);
return LV_ACTION_RES_OK;
}
static lv_action_res_t netw_ssid_rel_action( lv_obj_t * ta, lv_dispi_t* dispi)
{
lv_app_kb_open(ta, LV_APP_KB_MODE_TXT | LV_APP_KB_MODE_WIN_RESIZE | LV_APP_KB_MODE_CUR_MANAGE, netw_ssid_kb_close ,netw_ssid_kb_ok);
return LV_ACTION_RES_OK;
}
static lv_action_res_t netw_pwd_rel_action( lv_obj_t * ta, lv_dispi_t* dispi)
{
lv_app_kb_open(ta, LV_APP_KB_MODE_TXT | LV_APP_KB_MODE_WIN_RESIZE | LV_APP_KB_MODE_CUR_MANAGE, netw_pwd_kb_close ,netw_pwd_kb_ok);
return LV_ACTION_RES_OK;
}
static lv_action_res_t tcp_ip_rel_action( lv_obj_t * ta, lv_dispi_t* dispi)
{
lv_app_kb_open(ta, LV_APP_KB_MODE_TXT | LV_APP_KB_MODE_WIN_RESIZE | LV_APP_KB_MODE_CUR_MANAGE, tcp_ip_kb_close ,tcp_ip_kb_ok);
return LV_ACTION_RES_OK;
}
static lv_action_res_t tcp_port_rel_action( lv_obj_t * ta, lv_dispi_t* dispi)
{
lv_app_kb_open(ta, LV_APP_KB_MODE_NUM | LV_APP_KB_MODE_WIN_RESIZE | LV_APP_KB_MODE_CUR_MANAGE, tcp_port_kb_close ,tcp_port_kb_ok);
return LV_ACTION_RES_OK;
}
static lv_action_res_t wifi_ap_select_action( lv_obj_t * ddlist, lv_dispi_t* dispi)
{
lv_app_inst_t * app = lv_obj_get_free_p(ddlist);
my_app_data_t * adata = app->app_data;
char ssid[256];
lv_ddlist_get_selected_str(ddlist, ssid);
my_win_data_t * wdata = app->win_data;
lv_ta_set_text(wdata->netw_ssid_ta, ssid);
strcpy(adata->set_ssid, ssid);
return LV_ACTION_RES_OK;
}
static void netw_ssid_kb_ok(lv_obj_t * ta)
{
lv_app_inst_t * app = lv_obj_get_free_p(ta);
my_app_data_t * adata = app->app_data;
strcpy(adata->set_ssid, lv_ta_get_txt(ta));
}
static void netw_ssid_kb_close(lv_obj_t * ta)
{
lv_app_inst_t * app = lv_obj_get_free_p(ta);
my_app_data_t * adata = app->app_data;
lv_ta_set_text(ta, adata->set_ssid);
}
static void netw_pwd_kb_ok(lv_obj_t * ta)
{
lv_app_inst_t * app = lv_obj_get_free_p(ta);
my_app_data_t * adata = app->app_data;
strcpy(adata->set_pwd, lv_ta_get_txt(ta));
}
static void netw_pwd_kb_close(lv_obj_t * ta)
{
lv_app_inst_t * app = lv_obj_get_free_p(ta);
my_app_data_t * adata = app->app_data;
lv_ta_set_text(ta, adata->set_pwd);
}
static void tcp_ip_kb_ok(lv_obj_t * ta)
{
lv_app_inst_t * app = lv_obj_get_free_p(ta);
my_app_data_t * adata = app->app_data;
strcpy(adata->set_ip, lv_ta_get_txt(ta));
}
static void tcp_ip_kb_close(lv_obj_t * ta)
{
lv_app_inst_t * app = lv_obj_get_free_p(ta);
my_app_data_t * adata = app->app_data;
lv_ta_set_text(ta, adata->set_ip);
}
static void tcp_port_kb_ok(lv_obj_t * ta)
{
lv_app_inst_t * app = lv_obj_get_free_p(ta);
my_app_data_t * adata = app->app_data;
strcpy(adata->set_port, lv_ta_get_txt(ta));
}
static void tcp_port_kb_close(lv_obj_t * ta)
{
lv_app_inst_t * app = lv_obj_get_free_p(ta);
my_app_data_t * adata = app->app_data;
lv_ta_set_text(ta, adata->set_port);
}
static void list_cb(wifi_state_t state, const char * txt)
{
if(state == WIFI_STATE_OK) {
if(txt[0] == '\0') {
lv_app_notice_add("WiFi network list ready");
return;
}
if(strlen(ssid_list) + strlen(txt) + 4 < sizeof(ssid_list)) {
sprintf(ssid_list, "%s\n%s", ssid_list, txt);
}
lv_app_inst_t * app = lv_app_get_next(NULL, &my_app_dsc);
while(app != NULL) {
if(app->win_data != NULL) {
my_win_data_t * wdata = app->win_data;
lv_ddlist_set_options_str(wdata->list, ssid_list);
}
app = lv_app_get_next(app, &my_app_dsc);
}
} else if(state == WIFI_STATE_ERROR) {
lv_app_notice_add("WiFi network list error\n%s", txt);
}
}
static void tcp_transf_cb(wifi_state_t state, const char * txt)
{
if(state == WIFI_STATE_OK) {
uint16_t size = txt[0] + ((txt[1] << 8) & 0xFF00);
char buf[256];
memcpy(buf, &txt[2], size);
buf[size] = '\0';
lv_app_com_send(app_act_com, LV_APP_COM_TYPE_CHAR, &txt[2], size);
}else if(state == WIFI_STATE_ERROR) {
lv_app_notice_add("WiFi TCP transfer error\n%s", txt);
lv_app_notice_add("Reconnecting to WiFi...");
wifimng_reconnect();
}
app_act_com = NULL;
}
static void win_title_refr(void)
{
lv_app_inst_t * app;
app = lv_app_get_next(NULL, &my_app_dsc);
while(app != NULL) {
if(app->win != NULL) {
my_win_data_t * wdata = app->win_data;
if(wifimng_get_state() != WIFIMNG_STATE_READY) lv_label_set_text(wdata->title, "Not connected");
else {
char buf[256];
sprintf(buf, "%s - %s:%s", wifimng_get_last_ssid(), wifimng_get_last_ip(), wifimng_get_last_port());
lv_label_set_text(wdata->title, buf);
}
lv_obj_set_width(wdata->title, lv_win_get_width(app->win));
}
app = lv_app_get_next(app, &my_app_dsc);
}
}
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_EXAMPLE != 0*/

47
lv_appx/lv_app_wifi.h Normal file
View File

@@ -0,0 +1,47 @@
/**
* @file lv_app_example.h
*
*/
#ifndef LV_APP_WIFI_H
#define LV_APP_WIFI_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lvgl/lv_app/lv_app.h"
#if LV_APP_ENABLE != 0 && USE_LV_APP_WIFI != 0
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
typedef struct
{
}lv_app_wifi_conf_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
const lv_app_dsc_t * lv_app_wifi_init(void);
/**********************
* MACROS
**********************/
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_EXAMPLE != 0*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* LV_APP_EXAMPLE_H */

View File

@@ -1,232 +0,0 @@
/**
* @file lv_conf.h
*
*/
#if 0 /*Remove this to enable the content (Delete the last #endif too!)*/
#ifndef LV_CONF_H
#define LV_CONF_H
/*===================
Graphical settings
*=====================*/
/* Horizontal and vertical resolution of the library.
* Screen resolution multiplied by LV_DOWN_SCALE*/
#define LV_HOR_RES (480 * LV_DOWNSCALE)
#define LV_VER_RES (320 * LV_DOWNSCALE)
/* Buffered rendering: >= LV_DOWNSCALE * LV_HOR_RES or 0 to disable buffering*/
#define LV_VDB_SIZE (LV_HOR_RES * (LV_VER_RES / 20))
/* Enable antialaiassing
* If enabled everything will half-sized
* Use LV_DOWNSCALE to compensate
* the down scaling effect of antialiassing*/
#define LV_ANTIALIAS 1
/*Set the downscaling value*/
#if LV_ANTIALIAS == 0
#define LV_DOWNSCALE 1
#else
#define LV_DOWNSCALE 2
#endif
#define LV_REFR_PERIOD 40 /*Screen refresh period in milliseconds*/
#define LV_INV_FIFO_SIZE 32 /*The average number of objects on a screen */
/*=================
Misc. setting
*=================*/
/*Display Input settings*/
#define LV_DISPI_READ_PERIOD 50 /*Input device read period milliseconds*/
#define LV_DISPI_TP_MARKER 0 /*Mark the pressed points*/
#define LV_DISPI_DRAG_LIMIT 10 /*Drag threshold in pixels */
#define LV_DISPI_DRAG_THROW 20 /*Drag throw slow-down in [%]. Greater value means faster slow-down */
#define LV_DISPI_LONG_PRESS_TIME 400 /*Long press time in milliseconds*/
#define LV_DISPI_LONG_PRESS_REP_TIME 100 /*Repeated trigger period in long press [ms] */
/*Coordinates*/
#define LV_CORD_TYPE int16_t /*Coordinate type*/
#define LV_CORD_MAX (32000)
#define LV_CORD_MIN (-32000)
/*Fonts and texts*/
#define USE_FONT_DEJAVU_8 1
#define USE_FONT_DEJAVU_10 1
#define USE_FONT_DEJAVU_14 1
#define USE_FONT_DEJAVU_20 1
#define USE_FONT_DEJAVU_30 1
#define USE_FONT_DEJAVU_40 1
#define USE_FONT_DEJAVU_60 1
#define USE_FONT_DEJAVU_80 1
#define USE_FONT_SYMBOL_30 1
#define USE_FONT_SYMBOL_60 1
#define LV_FONT_DEFAULT FONT_DEJAVU_30 /*Always set a default font*/
#define LV_TXT_BREAK_CHARS " ,.;-" /*Can break texts on these chars*/
/*lv_obj (base object) settings*/
#define LV_OBJ_FREE_P 1 /*Enable the free pointer attribute*/
#define LV_OBJ_DEF_SCR_COLOR COLOR_SILVER /*Default screen color*/
/*Others*/
#define LV_COLOR_TRANSP COLOR_LIME
/*==================
* LV OBJ X USAGE
* ================*/
/*Rectangle (dependencies: -*/
#define USE_LV_RECT 1
/*Label (dependencies: -*/
#define USE_LV_LABEL 1
#if USE_LV_LABEL != 0
#define LV_LABEL_SCROLL_SPEED (25 * LV_DOWNSCALE) /*Hor, or ver. scroll speed (px/sec) in 'LV_LABEL_LONG_SCROLL' mode*/
#define LV_LABEL_SCROLL_SPEED_VER (10 * LV_DOWNSCALE) /*Ver. scroll speed if hor. scroll is applied too*/
#define LV_LABEL_SCROLL_PLAYBACK_PAUSE 500 /*Wait before the scroll turns back in ms*/
#define LV_LABEL_SCROLL_REPEAT_PAUSE 500 /*Wait before the scroll begins again in ms*/
#endif
/*Button (dependencies: lv_rect*/
#define USE_LV_BTN 1
/*Line (dependencies: -*/
#define USE_LV_LINE 1
/*Image (dependencies: lv_label (if symbols are enabled) from misc: FSINT, UFS)*/
#define USE_LV_IMG 1
#if USE_LV_IMG != 0
#define LV_IMG_DEF_WALLPAPER img_square_x2 /*Comment this line to NOT use wallpaper*/
/* 1: enables to interpret the file names as symbol name
* from symbol_def.h if they begin with a lower case letter.
* (driver letters are always upper case)*/
#define LV_IMG_ENABLE_SYMBOLS 1
#if LV_IMG_ENABLE_SYMBOLS != 0
#define LV_IMG_DEF_SYMBOL_FONT FONT_SYMBOL_30
#endif /*LV_IMG_ENABLE_SYMBOLS*/
#endif /*USE_LV_IMG*/
/*Page (dependencies: lv_rect)*/
#define USE_LV_PAGE 1
#if USE_LV_PAGE != 0
#define LV_PAGE_ANIM_FOCUS_TIME 300 /*List focus animation time [ms] (0: turn off the animation)*/
#endif
/*List (dependencies: lv_btn, lv_label, lv_img)*/
#define USE_LV_LIST 1
/*Check box (dependencies: lv_btn, lv_label)*/
#define USE_LV_CB 1
/*Progress bar (dependencies: lv_rect, lv_label)*/
#define USE_LV_PB 1
/*LED (dependencies: lv_rect)*/
#define USE_LV_LED 1
/*Chart (dependencies: lv_rect, lv_line)*/
#define USE_LV_CHART 1
/*Text area (dependencies: lv_label, lv_page)*/
#define USE_LV_TA 1
#if USE_LV_TA != 0
#define LV_TA_MAX_LENGTH 256
#define LV_TA_CUR_BLINK_TIME 400 /*ms*/
#endif
/*Button matrix (dependencies: lv_rect, lv_label)*/
#define USE_LV_BTNM 1
/*Window (dependencies: lv_rect, lv_btn, lv_label, lv_img, lv_page)*/
#define USE_LV_WIN 1
/*Message box (dependencies: lv_rect, lv_btn, lv_label)*/
#define USE_LV_MBOX 1
#if USE_LV_MBOX != 0
#define LV_MBOX_ANIM_TIME 250 /*How fast animate out the message box in auto close. 0: no animation [ms]*/
#endif
/*Gauge (dependencies: lv_rect, lv_label, lv_line, misc: trigo)*/
#define USE_LV_GAUGE 1
/*==================
* LV APP SETTINGS
* =================*/
/*Enable the application system*/
#define LV_APP_ENABLE 1
#if LV_APP_ENABLE != 0
#define LV_APP_SC_WIDTH (LV_HOR_RES / 4) /*Shortcut width*/
#define LV_APP_SC_HEIGHT (LV_VER_RES / 3) /*Shortcut height*/
#define LV_APP_FONT_SMALL FONT_DEJAVU_20
#define LV_APP_FONT_MEDIUM LV_FONT_DEFAULT
#define LV_APP_FONT_LARGE FONT_DEJAVU_40
/* Internal icons:
* 0: Do not use internal icons (img_close, img_add etc. icons have to be provided)
* 1: Use simple sized icons
* 2: Use double sized icons*/
#define LV_APP_USE_INTERNAL_ICONS 2
/*Enable or disable the internal icons individually*/
#if LV_APP_USE_INTERNAL_ICONS != 0
#define USE_IMG_CLOSE 1
#define USE_IMG_DOWN 1
#define USE_IMG_DRIVER 1
#define USE_IMG_FILE 1
#define USE_IMG_FOLDER 1
#define USE_IMG_LEFT 1
#define USE_IMG_OK 1
#define USE_IMG_RIGHT 1
#define USE_IMG_UP 1
#endif
/*Animation settings*/
#define LV_APP_EFFECT_OPA 1 /*Enable the opacity in the application style (can be modified)*/
#define LV_APP_EFFECT_ANIM 1 /*Enable the animation of the applications*/
#define LV_APP_EFFECT_OPA_ANIM 1 /*Enable the using opacity in the application animations*/
#define LV_APP_ANIM_WIN 200 /*Animation time in milliseconds (0: turn off animation)*/
#define LV_APP_ANIM_SC 200 /*Animation time in milliseconds (0: turn off animation)*/
#define LV_APP_ANIM_NOTICE 300 /*Obsolete, use LV_MBOX_ANIM. */
/* App. utility settings */
#define LV_APP_NOTICE_SHOW_TIME 4000 /*Notices will be shown for this time [ms]*/
#define LV_APP_NOTICE_MAX_LEN 256 /*Max. number of characters on a notice*/
/*==================
* LV APP X USAGE
* ================*/
#define USE_LV_APP_EXAMPLE 1
#define USE_LV_APP_SYSMON 1
#if USE_LV_APP_SYSMON != 0
#define LV_APP_SYSMON_REFR_TIME 500 /*[ms]*/
#define LV_APP_SYSMON_PNUM 64
#define LV_APP_SYSMON_MEM_WARN (4 * 1024)
#define LV_APP_SYSMON_FRAG_WARN (70) /*[%]*/
#define LV_APP_SYSMON_DEFRAG_PERIOD (5000) /*[%]*/
#endif /*USE_LV_APP_SYSMON != 0*/
#define USE_LV_APP_TERMINAL 1
#if USE_LV_APP_TERMINAL != 0
#define LV_APP_TERMINAL_LENGTH 512 /*Memory of the terminal*/
#endif /*USE_LV_APP_TERMINAL != 0*/
#define USE_LV_APP_FILES 1
#if USE_LV_APP_FILES != 0
#define LV_APP_FILES_PAGE_SIZE 8 /*Max. number of files/folder on a page*/
#define LV_APP_FILES_FN_MAX_LEN 128
#define LV_APP_FILES_PATH_MAX_LEN 256
#define LV_APP_FILES_CHUNK_DEF_SIZE 256
#define LV_APP_FILES_CHUNK_DEF_TIME 100
#define LV_APP_FILES_CHUNK_MAX_SIZE 1024
#endif /*USE_LV_APP_FILES != 0*/
#endif /*LV_APP_ENABLE != 0*/
#endif /*LV_CONF_H*/
#endif /*Remove this to enable the content*/

278
lv_conf_templ.h Normal file
View File

@@ -0,0 +1,278 @@
/**
* @file lv_conf.h
*
*/
#if 0 /*Remove this to enable the content (Delete the last #endif too!)*/
#ifndef LV_CONF_H
#define LV_CONF_H
/*===================
Graphical settings
*=====================*/
/* Horizontal and vertical resolution of the library.
* Screen resolution multiplied by LV_DOWN_SCALE*/
#define LV_HOR_RES (320 * LV_DOWNSCALE)
#define LV_VER_RES (240 * LV_DOWNSCALE)
#define LV_DPI (80 * LV_DOWNSCALE)
/* Buffered rendering: >= LV_DOWNSCALE * LV_HOR_RES or 0 to disable buffering*/
#define LV_VDB_SIZE (LV_HOR_RES * 30)
/* Enable antialaiassing
* If enabled everything will half-sized
* Use LV_DOWNSCALE to compensate
* the down scaling effect of antialiassing*/
#define LV_ANTIALIAS 1
/*Set the downscaling value*/
#define LV_DOWNSCALE (1 << LV_ANTIALIAS)
#define LV_REFR_PERIOD 40 /*Screen refresh period in milliseconds*/
#define LV_INV_FIFO_SIZE 32 /*The average number of objects on a screen */
/*=================
Misc. setting
*=================*/
/*Display Input settings*/
#define LV_DISPI_READ_PERIOD 50 /*Input device read period milliseconds*/
#define LV_DISPI_TP_MARKER 0 /*Mark the pressed points (Value means marker point size)*/
#define LV_DISPI_DRAG_LIMIT (10 * LV_DOWNSCALE) /*Drag threshold in pixels */
#define LV_DISPI_DRAG_THROW 20 /*Drag throw slow-down in [%]. Greater value means faster slow-down */
#define LV_DISPI_LONG_PRESS_TIME 400 /*Long press time in milliseconds*/
#define LV_DISPI_LONG_PRESS_REP_TIME 100 /*Repeated trigger period in long press [ms] */
/*lv_obj (base object) settings*/
#define LV_OBJ_FREE_NUM 1 /*Enable the free number attribute*/
#define LV_OBJ_FREE_P 1 /*Enable the free pointer attribute*/
/*Others*/
#define LV_COLOR_TRANSP COLOR_LIME
/*==================
* LV OBJ X USAGE
* ================*/
/*****************
* Simple object
*****************/
/*Label (dependencies: -*/
#define USE_LV_LABEL 1
#if USE_LV_LABEL != 0
#define LV_LABEL_SCROLL_SPEED (25 * LV_DOWNSCALE) /*Hor, or ver. scroll speed (px/sec) in 'LV_LABEL_LONG_SCROLL' mode*/
#define LV_LABEL_SCROLL_SPEED_VER (10 * LV_DOWNSCALE) /*Ver. scroll speed if hor. scroll is applied too*/
#define LV_LABEL_SCROLL_PLAYBACK_PAUSE 500 /*Wait before the scroll turns back in ms*/
#define LV_LABEL_SCROLL_REPEAT_PAUSE 500 /*Wait before the scroll begins again in ms*/
#endif
/*Image (dependencies: lv_label (if symbols are enabled) from misc: FSINT, UFS)*/
#define USE_LV_IMG 1
#if USE_LV_IMG != 0
//#define LV_IMG_DEF_WALLPAPER img_square_x1 /*Comment this line to NOT use wallpaper*/
/* 1: enables to interpret the file names as symbol name
* from symbol_def.h if they begin with a lower case letter.
* (driver letters are always upper case)*/
#define LV_IMG_ENABLE_SYMBOLS 1
#if LV_IMG_ENABLE_SYMBOLS != 0
#define LV_IMG_DEF_SYMBOL_FONT FONT_SYMBOL_30
#endif /*LV_IMG_ENABLE_SYMBOLS*/
#endif /*USE_LV_IMG*/
/*Line (dependencies: -*/
#define USE_LV_LINE 1
/*******************
* Container object
*******************/
/*Container (dependencies: -*/
#define USE_LV_CONT 1
/*Page (dependencies: lv_cont)*/
#define USE_LV_PAGE 1
/*Window (dependencies: lv_cont, lv_btn, lv_label, lv_img, lv_page)*/
#define USE_LV_WIN 1
/*************************
* Data visualizer object
*************************/
/*Bar (dependencies: -)*/
#define USE_LV_BAR 1
/*Line meter (dependencies: bar; misc: trigo)*/
#define USE_LV_LMETER 1
/*Gauge (dependencies:bar, lmeter; misc: trigo)*/
#define USE_LV_GAUGE 1
#if USE_LV_GAUGE != 0
#define LV_GAUGE_MAX_NEEDLE 4 /*Max number of needles. Used in the style.*/
#endif
/*Chart (dependencies: -)*/
#define USE_LV_CHART 1
/*LED (dependencies: -)*/
#define USE_LV_LED 1
/*Message box (dependencies: lv_rect, lv_btn, lv_label)*/
#define USE_LV_MBOX 1
/*Text area (dependencies: lv_label, lv_page)*/
#define USE_LV_TA 1
#if USE_LV_TA != 0
#define LV_TA_MAX_LENGTH 256
#define LV_TA_CUR_BLINK_TIME 400 /*ms*/
#define LV_TA_PWD_SHOW_TIME 1500 /*ms*/
#endif
/*************************
* User input object
*************************/
/*Button (dependencies: lv_cont*/
#define USE_LV_BTN 1
/*Button matrix (dependencies: -)*/
#define USE_LV_BTNM 1
/*Check box (dependencies: lv_btn, lv_label)*/
#define USE_LV_CB 1
/*List (dependencies: lv_page, lv_btn, lv_label, lv_img)*/
#define USE_LV_LIST 1
/*Drop down list (dependencies: lv_page, lv_label)*/
#define USE_LV_DDLIST 1
/*Slider (dependencies: lv_bar)*/
#define USE_LV_SLIDER 1
/*==================
* LV APP SETTINGS
* =================*/
/*Enable the application system*/
#define LV_APP_ENABLE 0
#if LV_APP_ENABLE != 0
/****************************
* Basic application settings
*****************************/
#define LV_APP_DESKTOP 1 /*Create a desktop-like environment*/
#define LV_APP_SC_WIDTH (LV_DPI * 2) /*Shortcut width*/
#define LV_APP_SC_HEIGHT (3 * LV_DPI / 2) /*Shortcut height*/
#define LV_APP_FONT_SMALL FONT_DEJAVU_20 /*A small font*/
#define LV_APP_FONT_MEDIUM FONT_DEFAULT /*A medium font*/
#define LV_APP_FONT_LARGE FONT_DEJAVU_40 /*A large font*/
/***********************
* Animation settings
***********************/
#define LV_APP_ANIM_WIN 200 /*Animation time of windows [ms] (0: turn off animations)*/
#define LV_APP_ANIM_DESKTOP 200 /*Animation time the desktop [ms] (0: turn off animations)*/
/************************
* App. utility settings
************************/
/*Notice*/
#define USE_LV_APP_NOTICE 1
#if USE_LV_APP_NOTICE != 0
#define LV_APP_NOTICE_SHOW_TIME 4000 /*Notices will be shown for this time [ms]*/
#define LV_APP_NOTICE_CLOSE_ANIM_TIME 300 /*Notice close animation time. [ms] 0: no animation */
#define LV_APP_NOTICE_MAX_NUM 6 /*Max. number of notices*/
#define LV_APP_NOTICE_MAX_LEN 256 /*Max. number of characters on a notice*/
#endif
/*File selector*/
#define USE_LV_APP_FSEL 1
#if USE_LV_APP_FSEL != 0
#define LV_APP_FSEL_PAGE_SIZE 8 /*Max. number of files/folder on a page*/
#define LV_APP_FSEL_FN_MAX_LEN 32 /*Max file name length*/
#define LV_APP_FSEL_PATH_MAX_LEN 256 /*Max path length*/
#endif
/*Keyboard*/
#define USE_LV_APP_KB 1
#if USE_LV_APP_KB != 0
#define LV_APP_KB_ANIM_TIME 300 /*ms*/
#endif
/*==================
* LV APP X USAGE
* ================*/
/*Example application*/
#define USE_LV_APP_EXAMPLE 1
/*Phantom application*/
#define USE_LV_APP_PHANTOM 1
#if USE_LV_APP_PHANTOM != 0
/*No settings*/
#endif
/*System monitor*/
#define USE_LV_APP_SYSMON 1
#if USE_LV_APP_SYSMON != 0
#define LV_APP_SYSMON_REFR_TIME 500 /*Mem. and CPU usage read period [ms]*/
#define LV_APP_SYSMON_PNUM 64 /*Number of point on the window's chart*/
#define LV_APP_SYSMON_MEM_WARN (2 * 1024) /*Make a notice less then this remaining memory [bytes]*/
#define LV_APP_SYSMON_FRAG_WARN (70) /*Make a notice above this fragmentation level [%]*/
#define LV_APP_SYSMON_DEFRAG_PERIOD (5000) /*Auto-defrag period [ms]*/
#endif /*USE_LV_APP_SYSMON != 0*/
/*Terminal*/
#define USE_LV_APP_TERMINAL 1
#if USE_LV_APP_TERMINAL != 0
#define LV_APP_TERMINAL_LENGTH 512 /*Memory of the terminal [character number]*/
#endif /*USE_LV_APP_TERMINAL != 0*/
/*Files*/
#define USE_LV_APP_FILES 1
#if USE_LV_APP_FILES != 0
#define LV_APP_FILES_PAGE_SIZE 8 /*Max. number of files/folder on a page*/
#define LV_APP_FILES_FN_MAX_LEN 32 /*Max file name length*/
#define LV_APP_FILES_PATH_MAX_LEN 256 /*Max path length*/
#define LV_APP_FILES_CHUNK_DEF_SIZE 256 /*Chunk size when sending a file*/
#define LV_APP_FILES_CHUNK_DEF_TIME 100 /*Delay between sent chunks*/
#define LV_APP_FILES_CHUNK_MAX_SIZE 1024 /*Max chunk size when the user sets it*/
#endif /*USE_LV_APP_FILES != 0*/
/*Benchmark*/
#define USE_LV_APP_BENCHMARK 1
#if USE_LV_APP_BENCHMARK != 0
/*No settings*/
#endif
/*WiFi (requires hal/wifi)*/
#define USE_LV_APP_WIFI 0
#if USE_LV_APP_WIFI != 0
#define LV_APP_WIFI_SSID_DEF "my_ssid"
#define LV_APP_WIFI_PWD_DEF "my_pasword"
#define LV_APP_WIFI_IP_DEF "10.11.12.13"
#define LV_APP_WIFI_PORT_DEF "5555"
#define LV_APP_WIFI_AUTO_CONNECT 1 /*Try to connect at start up to the deafult SSID and IP:PORT*/
#endif /*USE_LV_APP_WIFI != 0*/
/*GSM (requires hal/gsm)*/
#define USE_LV_APP_GSM 0
#if USE_LV_APP_GSM != 0
#define LV_APP_GSM_APN_DEF "my_apn"
#define LV_APP_GSM_IP_DEF "10.11.12.13"
#define LV_APP_GSM_PORT_DEF "5555"
#define LV_APP_GSM_AUTO_CONNECT 1 /*Try to connect at start up with the deafult APN and IP:PORT*/
#endif /*USE_LV_APP_GSM != 0*/
#endif /*LV_APP_ENABLE != 0*/
#endif /*LV_CONF_H*/
#endif /*Remove this to enable the content*/

File diff suppressed because it is too large Load Diff

View File

@@ -1,21 +1,21 @@
/**
* @file lv_draw_img.h
* @file lv_draw.h
*
*/
#ifndef LV_DRAW_H
#define LV_DRAW_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "../lv_objx/lv_btn.h"
#include "../lv_objx/lv_rect.h"
#include "../lv_objx/lv_line.h"
#include "../lv_objx/lv_img.h"
#include "../lv_objx/lv_label.h"
#include "misc_conf.h"
#include "misc/gfx/text.h"
#include "../lv_obj/lv_style.h"
/*********************
* DEFINES
@@ -33,54 +33,61 @@
* Draw a rectangle
* @param cords_p the coordinates of the rectangle
* @param mask_p the rectangle will be drawn only in this mask
* @param rects_p pointer to a rectangle style
* @param opa the opacity of the rectangle (0..255)
* @param style_p pointer to a style
*/
#if USE_LV_RECT != 0
void lv_draw_rect(const area_t * cords_p, const area_t * mask_p,
const lv_rects_t * rects_p, opa_t opa);
void lv_draw_rect(const area_t * cords_p, const area_t * mask_p, const lv_style_t * style_p);
/*Experimental use for 3D modeling*/
#define USE_LV_TRIANGLE 0
#if USE_LV_TRIANGLE != 0
/**
*
* @param points pointer to an array with 3 points
* @param mask_p the triangle will be drawn only in this mask
* @param color color of the triangle
*/
void lv_draw_triangle(const point_t * points, const area_t * mask_p, color_t color);
#endif
/**
* Write a text
* @param cords_p coordinates of the label
* @param mask_p the label will be drawn only in this area
* @param labels_p pointer to a label style
* @param opa opacity of the text (0..255)
* @param style_p pointer to a style
* @param txt 0 terminated text to write
* @param flags settings for the text from 'txt_flag_t' enum
* @param offset text offset in x and y direction (NULL if unused)
*/
#if USE_LV_LABEL != 0
void lv_draw_label(const area_t * cords_p,const area_t * mask_p,
const lv_labels_t * labels_p, opa_t opa, const char * txt);
#endif
void lv_draw_label(const area_t * cords_p,const area_t * mask_p, const lv_style_t * style_p,
const char * txt, txt_flag_t flag, point_t * offset);
/**
* Draw an image
* @param cords_p the coordinates of the image
* @param mask_p the image will be drawn only in this area
* @param map_p pointer to a color_t array which contains the pixels of the image
* @param opa opacity of the image (0..255)
*/
#if USE_LV_IMG != 0 && USE_FSINT != 0 && USE_UFS != 0
void lv_draw_img(const area_t * cords_p, const area_t * mask_p,
const lv_imgs_t * imgs_p, opa_t opa, const char * fn);
#endif
const lv_style_t * style_p, const char * fn);
/**
* Draw a line
* @param p1 first point of the line
* @param p2 second point of the line
* @param mask_pthe line will be drawn only on this area
* @param lines_p pointer to a line style
* @param opa opacity of the line (0..255)
* @param style_p pointer to a style
*/
#if USE_LV_LINE != 0
void lv_draw_line(const point_t * p1, const point_t * p2, const area_t * mask_p,
const lv_lines_t * lines_p, opa_t opa);
#endif
const lv_style_t * style_p);
/**********************
* MACROS
**********************/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_DRAW_H*/

View File

@@ -9,7 +9,7 @@
#include "lv_draw_rbasic.h"
#include "lv_conf.h"
#include "hal/disp/disp.h"
#include "../lv_misc/font.h"
#include "misc/gfx/font.h"
/*********************
* DEFINES
@@ -22,7 +22,6 @@
/**********************
* STATIC PROTOTYPES
**********************/
static void lv_rpx(cord_t x, cord_t y, const area_t * mask_p, color_t color);
/**********************
* STATIC VARIABLES
@@ -36,6 +35,25 @@ static void lv_rpx(cord_t x, cord_t y, const area_t * mask_p, color_t color);
* GLOBAL FUNCTIONS
**********************/
/**
* Put a pixel to the display
* @param x x coordinate of the pixel
* @param y y coordinate of the pixel
* @param mask_p the pixel will be drawn on this area
* @param color color of the pixel
* @param opa opacity (ignored, only for compatibility with lv_vpx)
*/
void lv_rpx(cord_t x, cord_t y, const area_t * mask_p, color_t color, opa_t opa)
{
area_t area;
area.x1 = x;
area.y1 = y;
area.x2 = x;
area.y2 = y;
lv_rfill(&area, mask_p, color, OPA_COVER);
}
/**
* Fill an area on the display
* @param cords_p coordinates of the area to fill
@@ -59,8 +77,7 @@ void lv_rfill(const area_t * cords_p, const area_t * mask_p,
if(union_ok != false){
disp_area(DISP_ID_ALL, masked_area.x1, masked_area.y1, masked_area.x2, masked_area.y2);
disp_fill(DISP_ID_ALL, color);
disp_fill(masked_area.x1, masked_area.y1, masked_area.x2, masked_area.y2, color);
}
}
@@ -73,7 +90,7 @@ void lv_rfill(const area_t * cords_p, const area_t * mask_p,
* @param color color of letter
* @param opa opacity of letter (ignored, only for compatibility with lv_vletter)
*/
void lv_rletter(const point_t * pos_p, const area_t * mask_p,
void lv_rletter(const point_t * pos_p, const area_t * mask_p,
const font_t * font_p, uint8_t letter,
color_t color, opa_t opa)
{
@@ -81,11 +98,11 @@ void lv_rletter(const point_t * pos_p, const area_t * mask_p,
const uint8_t * bitmap_p = font_get_bitmap(font_p, letter);
uint8_t col, col_sub, row;
#if FONT_ANTIALIAS == 0
for(row = 0; row < font_p->height_row; row ++) {
for(col = 0, col_sub = 7; col < w; col ++, col_sub--) {
if(*bitmap_p & (1 << col_sub)) {
lv_rpx(pos_p->x + col, pos_p->y + row, mask_p, color);
lv_rpx(pos_p->x + col, pos_p->y + row, mask_p, color, opa);
}
if(col_sub == 0) {
@@ -99,6 +116,48 @@ void lv_rletter(const point_t * pos_p, const area_t * mask_p,
/*Go to the next row*/
bitmap_p ++;
}
#else
const uint8_t * map1_p = bitmap_p;
const uint8_t * map2_p = bitmap_p + font_p->width_byte;
uint8_t px_cnt;
uint8_t col_byte_cnt;
for(row = 0; row < (font_p->height_row >> 1); row ++) {
col_byte_cnt = 0;
col_sub = 7;
for(col = 0; col < (w >> 1); col ++) {
px_cnt = 0;
if((*map1_p & (1 << col_sub)) != 0) px_cnt++;
if((*map2_p & (1 << col_sub)) != 0) px_cnt++;
if(col_sub != 0) col_sub --;
else {
col_sub = 7;
col_byte_cnt ++;
map1_p ++;
map2_p ++;
}
if((*map1_p & (1 << col_sub)) != 0) px_cnt++;
if((*map2_p & (1 << col_sub)) != 0) px_cnt++;
if(col_sub != 0) col_sub --;
else {
col_sub = 7;
col_byte_cnt ++;
map1_p ++;
map2_p ++;
}
if(px_cnt != 0) {
lv_rpx(pos_p->x + col, pos_p->y + row, mask_p, color_mix(color, COLOR_SILVER, 63 * px_cnt), OPA_COVER);
}
}
map1_p += font_p->width_byte;
map2_p += font_p->width_byte;
map1_p += font_p->width_byte - col_byte_cnt;
map2_p += font_p->width_byte - col_byte_cnt;
}
#endif
}
/**
@@ -131,11 +190,10 @@ void lv_rmap(const area_t * cords_p, const area_t * mask_p,
if(transp == false) {
cord_t row;
cord_t mask_w = area_get_width(&masked_a) - 1;
for(row = 0; row < area_get_height(&masked_a); row++) {
cord_t col;
for(col = 0; col < area_get_width(&masked_a); col ++) {
lv_rpx(masked_a.x1 + col, masked_a.y1 + row, mask_p, map_p[col]);
}
disp_map(masked_a.x1, masked_a.y1 + row, masked_a.x1 + mask_w, masked_a.y1 + row, map_p);
map_p += map_width;
}
}else {
@@ -145,7 +203,7 @@ void lv_rmap(const area_t * cords_p, const area_t * mask_p,
cord_t col;
for(col = 0; col < area_get_width(&masked_a); col ++) {
if(map_p[col].full != transp_color.full) {
lv_rpx(masked_a.x1 + col, masked_a.y1 + row, mask_p, map_p[col]);
lv_rpx(masked_a.x1 + col, masked_a.y1 + row, mask_p, map_p[col], opa);
}
}
map_p += map_width;
@@ -156,21 +214,3 @@ void lv_rmap(const area_t * cords_p, const area_t * mask_p,
/**********************
* STATIC FUNCTIONS
**********************/
/**
* Put a pixel to the display
* @param x x coordinate of the pixel
* @param y y coordinate of the pixel
* @param mask_p the pixel will be drawn on this area
* @param color color of the pixel
*/
static void lv_rpx(cord_t x, cord_t y, const area_t * mask_p, color_t color)
{
area_t area;
area.x1 = x;
area.y1 = y;
area.x2 = x;
area.y2 = y;
lv_rfill(&area, mask_p, color, OPA_COVER);
}

View File

@@ -6,12 +6,16 @@
#ifndef LV_DRAW_RBASIC_H
#define LV_DRAW_RBASIC_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "misc/others/color.h"
#include "../lv_misc/area.h"
#include "../lv_misc/font.h"
#include "misc/gfx/color.h"
#include "misc/gfx/area.h"
#include "misc/gfx/font.h"
/*********************
* DEFINES
@@ -24,6 +28,9 @@
/**********************
* GLOBAL PROTOTYPES
**********************/
void lv_rpx(cord_t x, cord_t y, const area_t * mask_p, color_t color, opa_t opa);
/**
* Fill an area on the display
* @param cords_p coordinates of the area to fill
@@ -65,4 +72,9 @@ void lv_rmap(const area_t * cords_p, const area_t * mask_p,
* MACROS
**********************/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_DRAW_RBASIC_H*/

View File

@@ -2,7 +2,16 @@
* @file lv_vdraw.c
*
*/
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include "lv_conf.h"
#include "misc/gfx/area.h"
#include "misc/gfx/font.h"
#include "misc/gfx/color.h"
#include "hal/disp/disp.h"
#if LV_VDB_SIZE != 0
#include <stddef.h>
@@ -23,6 +32,8 @@
/**********************
* STATIC PROTOTYPES
**********************/
static void sw_color_cpy(color_t * dest, const color_t * src, uint32_t length, opa_t opa);
static void sw_color_fill(area_t * mem_area, color_t * mem, const area_t * fill_area, color_t color, opa_t opa);
/**********************
* STATIC VARIABLES
@@ -36,10 +47,45 @@
* GLOBAL FUNCTIONS
**********************/
/**
* Put a pixel in the Virtual Display Buffer
* @param x pixel x coordinate
* @param y pixel y coordinate
* @param mask_p fill only on this mask (truncated to VDB area)
* @param color pixel color
* @param opa opacity of the area (0..255)
*/
void lv_vpx(cord_t x, cord_t y, const area_t * mask_p, color_t color, opa_t opa)
{
lv_vdb_t * vdb_p = lv_vdb_get();
/*Pixel out of the mask*/
if(x < mask_p->x1 || x > mask_p->x2 ||
y < mask_p->y1 || y > mask_p->y2) {
return;
}
uint32_t vdb_width = area_get_width(&vdb_p->area);
/*Make the coordinates relative to VDB*/
x-=vdb_p->area.x1;
y-=vdb_p->area.y1;
color_t * vdb_px_p = vdb_p->buf + y * vdb_width + x;
if(opa == OPA_COVER) {
*vdb_px_p = color;
}
else {
*vdb_px_p = color_mix(color,*vdb_px_p, opa);
}
}
/**
* Fill an area in the Virtual Display Buffer
* @param cords_p coordinates of the area to fill
* @param mask_p fill only o this mask
* @param mask_p fill only o this mask (truncated to VDB area)
* @param color fill color
* @param opa opacity of the area (0..255)
*/
@@ -56,49 +102,48 @@ void lv_vfill(const area_t * cords_p, const area_t * mask_p,
union_ok = area_union(&res_a, cords_p, mask_p);
/*If there are common part of the three area then draw to the vdb*/
if(union_ok == true) {
area_t vdb_rel_a; /*Stores relative coordinates on vdb*/
vdb_rel_a.x1 = res_a.x1 - vdb_p->vdb_area.x1;
vdb_rel_a.y1 = res_a.y1 - vdb_p->vdb_area.y1;
vdb_rel_a.x2 = res_a.x2 - vdb_p->vdb_area.x1;
vdb_rel_a.y2 = res_a.y2 - vdb_p->vdb_area.y1;
color_t * vdb_buf_tmp = vdb_p->buf;
uint32_t vdb_width = area_get_width(&vdb_p->vdb_area);
/*Move the vdb_tmp to the first row*/
vdb_buf_tmp += vdb_width * vdb_rel_a.y1;
/*Set all row in vdb to the given color*/
cord_t row;
uint32_t col;
/*Run simpler function without opacity*/
if(opa == OPA_COVER) {
for(row = vdb_rel_a.y1; row <= vdb_rel_a.y2; row++) {
for(col = vdb_rel_a.x1; col <= vdb_rel_a.x2; col++) {
vdb_buf_tmp[col] = color;
}
if(union_ok == false) return;
area_t vdb_rel_a; /*Stores relative coordinates on vdb*/
vdb_rel_a.x1 = res_a.x1 - vdb_p->area.x1;
vdb_rel_a.y1 = res_a.y1 - vdb_p->area.y1;
vdb_rel_a.x2 = res_a.x2 - vdb_p->area.x1;
vdb_rel_a.y2 = res_a.y2 - vdb_p->area.y1;
color_t * vdb_buf_tmp = vdb_p->buf;
uint32_t vdb_width = area_get_width(&vdb_p->area);
/*Move the vdb_tmp to the first row*/
vdb_buf_tmp += vdb_width * vdb_rel_a.y1;
#if DISP_HW_ACC == 0
sw_color_fill(&vdb_p->area, vdb_buf_tmp, &vdb_rel_a, color, opa);
#else
static color_t color_map[LV_HOR_RES];
static cord_t last_width = 0;
cord_t map_width = area_get_width(&vdb_rel_a);
if(color_map[0].full != color.full || last_width != map_width) {
uint16_t i;
for(i =0; i < map_width; i++) {
color_map[i].full = color.full;
}
last_width = map_width;
}
cord_t row;
for(row = vdb_rel_a.y1;row <= vdb_rel_a.y2; row++) {
disp_color_cpy(&vdb_buf_tmp[vdb_rel_a.x1], color_map, map_width, opa);
vdb_buf_tmp += vdb_width;
}
#endif
vdb_buf_tmp += vdb_width;
}
}
/*Calculate the alpha too*/
else {
for(row = vdb_rel_a.y1; row <= vdb_rel_a.y2; row++) {
for(col = vdb_rel_a.x1; col <= vdb_rel_a.x2; col++) {
color_t c = color_mix(color, vdb_buf_tmp[col], opa);
vdb_buf_tmp[col] = c;
}
vdb_buf_tmp += vdb_width;
}
}
}
}
/**
* Draw a letter in the Virtual Display Buffer
* @param pos_p left-top coordinate of the latter
* @param mask_p the letter will be drawn only on this area
* @param mask_p the letter will be drawn only on this area (truncated to VDB area)
* @param font_p pointer to font
* @param letter a letter to draw
* @param color color of letter
@@ -122,27 +167,76 @@ void lv_vletter(const point_t * pos_p, const area_t * mask_p,
pos_p->y + letter_h < mask_p->y1 || pos_p->y > mask_p->y2) return;
lv_vdb_t * vdb_p = lv_vdb_get();
cord_t vdb_width = area_get_width(&vdb_p->vdb_area);
cord_t vdb_width = area_get_width(&vdb_p->area);
color_t * vdb_buf_tmp = vdb_p->buf;
cord_t col, row;
uint8_t col_bit;
uint8_t col_byte_cnt;
/* Calculate the col/row start/end on the map
* If font anti alaiassing is enabled use the reduced letter sizes*/
cord_t col_start = pos_p->x > mask_p->x1 ? 0 : mask_p->x1 - pos_p->x;
cord_t col_end = pos_p->x + letter_w < mask_p->x2 ? letter_w : mask_p->x2 - pos_p->x + 1;
cord_t col_end = pos_p->x + (letter_w >> FONT_ANTIALIAS) < mask_p->x2 ? (letter_w >> FONT_ANTIALIAS) : mask_p->x2 - pos_p->x + 1;
cord_t row_start = pos_p->y > mask_p->y1 ? 0 : mask_p->y1 - pos_p->y;
cord_t row_end = pos_p->y + letter_h < mask_p->y2 ? letter_h : mask_p->y2 - pos_p->y + 1;
cord_t row_end = pos_p->y + (letter_h >> FONT_ANTIALIAS) < mask_p->y2 ? (letter_h >> FONT_ANTIALIAS) : mask_p->y2 - pos_p->y + 1;
/*Set a pointer on VDB to the first pixel of the letter*/
vdb_buf_tmp += ((pos_p->y - vdb_p->vdb_area.y1) * vdb_width)
+ pos_p->x - vdb_p->vdb_area.x1;
vdb_buf_tmp += ((pos_p->y - vdb_p->area.y1) * vdb_width)
+ pos_p->x - vdb_p->area.x1;
/*If the letter is partially out of mask the move there on VDB*/
vdb_buf_tmp += (row_start * vdb_width) + col_start;
/*Move on the map too*/
map_p += (row_start * font_p->width_byte) + (col_start>>3);
map_p += ((row_start << FONT_ANTIALIAS) * font_p->width_byte) + ((col_start << FONT_ANTIALIAS) >> 3);
#if FONT_ANTIALIAS != 0
opa_t opa_tmp = opa;
if(opa_tmp != OPA_COVER) opa_tmp = opa_tmp >> 2; /*Opacity per pixel (used when sum the pixels)*/
const uint8_t * map1_p = map_p;
const uint8_t * map2_p = map_p + font_p->width_byte;
uint8_t px_cnt;
for(row = row_start; row < row_end; row ++) {
col_byte_cnt = 0;
col_bit = 7 - ((col_start << FONT_ANTIALIAS) % 8);
for(col = col_start; col < col_end; col ++) {
px_cnt = 0;
if((*map1_p & (1 << col_bit)) != 0) px_cnt++;
if((*map2_p & (1 << col_bit)) != 0) px_cnt++;
if(col_bit != 0) col_bit --;
else {
col_bit = 7;
col_byte_cnt ++;
map1_p ++;
map2_p ++;
}
if((*map1_p & (1 << col_bit)) != 0) px_cnt++;
if((*map2_p & (1 << col_bit)) != 0) px_cnt++;
if(col_bit != 0) col_bit --;
else {
col_bit = 7;
col_byte_cnt ++;
map1_p ++;
map2_p ++;
}
if(px_cnt != 0) {
if(opa == OPA_COVER) *vdb_buf_tmp = color_mix(color, *vdb_buf_tmp, 63*px_cnt);
else *vdb_buf_tmp = color_mix(color, *vdb_buf_tmp, opa_tmp * px_cnt);
}
vdb_buf_tmp++;
}
map1_p += font_p->width_byte;
map2_p += font_p->width_byte;
map1_p += font_p->width_byte - col_byte_cnt;
map2_p += font_p->width_byte - col_byte_cnt;
vdb_buf_tmp += vdb_width - ((col_end) - (col_start)); /*Next row in VDB*/
}
#else
for(row = row_start; row < row_end; row ++) {
col_byte_cnt = 0;
col_bit = 7 - (col_start % 8);
@@ -152,9 +246,9 @@ void lv_vletter(const point_t * pos_p, const area_t * mask_p,
if(opa == OPA_COVER) *vdb_buf_tmp = color;
else *vdb_buf_tmp = color_mix(color, *vdb_buf_tmp, opa);
}
vdb_buf_tmp++;
/*Use a col. more times depending on LV_UPSCALE_FONT*/
vdb_buf_tmp++;
if(col_bit != 0) col_bit --;
else {
col_bit = 7;
@@ -166,12 +260,13 @@ void lv_vletter(const point_t * pos_p, const area_t * mask_p,
map_p += font_p->width_byte - col_byte_cnt;
vdb_buf_tmp += vdb_width - (col_end - col_start); /*Next row in VDB*/
}
#endif
}
/**
* Draw a color map to the display
* @param cords_p coordinates the color map
* @param mask_p the map will drawn only on this area
* @param mask_p the map will drawn only on this area (truncated to VDB area)
* @param map_p pointer to a color_t array
* @param opa opacity of the map (ignored, only for compatibility with lv_vmap)
* @param transp true: enable transparency of LV_IMG_COLOR_TRANSP color pixels
@@ -208,69 +303,36 @@ void lv_vmap(const area_t * cords_p, const area_t * mask_p,
}
/*Stores coordinates relative to the act vdb*/
masked_a.x1 = masked_a.x1 - vdb_p->vdb_area.x1;
masked_a.y1 = masked_a.y1 - vdb_p->vdb_area.y1;
masked_a.x2 = masked_a.x2 - vdb_p->vdb_area.x1;
masked_a.y2 = masked_a.y2 - vdb_p->vdb_area.y1;
masked_a.x1 = masked_a.x1 - vdb_p->area.x1;
masked_a.y1 = masked_a.y1 - vdb_p->area.y1;
masked_a.x2 = masked_a.x2 - vdb_p->area.x1;
masked_a.y2 = masked_a.y2 - vdb_p->area.y1;
cord_t vdb_width = area_get_width(&vdb_p->vdb_area);
cord_t vdb_width = area_get_width(&vdb_p->area);
color_t * vdb_buf_tmp = vdb_p->buf;
vdb_buf_tmp += (uint32_t) vdb_width * masked_a.y1; /*Move to the first row*/
map_p -= (masked_a.x1 >> ds_shift);
map_p -= (masked_a.x1 >> ds_shift); /*Move back. It will be easier to index 'map_p' later*/
if(upscale != false) {
cord_t row;
cord_t col;
color_t transp_color = LV_COLOR_TRANSP;
color_t color_tmp;
color_t prev_color = COLOR_BLACK;
cord_t map_col;
color_tmp = color_mix(recolor, prev_color, recolor_opa);
for(row = masked_a.y1; row <= masked_a.y2; row++) {
for(col = masked_a.x1; col <= masked_a.x2; col ++) {
map_col = col >> 1;
if(map_p[map_col].full != prev_color.full) {
prev_color.full = map_p[map_col].full;
color_tmp = color_mix(recolor, prev_color, recolor_opa);
}
if(transp == false || map_p[map_col].full != transp_color.full) {
vdb_buf_tmp[col] = color_mix( color_tmp, vdb_buf_tmp[col], opa);
}
}
if((row & 0x1) != 0) map_p += map_width; /*Next row on the map*/
vdb_buf_tmp += vdb_width ; /*Next row on the VDB*/
}
}
else {
/*No upscalse*/
if(upscale == false) {
if(transp == false) { /*Simply copy the pixels to the VDB*/
cord_t row;
cord_t map_useful_w = area_get_width(&masked_a);
if(opa == OPA_COVER) { /*no opa */
for(row = masked_a.y1; row <= masked_a.y2; row++) {
memcpy(&vdb_buf_tmp[masked_a.x1],
&map_p[masked_a.x1],
area_get_width(&masked_a) * sizeof(color_t));
map_p += map_width; /*Next row on the map*/
vdb_buf_tmp += vdb_width; /*Next row on the VDB*/
}
} else {
cord_t col;
for(row = masked_a.y1; row <= masked_a.y2; row++) {
for(col = masked_a.x1; col <= masked_a.x2; col ++) {
vdb_buf_tmp[col] = color_mix( map_p[col], vdb_buf_tmp[col], opa);
}
map_p += map_width; /*Next row on the map*/
vdb_buf_tmp += vdb_width; /*Next row on the VDB*/
}
}
/*To recolor draw simply a rectangle above the image*/
#if LV_VDB_SIZE != 0
lv_vfill(cords_p, mask_p, recolor, recolor_opa);
for(row = masked_a.y1; row <= masked_a.y2; row++) {
#if DISP_HW_ACC == 0
sw_color_cpy(&vdb_buf_tmp[masked_a.x1], &map_p[masked_a.x1], map_useful_w, opa);
#else
disp_color_cpy(&vdb_buf_tmp[masked_a.x1], &map_p[masked_a.x1], map_useful_w, opa);
#endif
map_p += map_width; /*Next row on the map*/
vdb_buf_tmp += vdb_width; /*Next row on the VDB*/
}
/*To recolor draw simply a rectangle above the image*/
if(recolor_opa != OPA_TRANSP) {
lv_vfill(cords_p, mask_p, recolor, recolor_opa);
}
} else { /*transp == true: Check all pixels */
cord_t row;
cord_t col;
@@ -285,8 +347,8 @@ void lv_vmap(const area_t * cords_p, const area_t * mask_p,
}
}
map_p += map_width; /*Next row on the map*/
vdb_buf_tmp += vdb_width; /*Next row on the VDB*/
map_p += map_width; /*Next row on the map*/
vdb_buf_tmp += vdb_width; /*Next row on the VDB*/
}
} else {
for(row = masked_a.y1; row <= masked_a.y2; row++) {
@@ -296,8 +358,8 @@ void lv_vmap(const area_t * cords_p, const area_t * mask_p,
}
}
map_p += map_width; /*Next row on the map*/
vdb_buf_tmp += vdb_width; /*Next row on the VDB*/
map_p += map_width; /*Next row on the map*/
vdb_buf_tmp += vdb_width; /*Next row on the VDB*/
}
}
} else { /*Recolor needed*/
@@ -330,12 +392,144 @@ void lv_vmap(const area_t * cords_p, const area_t * mask_p,
}
}
}
/*Upscalse*/
else {
cord_t row;
cord_t col;
color_t transp_color = LV_COLOR_TRANSP;
color_t color_tmp;
color_t prev_color = COLOR_BLACK;
cord_t map_col;
/*The most simple case (but upscale): 0 opacity, no recolor, no transp. pixels*/
if(transp == false && opa == OPA_COVER && recolor_opa == OPA_TRANSP) {
cord_t map_col_start = masked_a.x1 >> 1;
cord_t map_col_end = masked_a.x2 >> 1;
cord_t vdb_col; /*Col. in this row*/
cord_t vdb_col2; /*Col. in next row*/
for(row = masked_a.y1; row <= masked_a.y2; row += 2) {
map_col_start = masked_a.x1 >> 1;
map_col_end = masked_a.x2 >> 1;
vdb_col = masked_a.x1;
vdb_col2 = masked_a.x1 + vdb_width;
for(map_col = map_col_start; map_col <= map_col_end; map_col ++, vdb_col += 2, vdb_col2 += 2) {
vdb_buf_tmp[vdb_col].full = map_p[map_col].full;
vdb_buf_tmp[vdb_col + 1].full = map_p[map_col].full;
vdb_buf_tmp[vdb_col2].full = map_p[map_col].full;
vdb_buf_tmp[vdb_col2 + 1].full = map_p[map_col].full;
}
map_p += map_width;
vdb_buf_tmp += 2 * vdb_width ; /*+ 2 row on the VDB (2 rows are filled because of the upscale)*/
}
}
/*Handle other cases*/
else {
color_tmp = color_mix(recolor, prev_color, recolor_opa);
for(row = masked_a.y1; row <= masked_a.y2; row++) {
for(col = masked_a.x1; col <= masked_a.x2; col ++) {
map_col = col >> 1;
/*Handle recoloring*/
if(recolor_opa == OPA_TRANSP) {
color_tmp.full = map_p[map_col].full;
} else {
if(map_p[map_col].full != prev_color.full) {
prev_color.full = map_p[map_col].full;
color_tmp = color_mix(recolor, prev_color, recolor_opa);
}
}
/*Put the NOT transparent pixels*/
if(transp == false || map_p[map_col].full != transp_color.full) {
/*Handle opacity*/
if(opa == OPA_COVER) {
vdb_buf_tmp[col] = color_tmp;
} else {
vdb_buf_tmp[col] = color_mix( color_tmp, vdb_buf_tmp[col], opa);
}
}
}
if((row & 0x1) != 0) map_p += map_width; /*Next row on the map*/
vdb_buf_tmp += vdb_width ; /*Next row on the VDB*/
}
}
}
}
/**********************
* STATIC FUNCTIONS
**********************/
#if DISP_HW_ACC == 0
/**
* Copy pixels to destination memory using opacity
* @param dest a memory address. Copy 'src' here.
* @param src pointer to pixel map. Copy it to 'dest'.
* @param length number of pixels in 'src'
* @param opa opacity (0, OPA_TRANSP: transparent ... 255, OPA_COVER, fully cover)
*/
static void sw_color_cpy(color_t * dest, const color_t * src, uint32_t length, opa_t opa)
{
if(opa == OPA_COVER) {
memcpy(dest, src, length * sizeof(color_t));
} else {
cord_t col;
for(col = 0; col < length; col++) {
dest[col] = color_mix(src[col], dest[col], opa);
}
}
}
/**
*
* @param mem_area coordinates of 'mem' memory area
* @param mem a memory address. Considered to a rectangual window according to 'mem_area'
* @param fill_area coordinates of an area to fill. Relative to 'mem_area'.
* @param color fill color
* @param opa opacity (0, OPA_TRANSP: transparent ... 255, OPA_COVER, fully cover)
*/
static void sw_color_fill(area_t * mem_area, color_t * mem, const area_t * fill_area, color_t color, opa_t opa)
{
/*Set all row in vdb to the given color*/
cord_t row;
uint32_t col;
cord_t mem_width = area_get_width(mem_area);
/*Run simpler function without opacity*/
if(opa == OPA_COVER) {
/*Fill the first row with 'color'*/
for(col = fill_area->x1; col <= fill_area->x2; col++) {
mem[col] = color;
}
/*Copy the first row to all other rows*/
color_t * mem_first = &mem[fill_area->x1];
cord_t copy_size = (fill_area->x2 - fill_area->x1 + 1) * sizeof(color_t);
mem += mem_width;
for(row = fill_area->y1 + 1; row <= fill_area->y2; row++) {
memcpy(&mem[fill_area->x1], mem_first, copy_size);
mem += mem_width;
}
}
/*Calculate with alpha too*/
else {
color_t bg_tmp = COLOR_BLACK;
color_t opa_tmp = color_mix(color, bg_tmp, opa);
for(row = fill_area->y1; row <= fill_area->y2; row++) {
for(col = fill_area->x1; col <= fill_area->x2; col++) {
/*If the bg color changed recalculate the result color*/
if(mem[col].full != bg_tmp.full) {
bg_tmp = mem[col];
opa_tmp = color_mix(color, bg_tmp, opa);
}
mem[col] = opa_tmp;
}
mem += mem_width;
}
}
}
#endif /*DISP_HW_ACC == 0*/
#endif

View File

@@ -6,6 +6,10 @@
#ifndef LV_DRAW_VBASIC_H
#define LV_DRAW_VBASIC_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
@@ -13,9 +17,9 @@
#if LV_VDB_SIZE != 0
#include "misc/others/color.h"
#include "../lv_misc/area.h"
#include "../lv_misc/font.h"
#include "misc/gfx/color.h"
#include "misc/gfx/area.h"
#include "misc/gfx/font.h"
/*********************
* DEFINES
@@ -29,6 +33,7 @@
* GLOBAL PROTOTYPES
**********************/
void lv_vpx(cord_t x, cord_t y, const area_t * mask_p, color_t color, opa_t opa);
/**
* Fill an area in the Virtual Display Buffer
* @param cords_p coordinates of the area to fill
@@ -73,6 +78,10 @@ void lv_vmap(const area_t * cords_p, const area_t * mask_p,
* MACROS
**********************/
#endif /*LV_VDB_SIZE != 0*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif
#endif /*LV_DRAW_RBASIC_H*/

View File

@@ -1,31 +0,0 @@
#include "img_conf.h"
#include "lv_conf.h"
#if USE_IMG_CLOSE != 0 && LV_APP_USE_INTERNAL_ICONS == 1
#include <stdint.h>
#include "misc/others/color.h"
const color_int_t img_close [] = { /*Width = 14, Height = 15*/
14, /*Width*/
15, /*Heigth*/
16, /*Color depth = 16*/
1, /*Flags: Transp = 1*/
2016, 6339, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 4258, 2016,
6371, 0, 32, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2113, 0, 4226,
10597, 0, 0, 0, 2016, 2016, 2016, 2016, 2016, 2016, 32, 0, 0, 8452,
2016, 10597, 0, 0, 0, 2016, 2016, 2016, 2016, 32, 0, 0, 8452, 2016,
2016, 2016, 10597, 0, 0, 0, 2016, 2016, 32, 0, 0, 8452, 2016, 2016,
2016, 2016, 2016, 10565, 0, 0, 32, 2113, 0, 0, 6339, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 10597, 0, 0, 0, 0, 8452, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 0, 0, 0, 0, 35953, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 32, 0, 0, 0, 0, 0, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2113, 0, 0, 6339, 8484, 0, 0, 32, 2016, 2016, 2016,
2016, 2016, 32, 0, 0, 8452, 2016, 2016, 10597, 0, 0, 0, 2016, 2016,
2016, 32, 0, 0, 8452, 2016, 2016, 2016, 2016, 10597, 0, 0, 0, 2016,
2113, 0, 0, 6339, 2016, 2016, 2016, 2016, 2016, 2016, 10565, 0, 0, 32,
19049, 0, 8452, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 12678, 0, 14823,
2016, 23275, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 23243, 2016,
};
#endif

View File

@@ -1,26 +0,0 @@
#include "img_conf.h"
#include "lv_conf.h"
#if USE_IMG_DOWN != 0 && LV_APP_USE_INTERNAL_ICONS == 1
#include <stdint.h>
#include "misc/others/color.h"
const color_int_t img_down [] = { /*Width = 15, Height = 10*/
15, /*Width*/
10, /*Heigth*/
16, /*Color depth = 16*/
1, /*Flags: Transp = 1*/
2016, 2016, 27501, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 33840, 2016, 2016,
2016, 12710, 0, 19049, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 4226, 0, 35953, 2016,
14791, 0, 0, 0, 19049, 2016, 2016, 2016, 2016, 2016, 4226, 0, 0, 0, 35953,
10565, 0, 0, 0, 0, 16936, 2016, 2016, 2016, 2145, 0, 0, 0, 0, 29614,
2016, 8484, 0, 0, 0, 0, 19049, 2016, 4226, 0, 0, 0, 0, 29582, 2016,
2016, 2016, 10565, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31695, 2016, 2016,
2016, 2016, 2016, 8484, 0, 0, 0, 0, 0, 0, 0, 29582, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 8484, 0, 0, 0, 0, 0, 29582, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 8484, 0, 0, 0, 29582, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 8484, 0, 29582, 2016, 2016, 2016, 2016, 2016, 2016,
};
#endif

View File

@@ -1,30 +0,0 @@
#include "img_conf.h"
#include "lv_conf.h"
#if USE_IMG_DRIVER != 0 && LV_APP_USE_INTERNAL_ICONS == 1
#include <stdint.h>
#include "misc/others/color.h"
const color_int_t img_driver [] = { /*Width = 16, Height = 14*/
16, /*Width*/
14, /*Heigth*/
16, /*Color depth = 16*/
1, /*Flags: Transp = 1*/
2016, 2016, 2016, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 2016, 2016, 2016,
2016, 2016, 2016, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33808, 2016, 2016,
2016, 2016, 14823, 2113, 44373, 44373, 44373, 44373, 44373, 44373, 44373, 44373, 6339, 8452, 2016, 2016,
2016, 2016, 0, 23275, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 27469, 0, 2016, 2016,
2016, 29614, 0, 46518, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 48599, 0, 23275, 2016,
2016, 4258, 4258, 65503, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65503, 4226, 2113, 2016,
2016, 0, 27501, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 23243, 0, 40147,
21130, 0, 50744, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 44373, 0, 12710,
4226, 0, 21162, 21162, 21162, 57083, 65535, 65535, 65535, 65535, 61309, 21162, 21162, 19017, 0, 0,
2145, 0, 0, 0, 0, 23275, 65535, 65535, 65535, 65535, 31695, 0, 0, 0, 0, 0,
2145, 0, 0, 0, 0, 32, 21162, 21162, 21162, 21162, 2145, 0, 0, 0, 0, 0,
2145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
#endif

View File

@@ -1,32 +0,0 @@
#include "img_conf.h"
#include "lv_conf.h"
#if USE_IMG_FILE != 0 && LV_APP_USE_INTERNAL_ICONS == 1
#include <stdint.h>
#include "misc/others/color.h"
const color_int_t img_file [] = { /*Width = 12, Height = 16*/
12, /*Width*/
16, /*Heigth*/
16, /*Color depth = 16*/
1, /*Flags: Transp = 1*/
23275, 21162, 21162, 21162, 21162, 21162, 2016, 2016, 2016, 2016, 2016, 2016,
2145, 0, 0, 0, 0, 0, 2113, 2016, 2016, 2016, 2016, 2016,
2145, 0, 42260, 44373, 44373, 2113, 12678, 2145, 2016, 2016, 2016, 2016,
2145, 0, 63390, 65535, 65535, 2145, 59196, 16904, 2113, 2016, 2016, 2016,
2145, 0, 63390, 65535, 65535, 2145, 63390, 63422, 16904, 2113, 2016, 2016,
2145, 0, 63390, 65535, 65535, 2145, 63390, 65535, 63422, 16904, 2113, 2016,
2145, 0, 63390, 65535, 65535, 2145, 21130, 21162, 21162, 19017, 0, 2145,
2145, 0, 63390, 65535, 65535, 44405, 44373, 44373, 44373, 44373, 2113, 0,
2145, 0, 63390, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 2145, 0,
2145, 0, 63390, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 2145, 0,
2145, 0, 63390, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 2145, 0,
2145, 0, 63390, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 2145, 0,
2145, 0, 63390, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 2145, 0,
2145, 0, 63390, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 2145, 0,
2145, 0, 21130, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 32, 0,
2145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
#endif

View File

@@ -1,28 +0,0 @@
#include "img_conf.h"
#include "lv_conf.h"
#if USE_IMG_FOLDER != 0 && LV_APP_USE_INTERNAL_ICONS == 1
#include <stdint.h>
#include "misc/others/color.h"
const color_int_t img_folder [] = { /*Width = 16, Height = 12*/
16, /*Width*/
12, /*Heigth*/
16, /*Color depth = 16*/
1, /*Flags: Transp = 1*/
2016, 2016, 40147, 21162, 21162, 21162, 35921, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 23275, 2113, 0, 0, 0, 0, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 2016,
2016, 2145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
25388, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 21162, 21162,
12678, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6339,
21130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14791,
29582, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23243,
38034, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31695,
2016, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 38066,
2016, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2016,
2016, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2016,
};
#endif

View File

@@ -1,31 +0,0 @@
#include "img_conf.h"
#include "lv_conf.h"
#if USE_IMG_LEFT != 0 && LV_APP_USE_INTERNAL_ICONS == 1
#include <stdint.h>
#include "misc/others/color.h"
const color_int_t img_left [] = { /*Width = 10, Height = 15*/
10, /*Width*/
15, /*Heigth*/
16, /*Color depth = 16*/
1, /*Flags: Transp = 1*/
2016, 2016, 2016, 2016, 2016, 2016, 27501, 21130, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 29582, 0, 0, 21130, 2016,
2016, 2016, 2016, 2016, 31695, 0, 0, 0, 0, 27469,
2016, 2016, 2016, 29582, 0, 0, 0, 0, 4226, 2016,
2016, 2016, 29582, 0, 0, 0, 0, 4226, 2016, 2016,
2016, 29582, 0, 0, 0, 0, 4226, 2016, 2016, 2016,
29582, 0, 0, 0, 0, 4226, 2016, 2016, 2016, 2016,
0, 0, 0, 0, 0, 2016, 2016, 2016, 2016, 2016,
19049, 0, 0, 0, 0, 8484, 2016, 2016, 2016, 2016,
2016, 19049, 0, 0, 0, 0, 8484, 2016, 2016, 2016,
2016, 2016, 21130, 0, 0, 0, 0, 8484, 2016, 2016,
2016, 2016, 2016, 21130, 0, 0, 0, 0, 8484, 2016,
2016, 2016, 2016, 2016, 19017, 0, 0, 0, 0, 23243,
2016, 2016, 2016, 2016, 2016, 21130, 0, 0, 12710, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 21130, 14791, 2016, 2016,
};
#endif

View File

@@ -1,28 +0,0 @@
#include "img_conf.h"
#include "lv_conf.h"
#if USE_IMG_OK != 0 && LV_APP_USE_INTERNAL_ICONS == 1
#include <stdint.h>
#include "misc/others/color.h"
const color_int_t img_ok [] = { /*Width = 16, Height = 12*/
16, /*Width*/
12, /*Heigth*/
16, /*Color depth = 16*/
1, /*Flags: Transp = 1*/
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 32, 2113, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2113, 0, 0, 10597,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 32, 0, 0, 8452, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 32, 0, 0, 8452, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 32, 0, 0, 8452, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2113, 0, 0, 6371, 2016, 2016, 2016, 2016,
2016, 4258, 0, 40147, 2016, 2016, 2016, 32, 0, 0, 8452, 2016, 2016, 2016, 2016, 2016,
16936, 0, 0, 32, 2016, 2016, 2113, 0, 0, 6371, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 10565, 0, 0, 32, 2113, 0, 0, 6371, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 12710, 0, 0, 0, 0, 8452, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 12710, 0, 0, 8484, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 12710, 8484, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
};
#endif

View File

@@ -1,31 +0,0 @@
#include "img_conf.h"
#include "lv_conf.h"
#if USE_IMG_RIGHT != 0 && LV_APP_USE_INTERNAL_ICONS == 1
#include <stdint.h>
#include "misc/others/color.h"
const color_int_t img_right [] = { /*Width = 10, Height = 15*/
10, /*Width*/
15, /*Heigth*/
16, /*Color depth = 16*/
1, /*Flags: Transp = 1*/
2016, 2016, 21130, 27501, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 21130, 0, 0, 29582, 2016, 2016, 2016, 2016, 2016,
27469, 0, 0, 0, 0, 31695, 2016, 2016, 2016, 2016,
2016, 4226, 0, 0, 0, 0, 29582, 2016, 2016, 2016,
2016, 2016, 4226, 0, 0, 0, 0, 29582, 2016, 2016,
2016, 2016, 2016, 4226, 0, 0, 0, 0, 29582, 2016,
2016, 2016, 2016, 2016, 4226, 0, 0, 0, 0, 29582,
2016, 2016, 2016, 2016, 2016, 0, 0, 0, 0, 0,
2016, 2016, 2016, 2016, 8484, 0, 0, 0, 0, 19049,
2016, 2016, 2016, 8484, 0, 0, 0, 0, 19049, 2016,
2016, 2016, 8484, 0, 0, 0, 0, 21130, 2016, 2016,
2016, 8484, 0, 0, 0, 0, 21130, 2016, 2016, 2016,
23243, 0, 0, 0, 0, 19017, 2016, 2016, 2016, 2016,
2016, 12710, 0, 0, 21130, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 14791, 21130, 2016, 2016, 2016, 2016, 2016, 2016,
};
#endif

View File

@@ -1,26 +0,0 @@
#include "img_conf.h"
#include "lv_conf.h"
#if USE_IMG_UP != 0 && LV_APP_USE_INTERNAL_ICONS == 1
#include <stdint.h>
#include "misc/others/color.h"
const color_int_t img_up [] = { /*Width = 15, Height = 10*/
15, /*Width*/
10, /*Heigth*/
16, /*Color depth = 16*/
1, /*Flags: Transp = 1*/
2016, 2016, 2016, 2016, 2016, 2016, 8484, 0, 29582, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 8484, 0, 0, 0, 29582, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 8484, 0, 0, 0, 0, 0, 29582, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 8484, 0, 0, 0, 0, 0, 0, 0, 29582, 2016, 2016, 2016,
2016, 2016, 10565, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31695, 2016, 2016,
2016, 8484, 0, 0, 0, 0, 19049, 2016, 4226, 0, 0, 0, 0, 29582, 2016,
10565, 0, 0, 0, 0, 16936, 2016, 2016, 2016, 2145, 0, 0, 0, 0, 29614,
14791, 0, 0, 0, 19049, 2016, 2016, 2016, 2016, 2016, 4226, 0, 0, 0, 35953,
2016, 12710, 0, 19049, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 4226, 0, 35953, 2016,
2016, 2016, 27501, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 33840, 2016, 2016,
};
#endif

View File

@@ -1,49 +0,0 @@
#include "img_conf.h"
#include "lv_conf.h"
#if USE_IMG_CLOSE != 0 && LV_APP_USE_INTERNAL_ICONS == 2
#include <stdint.h>
#include "misc/others/color.h"
const color_int_t img_close [] = { /*Width = 35, Height = 33*/
35, /*Width*/
33, /*Heigth*/
16, /*Color depth = 16*/
1, /*Flags: Transp = 1*/
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 25356, 21130, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 21162, 23243, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 33808, 6371, 2145, 21162, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 25388, 4226, 4258, 29614, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 25388, 10565, 32, 0, 2145, 16936, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 21130, 4258, 0, 0, 6371, 23243, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 14791, 0, 0, 0, 0, 4226, 23275, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 29582, 6339, 0, 0, 0, 0, 10597, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 16904, 32, 0, 0, 0, 0, 4226, 16936, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 19049, 4258, 32, 0, 0, 0, 0, 12710, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 31695, 14791, 4226, 0, 0, 0, 0, 2145, 21162, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 25388, 4226, 0, 0, 0, 0, 2145, 10597, 27501, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 14791, 32, 0, 0, 0, 0, 2145, 16904, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 19049, 4258, 0, 0, 0, 0, 0, 10597, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 31727, 14791, 4226, 0, 0, 0, 0, 2145, 21162, 2016, 2016, 2016, 2016, 2016, 2016, 25388, 4258, 0, 0, 0, 0, 2145, 10597, 29582, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 14791, 32, 0, 0, 0, 0, 2145, 16904, 2016, 2016, 2016, 2016, 19049, 4226, 0, 0, 0, 0, 0, 10597, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 31727, 14791, 4226, 0, 0, 0, 0, 4226, 23275, 2016, 2016, 27501, 4258, 0, 0, 0, 0, 2113, 10597, 27501, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 12710, 0, 0, 0, 0, 32, 6339, 10565, 10597, 8452, 32, 0, 0, 0, 0, 10565, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31695, 12710, 4226, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2145, 10565, 27469, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 14823, 2113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12710, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 29614, 12678, 2145, 0, 0, 0, 0, 0, 0, 2113, 8452, 25388, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 29614, 6371, 0, 0, 0, 0, 0, 0, 4258, 23275, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 27501, 6339, 0, 0, 0, 0, 0, 0, 4258, 23243, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 19049, 4258, 32, 0, 0, 0, 0, 0, 0, 0, 4226, 16904, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 25388, 4258, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4226, 23243, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 21130, 4258, 0, 0, 0, 0, 32, 2113, 4226, 2145, 0, 0, 0, 0, 2145, 16936, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 29582, 6339, 0, 0, 0, 0, 2145, 12710, 19049, 21162, 16904, 4258, 0, 0, 0, 0, 4226, 23275, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 19049, 4258, 32, 0, 0, 0, 0, 12678, 2016, 2016, 2016, 2016, 14791, 32, 0, 0, 0, 0, 4226, 16936, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 25388, 4226, 0, 0, 0, 0, 2145, 10597, 29582, 2016, 2016, 2016, 2016, 31727, 14791, 4226, 0, 0, 0, 0, 2145, 21162, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 19017, 4226, 0, 0, 0, 0, 0, 10597, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 14791, 32, 0, 0, 0, 0, 2145, 16904, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 25388, 4226, 0, 0, 0, 0, 2113, 10597, 27501, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31727, 14791, 4226, 0, 0, 0, 0, 2145, 21162, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 19017, 4226, 0, 0, 0, 0, 0, 10565, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 12710, 0, 0, 0, 0, 0, 2113, 14823, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 12678, 0, 0, 0, 0, 2145, 10565, 27469, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31695, 14791, 4226, 0, 0, 0, 0, 8484, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 23243, 6339, 0, 0, 0, 12678, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 14823, 2113, 0, 0, 2113, 19049, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 21162, 6371, 4226, 10597, 27501, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 33808, 14823, 4258, 4258, 16936, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 21162, 19017, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 19049, 19049, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
};
#endif

View File

@@ -1,36 +0,0 @@
#include "img_conf.h"
#include "lv_conf.h"
#if USE_IMG_DOWN != 0 && LV_APP_USE_INTERNAL_ICONS == 2
#include <stdint.h>
#include "misc/others/color.h"
const color_int_t img_down [] = { /*Width = 29, Height = 20*/
29, /*Width*/
20, /*Heigth*/
16, /*Color depth = 16*/
1, /*Flags: Transp = 1*/
2016, 2016, 2016, 2016, 23243, 23275, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 25388, 31695, 2016, 2016, 2016,
2016, 2016, 2016, 16904, 4258, 6371, 21162, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 23275, 8452, 4226, 12678, 2016, 2016, 2016,
2016, 2016, 16904, 2113, 0, 0, 6339, 21162, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31727, 8452, 0, 0, 2113, 19017, 2016, 2016,
33808, 16904, 4258, 0, 0, 0, 0, 6371, 21162, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 25356, 8452, 32, 0, 0, 0, 2113, 12710, 2016,
19049, 2145, 0, 0, 0, 0, 0, 0, 6339, 21162, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31727, 8452, 0, 0, 0, 0, 0, 0, 2145, 23243,
16936, 32, 0, 0, 0, 0, 0, 0, 0, 6371, 19049, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 23243, 6371, 32, 0, 0, 0, 0, 0, 0, 2113, 19049,
29582, 12710, 2145, 0, 0, 0, 0, 0, 0, 0, 4258, 19049, 2016, 2016, 2016, 2016, 2016, 31695, 6371, 0, 0, 0, 0, 0, 0, 0, 32, 10597, 29582,
2016, 2016, 12678, 0, 0, 0, 0, 0, 0, 0, 0, 6371, 23243, 2016, 2016, 2016, 25356, 8452, 32, 0, 0, 0, 0, 0, 0, 32, 12678, 29582, 2016,
2016, 2016, 29614, 12710, 4226, 0, 0, 0, 0, 0, 0, 32, 8452, 19049, 2016, 2016, 8484, 0, 0, 0, 0, 0, 0, 0, 2113, 10597, 29614, 2016, 2016,
2016, 2016, 2016, 2016, 14791, 32, 0, 0, 0, 0, 0, 0, 32, 4226, 8484, 8452, 2113, 0, 0, 0, 0, 0, 0, 2113, 14791, 31695, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 31695, 12710, 4226, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 10597, 31695, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 12710, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 12678, 29614, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 29614, 12710, 2145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 10597, 29614, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 12710, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 12710, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 29614, 12710, 2145, 0, 0, 0, 0, 0, 0, 0, 32, 10597, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 12710, 0, 0, 0, 0, 0, 0, 32, 12710, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 29614, 12710, 2145, 0, 0, 0, 32, 10597, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 12710, 0, 0, 0, 12710, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 29614, 14791, 6371, 12678, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31727, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
};
#endif

View File

@@ -1,45 +0,0 @@
#include "img_conf.h"
#include "lv_conf.h"
#if USE_IMG_DRIVER != 0 && LV_APP_USE_INTERNAL_ICONS == 2
#include <stdint.h>
#include "misc/others/color.h"
const color_int_t img_driver [] = { /*Width = 32, Height = 29*/
32, /*Width*/
29, /*Heigth*/
16, /*Color depth = 16*/
1, /*Flags: Transp = 1*/
2016, 2016, 2016, 2016, 2016, 2016, 2016, 29614, 31695, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31695, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 23243, 10597, 12678, 12678, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12678, 10597, 21162, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 10597, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8484, 29614, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 23275, 4226, 0, 4226, 6371, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6371, 4226, 0, 2145, 16936, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 31727, 12678, 32, 4258, 25356, 35921, 33808, 33808, 33808, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 33808, 35921, 25388, 8452, 2113, 6371, 25356, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 21162, 4258, 2145, 14823, 42260, 54938, 52825, 50744, 50744, 50744, 50744, 50744, 50744, 50744, 50744, 50744, 50744, 52825, 54938, 44373, 19017, 4258, 32, 16904, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 12678, 0, 10565, 27501, 54938, 65535, 63422, 63390, 63390, 63390, 63390, 63390, 63390, 63390, 63390, 63390, 63390, 63422, 65535, 54970, 31695, 12710, 0, 10565, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 6339, 0, 19017, 40147, 61277, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 61309, 42292, 21162, 2113, 4258, 31695, 2016, 2016, 2016,
2016, 2016, 2016, 25388, 2145, 4226, 29614, 50712, 63390, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 63390, 50744, 31727, 4258, 32, 19049, 2016, 2016, 2016,
2016, 2016, 2016, 14791, 0, 8484, 40179, 59196, 65503, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65503, 59196, 40179, 8484, 0, 8484, 27501, 2016, 2016,
2016, 2016, 21162, 4226, 0, 14791, 48631, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 48631, 12710, 0, 0, 16936, 2016, 2016,
2016, 2016, 12710, 0, 2145, 21162, 54970, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 54938, 19049, 32, 0, 10565, 2016, 2016,
2016, 2016, 8452, 0, 12710, 31727, 57083, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 57051, 29582, 8484, 0, 6371, 2016, 2016,
2016, 29582, 4226, 2145, 25356, 44373, 61309, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 61277, 38066, 19049, 2113, 2145, 23243, 2016,
2016, 16936, 32, 6371, 38034, 57083, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65503, 50712, 29614, 6339, 0, 10597, 29614,
27469, 6371, 0, 8452, 35953, 52857, 57051, 59164, 57083, 59196, 63422, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65503, 59196, 57083, 59164, 54970, 46518, 29614, 6371, 0, 2113, 21130,
19017, 0, 0, 4258, 23243, 31727, 31727, 31727, 29614, 38066, 54970, 65503, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 59164, 38066, 29614, 31727, 31695, 29582, 19049, 4226, 0, 0, 14791,
14823, 0, 0, 2145, 10597, 14823, 14791, 12710, 10597, 21130, 42260, 57051, 65503, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 61277, 46486, 23243, 10597, 12710, 14791, 14791, 10565, 2113, 0, 0, 10597,
14823, 0, 0, 0, 2113, 2145, 2145, 2113, 32, 8452, 23275, 42260, 63390, 65535, 65535, 65535, 65535, 65535, 65535, 63422, 48599, 29582, 8484, 32, 2113, 2145, 2145, 2113, 0, 0, 0, 12678,
16904, 0, 0, 0, 0, 0, 0, 0, 0, 32, 10565, 25388, 50712, 61277, 59164, 57083, 57083, 59164, 61277, 50744, 31727, 14823, 2113, 0, 0, 0, 0, 0, 0, 0, 0, 12678,
16904, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2113, 10565, 27469, 33840, 33808, 31727, 31727, 33808, 33840, 27501, 12710, 4226, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12678,
16904, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2113, 10597, 14823, 14791, 14791, 14791, 14791, 14823, 10597, 2145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12678,
16904, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2113, 2145, 2145, 2145, 2145, 2145, 2145, 2113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12678,
16904, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12678,
16904, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12678,
14823, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10597,
12710, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8484,
23243, 6371, 6371, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 6371, 4226, 19017,
2016, 31727, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 31727, 31695, 2016,
};
#endif

View File

@@ -1,49 +0,0 @@
#include "img_conf.h"
#include "lv_conf.h"
#if USE_IMG_FILE != 0 && LV_APP_USE_INTERNAL_ICONS == 2
#include <stdint.h>
#include "misc/others/color.h"
const color_int_t img_file [] = { /*Width = 24, Height = 33*/
24, /*Width*/
33, /*Heigth*/
16, /*Color depth = 16*/
1, /*Flags: Transp = 1*/
2016, 31695, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31695, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
27469, 12678, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12678, 12678, 19017, 31727, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
19017, 2113, 2113, 2113, 32, 0, 0, 0, 0, 0, 2113, 4226, 6339, 19049, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
14791, 0, 0, 0, 4226, 6339, 6339, 6339, 6371, 4258, 0, 0, 0, 6371, 27501, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
14823, 0, 0, 4258, 23275, 33808, 33808, 33808, 35921, 25388, 6371, 0, 4226, 6339, 6371, 19049, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
16904, 0, 0, 8484, 38066, 52857, 52825, 52857, 54970, 40179, 10565, 2145, 19017, 19049, 4226, 6371, 29582, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
16904, 0, 0, 10597, 46518, 63422, 63422, 65503, 65535, 48631, 10597, 8484, 42260, 46486, 19017, 6339, 6339, 19049, 2016, 2016, 2016, 2016, 2016, 2016,
16904, 0, 0, 12678, 50712, 65535, 65535, 65535, 65535, 52857, 12678, 10597, 52825, 61309, 38066, 19017, 2145, 6339, 27501, 2016, 2016, 2016, 2016, 2016,
16904, 0, 0, 12678, 50712, 65535, 65535, 65535, 65535, 52825, 10597, 10597, 50712, 65535, 61277, 44405, 19017, 4258, 6339, 19017, 2016, 2016, 2016, 2016,
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 52825, 10597, 10597, 50712, 65535, 65535, 61309, 38066, 19049, 4226, 6371, 27501, 2016, 2016, 2016,
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 52825, 10597, 10597, 50744, 65535, 65535, 65535, 63390, 48599, 21162, 8452, 6371, 19049, 2016, 2016,
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 52825, 10597, 8452, 42260, 57083, 57083, 59164, 61277, 50712, 27469, 10565, 0, 4226, 27501, 2016,
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 52825, 10597, 32, 19049, 29582, 29582, 29614, 29614, 27469, 21130, 10597, 32, 0, 4258, 23275,
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 54938, 21162, 8484, 19017, 23243, 23243, 23243, 23243, 23243, 25356, 19017, 4226, 0, 0, 12678,
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 59196, 42260, 33808, 35921, 35953, 35953, 35953, 35953, 38034, 40147, 29614, 8452, 0, 0, 10597,
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 63422, 54970, 50744, 50712, 50712, 50712, 50712, 50712, 50744, 52857, 40179, 12678, 0, 0, 10597,
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 65535, 63422, 63390, 63390, 63390, 63390, 63390, 63390, 63422, 65535, 50712, 14823, 0, 0, 10597,
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 54938, 16904, 0, 0, 12678,
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 54938, 16904, 0, 0, 12678,
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 52857, 16904, 0, 0, 12678,
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 52857, 16904, 0, 0, 12678,
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 52857, 16904, 0, 0, 12678,
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 52857, 16904, 0, 0, 12678,
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 52857, 16904, 0, 0, 12678,
16904, 0, 0, 12678, 48631, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 52857, 16904, 0, 0, 12678,
16904, 0, 0, 12678, 50712, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 54938, 16904, 0, 0, 12678,
16904, 0, 0, 12678, 52825, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 57051, 16904, 0, 0, 12678,
16904, 0, 0, 10565, 42292, 59164, 59164, 57083, 57083, 57083, 57083, 57083, 57083, 57083, 57083, 57083, 57083, 59164, 61309, 46518, 14791, 0, 0, 12678,
16904, 0, 0, 4258, 23275, 33808, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 33808, 33840, 25388, 8452, 0, 0, 12678,
14823, 0, 0, 32, 8484, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 10565, 2113, 0, 0, 10597,
12710, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8484,
23243, 6371, 6371, 6371, 6371, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6339, 6371, 6371, 6371, 4226, 19017,
2016, 31727, 33808, 33808, 33808, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 33808, 33808, 31727, 31695, 2016,
};
#endif

View File

@@ -1,44 +0,0 @@
#include "img_conf.h"
#include "lv_conf.h"
#if USE_IMG_FOLDER != 0 && LV_APP_USE_INTERNAL_ICONS == 2
#include <stdint.h>
#include "misc/others/color.h"
const color_int_t img_folder [] = { /*Width = 34, Height = 28*/
34, /*Width*/
28, /*Heigth*/
16, /*Color depth = 16*/
1, /*Flags: Transp = 1*/
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31695, 31727, 31727, 31695, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 25356, 16904, 12710, 12710, 12710, 12710, 14823, 21162, 33808, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 27469, 12710, 6339, 4226, 2145, 2145, 2145, 2145, 2145, 4226, 10597, 27469, 2016, 33808, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31727, 31695, 29614, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 27469, 8452, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8484, 14791, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 12710, 10597, 8484, 23243, 2016, 2016, 2016,
2016, 2016, 2016, 16904, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12678, 2016, 2016, 2016,
2016, 2016, 2016, 23243, 6339, 8452, 8484, 8484, 8484, 8484, 8484, 8484, 8484, 8484, 8452, 8452, 6371, 6371, 6371, 6371, 6371, 6371, 6371, 6371, 6371, 6371, 6371, 6371, 6339, 2145, 19017, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 33808, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 31695, 29582, 27501, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 29582, 27501, 29582, 29582, 2016, 2016,
2016, 29582, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14823, 14791, 12678, 25388, 2016,
2016, 25356, 8452, 4226, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 2145, 19049, 2016,
2016, 25356, 6339, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19017, 2016,
2016, 29582, 10597, 2113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4258, 23275, 2016,
2016, 33808, 14823, 2145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2113, 8484, 27469, 2016,
2016, 2016, 19017, 4226, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2145, 12678, 31695, 2016,
2016, 2016, 23243, 4258, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4226, 16904, 2016, 2016,
2016, 2016, 25388, 6339, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4226, 19049, 2016, 2016,
2016, 2016, 29614, 6371, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4258, 23275, 2016, 2016,
2016, 2016, 33808, 8452, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6339, 27469, 2016, 2016,
2016, 2016, 2016, 8484, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6371, 31695, 2016, 2016,
2016, 2016, 2016, 10565, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8452, 2016, 2016, 2016,
2016, 2016, 2016, 10565, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8452, 2016, 2016, 2016,
2016, 2016, 2016, 8484, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6371, 2016, 2016, 2016,
2016, 2016, 2016, 19049, 4226, 6371, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 6371, 4226, 16936, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 31695, 31727, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 33808, 31727, 31695, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
};
#endif

View File

@@ -1,46 +0,0 @@
#include "img_conf.h"
#include "lv_conf.h"
#if USE_IMG_LEFT != 0 && LV_APP_USE_INTERNAL_ICONS == 2
#include <stdint.h>
#include "misc/others/color.h"
const color_int_t img_left [] = { /*Width = 19, Height = 30*/
19, /*Width*/
30, /*Heigth*/
16, /*Color depth = 16*/
1, /*Flags: Transp = 1*/
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 33808, 29582, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 27501, 14791, 10565, 21162, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 29582, 10565, 32, 0, 6371, 23243, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 29614, 12678, 32, 0, 0, 0, 6371, 23243, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31695, 10597, 32, 0, 0, 0, 0, 0, 8452, 25356,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31695, 14791, 2113, 0, 0, 0, 0, 0, 0, 2145, 21130,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 29582, 10597, 2113, 0, 0, 0, 0, 0, 0, 0, 8452, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 29582, 12678, 32, 0, 0, 0, 0, 0, 0, 32, 8452, 23275, 2016,
2016, 2016, 2016, 2016, 2016, 29614, 10597, 32, 0, 0, 0, 0, 0, 0, 0, 8452, 31727, 2016, 2016,
2016, 2016, 2016, 2016, 29614, 12710, 32, 0, 0, 0, 0, 0, 0, 32, 8452, 25356, 2016, 2016, 2016,
2016, 2016, 2016, 29614, 10597, 32, 0, 0, 0, 0, 0, 0, 0, 8452, 31727, 2016, 2016, 2016, 2016,
2016, 2016, 29614, 12710, 32, 0, 0, 0, 0, 0, 0, 2113, 8452, 25356, 2016, 2016, 2016, 2016, 2016,
2016, 29614, 10597, 32, 0, 0, 0, 0, 0, 0, 0, 8452, 31727, 2016, 2016, 2016, 2016, 2016, 2016,
29614, 12678, 32, 0, 0, 0, 0, 0, 0, 32, 8452, 23275, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
12678, 0, 0, 0, 0, 0, 0, 0, 0, 6371, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
8484, 0, 0, 0, 0, 0, 0, 0, 0, 6371, 31727, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
23243, 6339, 0, 0, 0, 0, 0, 0, 0, 2113, 10597, 29582, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 21162, 6371, 0, 0, 0, 0, 0, 0, 0, 32, 14791, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 21162, 6371, 0, 0, 0, 0, 0, 0, 0, 4226, 12710, 29614, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 23243, 8452, 0, 0, 0, 0, 0, 0, 0, 0, 12710, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 23243, 6371, 0, 0, 0, 0, 0, 0, 0, 2145, 12710, 29614, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 23243, 8452, 0, 0, 0, 0, 0, 0, 0, 0, 12710, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 23243, 6371, 0, 0, 0, 0, 0, 0, 0, 2145, 12710, 29614, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 23243, 6371, 0, 0, 0, 0, 0, 0, 0, 0, 12710, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 21130, 4258, 0, 0, 0, 0, 0, 0, 0, 4226, 19017,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 21130, 6371, 0, 0, 0, 0, 0, 0, 4258, 19049,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 23243, 6371, 0, 0, 0, 0, 2113, 16904, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 23243, 8452, 0, 0, 4258, 16904, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 21162, 8452, 4258, 16904, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 25388, 21162, 31727, 2016, 2016, 2016,
};
#endif

View File

@@ -1,47 +0,0 @@
#include "img_conf.h"
#include "lv_conf.h"
#if USE_IMG_OK != 0 && LV_APP_USE_INTERNAL_ICONS == 2
#include <stdint.h>
#include "misc/others/color.h"
const color_int_t img_ok [] = { /*Width = 34, Height = 31*/
34, /*Width*/
31, /*Heigth*/
16, /*Color depth = 16*/
1, /*Flags: Transp = 1*/
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 19017, 6339, 6371, 21130, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 25388, 4226, 0, 0, 6339, 29582, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 19049, 4258, 0, 0, 0, 32, 8452, 25388, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 27501, 4258, 0, 0, 0, 0, 2145, 10565, 29582, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 19049, 4258, 0, 0, 0, 0, 0, 12678, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 25388, 4226, 0, 0, 0, 0, 2145, 12678, 29582, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 19017, 4226, 0, 0, 0, 0, 0, 12678, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 25388, 4226, 0, 0, 0, 0, 2145, 12678, 29582, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 19017, 4226, 0, 0, 0, 0, 0, 12678, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 25388, 4226, 0, 0, 0, 0, 2145, 12678, 29582, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 21130, 4258, 0, 0, 0, 0, 0, 10565, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 33808, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 27501, 6339, 0, 0, 0, 0, 2145, 10597, 27501, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 25356, 10565, 6339, 14823, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 19049, 4258, 0, 0, 0, 0, 0, 12678, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 8484, 0, 0, 2113, 21130, 2016, 2016, 2016, 2016, 2016, 2016, 25388, 4226, 0, 0, 0, 0, 2145, 12678, 29582, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 31727, 12710, 2113, 0, 0, 0, 2145, 16936, 2016, 2016, 2016, 2016, 21130, 4258, 0, 0, 0, 0, 0, 10597, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 33808, 14823, 4226, 0, 0, 0, 0, 4226, 25356, 2016, 2016, 29614, 6371, 0, 0, 0, 0, 2145, 10597, 27501, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 14791, 0, 0, 0, 0, 32, 6339, 10565, 12678, 8484, 2113, 0, 0, 0, 0, 10597, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 31727, 14791, 4226, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2145, 10597, 27501, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 16904, 2113, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12678, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 16904, 4258, 0, 0, 0, 0, 0, 0, 2145, 12678, 29582, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 16904, 2113, 0, 0, 0, 0, 0, 12678, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 16904, 4258, 0, 0, 2145, 12678, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 16904, 2113, 0, 12678, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31727, 19017, 16904, 27501, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
};
#endif

View File

@@ -1,46 +0,0 @@
#include "img_conf.h"
#include "lv_conf.h"
#if USE_IMG_RIGHT != 0 && LV_APP_USE_INTERNAL_ICONS == 2
#include <stdint.h>
#include "misc/others/color.h"
const color_int_t img_right [] = { /*Width = 19, Height = 30*/
19, /*Width*/
30, /*Heigth*/
16, /*Color depth = 16*/
1, /*Flags: Transp = 1*/
2016, 2016, 2016, 2016, 29582, 33808, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 21162, 10565, 14791, 27501, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 23243, 6371, 0, 32, 10565, 29582, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 23243, 6371, 0, 0, 0, 32, 12678, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
25356, 8452, 0, 0, 0, 0, 0, 32, 10597, 31695, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
21130, 2145, 0, 0, 0, 0, 0, 0, 2113, 14791, 31695, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 8452, 0, 0, 0, 0, 0, 0, 0, 2113, 10597, 29582, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 23275, 8452, 32, 0, 0, 0, 0, 0, 0, 32, 12678, 29582, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 31727, 8452, 0, 0, 0, 0, 0, 0, 0, 32, 10597, 29614, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 25356, 8452, 32, 0, 0, 0, 0, 0, 0, 32, 12710, 29614, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 31727, 8452, 0, 0, 0, 0, 0, 0, 0, 32, 10597, 29614, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 25356, 8452, 2113, 0, 0, 0, 0, 0, 0, 32, 12710, 29614, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 31727, 8452, 0, 0, 0, 0, 0, 0, 0, 32, 10597, 29614, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 23275, 8452, 32, 0, 0, 0, 0, 0, 0, 32, 12678, 29614,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 29614, 6371, 0, 0, 0, 0, 0, 0, 0, 0, 12678,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31727, 6371, 0, 0, 0, 0, 0, 0, 0, 0, 8484,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 29582, 10597, 2113, 0, 0, 0, 0, 0, 0, 0, 6339, 23243,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 14791, 32, 0, 0, 0, 0, 0, 0, 0, 6371, 21162, 2016,
2016, 2016, 2016, 2016, 2016, 29614, 12710, 4226, 0, 0, 0, 0, 0, 0, 0, 6371, 21162, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 12710, 0, 0, 0, 0, 0, 0, 0, 0, 8452, 23243, 2016, 2016, 2016,
2016, 2016, 2016, 29614, 12710, 2145, 0, 0, 0, 0, 0, 0, 0, 6371, 23243, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 12710, 0, 0, 0, 0, 0, 0, 0, 0, 8452, 23243, 2016, 2016, 2016, 2016, 2016,
2016, 29614, 12710, 2145, 0, 0, 0, 0, 0, 0, 0, 6371, 23243, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 12710, 0, 0, 0, 0, 0, 0, 0, 0, 6371, 23243, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
19017, 4226, 0, 0, 0, 0, 0, 0, 0, 4258, 21130, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
19049, 4258, 0, 0, 0, 0, 0, 0, 6371, 21130, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 16904, 2113, 0, 0, 0, 0, 6371, 23243, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 16904, 4258, 0, 0, 8452, 23243, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 16904, 4258, 8452, 21162, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 31727, 21162, 25388, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
};
#endif

View File

@@ -1,36 +0,0 @@
#include "img_conf.h"
#include "lv_conf.h"
#if USE_IMG_UP != 0 && LV_APP_USE_INTERNAL_ICONS == 2
#include <stdint.h>
#include "misc/others/color.h"
const color_int_t img_up [] = { /*Width = 29, Height = 20*/
29, /*Width*/
20, /*Heigth*/
16, /*Color depth = 16*/
1, /*Flags: Transp = 1*/
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31727, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 29614, 14791, 6371, 12678, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 12710, 0, 0, 0, 12710, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 29614, 12710, 2145, 0, 0, 0, 32, 10597, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 12710, 0, 0, 0, 0, 0, 0, 32, 12710, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 29614, 12710, 2145, 0, 0, 0, 0, 0, 0, 0, 32, 10597, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 12710, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 12710, 29614, 2016, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 29614, 12710, 2145, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 10597, 29614, 2016, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 2016, 2016, 12710, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 12678, 29614, 2016, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 31695, 12710, 4226, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 10597, 31695, 2016, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 14791, 32, 0, 0, 0, 0, 0, 0, 32, 4226, 8484, 8452, 2113, 0, 0, 0, 0, 0, 0, 2113, 14791, 31695, 2016, 2016, 2016,
2016, 2016, 29614, 12710, 4226, 0, 0, 0, 0, 0, 0, 32, 8452, 19049, 2016, 2016, 8484, 0, 0, 0, 0, 0, 0, 0, 2113, 10597, 29614, 2016, 2016,
2016, 2016, 12678, 0, 0, 0, 0, 0, 0, 0, 0, 6371, 23243, 2016, 2016, 2016, 25356, 8452, 32, 0, 0, 0, 0, 0, 0, 32, 12678, 29582, 2016,
29582, 12710, 2145, 0, 0, 0, 0, 0, 0, 0, 4258, 19049, 2016, 2016, 2016, 2016, 2016, 31695, 6371, 0, 0, 0, 0, 0, 0, 0, 32, 10597, 29582,
16936, 32, 0, 0, 0, 0, 0, 0, 0, 6371, 19049, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 23243, 6371, 32, 0, 0, 0, 0, 0, 0, 2113, 19049,
19049, 2145, 0, 0, 0, 0, 0, 0, 6339, 21162, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31727, 8452, 0, 0, 0, 0, 0, 0, 2145, 23243,
33808, 16904, 4258, 0, 0, 0, 0, 6371, 21162, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 25356, 8452, 32, 0, 0, 0, 2113, 12710, 2016,
2016, 2016, 16904, 2113, 0, 0, 6339, 21162, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 31727, 8452, 0, 0, 2113, 19017, 2016, 2016,
2016, 2016, 2016, 16904, 4258, 6371, 21162, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 23275, 8452, 4226, 12678, 2016, 2016, 2016,
2016, 2016, 2016, 2016, 23243, 23275, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 2016, 25388, 31695, 2016, 2016, 2016,
};
#endif

View File

@@ -1,259 +0,0 @@
/**
* @file anim.c
*
*/
/*********************
* INCLUDES
*********************/
#include <string.h>
#include "anim.h"
#include "misc/math/math_base.h"
#include "misc/os/ptask.h"
#include "hal/systick/systick.h"
/*********************
* DEFINES
*********************/
#define ANIM_PATH_LENGTH 129 /*Elements in a path array*/
#define ANIM_PATH_START 64 /*In path array a value which corresponds to the start position*/
#define ANIM_PATH_END 192 /* ... to the end position. Not required, just for clearance.*/
#define ANIM_PATH_NORM_SHIFT 7 /*ANIM_PATH_START - ANIM_PATH_END. Must be 2^N. The exponent goes here. */
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
static void anim_task (void * param);
static bool anim_ready_handler(anim_t * a);
/**********************
* STATIC VARIABLES
**********************/
static ll_dsc_t anim_ll;
static uint32_t last_task_run;
static bool anim_del_global_flag = false;
static anim_path_t anim_path_lin[] =
{64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192};
static anim_path_t anim_path_step[] =
{64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 192,};
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/**
* Init. the animation module
*/
void anim_init(void)
{
ll_init(&anim_ll, sizeof(anim_t));
last_task_run = systick_get();
ptask_create(anim_task, LV_REFR_PERIOD, PTASK_PRIO_MID, NULL);
}
/**
* Create an animation
* @param anim_p an initialized 'anim_t' variable. Not required after call.
*/
void anim_create(anim_t * anim_p)
{
/*Add the new animation to the animation linked list*/
anim_t * new_anim = ll_ins_head(&anim_ll);
dm_assert(new_anim);
/*Initialize the animation descriptor*/
anim_p->playback_now = 0;
memcpy(new_anim, anim_p, sizeof(anim_t));
/*Set the start value*/
if(new_anim->fp != NULL) new_anim->fp(new_anim->var, new_anim->start);
}
/**
* Delete an animation for a variable with a given animatior function
* @param var pointer to variable
* @param fp a function pointer which is animating 'var',
* or NULL to ignore it and delete all animation with 'var
* @return true: at least 1 animation is deleted, false: no animation is deleted
*/
bool anim_del(void * var, anim_fp_t fp)
{
bool del = false;
anim_t * a;
anim_t * a_next;
a = ll_get_head(&anim_ll);
while(a != NULL) {
/*'a' might be deleted, so get the next object while 'a' is valid*/
a_next = ll_get_next(&anim_ll, a);
if(a->var == var && (a->fp == fp || fp == NULL)) {
ll_rem(&anim_ll, a);
dm_free(a);
del = true;
anim_del_global_flag = true;
}
a = a_next;
}
return del;
}
/**
* Calculate the time of an animation with a given speed and the start and end values
* @param speed speed of animation in unit/sec
* @param start start value of the animation
* @param end end value of the animation
* @return the required time [ms] for the animation with the given parameters
*/
uint16_t anim_speed_to_time(uint16_t speed, int32_t start, int32_t end)
{
int32_t d = MATH_ABS((int32_t) start - end);
uint16_t time = (int32_t)((int32_t)(d * 1000) / speed);
if(time == 0) {
time++;
}
return time;
}
/**
* Get a predefine animation path
* @param name name of the path from 'anim_path_name_t'
* @return pointer to the path array
*/
anim_path_t * anim_get_path(anim_path_name_t name)
{
switch (name) {
case ANIM_PATH_LIN:
return anim_path_lin;
break;
case ANIM_PATH_STEP:
return anim_path_step;
break;
default:
return NULL;
break;
}
}
/**********************
* STATIC FUNCTIONS
**********************/
/**
* Periodically handle the animations.
* @param param unused
*/
static void anim_task (void * param)
{
uint32_t elaps;
elaps = systick_elaps(last_task_run);
anim_t * a;
anim_t * a_next;
a = ll_get_head(&anim_ll);
while(a != NULL) {
/*'a' might be deleted, so get the next object while 'a' is valid*/
a_next = ll_get_next(&anim_ll, a);
a->act_time += elaps;
if(a->act_time >= 0) {
if(a->act_time > a->time) a->act_time = a->time;
/* Get the index of the path array based on the elapsed time*/
uint8_t path_i;
if(a->time == a->act_time) {
path_i = ANIM_PATH_LENGTH - 1; /*Use the last value id the time fully elapsed*/
} else {
path_i = a->act_time * (ANIM_PATH_LENGTH - 1) / a->time;
}
/* Get the new value which will be proportional to the current element of 'path_p'
* and the 'start' and 'end' values*/
int32_t new_val;
new_val = (int32_t)(a->path[path_i] - ANIM_PATH_START) * (a->end - a->start);
new_val = new_val >> ANIM_PATH_NORM_SHIFT;
new_val += a->start;
if(a->fp != NULL) a->fp(a->var, new_val); /*Apply the calculated value*/
/*If the time is elapsed the animation is ready*/
if(a->act_time >= a->time) {
bool invalid;
invalid = anim_ready_handler(a);
if(invalid != false) {
a_next = ll_get_head(&anim_ll); /*a_next might be invalid if animation delete occurred*/
}
}
}
a = a_next;
}
last_task_run = systick_get();
}
/**
* Called when an animation is ready to do the necessary thinks
* e.g. repeat, play back, delete etc.
* @param a pointer to an animation descriptor
* @return true: animation delete occurred
* */
static bool anim_ready_handler(anim_t * a)
{
bool invalid = false;
/*Delete the animation if
* - no repeat and no play back (simple one shot animation)
* - no repeat, play back is enabled and play back is ready */
if((a->repeat == 0 && a->playback == 0) ||
(a->repeat == 0 && a->playback == 1 && a->playback_now == 1)) {
void (*cb) (void *) = a->end_cb;
void * p = a->var;
ll_rem(&anim_ll, a);
dm_free(a);
/*Call the callback function at the end*/
/* Check if an animation is deleted in the cb function
* if yes then the caller function has to know this*/
anim_del_global_flag = false;
if(cb != NULL) cb(p);
invalid = anim_del_global_flag;
}
/*If the animation is not deleted then restart it*/
else {
a->act_time = - a->repeat_pause; /*Restart the animation*/
/*Swap the start and end values in play back mode*/
if(a->playback != 0) {
/*If now turning back use the 'playback_pause*/
if(a->playback_now == 0) a->act_time = - a->playback_pause;
/*Toggle the play back state*/
a->playback_now = a->playback_now == 0 ? 1: 0;
/*Swap the start and end values*/
int32_t tmp;
tmp = a->start;
a->start = a->end;
a->end = tmp;
}
}
return invalid;
}

View File

@@ -1,95 +0,0 @@
/**
* @file anim.h
*
*/
#ifndef ANIM_H
#define ANIM_H
/*********************
* INCLUDES
*********************/
#include "lvgl/lvgl.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
typedef enum
{
ANIM_PATH_LIN,
ANIM_PATH_STEP,
}anim_path_name_t;
typedef uint8_t anim_path_t;
typedef void (*anim_fp_t)(void *, int32_t);
typedef void (*anim_cb_t)(void *);
typedef struct
{
void * var; /*Variable to animate*/
anim_fp_t fp; /*Animator function*/
anim_cb_t end_cb; /*Call it when the animation is ready*/
anim_path_t * path; /*An array with the steps of animations*/
int32_t start; /*Start value*/
int32_t end; /*End value*/
int16_t time; /*Animation time in ms*/
int16_t act_time; /*Current time in animation. Set to negative to make delay.*/
uint16_t playback_pause; /*Wait before play back*/
uint16_t repeat_pause; /*Wait before repeat*/
uint8_t playback :1; /*When the animation is ready play it back*/
uint8_t repeat :1; /*Repeat the animation infinitely*/
/*Animation system use these - user shouldn't set*/
uint8_t playback_now :1; /*Play back is in progress*/
}anim_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
/**
* Init. the animation module
*/
void anim_init(void);
/**
* Create an animation
* @param anim_p an initialized 'anim_t' variable. Not required after call.
*/
void anim_create(anim_t * anim_p);
/**
* Delete an animation for a variable with a given animatior function
* @param var pointer to variable
* @param fp a function pointer which is animating 'var',
* or NULL to ignore it and delete all animation with 'var
* @return true: at least 1 animation is deleted, false: no animation is deleted
*/
bool anim_del(void * var, anim_fp_t fp);
/**
* Calculate the time of an animation with a given speed and the start and end values
* @param speed speed of animation in unit/sec
* @param start start value of the animation
* @param end end value of the animation
* @return the required time [ms] for the animation with the given parameters
*/
uint16_t anim_speed_to_time(uint16_t speed, int32_t start, int32_t end);
/**
* Get a predefine animation path
* @param name name of the path from 'anim_path_name_t'
* @return pointer to the path array
*/
anim_path_t * anim_get_path(anim_path_name_t name);
/**********************
* MACROS
**********************/
#endif

View File

@@ -1,233 +0,0 @@
/**
* @file 2d.c
*
*/
/*********************
* INCLUDES
*********************/
#include <lvgl/lv_misc/area.h>
#include "misc/math/math_base.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
/**********************
* STATIC VARIABLES
**********************/
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/**
* Initialize an area
* @param area_p pointer to an area
* @param x1 left coordinate of the area
* @param y1 top coordinate of the area
* @param x2 right coordinate of the area
* @param y2 bottom coordinate of the area
*/
void area_set(area_t * area_p, cord_t x1, cord_t y1, cord_t x2, cord_t y2)
{
area_p->x1 = x1;
area_p->y1 = y1;
area_p->x2 = x2;
area_p->y2 = y2;
}
/**
* Set the width of an area
* @param area_p pointer to an area
* @param w the new width of the area (w == 1 makes x1 == x2)
*/
void area_set_width(area_t * area_p, cord_t w)
{
area_p->x2 = area_p->x1 + w - 1;
}
/**
* Set the height of an area
* @param area_p pointer to an area
* @param h the new height of the area (h == 1 makes y1 == y2)
*/
void area_set_height(area_t * area_p, cord_t h)
{
area_p->y2 = area_p->y1 + h - 1;
}
/**
* Set the position of an area (width and height will be kept)
* @param area_p pointer to an area
* @param x the new x coordinate of the area
* @param y the new y coordinate of the area
*/
void area_set_pos(area_t * area_p, cord_t x, cord_t y)
{
cord_t w = area_get_width(area_p);
cord_t h = area_get_height(area_p);
area_p->x1 = x;
area_p->y1 = y;
area_set_width(area_p, w);
area_set_height(area_p, h);
}
/**
* Return with area of an area (x * y)
* @param area_p pointer to an area
* @return size of area
*/
uint32_t area_get_size(const area_t * area_p)
{
uint32_t size;
size = (uint32_t)(area_p->x2 - area_p->x1 + 1) *
(area_p->y2 - area_p->y1 + 1);
return size;
}
/**
* Get the common parts of two areas
* @param res_p pointer to an area, the result will be stored her
* @param a1_p pointer to the first area
* @param a2_p pointer to the second area
* @return false: the two area has NO common parts, res_p is invalid
*/
bool area_union(area_t * res_p, const area_t * a1_p, const area_t * a2_p)
{
/* Get the smaller area from 'a1_p' and 'a2_p' */
res_p->x1 = MATH_MAX(a1_p->x1, a2_p->x1);
res_p->y1 = MATH_MAX(a1_p->y1, a2_p->y1);
res_p->x2 = MATH_MIN(a1_p->x2, a2_p->x2);
res_p->y2 = MATH_MIN(a1_p->y2, a2_p->y2);
/*If x1 or y1 greater then x2 or y2 then the areas union is empty*/
bool union_ok = true;
if((res_p->x1 > res_p->x2) ||
(res_p->y1 > res_p->y2))
{
union_ok = false;
}
return union_ok;
}
/**
* Join two areas into a third which involves the other two
* @param res_p pointer to an area, the result will be stored here
* @param a1_p pointer to the first area
* @param a2_p pointer to the second area
*/
void area_join(area_t * a_res_p, const area_t * a1_p, const area_t * a2_p)
{
a_res_p->x1 = MATH_MIN(a1_p->x1, a2_p->x1);
a_res_p->y1 = MATH_MIN(a1_p->y1, a2_p->y1);
a_res_p->x2 = MATH_MAX(a1_p->x2, a2_p->x2);
a_res_p->y2 = MATH_MAX(a1_p->y2, a2_p->y2);
}
/**
* Check if a point is on an area
* @param a_p pointer to an area
* @param p_p pointer to a point
* @return false:the point is out of the area
*/
bool area_is_point_on(const area_t * a_p, const point_t * p_p)
{
bool is_on = false;
if((p_p->x >= a_p->x1 && p_p->x <= a_p->x2) &&
((p_p->y >= a_p->y1 && p_p->y <= a_p->y2)))
{
is_on = true;
}
return is_on;
}
/**
* Check if two area has common parts
* @param a1_p pointer to an area.
* @param a2_p pointer to an other area
* @return false: a1_p and a2_p has no common parts
*/
bool area_is_on(const area_t * a1_p, const area_t * a2_p)
{
/*Two area are on each other if... */
point_t p;
/*a2 left-top corner is on a1*/
p.x = a2_p->x1;
p.y = a2_p->y1;
if(area_is_point_on(a1_p, &p)) return true;
/*a2 right-top corner is on a1*/
p.x = a2_p->x1;
p.y = a2_p->y1;
if(area_is_point_on(a1_p, &p)) return true;
/*a2 left-bottom corner is on a1*/
p.x = a2_p->x1;
p.y = a2_p->y2;
if(area_is_point_on(a1_p, &p)) return true;
/*a2 right-bottom corner is on a1*/
p.x = a2_p->x2;
p.y = a2_p->y2;
if(area_is_point_on(a1_p, &p)) return true;
/*a2 is horizontally bigger then a1 and covers it*/
if((a2_p->x1 <= a1_p->x1 && a2_p->x2 >= a1_p->x2) && /*a2 hor. cover a1?*/
((a2_p->y1 <= a1_p->y1 && a2_p->y1 >= a1_p->y2) || /*upper edge is on a1?*/
(a2_p->y2 <= a1_p->y1 && a2_p->y2 >= a1_p->y2) ||/* or lower edge is on a1?*/
(a2_p->y1 <= a1_p->y1 && a2_p->y2 >= a1_p->y2))) /*or a2 vert bigger then a1*/
return true;
/*a2 is vertically bigger then a1 and covers it*/
if((a2_p->y1 <= a1_p->y1 && a2_p->y2 >= a1_p->y2) && /*a2 vert. cover a1?*/
((a2_p->x1 <= a1_p->x1 && a2_p->x1 >= a1_p->x2) || /*left edge is on a1?*/
(a2_p->x2 <= a1_p->x1 && a2_p->x2 >= a1_p->x2) ||/* or right edge is on a1?*/
(a2_p->x1 <= a1_p->x1 && a2_p->x2 >= a1_p->x2))) /*or a2 hor. bigger then a1*/
return true;
/*Else no cover*/
return false;
}
/**
* Check if an area is fully on an other
* @param ain_p pointer to an area which could be on aholder_p
* @param aholder pointer to an area which could involve ain_p
* @return
*/
bool area_is_in(const area_t * ain_p, const area_t * aholder_p)
{
bool is_in = false;
if(ain_p->x1 >= aholder_p->x1 &&
ain_p->y1 >= aholder_p->y1 &&
ain_p->x2 <= aholder_p->x2 &&
ain_p->y2 <= aholder_p->y2)
{
is_in = true;
}
return is_in;
}
/**********************
* STATIC FUNCTIONS
**********************/

View File

@@ -1,158 +0,0 @@
/**
* @file area.h
*
*/
#ifndef AREA_H
#define AREA_H
/*********************
* INCLUDES
*********************/
#include "lv_conf.h"
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
typedef LV_CORD_TYPE cord_t;
typedef struct
{
cord_t x;
cord_t y;
}point_t;
typedef struct
{
cord_t x1;
cord_t y1;
cord_t x2;
cord_t y2;
}area_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
/**
* Initialize an area
* @param area_p pointer to an area
* @param x1 left coordinate of the area
* @param y1 top coordinate of the area
* @param x2 right coordinate of the area
* @param y2 bottom coordinate of the area
*/
void area_set(area_t * area_p, cord_t x1, cord_t y1, cord_t x2, cord_t y2);
/**
* Copy an area
* @param dest pointer to the destination area
* @param src pointer to the source area
*/
static void inline area_cpy(area_t * dest, const area_t * src)
{
memcpy(dest, src, sizeof(area_t));
}
/**
* Get the width of an area
* @param area_p pointer to an area
* @return the width of the area (if x1 == x2 -> width = 1)
*/
static inline cord_t area_get_width(const area_t * area_p)
{
return area_p->x2 - area_p->x1 + 1;
}
/**
* Get the height of an area
* @param area_p pointer to an area
* @return the height of the area (if y1 == y2 -> height = 1)
*/
static inline cord_t area_get_height(const area_t * area_p)
{
return area_p->y2 - area_p->y1 + 1;
}
/**
* Set the width of an area
* @param area_p pointer to an area
* @param w the new width of the area (w == 1 makes x1 == x2)
*/
void area_set_width(area_t * area_p, cord_t w);
/**
* Set the height of an area
* @param area_p pointer to an area
* @param h the new height of the area (h == 1 makes y1 == y2)
*/
void area_set_height(area_t * area_p, cord_t h);
/**
* Set the position of an area (width and height will be kept)
* @param area_p pointer to an area
* @param x the new x coordinate of the area
* @param y the new y coordinate of the area
*/
void area_set_pos(area_t * area_p, cord_t x, cord_t y);
/**
* Return with area of an area (x * y)
* @param area_p pointer to an area
* @return size of area
*/
uint32_t area_get_size(const area_t * area_p);
/**
* Get the common parts of two areas
* @param res_p pointer to an area, the result will be stored her
* @param a1_p pointer to the first area
* @param a2_p pointer to the second area
* @return false: the two area has NO common parts, res_p is invalid
*/
bool area_union(area_t * res_p, const area_t * a1_p, const area_t * a2_p);
/**
* Join two areas into a third which involves the other two
* @param res_p pointer to an area, the result will be stored here
* @param a1_p pointer to the first area
* @param a2_p pointer to the second area
*/
void area_join(area_t * a_res_p, const area_t * a1_p, const area_t * a2_p);
/**
* Check if a point is on an area
* @param a_p pointer to an area
* @param p_p pointer to a point
* @return false:the point is out of the area
*/
bool area_is_point_on(const area_t * a_p, const point_t * p_p);
/**
* Check if two area has common parts
* @param a1_p pointer to an area.
* @param a2_p pointer to an other area
* @return false: a1_p and a2_p has no common parts
*/
bool area_is_on(const area_t * a1_p, const area_t * a2_p);
/**
* Check if an area is fully on an other
* @param ain_p pointer to an area which could be on aholder_p
* @param aholder pointer to an area which could involve ain_p
* @return
*/
bool area_is_in(const area_t * ain_p, const area_t * aholder_p);
/**********************
* MACROS
**********************/
#endif

View File

@@ -1,79 +0,0 @@
/**
* @file circ.c
* Circle drawing algorithm (with Bresenham)
* Only a 1/8 circle is calculated. Use CIRC_OCT1_X, CIRC_OCT1_Y macros to get
* the other octets.
*/
/*********************
* INCLUDES
*********************/
#include <lvgl/lv_misc/area.h>
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
/**********************
* STATIC VARIABLES
**********************/
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/**
* Initialize the circle drawing
* @param c pointer to a point. The coordinates will be calculated here
* @param tmp point to a variable. It will store temporary data
* @param radius radius of the circle
*/
void circ_init(point_t * c, cord_t * tmp, cord_t radius)
{
c->x = radius;
c->y = 0;
*tmp = 1 - radius;
}
/**
* Test the circle drawing is ready or not
* @param c same as in circ_init
* @return true if the circle is not ready yet
*/
bool circ_cont(point_t * c)
{
return c->y <= c->x ? true : false;
}
/**
* Get the next point from the circle
* @param c same as in circ_init. The next point stored here.
* @param tmp same as in circ_init.
*/
void circ_next(point_t * c, cord_t * tmp)
{
c->y++;
if (*tmp <= 0) {
(*tmp) += 2 * c->y + 1; // Change in decision criterion for y -> y+1
} else {
c->x--;
(*tmp) += 2 * (c->y - c->x) + 1; // Change for y -> y+1, x -> x-1
}
}
/**********************
* STATIC FUNCTIONS
**********************/

View File

@@ -1,70 +0,0 @@
/**
* @file circ.h
*
*/
#ifndef CIRC_H
#define CIRC_H
/*********************
* INCLUDES
*********************/
#include <lvgl/lv_misc/area.h>
#include <stddef.h>
/*********************
* DEFINES
*********************/
#define CIRC_OCT1_X(p) (p.x)
#define CIRC_OCT1_Y(p) (p.y)
#define CIRC_OCT2_X(p) (p.y)
#define CIRC_OCT2_Y(p) (p.x)
#define CIRC_OCT3_X(p) (-p.y)
#define CIRC_OCT3_Y(p) (p.x)
#define CIRC_OCT4_X(p) (-p.x)
#define CIRC_OCT4_Y(p) (p.y)
#define CIRC_OCT5_X(p) (-p.x)
#define CIRC_OCT5_Y(p) (-p.y)
#define CIRC_OCT6_X(p) (-p.y)
#define CIRC_OCT6_Y(p) (-p.x)
#define CIRC_OCT7_X(p) (p.y)
#define CIRC_OCT7_Y(p) (-p.x)
#define CIRC_OCT8_X(p) (p.x)
#define CIRC_OCT8_Y(p) (-p.y)
/**********************
* TYPEDEFS
**********************/
/**********************
* GLOBAL PROTOTYPES
**********************/
/**
* Initialize the circle drawing
* @param c pointer to a point. The coordinates will be calculated here
* @param tmp point to a variable. It will store temporary data
* @param radius radius of the circle
*/
void circ_init(point_t * c, cord_t * tmp, cord_t radius);
/**
* Test the circle drawing is ready or not
* @param c same as in circ_init
* @return true if the circle is not ready yet
*/
bool circ_cont(point_t * c);
/**
* Get the next point from the circle
* @param c same as in circ_init. The next point stored here.
* @param tmp same as in circ_init.
*/
void circ_next(point_t * c, cord_t * tmp);
/**********************
* MACROS
**********************/
#endif

View File

@@ -1,163 +0,0 @@
/**
* @file font.c
*
*/
/*********************
* INCLUDES
*********************/
#include <lvgl/lv_misc/fonts/symbol_30.h>
#include <stddef.h>
#include "font.h"
#include "fonts/dejavu_8.h"
#include "fonts/dejavu_10.h"
#include "fonts/dejavu_14.h"
#include "fonts/dejavu_20.h"
#include "fonts/dejavu_30.h"
#include "fonts/dejavu_40.h"
#include "fonts/dejavu_60.h"
#include "fonts/dejavu_80.h"
#include "fonts/symbol_30.h"
#include "fonts/symbol_60.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
/**********************
* STATIC VARIABLES
**********************/
/**********************
* GLOBAL PROTOTYPES
**********************/
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/**
* Get the font from its id
* @param font_id: the id of a font (an element of font_types_t enum)
* @return pointer to a font descriptor
*/
const font_t * font_get(font_types_t font_id)
{
const font_t * font_p = NULL;
switch(font_id)
{
#if USE_FONT_DEJAVU_8 != 0
case FONT_DEJAVU_8:
font_p = dejavu_8_get_dsc();
break;
#endif
#if USE_FONT_DEJAVU_10 != 0
case FONT_DEJAVU_10:
font_p = dejavu_10_get_dsc();
break;
#endif
#if USE_FONT_DEJAVU_14 != 0
case FONT_DEJAVU_14:
font_p = dejavu_14_get_dsc();
break;
#endif
#if USE_FONT_DEJAVU_20 != 0
case FONT_DEJAVU_20:
font_p = dejavu_20_get_dsc();
break;
#endif
#if USE_FONT_DEJAVU_30 != 0
case FONT_DEJAVU_30:
font_p = dejavu_30_get_dsc();
break;
#endif
#if USE_FONT_DEJAVU_40 != 0
case FONT_DEJAVU_40:
font_p = dejavu_40_get_dsc();
break;
#endif
#if USE_FONT_DEJAVU_60 != 0
case FONT_DEJAVU_60:
font_p = dejavu_60_get_dsc();
break;
#endif
#if USE_FONT_DEJAVU_80 != 0
case FONT_DEJAVU_80:
font_p = dejavu_80_get_dsc();
break;
#endif
#if USE_FONT_SYMBOL_30 != 0
case FONT_SYMBOL_30:
font_p = symbol_30_get_dsc();
break;
#endif
#if USE_FONT_SYMBOL_60 != 0
case FONT_SYMBOL_60:
font_p = symbol_60_get_dsc();
break;
#endif
default:
font_p = NULL;
}
return font_p;
}
/**
* Return with the bitmap of a font.
* @param font_p pointer to a font
* @param letter a letter
* @return pointer to the bitmap of the letter
*/
const uint8_t * font_get_bitmap(const font_t * font_p, uint8_t letter)
{
if(letter < font_p->start_ascii || letter >= font_p->start_ascii + font_p->letter_cnt) return NULL;
uint32_t index = (letter - font_p->start_ascii) * font_p->height_row * font_p->width_byte;
return &font_p->bitmaps_a[index];
}
/**
* Get the width of a letter in a font
* @param font_p pointer to a font
* @param letter a letter
* @return the width of a letter
*/
uint8_t font_get_width(const font_t * font_p, uint8_t letter)
{
if(letter < font_p->start_ascii) return 0;
letter -= font_p->start_ascii;
uint8_t w = 0;
if(letter < font_p->letter_cnt) {
w = font_p->fixed_width != 0 ? font_p->fixed_width :
font_p->width_bit_a[letter];
}
return w;
}
/**********************
* STATIC FUNCTIONS
**********************/

View File

@@ -1,115 +0,0 @@
/**
* @file font.h
*
*/
#ifndef FONT_H
#define FONT_H
/*********************
* INCLUDES
*********************/
#include "lv_conf.h"
#include <stdint.h>
#include <stddef.h>
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
typedef enum
{
#if USE_FONT_DEJAVU_8 != 0
FONT_DEJAVU_8,
#endif
#if USE_FONT_DEJAVU_10 != 0
FONT_DEJAVU_10,
#endif
#if USE_FONT_DEJAVU_14 != 0
FONT_DEJAVU_14,
#endif
#if USE_FONT_DEJAVU_20 != 0
FONT_DEJAVU_20,
#endif
#if USE_FONT_DEJAVU_30 != 0
FONT_DEJAVU_30,
#endif
#if USE_FONT_DEJAVU_40 != 0
FONT_DEJAVU_40,
#endif
#if USE_FONT_DEJAVU_60 != 0
FONT_DEJAVU_60,
#endif
#if USE_FONT_DEJAVU_80 != 0
FONT_DEJAVU_80,
#endif
#if USE_FONT_SYMBOL_30 != 0
FONT_SYMBOL_30,
#endif
#if USE_FONT_SYMBOL_60 != 0
FONT_SYMBOL_60,
#endif
FONT_TYPE_NUM,
}font_types_t;
typedef struct
{
uint8_t letter_cnt;
uint8_t start_ascii;
uint8_t width_byte;
uint8_t height_row;
uint8_t fixed_width;
const uint8_t * width_bit_a;
const uint8_t * bitmaps_a;
}font_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
/**
* Get the font from its id
* @param font_id: the id of a font (an element of font_types_t enum)
* @return pointer to a font descriptor
*/
const font_t * font_get(font_types_t font_id);
/**
* Return with the bitmap of a font.
* @param font_p pointer to a font
* @param letter a letter
* @return pointer to the bitmap of the letter
*/
const uint8_t * font_get_bitmap(const font_t * font_p, uint8_t letter);
/**
* Get the height of a font
* @param font_p pointer to a font
* @return the height of a font
*/
static inline uint8_t font_get_height(const font_t * font_p)
{
return font_p->height_row;
}
/**
* Get the width of a letter in a font
* @param font_p pointer to a font
* @param letter a letter
* @return the width of a letter
*/
uint8_t font_get_width(const font_t * font_p, uint8_t letter);
/**********************
* MACROS
**********************/
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,18 +0,0 @@
#ifndef DEJAVU_10_H
#define DEJAVU_10_H
/*Use ISO8859-1 encoding in the IDE*/
#include "lv_conf.h"
#if USE_FONT_DEJAVU_10 != 0
#include <stdint.h>
#include "../font.h"
const font_t * dejavu_10_get_dsc(void);
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,18 +0,0 @@
#ifndef DEJAVU_14_H
#define DEJAVU_14_H
/*Use ISO8859-1 encoding in the IDE*/
#include "lv_conf.h"
#if USE_FONT_DEJAVU_14 != 0
#include <stdint.h>
#include "../font.h"
const font_t * dejavu_14_get_dsc(void);
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,18 +0,0 @@
#ifndef DEJAVU_20_H
#define DEJAVU_20_H
/*Use ISO8859-1 encoding in the IDE*/
#include "misc_conf.h"
#if USE_FONT_DEJAVU_20 != 0
#include <stdint.h>
#include "../font.h"
const font_t * dejavu_20_get_dsc(void);
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,18 +0,0 @@
#ifndef DEJAVU_30_H
#define DEJAVU_30_H
/*Use ISO8859-1 encoding in the IDE*/
#include "lv_conf.h"
#if USE_FONT_DEJAVU_30 != 0
#include <stdint.h>
#include "../font.h"
const font_t * dejavu_30_get_dsc(void);
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,18 +0,0 @@
#ifndef DEJAVU_40_H
#define DEJAVU_40_H
/*Use ISO8859-1 encoding in the IDE*/
#include "lv_conf.h"
#if USE_FONT_DEJAVU_40 != 0
#include <stdint.h>
#include "../font.h"
const font_t * dejavu_40_get_dsc(void);
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,18 +0,0 @@
#ifndef DEJAVU_60_H
#define DEJAVU_60_H
/*Use ISO8859-1 encoding in the IDE*/
#include "lv_conf.h"
#if USE_FONT_DEJAVU_60 != 0
#include <stdint.h>
#include "../font.h"
const font_t * dejavu_60_get_dsc(void);
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,18 +0,0 @@
#ifndef DEJAVU_8_H
#define DEJAVU_8_H
/*Use ISO8859-1 encoding in the IDE*/
#include "lv_conf.h"
#if USE_FONT_DEJAVU_8 != 0
#include <stdint.h>
#include "../font.h"
const font_t * dejavu_8_get_dsc(void);
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +0,0 @@
#ifndef DEJAVU_80_H
#define DEJAVU_80_H
/*Use ISO8859-1 encoding in the IDE*/
#include "lv_conf.h"
#if USE_FONT_DEJAVU_80 != 0
#include <stdint.h>
#include "../font.h"
const font_t * dejavu_80_get_dsc(void);
#endif
#endif

View File

@@ -1,867 +0,0 @@
#include "lv_conf.h"
#if USE_FONT_SYMBOL_30 != 0
#include <stdint.h>
#include "../font.h"
static const uint8_t symbol_30_bitmaps[3120] =
{
// ASCII: 97, char width: 30
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x03, 0xff, 0xff, 0x00, // ------OOOOOOOOOOOOOOOOOO------..
0x07, 0xff, 0xff, 0x80, // -----OOOOOOOOOOOOOOOOOOOO-----..
0x07, 0xff, 0xff, 0x80, // -----OOOOOOOOOOOOOOOOOOOO-----..
0x07, 0xff, 0xff, 0x80, // -----OOOOOOOOOOOOOOOOOOOO-----..
0x0f, 0xff, 0xff, 0xc0, // ----OOOOOOOOOOOOOOOOOOOOOO----..
0x0f, 0xff, 0xff, 0xc0, // ----OOOOOOOOOOOOOOOOOOOOOO----..
0x0f, 0xff, 0xff, 0xc0, // ----OOOOOOOOOOOOOOOOOOOOOO----..
0x1f, 0xff, 0xff, 0xe0, // ---OOOOOOOOOOOOOOOOOOOOOOOO---..
0x1f, 0xff, 0xff, 0xe0, // ---OOOOOOOOOOOOOOOOOOOOOOOO---..
0x3f, 0xff, 0xff, 0xf0, // --OOOOOOOOOOOOOOOOOOOOOOOOOO--..
0x3f, 0xff, 0xff, 0xf0, // --OOOOOOOOOOOOOOOOOOOOOOOOOO--..
0x3f, 0xff, 0xff, 0xf0, // --OOOOOOOOOOOOOOOOOOOOOOOOOO--..
0x7f, 0xff, 0xff, 0xf8, // -OOOOOOOOOOOOOOOOOOOOOOOOOOOO-..
0x7f, 0xff, 0xff, 0xf8, // -OOOOOOOOOOOOOOOOOOOOOOOOOOOO-..
0x7f, 0xff, 0xff, 0xf8, // -OOOOOOOOOOOOOOOOOOOOOOOOOOOO-..
0xff, 0xff, 0xff, 0xfc, // OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO..
0xff, 0xff, 0xff, 0xfc, // OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO..
0xff, 0xff, 0xff, 0xfc, // OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO..
0xe0, 0x00, 0x00, 0x1c, // OOO------------------------OOO..
0x60, 0x00, 0x00, 0x18, // -OO------------------------OO-..
0x60, 0x00, 0x03, 0x18, // -OO-------------------OO---OO-..
0x60, 0x00, 0x03, 0x18, // -OO-------------------OO---OO-..
0x70, 0x00, 0x00, 0x38, // -OOO----------------------OOO-..
0x30, 0x00, 0x00, 0x30, // --OO----------------------OO--..
0x3f, 0xff, 0xff, 0xf0, // --OOOOOOOOOOOOOOOOOOOOOOOOOO--..
0x3f, 0xff, 0xff, 0xf0, // --OOOOOOOOOOOOOOOOOOOOOOOOOO--..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
// ASCII: 98, char width: 26
0xff, 0xfe, 0x40, 0x00, // OOOOOOOOOOOOOOO--O--------......
0xff, 0xfe, 0x60, 0x00, // OOOOOOOOOOOOOOO--OO-------......
0xff, 0xfe, 0x70, 0x00, // OOOOOOOOOOOOOOO--OOO------......
0xff, 0xfe, 0x78, 0x00, // OOOOOOOOOOOOOOO--OOOO-----......
0xff, 0xfe, 0x7c, 0x00, // OOOOOOOOOOOOOOO--OOOOO----......
0xff, 0xfe, 0x7e, 0x00, // OOOOOOOOOOOOOOO--OOOOOO---......
0xff, 0xfe, 0x7f, 0x00, // OOOOOOOOOOOOOOO--OOOOOOO--......
0xff, 0xfe, 0x7f, 0x80, // OOOOOOOOOOOOOOO--OOOOOOOO-......
0xff, 0xfe, 0x00, 0x00, // OOOOOOOOOOOOOOO-----------......
0xff, 0xff, 0x00, 0x00, // OOOOOOOOOOOOOOOO----------......
0xff, 0xff, 0xff, 0xc0, // OOOOOOOOOOOOOOOOOOOOOOOOOO......
0xff, 0xff, 0xff, 0xc0, // OOOOOOOOOOOOOOOOOOOOOOOOOO......
0xfe, 0x00, 0x1f, 0xc0, // OOOOOOO------------OOOOOOO......
0xfe, 0x00, 0x1f, 0xc0, // OOOOOOO------------OOOOOOO......
0xfe, 0x00, 0x1f, 0xc0, // OOOOOOO------------OOOOOOO......
0xff, 0xff, 0xff, 0xc0, // OOOOOOOOOOOOOOOOOOOOOOOOOO......
0xff, 0xff, 0xff, 0xc0, // OOOOOOOOOOOOOOOOOOOOOOOOOO......
0xfe, 0x00, 0x1f, 0xc0, // OOOOOOO------------OOOOOOO......
0xfe, 0x00, 0x1f, 0xc0, // OOOOOOO------------OOOOOOO......
0xff, 0xff, 0xff, 0xc0, // OOOOOOOOOOOOOOOOOOOOOOOOOO......
0xff, 0xff, 0xff, 0xc0, // OOOOOOOOOOOOOOOOOOOOOOOOOO......
0xfe, 0x00, 0x1f, 0xc0, // OOOOOOO------------OOOOOOO......
0xfe, 0x00, 0x1f, 0xc0, // OOOOOOO------------OOOOOOO......
0xff, 0xff, 0xff, 0xc0, // OOOOOOOOOOOOOOOOOOOOOOOOOO......
0xff, 0xff, 0xff, 0xc0, // OOOOOOOOOOOOOOOOOOOOOOOOOO......
0xff, 0xff, 0xff, 0xc0, // OOOOOOOOOOOOOOOOOOOOOOOOOO......
0xff, 0xff, 0xff, 0xc0, // OOOOOOOOOOOOOOOOOOOOOOOOOO......
0xff, 0xff, 0xff, 0xc0, // OOOOOOOOOOOOOOOOOOOOOOOOOO......
0xff, 0xff, 0xff, 0xc0, // OOOOOOOOOOOOOOOOOOOOOOOOOO......
0xff, 0xff, 0xff, 0x80, // OOOOOOOOOOOOOOOOOOOOOOOOO-......
// ASCII: 99, char width: 32
0x00, 0x00, 0x00, 0x00, // --------------------------------
0x3f, 0xe0, 0x00, 0x00, // --OOOOOOOOO---------------------
0x7f, 0xf0, 0x00, 0x00, // -OOOOOOOOOOO--------------------
0xff, 0xf8, 0x00, 0x00, // OOOOOOOOOOOOO-------------------
0xff, 0xf8, 0x00, 0x00, // OOOOOOOOOOOOO-------------------
0xff, 0xff, 0xff, 0x00, // OOOOOOOOOOOOOOOOOOOOOOOO--------
0xff, 0xff, 0xff, 0x80, // OOOOOOOOOOOOOOOOOOOOOOOOO-------
0xff, 0xff, 0xff, 0x80, // OOOOOOOOOOOOOOOOOOOOOOOOO-------
0xff, 0xff, 0xff, 0xc0, // OOOOOOOOOOOOOOOOOOOOOOOOOO------
0xff, 0xff, 0xff, 0xc0, // OOOOOOOOOOOOOOOOOOOOOOOOOO------
0xff, 0xff, 0xff, 0xc0, // OOOOOOOOOOOOOOOOOOOOOOOOOO------
0xff, 0xff, 0xff, 0xc0, // OOOOOOOOOOOOOOOOOOOOOOOOOO------
0xff, 0x80, 0x00, 0x00, // OOOOOOOOO-----------------------
0xfe, 0x00, 0x00, 0x00, // OOOOOOO-------------------------
0xfc, 0x3f, 0xff, 0xff, // OOOOOO----OOOOOOOOOOOOOOOOOOOOOO
0xf8, 0xff, 0xff, 0xfe, // OOOOO---OOOOOOOOOOOOOOOOOOOOOOO-
0xf1, 0xff, 0xff, 0xfe, // OOOO---OOOOOOOOOOOOOOOOOOOOOOOO-
0xf3, 0xff, 0xff, 0xfc, // OOOO--OOOOOOOOOOOOOOOOOOOOOOOO--
0xe7, 0xff, 0xff, 0xf8, // OOO--OOOOOOOOOOOOOOOOOOOOOOOO---
0xcf, 0xff, 0xff, 0xf0, // OO--OOOOOOOOOOOOOOOOOOOOOOOO----
0x8f, 0xff, 0xff, 0xe0, // O---OOOOOOOOOOOOOOOOOOOOOOO-----
0x1f, 0xff, 0xff, 0xe0, // ---OOOOOOOOOOOOOOOOOOOOOOOO-----
0x3f, 0xff, 0xff, 0xc0, // --OOOOOOOOOOOOOOOOOOOOOOOO------
0x7f, 0xff, 0xff, 0x80, // -OOOOOOOOOOOOOOOOOOOOOOOO-------
0x7f, 0xff, 0xfe, 0x00, // -OOOOOOOOOOOOOOOOOOOOOO---------
0x00, 0x00, 0x00, 0x00, // --------------------------------
0x00, 0x00, 0x00, 0x00, // --------------------------------
0x00, 0x00, 0x00, 0x00, // --------------------------------
0x00, 0x00, 0x00, 0x00, // --------------------------------
0x00, 0x00, 0x00, 0x00, // --------------------------------
// ASCII: 100, char width: 24
0x00, 0x00, 0x00, 0x00, // ------------------------........
0x00, 0xff, 0x00, 0x00, // --------OOOOOOOO--------........
0x01, 0xff, 0x80, 0x00, // -------OOOOOOOOOO-------........
0x03, 0x81, 0x80, 0x00, // ------OOO------OO-------........
0x03, 0x01, 0xc0, 0x00, // ------OO-------OOO------........
0xff, 0xff, 0xff, 0x00, // OOOOOOOOOOOOOOOOOOOOOOOO........
0xff, 0xff, 0xff, 0x00, // OOOOOOOOOOOOOOOOOOOOOOOO........
0x30, 0x00, 0x1c, 0x00, // --OO---------------OOO--........
0x30, 0x00, 0x1c, 0x00, // --OO---------------OOO--........
0x30, 0x00, 0x1c, 0x00, // --OO---------------OOO--........
0x30, 0x00, 0x1c, 0x00, // --OO---------------OOO--........
0x33, 0x99, 0x9c, 0x00, // --OO--OOO--OO--OO--OOO--........
0x33, 0x99, 0x9c, 0x00, // --OO--OOO--OO--OO--OOO--........
0x33, 0x99, 0x9c, 0x00, // --OO--OOO--OO--OO--OOO--........
0x33, 0x99, 0x9c, 0x00, // --OO--OOO--OO--OO--OOO--........
0x33, 0x99, 0x9c, 0x00, // --OO--OOO--OO--OO--OOO--........
0x33, 0x99, 0x9c, 0x00, // --OO--OOO--OO--OO--OOO--........
0x33, 0x99, 0x9c, 0x00, // --OO--OOO--OO--OO--OOO--........
0x33, 0x99, 0x9c, 0x00, // --OO--OOO--OO--OO--OOO--........
0x33, 0x99, 0x9c, 0x00, // --OO--OOO--OO--OO--OOO--........
0x33, 0x99, 0x9c, 0x00, // --OO--OOO--OO--OO--OOO--........
0x33, 0x99, 0x9c, 0x00, // --OO--OOO--OO--OO--OOO--........
0x30, 0x00, 0x1c, 0x00, // --OO---------------OOO--........
0x30, 0x00, 0x1c, 0x00, // --OO---------------OOO--........
0x38, 0x00, 0x18, 0x00, // --OOO--------------OO---........
0x1f, 0xff, 0xf8, 0x00, // ---OOOOOOOOOOOOOOOOOO---........
0x1f, 0xff, 0xf0, 0x00, // ---OOOOOOOOOOOOOOOOO----........
0x00, 0x00, 0x00, 0x00, // ------------------------........
0x00, 0x00, 0x00, 0x00, // ------------------------........
0x00, 0x00, 0x00, 0x00, // ------------------------........
// ASCII: 101, char width: 26
0x00, 0x00, 0x00, 0x00, // --------------------------......
0xff, 0xff, 0xe0, 0x00, // OOOOOOOOOOOOOOOOOOO-------......
0xff, 0xff, 0xf0, 0x00, // OOOOOOOOOOOOOOOOOOOO------......
0xcf, 0xe1, 0xb8, 0x00, // OO--OOOOOOO----OO-OOO-----......
0xcf, 0xe1, 0x9c, 0x00, // OO--OOOOOOO----OO--OOO----......
0xcf, 0xe1, 0x8e, 0x00, // OO--OOOOOOO----OO---OOO---......
0xcf, 0xe1, 0x87, 0x00, // OO--OOOOOOO----OO----OOO--......
0xcf, 0xe1, 0x83, 0x80, // OO--OOOOOOO----OO-----OOO-......
0xcf, 0xe1, 0x81, 0xc0, // OO--OOOOOOO----OO------OOO......
0xcf, 0xe1, 0x81, 0xc0, // OO--OOOOOOO----OO------OOO......
0xcf, 0xff, 0x81, 0xc0, // OO--OOOOOOOOOOOOO------OOO......
0xc7, 0xff, 0x81, 0xc0, // OO---OOOOOOOOOOOO------OOO......
0xc0, 0x00, 0x01, 0xc0, // OO---------------------OOO......
0xc0, 0x00, 0x01, 0xc0, // OO---------------------OOO......
0xc0, 0x00, 0x01, 0xc0, // OO---------------------OOO......
0xc0, 0x00, 0x01, 0xc0, // OO---------------------OOO......
0xc7, 0xff, 0xf9, 0xc0, // OO---OOOOOOOOOOOOOOOO--OOO......
0xcf, 0xff, 0xfd, 0xc0, // OO--OOOOOOOOOOOOOOOOOO-OOO......
0xce, 0x00, 0x1d, 0xc0, // OO--OOO------------OOO-OOO......
0xce, 0x00, 0x1d, 0xc0, // OO--OOO------------OOO-OOO......
0xce, 0x00, 0x1d, 0xc0, // OO--OOO------------OOO-OOO......
0xce, 0x00, 0x1d, 0xc0, // OO--OOO------------OOO-OOO......
0xce, 0x00, 0x1d, 0xc0, // OO--OOO------------OOO-OOO......
0xce, 0x00, 0x1d, 0xc0, // OO--OOO------------OOO-OOO......
0xce, 0x00, 0x1d, 0xc0, // OO--OOO------------OOO-OOO......
0xff, 0xff, 0xff, 0xc0, // OOOOOOOOOOOOOOOOOOOOOOOOOO......
0xff, 0xff, 0xff, 0x80, // OOOOOOOOOOOOOOOOOOOOOOOOO-......
0x00, 0x00, 0x00, 0x00, // --------------------------......
0x00, 0x00, 0x00, 0x00, // --------------------------......
0x00, 0x00, 0x00, 0x00, // --------------------------......
// ASCII: 102, char width: 26
0x00, 0x00, 0x00, 0x00, // --------------------------......
0x00, 0x00, 0x38, 0x00, // ------------------OOO-----......
0x00, 0x00, 0x7c, 0x00, // -----------------OOOOO----......
0x00, 0x00, 0xfe, 0x00, // ----------------OOOOOOO---......
0x00, 0x01, 0xff, 0x00, // ---------------OOOOOOOOO--......
0x00, 0x00, 0xff, 0x80, // ----------------OOOOOOOOO-......
0x00, 0x06, 0x7f, 0x80, // -------------OO--OOOOOOOO-......
0x00, 0x0f, 0x3f, 0x80, // ------------OOOO--OOOOOOO-......
0x00, 0x1f, 0x9f, 0x80, // -----------OOOOOO--OOOOOO-......
0x00, 0x3f, 0xcf, 0x00, // ----------OOOOOOOO--OOOO--......
0x00, 0x7b, 0xe6, 0x00, // ---------OOOO-OOOOO--OO---......
0x00, 0xf7, 0xf0, 0x00, // --------OOOO-OOOOOOO------......
0x01, 0xef, 0xf8, 0x00, // -------OOOO-OOOOOOOOO-----......
0x03, 0xdf, 0xf0, 0x00, // ------OOOO-OOOOOOOOO------......
0x07, 0xbf, 0xe0, 0x00, // -----OOOO-OOOOOOOOO-------......
0x0f, 0x7f, 0xc0, 0x00, // ----OOOO-OOOOOOOOO--------......
0x1e, 0xff, 0x80, 0x00, // ---OOOO-OOOOOOOOO---------......
0x3d, 0xff, 0x00, 0x00, // --OOOO-OOOOOOOOO----------......
0x7b, 0xfe, 0x00, 0x00, // -OOOO-OOOOOOOOO-----------......
0xff, 0xfc, 0x00, 0x00, // OOOOOOOOOOOOOO------------......
0xe7, 0xf8, 0x00, 0x00, // OOO--OOOOOOOO-------------......
0xc3, 0xf0, 0x00, 0x00, // OO----OOOOOO--------------......
0xc1, 0xe0, 0x00, 0x00, // OO-----OOOO---------------......
0xf1, 0xc0, 0x00, 0x00, // OOOO---OOO----------------......
0xf1, 0xc0, 0x00, 0x00, // OOOO---OOO----------------......
0xff, 0x80, 0x00, 0x00, // OOOOOOOOO-----------------......
0xff, 0x00, 0x00, 0x00, // OOOOOOOO------------------......
0x00, 0x00, 0x00, 0x00, // --------------------------......
0x00, 0x00, 0x00, 0x00, // --------------------------......
0x00, 0x00, 0x00, 0x00, // --------------------------......
// ASCII: 103, char width: 30
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x03, 0xc0, // ----------------------OOOO----..
0x00, 0x00, 0x07, 0xe0, // ---------------------OOOOOO---..
0x00, 0x00, 0x0f, 0xf0, // --------------------OOOOOOOO--..
0x00, 0x00, 0x0f, 0xf0, // --------------------OOOOOOOO--..
0x00, 0x00, 0x1f, 0xf0, // -------------------OOOOOOOOO--..
0x00, 0x00, 0x3f, 0xe0, // ------------------OOOOOOOOO---..
0x06, 0x00, 0x7f, 0xc0, // -----OO----------OOOOOOOOO----..
0x0f, 0x00, 0xff, 0x80, // ----OOOO--------OOOOOOOOO-----..
0x1f, 0x81, 0xff, 0x00, // ---OOOOOO------OOOOOOOOO------..
0x3f, 0xc3, 0xfe, 0x00, // --OOOOOOOO----OOOOOOOOO-------..
0x3f, 0xe7, 0xfc, 0x00, // --OOOOOOOOO--OOOOOOOOO--------..
0x1f, 0xff, 0xf8, 0x00, // ---OOOOOOOOOOOOOOOOOO---------..
0x0f, 0xff, 0xf0, 0x00, // ----OOOOOOOOOOOOOOOO----------..
0x07, 0xff, 0xe0, 0x00, // -----OOOOOOOOOOOOOO-----------..
0x03, 0xff, 0xc0, 0x00, // ------OOOOOOOOOOOO------------..
0x01, 0xff, 0x80, 0x00, // -------OOOOOOOOOO-------------..
0x00, 0xff, 0x00, 0x00, // --------OOOOOOOO--------------..
0x00, 0x7e, 0x00, 0x00, // ---------OOOOOO---------------..
0x00, 0x3c, 0x00, 0x00, // ----------OOOO----------------..
0x00, 0x18, 0x00, 0x00, // -----------OO-----------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
// ASCII: 104, char width: 24
0x00, 0x00, 0x00, 0x00, // ------------------------........
0x00, 0x00, 0x00, 0x00, // ------------------------........
0x00, 0x00, 0x00, 0x00, // ------------------------........
0x00, 0x00, 0x00, 0x00, // ------------------------........
0x00, 0x00, 0x00, 0x00, // ------------------------........
0x0e, 0x00, 0x60, 0x00, // ----OOO----------OO-----........
0x0f, 0x00, 0xf0, 0x00, // ----OOOO--------OOOO----........
0x1f, 0x81, 0xf8, 0x00, // ---OOOOOO------OOOOOO---........
0x3f, 0xc3, 0xfc, 0x00, // --OOOOOOOO----OOOOOOOO--........
0x3f, 0xe7, 0xfc, 0x00, // --OOOOOOOOO--OOOOOOOOO--........
0x1f, 0xff, 0xf8, 0x00, // ---OOOOOOOOOOOOOOOOOO---........
0x0f, 0xff, 0xf0, 0x00, // ----OOOOOOOOOOOOOOOO----........
0x07, 0xff, 0xe0, 0x00, // -----OOOOOOOOOOOOOO-----........
0x03, 0xff, 0xc0, 0x00, // ------OOOOOOOOOOOO------........
0x01, 0xff, 0x80, 0x00, // -------OOOOOOOOOO-------........
0x01, 0xff, 0x80, 0x00, // -------OOOOOOOOOO-------........
0x03, 0xff, 0xc0, 0x00, // ------OOOOOOOOOOOO------........
0x07, 0xff, 0xe0, 0x00, // -----OOOOOOOOOOOOOO-----........
0x0f, 0xff, 0xf0, 0x00, // ----OOOOOOOOOOOOOOOO----........
0x1f, 0xff, 0xf8, 0x00, // ---OOOOOOOOOOOOOOOOOO---........
0x3f, 0xe7, 0xfc, 0x00, // --OOOOOOOOO--OOOOOOOOO--........
0x3f, 0xc3, 0xfc, 0x00, // --OOOOOOOO----OOOOOOOO--........
0x3f, 0x81, 0xf8, 0x00, // --OOOOOOO------OOOOOO---........
0x1f, 0x00, 0xf0, 0x00, // ---OOOOO--------OOOO----........
0x0e, 0x00, 0x60, 0x00, // ----OOO----------OO-----........
0x00, 0x00, 0x00, 0x00, // ------------------------........
0x00, 0x00, 0x00, 0x00, // ------------------------........
0x00, 0x00, 0x00, 0x00, // ------------------------........
0x00, 0x00, 0x00, 0x00, // ------------------------........
0x00, 0x00, 0x00, 0x00, // ------------------------........
// ASCII: 105, char width: 30
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x0c, 0x00, 0x00, 0xc0, // ----OO------------------OO----..
0x1e, 0x00, 0x01, 0xe0, // ---OOOO----------------OOOO---..
0x3f, 0x00, 0x03, 0xf0, // --OOOOOO--------------OOOOOO--..
0x3f, 0x80, 0x07, 0xf8, // --OOOOOOO------------OOOOOOOO-..
0x7f, 0xc0, 0x0f, 0xf0, // -OOOOOOOOO----------OOOOOOOO--..
0x3f, 0xe0, 0x1f, 0xf0, // --OOOOOOOOO--------OOOOOOOOO--..
0x1f, 0xf0, 0x3f, 0xe0, // ---OOOOOOOOO------OOOOOOOOO---..
0x0f, 0xf8, 0x7f, 0xc0, // ----OOOOOOOOO----OOOOOOOOO----..
0x07, 0xfc, 0xff, 0x80, // -----OOOOOOOOO--OOOOOOOOO-----..
0x03, 0xff, 0xff, 0x00, // ------OOOOOOOOOOOOOOOOOO------..
0x01, 0xff, 0xfe, 0x00, // -------OOOOOOOOOOOOOOOO-------..
0x00, 0xff, 0xfc, 0x00, // --------OOOOOOOOOOOOOO--------..
0x00, 0x7f, 0xf8, 0x00, // ---------OOOOOOOOOOOO---------..
0x00, 0x3f, 0xf0, 0x00, // ----------OOOOOOOOOO----------..
0x00, 0x1f, 0xe0, 0x00, // -----------OOOOOOOO-----------..
0x00, 0x0f, 0xc0, 0x00, // ------------OOOOOO------------..
0x00, 0x07, 0x80, 0x00, // -------------OOOO-------------..
0x00, 0x03, 0x00, 0x00, // --------------OO--------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
// ASCII: 106, char width: 21
0x00, 0x03, 0xc0, 0x00, // --------------OOOO---...........
0x00, 0x07, 0xe0, 0x00, // -------------OOOOOO--...........
0x00, 0x0f, 0xf0, 0x00, // ------------OOOOOOOO-...........
0x00, 0x1f, 0xf0, 0x00, // -----------OOOOOOOOO-...........
0x00, 0x3f, 0xe0, 0x00, // ----------OOOOOOOOO--...........
0x00, 0x7f, 0xc0, 0x00, // ---------OOOOOOOOO---...........
0x00, 0xff, 0x80, 0x00, // --------OOOOOOOOO----...........
0x01, 0xff, 0x00, 0x00, // -------OOOOOOOOO-----...........
0x03, 0xfe, 0x00, 0x00, // ------OOOOOOOOO------...........
0x07, 0xfc, 0x00, 0x00, // -----OOOOOOOOO-------...........
0x0f, 0xf8, 0x00, 0x00, // ----OOOOOOOOO--------...........
0x0f, 0xf0, 0x00, 0x00, // ----OOOOOOOO---------...........
0x1f, 0xe0, 0x00, 0x00, // ---OOOOOOOO----------...........
0x3f, 0xe0, 0x00, 0x00, // --OOOOOOOOO----------...........
0x0f, 0xf0, 0x00, 0x00, // ----OOOOOOOO---------...........
0x0f, 0xf8, 0x00, 0x00, // ----OOOOOOOOO--------...........
0x07, 0xfc, 0x00, 0x00, // -----OOOOOOOOO-------...........
0x03, 0xfe, 0x00, 0x00, // ------OOOOOOOOO------...........
0x01, 0xff, 0x00, 0x00, // -------OOOOOOOOO-----...........
0x00, 0xff, 0x80, 0x00, // --------OOOOOOOOO----...........
0x00, 0x7f, 0xc0, 0x00, // ---------OOOOOOOOO---...........
0x00, 0x3f, 0xe0, 0x00, // ----------OOOOOOOOO--...........
0x00, 0x1f, 0xf0, 0x00, // -----------OOOOOOOOO-...........
0x00, 0x0f, 0xf0, 0x00, // ------------OOOOOOOO-...........
0x00, 0x07, 0xe0, 0x00, // -------------OOOOOO--...........
0x00, 0x03, 0xc0, 0x00, // --------------OOOO---...........
0x00, 0x01, 0x80, 0x00, // ---------------OO----...........
0x00, 0x00, 0x00, 0x00, // ---------------------...........
0x00, 0x00, 0x00, 0x00, // ---------------------...........
0x00, 0x00, 0x00, 0x00, // ---------------------...........
// ASCII: 107, char width: 21
0x1e, 0x00, 0x00, 0x00, // ---OOOO--------------...........
0x3f, 0x00, 0x00, 0x00, // --OOOOOO-------------...........
0x3f, 0x80, 0x00, 0x00, // --OOOOOOO------------...........
0x7f, 0xc0, 0x00, 0x00, // -OOOOOOOOO-----------...........
0x3f, 0xe0, 0x00, 0x00, // --OOOOOOOOO----------...........
0x1f, 0xf0, 0x00, 0x00, // ---OOOOOOOOO---------...........
0x0f, 0xf8, 0x00, 0x00, // ----OOOOOOOOO--------...........
0x07, 0xfc, 0x00, 0x00, // -----OOOOOOOOO-------...........
0x03, 0xfe, 0x00, 0x00, // ------OOOOOOOOO------...........
0x01, 0xff, 0x00, 0x00, // -------OOOOOOOOO-----...........
0x00, 0xff, 0x80, 0x00, // --------OOOOOOOOO----...........
0x00, 0x7f, 0xc0, 0x00, // ---------OOOOOOOOO---...........
0x00, 0x3f, 0xe0, 0x00, // ----------OOOOOOOOO--...........
0x00, 0x3f, 0xe0, 0x00, // ----------OOOOOOOOO--...........
0x00, 0x7f, 0xc0, 0x00, // ---------OOOOOOOOO---...........
0x00, 0xff, 0x80, 0x00, // --------OOOOOOOOO----...........
0x01, 0xff, 0x00, 0x00, // -------OOOOOOOOO-----...........
0x03, 0xfe, 0x00, 0x00, // ------OOOOOOOOO------...........
0x07, 0xfc, 0x00, 0x00, // -----OOOOOOOOO-------...........
0x0f, 0xf8, 0x00, 0x00, // ----OOOOOOOOO--------...........
0x1f, 0xf0, 0x00, 0x00, // ---OOOOOOOOO---------...........
0x1f, 0xe0, 0x00, 0x00, // ---OOOOOOOO----------...........
0x3f, 0xc0, 0x00, 0x00, // --OOOOOOOO-----------...........
0x7f, 0x80, 0x00, 0x00, // -OOOOOOOO------------...........
0x3f, 0x00, 0x00, 0x00, // --OOOOOO-------------...........
0x1e, 0x00, 0x00, 0x00, // ---OOOO--------------...........
0x0c, 0x00, 0x00, 0x00, // ----OO---------------...........
0x00, 0x00, 0x00, 0x00, // ---------------------...........
0x00, 0x00, 0x00, 0x00, // ---------------------...........
0x00, 0x00, 0x00, 0x00, // ---------------------...........
// ASCII: 108, char width: 30
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x03, 0x00, 0x00, // --------------OO--------------..
0x00, 0x07, 0x80, 0x00, // -------------OOOO-------------..
0x00, 0x0f, 0xc0, 0x00, // ------------OOOOOO------------..
0x00, 0x1f, 0xe0, 0x00, // -----------OOOOOOOO-----------..
0x00, 0x3f, 0xf0, 0x00, // ----------OOOOOOOOOO----------..
0x00, 0x7f, 0xf8, 0x00, // ---------OOOOOOOOOOOO---------..
0x00, 0xff, 0xfc, 0x00, // --------OOOOOOOOOOOOOO--------..
0x01, 0xff, 0xfe, 0x00, // -------OOOOOOOOOOOOOOOO-------..
0x03, 0xff, 0xff, 0x00, // ------OOOOOOOOOOOOOOOOOO------..
0x07, 0xfc, 0xff, 0x80, // -----OOOOOOOOO--OOOOOOOOO-----..
0x0f, 0xf8, 0x7f, 0xc0, // ----OOOOOOOOO----OOOOOOOOO----..
0x1f, 0xf0, 0x3f, 0xe0, // ---OOOOOOOOO------OOOOOOOOO---..
0x3f, 0xe0, 0x1f, 0xf0, // --OOOOOOOOO--------OOOOOOOOO--..
0x3f, 0xc0, 0x0f, 0xf0, // --OOOOOOOO----------OOOOOOOO--..
0x7f, 0x80, 0x07, 0xf8, // -OOOOOOOO------------OOOOOOOO-..
0x3f, 0x00, 0x03, 0xf0, // --OOOOOO--------------OOOOOO--..
0x1e, 0x00, 0x01, 0xe0, // ---OOOO----------------OOOO---..
0x0c, 0x00, 0x00, 0xc0, // ----OO------------------OO----..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
// ASCII: 109, char width: 17
0x01, 0x80, 0x00, 0x00, // -------OO--------...............
0x01, 0xc0, 0x00, 0x00, // -------OOO-------...............
0x01, 0xe0, 0x00, 0x00, // -------OOOO------...............
0x01, 0xf0, 0x00, 0x00, // -------OOOOO-----...............
0x01, 0xf8, 0x00, 0x00, // -------OOOOOO----...............
0x01, 0xfc, 0x00, 0x00, // -------OOOOOOO---...............
0x21, 0xde, 0x00, 0x00, // --O----OOO-OOOO--...............
0x71, 0xcf, 0x00, 0x00, // -OOO---OOO--OOOO-...............
0x79, 0xcf, 0x80, 0x00, // -OOOO--OOO--OOOOO...............
0x3d, 0xde, 0x00, 0x00, // --OOOO-OOO-OOOO--...............
0x1f, 0xfc, 0x00, 0x00, // ---OOOOOOOOOOO---...............
0x0f, 0xf8, 0x00, 0x00, // ----OOOOOOOOO----...............
0x07, 0xf0, 0x00, 0x00, // -----OOOOOOO-----...............
0x03, 0xe0, 0x00, 0x00, // ------OOOOO------...............
0x01, 0xe0, 0x00, 0x00, // -------OOOO------...............
0x03, 0xf0, 0x00, 0x00, // ------OOOOOO-----...............
0x07, 0xf8, 0x00, 0x00, // -----OOOOOOOO----...............
0x0f, 0xfc, 0x00, 0x00, // ----OOOOOOOOOO---...............
0x1d, 0xde, 0x00, 0x00, // ---OOO-OOO-OOOO--...............
0x39, 0xcf, 0x00, 0x00, // --OOO--OOO--OOOO-...............
0x71, 0xc7, 0x80, 0x00, // -OOO---OOO---OOOO...............
0x71, 0xce, 0x00, 0x00, // -OOO---OOO--OOO--...............
0x01, 0xfc, 0x00, 0x00, // -------OOOOOOO---...............
0x01, 0xf8, 0x00, 0x00, // -------OOOOOO----...............
0x01, 0xf8, 0x00, 0x00, // -------OOOOOO----...............
0x01, 0xf0, 0x00, 0x00, // -------OOOOO-----...............
0x01, 0xe0, 0x00, 0x00, // -------OOOO------...............
0x01, 0xc0, 0x00, 0x00, // -------OOO-------...............
0x01, 0x80, 0x00, 0x00, // -------OO--------...............
0x00, 0x00, 0x00, 0x00, // -----------------...............
// ASCII: 110, char width: 17
0x0f, 0xe0, 0x00, 0x00, // ----OOOOOOO------...............
0x1c, 0x70, 0x00, 0x00, // ---OOO---OOO-----...............
0x38, 0x38, 0x00, 0x00, // --OOO-----OOO----...............
0x38, 0x18, 0x00, 0x00, // --OOO------OO----...............
0x30, 0x1b, 0x80, 0x00, // --OO-------OO-OOO...............
0x30, 0x1b, 0x80, 0x00, // --OO-------OO-OOO...............
0x30, 0x18, 0x00, 0x00, // --OO-------OO----...............
0x30, 0x18, 0x00, 0x00, // --OO-------OO----...............
0x33, 0x9b, 0x80, 0x00, // --OO--OOO--OO-OOO...............
0x33, 0x9b, 0x80, 0x00, // --OO--OOO--OO-OOO...............
0x33, 0x98, 0x00, 0x00, // --OO--OOO--OO----...............
0x33, 0x98, 0x00, 0x00, // --OO--OOO--OO----...............
0x33, 0x98, 0x00, 0x00, // --OO--OOO--OO----...............
0x33, 0x9b, 0x80, 0x00, // --OO--OOO--OO-OOO...............
0x33, 0x9b, 0x80, 0x00, // --OO--OOO--OO-OOO...............
0x33, 0x98, 0x00, 0x00, // --OO--OOO--OO----...............
0x33, 0x98, 0x00, 0x00, // --OO--OOO--OO----...............
0x33, 0x98, 0x00, 0x00, // --OO--OOO--OO----...............
0x73, 0x9c, 0x00, 0x00, // -OOO--OOO--OOO---...............
0x63, 0x8c, 0x00, 0x00, // -OO---OOO---OO---...............
0xe7, 0xce, 0x00, 0x00, // OOO--OOOOO--OOO--...............
0xcf, 0xe6, 0x00, 0x00, // OO--OOOOOOO--OO--...............
0xcf, 0xe6, 0x00, 0x00, // OO--OOOOOOO--OO--...............
0xcf, 0xe6, 0x00, 0x00, // OO--OOOOOOO--OO--...............
0xe7, 0xce, 0x00, 0x00, // OOO--OOOOO--OOO--...............
0xe3, 0x8c, 0x00, 0x00, // OOO---OOO---OO---...............
0x70, 0x1c, 0x00, 0x00, // -OOO-------OOO---...............
0x38, 0x38, 0x00, 0x00, // --OOO-----OOO----...............
0x1f, 0xf0, 0x00, 0x00, // ---OOOOOOOOO-----...............
0x07, 0xc0, 0x00, 0x00, // -----OOOOO-------...............
// ASCII: 111, char width: 24
0x00, 0x00, 0x00, 0x00, // ------------------------........
0x00, 0x00, 0x00, 0x00, // ------------------------........
0x00, 0x00, 0x00, 0x00, // ------------------------........
0x00, 0x00, 0x06, 0x00, // ---------------------OO-........
0x00, 0x00, 0x1f, 0x00, // -------------------OOOOO........
0x00, 0x00, 0x7e, 0x00, // -----------------OOOOOO-........
0x00, 0x01, 0xfe, 0x00, // ---------------OOOOOOOO-........
0x00, 0x07, 0xfc, 0x00, // -------------OOOOOOOOO--........
0x00, 0x1f, 0xfc, 0x00, // -----------OOOOOOOOOOO--........
0x00, 0x7f, 0xf8, 0x00, // ---------OOOOOOOOOOOO---........
0x01, 0xff, 0xf8, 0x00, // -------OOOOOOOOOOOOOO---........
0x07, 0xff, 0xf0, 0x00, // -----OOOOOOOOOOOOOOO----........
0x1f, 0xff, 0xf0, 0x00, // ---OOOOOOOOOOOOOOOOO----........
0x7f, 0xff, 0xe0, 0x00, // -OOOOOOOOOOOOOOOOOO-----........
0xff, 0xff, 0xe0, 0x00, // OOOOOOOOOOOOOOOOOOO-----........
0xff, 0xff, 0xc0, 0x00, // OOOOOOOOOOOOOOOOOO------........
0x00, 0x1f, 0xc0, 0x00, // -----------OOOOOOO------........
0x00, 0x1f, 0x80, 0x00, // -----------OOOOOO-------........
0x00, 0x1f, 0x80, 0x00, // -----------OOOOOO-------........
0x00, 0x1f, 0x00, 0x00, // -----------OOOOO--------........
0x00, 0x1f, 0x00, 0x00, // -----------OOOOO--------........
0x00, 0x1e, 0x00, 0x00, // -----------OOOO---------........
0x00, 0x1e, 0x00, 0x00, // -----------OOOO---------........
0x00, 0x1c, 0x00, 0x00, // -----------OOO----------........
0x00, 0x1c, 0x00, 0x00, // -----------OOO----------........
0x00, 0x18, 0x00, 0x00, // -----------OO-----------........
0x00, 0x18, 0x00, 0x00, // -----------OO-----------........
0x00, 0x00, 0x00, 0x00, // ------------------------........
0x00, 0x00, 0x00, 0x00, // ------------------------........
0x00, 0x00, 0x00, 0x00, // ------------------------........
// ASCII: 112, char width: 30
0x00, 0x07, 0x80, 0x00, // -------------OOOO-------------..
0x00, 0x0f, 0xc0, 0x00, // ------------OOOOOO------------..
0x00, 0x0f, 0xc0, 0x00, // ------------OOOOOO------------..
0x00, 0x1f, 0xe0, 0x00, // -----------OOOOOOOO-----------..
0x00, 0x1f, 0xe0, 0x00, // -----------OOOOOOOO-----------..
0x00, 0x3f, 0xf0, 0x00, // ----------OOOOOOOOOO----------..
0x00, 0x3f, 0xf0, 0x00, // ----------OOOOOOOOOO----------..
0x00, 0x7f, 0xf8, 0x00, // ---------OOOOOOOOOOOO---------..
0x00, 0xf8, 0x7c, 0x00, // --------OOOOO----OOOOO--------..
0x00, 0xf8, 0x7c, 0x00, // --------OOOOO----OOOOO--------..
0x01, 0xf8, 0x7e, 0x00, // -------OOOOOO----OOOOOO-------..
0x01, 0xf8, 0x7e, 0x00, // -------OOOOOO----OOOOOO-------..
0x03, 0xf8, 0x7f, 0x00, // ------OOOOOOO----OOOOOOO------..
0x03, 0xf8, 0x7f, 0x00, // ------OOOOOOO----OOOOOOO------..
0x07, 0xf8, 0x7f, 0x80, // -----OOOOOOOO----OOOOOOOO-----..
0x07, 0xf8, 0x7f, 0x80, // -----OOOOOOOO----OOOOOOOO-----..
0x0f, 0xff, 0xff, 0xc0, // ----OOOOOOOOOOOOOOOOOOOOOO----..
0x0f, 0xff, 0xff, 0xc0, // ----OOOOOOOOOOOOOOOOOOOOOO----..
0x1f, 0xf8, 0x7f, 0xe0, // ---OOOOOOOOOO----OOOOOOOOOO---..
0x1f, 0xf8, 0x7f, 0xe0, // ---OOOOOOOOOO----OOOOOOOOOO---..
0x3f, 0xf8, 0x7f, 0xf0, // --OOOOOOOOOOO----OOOOOOOOOOO--..
0x7f, 0xf8, 0x7f, 0xf8, // -OOOOOOOOOOOO----OOOOOOOOOOOO-..
0x7f, 0xf8, 0x7f, 0xf8, // -OOOOOOOOOOOO----OOOOOOOOOOOO-..
0xff, 0xff, 0xff, 0xfc, // OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO..
0xff, 0xff, 0xff, 0xfc, // OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO..
0xff, 0xff, 0xff, 0xfc, // OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO..
0x7f, 0xff, 0xff, 0xf8, // -OOOOOOOOOOOOOOOOOOOOOOOOOOOO-..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
// ASCII: 113, char width: 24
0x00, 0x00, 0x00, 0x00, // ------------------------........
0x00, 0x00, 0x00, 0x00, // ------------------------........
0x00, 0x7f, 0x00, 0x00, // ---------OOOOOOO--------........
0x03, 0xff, 0xc0, 0x00, // ------OOOOOOOOOOOO------........
0x07, 0xff, 0xf0, 0x00, // -----OOOOOOOOOOOOOOO----........
0x0f, 0xff, 0xf8, 0x00, // ----OOOOOOOOOOOOOOOOO---........
0x1f, 0xe3, 0xfc, 0x00, // ---OOOOOOOO---OOOOOOOO--........
0x3f, 0xc3, 0xfc, 0x00, // --OOOOOOOO----OOOOOOOO--........
0x7f, 0xc3, 0xfe, 0x00, // -OOOOOOOOO----OOOOOOOOO-........
0x7f, 0xe3, 0xfe, 0x00, // -OOOOOOOOOO---OOOOOOOOO-........
0x7f, 0xff, 0xff, 0x00, // -OOOOOOOOOOOOOOOOOOOOOOO........
0xff, 0xff, 0xff, 0x00, // OOOOOOOOOOOOOOOOOOOOOOOO........
0xff, 0xe3, 0xff, 0x00, // OOOOOOOOOOO---OOOOOOOOOO........
0xff, 0xe3, 0xff, 0x00, // OOOOOOOOOOO---OOOOOOOOOO........
0xff, 0xe3, 0xff, 0x00, // OOOOOOOOOOO---OOOOOOOOOO........
0xff, 0xe3, 0xff, 0x00, // OOOOOOOOOOO---OOOOOOOOOO........
0xff, 0xe3, 0xff, 0x00, // OOOOOOOOOOO---OOOOOOOOOO........
0xff, 0xe3, 0xff, 0x00, // OOOOOOOOOOO---OOOOOOOOOO........
0x7f, 0xe3, 0xff, 0x00, // -OOOOOOOOOO---OOOOOOOOOO........
0x7f, 0xe3, 0xfe, 0x00, // -OOOOOOOOOO---OOOOOOOOO-........
0x7f, 0xe3, 0xfe, 0x00, // -OOOOOOOOOO---OOOOOOOOO-........
0x3f, 0xe3, 0xfc, 0x00, // --OOOOOOOOO---OOOOOOOO--........
0x1f, 0xe3, 0xfc, 0x00, // ---OOOOOOOO---OOOOOOOO--........
0x0f, 0xff, 0xf8, 0x00, // ----OOOOOOOOOOOOOOOOO---........
0x07, 0xff, 0xf0, 0x00, // -----OOOOOOOOOOOOOOO----........
0x03, 0xff, 0xc0, 0x00, // ------OOOOOOOOOOOO------........
0x00, 0x7f, 0x00, 0x00, // ---------OOOOOOO--------........
0x00, 0x00, 0x00, 0x00, // ------------------------........
0x00, 0x00, 0x00, 0x00, // ------------------------........
0x00, 0x00, 0x00, 0x00, // ------------------------........
// ASCII: 114, char width: 30
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x3f, 0xff, 0xff, 0x00, // --OOOOOOOOOOOOOOOOOOOOOO------..
0x7f, 0xff, 0xff, 0xc0, // -OOOOOOOOOOOOOOOOOOOOOOOOO----..
0xff, 0xff, 0xff, 0xc0, // OOOOOOOOOOOOOOOOOOOOOOOOOO----..
0xf0, 0x00, 0x01, 0xe0, // OOOO-------------------OOOO---..
0xe6, 0x00, 0x01, 0xf0, // OOO--OO----------------OOOOO--..
0xe7, 0x00, 0x01, 0xf8, // OOO--OOO---------------OOOOOO-..
0xe7, 0x00, 0x01, 0xfc, // OOO--OOO---------------OOOOOOO..
0xe7, 0x00, 0x01, 0xfc, // OOO--OOO---------------OOOOOOO..
0xe7, 0x00, 0x01, 0xfc, // OOO--OOO---------------OOOOOOO..
0xe7, 0x00, 0x01, 0xfc, // OOO--OOO---------------OOOOOOO..
0xe7, 0x00, 0x01, 0xfc, // OOO--OOO---------------OOOOOOO..
0xe7, 0x00, 0x01, 0xfc, // OOO--OOO---------------OOOOOOO..
0xe7, 0x00, 0x01, 0xf8, // OOO--OOO---------------OOOOOO-..
0xe6, 0x00, 0x01, 0xf0, // OOO--OO----------------OOOOO--..
0xe0, 0x00, 0x01, 0xe0, // OOO--------------------OOOO---..
0xf0, 0x00, 0x01, 0xc0, // OOOO-------------------OOO----..
0xff, 0xff, 0xff, 0xc0, // OOOOOOOOOOOOOOOOOOOOOOOOOO----..
0x7f, 0xff, 0xff, 0x80, // -OOOOOOOOOOOOOOOOOOOOOOOO-----..
0x3f, 0xff, 0xff, 0x00, // --OOOOOOOOOOOOOOOOOOOOOO------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
// ASCII: 115, char width: 30
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x3f, 0xff, 0xff, 0x00, // --OOOOOOOOOOOOOOOOOOOOOO------..
0x7f, 0xff, 0xff, 0xc0, // -OOOOOOOOOOOOOOOOOOOOOOOOO----..
0xff, 0xff, 0xff, 0xc0, // OOOOOOOOOOOOOOOOOOOOOOOOOO----..
0xf0, 0x00, 0x01, 0xe0, // OOOO-------------------OOOO---..
0xe6, 0x30, 0x01, 0xf0, // OOO--OO---OO-----------OOOOO--..
0xe7, 0x78, 0x01, 0xf8, // OOO--OOO-OOOO----------OOOOOO-..
0xe7, 0x78, 0x01, 0xfc, // OOO--OOO-OOOO----------OOOOOOO..
0xe7, 0x78, 0x01, 0xfc, // OOO--OOO-OOOO----------OOOOOOO..
0xe7, 0x78, 0x01, 0xfc, // OOO--OOO-OOOO----------OOOOOOO..
0xe7, 0x78, 0x01, 0xfc, // OOO--OOO-OOOO----------OOOOOOO..
0xe7, 0x78, 0x01, 0xfc, // OOO--OOO-OOOO----------OOOOOOO..
0xe7, 0x78, 0x01, 0xfc, // OOO--OOO-OOOO----------OOOOOOO..
0xe7, 0x78, 0x01, 0xf8, // OOO--OOO-OOOO----------OOOOOO-..
0xe6, 0x30, 0x01, 0xf0, // OOO--OO---OO-----------OOOOO--..
0xe0, 0x00, 0x01, 0xe0, // OOO--------------------OOOO---..
0xf0, 0x00, 0x01, 0xc0, // OOOO-------------------OOO----..
0xff, 0xff, 0xff, 0xc0, // OOOOOOOOOOOOOOOOOOOOOOOOOO----..
0x7f, 0xff, 0xff, 0x80, // -OOOOOOOOOOOOOOOOOOOOOOOO-----..
0x3f, 0xff, 0xff, 0x00, // --OOOOOOOOOOOOOOOOOOOOOO------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
// ASCII: 116, char width: 30
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x3f, 0xff, 0xff, 0x00, // --OOOOOOOOOOOOOOOOOOOOOO------..
0x7f, 0xff, 0xff, 0xc0, // -OOOOOOOOOOOOOOOOOOOOOOOOO----..
0xff, 0xff, 0xff, 0xc0, // OOOOOOOOOOOOOOOOOOOOOOOOOO----..
0xf0, 0x00, 0x01, 0xe0, // OOOO-------------------OOOO---..
0xe6, 0x33, 0x81, 0xf0, // OOO--OO---OO--OOO------OOOOO--..
0xe7, 0x7b, 0x81, 0xf8, // OOO--OOO-OOOO-OOO------OOOOOO-..
0xe7, 0x7b, 0x81, 0xfc, // OOO--OOO-OOOO-OOO------OOOOOOO..
0xe7, 0x7b, 0x81, 0xfc, // OOO--OOO-OOOO-OOO------OOOOOOO..
0xe7, 0x7b, 0x81, 0xfc, // OOO--OOO-OOOO-OOO------OOOOOOO..
0xe7, 0x7b, 0x81, 0xfc, // OOO--OOO-OOOO-OOO------OOOOOOO..
0xe7, 0x7b, 0x81, 0xfc, // OOO--OOO-OOOO-OOO------OOOOOOO..
0xe7, 0x7b, 0x81, 0xfc, // OOO--OOO-OOOO-OOO------OOOOOOO..
0xe7, 0x7b, 0x81, 0xf8, // OOO--OOO-OOOO-OOO------OOOOOO-..
0xe6, 0x33, 0x81, 0xf0, // OOO--OO---OO--OOO------OOOOO--..
0xe0, 0x00, 0x01, 0xe0, // OOO--------------------OOOO---..
0xf0, 0x00, 0x01, 0xc0, // OOOO-------------------OOO----..
0xff, 0xff, 0xff, 0xc0, // OOOOOOOOOOOOOOOOOOOOOOOOOO----..
0x7f, 0xff, 0xff, 0x80, // -OOOOOOOOOOOOOOOOOOOOOOOO-----..
0x3f, 0xff, 0xff, 0x00, // --OOOOOOOOOOOOOOOOOOOOOO------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
// ASCII: 117, char width: 30
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x3f, 0xff, 0xff, 0x00, // --OOOOOOOOOOOOOOOOOOOOOO------..
0x7f, 0xff, 0xff, 0xc0, // -OOOOOOOOOOOOOOOOOOOOOOOOO----..
0xff, 0xff, 0xff, 0xc0, // OOOOOOOOOOOOOOOOOOOOOOOOOO----..
0xf0, 0x00, 0x01, 0xe0, // OOOO-------------------OOOO---..
0xe6, 0x33, 0x9d, 0xf0, // OOO--OO---OO--OOO--OOO-OOOOO--..
0xe7, 0x7b, 0x9d, 0xf8, // OOO--OOO-OOOO-OOO--OOO-OOOOOO-..
0xe7, 0x7b, 0x9d, 0xfc, // OOO--OOO-OOOO-OOO--OOO-OOOOOOO..
0xe7, 0x7b, 0x9d, 0xfc, // OOO--OOO-OOOO-OOO--OOO-OOOOOOO..
0xe7, 0x7b, 0x9d, 0xfc, // OOO--OOO-OOOO-OOO--OOO-OOOOOOO..
0xe7, 0x7b, 0x9d, 0xfc, // OOO--OOO-OOOO-OOO--OOO-OOOOOOO..
0xe7, 0x7b, 0x9d, 0xfc, // OOO--OOO-OOOO-OOO--OOO-OOOOOOO..
0xe7, 0x7b, 0x9d, 0xfc, // OOO--OOO-OOOO-OOO--OOO-OOOOOOO..
0xe7, 0x7b, 0x9d, 0xf8, // OOO--OOO-OOOO-OOO--OOO-OOOOOO-..
0xe6, 0x33, 0x99, 0xf0, // OOO--OO---OO--OOO--OO--OOOOO--..
0xe0, 0x00, 0x01, 0xe0, // OOO--------------------OOOO---..
0xf0, 0x00, 0x01, 0xc0, // OOOO-------------------OOO----..
0xff, 0xff, 0xff, 0xc0, // OOOOOOOOOOOOOOOOOOOOOOOOOO----..
0x7f, 0xff, 0xff, 0x80, // -OOOOOOOOOOOOOOOOOOOOOOOO-----..
0x3f, 0xff, 0xff, 0x00, // --OOOOOOOOOOOOOOOOOOOOOO------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
// ASCII: 118, char width: 30
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x3f, 0xff, 0xff, 0x00, // --OOOOOOOOOOOOOOOOOOOOOO------..
0x7f, 0xff, 0xff, 0xc0, // -OOOOOOOOOOOOOOOOOOOOOOOOO----..
0xff, 0xff, 0xff, 0xc0, // OOOOOOOOOOOOOOOOOOOOOOOOOO----..
0xf0, 0x00, 0x01, 0xe0, // OOOO-------------------OOOO---..
0xe7, 0xff, 0xfd, 0xf0, // OOO--OOOOOOOOOOOOOOOOO-OOOOO--..
0xe7, 0xff, 0xfd, 0xf8, // OOO--OOOOOOOOOOOOOOOOO-OOOOOO-..
0xe7, 0xf7, 0xfd, 0xfc, // OOO--OOOOOOO-OOOOOOOOO-OOOOOOO..
0xe7, 0xe3, 0xfd, 0xfc, // OOO--OOOOOO---OOOOOOOO-OOOOOOO..
0xe7, 0xc3, 0xfd, 0xfc, // OOO--OOOOO----OOOOOOOO-OOOOOOO..
0xe7, 0x70, 0x7d, 0xfc, // OOO--OOO-OOO-----OOOOO-OOOOOOO..
0xe7, 0xf8, 0xfd, 0xfc, // OOO--OOOOOOOO---OOOOOO-OOOOOOO..
0xe7, 0xff, 0xfd, 0xfc, // OOO--OOOOOOOOOOOOOOOOO-OOOOOOO..
0xe7, 0xff, 0xfd, 0xf8, // OOO--OOOOOOOOOOOOOOOOO-OOOOOO-..
0xe7, 0xff, 0xfd, 0xf0, // OOO--OOOOOOOOOOOOOOOOO-OOOOO--..
0xe0, 0x00, 0x01, 0xe0, // OOO--------------------OOOO---..
0xf0, 0x00, 0x01, 0xc0, // OOOO-------------------OOO----..
0xff, 0xff, 0xff, 0xc0, // OOOOOOOOOOOOOOOOOOOOOOOOOO----..
0x7f, 0xff, 0xff, 0x80, // -OOOOOOOOOOOOOOOOOOOOOOOO-----..
0x3f, 0xff, 0xff, 0x00, // --OOOOOOOOOOOOOOOOOOOOOO------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
0x00, 0x00, 0x00, 0x00, // ------------------------------..
// ASCII: 119, char width: 30
0x00, 0x7f, 0xf8, 0x00, // ---------OOOOOOOOOOOO---------..
0x01, 0xf0, 0x3e, 0x00, // -------OOOOO------OOOOO-------..
0x07, 0xc0, 0x0f, 0x80, // -----OOOOO----------OOOOO-----..
0x0f, 0xc0, 0x0f, 0xc0, // ----OOOOOO----------OOOOOO----..
0x1f, 0xe0, 0x1f, 0xe0, // ---OOOOOOOO--------OOOOOOOO---..
0x1f, 0xe0, 0x1f, 0xe0, // ---OOOOOOOO--------OOOOOOOO---..
0x3f, 0xff, 0xff, 0xf0, // --OOOOOOOOOOOOOOOOOOOOOOOOOO--..
0x3f, 0xff, 0xff, 0xf0, // --OOOOOOOOOOOOOOOOOOOOOOOOOO--..
0x7f, 0xf0, 0x7f, 0xf8, // -OOOOOOOOOOO-----OOOOOOOOOOOO-..
0x67, 0xe0, 0x1f, 0x98, // -OO--OOOOOO--------OOOOOO--OO-..
0xe3, 0xc0, 0x0f, 0x1c, // OOO---OOOO----------OOOO---OOO..
0xe1, 0x80, 0x06, 0x1c, // OOO----OO------------OO----OOO..
0xc1, 0x80, 0x06, 0x0c, // OO-----OO------------OO-----OO..
0xc3, 0x80, 0x07, 0x0c, // OO----OOO------------OOO----OO..
0xc3, 0x80, 0x07, 0x0c, // OO----OOO------------OOO----OO..
0xc3, 0x80, 0x07, 0x0c, // OO----OOO------------OOO----OO..
0xc1, 0x80, 0x06, 0x0c, // OO-----OO------------OO-----OO..
0xe1, 0x80, 0x06, 0x1c, // OOO----OO------------OO----OOO..
0xe3, 0xc0, 0x0f, 0x1c, // OOO---OOOO----------OOOO---OOO..
0x67, 0xe0, 0x1f, 0x98, // -OO--OOOOOO--------OOOOOO--OO-..
0x7f, 0xf8, 0x7f, 0xf8, // -OOOOOOOOOOOO----OOOOOOOOOOOO-..
0x3f, 0xff, 0xff, 0xf0, // --OOOOOOOOOOOOOOOOOOOOOOOOOO--..
0x3f, 0xff, 0xff, 0xf0, // --OOOOOOOOOOOOOOOOOOOOOOOOOO--..
0x1f, 0xe0, 0x1f, 0xe0, // ---OOOOOOOO--------OOOOOOOO---..
0x1f, 0xe0, 0x1f, 0xe0, // ---OOOOOOOO--------OOOOOOOO---..
0x0f, 0xc0, 0x0f, 0xc0, // ----OOOOOO----------OOOOOO----..
0x07, 0xc0, 0x07, 0x80, // -----OOOOO-----------OOOO-----..
0x01, 0xf0, 0x3e, 0x00, // -------OOOOO------OOOOO-------..
0x00, 0x7f, 0xf8, 0x00, // ---------OOOOOOOOOOOO---------..
0x00, 0x1f, 0xe0, 0x00, // -----------OOOOOOOO-----------..
// ASCII: 120, char width: 26
0x00, 0x1e, 0x00, 0x00, // -----------OOOO-----------......
0x00, 0x1e, 0x00, 0x00, // -----------OOOO-----------......
0x00, 0x1e, 0x00, 0x00, // -----------OOOO-----------......
0x00, 0x1e, 0x00, 0x00, // -----------OOOO-----------......
0x07, 0x1e, 0x38, 0x00, // -----OOO---OOOO---OOO-----......
0x0f, 0x9e, 0x7c, 0x00, // ----OOOOO--OOOO--OOOOO----......
0x1f, 0x9e, 0x7e, 0x00, // ---OOOOOO--OOOO--OOOOOO---......
0x3f, 0x1e, 0x3f, 0x00, // --OOOOOO---OOOO---OOOOOO--......
0x7e, 0x1e, 0x1f, 0x00, // -OOOOOO----OOOO----OOOOO--......
0x7c, 0x1e, 0x0f, 0x80, // -OOOOO-----OOOO-----OOOOO-......
0x78, 0x1e, 0x0f, 0x80, // -OOOO------OOOO-----OOOOO-......
0xf8, 0x1e, 0x07, 0x80, // OOOOO------OOOO------OOOO-......
0xf8, 0x1e, 0x07, 0xc0, // OOOOO------OOOO------OOOOO......
0xf0, 0x1c, 0x07, 0xc0, // OOOO-------OOO-------OOOOO......
0xf0, 0x00, 0x07, 0xc0, // OOOO-----------------OOOOO......
0xf0, 0x00, 0x07, 0xc0, // OOOO-----------------OOOOO......
0xf8, 0x00, 0x07, 0xc0, // OOOOO----------------OOOOO......
0xf8, 0x00, 0x07, 0x80, // OOOOO----------------OOOO-......
0x78, 0x00, 0x0f, 0x80, // -OOOO---------------OOOOO-......
0x7c, 0x00, 0x0f, 0x80, // -OOOOO--------------OOOOO-......
0x3e, 0x00, 0x1f, 0x00, // --OOOOO------------OOOOO--......
0x3f, 0x00, 0x3f, 0x00, // --OOOOOO----------OOOOOO--......
0x1f, 0xc0, 0xfe, 0x00, // ---OOOOOOO------OOOOOOO---......
0x0f, 0xff, 0xfc, 0x00, // ----OOOOOOOOOOOOOOOOOO----......
0x07, 0xff, 0xf8, 0x00, // -----OOOOOOOOOOOOOOOO-----......
0x01, 0xff, 0xe0, 0x00, // -------OOOOOOOOOOOO-------......
0x00, 0x7f, 0x80, 0x00, // ---------OOOOOOOO---------......
0x00, 0x00, 0x00, 0x00, // --------------------------......
0x00, 0x00, 0x00, 0x00, // --------------------------......
0x00, 0x00, 0x00, 0x00, // --------------------------......
// ASCII: 121, char width: 26
0x00, 0x00, 0x00, 0x00, // --------------------------......
0x00, 0x3e, 0x00, 0x00, // ----------OOOOO-----------......
0x00, 0x3f, 0x00, 0x00, // ----------OOOOOO----------......
0x06, 0x3f, 0x18, 0x00, // -----OO---OOOOOO---OO-----......
0x0f, 0x3f, 0x3c, 0x00, // ----OOOO--OOOOOO--OOOO----......
0x1f, 0xff, 0xfe, 0x00, // ---OOOOOOOOOOOOOOOOOOOO---......
0x3f, 0xff, 0xfe, 0x00, // --OOOOOOOOOOOOOOOOOOOOO---......
0x1f, 0xff, 0xfe, 0x00, // ---OOOOOOOOOOOOOOOOOOOO---......
0x1f, 0xff, 0xfc, 0x00, // ---OOOOOOOOOOOOOOOOOOO----......
0x0f, 0xff, 0xfc, 0x00, // ----OOOOOOOOOOOOOOOOOO----......
0x0f, 0xe1, 0xfc, 0x00, // ----OOOOOOO----OOOOOOO----......
0x3f, 0xc0, 0xff, 0x00, // --OOOOOOOO------OOOOOOOO--......
0xff, 0x80, 0x7f, 0xc0, // OOOOOOOOO--------OOOOOOOOO......
0xff, 0x80, 0x7f, 0xc0, // OOOOOOOOO--------OOOOOOOOO......
0xff, 0x80, 0x7f, 0xc0, // OOOOOOOOO--------OOOOOOOOO......
0xff, 0x80, 0x7f, 0xc0, // OOOOOOOOO--------OOOOOOOOO......
0x7f, 0xc0, 0xff, 0x00, // -OOOOOOOOO------OOOOOOOO--......
0x0f, 0xe1, 0xfc, 0x00, // ----OOOOOOO----OOOOOOO----......
0x0f, 0xff, 0xfc, 0x00, // ----OOOOOOOOOOOOOOOOOO----......
0x1f, 0xff, 0xfc, 0x00, // ---OOOOOOOOOOOOOOOOOOO----......
0x1f, 0xff, 0xfe, 0x00, // ---OOOOOOOOOOOOOOOOOOOO---......
0x3f, 0xff, 0xff, 0x00, // --OOOOOOOOOOOOOOOOOOOOOO--......
0x1f, 0xff, 0xfe, 0x00, // ---OOOOOOOOOOOOOOOOOOOO---......
0x0f, 0x3f, 0x3c, 0x00, // ----OOOO--OOOOOO--OOOO----......
0x06, 0x3f, 0x18, 0x00, // -----OO---OOOOOO---OO-----......
0x00, 0x3f, 0x00, 0x00, // ----------OOOOOO----------......
0x00, 0x3e, 0x00, 0x00, // ----------OOOOO-----------......
0x00, 0x00, 0x00, 0x00, // --------------------------......
0x00, 0x00, 0x00, 0x00, // --------------------------......
0x00, 0x00, 0x00, 0x00, // --------------------------......
// ASCII: 122, char width: 34
0x00, 0x00, 0x00, 0x00, // --------------------------------
0x00, 0x0f, 0xfc, 0x00, // ------------OOOOOOOOOO----------
0x00, 0xff, 0xff, 0xc0, // --------OOOOOOOOOOOOOOOOOO------
0x03, 0xff, 0xff, 0xf0, // ------OOOOOOOOOOOOOOOOOOOOOO----
0x0f, 0xff, 0xff, 0xfc, // ----OOOOOOOOOOOOOOOOOOOOOOOOOO--
0x1f, 0xf8, 0x03, 0xff, // ---OOOOOOOOOO---------OOOOOOOOOO
0x7f, 0xc0, 0x00, 0x7f, // -OOOOOOOOO---------------OOOOOOO
0x7f, 0x07, 0xf8, 0x1f, // -OOOOOOO-----OOOOOOOO------OOOOO
0x7c, 0x3f, 0xff, 0x0f, // -OOOOO----OOOOOOOOOOOOOO----OOOO
0x18, 0xff, 0xff, 0xc3, // ---OO---OOOOOOOOOOOOOOOOOO----OO
0x01, 0xff, 0xff, 0xe0, // -------OOOOOOOOOOOOOOOOOOOO-----
0x03, 0xfc, 0x0f, 0xf8, // ------OOOOOOOO------OOOOOOOOO---
0x07, 0xf0, 0x03, 0xf8, // -----OOOOOOO----------OOOOOOO---
0x03, 0xc0, 0x00, 0xf0, // ------OOOO--------------OOOO----
0x01, 0x83, 0xf0, 0x60, // -------OO-----OOOOOO-----OO-----
0x00, 0x1f, 0xfe, 0x00, // -----------OOOOOOOOOOOO---------
0x00, 0x3f, 0xff, 0x80, // ----------OOOOOOOOOOOOOOO-------
0x00, 0x3f, 0xff, 0x00, // ----------OOOOOOOOOOOOOO--------
0x00, 0x1e, 0x0e, 0x00, // -----------OOOO-----OOO---------
0x00, 0x00, 0x00, 0x00, // --------------------------------
0x00, 0x01, 0xe0, 0x00, // ---------------OOOO-------------
0x00, 0x03, 0xf0, 0x00, // --------------OOOOOO------------
0x00, 0x01, 0xe0, 0x00, // ---------------OOOO-------------
0x00, 0x00, 0xc0, 0x00, // ----------------OO--------------
0x00, 0x00, 0x00, 0x00, // --------------------------------
0x00, 0x00, 0x00, 0x00, // --------------------------------
0x00, 0x00, 0x00, 0x00, // --------------------------------
0x00, 0x00, 0x00, 0x00, // --------------------------------
0x00, 0x00, 0x00, 0x00, // --------------------------------
0x00, 0x00, 0x00, 0x00, // --------------------------------
};
static const uint8_t symbol_30_widths[26] =
{
30, 26, 32, 24, 26, 26, 30, 24,
30, 21, 21, 30, 17, 17, 24, 30,
24, 30, 30, 30, 30, 30, 30, 26,
26, 34,
};
static const font_t symbol_30_dsc =
{
26, // Letter count
97, // First ascii code
4, // Letters width (bytes)
30, // Letters height (row)
0, // Fixed width or 0 if variable
symbol_30_widths,
symbol_30_bitmaps
};
const font_t * symbol_30_get_dsc(void)
{
return &symbol_30_dsc;
}
#endif

View File

@@ -1,16 +0,0 @@
#ifndef SYMBOL_30_H
#define SYMBOL_30_H
/*Use ISO8859-1 encoding in the IDE*/
#include "lv_conf.h"
#if USE_FONT_SYMBOL_30 != 0
#include <stdint.h>
#include "../font.h"
const font_t * symbol_30_get_dsc(void);
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,16 +0,0 @@
#ifndef SYMBOL_60_H
#define SYMBOL_60_H
/*Use ISO8859-1 encoding in the IDE*/
#include "lv_conf.h"
#if USE_FONT_SYMBOL_60 != 0
#include <stdint.h>
#include "../font.h"
const font_t * symbol_60_get_dsc(void);
#endif
#endif

View File

@@ -1,41 +0,0 @@
#ifndef SYMBOL_DEF_H
#define SYMBOL_DEF_H
/*Use ISO8859-1 encoding in the IDE*/
#include "lv_conf.h"
#if USE_FONT_SYMBOL_30 != 0
#include <stdint.h>
#include "../font.h"
#define SYMBOL_DRIVE "a"
#define SYMBOL_FILE "b"
#define SYMBOL_FOLDER "c"
#define SYMBOL_DELETE "d"
#define SYMBOL_SAVE "e"
#define SYMBOL_EDIT "f"
#define SYMBOL_OK "g"
#define SYMBOL_CLOSE "h"
#define SYMBOL_DOWN "i"
#define SYMBOL_LEFT "j"
#define SYMBOL_RIGHT "k"
#define SYMBOL_UP "l"
#define SYMBOL_BT "m"
#define SYMBOL_THERM "n"
#define SYMBOL_GPS "o"
#define SYMBOL_WARN "p"
#define SYMBOL_INFO "q"
#define SYMBOL_BATT1 "r"
#define SYMBOL_BATT2 "s"
#define SYMBOL_BATT3 "t"
#define SYMBOL_BATT4 "u"
#define SYMBOL_BATTCH "v"
#define SYMBOL_HELP "w"
#define SYMBOL_POWER "x"
#define SYMBOL_SETUP "y"
#define SYMBOL_WIFI "z"
#endif
#endif /*SYMBOL_DEF_H*/

View File

@@ -1,212 +0,0 @@
/**
* @file font.c
*
*/
/*********************
* INCLUDES
*********************/
#include "text.h"
#include "misc/math/math_base.h"
/*********************
* DEFINES
*********************/
#define TXT_NO_BREAK_FOUND UINT16_MAX
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
static bool txt_is_break_char(char letter);
/**********************
* STATIC VARIABLES
**********************/
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/**
* Get size of a text
* @param size_res pointer to a 'point_t' variable to store the result
* @param text pointer to a text
* @param font pinter to font of the text
* @param letter_space letter space of the text
* @param line_space line space of the text
* @param max_width max with of the text (break the lines to fit this size) Set LV_CORD_MAX to avoid line breaks
*/
void txt_get_size(point_t * size_res, const char * text, const font_t * font,
uint16_t letter_space, uint16_t line_space, cord_t max_width)
{
size_res->x = 0;
size_res->y = 0;
if(text == NULL) return;
if(font == NULL) return;
uint32_t line_start = 0;
uint32_t new_line_start = 0;
cord_t act_line_length;
uint8_t letter_height = font_get_height(font);
/*Calc. the height and longest line*/
while (text[line_start] != '\0')
{
new_line_start += txt_get_next_line(&text[line_start], font, letter_space, max_width);
size_res->y += letter_height;
size_res->y += line_space;
/*Calculate the the longest line*/
act_line_length = txt_get_width(&text[line_start], new_line_start - line_start,
font, letter_space);
size_res->x = MATH_MAX(act_line_length, size_res->x);
line_start = new_line_start;
}
if(line_start != 0 && (text[line_start - 1] == '\n' || text[line_start - 1] == '\r')) {
size_res->y += letter_height + line_space;
}
/*Correction with the last line space or set the height manually if the text is empty*/
if(size_res->y == 0) size_res->y = letter_height;
else size_res->y -= line_space;
}
/**
* Get the next line of text. Check line length and break chars too.
* @param txt a '\0' terminated string
* @param font pointer to a font
* @param letter_space letter space
* @param max_l max line length
* @return the index of the first char of the new line
*/
uint16_t txt_get_next_line(const char * txt, const font_t * font,
uint16_t letter_space, cord_t max_l)
{
if(txt == NULL) return 0;
if(font == NULL) return 0;
uint32_t i = 0;
cord_t act_l = 0;
uint16_t last_break = TXT_NO_BREAK_FOUND;
while(txt[i] != '\0') {
/*Check for new line chars*/
if(txt[i] == '\n' || txt[i] == '\r') {
/*Handle \n\r and \r\n as well*/
if(txt[i] == '\n' && txt[i + 1] == '\r') {
i++;
} else if(txt[i] == '\r' && txt[i + 1] == '\n') {
i++;
}
return i+1; /*Return with the first letter of the next line*/
} else { /*Check the actual length*/
act_l += font_get_width(font, txt[i]);
/*If the txt is too long then finish, this is the line end*/
if(act_l > max_l) {
/*If already a break character is found, then break there*/
if(last_break != TXT_NO_BREAK_FOUND && txt_is_break_char(txt[i]) == false) {
i = last_break;
}
while(txt[i] == ' ') i++;
/* Do not let to return without doing nothing.
* Find at least one character */
if(i == 0) i++;
return i;
}
/*If this char still can fit to this line then check if
* txt can be broken here later */
else if(txt_is_break_char(txt[i])) {
last_break = i;
last_break++;/*Go to the next char, the break char stays in this line*/
}
}
act_l += letter_space;
i++;
}
return i;
}
/**
* Give the length of a text with a given font
* @param txt a '\0' terminate string
* @param char_num number of characters in 'txt'
* @param font pointer to a font
* @param letter_space letter sapce
* @return length of a char_num long text
*/
cord_t txt_get_width(const char * txt, uint16_t char_num,
const font_t * font, uint16_t letter_space)
{
if(txt == NULL) return 0;
if(font == NULL) return 0;
uint16_t i;
cord_t len = 0;
if(char_num != 0) {
for(i = 0; i < char_num; i++) {
len += font_get_width(font, txt[i]);
len += letter_space;
}
/*Trim closing spaces */
for(i = char_num - 1; i > 0; i--) {
if(txt[i] == ' ') {
len -= font_get_width(font, txt[i]);
len -= letter_space;
} else {
break;
}
}
/*Correct the last letter space,
* because thee is no letter space after the last char*/
len -= letter_space;
}
return len;
}
/**********************
* STATIC FUNCTIONS
**********************/
/**
* Test if char is break char or not (a text can broken here or not)
* @param letter a letter
* @return false: 'letter' is not break char
*/
static bool txt_is_break_char(char letter)
{
uint8_t i;
bool ret = false;
/*Compare the letter to TXT_BREAK_CHARS*/
for(i = 0; LV_TXT_BREAK_CHARS[i] != '\0'; i++) {
if(letter == LV_TXT_BREAK_CHARS[i]) {
ret = true; /*If match then it is break char*/
break;
}
}
return ret;
}

View File

@@ -1,69 +0,0 @@
/**
* @file text.h
*
*/
#ifndef TEXT_H
#define TEXT_H
/*********************
* INCLUDES
*********************/
#include <lvgl/lv_misc/area.h>
#include <stdbool.h>
#include "font.h"
#include "area.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* GLOBAL PROTOTYPES
**********************/
/**
* Get size of a text
* @param size_res pointer to a 'point_t' variable to store the result
* @param text pointer to a text
* @param font pinter to font of the text
* @param letter_space letter space of the text
* @param line_space line space of the text
* @param max_width max with of the text (break the lines to fit this size) Set LV_CORD_MAX to avoid line breaks
*/
void txt_get_size(point_t * size_res, const char * text, const font_t * font,
uint16_t letter_space, uint16_t line_space, cord_t max_width);
/**
* Get the next line of text. Check line length and break chars too.
* @param txt a '\0' terminated string
* @param font_p pointer to a font
* @param letter_space letter space
* @param max_l max line length
* @return the index of the first char of the new line
*/
uint16_t txt_get_next_line(const char * txt, const font_t * font_p,
uint16_t letter_space, cord_t max_l);
/**
* Give the length of a text with a given font
* @param txt a '\0' terminate string
* @param char_num number of characters in 'txt'
* @param font_p pointer to a font
* @param letter_space letter sapce
* @return length of a char_num long text
*/
cord_t txt_get_width(const char * txt, uint16_t char_num,
const font_t * font_p, uint16_t letter_space);
/**********************
* MACROS
**********************/
#endif

View File

@@ -41,6 +41,7 @@ static void dispi_drag_throw(lv_dispi_t * dispi_p);
static ptask_t* dispi_task_p;
static bool lv_dispi_reset_qry;
static bool lv_dispi_reset_now;
static lv_dispi_t dispi_array[INDEV_NUM];
/**********************
* MACROS
@@ -65,6 +66,15 @@ void lv_dispi_init(void)
#endif
}
/**
* Get an array with all the display inputs. Contains (INDEV_NUM elements)
* @return pointer to a an lv_dispi_t array.
*/
lv_dispi_t * lv_dispi_get_array(void)
{
return dispi_array;
}
/**
* Reset all display inputs
*/
@@ -135,15 +145,13 @@ void lv_dispi_wait_release(lv_dispi_t * dispi)
*/
static void dispi_task(void * param)
{
static lv_dispi_t dispi[INDEV_NUM];
cord_t x;
cord_t y;
uint8_t i;
for (i = 0; i < INDEV_NUM; i++) {
dispi[i].pressed = indev_get(i, &x, &y);
dispi_proc_point(&dispi[i], x, y);
dispi_array[i].pressed = indev_get(i, &x, &y);
dispi_proc_point(&dispi_array[i], x, y);
}
/*If reset query occurred in this round then set a flag to
@@ -177,6 +185,7 @@ static void dispi_proc_point(lv_dispi_t * dispi_p, cord_t x, cord_t y)
if(lv_dispi_reset_now != false) {
dispi_p->act_obj = NULL;
dispi_p->last_obj = NULL;
dispi_p->drag_range_out = 0;
dispi_p->drag_in_prog = 0;
dispi_p->long_press_sent = 0;
dispi_p->press_time_stamp = 0;
@@ -188,10 +197,10 @@ static void dispi_proc_point(lv_dispi_t * dispi_p, cord_t x, cord_t y)
if(dispi_p->pressed != false){
#if LV_DISPI_TP_MARKER != 0
area_t area;
area.x1 = x;
area.y1 = y;
area.x2 = x + 1;
area.y2 = y + 1;
area.x1 = x - (LV_DISPI_TP_MARKER >> 1);
area.y1 = y - (LV_DISPI_TP_MARKER >> 1);
area.x2 = x + ((LV_DISPI_TP_MARKER >> 1) | 0x1);
area.y2 = y + ((LV_DISPI_TP_MARKER >> 1) | 0x1);
lv_rfill(&area, NULL, COLOR_MAKE(0xFF, 0, 0), OPA_COVER);
#endif
dispi_proc_press(dispi_p);
@@ -218,8 +227,8 @@ static void dispi_proc_press(lv_dispi_t * dispi_p)
if(dispi_p->act_obj == NULL) {
pr_obj = dispi_search_obj(dispi_p, lv_scr_act());
}
/*If there is last object but it can not be dragged also search*/
else if(lv_obj_get_drag(dispi_p->act_obj) == false) {/*Now act_obj != NULL*/
/*If there is last object but it is not dragged also search*/
else if(dispi_p->drag_in_prog == 0) {/*Now act_obj != NULL*/
pr_obj = dispi_search_obj(dispi_p, lv_scr_act());
}
/*If a dragable object was the last then keep it*/
@@ -244,6 +253,7 @@ static void dispi_proc_press(lv_dispi_t * dispi_p)
* It is necessary to count the long press time.*/
dispi_p->press_time_stamp = systick_get();
dispi_p->long_press_sent = 0;
dispi_p->drag_range_out = 0;
dispi_p->drag_in_prog = 0;
dispi_p->vect_sum.x = 0;
dispi_p->vect_sum.y = 0;
@@ -402,7 +412,7 @@ static void dispi_drag(lv_dispi_t * dispi_p)
if(lv_obj_get_drag(drag_obj) == false) return;
/*If still there is no drag then count the movement*/
if(dispi_p->drag_in_prog == 0) {
if(dispi_p->drag_range_out == 0) {
dispi_p->vect_sum.x += dispi_p->vect.x;
dispi_p->vect_sum.y += dispi_p->vect.y;
@@ -410,21 +420,29 @@ static void dispi_drag(lv_dispi_t * dispi_p)
if(MATH_ABS(dispi_p->vect_sum.x) >= LV_DISPI_DRAG_LIMIT ||
MATH_ABS(dispi_p->vect_sum.y) >= LV_DISPI_DRAG_LIMIT)
{
dispi_p->drag_in_prog = 1;
drag_obj->signal_f(drag_obj,
LV_SIGNAL_DRAG_BEGIN, dispi_p);
dispi_p->drag_range_out = 1;
}
}
/*If the drag limit is stepped over then handle the dragging*/
if(dispi_p->drag_in_prog != 0) {
if(dispi_p->drag_range_out != 0) {
/*Set new position if the vector is not zero*/
if(dispi_p->vect.x != 0 ||
dispi_p->vect.y != 0) {
/*Get the coordinates of the object end modify them*/
cord_t act_x = lv_obj_get_x(drag_obj) + dispi_p->vect.x;
cord_t act_y = lv_obj_get_y(drag_obj) + dispi_p->vect.y;
lv_obj_set_pos(drag_obj, act_x, act_y);
cord_t act_x = lv_obj_get_x(drag_obj);
cord_t act_y = lv_obj_get_y(drag_obj);
lv_obj_set_pos(drag_obj, act_x + dispi_p->vect.x, act_y + dispi_p->vect.y);
/*Set the drag in progress flag if the object is really moved*/
if(lv_obj_get_x(drag_obj) != act_x || lv_obj_get_y(drag_obj) != act_y) {
if(dispi_p->drag_range_out != 0) { /*Send the drag begin signal on first move*/
drag_obj->signal_f(drag_obj, LV_SIGNAL_DRAG_BEGIN, dispi_p);
}
dispi_p->drag_in_prog = 1;
}
}
}
}

View File

@@ -6,6 +6,10 @@
#ifndef LV_DISPI_H
#define LV_DISPI_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
@@ -31,6 +35,7 @@ typedef struct
uint32_t lpr_rep_time_stamp;
/*Flags*/
uint8_t drag_range_out :1;
uint8_t drag_in_prog :1;
uint8_t long_press_sent :1;
uint8_t wait_release :1;
@@ -39,8 +44,8 @@ typedef struct
typedef enum
{
LV_ACTION_RES_INV = 0,
LV_ACTION_RES_OK,
LV_ACTION_RES_INV = 0, /*Typically indicates that the object is deleted (become invalid) in the action function*/
LV_ACTION_RES_OK, /*The object is valid (no deleted) after the action*/
}lv_action_res_t;
typedef lv_action_res_t ( * lv_action_t) (struct __LV_OBJ_T * obj, lv_dispi_t * dispi);
@@ -54,6 +59,12 @@ typedef lv_action_res_t ( * lv_action_t) (struct __LV_OBJ_T * obj, lv_dispi_t *
*/
void lv_dispi_init(void);
/**
* Get an array with all the display inputs. Contains (INDEV_NUM elements)
* @return pointer to a an lv_dispi_t array.
*/
lv_dispi_t * lv_dispi_get_array(void);
/**
* Reset all display inputs
*/
@@ -96,4 +107,9 @@ void lv_dispi_wait_release(lv_dispi_t * dispi);
* MACROS
**********************/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_DISPI_H*/

View File

@@ -7,16 +7,17 @@
* INCLUDES
*********************/
#include <lv_conf.h>
#include <lvgl/lv_draw/lv_draw_rbasic.h>
#include <lvgl/lv_draw/lv_draw_vbasic.h>
#include <lvgl/lv_misc/anim.h>
#include <lvgl/lv_obj/lv_dispi.h>
#include <lvgl/lv_obj/lv_obj.h>
#include <lvgl/lv_obj/lv_refr.h>
#include "lv_conf.h"
#include "lvgl/lv_draw/lv_draw.h"
#include "lvgl/lv_obj/lv_dispi.h"
#include "lvgl/lv_obj/lv_obj.h"
#include "lvgl/lv_obj/lv_refr.h"
#include "lvgl/lv_app/lv_app.h"
#include "lvgl/lv_draw/lv_draw_rbasic.h"
#include "misc/gfx/anim.h"
#include "hal/indev/indev.h"
#include <stdint.h>
#include <string.h>
#include <sys/types.h>
#ifdef LV_IMG_DEF_WALLPAPER
#include "../lv_objx/lv_img.h"
@@ -25,7 +26,6 @@
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
@@ -35,6 +35,7 @@
**********************/
static void lv_obj_pos_child_refr(lv_obj_t * obj, cord_t x_diff, cord_t y_diff);
static void lv_style_refr_core(void * style_p, lv_obj_t * obj);
static void lv_child_refr_style(lv_obj_t * obj);
static void lv_obj_del_child(lv_obj_t * obj);
static bool lv_obj_design(lv_obj_t * obj, const area_t * mask_p, lv_design_mode_t mode);
@@ -45,11 +46,6 @@ static lv_obj_t * def_scr = NULL;
static lv_obj_t * act_scr = NULL;
static ll_dsc_t scr_ll;
static lv_objs_t lv_objs_def = {.color = COLOR_MAKE(0xa0, 0xc0, 0xe0), .transp = 0};
static lv_objs_t lv_objs_scr = {.color = LV_OBJ_DEF_SCR_COLOR, .transp = 0};
static lv_objs_t lv_objs_transp = {.transp = 1};
#ifdef LV_IMG_DEF_WALLPAPER
LV_IMG_DECLARE(LV_IMG_DEF_WALLPAPER);
#endif
@@ -71,12 +67,12 @@ void lv_init(void)
area_t scr_area;
area_set(&scr_area, 0, 0, LV_HOR_RES, LV_VER_RES);
lv_rfill(&scr_area, NULL, COLOR_BLACK, OPA_COVER);
/*Init. the sstyles*/
lv_style_init();
/*Init. the screen refresh system*/
lv_refr_init();
/*Init. the animations*/
anim_init();
/*Create the default screen*/
ll_init(&scr_ll, sizeof(lv_obj_t));
@@ -85,6 +81,7 @@ void lv_init(void)
def_scr = lv_img_create(NULL, NULL);
lv_img_set_auto_size(def_scr, false);
lv_img_set_file(def_scr, "U:/def_wp");
lv_img_set_upscale(def_scr, true);
#else
def_scr = lv_obj_create(NULL, NULL);
#endif
@@ -134,15 +131,16 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, lv_obj_t * copy)
new_obj->ext_size = 0;
/*Set appearance*/
new_obj->style_p = lv_objs_get(LV_OBJS_SCR, NULL);
new_obj->opa = OPA_COVER;
new_obj->style_p = lv_style_get(LV_STYLE_SCR, NULL);
/*Set virtual functions*/
lv_obj_set_signal_f(new_obj, lv_obj_signal);
lv_obj_set_design_f(new_obj, lv_obj_design);
/*Set free data*/
#if LV_OBJ_FREE_NUM != 0
new_obj->free_num = 0;
#endif
#if LV_OBJ_FREE_P != 0
new_obj->free_p = NULL;
#endif
@@ -152,7 +150,6 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, lv_obj_t * copy)
new_obj->drag_en = 0;
new_obj->drag_throw_en = 0;
new_obj->drag_parent = 0;
new_obj->style_iso = 0;
new_obj->hidden = 0;
new_obj->top_en = 0;
new_obj->protect = LV_PROTECT_NONE;
@@ -177,15 +174,16 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, lv_obj_t * copy)
new_obj->ext_size = 0;
/*Set appearance*/
new_obj->style_p = lv_objs_get(LV_OBJS_DEF, NULL);
new_obj->opa = OPA_COVER;
new_obj->style_p = lv_style_get(LV_STYLE_PLAIN, NULL);
/*Set virtual functions*/
lv_obj_set_signal_f(new_obj, lv_obj_signal);
lv_obj_set_design_f(new_obj, lv_obj_design);
/*Set free data*/
#if LV_OBJ_FREE_NUM != 0
new_obj->free_num = 0;
#endif
#if LV_OBJ_FREE_P != 0
new_obj->free_p = NULL;
#endif
@@ -195,7 +193,6 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, lv_obj_t * copy)
new_obj->drag_en = 0;
new_obj->drag_throw_en = 0;
new_obj->drag_parent = 0;
new_obj->style_iso = 0;
new_obj->hidden = 0;
new_obj->top_en = 0;
new_obj->protect = LV_PROTECT_NONE;
@@ -208,10 +205,10 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, lv_obj_t * copy)
area_cpy(&new_obj->cords, &copy->cords);
new_obj->ext_size = copy->ext_size;
new_obj->opa = copy->opa;
/*Set free data*/
#if LV_OBJ_FREE_NUM != 0
new_obj->free_num = copy->free_num;
#endif
#if LV_OBJ_FREE_P != 0
new_obj->free_p = copy->free_p;
#endif
@@ -226,10 +223,6 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, lv_obj_t * copy)
new_obj->style_p = copy->style_p;
if(copy->style_iso != 0) {
lv_obj_iso_style(new_obj, dm_get_size(copy->style_p));
}
lv_obj_set_pos(new_obj, lv_obj_get_x(copy), lv_obj_get_y(copy));
}
@@ -247,7 +240,7 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, lv_obj_t * copy)
/**
* Delete 'obj' and all of its children
* @param obj
* @param obj pointer to an object to delete
*/
void lv_obj_del(lv_obj_t * obj)
{
@@ -285,13 +278,26 @@ void lv_obj_del(lv_obj_t * obj)
/*Delete the base objects*/
if(obj->ext != NULL) dm_free(obj->ext);
if(obj->style_iso != 0) dm_free(obj->style_p);
dm_free(obj); /*Free the object itself*/
/* Reset all display input (dispi) because
* the deleted object can be being pressed*/
lv_dispi_reset();
/* Reset all display input (dispi) if
* the currently pressed object is deleted too*/
lv_dispi_t * dispi_array = lv_dispi_get_array();
lv_obj_t * dpar;
uint8_t d;
for(d = 0; d < INDEV_NUM; d++) {
dpar = obj;
while(dpar != NULL) {
if(dispi_array[d].act_obj == dpar ||
dispi_array[d].last_obj == dpar) {
lv_dispi_reset();
break;
} else {
dpar = lv_obj_get_parent(dpar);
}
}
}
/*Send a signal to the parent to notify it about the child delete*/
if(par != NULL) {
par->signal_f(par, LV_SIGNAL_CHILD_CHG, NULL);
@@ -309,50 +315,25 @@ bool lv_obj_signal(lv_obj_t * obj, lv_signal_t sign, void * param)
{
bool valid = true;
lv_style_t * style = lv_obj_get_style(obj);
switch(sign) {
case LV_SIGNAL_CHILD_CHG:
/*Return 'invalid' if the child change signal is not enabled*/
if(lv_obj_is_protected(obj, LV_PROTECT_CHILD_CHG) != false) valid = false;
break;
default:
break;
case LV_SIGNAL_CHILD_CHG:
/*Return 'invalid' if the child change signal is not enabled*/
if(lv_obj_is_protected(obj, LV_PROTECT_CHILD_CHG) != false) valid = false;
break;
case LV_SIGNAL_REFR_EXT_SIZE:
if(style->swidth > obj->ext_size) obj->ext_size = style->swidth;
break;
case LV_SIGNAL_STYLE_CHG:
lv_obj_refr_ext_size(obj);
break;
default:
break;
}
return valid;
}
/**
* Return with a pointer to built-in style and/or copy it to a variable
* @param style a style name from lv_objs_builtin_t enum
* @param copy_p copy the style to this variable. (NULL if unused)
* @return pointer to an lv_objs_t style
*/
lv_objs_t * lv_objs_get(lv_objs_builtin_t style, lv_objs_t * copy_p)
{
lv_objs_t *style_p;
switch(style) {
case LV_OBJS_DEF:
style_p = &lv_objs_def;
break;
case LV_OBJS_SCR:
style_p = &lv_objs_scr;
break;
case LV_OBJS_TRANSP:
style_p = &lv_objs_transp;
break;
default:
style_p = NULL;
}
if(copy_p != NULL) {
if(style_p != NULL) memcpy(copy_p, style_p, sizeof(lv_objs_t));
else memcpy(copy_p, &lv_objs_def, sizeof(lv_objs_t));
}
return style_p;
}
/**
* Mark the object as invalid therefore its current position will be redrawn by 'lv_refr_task'
@@ -490,7 +471,7 @@ void lv_obj_set_pos(lv_obj_t * obj, cord_t x, cord_t y)
/**
* Set relative the position of an object (relative to the parent).
* The coordinates will be upscaled to compensate LV_DOWNSCALE.
* The coordinates will be upscaled with LV_DOWNSCALE.
* @param obj pointer to an object
* @param x new distance from the left side of the parent. (will be multiplied with LV_DOWNSCALE)
* @param y new distance from the top of the parent. (will be multiplied with LV_DOWNSCALE)
@@ -512,7 +493,7 @@ void lv_obj_set_x(lv_obj_t * obj, cord_t x)
/**
* Set the x coordinate of a object.
* The coordinate will be upscaled to compensate LV_DOWNSCALE.
* The coordinate will be upscaled with LV_DOWNSCALE.
* @param obj pointer to an object
* @param x new distance from the left side from the parent. (will be multiplied with LV_DOWNSCALE)
*/
@@ -533,7 +514,7 @@ void lv_obj_set_y(lv_obj_t * obj, cord_t y)
/**
* Set the y coordinate of a object.
* The coordinate will be upscaled to compensate LV_DOWNSCALE.
* The coordinate will be upscaled with LV_DOWNSCALE.
* @param obj pointer to an object
* @param y new distance from the top of the parent. (will be multiplied with LV_DOWNSCALE)
*/
@@ -582,7 +563,7 @@ void lv_obj_set_size(lv_obj_t * obj, cord_t w, cord_t h)
}
/**
* Set the size of an object. The coordinates will be upscaled to compensate LV_DOWNSCALE.
* Set the size of an object. The coordinates will be upscaled with LV_DOWNSCALE.
* @param obj pointer to an object
* @param w new width (will be multiplied with LV_DOWNSCALE)
* @param h new height (will be multiplied with LV_DOWNSCALE)
@@ -603,7 +584,7 @@ void lv_obj_set_width(lv_obj_t * obj, cord_t w)
}
/**
* Set the width of an object. The width will be upscaled to compensate LV_DOWNSCALE
* Set the width of an object. The width will be upscaled with LV_DOWNSCALE
* @param obj pointer to an object
* @param w new width (will be multiplied with LV_DOWNSCALE)
*/
@@ -623,7 +604,7 @@ void lv_obj_set_height(lv_obj_t * obj, cord_t h)
}
/**
* Set the height of an object. The height will be upscaled to compensate LV_DOWNSCALE
* Set the height of an object. The height will be upscaled with LV_DOWNSCALE
* @param obj pointer to an object
* @param h new height (will be multiplied with LV_DOWNSCALE)
*/
@@ -771,7 +752,7 @@ void lv_obj_align(lv_obj_t * obj,lv_obj_t * base, lv_align_t align, cord_t x_mod
/**
* Align an object to an other object. The coordinates will be upscaled to compensate LV_DOWNSCALE.
* Align an object to an other object. The coordinates will be upscaled with LV_DOWNSCALE.
* @param obj pointer to an object to align
* @param base pointer to an object (if NULL the parent is used). 'obj' will be aligned to it.
* @param align type of alignment (see 'lv_align_t' enum)
@@ -804,76 +785,15 @@ void lv_obj_set_ext_size(lv_obj_t * obj, cord_t ext_size)
* @param obj pointer to an object
* @param style_p pointer to the new style
*/
void lv_obj_set_style(lv_obj_t * obj, void * style)
void lv_obj_set_style(lv_obj_t * obj, lv_style_t * style)
{
lv_obj_inv(obj);
if(obj->style_iso != 0) {
dm_free(obj->style_p);
obj->style_iso = 0;
}
obj->style_p = style;
/*Send a style change signal to the object*/
lv_obj_refr_style(obj);
/*Send a signal about style change to every children with NULL style*/
lv_child_refr_style(obj);
lv_obj_inv(obj);
}
/**
* Isolate the style of an object. In other words a unique style will be created
* for this object which can be freely modified independently from the style of the
* other objects.
*/
void * lv_obj_iso_style(lv_obj_t * obj, uint32_t style_size)
{
if(obj->style_iso != 0) return obj->style_p;
void * ori_style_p = lv_obj_get_style(obj);
void * iso_style = dm_alloc(style_size);
dm_assert(iso_style);
memcpy(iso_style, ori_style_p, style_size);
obj->style_iso = 1;
obj->style_p = iso_style;
lv_obj_refr_style(obj);
return obj->style_p;
}
/**
* Set the opacity of an object
* @param obj pointer to an object
* @param opa 0 (transparent) .. 255(fully cover)
*/
void lv_obj_set_opa(lv_obj_t * obj, uint8_t opa)
{
obj->opa = opa;
lv_obj_inv(obj);
}
/**
* Set the opacity of an object and all of its children
* @param obj pointer to an object
* @param opa 0 (transparent) .. 255(fully cover)
*/
void lv_obj_set_opar(lv_obj_t * obj, uint8_t opa)
{
lv_obj_t * i;
LL_READ(obj->child_ll, i) {
lv_obj_set_opar(i, opa);
}
/*Set the opacity is the object is not protected*/
if(lv_obj_is_protected(obj, LV_PROTECT_OPA) == false) obj->opa = opa;
lv_obj_inv(obj);
}
/**
* Notify an object about its style is modified
* @param obj pointer to an object
@@ -888,10 +808,10 @@ void lv_obj_refr_style(lv_obj_t * obj)
/**
* Notify all object if a style is modified
* @param style pinter to a style. Only objects with this style will be notified
* @param style pointer to a style. Only the objects with this style will be notified
* (NULL to notify all objects)
*/
void lv_style_refr_all(void * style)
void lv_style_refr_objs(void * style)
{
lv_obj_t * i;
LL_READ(scr_ll, i) {
@@ -1043,6 +963,7 @@ void lv_obj_refr_ext_size(lv_obj_t * obj)
lv_obj_inv(obj);
}
#if LV_OBJ_FREE_NUM != 0
/**
* Set an application specific number for an object.
* It can help to identify objects in the application.
@@ -1053,6 +974,7 @@ void lv_obj_set_free_num(lv_obj_t * obj, uint8_t free_num)
{
obj->free_num = free_num;
}
#endif
#if LV_OBJ_FREE_P != 0
/**
@@ -1116,11 +1038,6 @@ void lv_obj_anim(lv_obj_t * obj, lv_anim_builtin_t type, uint16_t time, uint16_t
a.start = lv_obj_get_height(par);
a.end = lv_obj_get_y(obj);
break;
case LV_ANIM_FADE:
a.fp = (void(*)(void * , int32_t))lv_obj_set_opar;
a.start = OPA_TRANSP;
a.end = OPA_COVER;
break;
case LV_ANIM_GROW_H:
a.fp = (void(*)(void * , int32_t))lv_obj_set_width;
a.start = 0;
@@ -1301,7 +1218,7 @@ cord_t lv_obj_get_height(lv_obj_t * obj)
* @param obj pointer to an object
* @return the extended size attribute
*/
cord_t lv_obj_getext_size(lv_obj_t * obj)
cord_t lv_obj_get_ext_size(lv_obj_t * obj)
{
return obj->ext_size;
}
@@ -1311,23 +1228,26 @@ cord_t lv_obj_getext_size(lv_obj_t * obj)
*---------------*/
/**
* Get the style pointer of an object
* Get the style pointer of an object (if NULL get style of the parent)
* @param obj pointer to an object
* @return pointer to a style
*/
void * lv_obj_get_style(lv_obj_t * obj)
lv_style_t * lv_obj_get_style(lv_obj_t * obj)
{
return obj->style_p;
}
if(obj->style_p != NULL) return obj->style_p;
else {
lv_obj_t * par = obj->par;
/**
* Get the opacity of an object
* @param obj pointer to an object
* @return 0 (transparent) .. 255 (fully cover)
*/
opa_t lv_obj_get_opa(lv_obj_t * obj)
{
return obj->opa;
while(par != NULL) {
if(par->style_p != NULL) {
if(par->style_p->glass == 0) return par->style_p;
}
par = par->par;
}
}
/*Never reach this, at least the screen has to be a style*/
return NULL;
}
/*-----------------
@@ -1394,16 +1314,6 @@ bool lv_obj_get_drag_parent(lv_obj_t * obj)
return obj->drag_parent == 0 ? false : true;
}
/**
* Get the style isolation attribute of an object
* @param obj pointer to an object
* @return pointer to a style
*/
bool lv_obj_get_style_iso(lv_obj_t * obj)
{
return obj->style_iso == 0 ? false : true;
}
/**
* Get the protect field of an object
* @param obj pointer to an object
@@ -1461,7 +1371,7 @@ void * lv_obj_get_ext(lv_obj_t * obj)
return obj->ext;
}
#if LV_OBJ_FREE_NUM != 0
/**
* Get the free number
* @param obj pointer to an object
@@ -1471,6 +1381,7 @@ uint8_t lv_obj_get_free_num(lv_obj_t * obj)
{
return obj->free_num;
}
#endif
#if LV_OBJ_FREE_P != 0
/**
@@ -1500,21 +1411,33 @@ void * lv_obj_get_free_p(lv_obj_t * obj)
static bool lv_obj_design(lv_obj_t * obj, const area_t * mask_p, lv_design_mode_t mode)
{
if(mode == LV_DESIGN_COVER_CHK) {
bool cover;
cover = area_is_in(mask_p, &obj->cords);
return cover;
/* Because of the radius it is not sure the area is covered
* Check the areas where there is no radius*/
lv_style_t * style = lv_obj_get_style(obj);
if(style->empty != 0) return false;
uint16_t r = style->radius;
if(r == LV_RADIUS_CIRCLE) return false;
area_t area_tmp;
/*Check horizontally without radius*/
lv_obj_get_cords(obj, &area_tmp);
area_tmp.x1 += r;
area_tmp.x2 -= r;
if(area_is_in(mask_p, &area_tmp) == false) return false;
/*Check vertically without radius*/
lv_obj_get_cords(obj, &area_tmp);
area_tmp.y1 += r;
area_tmp.y2 -= r;
if(area_is_in(mask_p, &area_tmp) == false) return false;
} else if(mode == LV_DESIGN_DRAW_MAIN) {
lv_objs_t * objs_p = lv_obj_get_style(obj);
opa_t opa = lv_obj_get_opa(obj);
color_t color = objs_p->color;
/*Simply draw a rectangle*/
#if LV_VDB_SIZE == 0
lv_rfill(&obj->cords, mask_p, color, opa);
#else
lv_vfill(&obj->cords, mask_p, color, opa);
#endif
lv_style_t * style = lv_obj_get_style(obj);
lv_draw_rect(&obj->cords, mask_p, style);
}
return true;
}
@@ -1548,6 +1471,7 @@ static void lv_style_refr_core(void * style_p, lv_obj_t * obj)
lv_obj_t * i;
LL_READ(obj->child_ll, i) {
if(i->style_p == style_p || style_p == NULL) {
lv_obj_inv(i);
i->signal_f(i, LV_SIGNAL_STYLE_CHG, NULL);
lv_obj_inv(i);
}
@@ -1556,6 +1480,26 @@ static void lv_style_refr_core(void * style_p, lv_obj_t * obj)
}
}
/**
* Recursively refresh the style of the children. Go deeper until a not NULL style is found
* because the NULL styles are inherited from the parent
* @param obj pointer to an object
*/
static void lv_child_refr_style(lv_obj_t * obj)
{
lv_obj_t * child = lv_obj_get_child(obj, NULL);
while(child != NULL) {
if(child->style_p == NULL) {
lv_child_refr_style(child);
}
child = lv_obj_get_child(obj, child);
}
/*Send a style change signal to the object*/
lv_obj_refr_style(obj);
}
/**
* Called by 'lv_obj_del' to delete the children objects
* @param obj pointer to an object (all of its children will be deleted)
@@ -1590,9 +1534,6 @@ static void lv_obj_del_child(lv_obj_t * obj)
/*Delete the base objects*/
if(obj->ext != NULL) dm_free(obj->ext);
if(obj->style_iso != 0) dm_free(obj->style_p);
dm_free(obj); /*Free the object itself*/
}

View File

@@ -6,19 +6,26 @@
#ifndef LV_OBJ_H
#define LV_OBJ_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include <lvgl/lv_misc/area.h>
#include "lv_conf.h"
#include <misc/gfx/area.h>
#include <stddef.h>
#include <stdbool.h>
#include "misc/mem/dyn_mem.h"
#include "misc/mem/linked_list.h"
#include "misc/others/color.h"
#include "misc/gfx/color.h"
#include "lv_style.h"
/*********************
* DEFINES
*********************/
/*Error check of lv_conf.h*/
#if LV_HOR_RES == 0 || LV_VER_RES == 0
#error "LV: LV_HOR_RES and LV_VER_RES must be greater then 0"
@@ -32,6 +39,14 @@
#error "LV: If LV_VDB_SIZE == 0 the antialaissing must be disabled"
#endif
#if LV_VDB_SIZE != 0 && LV_VDB_SIZE < LV_HOR_RES && LV_ANTIALIAS == 0
#error "LV: Small Virtual Display Buffer (lv_conf.h: LV_VDB_SIZE >= LV_HOR_RES)"
#endif
#if LV_VDB_SIZE != 0 && LV_VDB_SIZE < 2 *LV_HOR_RES && LV_ANTIALIAS != 0
#error "LV: Small Virtual Display Buffer (lv_conf.h: LV_VDB_SIZE >= (2 * LV_HOR_RES))"
#endif
/*New defines*/
#define LV_OBJ_DEF_WIDTH (80 * LV_DOWNSCALE)
#define LV_OBJ_DEF_HEIGHT (60 * LV_DOWNSCALE)
@@ -76,39 +91,37 @@ typedef bool (* lv_signal_f_t) (struct __LV_OBJ_T * obj, lv_signal_t sign, void
typedef struct __LV_OBJ_T
{
struct __LV_OBJ_T * par;
ll_dsc_t child_ll;
struct __LV_OBJ_T * par; /*Pointer to the parent object*/
ll_dsc_t child_ll; /*Linked list to store the children objects*/
area_t cords;
area_t cords; /*Coordinates of the object (x1, y1, x2, y2)*/
lv_signal_f_t signal_f;
lv_design_f_t design_f;
lv_signal_f_t signal_f; /*Object type specific signal function*/
lv_design_f_t design_f; /*Object type specific design function*/
void * ext; /*The object attributes can be extended here*/
void * style_p; /*Object specific style*/
void * ext; /*Object type specific extended data*/
lv_style_t * style_p; /*Pointer to the object's style*/
#if LV_OBJ_FREE_P != 0
void * free_p; /*Application specific pointer (set it freely)*/
void * free_p; /*Application specific pointer (set it freely)*/
#endif
/*Attributes and states*/
uint8_t click_en :1; /*1: can be pressed by a display input device*/
uint8_t drag_en :1; /*1: enable the dragging*/
uint8_t click_en :1; /*1: Can be pressed by a display input device*/
uint8_t drag_en :1; /*1: Enable the dragging*/
uint8_t drag_throw_en:1; /*1: Enable throwing with drag*/
uint8_t drag_parent :1; /*1. Parent will be dragged instead*/
uint8_t style_iso :1; /*1: The object has got an own style*/
uint8_t drag_parent :1; /*1: Parent will be dragged instead*/
uint8_t hidden :1; /*1: Object is hidden*/
uint8_t top_en :1; /*1: If the object or its children is clicked it goes to the foreground*/
uint8_t top_en :1; /*1: If the object or its children is clicked it goes to the foreground*/
uint8_t reserved :1;
uint8_t protect; /*Automatically happening actions can be prevented. 'OR'ed values from lv_obj_prot_t*/
cord_t ext_size; /*EXTtend the size of the object in every direction. Used to draw shadow, shine etc.*/
cord_t ext_size; /*EXTtend the size of the object in every direction. E.g. for shadow drawing*/
#if LV_OBJ_FREE_NUM != 0
uint8_t free_num; /*Application specific identifier (set it freely)*/
opa_t opa;
#endif
}lv_obj_t;
/*Protect some attributes (max. 8 bit)*/
@@ -116,54 +129,46 @@ typedef enum
{
LV_PROTECT_NONE = 0x00,
LV_PROTECT_CHILD_CHG = 0x01, /*Disable the child change signal. Used by the library*/
LV_PROTECT_OPA = 0x02, /*Prevent lv_obj_set_opar to modify the opacity*/
LV_PROTECT_PARENT = 0x04, /*Prevent automatic parent change (e.g. in lv_page)*/
LV_PROTECT_POS = 0x08, /*Prevent automatic positioning (e.g. in lv_rect layout)*/
LV_PROTECT_PARENT = 0x02, /*Prevent automatic parent change (e.g. in lv_page)*/
LV_PROTECT_POS = 0x04, /*Prevent automatic positioning (e.g. in lv_cont layout)*/
LV_PROTECT_FOLLOW = 0x08, /*Prevent the object be followed in automatic ordering (e.g. in lv_cont PRETTY layout)*/
}lv_protect_t;
typedef enum
{
LV_ALIGN_CENTER = 0,
LV_ALIGN_IN_TOP_LEFT,
LV_ALIGN_IN_TOP_MID,
LV_ALIGN_IN_TOP_RIGHT,
LV_ALIGN_IN_BOTTOM_LEFT,
LV_ALIGN_IN_BOTTOM_MID,
LV_ALIGN_IN_BOTTOM_RIGHT,
LV_ALIGN_IN_LEFT_MID,
LV_ALIGN_IN_RIGHT_MID,
LV_ALIGN_OUT_TOP_LEFT,
LV_ALIGN_OUT_TOP_MID,
LV_ALIGN_OUT_TOP_RIGHT,
LV_ALIGN_OUT_BOTTOM_LEFT,
LV_ALIGN_OUT_BOTTOM_MID,
LV_ALIGN_OUT_BOTTOM_RIGHT,
LV_ALIGN_OUT_LEFT_TOP,
LV_ALIGN_OUT_LEFT_MID,
LV_ALIGN_OUT_LEFT_BOTTOM,
LV_ALIGN_OUT_RIGHT_TOP,
LV_ALIGN_OUT_RIGHT_MID,
LV_ALIGN_OUT_RIGHT_BOTTOM,
LV_ALIGN_IN_TOP_LEFT,
LV_ALIGN_IN_TOP_MID,
LV_ALIGN_IN_TOP_RIGHT,
LV_ALIGN_IN_BOTTOM_LEFT,
LV_ALIGN_IN_BOTTOM_MID,
LV_ALIGN_IN_BOTTOM_RIGHT,
LV_ALIGN_IN_LEFT_MID,
LV_ALIGN_IN_RIGHT_MID,
LV_ALIGN_OUT_TOP_LEFT,
LV_ALIGN_OUT_TOP_MID,
LV_ALIGN_OUT_TOP_RIGHT,
LV_ALIGN_OUT_BOTTOM_LEFT,
LV_ALIGN_OUT_BOTTOM_MID,
LV_ALIGN_OUT_BOTTOM_RIGHT,
LV_ALIGN_OUT_LEFT_TOP,
LV_ALIGN_OUT_LEFT_MID,
LV_ALIGN_OUT_LEFT_BOTTOM,
LV_ALIGN_OUT_RIGHT_TOP,
LV_ALIGN_OUT_RIGHT_MID,
LV_ALIGN_OUT_RIGHT_BOTTOM,
}lv_align_t;
typedef struct
{
color_t color;
uint8_t transp :1;
opa_t opa;
}lv_objs_t;
typedef enum
{
LV_OBJS_DEF,
LV_OBJS_SCR,
LV_OBJS_TRANSP,
}lv_objs_builtin_t;
typedef enum
{
LV_ANIM_NONE = 0,
LV_ANIM_FADE, /*Animate the opacity*/
LV_ANIM_FLOAT_TOP, /*Float from/to the top*/
LV_ANIM_FLOAT_LEFT, /*Float from/to the left*/
LV_ANIM_FLOAT_BOTTOM, /*Float from/to the bottom*/
@@ -181,25 +186,6 @@ typedef enum
*/
void lv_init(void);
/**
* Mark the object as invalid therefore its current position will be redrawn by 'lv_refr_task'
* @param obj pointer to an object
*/
void lv_obj_inv(lv_obj_t * obj);
/**
* Notify an object about its style is modified
* @param obj pointer to an object
*/
void lv_obj_refr_style(lv_obj_t * obj);
/**
* Notify all object if a style is modified
* @param style pinter to a style. Only objects with this style will be notified
* (NULL to notify all objects)
*/
void lv_style_refr_all(void * style);
/**
* Create a basic object
* @param parent pointer to a parent object.
@@ -211,7 +197,7 @@ lv_obj_t * lv_obj_create(lv_obj_t * parent, lv_obj_t * copy);
/**
* Delete 'obj' and all of its children
* @param obj
* @param obj pointer to an object to delete
*/
void lv_obj_del(lv_obj_t * obj);
@@ -225,12 +211,10 @@ void lv_obj_del(lv_obj_t * obj);
bool lv_obj_signal(lv_obj_t * obj, lv_signal_t sign, void * param);
/**
* Return with a pointer to built-in style and/or copy it to a variable
* @param style a style name from lv_objs_builtin_t enum
* @param copy_p copy the style to this variable. (NULL if unused)
* @return pointer to an lv_objs_t style
* Mark the object as invalid therefore its current position will be redrawn by 'lv_refr_task'
* @param obj pointer to an object
*/
lv_objs_t * lv_objs_get(lv_objs_builtin_t style, lv_objs_t * copy_p);
void lv_obj_inv(lv_obj_t * obj);
/**
* Load a new screen
@@ -255,7 +239,7 @@ void lv_obj_set_pos(lv_obj_t * obj, cord_t x, cord_t y);
/**
* Set relative the position of an object (relative to the parent).
* The coordinates will be upscaled to compensate LV_DOWNSCALE.
* The coordinates will be upscaled with LV_DOWNSCALE.
* @param obj pointer to an object
* @param x new distance from the left side of the parent. (will be multiplied with LV_DOWNSCALE)
* @param y new distance from the top of the parent. (will be multiplied with LV_DOWNSCALE)
@@ -271,7 +255,7 @@ void lv_obj_set_x(lv_obj_t * obj, cord_t x);
/**
* Set the x coordinate of a object.
* The coordinate will be upscaled to compensate LV_DOWNSCALE.
* The coordinate will be upscaled with LV_DOWNSCALE.
* @param obj pointer to an object
* @param x new distance from the left side from the parent. (will be multiplied with LV_DOWNSCALE)
*/
@@ -286,7 +270,7 @@ void lv_obj_set_y(lv_obj_t * obj, cord_t y);
/**
* Set the y coordinate of a object.
* The coordinate will be upscaled to compensate LV_DOWNSCALE.
* The coordinate will be upscaled with LV_DOWNSCALE.
* @param obj pointer to an object
* @param y new distance from the top of the parent. (will be multiplied with LV_DOWNSCALE)
*/
@@ -301,7 +285,7 @@ void lv_obj_set_y_us(lv_obj_t * obj, cord_t y);
void lv_obj_set_size(lv_obj_t * obj, cord_t w, cord_t h);
/**
* Set the size of an object. The coordinates will be upscaled to compensate LV_DOWNSCALE.
* Set the size of an object. The coordinates will be upscaled with LV_DOWNSCALE.
* @param obj pointer to an object
* @param w new width (will be multiplied with LV_DOWNSCALE)
* @param h new height (will be multiplied with LV_DOWNSCALE)
@@ -316,7 +300,7 @@ void lv_obj_set_size_us(lv_obj_t * obj, cord_t w, cord_t h);
void lv_obj_set_width(lv_obj_t * obj, cord_t w);
/**
* Set the width of an object. The width will be upscaled to compensate LV_DOWNSCALE
* Set the width of an object. The width will be upscaled with LV_DOWNSCALE
* @param obj pointer to an object
* @param w new width (will be multiplied with LV_DOWNSCALE)
*/
@@ -330,7 +314,7 @@ void lv_obj_set_width_us(lv_obj_t * obj, cord_t w);
void lv_obj_set_height(lv_obj_t * obj, cord_t h);
/**
* Set the height of an object. The height will be upscaled to compensate LV_DOWNSCALE
* Set the height of an object. The height will be upscaled with LV_DOWNSCALE
* @param obj pointer to an object
* @param h new height (will be multiplied with LV_DOWNSCALE)
*/
@@ -347,7 +331,7 @@ void lv_obj_set_height_us(lv_obj_t * obj, cord_t h);
void lv_obj_align(lv_obj_t * obj,lv_obj_t * base, lv_align_t align, cord_t x_mod, cord_t y_mod);
/**
* Align an object to an other object. The coordinates will be upscaled to compensate LV_DOWNSCALE.
* Align an object to an other object. The coordinates will be upscaled with LV_DOWNSCALE.
* @param obj pointer to an object to align
* @param base pointer to an object (if NULL the parent is used). 'obj' will be aligned to it.
* @param align type of alignment (see 'lv_align_t' enum)
@@ -368,28 +352,20 @@ void lv_obj_set_ext_size(lv_obj_t * obj, cord_t ext_size);
* @param obj pointer to an object
* @param style_p pointer to the new style
*/
void lv_obj_set_style(lv_obj_t * obj, void * style);
void lv_obj_set_style(lv_obj_t * obj, lv_style_t * style);
/**
* Isolate the style of an object. In other words a unique style will be created
* for this object which can be freely modified independently from the style of the
* other objects.
*/
void * lv_obj_iso_style(lv_obj_t * obj, uint32_t style_size);
/**
* Set the opacity of an object
* Notify an object about its style is modified
* @param obj pointer to an object
* @param opa 0 (transparent) .. 255(fully cover)
*/
void lv_obj_set_opa(lv_obj_t * obj, uint8_t opa);
void lv_obj_refr_style(lv_obj_t * obj);
/**
* Set the opacity of an object and all of its children
* @param obj pointer to an object
* @param opa 0 (transparent) .. 255(fully cover)
* Notify all object if a style is modified
* @param style pointer to a style. Only the objects with this style will be notified
* (NULL to notify all objects)
*/
void lv_obj_set_opar(lv_obj_t * obj, uint8_t opa);
void lv_style_refr_objs(void * style);
/**
* Hide an object. It won't be visible and clickable.
@@ -478,6 +454,7 @@ void * lv_obj_alloc_ext(lv_obj_t * obj, uint16_t ext_size);
*/
void lv_obj_refr_ext_size(lv_obj_t * obj);
#if LV_OBJ_FREE_NUM != 0
/**
* Set an application specific number for an object.
* It can help to identify objects in the application.
@@ -485,7 +462,9 @@ void lv_obj_refr_ext_size(lv_obj_t * obj);
* @param free_num the new free number
*/
void lv_obj_set_free_num(lv_obj_t * obj, uint8_t free_num);
#endif
#if LV_OBJ_FREE_P != 0
/**
* Set an application specific pointer for an object.
* It can help to identify objects in the application.
@@ -493,7 +472,7 @@ void lv_obj_set_free_num(lv_obj_t * obj, uint8_t free_num);
* @param free_p the new free pinter
*/
void lv_obj_set_free_p(lv_obj_t * obj, void * free_p);
#endif
/**
* Animate an object
* @param obj pointer to an object to animate
@@ -580,21 +559,14 @@ cord_t lv_obj_get_height(lv_obj_t * obj);
* @param obj pointer to an object
* @return the extended size attribute
*/
cord_t lv_obj_getext_size(lv_obj_t * obj);
cord_t lv_obj_get_ext_size(lv_obj_t * obj);
/**
* Get the style pointer of an object
* Get the style pointer of an object (if NULL get style of the parent)
* @param obj pointer to an object
* @return pointer to a style
*/
void * lv_obj_get_style(lv_obj_t * obj);
/**
* Get the opacity of an object
* @param obj pointer to an object
* @return 0 (transparent) .. 255 (fully cover)
*/
opa_t lv_obj_get_opa(lv_obj_t * obj);
lv_style_t * lv_obj_get_style(lv_obj_t * obj);
/**
* Get the hidden attribute of an object
@@ -638,13 +610,6 @@ bool lv_obj_get_drag_throw(lv_obj_t * obj);
*/
bool lv_obj_get_drag_parent(lv_obj_t * obj);
/**
* Get the style isolation attribute of an object
* @param obj pointer to an object
* @return pointer to a style
*/
bool lv_obj_get_style_iso(lv_obj_t * obj);
/**
* Get the protect field of an object
* @param obj pointer to an object
@@ -682,25 +647,31 @@ lv_design_f_t lv_obj_get_design_f(lv_obj_t * obj);
*/
void * lv_obj_get_ext(lv_obj_t * obj);
#if LV_OBJ_FREE_NUM != 0
/**
* Get the free number
* @param obj pointer to an object
* @return the free number
*/
uint8_t lv_obj_get_free_num(lv_obj_t * obj);
#endif
#if LV_OBJ_FREE_P != 0
/**
* Get the free pointer
* @param obj pointer to an object
* @return the free pointer
*/
void * lv_obj_get_free_p(lv_obj_t * obj);
#endif
/**********************
* MACROS
**********************/
#define LV_SA(obj, style_type) ((style_type *) obj->style_p)
#define LV_EA(obj, ext_type) ((ext_type *) obj->ext)
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_OBJ_H*/

View File

@@ -12,6 +12,7 @@
#include "misc/mem/fifo.h"
#include "lv_refr.h"
#include "lv_vdb.h"
#include "hal/systick/systick.h"
/*********************
* DEFINES
@@ -45,8 +46,10 @@ static void lv_refr_obj(lv_obj_t * obj, const area_t * mask_ori_p);
/**********************
* STATIC VARIABLES
**********************/
lv_join_t inv_buf[LV_INV_FIFO_SIZE];
uint16_t inv_buf_p;
static lv_join_t inv_buf[LV_INV_FIFO_SIZE];
static uint16_t inv_buf_p;
static void (*monitor_cb)(uint32_t, uint32_t);
static uint32_t px_num;
/**********************
* MACROS
@@ -76,6 +79,12 @@ void lv_refr_init(void)
*/
void lv_inv_area(const area_t * area_p)
{
/*Clear the invalidate buffer if the parameter is NULL*/
if(area_p == NULL) {
inv_buf_p = 0;
return;
}
area_t scr_area;
scr_area.x1 = 0;
scr_area.y1 = 0;
@@ -116,6 +125,18 @@ void lv_inv_area(const area_t * area_p)
}
}
/**
* Set a function to call after every refresh to announce the refresh time and the number of refreshed pixels
* @param cb pointer to a callback function (void my_refr_cb(uint32_t time_ms, uint32_t px_num))
* time_ms: refresh time in [ms]
* px_num: not the drawn pixels but the number of affected pixels of the screen
* (more pixels are drawn with opacity areas)
*/
void lv_refr_set_monitor_cb(void (*cb)(uint32_t, uint32_t))
{
monitor_cb = cb;
}
/**********************
* STATIC FUNCTIONS
**********************/
@@ -126,12 +147,25 @@ void lv_inv_area(const area_t * area_p)
*/
static void lv_refr_task(void * param)
{
uint32_t start = systick_get();
lv_refr_join_area();
lv_refr_areas();
bool refr_done = false;
if(inv_buf_p != 0) refr_done = true;
memset(inv_buf, 0, sizeof(inv_buf));
inv_buf_p = 0;
/* In the callback lv_obj_inv can occur
* therefore be sure the inv_buf is cleared prior to it*/
if(refr_done != false) {
if(monitor_cb != NULL) {
monitor_cb(systick_elaps(start), px_num);
}
}
}
@@ -180,8 +214,9 @@ static void lv_refr_join_area(void)
*/
static void lv_refr_areas(void)
{
px_num = 0;
uint32_t i;
for(i = 0; i < inv_buf_p; i++) {
/*Refresh the unjoined areas*/
if(inv_buf[i].joined == 0) {
@@ -192,9 +227,10 @@ static void lv_refr_areas(void)
/*If VDB is used...*/
lv_refr_area_with_vdb(&inv_buf[i].area);
#endif
if(monitor_cb != NULL) px_num += area_get_size(&inv_buf[i].area);
}
}
}
#if LV_VDB_SIZE == 0
@@ -224,12 +260,12 @@ static void lv_refr_area_with_vdb(const area_t * area_p)
lv_vdb_t * vdb_p = lv_vdb_get();
/*Always use the full row*/
vdb_p->vdb_area.x1 = area_p->x1;
vdb_p->vdb_area.y1 = area_p->y1;
vdb_p->vdb_area.x2 = area_p->x2;
vdb_p->area.x1 = area_p->x1;
vdb_p->area.y1 = area_p->y1;
vdb_p->area.x2 = area_p->x2;
/*Calculate the max row num*/
uint32_t max_row = (uint32_t) LV_VDB_SIZE / (vdb_p->vdb_area.x2 - vdb_p->vdb_area.x1 + 1);
uint32_t max_row = (uint32_t) LV_VDB_SIZE / (vdb_p->area.x2 - vdb_p->area.x1 + 1);
if(max_row > area_get_height(area_p)) max_row = area_get_height(area_p);
/*Round the row number with downscale*/
@@ -242,17 +278,17 @@ static void lv_refr_area_with_vdb(const area_t * area_p)
for(row = area_p->y1; row + max_row - 1 <= area_p->y2; row += max_row) {
/*Calc. the next y coordinates of VDB*/
vdb_p->vdb_area.y1 = row;
vdb_p->vdb_area.y2 = row + max_row - 1;
vdb_p->area.y1 = row;
vdb_p->area.y2 = row + max_row - 1;
lv_refr_area_part_vdb(area_p);
}
/*If the last y coordinates are not handled yet ...*/
if(area_p->y2 != vdb_p->vdb_area.y2) {
if(area_p->y2 != vdb_p->area.y2) {
/*Calc. the next y coordinates of VDB*/
vdb_p->vdb_area.y1 = row;
vdb_p->vdb_area.y2 = area_p->y2;
vdb_p->area.y1 = row;
vdb_p->area.y2 = area_p->y2;
/*Refresh this part too*/
lv_refr_area_part_vdb(area_p);
@@ -271,14 +307,14 @@ static void lv_refr_area_part_vdb(const area_t * area_p)
/*Get the new mask from the original area and the act. VDB
It will be a part of 'area_p'*/
area_t start_mask;
area_union(&start_mask, area_p, &vdb_p->vdb_area);
area_union(&start_mask, area_p, &vdb_p->area);
/*Get the most top object which is not covered by others*/
top_p = lv_refr_get_top_obj(&start_mask, lv_scr_act());
/*Do the refreshing from the top object*/
lv_refr_make(top_p, &start_mask);
/*Flush the content of the VDB*/
lv_vdb_flush();
}
@@ -310,8 +346,8 @@ static lv_obj_t * lv_refr_get_top_obj(const area_t * area_p, lv_obj_t * obj)
/*If no better children check this object*/
if(found_p == NULL) {
if(obj->opa == OPA_COVER &&
LV_SA(obj, lv_objs_t)->transp == 0 &&
lv_style_t * style = lv_obj_get_style(obj);
if(style->opa == OPA_COVER &&
obj->design_f(obj, area_p, LV_DESIGN_COVER_CHK) != false) {
found_p = obj;
}
@@ -322,7 +358,7 @@ static lv_obj_t * lv_refr_get_top_obj(const area_t * area_p, lv_obj_t * obj)
}
/**
* Make the refreshing from an object. Draw all its children and the yungers too.
* Make the refreshing from an object. Draw all its children and the youngers too.
* @param top_p pointer to an objects. Start the drawing from it.
* @param mask_p pointer to an area, the objects will be drawn only here
*/
@@ -396,10 +432,11 @@ static void lv_refr_obj(lv_obj_t * obj, const area_t * mask_ori_p)
/*Draw the parent and its children only if they ore on 'mask_parent'*/
if(union_ok != false) {
/* Redraw the object */
if(obj->opa != OPA_TRANSP && LV_SA(obj, lv_objs_t)->transp == 0) {
/* Redraw the object */
lv_style_t * style = lv_obj_get_style(obj);
if(style->opa != OPA_TRANSP) {
obj->design_f(obj, &obj_ext_mask, LV_DESIGN_DRAW_MAIN);
/* tick_wait_ms(100); */ /*DEBUG: Wait after every object draw to see the order of drawing*/
//tick_wait_ms(100); /*DEBUG: Wait after every object draw to see the order of drawing*/
}
/*Create a new 'obj_mask' without 'ext_size' because the children can't be visible there*/
@@ -430,7 +467,7 @@ static void lv_refr_obj(lv_obj_t * obj, const area_t * mask_ori_p)
}
/* If all the children are redrawn make 'post draw' design */
if(obj->opa != OPA_TRANSP && LV_SA(obj, lv_objs_t)->transp == 0) {
if(style->opa != OPA_TRANSP) {
obj->design_f(obj, &obj_ext_mask, LV_DESIGN_DRAW_POST);
}
}

View File

@@ -3,12 +3,20 @@
*
*/
#ifndef LV_REFR_H
#define LV_REFR_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lv_obj.h"
#include <stdbool.h>
/*********************
* DEFINES
*********************/
@@ -44,6 +52,19 @@ void lv_refr_init(void);
*/
void lv_inv_area(const area_t * area_p);
/**
* Set a function to call after every refresh to announce the refresh time and the number of refreshed pixels
* @param cb pointer to a callback function (void my_refr_cb(uint32_t time_ms, uint32_t px_num))
*/
void lv_refr_set_monitor_cb(void (*cb)(uint32_t, uint32_t));
/**********************
* STATIC FUNCTIONS
**********************/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_REFR_H*/

234
lv_obj/lv_style.c Normal file
View File

@@ -0,0 +1,234 @@
/**
* @file lv_style.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_conf.h"
#include "lv_style.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
/**********************
* STATIC VARIABLES
**********************/
static lv_style_t lv_style_scr;
static lv_style_t lv_style_transp;
static lv_style_t lv_style_transp_tight;
static lv_style_t lv_style_plain;
static lv_style_t lv_style_plain_color;
static lv_style_t lv_style_pretty;
static lv_style_t lv_style_pretty_color;
static lv_style_t lv_style_btn_rel;
static lv_style_t lv_style_btn_pr;
static lv_style_t lv_style_btn_trel;
static lv_style_t lv_style_btn_tpr;
static lv_style_t lv_style_btn_ina;
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/**
* Init the basic styles
*/
void lv_style_init (void)
{
/* Not White/Black/Gray colors are created by HSV model with
* HUE = 210*/
/*Screen style*/
lv_style_scr.ccolor = COLOR_MAKE(0x20, 0x20, 0x20);
lv_style_scr.opa = OPA_COVER;
lv_style_scr.mcolor = COLOR_MAKE(0xc9, 0xdb, 0xee);
lv_style_scr.gcolor = COLOR_MAKE(0x4d, 0x91, 0xd5);
lv_style_scr.bcolor = COLOR_BLACK;
lv_style_scr.scolor = COLOR_GRAY;
lv_style_scr.radius = 0;
lv_style_scr.bwidth = 0;
lv_style_scr.swidth = 0;
lv_style_scr.stype = LV_STYPE_FULL;
lv_style_scr.vpad = LV_DPI / 12;
lv_style_scr.hpad = LV_DPI / 12;
lv_style_scr.opad = LV_DPI / 12;
lv_style_scr.bopa = OPA_COVER;
lv_style_scr.empty = 0;
lv_style_scr.glass = 0;
lv_style_scr.font = font_get(FONT_DEFAULT);
lv_style_scr.letter_space = 1 * LV_DOWNSCALE;
lv_style_scr.line_space = 2 * LV_DOWNSCALE;
lv_style_scr.txt_align = LV_TXT_ALIGN_LEFT;
lv_style_scr.img_recolor = OPA_TRANSP;
lv_style_scr.line_width = 1 * LV_DOWNSCALE;
/*Plain style (by default near the same as the screen style)*/
memcpy(&lv_style_plain, &lv_style_scr, sizeof(lv_style_t));
lv_style_plain.mcolor = COLOR_WHITE;
lv_style_plain.gcolor = COLOR_WHITE;
lv_style_plain.bcolor = COLOR_WHITE;
/*Plain color style*/
memcpy(&lv_style_plain_color, &lv_style_plain, sizeof(lv_style_t));
lv_style_plain_color.ccolor = COLOR_MAKE(0xf0, 0xf0, 0xf0);
lv_style_plain_color.mcolor = COLOR_MAKE(0x55, 0x96, 0xd8);
lv_style_plain_color.gcolor = lv_style_plain_color.mcolor;
/*Pretty style */
memcpy(&lv_style_pretty, &lv_style_plain, sizeof(lv_style_t));
lv_style_pretty.ccolor = COLOR_MAKE(0x20, 0x20, 0x20);
lv_style_pretty.mcolor = COLOR_WHITE;
lv_style_pretty.gcolor = COLOR_SILVER;
lv_style_pretty.bcolor = COLOR_MAKE(0x40, 0x40, 0x40);
lv_style_pretty.radius = LV_DPI / 15;
lv_style_pretty.bwidth = LV_DPI / 50 >= 1 ? LV_DPI / 50 : 1;
lv_style_pretty.bopa = OPA_50;
/*Pretty color style*/
memcpy(&lv_style_pretty_color, &lv_style_pretty, sizeof(lv_style_t));
lv_style_pretty_color.ccolor = COLOR_MAKE(0xe0, 0xe0, 0xe0);
lv_style_pretty_color.mcolor = COLOR_MAKE(0x6b, 0x9a, 0xc7);
lv_style_pretty_color.gcolor = COLOR_MAKE(0x2b, 0x59, 0x8b);
lv_style_pretty_color.bcolor = COLOR_MAKE(0x15, 0x2c, 0x42);
/*Transparent style*/
memcpy(&lv_style_transp, &lv_style_plain, sizeof(lv_style_t));
lv_style_transp.empty = 1;
lv_style_transp.bwidth = 0;
lv_style_transp.glass = 1;
/*Transparent tight style*/
memcpy(&lv_style_transp_tight, &lv_style_transp, sizeof(lv_style_t));
lv_style_transp_tight.hpad = 0;
lv_style_transp_tight.vpad = 0;
/*Button released style*/
memcpy(&lv_style_btn_rel, &lv_style_plain, sizeof(lv_style_t));
lv_style_btn_rel.mcolor = COLOR_MAKE(0x76, 0xa2, 0xd0);
lv_style_btn_rel.gcolor = COLOR_MAKE(0x19, 0x3a, 0x5d);
lv_style_btn_rel.bcolor = COLOR_MAKE(0x0b, 0x19, 0x28);
lv_style_btn_rel.ccolor = COLOR_MAKE(0xff, 0xff, 0xff);
lv_style_btn_rel.bwidth = LV_DPI / 50 >= 1 ? LV_DPI / 50 : 1;
lv_style_btn_rel.radius = LV_DPI / 15;
lv_style_btn_rel.bopa = OPA_70;
lv_style_btn_rel.scolor = COLOR_GRAY;
lv_style_btn_rel.swidth = 0;
lv_style_btn_rel.hpad = LV_DPI / 4;
lv_style_btn_rel.vpad = LV_DPI / 6;
lv_style_btn_rel.opad = LV_DPI / 10;
lv_style_btn_rel.txt_align = LV_TXT_ALIGN_MID;
/*Button pressed style*/
memcpy(&lv_style_btn_pr, &lv_style_btn_rel, sizeof(lv_style_t));
lv_style_btn_pr.mcolor = COLOR_MAKE(0x33, 0x62, 0x94);
lv_style_btn_pr.gcolor = COLOR_MAKE(0x10, 0x26, 0x3c);
lv_style_btn_pr.ccolor = COLOR_MAKE(0xa4, 0xb5, 0xc6);
/*Button toggle released style*/
memcpy(&lv_style_btn_trel, &lv_style_btn_rel, sizeof(lv_style_t));
lv_style_btn_trel.mcolor = COLOR_MAKE(0x0a, 0x11, 0x22);
lv_style_btn_trel.gcolor = COLOR_MAKE(0x37, 0x62, 0x90);
lv_style_btn_trel.bcolor = COLOR_MAKE(0x01, 0x07, 0x0d);
lv_style_btn_trel.ccolor = COLOR_MAKE(0xc8, 0xdd, 0xf4);
/*Button toggle pressed style*/
memcpy(&lv_style_btn_tpr, &lv_style_btn_rel, sizeof(lv_style_t));
lv_style_btn_tpr.mcolor = COLOR_MAKE(0x02, 0x14, 0x27);
lv_style_btn_tpr.gcolor = COLOR_MAKE(0x2b, 0x4c, 0x70);
lv_style_btn_tpr.ccolor = COLOR_MAKE(0xa4, 0xb5, 0xc6);
/*Button inactive style*/
memcpy(&lv_style_btn_ina, &lv_style_btn_rel, sizeof(lv_style_t));
lv_style_btn_ina.mcolor = COLOR_MAKE(0xd8, 0xd8, 0xd8);
lv_style_btn_ina.gcolor = COLOR_MAKE(0xd8, 0xd8, 0xd8);
lv_style_btn_ina.bcolor = COLOR_MAKE(0x90, 0x90, 0x90);
lv_style_btn_ina.ccolor = COLOR_MAKE(0x70, 0x70, 0x70);
}
/**
* Get style from its name
* @param style_name an element of the 'lv_style_name_t' enum
* @return pointer to the requested style (lv_style_def by default)
*/
lv_style_t * lv_style_get(lv_style_name_t style_name, lv_style_t * copy)
{
lv_style_t * style = &lv_style_plain;
switch(style_name) {
case LV_STYLE_SCR:
style = &lv_style_scr;
break;
case LV_STYLE_PLAIN:
style = &lv_style_plain;
break;
case LV_STYLE_PLAIN_COLOR:
style = &lv_style_plain_color;
break;
case LV_STYLE_PRETTY:
style = &lv_style_pretty;
break;
case LV_STYLE_PRETTY_COLOR:
style = &lv_style_pretty_color;
break;
case LV_STYLE_TRANSP:
style = &lv_style_transp;
break;
case LV_STYLE_TRANSP_TIGHT:
style = &lv_style_transp_tight;
break;
case LV_STYLE_BTN_REL:
style = &lv_style_btn_rel;
break;
case LV_STYLE_BTN_PR:
style = &lv_style_btn_pr;
break;
case LV_STYLE_BTN_TREL:
style = &lv_style_btn_trel;
break;
case LV_STYLE_BTN_TPR:
style = &lv_style_btn_tpr;
break;
case LV_STYLE_BTN_INA:
style = &lv_style_btn_ina;
break;
default:
style = &lv_style_plain;
}
if(copy != NULL) memcpy(copy, style, sizeof(lv_style_t));
return style;
}
/**
* Copy a style to an other
* @param dest pointer to the destination style
* @param src pointer to the source style
*/
void lv_style_cpy(lv_style_t * dest, const lv_style_t * src)
{
memcpy(dest, src, sizeof(lv_style_t));
}
/**********************
* STATIC FUNCTIONS
**********************/

114
lv_obj/lv_style.h Normal file
View File

@@ -0,0 +1,114 @@
/**
* @file lv_style.h
*
*/
#ifndef LV_STYLE_H
#define LV_STYLE_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include <stdbool.h>
#include "misc/gfx/color.h"
#include "misc/gfx/area.h"
#include "misc/gfx/font.h"
/*********************
* DEFINES
*********************/
#define LV_RADIUS_CIRCLE (CORD_MAX) /*A very big radius to always draw as circle*/
/**********************
* TYPEDEFS
**********************/
typedef enum {
LV_TXT_ALIGN_LEFT = 0,
LV_TXT_ALIGN_MID,
}lv_txt_align_t;
/*Shadow types*/
typedef enum
{
LV_STYPE_BOTTOM = 0,
LV_STYPE_FULL,
}lv_stype_t;
typedef struct
{
/*Object level styles*/
color_t ccolor; /*Content color (e.g. text or image re-color )*/
opa_t opa; /*Opacity of the object*/
uint8_t glass :1; /*1: Do not inherit this style*/
uint8_t empty :1; /*Transparent background (border drawn)*/
uint8_t stype :2; /*Shadow type from 'lv_shadow_type_t'*/
uint8_t txt_align:2;
color_t mcolor; /*Main color of background*/
color_t gcolor; /*Gradient color of background*/
color_t bcolor; /*Border color of background*/
color_t scolor; /*Shadow color of background*/
cord_t radius; /*Corner radius of background*/
cord_t bwidth; /*Width of the background border*/
cord_t swidth; /*Width of the background shadow effect*/
cord_t vpad; /*Vertical padding*/
cord_t hpad; /*Horizontal padding*/
cord_t opad; /*Object padding on the background*/
opa_t bopa; /*Opacity of background border*/
const font_t * font;
cord_t letter_space;
cord_t line_space;
opa_t img_recolor;
cord_t line_width;
}lv_style_t;
typedef enum {
LV_STYLE_SCR,
LV_STYLE_TRANSP,
LV_STYLE_TRANSP_TIGHT,
LV_STYLE_PLAIN,
LV_STYLE_PLAIN_COLOR,
LV_STYLE_PRETTY,
LV_STYLE_PRETTY_COLOR,
LV_STYLE_BTN_REL,
LV_STYLE_BTN_PR,
LV_STYLE_BTN_TREL,
LV_STYLE_BTN_TPR,
LV_STYLE_BTN_INA,
}lv_style_name_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
/**
* Init the basic styles
*/
void lv_style_init (void);
/**
* Get style from its name
* @param style_name an element of the 'lv_style_name_t' enum
* @return pointer to the requested style (lv_style_def by default)
*/
lv_style_t * lv_style_get(lv_style_name_t style_name, lv_style_t * copy);
void lv_style_cpy(lv_style_t * dest, const lv_style_t * src);
/**********************
* MACROS
**********************/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_STYLE_H*/

View File

@@ -53,8 +53,7 @@ lv_vdb_t * lv_vdb_get(void)
void lv_vdb_flush(void)
{
#if LV_ANTIALIAS == 0
disp_area(DISP_ID_ALL, vdb.vdb_area.x1 , vdb.vdb_area.y1, vdb.vdb_area.x2, vdb.vdb_area.y2);
disp_map(DISP_ID_ALL, vdb.buf);
disp_map(vdb.area.x1, vdb.area.y1, vdb.area.x2, vdb.area.y2, vdb.buf);
#else
/* Get the average of 2x2 pixels and put the result back to the VDB
* The reading goes much faster then the write back
@@ -69,25 +68,33 @@ void lv_vdb_flush(void)
* */
cord_t x;
cord_t y;
cord_t w = area_get_width(&vdb.vdb_area);
cord_t w = area_get_width(&vdb.area);
color_t * in1_buf = vdb.buf; /*Pointer to the first row*/
color_t * in2_buf = vdb.buf + w; /*Pointer to the second row*/
color_t * out_buf = vdb.buf; /*Store the result here*/
for(y = vdb.vdb_area.y1; y < vdb.vdb_area.y2; y += 2) {
for(x = vdb.vdb_area.x1; x < vdb.vdb_area.x2; x += 2) {
/*Get the average of 2x2 red*/
out_buf->red = (in1_buf->red + (in1_buf + 1)->red +
in2_buf->red + (in2_buf+ 1)->red) >> 2;
/*Get the average of 2x2 green*/
out_buf->green = (in1_buf->green + (in1_buf + 1)->green +
in2_buf->green + (in2_buf + 1)->green) >> 2;
/*Get the average of 2x2 blue*/
out_buf->blue = (in1_buf->blue + (in1_buf + 1)->blue +
in2_buf->blue + (in2_buf + 1)->blue) >> 2;
in1_buf+=2; /*Skip the next pixel because it is already used above*/
in2_buf+=2;
out_buf++;
for(y = vdb.area.y1; y < vdb.area.y2; y += 2) {
for(x = vdb.area.x1; x < vdb.area.x2; x += 2) {
/*If the pixels are the same do not calculate the average */
if(in1_buf->full == (in1_buf + 1)->full &&
in1_buf->full == in2_buf->full &&
in1_buf->full == (in2_buf + 1)->full) {
out_buf->full = in1_buf->full;
} else {
/*Get the average of 2x2 red*/
out_buf->red = (in1_buf->red + (in1_buf + 1)->red +
in2_buf->red + (in2_buf+ 1)->red) >> 2;
/*Get the average of 2x2 green*/
out_buf->green = (in1_buf->green + (in1_buf + 1)->green +
in2_buf->green + (in2_buf + 1)->green) >> 2;
/*Get the average of 2x2 blue*/
out_buf->blue = (in1_buf->blue + (in1_buf + 1)->blue +
in2_buf->blue + (in2_buf + 1)->blue) >> 2;
}
in1_buf += 2; /*Skip the next pixel because it is already used above*/
in2_buf += 2;
out_buf ++;
}
/*2 row is ready so go the next 2*/
in1_buf += w; /*Skip the next row because it is processed from in2_buf*/
@@ -96,8 +103,7 @@ void lv_vdb_flush(void)
/* Now the full the VDB is filtered and the result is stored in the first quarter of it
* Write out the filtered map to the display*/
disp_area(DISP_ID_ALL, vdb.vdb_area.x1 >> 1, vdb.vdb_area.y1 >> 1, vdb.vdb_area.x2 >> 1, vdb.vdb_area.y2 >> 1);
disp_map(DISP_ID_ALL, vdb.buf);
disp_map(vdb.area.x1 >> 1, vdb.area.y1 >> 1, vdb.area.x2 >> 1, vdb.area.y2 >> 1, vdb.buf);
#endif
}
@@ -105,6 +111,4 @@ void lv_vdb_flush(void)
* STATIC FUNCTIONS
**********************/
#endif

View File

@@ -6,6 +6,10 @@
#ifndef LV_VDB_H
#define LV_VDB_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
@@ -13,9 +17,8 @@
#if LV_VDB_SIZE != 0
#include "misc/others/color.h"
#include <lvgl/lv_misc/area.h>
#include "../lv_misc/font.h"
#include "misc/gfx/color.h"
#include "misc/gfx/area.h"
/*********************
* DEFINES
@@ -27,7 +30,7 @@
typedef struct
{
area_t vdb_area;
area_t area;
color_t buf[LV_VDB_SIZE];
}lv_vdb_t;
@@ -52,6 +55,10 @@ void lv_vdb_flush(void);
* MACROS
**********************/
#endif /*LV_VDB_SIZE != 0*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif
#endif /*LV_VDB_H*/

306
lv_objx/lv_bar.c Normal file
View File

@@ -0,0 +1,306 @@
/**
* @file lv_bar.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_conf.h"
#if USE_LV_BAR != 0
#include <lvgl/lv_objx/lv_bar.h>
#include "../lv_draw/lv_draw.h"
#include "misc/gfx/anim.h"
#include <stdio.h>
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
static bool lv_bar_design(lv_obj_t * bar, const area_t * mask, lv_design_mode_t mode);
/**********************
* STATIC VARIABLES
**********************/
static lv_design_f_t ancestor_design_f;
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/*-----------------
* Create function
*-----------------*/
/**
* Create a bar objects
* @param par pointer to an object, it will be the parent of the new bar
* @param copy pointer to a bar object, if not NULL then the new object will be copied from it
* @return pointer to the created bar
*/
lv_obj_t * lv_bar_create(lv_obj_t * par, lv_obj_t * copy)
{
/*Create the ancestor basic object*/
lv_obj_t * new_bar = lv_obj_create(par, copy);
dm_assert(new_bar);
/*Allocate the object type specific extended data*/
lv_bar_ext_t * ext = lv_obj_alloc_ext(new_bar, sizeof(lv_bar_ext_t));
dm_assert(ext);
ext->min_value = 0;
ext->max_value = 100;
ext->act_value = 0;
ext->style_indic = lv_style_get(LV_STYLE_PRETTY_COLOR, NULL);
/* Save the ancient design function.
* It will be used in the bar design function*/
if(ancestor_design_f == NULL) ancestor_design_f = lv_obj_get_design_f(new_bar);
lv_obj_set_signal_f(new_bar, lv_bar_signal);
lv_obj_set_design_f(new_bar, lv_bar_design);
/*Init the new bar object*/
if(copy == NULL) {
lv_obj_set_click(new_bar, false);
lv_obj_set_size(new_bar, LV_DPI * 2, LV_DPI / 3);
lv_obj_set_style(new_bar, lv_style_get(LV_STYLE_PRETTY, NULL));
lv_bar_set_value(new_bar, ext->act_value);
} else {
lv_bar_ext_t * ext_copy = lv_obj_get_ext(copy);
ext->min_value = ext_copy->min_value;
ext->max_value = ext_copy->max_value;
ext->act_value = ext_copy->act_value;
ext->style_indic = ext_copy->style_indic;
/*Refresh the style with new signal function*/
lv_obj_refr_style(new_bar);
lv_bar_set_value(new_bar, ext->act_value);
}
return new_bar;
}
/**
* Signal function of the bar
* @param bar pointer to a bar object
* @param sign a signal type from lv_signal_t enum
* @param param pointer to a signal specific variable
*/
bool lv_bar_signal(lv_obj_t * bar, lv_signal_t sign, void * param)
{
bool valid;
/* Include the ancient signal function */
valid = lv_obj_signal(bar, sign, param);
/* The object can be deleted so check its validity and then
* make the object specific signal handling */
if(valid != false) {
if(sign == LV_SIGNAL_REFR_EXT_SIZE) {
lv_style_t * style_indic = lv_bar_get_style_indic(bar);
if(style_indic->swidth > bar->ext_size) bar->ext_size = style_indic->swidth;
}
}
return valid;
}
/*=====================
* Setter functions
*====================*/
/**
* Set a new value on the bar
* @param bar pointer to a bar object
* @param value new value
*/
void lv_bar_set_value(lv_obj_t * bar, int16_t value)
{
lv_bar_ext_t * ext = lv_obj_get_ext(bar);
ext->act_value = value > ext->max_value ? ext->max_value : value;
ext->act_value = ext->act_value < ext->min_value ? ext->min_value : ext->act_value;
lv_obj_inv(bar);
}
/**
* Set a new value with animation on the bar
* @param bar pointer to a bar object
* @param value new value
* @param anim_time animation time in milliseconds
*/
void lv_bar_set_value_anim(lv_obj_t * bar, int16_t value, uint16_t anim_time)
{
lv_bar_ext_t * ext = lv_obj_get_ext(bar);
int16_t new_value;
new_value = value > ext->max_value ? ext->max_value : value;
new_value = new_value < ext->min_value ? ext->min_value : new_value;
anim_t a;
a.var = bar;
a.start = ext->act_value;
a.end = new_value;
a.fp = (anim_fp_t)lv_bar_set_value;
a.path = anim_get_path(ANIM_PATH_LIN);
a.end_cb = NULL;
a.act_time = 0;
a.time = anim_time;
a.playback = 0;
a.playback_pause = 0;
a.repeat = 0;
a.repeat_pause = 0;
anim_create(&a);
}
/**
* Set minimum and the maximum values of a bar
* @param bar pointer to he bar object
* @param min minimum value
* @param max maximum value
*/
void lv_bar_set_range(lv_obj_t * bar, int16_t min, int16_t max)
{
lv_bar_ext_t * ext = lv_obj_get_ext(bar);
ext->max_value = max;
ext->max_value = max;
if(ext->act_value > max) {
ext->act_value = max;
lv_bar_set_value(bar, ext->act_value);
}
lv_obj_inv(bar);
}
/**
* Set the style of bar indicator
* @param bar pointer to a bar object
* @param style pointer to a style
*/
void lv_bar_set_style_indic(lv_obj_t * bar, lv_style_t * style)
{
lv_bar_ext_t * ext = lv_obj_get_ext(bar);
ext->style_indic = style;
bar->signal_f(bar, LV_SIGNAL_REFR_EXT_SIZE, NULL);
lv_obj_inv(bar);
}
/*=====================
* Getter functions
*====================*/
/**
* Get the value of a bar
* @param bar pointer to a bar object
* @return the value of the bar
*/
int16_t lv_bar_get_value(lv_obj_t * bar)
{
lv_bar_ext_t * ext = lv_obj_get_ext(bar);
return ext->act_value;
}
/**
* Get the minimum value of a bar
* @param bar pointer to a bar object
* @return the minimum value of the bar
*/
int16_t lv_bar_get_min_value(lv_obj_t * bar)
{
lv_bar_ext_t * ext = lv_obj_get_ext(bar);
return ext->min_value;
}
/**
* Get the maximum value of a bar
* @param bar pointer to a bar object
* @return the maximum value of the bar
*/
int16_t lv_bar_get_max_value(lv_obj_t * bar)
{
lv_bar_ext_t * ext = lv_obj_get_ext(bar);
return ext->max_value;
}
/**
* Get the style of bar indicator
* @param bar pointer to a bar object
* @return pointer to the bar indicator style
*/
lv_style_t * lv_bar_get_style_indic(lv_obj_t * bar)
{
lv_bar_ext_t * ext = lv_obj_get_ext(bar);
if(ext->style_indic == NULL) return lv_obj_get_style(bar);
return ext->style_indic;
}
/**********************
* STATIC FUNCTIONS
**********************/
/**
* Handle the drawing related tasks of the bars
* @param bar pointer to an object
* @param mask the object will be drawn only in this area
* @param mode LV_DESIGN_COVER_CHK: only check if the object fully covers the 'mask_p' area
* (return 'true' if yes)
* LV_DESIGN_DRAW: draw the object (always return 'true')
* LV_DESIGN_DRAW_POST: drawing after every children are drawn
* @param return true/false, depends on 'mode'
*/
static bool lv_bar_design(lv_obj_t * bar, const area_t * mask, lv_design_mode_t mode)
{
if(mode == LV_DESIGN_COVER_CHK) {
/*Return false if the object is not covers the mask area*/
return ancestor_design_f(bar, mask, mode);;
} else if(mode == LV_DESIGN_DRAW_MAIN) {
ancestor_design_f(bar, mask, mode);
lv_bar_ext_t * ext = lv_obj_get_ext(bar);
lv_style_t * style_indic = lv_bar_get_style_indic(bar);
area_t indic_area;
area_cpy(&indic_area, &bar->cords);
indic_area.x1 += style_indic->hpad;
indic_area.x2 -= style_indic->hpad;
indic_area.y1 += style_indic->vpad;
indic_area.y2 -= style_indic->vpad;
cord_t w = area_get_width(&indic_area);
cord_t h = area_get_height(&indic_area);
if(w >= h) {
indic_area.x2 = (int32_t) ((int32_t)w * ext->act_value) / (ext->max_value - ext->min_value);
indic_area.x2 += indic_area.x1;
} else {
indic_area.y1 = (int32_t) ((int32_t)h * ext->act_value) / (ext->max_value - ext->min_value);
indic_area.y1 = indic_area.y2 - indic_area.y1;
}
/*Draw the indicator*/
lv_draw_rect(&indic_area, mask, style_indic);
}
return true;
}
#endif

131
lv_objx/lv_bar.h Normal file
View File

@@ -0,0 +1,131 @@
/**
* @file lv_bar.h
*
*/
#ifndef LV_BAR_H
#define LV_BAR_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lv_conf.h"
#if USE_LV_BAR != 0
#include "../lv_obj/lv_obj.h"
#include <lvgl/lv_objx/lv_cont.h>
#include "lv_btn.h"
#include "lv_label.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/*Data of bar*/
typedef struct
{
/*No inherited ext*/ /*Ext. of ancestor*/
/*New data for this type */
int16_t act_value; /*Current value of the bar*/
int16_t min_value; /*Minimum value of the bar*/
int16_t max_value; /*Maximum value of the bar*/
lv_style_t * style_indic; /*Style of the indicator*/
}lv_bar_ext_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
/**
* Create a bar objects
* @param par pointer to an object, it will be the parent of the new bar
* @param copy pointer to a bar object, if not NULL then the new object will be copied from it
* @return pointer to the created bar
*/
lv_obj_t * lv_bar_create(lv_obj_t * par, lv_obj_t * copy);
/**
* Signal function of the bar
* @param bar pointer to a bar object
* @param sign a signal type from lv_signal_t enum
* @param param pointer to a signal specific variable
*/
bool lv_bar_signal(lv_obj_t * bar, lv_signal_t sign, void * param);
/**
* Set a new value on the bar
* @param bar pointer to a bar object
* @param value new value
*/
void lv_bar_set_value(lv_obj_t * bar, int16_t value);
/**
* Set a new value with animation on the bar
* @param bar pointer to a bar object
* @param value new value
* @param anim_time animation time in milliseconds
*/
void lv_bar_set_value_anim(lv_obj_t * bar, int16_t value, uint16_t anim_time);
/**
* Set minimum and the maximum values of a bar
* @param bar pointer to he bar object
* @param min minimum value
* @param max maximum value
*/
void lv_bar_set_range(lv_obj_t * bar, int16_t min, int16_t max);
/**
* Set the style of bar indicator
* @param bar pointer to a bar object
* @param style pointer to a style
*/
void lv_bar_set_style_indic(lv_obj_t * bar, lv_style_t * style);
/**
* Get the value of a bar
* @param bar pointer to a bar object
* @return the value of the bar
*/
int16_t lv_bar_get_value(lv_obj_t * bar);
/**
* Get the minimum value of a bar
* @param bar pointer to a bar object
* @return the minimum value of the bar
*/
int16_t lv_bar_get_min_value(lv_obj_t * bar);
/**
* Get the maximum value of a bar
* @param bar pointer to a bar object
* @return the maximum value of the bar
*/
int16_t lv_bar_get_max_value(lv_obj_t * bar);
/**
* Get the style of bar indicator
* @param bar pointer to a bar object
* @return pointer to the bar indicator style
*/
lv_style_t * lv_bar_get_style_indic(lv_obj_t * bar);
/**********************
* MACROS
**********************/
#endif /*USE_LV_BAR*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_BAR_H*/

View File

@@ -7,16 +7,16 @@
* INCLUDES
*********************/
#include <lvgl/lv_misc/area.h>
#include <lvgl/lv_obj/lv_obj.h>
#include <misc/others/color.h>
#include <stdbool.h>
#include "lv_conf.h"
#if USE_LV_BTN != 0
#include <string.h>
#include "lv_btn.h"
#include "lvgl/lv_obj/lv_obj.h"
#include "misc/gfx/area.h"
#include "misc/gfx/color.h"
#include "../lv_draw/lv_draw.h"
#include "lv_btn.h"
#include <stdbool.h>
#include <string.h>
/*********************
* DEFINES
@@ -29,18 +29,13 @@
/**********************
* STATIC PROTOTYPES
**********************/
#if 0
static bool lv_btn_design(lv_obj_t * btn, const area_t * mask, lv_design_mode_t mode);
static void lv_btn_style_load(lv_obj_t * btn, lv_rects_t * new_rects);
static void lv_btns_init(void);
#endif
/**********************
* STATIC VARIABLES
**********************/
static lv_btns_t lv_btns_def;
static lv_btns_t lv_btns_transp;
static lv_btns_t lv_btns_border;
static lv_design_f_t ancestor_design_f;
/**********************
* MACROS
@@ -60,7 +55,7 @@ lv_obj_t * lv_btn_create(lv_obj_t * par, lv_obj_t * copy)
{
lv_obj_t * new_btn;
new_btn = lv_rect_create(par, copy);
new_btn = lv_cont_create(par, copy);
dm_assert(new_btn);
/*Allocate the extended data*/
lv_btn_ext_t * ext = lv_obj_alloc_ext(new_btn, sizeof(lv_btn_ext_t));
@@ -70,18 +65,20 @@ lv_obj_t * lv_btn_create(lv_obj_t * par, lv_obj_t * copy)
ext->rel_action = NULL;
ext->lpr_action = NULL;
ext->lpr_rep_action = NULL;
ext->styles[LV_BTN_STATE_REL] = lv_style_get(LV_STYLE_BTN_REL, NULL);
ext->styles[LV_BTN_STATE_PR] = lv_style_get(LV_STYLE_BTN_PR, NULL);
ext->styles[LV_BTN_STATE_TREL] = lv_style_get(LV_STYLE_BTN_TREL, NULL);
ext->styles[LV_BTN_STATE_TPR] = lv_style_get(LV_STYLE_BTN_TPR, NULL);
ext->styles[LV_BTN_STATE_INA] = lv_style_get(LV_STYLE_BTN_INA, NULL);
ext->lpr_exec = 0;
ext->tgl = 0;
if(ancestor_design_f == NULL) ancestor_design_f = lv_obj_get_design_f(new_btn);
lv_obj_set_signal_f(new_btn, lv_btn_signal);
lv_obj_set_design_f(new_btn, lv_btn_design);
/*If no copy do the basic initialization*/
if(copy == NULL) {
lv_rect_set_layout(new_btn, LV_RECT_LAYOUT_CENTER);
lv_obj_set_style(new_btn, lv_btns_get(LV_BTNS_DEF, NULL));
lv_cont_set_layout(new_btn, LV_CONT_LAYOUT_CENTER);
lv_obj_set_style(new_btn, ext->styles[LV_BTN_STATE_REL]);
}
/*Copy 'copy'*/
else {
@@ -91,6 +88,11 @@ lv_obj_t * lv_btn_create(lv_obj_t * par, lv_obj_t * copy)
ext->rel_action = copy_ext->rel_action;
ext->lpr_action = copy_ext->lpr_action;
ext->lpr_rep_action = copy_ext->lpr_action;
ext->styles[LV_BTN_STATE_REL] = copy_ext->styles[LV_BTN_STATE_REL];
ext->styles[LV_BTN_STATE_PR] = copy_ext->styles[LV_BTN_STATE_PR];
ext->styles[LV_BTN_STATE_TREL] = copy_ext->styles[LV_BTN_STATE_TREL];
ext->styles[LV_BTN_STATE_TPR] = copy_ext->styles[LV_BTN_STATE_TPR];
ext->styles[LV_BTN_STATE_INA] = copy_ext->styles[LV_BTN_STATE_INA];
ext->tgl = copy_ext->tgl;
/*Refresh the style with new signal function*/
@@ -111,90 +113,78 @@ bool lv_btn_signal(lv_obj_t * btn, lv_signal_t sign, void * param)
bool valid;
/* Include the ancient signal function */
valid = lv_rect_signal(btn, sign, param);
valid = lv_cont_signal(btn, sign, param);
/* The object can be deleted so check its validity and then
* make the object specific signal handling */
if(valid != false) {
lv_btn_ext_t * ext = lv_obj_get_ext(btn);
lv_btn_state_t state = lv_btn_get_state(btn);
lv_btn_ext_t * ext = lv_obj_get_ext(btn);
bool tgl = lv_btn_get_tgl(btn);
switch (sign) {
case LV_SIGNAL_PRESSED:
/*Refresh the state*/
if(ext->state == LV_BTN_STATE_REL) {
lv_btn_set_state(btn, LV_BTN_STATE_PR);
} else if(ext->state == LV_BTN_STATE_TGL_REL) {
lv_btn_set_state(btn, LV_BTN_STATE_TGL_PR);
}
if(sign == LV_SIGNAL_PRESSED) {
/*Refresh the state*/
if(ext->state == LV_BTN_STATE_REL) {
lv_btn_set_state(btn, LV_BTN_STATE_PR);
} else if(ext->state == LV_BTN_STATE_TREL) {
lv_btn_set_state(btn, LV_BTN_STATE_TPR);
}
ext->lpr_exec = 0;
/*Call the press action, here 'param' is the caller dispi*/
if(ext->pr_action != NULL && state != LV_BTN_STATE_INA) {
valid = ext->pr_action(btn, param);
}
break;
case LV_SIGNAL_PRESS_LOST:
/*Refresh the state*/
ext->lpr_exec = 0;
/*Call the press action, 'param' is the caller dispi*/
if(ext->pr_action != NULL && state != LV_BTN_STATE_INA) {
valid = ext->pr_action(btn, param);
}
}
else if(sign == LV_SIGNAL_PRESS_LOST) {
/*Refresh the state*/
if(ext->state == LV_BTN_STATE_PR) lv_btn_set_state(btn, LV_BTN_STATE_REL);
else if(ext->state == LV_BTN_STATE_TPR) lv_btn_set_state(btn, LV_BTN_STATE_TREL);
}
else if(sign == LV_SIGNAL_PRESSING) {
/*When the button begins to drag revert pressed states to released*/
if(lv_dispi_is_dragging(param) != false) {
if(ext->state == LV_BTN_STATE_PR) lv_btn_set_state(btn, LV_BTN_STATE_REL);
else if(ext->state == LV_BTN_STATE_TGL_PR) lv_btn_set_state(btn, LV_BTN_STATE_TGL_REL);
lv_obj_inv(btn);
break;
case LV_SIGNAL_PRESSING:
/*When the button begins to drag revert pressed states to released*/
if(lv_dispi_is_dragging(param) != false) {
if(ext->state == LV_BTN_STATE_PR) lv_btn_set_state(btn, LV_BTN_STATE_REL);
else if(ext->state == LV_BTN_STATE_TGL_PR) lv_btn_set_state(btn, LV_BTN_STATE_TGL_REL);
}
lv_obj_inv(btn);
break;
case LV_SIGNAL_RELEASED:
/*If not dragged and it was not long press action then
*change state and run the action*/
if(lv_dispi_is_dragging(param) == false && ext->lpr_exec == 0) {
if(ext->state == LV_BTN_STATE_PR && tgl == false) {
lv_btn_set_state(btn, LV_BTN_STATE_REL);
} else if(ext->state == LV_BTN_STATE_TGL_PR && tgl == false) {
lv_btn_set_state(btn, LV_BTN_STATE_TGL_REL);
} else if(ext->state == LV_BTN_STATE_PR && tgl == true) {
lv_btn_set_state(btn, LV_BTN_STATE_TGL_REL);
} else if(ext->state == LV_BTN_STATE_TGL_PR && tgl == true) {
lv_btn_set_state(btn, LV_BTN_STATE_REL);
}
if(ext->rel_action != NULL && state != LV_BTN_STATE_INA) {
valid = ext->rel_action(btn, param);
}
} else { /*If dragged change back the state*/
if(ext->state == LV_BTN_STATE_PR) {
lv_btn_set_state(btn, LV_BTN_STATE_REL);
} else if(ext->state == LV_BTN_STATE_TGL_PR) {
lv_btn_set_state(btn, LV_BTN_STATE_TGL_REL);
}
lv_obj_inv(btn);
else if(ext->state == LV_BTN_STATE_TPR) lv_btn_set_state(btn, LV_BTN_STATE_TREL);
}
}
else if(sign == LV_SIGNAL_RELEASED) {
/*If not dragged and it was not long press action then
*change state and run the action*/
if(lv_dispi_is_dragging(param) == false && ext->lpr_exec == 0) {
if(ext->state == LV_BTN_STATE_PR && tgl == false) {
lv_btn_set_state(btn, LV_BTN_STATE_REL);
} else if(ext->state == LV_BTN_STATE_TPR && tgl == false) {
lv_btn_set_state(btn, LV_BTN_STATE_TREL);
} else if(ext->state == LV_BTN_STATE_PR && tgl == true) {
lv_btn_set_state(btn, LV_BTN_STATE_TREL);
} else if(ext->state == LV_BTN_STATE_TPR && tgl == true) {
lv_btn_set_state(btn, LV_BTN_STATE_REL);
}
break;
case LV_SIGNAL_LONG_PRESS:
/*Call the long press action, here 'param' is the caller dispi*/
if(ext->rel_action != NULL && state != LV_BTN_STATE_INA) {
valid = ext->rel_action(btn, param);
}
} else { /*If dragged change back the state*/
if(ext->state == LV_BTN_STATE_PR) {
lv_btn_set_state(btn, LV_BTN_STATE_REL);
} else if(ext->state == LV_BTN_STATE_TPR) {
lv_btn_set_state(btn, LV_BTN_STATE_TREL);
}
}
}
else if(sign == LV_SIGNAL_LONG_PRESS) {
/*Call the long press action, 'param' is the caller dispi*/
if(ext->lpr_action != NULL && state != LV_BTN_STATE_INA) {
ext->lpr_exec = 1;
ext->lpr_exec = 1;
valid = ext->lpr_action(btn, param);
}
break;
case LV_SIGNAL_LONG_PRESS_REP:
/*Call the release action, here 'param' is the caller dispi*/
if(ext->lpr_rep_action != NULL && state != LV_BTN_STATE_INA) {
valid = ext->lpr_rep_action(btn, param);
}
break;
default:
/*Do nothing*/
break;
}
else if(sign == LV_SIGNAL_LONG_PRESS_REP) {
/*Call the release action, 'param' is the caller dispi*/
if(ext->lpr_rep_action != NULL && state != LV_BTN_STATE_INA) {
valid = ext->lpr_rep_action(btn, param);
}
}
}
@@ -227,7 +217,7 @@ void lv_btn_set_state(lv_obj_t * btn, lv_btn_state_t state)
lv_btn_ext_t * ext = lv_obj_get_ext(btn);
if(ext->state != state) {
ext->state = state;
lv_obj_inv(btn);
lv_obj_set_style(btn, ext->styles[state]);
}
}
@@ -278,6 +268,31 @@ void lv_btn_set_lpr_rep_action(lv_obj_t * btn, lv_action_t lpr_rep_action)
ext->lpr_rep_action = lpr_rep_action;
}
/**
* Set styles of a button is each state
* @param btn pointer to button object
* @param rel pointer to a style for releases state
* @param pr pointer to a style for pressed state
* @param trel pointer to a style for toggled releases state
* @param tpr pointer to a style for toggled pressed state
* @param ina pointer to a style for inactive state
*/
void lv_btn_set_styles(lv_obj_t * btn, lv_style_t * rel, lv_style_t * pr,
lv_style_t * trel, lv_style_t * tpr,
lv_style_t * ina)
{
lv_btn_ext_t * ext = lv_obj_get_ext(btn);
ext->styles[LV_BTN_STATE_REL] = rel;
ext->styles[LV_BTN_STATE_PR] = pr;
ext->styles[LV_BTN_STATE_TREL] = trel;
ext->styles[LV_BTN_STATE_TPR] = tpr;
ext->styles[LV_BTN_STATE_INA] = ina;
lv_obj_set_style(btn, ext->styles[ext->state]);
}
/*=====================
* Getter functions
*====================*/
@@ -307,49 +322,26 @@ bool lv_btn_get_tgl(lv_obj_t * btn)
}
/**
* Return with a pointer to a built-in style and/or copy it to a variable
* @param style a style name from lv_btns_builtin_t enum
* @param copy copy the style to this variable. (NULL if unused)
* @return pointer to an lv_btns_t style
* Get the style of a button in a given state
* @param btn pointer to a button object
* @param state a state from 'lv_btn_state_t' in which style should be get
* @return pointer to the style in the given state
*/
lv_btns_t * lv_btns_get(lv_btns_builtin_t style, lv_btns_t * copy)
lv_style_t * lv_btn_get_style(lv_obj_t * btn, lv_btn_state_t state)
{
static bool style_inited = false;
lv_btn_ext_t * ext = lv_obj_get_ext(btn);
/*Make the style initialization if it is not done yet*/
if(style_inited == false) {
lv_btns_init();
style_inited = true;
}
if(ext->styles[state] == NULL) return lv_obj_get_style(btn->par);
lv_btns_t * style_p;
switch(style) {
case LV_BTNS_DEF:
style_p = &lv_btns_def;
break;
case LV_BTNS_TRANSP:
style_p = &lv_btns_transp;
break;
case LV_BTNS_BORDER:
style_p = &lv_btns_border;
break;
default:
style_p = &lv_btns_def;
}
if(copy != NULL) {
if(style_p != NULL) memcpy(copy, style_p, sizeof(lv_btns_t));
else memcpy(copy, &lv_btns_def, sizeof(lv_btns_t));
}
return style_p;
return ext->styles[state];
}
/**********************
* STATIC FUNCTIONS
**********************/
#if 0
/**
* Handle the drawing related tasks of the buttons
* @param btn pointer to a button object
@@ -365,161 +357,12 @@ static bool lv_btn_design(lv_obj_t * btn, const area_t * mask, lv_design_mode_t
/* Because of the radius it is not sure the area is covered*/
if(mode == LV_DESIGN_COVER_CHK) {
/*Temporally set a rectangle style for the button to look like as rectangle*/
lv_rects_t rects_tmp;
lv_btns_t * btns_tmp = lv_obj_get_style(btn);
bool ret = false;
lv_btn_style_load(btn, &rects_tmp);
if(rects_tmp.objs.transp == 0) {
btn->style_p = &rects_tmp;
ret = ancestor_design_f(btn, mask, mode); /*Draw the rectangle*/
btn->style_p = btns_tmp; /*Reload the original button style*/
}
return ret;
} else if(mode == LV_DESIGN_DRAW_MAIN || mode == LV_DESIGN_DRAW_POST) {
area_t area;
lv_obj_get_cords(btn, &area);
return false;
} else if(mode == LV_DESIGN_DRAW_MAIN || mode == LV_DESIGN_DRAW_POST) {
/*Temporally set a rectangle style for the button to draw it as rectangle*/
lv_rects_t rects_tmp;
lv_btns_t * btns_tmp = lv_obj_get_style(btn);
lv_btn_style_load(btn, &rects_tmp);
if(rects_tmp.objs.transp == 0) {
btn->style_p = &rects_tmp;
ancestor_design_f(btn, mask, mode); /*Draw the rectangle*/
btn->style_p = btns_tmp; /*Reload the original button style*/
}
}
return true;
}
/**
* Crate a rectangle style according to the state of the button
* @param btn pointer to a button object
* @param new_rects load the style here (pointer to a rectangle style)
*/
static void lv_btn_style_load(lv_obj_t * btn, lv_rects_t * new_rects)
{
lv_btn_state_t state = lv_btn_get_state(btn);
lv_btns_t * style = lv_obj_get_style(btn);
/*Load the style*/
memcpy(new_rects, &style->rects, sizeof(lv_rects_t));
new_rects->objs.color = style->mcolor[state];
new_rects->gcolor = style->gcolor[state];
new_rects->bcolor = style->bcolor[state];
new_rects->lcolor = style->lcolor[state];
new_rects->empty = style->flags[state].empty;
new_rects->objs.transp = style->flags[state].transp;
if(style->flags[state].light_en != 0) new_rects->light = style->rects.light;
else new_rects->light = 0;
}
/**
* Initialize the button styles
*/
static void lv_btns_init(void)
{
/*Default style*/
lv_btns_def.mcolor[LV_BTN_STATE_REL] = COLOR_MAKE(0x60, 0x88, 0xb0);
lv_btns_def.gcolor[LV_BTN_STATE_REL] = COLOR_MAKE(0x20, 0x30, 0x40);
lv_btns_def.bcolor[LV_BTN_STATE_REL] = COLOR_MAKE(0xff, 0xff, 0xff);
lv_btns_def.lcolor[LV_BTN_STATE_REL] = COLOR_MAKE(0x30, 0x40, 0x50);
lv_btns_def.flags[LV_BTN_STATE_REL].light_en = 0;
lv_btns_def.flags[LV_BTN_STATE_REL].transp = 0;
lv_btns_def.flags[LV_BTN_STATE_REL].empty = 0;
lv_btns_def.mcolor[LV_BTN_STATE_PR] =COLOR_MAKE(0x50, 0x68, 0x80);
lv_btns_def.gcolor[LV_BTN_STATE_PR] = COLOR_MAKE(0x18, 0x20, 0x28);
lv_btns_def.bcolor[LV_BTN_STATE_PR] = COLOR_MAKE(0x60, 0x80, 0xa0);
lv_btns_def.lcolor[LV_BTN_STATE_PR] = COLOR_MAKE(0x30, 0x40, 0x50);
lv_btns_def.flags[LV_BTN_STATE_PR].light_en = 0;
lv_btns_def.flags[LV_BTN_STATE_PR].transp = 0;
lv_btns_def.flags[LV_BTN_STATE_PR].empty = 0;
lv_btns_def.mcolor[LV_BTN_STATE_TGL_REL] = COLOR_MAKE(0x40, 0x60, 0x80);
lv_btns_def.gcolor[LV_BTN_STATE_TGL_REL] = COLOR_MAKE(0x10, 0x18, 0x20);
lv_btns_def.bcolor[LV_BTN_STATE_TGL_REL] = COLOR_MAKE(0x20, 0x30, 0x40);
lv_btns_def.lcolor[LV_BTN_STATE_TGL_REL] = COLOR_MAKE(0x30, 0x40, 0x50);
lv_btns_def.flags[LV_BTN_STATE_TGL_REL].light_en = 1;
lv_btns_def.flags[LV_BTN_STATE_TGL_REL].transp = 0;
lv_btns_def.flags[LV_BTN_STATE_TGL_REL].empty = 0;
lv_btns_def.mcolor[LV_BTN_STATE_TGL_PR] = COLOR_MAKE(0x60, 0x80, 0xa0);
lv_btns_def.gcolor[LV_BTN_STATE_TGL_PR] = COLOR_MAKE(0x20, 0x30, 0x40);
lv_btns_def.bcolor[LV_BTN_STATE_TGL_PR] = COLOR_MAKE(0x20, 0x30, 0x40);
lv_btns_def.lcolor[LV_BTN_STATE_TGL_PR] = COLOR_MAKE(0x30, 0x40, 0x50);
lv_btns_def.flags[LV_BTN_STATE_TGL_PR].light_en = 1;
lv_btns_def.flags[LV_BTN_STATE_TGL_PR].transp = 0;
lv_btns_def.flags[LV_BTN_STATE_TGL_PR].empty = 0;
lv_btns_def.mcolor[LV_BTN_STATE_INA] = COLOR_SILVER;
lv_btns_def.gcolor[LV_BTN_STATE_INA] = COLOR_GRAY;
lv_btns_def.bcolor[LV_BTN_STATE_INA] = COLOR_WHITE;
lv_btns_def.lcolor[LV_BTN_STATE_INA] = COLOR_MAKE(0x30, 0x40, 0x50);
lv_btns_def.flags[LV_BTN_STATE_INA].light_en = 0;
lv_btns_def.flags[LV_BTN_STATE_INA].transp= 0;
lv_btns_def.flags[LV_BTN_STATE_INA].empty = 0;
lv_btns_def.rects.objs.color = lv_btns_def.mcolor[LV_BTN_STATE_REL];
lv_btns_def.rects.gcolor = lv_btns_def.gcolor[LV_BTN_STATE_REL];
lv_btns_def.rects.bcolor = lv_btns_def.bcolor[LV_BTN_STATE_REL];
lv_btns_def.rects.objs.transp = 0;
lv_btns_def.rects.empty = 0;
lv_btns_def.rects.light = 6 * LV_DOWNSCALE;
lv_btns_def.rects.bwidth = 2 * LV_DOWNSCALE;
lv_btns_def.rects.bopa = 70;
lv_btns_def.rects.empty = 0;
lv_btns_def.rects.round = 4 * LV_DOWNSCALE;
lv_btns_def.rects.hpad = 10 * LV_DOWNSCALE;
lv_btns_def.rects.vpad = 15 * LV_DOWNSCALE;
lv_btns_def.rects.opad = 10 * LV_DOWNSCALE;
/*Transparent style*/
memcpy(&lv_btns_transp, &lv_btns_def, sizeof(lv_btns_t));
lv_btns_transp.rects.bwidth = 0;
lv_btns_transp.flags[LV_BTN_STATE_REL].transp = 1;
lv_btns_transp.flags[LV_BTN_STATE_REL].empty = 1;
lv_btns_transp.flags[LV_BTN_STATE_REL].light_en = 0;
lv_btns_transp.flags[LV_BTN_STATE_PR].transp = 1;
lv_btns_transp.flags[LV_BTN_STATE_PR].empty = 1;
lv_btns_transp.flags[LV_BTN_STATE_PR].light_en = 0;
lv_btns_transp.flags[LV_BTN_STATE_TGL_REL].transp = 1;
lv_btns_transp.flags[LV_BTN_STATE_TGL_REL].empty = 1;
lv_btns_transp.flags[LV_BTN_STATE_TGL_REL].light_en = 0;
lv_btns_transp.flags[LV_BTN_STATE_TGL_PR].transp = 1;
lv_btns_transp.flags[LV_BTN_STATE_TGL_PR].empty = 1;
lv_btns_transp.flags[LV_BTN_STATE_TGL_PR].light_en = 0;
lv_btns_transp.flags[LV_BTN_STATE_INA].transp = 1;
lv_btns_transp.flags[LV_BTN_STATE_INA].empty = 1;
lv_btns_transp.flags[LV_BTN_STATE_INA].light_en = 0;
/*Border style*/
memcpy(&lv_btns_border, &lv_btns_def, sizeof(lv_btns_t));
lv_btns_border.bcolor[LV_BTN_STATE_REL] = COLOR_BLACK;
lv_btns_border.bcolor[LV_BTN_STATE_PR] = COLOR_BLACK;
lv_btns_border.bcolor[LV_BTN_STATE_TGL_REL] = COLOR_BLACK;
lv_btns_border.bcolor[LV_BTN_STATE_TGL_PR] = COLOR_BLACK;
lv_btns_border.bcolor[LV_BTN_STATE_INA] = COLOR_GRAY;
lv_btns_border.flags[LV_BTN_STATE_REL].empty = 1;
lv_btns_border.flags[LV_BTN_STATE_PR].empty = 0;
lv_btns_border.flags[LV_BTN_STATE_TGL_REL].empty = 0;
lv_btns_border.flags[LV_BTN_STATE_TGL_PR].empty = 0;
lv_btns_border.flags[LV_BTN_STATE_INA].empty = 1;
lv_btns_border.flags[LV_BTN_STATE_REL].light_en = 0;
lv_btns_border.flags[LV_BTN_STATE_PR].light_en = 0;
lv_btns_border.flags[LV_BTN_STATE_TGL_REL].light_en = 0;
lv_btns_border.flags[LV_BTN_STATE_TGL_PR].light_en = 0;
lv_btns_border.flags[LV_BTN_STATE_INA].light_en = 0;
lv_btns_border.rects.bwidth = 1 * LV_DOWNSCALE;
lv_btns_border.rects.bopa = 50;
lv_btns_border.rects.round = 4 * LV_DOWNSCALE;
lv_btns_border.rects.hpad = 10 * LV_DOWNSCALE;
lv_btns_border.rects.vpad = 10 * LV_DOWNSCALE;
}
#endif
#endif

View File

@@ -6,6 +6,10 @@
#ifndef LV_BTN_H
#define LV_BTN_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
@@ -13,11 +17,11 @@
#if USE_LV_BTN != 0
/*Testing of dependencies*/
#if USE_LV_RECT == 0
#error "lv_btn: lv_rect is required. Enable it in lv_conf.h (USE_LV_RECT 1) "
#if USE_LV_CONT == 0
#error "lv_btn: lv_cont is required. Enable it in lv_conf.h (USE_LV_CONT 1) "
#endif
#include "lv_rect.h"
#include <lvgl/lv_objx/lv_cont.h>
#include "../lv_obj/lv_dispi.h"
/*********************
@@ -28,12 +32,13 @@
* TYPEDEFS
**********************/
/*Button states*/
typedef enum
{
LV_BTN_STATE_PR,
LV_BTN_STATE_REL,
LV_BTN_STATE_TGL_PR,
LV_BTN_STATE_TGL_REL,
LV_BTN_STATE_PR,
LV_BTN_STATE_TREL,
LV_BTN_STATE_TPR,
LV_BTN_STATE_INA,
LV_BTN_STATE_NUM,
}lv_btn_state_t;
@@ -41,46 +46,20 @@ typedef enum
/*Data of button*/
typedef struct
{
lv_rect_ext_t rect_ext; /*Ext. of ancestor*/
lv_cont_ext_t cont; /*Ext. of ancestor*/
/*New data for this type */
lv_action_t pr_action;
lv_action_t rel_action;
lv_action_t lpr_action;
lv_action_t lpr_rep_action;
lv_action_t pr_action; /*A function to call when the button is pressed (NULL if unused)*/
lv_action_t rel_action; /*A function to call when the button is released (NULL if unused)*/
lv_action_t lpr_action; /*A function to call when the button is long pressed (NULL if unused)*/
lv_action_t lpr_rep_action; /*A function to call periodically after long press (NULL if unused)*/
lv_btn_state_t state;
uint8_t tgl :1; /*1: Toggle enabled*/
uint8_t lpr_exec :1; /*1: long press action executed (Not for user)*/
lv_style_t * styles[LV_BTN_STATE_NUM]; /*Styles in each state*/
lv_btn_state_t state; /*Current state of the button from 'lv_btn_state_t' enum*/
uint8_t tgl :1; /*1: Toggle enabled*/
uint8_t lpr_exec :1; /*1: Long press action executed (Handled by the library)*/
}lv_btn_ext_t;
/*Bits of 'flag' in 'lv_btns_t'*/
typedef struct
{
uint8_t light_en :1;
uint8_t transp :1;
uint8_t empty :1;
}lv_btns_bits_t;
/*Style of button*/
typedef struct
{
lv_rects_t rects; /*Style of ancestor*/
/*New style element for this type */
color_t mcolor[LV_BTN_STATE_NUM];
color_t gcolor[LV_BTN_STATE_NUM];
color_t bcolor[LV_BTN_STATE_NUM];
color_t lcolor[LV_BTN_STATE_NUM];
lv_btns_bits_t flags[LV_BTN_STATE_NUM];
}lv_btns_t;
/*Built-in styles of button*/
typedef enum
{
LV_BTNS_DEF,
LV_BTNS_TRANSP,
LV_BTNS_BORDER,
}lv_btns_builtin_t;
/**********************
* GLOBAL PROTOTYPES
@@ -144,6 +123,17 @@ void lv_btn_set_lpr_action(lv_obj_t * btn, lv_action_t lpr_action);
*/
void lv_btn_set_lpr_rep_action(lv_obj_t * btn, lv_action_t lpr_rep_action);
/**
* Set styles of a button is each state
* @param btn pointer to button object
* @param rel pointer to a style for releases state
* @param pr pointer to a style for pressed state
* @param trel pointer to a style for toggled releases state
* @param tpr pointer to a style for toggled pressed state
* @param ina pointer to a style for inactive state
*/
void lv_btn_set_styles(lv_obj_t * btn, lv_style_t * rel, lv_style_t * pr, lv_style_t * trel, lv_style_t * tpr, lv_style_t * ina);
/**
* Get the current state of the button
* @param btn pointer to a button object
@@ -159,17 +149,21 @@ lv_btn_state_t lv_btn_get_state(lv_obj_t * btn);
bool lv_btn_get_tgl(lv_obj_t * btn);
/**
* Return with a pointer to a built-in style and/or copy it to a variable
* @param style a style name from lv_btns_builtin_t enum
* @param copy copy the style to this variable. (NULL if unused)
* @return pointer to an lv_btns_t style
* Get the style of a button in a given state
* @param btn pointer to a button object
* @param state a state from 'lv_btn_state_t' in which style should be get
* @return pointer to the style in the given state
*/
lv_btns_t * lv_btns_get(lv_btns_builtin_t style, lv_btns_t * copy);
lv_style_t * lv_btn_get_style(lv_obj_t * btn, lv_btn_state_t state);
/**********************
* MACROS
**********************/
#endif /*USE_LV_BTN*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif
#endif /*LV_BTN_H*/

View File

@@ -10,14 +10,14 @@
#if USE_LV_BTNM != 0
#include "lv_btnm.h"
#include "misc/gfx/text.h"
#include "../lv_draw/lv_draw.h"
#include "../lv_misc/text.h"
#include "../lv_obj/lv_refr.h"
/*********************
* DEFINES
*********************/
#define LV_BTNM_BTN_PR_INVALID 0xFFFF
#define LV_BTNM_PR_NONE 0xFFFF
/**********************
* TYPEDEFS
@@ -26,18 +26,14 @@
/**********************
* STATIC PROTOTYPES
**********************/
static bool lv_btnm_design(lv_obj_t * btnm, const area_t * mask, lv_design_mode_t mode);
static uint8_t lv_btnm_get_width_unit(const char * btn_str);
static uint16_t lv_btnm_get_btn_from_point(lv_obj_t * btnm, point_t * p);
static void lv_btnm_create_btns(lv_obj_t * btnm, const char ** map);
static void lv_btnms_init(void);
/**********************
* STATIC VARIABLES
**********************/
static lv_btnms_t lv_btnms_def;
static const char * lv_btnm_def_map[] = {"Btn1","Btn2", "Btn3","\n",
"\002Btn4","Btn5", ""};
@@ -64,33 +60,38 @@ static lv_design_f_t ancestor_design_f;
lv_obj_t * lv_btnm_create(lv_obj_t * par, lv_obj_t * copy)
{
/*Create the ancestor object*/
lv_obj_t * new_btnm = lv_rect_create(par, copy);
lv_obj_t * new_btnm = lv_cont_create(par, copy);
dm_assert(new_btnm);
/*Allocate the object type specific extended data*/
lv_btnm_ext_t * ext = lv_obj_alloc_ext(new_btnm, sizeof(lv_btnm_ext_t));
dm_assert(ext);
ext->btn_cnt = 0;
ext->btn_pr = LV_BTNM_BTN_PR_INVALID;
ext->btn_pr = LV_BTNM_PR_NONE;
ext->btn_areas = NULL;
ext->cb = NULL;
ext->map_p = NULL;
ext->style_btn_rel = lv_style_get(LV_STYLE_BTN_REL, NULL);
ext->style_btn_pr = lv_style_get(LV_STYLE_BTN_PR, NULL);
if(ancestor_design_f == NULL) ancestor_design_f = lv_obj_get_design_f(new_btnm);
lv_obj_set_signal_f(new_btnm, lv_btnm_signal);
lv_obj_set_design_f(new_btnm, lv_btnm_design);
/*Init the new button matrix object*/
if(copy == NULL) {
lv_obj_set_size(new_btnm, LV_HOR_RES / 2, LV_VER_RES / 2);
lv_obj_set_style(new_btnm, lv_btnms_get(LV_BTNMS_DEF, NULL));
lv_obj_set_size(new_btnm, LV_HOR_RES, LV_VER_RES / 2);
lv_obj_set_style(new_btnm, lv_style_get(LV_STYLE_PLAIN, NULL));
lv_btnm_set_map(new_btnm, lv_btnm_def_map);
}
/*Copy an existing object*/
else {
lv_btnm_ext_t * copy_ext = lv_obj_get_ext(copy);
ext->style_btn_rel = copy_ext->style_btn_rel;
ext->style_btn_pr = copy_ext->style_btn_pr;
lv_btnm_set_map(new_btnm, lv_btnm_get_map(copy));
ext->cb = copy_ext->cb;
}
return new_btnm;
@@ -108,83 +109,84 @@ bool lv_btnm_signal(lv_obj_t * btnm, lv_signal_t sign, void * param)
bool valid;
/* Include the ancient signal function */
valid = lv_rect_signal(btnm, sign, param);
valid = lv_cont_signal(btnm, sign, param);
/* The object can be deleted so check its validity and then
* make the object specific signal handling */
if(valid != false) {
lv_btnm_ext_t * ext = lv_obj_get_ext(btnm);
uint16_t new_btn;
area_t btnm_area;
area_t btn_area;
point_t p;
switch(sign) {
case LV_SIGNAL_CLEANUP:
dm_free(ext->btn_areas);
break;
case LV_SIGNAL_STYLE_CHG:
case LV_SIGNAL_CORD_CHG:
lv_btnm_set_map(btnm, LV_EA(btnm, lv_btnm_ext_t)->map_p);
break;
case LV_SIGNAL_PRESSING:
/*Search the pressed area*/
lv_dispi_get_point(param, &p);
new_btn = lv_btnm_get_btn_from_point(btnm, &p);
/*Invalidate to old and the new areas*/;
lv_obj_get_cords(btnm, &btnm_area);
if(new_btn != ext->btn_pr) {
lv_dispi_reset_lpr(param);
if(ext->btn_pr != LV_BTNM_BTN_PR_INVALID) {
area_cpy(&btn_area, &ext->btn_areas[ext->btn_pr]);
btn_area.x1 += btnm_area.x1;
btn_area.y1 += btnm_area.y1;
btn_area.x2 += btnm_area.x1;
btn_area.y2 += btnm_area.y1;
lv_inv_area(&btn_area);
}
if(new_btn != LV_BTNM_BTN_PR_INVALID) {
area_cpy(&btn_area, &ext->btn_areas[new_btn]);
btn_area.x1 += btnm_area.x1;
btn_area.y1 += btnm_area.y1;
btn_area.x2 += btnm_area.x1;
btn_area.y2 += btnm_area.y1;
lv_inv_area(&btn_area);
}
}
ext->btn_pr = new_btn;
break;
case LV_SIGNAL_RELEASED:
case LV_SIGNAL_LONG_PRESS_REP:
if(ext->cb != NULL &&
ext->btn_pr != LV_BTNM_BTN_PR_INVALID) {
uint16_t txt_i = 0;
uint16_t btn_i = 0;
/*Search the next valid text in the map*/
while(btn_i != ext->btn_pr) {
btn_i ++;
txt_i ++;
if(strcmp(ext->map_p[txt_i], "\n") == 0) txt_i ++;
}
ext->cb(btnm, txt_i);
}
if(sign == LV_SIGNAL_RELEASED && ext->btn_pr != LV_BTNM_BTN_PR_INVALID) {
/*Invalidate to old area*/;
lv_obj_get_cords(btnm, &btnm_area);
if(sign == LV_SIGNAL_CLEANUP) {
dm_free(ext->btn_areas);
}
else if(sign == LV_SIGNAL_STYLE_CHG || sign == LV_SIGNAL_CORD_CHG) {
lv_btnm_set_map(btnm, ext->map_p);
}
else if(sign == LV_SIGNAL_PRESSING) {
uint16_t btn_pr;
/*Search the pressed area*/
lv_dispi_get_point(param, &p);
btn_pr = lv_btnm_get_btn_from_point(btnm, &p);
/*Invalidate to old and the new areas*/;
lv_obj_get_cords(btnm, &btnm_area);
if(btn_pr != ext->btn_pr) {
lv_dispi_reset_lpr(param);
if(ext->btn_pr != LV_BTNM_PR_NONE) {
area_cpy(&btn_area, &ext->btn_areas[ext->btn_pr]);
btn_area.x1 += btnm_area.x1;
btn_area.y1 += btnm_area.y1;
btn_area.x2 += btnm_area.x1;
btn_area.y2 += btnm_area.y1;
lv_inv_area(&btn_area);
}
if(btn_pr != LV_BTNM_PR_NONE) {
area_cpy(&btn_area, &ext->btn_areas[btn_pr]);
btn_area.x1 += btnm_area.x1;
btn_area.y1 += btnm_area.y1;
btn_area.x2 += btnm_area.x1;
btn_area.y2 += btnm_area.y1;
lv_inv_area(&btn_area);
}
}
ext->btn_pr = LV_BTNM_BTN_PR_INVALID;
}
break;
default:
break;
ext->btn_pr = btn_pr;
}
else if(sign == LV_SIGNAL_RELEASED || sign == LV_SIGNAL_LONG_PRESS_REP) {
if(ext->cb != NULL && ext->btn_pr != LV_BTNM_PR_NONE) {
uint16_t txt_i = 0;
uint16_t btn_i = 0;
/* Search the text of ext->btn_pr the buttons text in the map
* Skip "\n"-s*/
while(btn_i != ext->btn_pr) {
btn_i ++;
txt_i ++;
if(strcmp(ext->map_p[txt_i], "\n") == 0) txt_i ++;
}
ext->cb(btnm, txt_i);
}
if(sign == LV_SIGNAL_RELEASED && ext->btn_pr != LV_BTNM_PR_NONE) {
/*Invalidate to old area*/;
lv_obj_get_cords(btnm, &btnm_area);
area_cpy(&btn_area, &ext->btn_areas[ext->btn_pr]);
btn_area.x1 += btnm_area.x1;
btn_area.y1 += btnm_area.y1;
btn_area.x2 += btnm_area.x1;
btn_area.y2 += btnm_area.y1;
lv_inv_area(&btn_area);
ext->btn_pr = LV_BTNM_PR_NONE;
}
}
else if(sign == LV_SIGNAL_PRESS_LOST) {
ext->btn_pr = LV_BTNM_PR_NONE;
lv_obj_inv(btnm);
}
}
return valid;
@@ -208,16 +210,17 @@ void lv_btnm_set_map(lv_obj_t * btnm, const char ** map)
{
if(map == NULL) return;
LV_EA(btnm, lv_btnm_ext_t)->map_p = map;
lv_btnm_ext_t * ext = lv_obj_get_ext(btnm);
ext->map_p = map;
/*Analyze the map and create the required number of buttons*/
lv_btnm_create_btns(btnm, map);
/*Set size and positions of the buttons*/
lv_btnms_t * btnms = lv_obj_get_style(btnm);
cord_t max_w = lv_obj_get_width(btnm) - 2 * btnms->rects.hpad;
cord_t max_h = lv_obj_get_height(btnm) - 2 * btnms->rects.vpad;
cord_t act_y = btnms->rects.vpad;
lv_style_t * btnms = lv_obj_get_style(btnm);
cord_t max_w = lv_obj_get_width(btnm) - 2 * btnms->hpad;
cord_t max_h = lv_obj_get_height(btnm) - 2 * btnms->vpad;
cord_t act_y = btnms->vpad;
/*Count the lines to calculate button height*/
uint8_t line_cnt = 1;
@@ -226,7 +229,7 @@ void lv_btnm_set_map(lv_obj_t * btnm, const char ** map)
if(strcmp(map[li], "\n") == 0) line_cnt ++;
}
cord_t btn_h = max_h - ((line_cnt - 1) * btnms->rects.opad);
cord_t btn_h = max_h - ((line_cnt - 1) * btnms->opad);
btn_h = btn_h / line_cnt;
/* Count the units and the buttons in a line
@@ -237,7 +240,6 @@ void lv_btnm_set_map(lv_obj_t * btnm, const char ** map)
uint16_t i_tot = 0; /*Act. index in the str map*/
uint16_t btn_i = 0; /*Act. index of button areas*/
const char ** map_p_tmp = map;
lv_btnm_ext_t * ext = lv_obj_get_ext(btnm);
/*Count the units and the buttons in a line*/
while(1) {
@@ -253,11 +255,11 @@ void lv_btnm_set_map(lv_obj_t * btnm, const char ** map)
/*Only deal with the non empty lines*/
if(btn_cnt != 0) {
/*Calculate the width of all units*/
cord_t all_unit_w = max_w - ((btn_cnt-1) * btnms->rects.opad);
cord_t all_unit_w = max_w - ((btn_cnt-1) * btnms->opad);
/*Set the button size and positions and set the texts*/
uint16_t i;
cord_t act_x = btnms->rects.hpad;
cord_t act_x = btnms->hpad;
cord_t act_unit_w;
unit_act_cnt = 0;
for(i = 0; i < btn_cnt; i++) {
@@ -267,7 +269,7 @@ void lv_btnm_set_map(lv_obj_t * btnm, const char ** map)
act_unit_w = (all_unit_w * lv_btnm_get_width_unit(map_p_tmp[i])) / unit_cnt;
/*Always recalculate act_x because of rounding errors */
act_x = (unit_act_cnt * all_unit_w) / unit_cnt + i * btnms->rects.opad + btnms->rects.hpad;
act_x = (unit_act_cnt * all_unit_w) / unit_cnt + i * btnms->opad + btnms->hpad;
area_set(&ext->btn_areas[btn_i], act_x,
act_y,
@@ -280,7 +282,7 @@ void lv_btnm_set_map(lv_obj_t * btnm, const char ** map)
btn_i ++;
}
}
act_y += btn_h + btnms->rects.opad;
act_y += btn_h + btnms->opad;
if(strlen(map_p_tmp[btn_cnt]) == 0) break; /*Break on end of map*/
map_p_tmp = &map_p_tmp[btn_cnt + 1]; /*Set the map to the next line*/
i_tot ++; /*Skip the '\n'*/
@@ -294,9 +296,26 @@ void lv_btnm_set_map(lv_obj_t * btnm, const char ** map)
* @param btnm: pointer to button matrix object
* @param cb pointer to a callback function
*/
void lv_btnm_set_cb(lv_obj_t * btnm, lv_btnm_callback_t cb)
void lv_btnm_set_action(lv_obj_t * btnm, lv_btnm_callback_t cb)
{
LV_EA(btnm, lv_btnm_ext_t)->cb = cb;
lv_btnm_ext_t * ext = lv_obj_get_ext(btnm);
ext->cb = cb;
}
/**
* Set the styles of the buttons of the button matrox
* @param btnm pointer to a button matrix object
* @param state style in this state (LV_BTN_STATE_PR or LV_BTN_STATE_REL)
* @param style pointer to style
*/
void lv_btnm_set_styles_btn(lv_obj_t * btnm, lv_style_t * rel, lv_style_t * pr)
{
lv_btnm_ext_t * ext = lv_obj_get_ext(btnm);
ext->style_btn_rel = rel;
ext->style_btn_pr = pr;
lv_obj_inv(btnm);
}
/*=====================
@@ -310,7 +329,8 @@ void lv_btnm_set_cb(lv_obj_t * btnm, lv_btnm_callback_t cb)
*/
const char ** lv_btnm_get_map(lv_obj_t * btnm)
{
return LV_EA(btnm, lv_btnm_ext_t)->map_p;
lv_btnm_ext_t * ext = lv_obj_get_ext(btnm);
return ext->map_p;
}
/**
@@ -318,44 +338,37 @@ const char ** lv_btnm_get_map(lv_obj_t * btnm)
* @param btnm: pointer to button matrix object
* @return pointer to the callback function
*/
lv_btnm_callback_t lv_btnm_get_cb(lv_obj_t * btnm)
lv_btnm_callback_t lv_btnm_get_action(lv_obj_t * btnm)
{
return LV_EA(btnm, lv_btnm_ext_t)->cb;
lv_btnm_ext_t * ext = lv_obj_get_ext(btnm);
return ext->cb;
}
/**
* Return with a pointer to a built-in style and/or copy it to a variable
* @param style a style name from lv_btnms_builtin_t enum
* @param copy copy the style to this variable. (NULL if unused)
* @return pointer to an lv_btnms_t style
* Get the style of buttons in button matrix
* @param btnm pointer to a button matrix object
* @param state style in this state (LV_BTN_STATE_PR or LV_BTN_STATE_REL)
* @return pointer the button style in the given state
*/
lv_btnms_t * lv_btnms_get(lv_btnms_builtin_t style, lv_btnms_t * copy)
lv_style_t * lv_btnm_get_style_btn(lv_obj_t * btnm, lv_btn_state_t state)
{
static bool style_inited = false;
lv_style_t * style;
lv_btnm_ext_t * ext = lv_obj_get_ext(btnm);
/*Make the style initialization if it is not done yet*/
if(style_inited == false) {
lv_btnms_init();
style_inited = true;
}
switch(state) {
case LV_BTN_STATE_PR:
style = ext->style_btn_pr;
break;
case LV_BTN_STATE_REL:
style = ext->style_btn_rel;
break;
default:
style = NULL;
}
lv_btnms_t *style_p;
if(style == NULL) style = lv_obj_get_style(btnm);
switch(style) {
case LV_BTNMS_DEF:
style_p = &lv_btnms_def;
break;
default:
style_p = &lv_btnms_def;
}
if(copy != NULL) {
if(style_p != NULL) memcpy(copy, style_p, sizeof(lv_btnms_t));
else memcpy(copy, &lv_btnms_def, sizeof(lv_btnms_t));
}
return style_p;
return style;
}
/**********************
@@ -383,7 +396,7 @@ static bool lv_btnm_design(lv_obj_t * btnm, const area_t * mask, lv_design_mode_
ancestor_design_f(btnm, mask, mode);
lv_btnm_ext_t * ext = lv_obj_get_ext(btnm);
lv_btnms_t * style = lv_obj_get_style(btnm);
lv_style_t * btn_style;
area_t area_btnm;
area_t area_tmp;
@@ -405,37 +418,26 @@ static bool lv_btnm_design(lv_obj_t * btnm, const area_t * mask, lv_design_mode_
btn_h = area_get_height(&area_tmp);
/*Load the style*/
lv_rects_t new_rects;
lv_btn_state_t state;
state = ext->btn_pr == btn_i ? LV_BTN_STATE_PR : LV_BTN_STATE_REL;
memcpy(&new_rects, &style->btns, sizeof(lv_rects_t));
new_rects.objs.color = style->btns.mcolor[state];
new_rects.gcolor = style->btns.gcolor[state];
new_rects.bcolor = style->btns.bcolor[state];
new_rects.lcolor = style->btns.lcolor[state];
new_rects.empty = style->btns.flags[state].empty;
new_rects.objs.transp = style->btns.flags[state].transp;
btn_style = lv_btnm_get_style_btn(btnm, ext->btn_pr == btn_i ? LV_BTN_STATE_PR : LV_BTN_STATE_REL);
if(style->btns.flags[state].light_en != 0) new_rects.light = style->rects.light;
else new_rects.light = 0;
lv_draw_rect(&area_tmp, mask, &new_rects, OPA_COVER);
lv_draw_rect(&area_tmp, mask, btn_style);
/*Search the next valid text in the map*/
while(strcmp(ext->map_p[txt_i], "\n") == 0) txt_i ++;
/*Calculate the size of the text*/
const font_t * font = font_get(style->labels.font);
const font_t * font = btn_style->font;
point_t txt_size;
txt_get_size(&txt_size, ext->map_p[txt_i], font,
style->labels.letter_space, style->labels.line_space, area_get_width(&area_btnm));
btn_style->letter_space, btn_style->line_space,
area_get_width(&area_btnm), TXT_FLAG_NONE);
area_tmp.x1 += (btn_w - txt_size.x) / 2;
area_tmp.y1 += (btn_h - txt_size.y) / 2;
area_tmp.x2 = area_tmp.x1 + txt_size.x;
area_tmp.y2 = area_tmp.y1 + txt_size.y;
lv_draw_label(&area_tmp, mask, &style->labels, OPA_COVER, ext->map_p[txt_i]);
lv_draw_label(&area_tmp, mask, btn_style, ext->map_p[txt_i], TXT_FLAG_NONE, NULL);
txt_i ++;
}
}
@@ -444,18 +446,6 @@ static bool lv_btnm_design(lv_obj_t * btnm, const area_t * mask, lv_design_mode_
return true;
}
/**
* Initialize the button matrix styles
*/
static void lv_btnms_init(void)
{
/*Default style*/
lv_rects_get(LV_RECTS_DEF, &lv_btnms_def.rects); /*Background rectangle style*/
lv_btns_get(LV_BTNS_DEF, &lv_btnms_def.btns); /*Button style*/
lv_labels_get(LV_LABELS_BTN, &lv_btnms_def.labels); /*BUtton label style*/
}
/**
* Create the required number of buttons according to a map
* @param btnm pointer to button matrix object
@@ -477,6 +467,7 @@ static void lv_btnm_create_btns(lv_obj_t * btnm, const char ** map)
if(ext->btn_areas != NULL) {
dm_free(ext->btn_areas);
ext->btn_areas = NULL;
}
ext->btn_areas = dm_alloc(sizeof(area_t) * btn_cnt);
@@ -493,7 +484,6 @@ static uint8_t lv_btnm_get_width_unit(const char * btn_str)
if(btn_str[0] <= '\011') return btn_str[0];
return 1;
}
static uint16_t lv_btnm_get_btn_from_point(lv_obj_t * btnm, point_t * p)
@@ -515,7 +505,7 @@ static uint16_t lv_btnm_get_btn_from_point(lv_obj_t * btnm, point_t * p)
}
}
if(i == ext->btn_cnt) i = LV_BTNM_BTN_PR_INVALID;
if(i == ext->btn_cnt) i = LV_BTNM_PR_NONE;
return i;
}

View File

@@ -7,23 +7,17 @@
#ifndef LV_BTNM_H
#define LV_BTNM_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lv_conf.h"
#if USE_LV_BTNM != 0
/*Testing of dependencies*/
#if USE_LV_RECT == 0
#error "lv_btnm: lv_rect is required. Enable it in lv_conf.h (USE_LV_RECT 1) "
#endif
#if USE_LV_BTN == 0
#error "lv_btnm: lv_btn is required. Enable it in lv_conf.h (USE_LV_BTN 1) "
#endif
#include "../lv_obj/lv_obj.h"
#include "lv_rect.h"
#include "lv_label.h"
#include "lv_btn.h"
@@ -35,7 +29,7 @@
* TYPEDEFS
**********************/
/* Type of callback function which is called when a button is released
/* Type of callback function which is called when a button is released on the button matrix
* Parameters: button matrix, released button index in the map string
* return LV_ACTION_RES_INV: the button matrix is deleted else LV_ACTION_RES_OK*/
typedef lv_action_res_t (*lv_btnm_callback_t) (lv_obj_t *, uint16_t);
@@ -43,31 +37,17 @@ typedef lv_action_res_t (*lv_btnm_callback_t) (lv_obj_t *, uint16_t);
/*Data of button matrix*/
typedef struct
{
lv_rect_ext_t rect; /*Ext. of ancestor*/
lv_cont_ext_t bg; /*Ext. of ancestor*/
/*New data for this type */
const char ** map_p; /*Pointer to the current map*/
area_t * btn_areas;
uint16_t btn_cnt;
uint16_t btn_pr;
lv_btnm_callback_t cb;
area_t * btn_areas; /*Array of areas for the buttons (Handled by the library)*/
uint16_t btn_cnt; /*Number of button in 'map_p'(Handled by the library)*/
uint16_t btn_pr; /*Index of the currently pressed button or LV_BTNM_PR_NONE (Handled by the library)*/
lv_btnm_callback_t cb; /*A function to call when a button is releases*/
lv_style_t * style_btn_rel; /*Style of the released buttons*/
lv_style_t * style_btn_pr; /*Style of the pressed buttons*/
}lv_btnm_ext_t;
/*Style of button matrix*/
typedef struct
{
lv_rects_t rects; /*Style of ancestor*/
/*New style element for this type */
lv_btns_t btns; /*Style of the buttons*/
lv_labels_t labels; /*Style of the labels on the buttons*/
}lv_btnms_t;
/*Built-in styles of button matrix*/
typedef enum
{
LV_BTNMS_DEF,
}lv_btnms_builtin_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
@@ -106,7 +86,15 @@ void lv_btnm_set_map(lv_obj_t * btnm, const char ** map);
* @param btnm: pointer to button matrix object
* @param cb pointer to a callback function
*/
void lv_btnm_set_cb(lv_obj_t * btnm, lv_btnm_callback_t cb);
void lv_btnm_set_action(lv_obj_t * btnm, lv_btnm_callback_t cb);
/**
* Set the styles of the buttons of the button matrox
* @param btnm pointer to a button matrix object
* @param state style in this state (LV_BTN_STATE_PR or LV_BTN_STATE_REL)
* @param style pointer to style
*/
void lv_btnm_set_styles_btn(lv_obj_t * btnm, lv_style_t * rel, lv_style_t * pr);
/**
* Get the current map of a button matrix
@@ -120,15 +108,15 @@ const char ** lv_btnm_get_map(lv_obj_t * btnm);
* @param btnm: pointer to button matrix object
* @return pointer to the callback function
*/
lv_btnm_callback_t lv_btnm_get_cb(lv_obj_t * btnm);
lv_btnm_callback_t lv_btnm_get_action(lv_obj_t * btnm);
/**
* Return with a pointer to a built-in style and/or copy it to a variable
* @param style a style name from lv_btnms_builtin_t enum
* @param copy copy the style to this variable. (NULL if unused)
* @return pointer to an lv_btnms_t style
* Get the style of buttons in button matrix
* @param btnm pointer to a button matrix object
* @param state style in this state (LV_BTN_STATE_PR or LV_BTN_STATE_REL)
* @return pointer the button style in the given state
*/
lv_btnms_t * lv_btnms_get(lv_btnms_builtin_t style, lv_btnms_t * copy);
lv_style_t * lv_btnm_get_style_btn(lv_obj_t * btnm, lv_btn_state_t state);
/**********************
* MACROS
@@ -136,4 +124,8 @@ lv_btnms_t * lv_btnms_get(lv_btnms_builtin_t style, lv_btnms_t * copy);
#endif /*USE_LV_BTNM*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_BTNM_H*/

View File

@@ -23,12 +23,10 @@
* STATIC PROTOTYPES
**********************/
static bool lv_cb_design(lv_obj_t * cb, const area_t * mask, lv_design_mode_t mode);
static void lv_cbs_init(void);
/**********************
* STATIC VARIABLES
**********************/
static lv_cbs_t lv_cbs_def;
static lv_design_f_t ancestor_design_f;
/**********************
* MACROS
@@ -66,17 +64,22 @@ lv_obj_t * lv_cb_create(lv_obj_t * par, lv_obj_t * copy)
/*Init the new checkbox object*/
if(copy == NULL) {
lv_rect_set_layout(new_cb, LV_RECT_LAYOUT_ROW_M);
lv_rect_set_fit(new_cb, true, true);
ext->bullet = lv_btn_create(new_cb, NULL);
lv_btn_set_styles(new_cb, lv_style_get(LV_STYLE_TRANSP, NULL), lv_style_get(LV_STYLE_TRANSP, NULL),
lv_style_get(LV_STYLE_TRANSP, NULL), lv_style_get(LV_STYLE_TRANSP, NULL),
lv_style_get(LV_STYLE_TRANSP, NULL));
lv_cont_set_layout(new_cb, LV_CONT_LAYOUT_ROW_M);
lv_cont_set_fit(new_cb, true, true);
lv_btn_set_tgl(new_cb, true);
ext->bullet = lv_btn_create(new_cb, NULL);
lv_obj_set_click(ext->bullet, false);
lv_btn_set_styles(ext->bullet, lv_style_get(LV_STYLE_PRETTY, NULL), lv_style_get(LV_STYLE_PRETTY_COLOR, NULL),
lv_style_get(LV_STYLE_BTN_TREL, NULL), lv_style_get(LV_STYLE_BTN_TPR, NULL),
lv_style_get(LV_STYLE_BTN_INA, NULL));
ext->label = lv_label_create(new_cb, NULL);
lv_obj_set_style(ext->label, NULL); /*Inherit the style of the parent*/
lv_label_set_text(ext->label, "Check box");
lv_obj_set_style(new_cb, lv_cbs_get(LV_CBS_DEF, NULL));
} else {
lv_cb_ext_t * copy_ext = lv_obj_get_ext(copy);
ext->bullet = lv_btn_create(new_cb, copy_ext->bullet);
@@ -85,8 +88,6 @@ lv_obj_t * lv_cb_create(lv_obj_t * par, lv_obj_t * copy)
/*Refresh the style with new signal function*/
lv_obj_refr_style(new_cb);
}
lv_obj_align_us(new_cb, NULL, LV_ALIGN_CENTER, 0, 0);
return new_cb;
}
@@ -106,29 +107,19 @@ bool lv_cb_signal(lv_obj_t * cb, lv_signal_t sign, void * param)
valid = lv_btn_signal(cb, sign, param);
lv_cb_ext_t * ext = lv_obj_get_ext(cb);
lv_cbs_t * cbs = lv_obj_get_style(cb);
lv_style_t * style = lv_obj_get_style(cb);
/* The object can be deleted so check its validity and then
* make the object specific signal handling */
if(valid != false) {
switch(sign) {
case LV_SIGNAL_PRESSED:
case LV_SIGNAL_RELEASED:
case LV_SIGNAL_LONG_PRESS:
case LV_SIGNAL_PRESS_LOST:
lv_btn_set_state(ext->bullet, lv_btn_get_state(cb));
break;
case LV_SIGNAL_STYLE_CHG:
lv_obj_set_size(ext->bullet, cbs->bullet_size, cbs->bullet_size);
lv_obj_set_style(ext->bullet, &cbs->bullet);
lv_obj_set_style(ext->label, &cbs->label);
break;
case LV_SIGNAL_CLEANUP:
/*Nothing to cleanup. (No dynamically allocated memory in 'ext')*/
break;
default:
break;
if(sign == LV_SIGNAL_STYLE_CHG) {
lv_obj_set_size(ext->bullet, font_get_height(style->font), font_get_height(style->font));
}
if(sign == LV_SIGNAL_PRESSED ||
sign == LV_SIGNAL_RELEASED ||
sign == LV_SIGNAL_PRESS_LOST) {
lv_btn_set_state(lv_cb_get_bullet(cb), lv_btn_get_state(cb));
}
}
return valid;
@@ -167,38 +158,16 @@ const char * lv_cb_get_text(lv_obj_t * cb)
}
/**
* Return with a pointer to a built-in style and/or copy it to a variable
* @param style a style name from lv_cbs_builtin_t enum
* @param copy copy the style to this variable. (NULL if unused)
* @return pointer to an lv_cbs_t style
* Get the bullet (lv_btn) of a check box
* @param cb pointer to check box object
* @return pointer to the bullet of the check box (lv_btn)
*/
lv_cbs_t * lv_cbs_get(lv_cbs_builtin_t style, lv_cbs_t * copy)
lv_obj_t * lv_cb_get_bullet(lv_obj_t * cb)
{
static bool style_inited = false;
/*Make the style initialization if it is not done yet*/
if(style_inited == false) {
lv_cbs_init();
style_inited = true;
}
lv_cbs_t *style_p;
switch(style) {
case LV_CBS_DEF:
style_p = &lv_cbs_def;
break;
default:
style_p = &lv_cbs_def;
}
if(copy != NULL) {
if(style_p != NULL) memcpy(copy, style_p, sizeof(lv_cbs_t));
else memcpy(copy, &lv_cbs_def, sizeof(lv_cbs_t));
}
return style_p;
lv_cb_ext_t * ext = lv_obj_get_ext(cb);
return ext->bullet;
}
/**********************
* STATIC FUNCTIONS
**********************/
@@ -234,61 +203,4 @@ static bool lv_cb_design(lv_obj_t * cb, const area_t * mask, lv_design_mode_t mo
return true;
}
/**
* Initialize the rectangle styles
*/
static void lv_cbs_init(void)
{
/*Default style*/
/*Bg style*/
lv_btns_get(LV_RECTS_TRANSP, &lv_cbs_def.bg);
lv_cbs_def.bg.rects.hpad = 6 * LV_DOWNSCALE;
lv_cbs_def.bg.rects.vpad = 6 * LV_DOWNSCALE;
lv_cbs_def.bg.rects.opad = 5 * LV_DOWNSCALE;
/*Bullet style*/
lv_btns_get(LV_BTNS_DEF, &lv_cbs_def.bullet);
lv_cbs_def.bullet.mcolor[LV_BTN_STATE_REL] = COLOR_WHITE;
lv_cbs_def.bullet.gcolor[LV_BTN_STATE_REL] = COLOR_SILVER;
lv_cbs_def.bullet.bcolor[LV_BTN_STATE_REL] = COLOR_BLACK;
lv_cbs_def.bullet.flags[LV_BTN_STATE_REL].light_en = 0;
lv_cbs_def.bullet.mcolor[LV_BTN_STATE_PR] = COLOR_SILVER;
lv_cbs_def.bullet.gcolor[LV_BTN_STATE_PR] = COLOR_GRAY;
lv_cbs_def.bullet.bcolor[LV_BTN_STATE_PR] = COLOR_BLACK;
lv_cbs_def.bullet.flags[LV_BTN_STATE_PR].light_en = 0;
lv_cbs_def.bullet.mcolor[LV_BTN_STATE_TGL_REL] = COLOR_MAKE(0x20, 0x30, 0x40);
lv_cbs_def.bullet.gcolor[LV_BTN_STATE_TGL_REL] = COLOR_MAKE(0x10, 0x20, 0x30);
lv_cbs_def.bullet.bcolor[LV_BTN_STATE_TGL_REL] = COLOR_WHITE;
lv_cbs_def.bullet.flags[LV_BTN_STATE_TGL_REL].light_en = 1;
lv_cbs_def.bullet.mcolor[LV_BTN_STATE_TGL_PR] = COLOR_MAKE(0x50, 0x70, 0x90);
lv_cbs_def.bullet.gcolor[LV_BTN_STATE_TGL_PR] = COLOR_MAKE(0x20, 0x30, 0x40);
lv_cbs_def.bullet.bcolor[LV_BTN_STATE_TGL_PR] = COLOR_WHITE;
lv_cbs_def.bullet.flags[LV_BTN_STATE_TGL_PR].light_en = 1;
lv_cbs_def.bullet.mcolor[LV_BTN_STATE_INA] = COLOR_SILVER;
lv_cbs_def.bullet.gcolor[LV_BTN_STATE_INA] = COLOR_GRAY;
lv_cbs_def.bullet.bcolor[LV_BTN_STATE_INA] = COLOR_WHITE;
lv_cbs_def.bullet.flags[LV_BTN_STATE_INA].light_en = 0;
lv_cbs_def.bullet.rects.bwidth = 2 * LV_DOWNSCALE;
lv_cbs_def.bullet.rects.bopa = 70;
lv_cbs_def.bullet.rects.light = 6 * LV_DOWNSCALE;
lv_cbs_def.bullet.rects.empty = 0;
lv_cbs_def.bullet.rects.round = LV_OBJ_DEF_WIDTH / 3 / 4;
lv_cbs_def.bullet.rects.hpad = 0 * LV_DOWNSCALE;
lv_cbs_def.bullet.rects.vpad = 0 * LV_DOWNSCALE;
lv_cbs_def.bullet.rects.opad = 0 * LV_DOWNSCALE;
/*Label*/
lv_labels_get(LV_LABELS_TXT, &lv_cbs_def.label);
lv_cbs_def.label.objs.color = COLOR_MAKE(0x10, 0x18, 0x20);
/*Others*/
lv_cbs_def.bullet_size = LV_OBJ_DEF_WIDTH / 3;
}
#endif

View File

@@ -6,14 +6,19 @@
#ifndef LV_CB_H
#define LV_CB_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lv_conf.h"
#if USE_LV_CB != 0
/*Testing of dependencies*/
#if USE_LV_BTN == 0
#error "lv_cb: lv_rect is required. Enable it in lv_conf.h (USE_LV_BTN 1) "
#error "lv_cb: lv_btn is required. Enable it in lv_conf.h (USE_LV_BTN 1) "
#endif
#if USE_LV_LABEL == 0
@@ -37,26 +42,10 @@ typedef struct
{
lv_btn_ext_t bg_btn; /*Ext. of ancestor*/
/*New data for this type */
lv_obj_t * bullet;
lv_obj_t * label;
lv_obj_t * bullet; /*Pointer to button*/
lv_obj_t * label; /*Pointer to label*/
}lv_cb_ext_t;
/*Style of check box*/
typedef struct
{
lv_btns_t bg; /*Style of ancestor*/
/*New style element for this type */
lv_btns_t bullet;
lv_labels_t label;
cord_t bullet_size;
}lv_cbs_t;
/*Built-in styles of check box*/
typedef enum
{
LV_CBS_DEF,
}lv_cbs_builtin_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
@@ -92,17 +81,20 @@ void lv_cb_set_text(lv_obj_t * cb, const char * txt);
const char * lv_cb_get_text(lv_obj_t * cb);
/**
* Return with a pointer to a built-in style and/or copy it to a variable
* @param style a style name from lv_cbs_builtin_t enum
* @param copy copy the style to this variable. (NULL if unused)
* @return pointer to an lv_cbs_t style
* Get the bullet (lv_btn) of a check box
* @param cb pointer to check box object
* @return pointer to the bullet of the check box (lv_btn)
*/
lv_cbs_t * lv_cbs_get(lv_cbs_builtin_t style, lv_cbs_t * copy);
lv_obj_t * lv_cb_get_bullet(lv_obj_t * cb);
/**********************
* MACROS
**********************/
#endif /*USE_LV_CB*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif
#endif /*LV_CB_H*/

Some files were not shown because too many files have changed in this diff Show More