Compare commits

..

259 Commits

Author SHA1 Message Date
Gabor
7dfb4eb374 Release v4.2.0 2017-08-17 11:07:00 +02:00
Gabor
b424927b80 Merge branch 'master' of https://github.com/littlevgl/lvgl 2017-08-17 11:06:24 +02:00
Gabor
42f040f885 Merge branch 'beta' 2017-08-17 11:05:55 +02:00
Gabor
f776a8f1cf lv_ddlist: remove unused variable 2017-08-17 10:44:42 +02:00
Gabor
9fddc294ab Merge branch 'examples' into beta 2017-08-17 10:42:23 +02:00
Gabor
7fdd633561 lv_example: add screenshots 2017-08-17 10:41:48 +02:00
Gabor
b8080ef1db lv_examle: renames, add 'lv_ex_' prefix 2017-08-17 09:56:01 +02:00
Gabor
e044e02541 lv_example: style_usage example added 2017-08-17 09:42:12 +02:00
Gabor Kiss-Vamosi
22dabf9c2a Update TODO_MINOR.md 2017-08-16 20:06:49 +02:00
Gabor Kiss-Vamosi
96a43ba3c5 Update TODO_MINOR.md 2017-08-16 12:39:40 +02:00
Gabor
a8721ff3c3 lv_btnm: 0. byte (width dsc) 1. byte: hidden if \177 (0x7F) 2017-08-16 12:36:22 +02:00
Gabor Kiss-Vamosi
d15980cdd3 Update TODO_MINOR.md 2017-08-16 11:49:22 +02:00
Gabor Kiss-Vamosi
2e60555506 Update TODO_MINOR.md 2017-08-16 11:41:30 +02:00
Gabor Kiss-Vamosi
692a4b33c8 Update TODO_PATCH.md 2017-08-16 11:40:14 +02:00
Gabor
da0a235a33 Merge branch 'bugfix' into beta 2017-08-16 11:38:49 +02:00
Gabor
77e1dc21bb lv_ta: fix memory leak on delete in password mode 2017-08-16 11:38:26 +02:00
Gabor
94b6be4c3d Merge branch 'beta' into bugfix 2017-08-16 11:34:48 +02:00
Gabor
1ff5f1f91d lv_ta: lv_ta_set_one_line added 2017-08-16 11:28:33 +02:00
Gabor
3e053db00b lv_slider: don't let indicator or bar to disappear because of hpad/vpad 2017-08-16 11:28:33 +02:00
Gabor Kiss-Vamosi
317c8f40da Update CONTRIBUTING.md 2017-08-14 17:10:33 +02:00
Gabor Kiss-Vamosi
267d0d96af Update CONTRIBUTING.md 2017-08-14 17:09:56 +02:00
Gabor Kiss-Vamosi
660a986e04 Update TODO_MINOR.md 2017-08-14 17:03:56 +02:00
Gabor Kiss-Vamosi
b83023703b Update CONTRIBUTING.md 2017-08-13 23:11:15 +02:00
Gabor Kiss-Vamosi
740eaa56b7 Update TODO_MINOR.md 2017-08-13 23:04:20 +02:00
Gabor Kiss-Vamosi
5b06a41ebc Merge pull request #17 from iamniels/beta
update lv_init function name
2017-08-12 22:26:04 +02:00
niels
894d5f5861 update lv_init function name 2017-08-12 17:08:29 +02:00
Gabor Kiss-Vamosi
969640717f Update TODO_PATCH.md 2017-08-12 11:43:21 +02:00
Gabor
d69c18dba4 examples: style_usage: skeleton added 2017-08-12 10:10:16 +02:00
Gabor
125b199f85 examples: obj_usage: comment updates 2017-08-12 10:09:27 +02:00
Gabor
4924e871b2 Merge branch 'beta' into examples 2017-08-11 19:52:41 +02:00
Gabor
4ab5d9459e lv_slider: don't let indicator or bar to disappear because of hpad/vpad 2017-08-11 19:51:08 +02:00
Gabor Kiss-Vamosi
ff3f2ed80c Update README.md 2017-08-11 08:14:36 +02:00
Gabor Kiss-Vamosi
dee00b08cc Update TODO_PATCH.md 2017-08-11 08:11:05 +02:00
Gabor Kiss-Vamosi
3052681761 Update TODO_MINOR.md 2017-08-08 10:23:34 +02:00
Gabor
a90aa4211b Merge branch 'double_vdb' into beta 2017-08-08 09:47:35 +02:00
Gabor
09f8e25fdd LV_VDB_DOUBLE: tested on STM32F429 Discovery 2017-08-08 09:47:17 +02:00
Gabor Kiss-Vamosi
702ba26dd8 Update TODO_MINOR.md 2017-08-07 23:26:36 +02:00
Gabor Kiss-Vamosi
7284aa0d05 Update TODO_MINOR.md 2017-08-07 23:17:21 +02:00
Gabor Kiss-Vamosi
fb5cee3b56 Update CONTRIBUTING.md 2017-08-04 19:16:46 +02:00
Kiss-Vamosi Gabor
d9147ae21b LV_VDB_DOUBLE: Add double virtual display buffer. Needs test on real hardware 2017-08-04 19:09:29 +02:00
Gabor Kiss-Vamosi
1749a0e7e1 Update TODO_MINOR.md 2017-08-04 18:29:49 +02:00
Gabor Kiss-Vamosi
3a7d160bfa Update TODO_MINOR.md 2017-08-04 18:28:51 +02:00
Gabor Kiss-Vamosi
958ad5f999 Update TODO_PATCH.md 2017-08-04 18:27:20 +02:00
Gabor Kiss-Vamosi
178f42b89a Update TODO_MINOR.md 2017-08-04 18:22:05 +02:00
Gabor Kiss-Vamosi
cd15f653f6 Update TODO_MAJOR.md 2017-08-04 18:17:09 +02:00
Gabor Kiss-Vamosi
6e1a32e891 Update TODO_PATCH.md 2017-08-04 12:46:25 +02:00
Gabor
0c1e3239b7 lv_slider: don't indicator or bar to disappear because of hpad/vpad 2017-08-04 12:40:43 +02:00
Gabor
e6b6c3a19c example obj_usage: begin 2017-08-04 12:37:32 +02:00
Gabor Kiss-Vamosi
f547a7dbc2 Update TODO_MINOR.md 2017-08-02 22:59:24 +02:00
Gabor Kiss-Vamosi
fa8846a2ce Update README.md 2017-08-02 22:17:19 +02:00
Gabor Kiss-Vamosi
e4cf96cb81 Update CONTRIBUTING.md 2017-08-02 22:14:57 +02:00
Gabor Kiss-Vamosi
9b51181575 Update TODO_MINOR.md 2017-07-31 08:25:32 +02:00
Gabor Kiss-Vamosi
22d79cd585 Update README.md 2017-07-31 01:21:29 +02:00
Gabor Kiss-Vamosi
25651261c2 Update TODO_MAJOR.md 2017-07-31 01:14:41 +02:00
Gabor Kiss-Vamosi
687dea0543 Update README.md 2017-07-30 23:44:59 +02:00
Gabor Kiss-Vamosi
55b7a9f513 Update README.md 2017-07-30 23:38:13 +02:00
Gabor Kiss-Vamosi
61881ca7cd Update README.md 2017-07-30 23:36:42 +02:00
Gabor Kiss-Vamosi
2ab2a5a973 Update README.md 2017-07-30 15:50:04 +02:00
Gabor Kiss-Vamosi
d3a07c866f Update TODO_MAJOR.md 2017-07-30 15:47:44 +02:00
Kiss-Vamosi Gabor
7c3263bc7b licence move back to root 2017-07-30 13:47:43 +02:00
Gabor Kiss-Vamosi
053e70342c Update CONTRIBUTING.md 2017-07-30 13:45:36 +02:00
Gabor Kiss-Vamosi
46f51b1d67 Update CONTRIBUTING.md 2017-07-30 13:45:06 +02:00
Gabor Kiss-Vamosi
81e84ed829 Update CONTRIBUTING.md 2017-07-30 13:44:11 +02:00
Kiss-Vamosi Gabor
04197a83d0 create docs folder and move documents there 2017-07-30 13:42:30 +02:00
Gabor Kiss-Vamosi
931e74e2a6 Update TODO_PATCH.md 2017-07-30 13:40:36 +02:00
Gabor Kiss-Vamosi
7b26cdc75e Create TODO_PATCH.md 2017-07-30 13:39:27 +02:00
Gabor Kiss-Vamosi
c72c8c62de Update TODO_MAJOR.md 2017-07-30 13:35:55 +02:00
Gabor Kiss-Vamosi
e65f781bbd Update TODO_MINOR.md 2017-07-30 13:35:27 +02:00
Gabor Kiss-Vamosi
2846cff2d3 Update TODO_MINOR.md 2017-07-30 13:35:06 +02:00
Gabor Kiss-Vamosi
31fcc7d395 Create TODO_MINOR.md 2017-07-30 13:32:59 +02:00
Gabor Kiss-Vamosi
ec776b48d5 Create TODO_MAJOR.md 2017-07-30 12:22:39 +02:00
Gabor Kiss-Vamosi
b8226ace04 Update CONTRIBUTING.md 2017-07-30 12:11:41 +02:00
Gabor Kiss-Vamosi
3bf1dde5b2 Create CONTRIBUTING.md 2017-07-30 11:52:11 +02:00
Gabor Kiss-Vamosi
3b3ba1b5df Create CODE_OF_CONDUCT.md 2017-07-30 09:46:37 +02:00
Gabor
d1837d2684 Merge branch 'examples' into beta 2017-07-28 15:01:14 +02:00
Gabor
fbe39b7357 Merge branch 'lv_group' into beta 2017-07-28 14:58:50 +02:00
Gabor
f4b9b2a477 lv_label: remove old test code 2017-07-28 14:32:27 +02:00
Gabor
af47b4bd40 lv_ta: copy password mode too on obj. copy 2017-07-28 14:26:51 +02:00
Gabor
e78c3d132c lv_style_h: bad funcion declaration fixed 2017-07-28 14:19:52 +02:00
Gabor
2dbda3d004 Merge branch 'style_anim' into beta 2017-07-28 13:58:39 +02:00
Gabor
6d4791c6e9 style animation added 2017-07-28 13:57:56 +02:00
Gabor
3c2c4c5f86 examples: encoder_ctrl comment update 2017-07-28 11:35:53 +02:00
Gabor
358f7cf00b examples: encoder_ctrl comments added 2017-07-28 11:08:23 +02:00
Gabor
7248eef1f0 Merge branch 'beta' into examples 2017-07-27 14:10:48 +02:00
Gabor
422481533e merge lv_group to examples 2017-07-27 14:02:35 +02:00
Gabor
6cd9fda009 lv_cont: PRETTY layout arrange proportionally if 2 objs. in a row 2017-07-27 13:45:37 +02:00
Gabor
c46e31c536 examples: encorder_ctrl: GUI update 2017-07-27 13:42:55 +02:00
Gabor
a7a24bcf84 example_encoder: GUI added 2017-07-27 13:42:55 +02:00
Gabor
73d4fd00bd lv_obj: lv_ddlist: bugfix, copy 'num_opt' attribute too 2017-07-27 13:42:55 +02:00
Gabor
e52a2fb87c lv_obj: lv_obj_set_parent: bugfix, send CHILD_CHG signal to the old parent too 2017-07-27 13:42:55 +02:00
Gabor
2bdfdc0ed2 hello_world example added and encoder_ctrl begun 2017-07-27 13:42:55 +02:00
Gabor
6b3444271c lv_group: focus_freeze added 2017-07-27 12:07:21 +02:00
Gabor
78c5ad0cdb example_encoder: GUI added 2017-07-27 10:49:44 +02:00
Gabor
df00db0dc2 lv_obj: lv_ddlist: bugfix, copy 'num_opt' attribute too 2017-07-27 10:49:19 +02:00
Gabor
89731ae74a lv_obj: lv_obj_set_parent: bugfix, send CHILD_CHG signal to the old parent too 2017-07-27 10:48:16 +02:00
Gabor
592a54f8ee hello_world example added and encoder_ctrl begun 2017-07-26 11:37:25 +02:00
Gabor Kiss-Vamosi
9fcb264e05 Update README.md 2017-07-25 10:46:17 +02:00
Gabor
1456853135 lv_example: add empty files to build the skeleton 2017-07-25 10:44:40 +02:00
Gabor
92ebe1f940 Examples README added 2017-07-25 10:34:33 +02:00
Gabor
cd83e6febc Merge branch 'lv_group' into beta 2017-07-25 09:05:18 +02:00
Gabor
9fcb8e0d1b lv_group: LV_SIGNAL_SEND sends a character instead of LV_SIGNAL_INC/DEC 2017-07-25 09:02:21 +02:00
Gabor
adbd978155 lv_btn: run rel. action on Select, Inc. Dec. 2017-07-24 12:19:15 +02:00
Gabor
455676e982 lv_group: works with obj. copy + bug fixes 2017-07-20 13:29:22 +02:00
Gabor
faf33212e7 lv_group: group signals are added to releated object types 2017-07-20 12:26:34 +02:00
Kiss-Vamosi Gabor
8dba219f42 lv_group: object types are activated correctly (ddlist open/close, label background, page scrl activate) 2017-07-20 01:09:20 +02:00
Gabor
ab21e705d5 lv_group: add lv_group.c,h 2017-07-19 15:19:10 +02:00
Gabor
4fd0dfc7c4 lv_cong_templ.h: disable lv_app_wifi/gsm/ethetnet 2017-07-12 14:33:12 +02:00
Gabor
fb49ed806e version number fix 2017-07-12 14:25:49 +02:00
Gabor
5353906dea new patch: v4.1.1 2017-07-12 14:12:10 +02:00
Gabor
25fb3e368a lv_app_wifi/gsm: save/load config. 2017-07-12 14:09:58 +02:00
Gabor
811386090d lv_app_files: back symbol bugfix 2017-07-12 14:02:39 +02:00
Gabor
186a5c07c2 lv_app_bencmark: bg name bugfix 2017-07-12 14:02:03 +02:00
Gabor
c6179239e1 lv_app win opan/close anim use '_us' functions 2017-07-12 13:59:23 +02:00
Gabor
d1e6063551 merge master 2017-07-10 17:49:11 +02:00
Gabor
9de436a61b lv_ddlist: fix misspelled function name 2017-07-10 17:29:53 +02:00
Gabor
e00cd04963 lv_app: lv_scr_app(), lv_app_add_dsc() added 2017-07-10 17:29:19 +02:00
Gabor
a24c6d30b2 lv_app_wifi/gsm: bugfixes/updates 2017-07-10 17:28:31 +02:00
Gabor
cc98cfb27e lv_app_ethernet: simple but working version added 2017-07-10 17:27:49 +02:00
Gabor
37c9154b13 lv_app_wifi: buffer and resend last message 2017-07-10 11:38:03 +02:00
Kiss-Vamosi Gabor
3632b1b916 lv_app_benchmark: add 16 and 8 bit wallpapers 2017-07-09 15:57:55 +02:00
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
Kiss-Vamosi Gabor
f16c78fc9f release v4.1.0 2017-07-09 15:33:27 +02:00
Kiss-Vamosi Gabor
7fab8564d0 header udated with __cplusplus define 2017-07-09 15:32:49 +02:00
Gabor Kiss-Vamosi
a02fb7bf82 Update README.md 2017-07-09 14:39:28 +02:00
Kiss-Vamosi Gabor
8bf03bd7e3 LV_CONT_LAYOUT_PRETTY with LV_PROTECT_FOLLOW bugfix 2017-07-07 23:21:35 +02:00
Kiss-Vamosi Gabor
056d449f89 LV_PROTECT_FOLLOW added to 'line break' to LV_CONT_LAYOUT_PRETTY 2017-07-07 23:02:08 +02:00
Kiss-Vamosi Gabor
889807b449 lv_app_benchmark: skeleton added 2017-07-07 19:38:11 +02:00
Kiss-Vamosi Gabor
2f5d824348 lv_refr: solve warnings 2017-07-07 18:48:45 +02:00
Kiss-Vamosi Gabor
6b711b759c lv_refr: comment update 2017-07-07 18:47:48 +02:00
Kiss-Vamosi Gabor
dcb77a59c7 lv_refr: refresh time monitor added 2017-07-07 18:40:43 +02:00
Gabor
168bda2b8f lv_ta: pwd_mode added, lv_label:pwd_mode deleted 2017-07-07 16:22:24 +02:00
Gabor
119c4b577b lv_draw_vbasic: upscales img draw optimization 2017-06-28 14:28:48 +02:00
Gabor
cf3b94d29b lv_list: lv_list_set_element_text_roll() added 2017-06-27 11:15:18 +02:00
Gabor
678e119d2f Hw. accelerator API updated 2017-06-26 16:20:05 +02:00
Gabor
b82c4c828b lv_list: label ROLL bugfix 2017-06-26 14:22:56 +02:00
Gabor
5fcbdc3e9a lv_app_gsm: added 2017-06-26 14:08:29 +02:00
Gabor
941925a56e follow wifi modifications 2017-06-23 15:14:20 +02:00
Gabor
9ee60404cf lv_app_wifi: minor update 2017-06-21 15:13:08 +02:00
Gabor
662c22b51a lv_obj_del: reset the dispi-s only if it is really required 2017-06-21 10:26:38 +02:00
Gabor
166fa39d89 lv_list: text height bugfix 2017-06-20 15:14:54 +02:00
Gabor
23c559bbb0 Update function calls with LV_IMG_ENABLE_SYMBOLS 1 2017-06-19 12:58:07 +02:00
Kiss-Vamosi Gabor
79e372c2f2 lv_label: LV_LABEL_LONG_ROLL addad to scroll the text not the object 2017-06-18 18:25:25 +02:00
Kiss-Vamosi Gabor
7cd532ae58 img. draw bugfix 2017-06-18 12:49:00 +02:00
Kiss-Vamosi Gabor
3b42e205ad lv_mbox set_btn_styles: bugfix if set styles with still no button created 2017-06-17 20:45:00 +02:00
Kiss-Vamosi Gabor
15b9d8d808 lv_cont pretty layout: bugfix if there is 1 too long object in a row 2017-06-17 20:43:51 +02:00
Kiss-Vamosi Gabor
5e9cf2571d lv_refr: disable exectuion time monitor by default 2017-06-17 09:10:03 +02:00
Kiss-Vamosi Gabor
95b6a2193f Exection time monitor added (printf the result) 2017-06-17 09:08:54 +02:00
Kiss-Vamosi Gabor
a13259d3f9 Error check for too small VDB 2017-06-17 09:08:12 +02:00
Kiss-Vamosi Gabor
c3e9ce73b0 Draw: make ready to use hw. accelerator 2017-06-16 22:30:47 +02:00
Gabor
8fc7c26aa1 ta: lv_ta_get_label() added 2017-06-13 14:49:41 +02:00
Gabor
fbc4551894 lv_app_kb MODE_ANIM -> ANIM_IN, ANIM_OUT 2017-06-13 14:42:44 +02:00
Gabor
06cea6ed3a label pwd mode added 2017-06-13 14:17:33 +02:00
Gabor
26325e5ee6 lv_app_kb: LV_APP_KB_MODE_ANIM added 2017-06-13 11:21:06 +02:00
Gabor
8578c2f1a2 WiFi app added 2017-06-07 12:38:43 +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
182 changed files with 13404 additions and 74240 deletions

View File

@@ -1,16 +0,0 @@
# LittleV Graphical Libraray Core
LittleV Graphical Library is C written software libraray which helps you to add modern and innovative graphical user interface to your embedded application.
The library supports high level graphical effects, like anialaiasing, opacity, color fade etc.
The GUI can be built from simle objects like screens, buttons labels, images etc.
The "misc" modul is required to use use the library. (https://github.com/littlevgl/misc)
Check littlev.hu for more information!
There are two branches: master and beta. In beta you will find the newest features which are not released yet.

46
docs/CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [atom@github.com](mailto:atom@github.com). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

180
docs/CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,180 @@
# Contributing to Littlev Graphics Library
First of all thank you for reading these guide before contributing!
In this guide you can read how can you help in developing the Littlev Graphic Library. These are not strict rules rather just suggestions. If you have a constructive idea just create pull request on this document!
### Table Of Content
* [Who can contribute?](#who-can-contribute)
* [How to report an issue?](#how-to-report-an-issue)
* [Simple issue](#simple-issue)
* [Complex issue](#complex-issue)
* [How to suggest a feature?](#how-to-suggest-a-feature)
* [How to implement a feature?](#how-to-implement-a-feature)
* [Styling guide](#styling-guide)
* [Git Commit Messages](#Git-commit-messages)
* [File format](#file-format)
* [Functions](#functions)
* [Variables](#variables)
* [Defines](#defines)
* [Comments](#comments)
* [Formatting](#formatting)
## Who can contribute?
Everybody is welcome in contributing independently from skills, programming level or any personal attribute.
There are several ways to contribute in the graphics library like:
* Report an issue
* Suggest feature
* Fix an issue
* Implement a feature
Please, take a look at [CODE_OF_CONDUCT](https://github.com/littlevgl/lvgl/blob/master/docs/CODE_OF_CONDUCT.md)
## How to report an issue?
There are 3 permanent branches:
* `master` for stable, released versions
* `beta` for developers, all feature branches merged here first
* `bugfix` for hotfixes, not new features
### Simple issue
If you find an issue which is very simple to fix, and you fixed it, please send a pull request against `beta` branch.
A simple issue could be:
* Misspelled names
* Comment: misspelling or grammatical error in comments
* Variable: misspelled variable name (e.g. ***ojb**_next* instead of ***obj**_next*)
* Define: only local defines in files because global defines affect API
* Function: only static function name because global functions affect API
* Not handled error case:
* A parameter can be NULL (during normal usage)
* Negative index in array or over indexing
* Overflow in variable
* Anything which is local an can be fixed with a few lines of code
### Complex issue
If you find a complex issue which:
* might be simple but you don't know its origin
* affects a whole file, module or even the architecture
* needs deeper discussion
please create a **new issue** and describe
* what you experience
* how to reproduce the issue (maybe with example code)
* version you are using (lvgl.h)
* misc library version (misc.h)
## How to suggest a feature?
If you have a good and useful idea you can use GitHub issues to suggest a new feature. Please note the followings on feature requests:
* What the new feature is about?
* Why/Where/In which case is it useful/helpful/relevant?
* Can you help in implementing it?
After a discussion we figure out the specification of the new feature and the technical details/implementation possibilities.
With the knowledge of how to do it somebody can implement the new feature.
The new feature should be in a new branch.
Keep in mind if you wouldn't like to do the implementation there is no guarantee that it will be ready in the new future.
However if you would like to force it, take a look at this page: [Feature request service](http://www.gl.littlev.hu/services#feature)
## How to implement a feature?
In [docs/TODO_MINOR.md](https://github.com/littlevgl/lvgl/blob/master/docs/TODO_MINOR.md) and [docs/TODO_PATCH.md](https://github.com/littlevgl/lvgl/blob/master/docs/TODO_PATCH.md) you can see some ideas which are waiting for somebody to realize them! If want to deal with a feature from this files, please start an issue and discusse the details.
## Styling guide
### Git Commit Messages
* Use the present tense ("Add feature" not "Added feature")
* Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
* Limit the first line to 72 characters or less
* Reference issues and pull requests liberally after the first line
### File format
Use [misc/templ/templ.c](https://github.com/littlevgl/misc/blob/master/templ/templ.c) and [misc/templ/templ.h](https://github.com/littlevgl/misc/blob/master/templ/templ.h)
### Functions
* try to write function shorter then is 40 lines
* always shorter then 100 lines (except very straightforwards)
* in function names:
* words sparated by '_'
* only lower case letters
* only clear abbreviation (OK: *lv_xy_get_title_txt*, BAD: *lv_xy_get_ttxt*)
#### Global functions names (API)
An example: *lv_btn_set_state()*
* starts with *lv*
* followed by module name: *btn*, *label*, *style* etc.
* followed by the action: *set*, *get*, *refr* etc.
* closed with subject: *name*, *size*, *state* etc.
* optional like in *lv_obj_del()* it is missing
* could contain more words: *long_mode*, *point_all*
#### Static functions names
Names can be used freely.
### Variables
* words sparated by '_'
* always lower case
* one line one declaration (BAD: char x, y;)
* use `<stdint.h>` (*uint8_t*, *int32_t* etc)
* declare variables when needed (not all at function start)
* use the smallest required scope
* variables in a file (outside functions) are always *static*
* do not use global variables (use functions to set/get static variables)
### Defines
* always upper case
* starts with *LV_*
* followed by the modul: *OBJ*, *BTN* etc.
* closed by the subject: *ANIM_TIME*, *VALUE_MIN*, *WIDTH_DEF*
### Comments
Before every function have a comment like this:
```
/**
* Return with the screen of an object
* @param obj pointer to an object
* @return pointer to a screen
*/
lv_obj_t * lv_obj_get_scr(lv_obj_t * obj);
```
Always use `/* Something */` format and NOT `//Something`
Write readable code to avoid descriptive comments like:
`x++; /* Add 1 to x */`.
The code should show clearly what you are doing.
You should write **why** have you done this:
`x++; /*Because of closing '\0' of the string */`
### Formatting
Here is example to show bracket placing and using of white spaces:
```
/**
* Set a new text for a label. Memory will be allocated to store the text by the label.
* @param label pointer to a label object
* @param text '\0' terminated character string. NULL to refresh with the current text.
*/
void lv_label_set_text(lv_obj_t * label, const char * text)
{ /*Main bracket in new line*/
if(label == NULL) return; /*No bracket only if the command is inline with the if statement*/
lv_obj_inv(label);
lv_label_ext_t * ext = lv_obj_get_ext(label);
/*Comment before a section */
if(text == ext->txt || text == NULL) { /*Bracket start inline*/
lv_label_refr_text(label);
return;
}
.
.
.
}
```
Use 4 spaces indentation instead of tab.

83
docs/README.md Normal file
View File

@@ -0,0 +1,83 @@
# LittleV Graphics Libraray
![LittlevGL cover](http://www.gl.littlev.hu/home/main_cover_small.png)
LittlevGL is a graphics library to create Graphical User Interfaces (GUI) on TFT, LCD or monochrome displays using microcontroller based embedded systems.
Transparency, anti-aliassing and smooth animations can be used with no double buffering so typically no external memories are required.
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.
Homepage: http://gl.littlev.hu
## Key features
* Hardware independent, support any modern microcontroller
* High resolution TFTs, monochrome or any type of display supported (24/16/8/1 bit color depth)
* External RAM, FPU or GPU not required just optional
* Build GUI from simple graphical objects
* Buttons, Labels, Images
* Charts, Lists, Bars, Sliders, Text areas etc.
* High level graphical features without double buffering
* 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
* Modular and well-structured source code
* Actively developed
## 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/disp `disp_color_cpy(dest, src, length, opa)` copy pixel, optional for GPU
* 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();
* **lv_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
See [CONTRIBUTING.md](https://github.com/littlevgl/lvgl/blob/master/docs/CONTRIBUTING.md)
## Donate
If you are pleased with the graphics library and found it useful please 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)

12
docs/TODO_MAJOR.md Normal file
View File

@@ -0,0 +1,12 @@
# TODOs for major versions
Major versions released typically when API changes are required
## Contributing
Please create an issue to suggest a new feature instead of adding pull request to this file.
## v5
- [ ] rename repository from *lvgl* to *littlevgl*
- [ ] define renames: e.g. *USE_LV_BTN* to *LV_BTN_USE*
- [ ] Remove LV_DOWNSCALE (LV_ANTIALIAS will be used instead)
- [ ] *lv_ta_get_txt* rename to *lv_ta_get_text*
- [ ] btnm_action pass text instead of text_id

30
docs/TODO_MINOR.md Normal file
View File

@@ -0,0 +1,30 @@
# TODOs for minor versions
Minor versions (x.1.0, x.2.0 ...) released when one or more new feature is addded without changing the API. New features can be added with major versions (1.0.0, 2.0.0 ...) too.
## Contributing
Please create an issue to suggest a new feature instead of adding pull request to this file.
## Ideas
Here are ideas which are not assigned to a minor version yet:
- label: add a horzintal line (e.g. underline or line through).
- label long mode: dot begin
- music player app
- files app update: show content as text
- GUI remote control
- automatically build GUI from file (e.g. XML, JSON or HTML)
- lv_split: new object type, a hor. or ver. line for decoration purpose
- lv_valset: new object type, a label with "+" and "-" buttons
- lv_tabview: new object type to organise content with tabs
- lv_btngrp: new object type to display more buttons to choose an option from them
- lv_switch: new object type, turn on/off by tap (a little slider)
- lv_roller: new object type, a roller to select a value (like on smartphones)
## v4.2
- [x] Double VDB support: one for rendering, another to transfer former rendered image to frame buffer in the background (e.g. with DMA) [#15](https://github.com/littlevgl/lvgl/issues/15)
- [x] lv_group: to control without touch pad. Issue [#14](https://github.com/littlevgl/lvgl/issues/14)
- [x] lv_page: scrl def fit modification: hor:false, ver:true, and always set width to parent width
- [x] lv_btn: add lv_btn_get_..._action
- [x] lv_list: add lv_list_get_element_label/img
- [x] lv_ta: lv_ta_set_one_line to configure the Text area to one lined input field
- [x] style animations add
- [x] lv_btnm: besides 0. byte (width dsc) 1. byte: hidden (\177, 0x7F, delete)

13
docs/TODO_PATCH.md Normal file
View File

@@ -0,0 +1,13 @@
# TODOs for patch versions
Patch versions (x.y.1, x.y.2) contain bugfixes without changing the API but they can apppear in minor (x.1.0, x.2.0) or major (1.0.0, 2.0.0) versions too.
Bugfixes are done in `bugfix` branche.
The bugfixes of the still not released version are in `beta` branche.
## Contributing
Please create an issue to introduce a bug instead of adding pull request to this file.
## Next release
- [x] lv_slider: don't let indicator or bar to disappear because of hpad/vpad
- [x] lv_ta: memory leak if deleted in password mode

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;
@@ -107,6 +113,18 @@ typedef struct {
*/
void lv_app_init(void);
/**
* Get screen of the applications
*/
lv_obj_t * lv_scr_app(void);
/**
* Allocate a new application descriptor
* @return pointer to an lv_app_dsc_t pointer. Save here a pointer to an app. dsc.
* E.g. *dsc = &my_app_dsc;
*/
lv_app_dsc_t ** lv_app_add_dsc(void);
/**
* Run an application according to 'app_dsc'
* @param app_dsc pointer to an application descriptor
@@ -215,10 +233,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 +244,27 @@ 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_ethernet.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

698
lv_appx/lv_app_benchmark.c Normal file
View File

@@ -0,0 +1,698 @@
/**
* @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 / 8)
#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 shdw :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;
static const color_int_t img_benchmark_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_benchmark_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*/
my_app_data_t * ad = app->app_data;
ad->opa = 0;
ad->recolor = 0;
ad->shdw = 0;
ad->upscalse = 0;
ad->wp = 0;
}
/**
* 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->shdw == 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);
lv_img_set_auto_size(wdata->wp, false);
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->shdw != 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, 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->shdw = 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->shdw = 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*/
#if COLOR_DEPTH == 8
static const color_int_t img_benchmark_bg[] = {
/*HEADER
Width = 40
Height = 40
Transp: 0
Color depth: 8*/
40, 128, 2, 2,
/*IMAGE DATA*/
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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 5, 5, 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, 0, 0, 0,
0, 0, 0, 0, 5, 5, 5, 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, 0, 0, 0,
0, 0, 0, 0, 5, 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, 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, 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, 0, 5, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 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, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 5, 0, 0, 0, 5, 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, 5, 0, 0, 0, 0, 5, 5, 0, 5, 5, 5, 0, 0, 5, 5, 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, 5, 0, 5, 5, 0, 5, 5, 0, 0, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 5, 5, 5, 5, 5, 0, 0, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 5, 0, 0, 0, 5, 5, 5, 5, 5, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 5, 0, 0, 5, 5, 5, 5, 5, 5, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 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, 0, 0, 0, 0, 0, 0, 5, 5, 5, 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, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 0, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 5, 5, 0, 0, 0, 5, 5, 5, 0, 5, 5, 5, 5, 0, 0, 5, 5, 5, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 5, 5, 5, 5, 5, 5, 5, 5, 0, 5, 5, 5, 5, 5, 0, 5, 5, 5, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 5, 5, 5, 5, 0, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 0, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 5, 5, 5, 0, 0, 0, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 0, 5, 5, 5, 0, 5, 0, 0, 0, 0, 0, 5, 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, 5, 5, 5, 5, 5, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 5, 5, 5, 5, 0, 5, 5, 5, 5, 5, 5, 5, 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, 5, 5, 5, 5, 5, 0, 0, 0, 5, 5, 5, 5, 5, 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, 5, 5, 5, 0, 0, 0, 0, 0, 5, 5, 5, 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, 5, 0, 0, 0, 0, 0, 0, 0, 5, 5, 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, 0, 0, 0, 0, 0, 0, 0, 0, 5, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 5, 5, 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, 5, 5, 0, 0, 0, 0, 5, 5, 5, 5, 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, 5, 5, 0, 0, 0, 0, 5, 5, 5, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
#endif /*COLOR_DEPTH*/
#if COLOR_DEPTH == 16
static const color_int_t img_benchmark_bg[] = {
/*HEADER
Width = 40
Height = 40
Transp: 0
Color depth: 16*/
32808, 1026,
/*IMAGE DATA*/
32, 32, 32, 2113, 2113, 4258, 6339, 4258, 4258, 4226, 4226, 2145, 4226, 2113, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 2145, 2145, 4226, 4226, 4226, 4226, 4226, 2145, 32, 32, 32, 32,
0, 32, 2113, 32, 6339, 10565, 8452, 4258, 4226, 4226, 2145, 4226, 6339, 4226, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 2145, 4226, 2145, 2145, 4226, 4226, 4226, 6371, 6339, 4226, 32, 32, 32,
32, 32, 2113, 4226, 8484, 8484, 8452, 6371, 4226, 2145, 4226, 4258, 4258, 4258, 2145, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 2145, 4226, 4226, 4226, 4226, 2145, 2145, 4226, 6339, 4258, 4258, 4226, 32, 32,
32, 32, 4258, 6371, 8452, 6371, 6371, 6339, 4226, 2145, 4226, 4226, 2145, 4226, 4226, 2113, 32, 0, 0, 0, 0, 32, 0, 0, 32, 2113, 2145, 2145, 2145, 4226, 4226, 4226, 2145, 4226, 6339, 4226, 6371, 6339, 2145, 32,
2113, 2145, 6371, 6339, 4226, 4226, 4226, 4226, 4258, 4258, 4226, 2145, 4226, 2145, 2145, 4226, 4258, 32, 0, 0, 0, 0, 0, 2113, 6339, 4226, 2113, 2145, 2145, 2145, 4226, 4226, 4258, 4226, 4258, 4258, 4258, 6339, 6339, 2145,
4226, 4258, 6339, 4226, 4226, 2145, 2145, 2145, 4226, 4226, 4226, 2145, 2145, 2145, 4226, 6339, 8452, 6339, 32, 0, 0, 0, 2113, 6339, 6371, 6339, 2145, 2113, 2145, 2145, 4226, 4226, 4226, 4226, 4226, 4226, 4226, 4258, 4258, 4226,
4226, 4226, 2145, 4226, 2145, 2145, 4226, 4226, 2145, 4226, 4226, 4226, 2145, 4226, 6371, 6371, 6371, 8452, 4258, 32, 0, 2113, 6371, 6371, 6371, 6339, 6339, 2145, 2145, 4226, 2145, 2145, 2145, 4226, 4258, 4226, 4226, 4226, 2145, 4226,
4226, 2145, 4226, 2145, 2145, 4226, 4226, 4226, 4226, 4226, 2145, 2145, 4258, 6371, 8452, 6371, 6371, 6371, 8452, 6339, 2145, 6339, 8452, 6371, 6339, 6371, 6371, 6339, 4226, 2145, 2145, 2145, 2145, 2145, 4258, 4258, 2145, 2145, 2145, 2145,
4226, 2145, 4226, 2113, 2145, 4226, 4258, 4226, 2145, 2145, 2145, 4258, 6371, 8452, 6371, 6339, 6371, 6371, 8452, 8452, 6339, 8452, 8452, 8452, 6371, 6371, 8452, 8452, 6339, 4226, 2145, 2145, 2145, 2145, 4226, 4258, 2145, 2113, 2145, 2145,
2145, 2145, 2113, 2145, 4226, 4226, 4226, 2145, 2145, 2113, 4226, 6339, 6371, 6371, 6371, 6371, 6371, 8452, 6371, 8452, 8452, 6371, 8452, 8452, 6339, 6371, 8452, 8452, 8452, 6371, 4226, 2145, 4226, 4226, 4226, 4226, 4226, 4226, 2145, 4226,
4226, 4226, 2145, 4226, 4226, 2145, 4226, 2145, 2113, 2145, 6339, 6371, 6371, 8452, 8452, 8452, 8484, 8452, 6371, 6371, 6371, 6371, 6371, 6371, 6371, 6371, 6371, 6371, 8452, 8452, 6339, 2145, 2145, 4226, 4226, 2145, 4226, 4226, 2145, 4226,
2145, 4226, 4258, 2145, 2145, 2145, 2113, 2145, 4226, 6339, 6371, 6371, 6371, 8452, 8484, 8484, 8452, 6371, 6371, 6371, 6371, 6371, 6371, 8452, 6371, 6339, 6371, 6371, 6371, 8452, 8452, 6339, 4226, 2145, 2145, 4226, 4226, 2145, 4226, 2145,
32, 2113, 4226, 4226, 2145, 2145, 2113, 2145, 8452, 8452, 6371, 6371, 6339, 8484, 8484, 8484, 8484, 8452, 6371, 6339, 6371, 6371, 6371, 6371, 6371, 6371, 6339, 6339, 6339, 6339, 8452, 8484, 6371, 2145, 2145, 4226, 2145, 4226, 4226, 2113,
0, 0, 2145, 4226, 4226, 4226, 4258, 6371, 6371, 8452, 6371, 6339, 6339, 8452, 8484, 8452, 8452, 8452, 6371, 6371, 8452, 8452, 8452, 6371, 6371, 6339, 6371, 6339, 6371, 6371, 8452, 8452, 8484, 8452, 4226, 4226, 4258, 4258, 2113, 32,
0, 0, 32, 2113, 2145, 6339, 8452, 8452, 6339, 6339, 8452, 6371, 6339, 6371, 10565, 8484, 8452, 8484, 8452, 6371, 6339, 8452, 8452, 6371, 6371, 6339, 6371, 6371, 6371, 8452, 8452, 8452, 8484, 10565, 6371, 4258, 4226, 2145, 32, 0,
0, 0, 0, 0, 2113, 6339, 8452, 6371, 6371, 6339, 6371, 8452, 6371, 6371, 8452, 8484, 8452, 8452, 8484, 8452, 4258, 8452, 8452, 6339, 6339, 6339, 6339, 6371, 6371, 6371, 6371, 8452, 8452, 8452, 8484, 8452, 2113, 0, 0, 32,
0, 0, 0, 0, 0, 4258, 6371, 6371, 6371, 6371, 6371, 6371, 6371, 6371, 8452, 8452, 8452, 8484, 8452, 2145, 32, 4226, 6371, 6371, 6371, 6339, 6371, 6371, 6371, 6371, 6371, 6371, 8452, 8452, 8452, 4226, 32, 0, 0, 32,
0, 0, 0, 0, 0, 0, 4226, 8452, 6371, 6371, 6371, 6339, 6371, 8452, 8452, 8452, 8484, 8452, 2145, 0, 0, 0, 4226, 8452, 6371, 6371, 6371, 6339, 6339, 6371, 6371, 6371, 8452, 8484, 4258, 0, 32, 32, 32, 0,
0, 0, 0, 0, 0, 0, 32, 4258, 6371, 6371, 6371, 6371, 6371, 8452, 8452, 8452, 8452, 2145, 0, 0, 32, 0, 0, 4226, 6371, 6371, 6339, 6339, 6371, 6371, 6371, 6371, 6371, 2145, 0, 0, 32, 32, 32, 0,
0, 0, 0, 0, 0, 0, 0, 32, 6339, 6371, 6371, 6371, 6371, 8452, 8484, 8452, 4226, 32, 0, 0, 0, 0, 0, 0, 4226, 6339, 6339, 6339, 6371, 6371, 6371, 6371, 4226, 0, 32, 32, 32, 32, 0, 0,
0, 0, 0, 0, 0, 0, 0, 2113, 6339, 6371, 6371, 6371, 6371, 8452, 8484, 8484, 4258, 32, 0, 0, 0, 0, 0, 32, 4258, 6339, 6339, 6371, 6371, 6371, 8452, 8452, 4258, 32, 32, 32, 32, 32, 0, 32,
0, 0, 0, 32, 0, 0, 2113, 6339, 8484, 8452, 6371, 6371, 8452, 8484, 8484, 8484, 8452, 4226, 0, 0, 0, 0, 32, 6339, 8452, 6371, 6371, 6371, 6371, 6371, 8452, 8452, 8484, 6371, 2113, 32, 32, 32, 32, 32,
0, 0, 0, 0, 0, 2113, 6339, 8452, 8484, 8484, 8452, 6371, 8452, 10597, 8452, 8452, 8452, 6371, 4226, 0, 0, 32, 4258, 8452, 8452, 8452, 8452, 6371, 6339, 6371, 6371, 6371, 8484, 8484, 6339, 2113, 0, 32, 32, 32,
0, 0, 0, 0, 2113, 6371, 8452, 8452, 8452, 8452, 8452, 8452, 8484, 10597, 8452, 8452, 6371, 8452, 8452, 4258, 2113, 6339, 8452, 8452, 8452, 6371, 8452, 8452, 8452, 8452, 6371, 6371, 8452, 8484, 8484, 6371, 2113, 32, 32, 32,
0, 0, 0, 32, 2145, 6339, 8484, 8452, 8452, 8452, 8452, 8452, 8484, 8484, 8452, 8452, 6371, 8452, 8452, 10565, 8484, 8452, 8484, 8452, 8452, 6371, 8452, 8484, 8452, 8484, 8452, 6371, 8484, 8484, 10597, 6371, 6339, 2145, 0, 32,
0, 0, 0, 2145, 4226, 2145, 6339, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8452, 8484, 8452, 8452, 8452, 8452, 8452, 6371, 8452, 8452, 8452, 8484, 8484, 8484, 8484, 12678, 6371, 4226, 6371, 4258, 32, 0,
0, 32, 2145, 4226, 4226, 2145, 2145, 6339, 8484, 10565, 8452, 8452, 8452, 8452, 8484, 8484, 8452, 8452, 6371, 6371, 6371, 6339, 8452, 8452, 8452, 8452, 6371, 8452, 8484, 8484, 8452, 8484, 10565, 8484, 4258, 4226, 6339, 6339, 2145, 32,
2113, 4226, 4258, 4226, 4226, 4226, 2145, 2145, 8452, 8484, 8452, 6371, 8452, 8452, 8484, 8452, 8452, 6371, 6339, 6339, 6339, 6371, 6371, 8452, 8452, 8452, 6371, 6371, 6339, 8452, 8484, 8484, 6371, 4226, 4258, 6339, 4226, 4258, 6339, 4226,
2145, 2145, 4226, 4226, 4226, 4226, 2145, 2145, 2145, 10565, 8452, 8452, 8452, 6371, 8452, 8452, 8452, 6371, 8452, 6371, 6339, 6371, 6371, 6371, 8452, 6371, 6371, 6339, 6339, 6371, 6371, 6339, 4226, 4258, 4226, 6339, 6339, 4258, 6339, 4226,
2145, 2145, 2113, 4226, 4226, 4226, 4226, 4226, 2145, 4226, 6339, 6371, 6371, 8452, 8452, 8452, 8452, 8452, 6371, 6371, 6371, 6339, 8452, 8452, 8452, 8452, 8452, 8452, 6371, 6371, 4258, 2145, 4226, 4258, 6339, 4258, 4258, 4226, 4226, 4258,
2145, 2145, 2145, 2145, 2145, 4226, 4226, 4226, 4226, 2145, 2145, 6371, 8484, 8452, 8452, 8452, 8452, 8452, 8452, 6371, 6371, 6371, 8452, 8484, 8452, 8452, 8452, 8484, 8484, 6339, 2145, 2145, 4226, 4226, 4258, 6339, 4226, 2145, 4226, 4226,
2145, 2145, 4226, 4226, 4226, 4258, 4226, 4258, 4258, 4226, 2145, 4226, 6371, 8452, 8452, 6371, 8452, 8452, 8452, 8452, 6339, 8452, 8452, 8452, 8484, 10565, 8452, 8484, 6371, 4226, 4226, 4258, 6339, 6339, 6339, 6339, 4226, 2145, 2145, 4226,
2145, 2145, 2145, 4226, 4226, 6339, 6339, 6339, 4226, 4226, 4226, 2145, 4258, 6339, 8452, 8452, 8452, 8452, 8484, 4258, 2113, 6339, 8452, 8452, 8452, 8484, 8452, 6339, 4258, 4226, 6339, 6339, 6339, 6339, 6339, 6339, 4226, 2145, 2145, 4258,
2145, 4226, 4226, 4226, 4258, 4226, 6371, 6339, 4226, 4226, 4226, 4226, 2145, 4226, 6339, 8452, 8452, 8452, 4258, 32, 0, 2113, 6339, 8484, 10565, 8484, 6339, 4226, 4258, 6339, 6339, 6339, 6339, 4258, 4226, 2145, 4258, 4226, 4226, 4258,
2145, 4226, 4258, 4258, 4226, 4226, 4226, 4258, 6339, 4258, 4226, 2145, 2145, 2145, 4226, 6371, 8452, 4226, 32, 0, 0, 0, 32, 6371, 10565, 8452, 4226, 4226, 4258, 4258, 6339, 6339, 6371, 4226, 2145, 4226, 4226, 4226, 4258, 4226,
32, 2113, 6339, 4258, 4258, 4226, 4226, 4226, 4258, 4258, 4226, 4226, 4226, 4226, 4226, 4226, 4226, 32, 0, 0, 0, 0, 0, 2113, 8452, 6339, 4258, 4226, 4226, 4226, 4258, 6339, 4258, 4258, 4226, 4258, 6339, 4258, 4226, 2113,
0, 0, 2113, 4258, 4258, 4258, 4258, 4226, 2145, 2145, 4226, 4226, 4226, 4258, 4258, 2113, 32, 32, 32, 32, 32, 0, 32, 2113, 2145, 4258, 6371, 6339, 4258, 6339, 4258, 4226, 4258, 8484, 6371, 8452, 8484, 6339, 2113, 0,
0, 0, 0, 2113, 6339, 6339, 4258, 4226, 2145, 2145, 2145, 4226, 6339, 4258, 2145, 32, 32, 32, 32, 32, 0, 0, 32, 32, 2113, 2145, 6339, 8452, 8452, 4258, 4226, 4258, 6339, 8484, 10565, 10597, 8452, 2145, 32, 0,
0, 0, 0, 0, 4258, 6371, 6339, 4226, 4226, 2145, 2145, 4226, 4258, 4226, 32, 0, 32, 32, 32, 32, 0, 32, 0, 32, 32, 32, 2145, 8452, 8452, 4258, 4226, 4226, 4258, 8484, 8452, 8484, 4226, 0, 0, 0,
0, 0, 0, 0, 32, 4226, 4258, 6339, 4226, 4226, 4226, 4226, 2145, 32, 32, 0, 0, 32, 32, 32, 0, 0, 0, 0, 32, 2113, 2113, 2145, 4226, 4226, 4226, 4226, 6339, 6371, 4226, 2145, 32, 0, 0, 0,
};
#endif /*COLOR_DEPTH == 16*/
#if COLOR_DEPTH == 24
static const color_int_t img_benchmark_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 /*COLOR_DEPTH == 24*/
#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 */

227
lv_appx/lv_app_ethernet.c Normal file
View File

@@ -0,0 +1,227 @@
/**
* @file lv_app_ethernet.c
*
*/
/*********************
* INCLUDES
*********************/
#include "lv_app_ethernet.h"
#if LV_APP_ENABLE != 0 && USE_LV_APP_ETHERNET != 0
#include "../lv_app/lv_app_util/lv_app_kb.h"
#include "hal/eth/eth.h"
#include "misc/os/ptask.h"
#include "hal/systick/systick.h"
#include <stdio.h>
/*********************
* DEFINES
*********************/
#define ETH_MONITOR_PERIOD 1000 /*ms*/
/**********************
* TYPEDEFS
**********************/
/*Application specific data for an instance of this application*/
typedef struct
{
uint8_t * last_msg_dp;
uint16_t last_msg_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 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 eth_state_monitor_task(void * param);
static void tcp_transf_cb(eth_state_t state, const char * txt);
/**********************
* STATIC VARIABLES
**********************/
static lv_app_dsc_t my_app_dsc =
{
.name = "Ethernet",
.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 = NULL;
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/**
* Initialize the application
* @return pointer to the application descriptor of this application
*/
const lv_app_dsc_t * lv_app_ethernet_init(void)
{
ptask_create(eth_state_monitor_task, ETH_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_ethernet_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*/
eth_tcp_transf(data, size, tcp_transf_cb);
app_act_com = app_rec;
my_app_data_t * adata = app_act_com->app_data;
if(adata->last_msg_dp != NULL) dm_free(adata->last_msg_dp);
adata->last_msg_dp = dm_alloc(size);
memcpy(adata->last_msg_dp, data, size);
adata->last_msg_size = size;
}
}
/**
* 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)
{
}
/**
* 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 eth_state_monitor_task(void * param)
{
/* The eth. should be busy if there is sg. to send.
* It means fail during last send. Try again*/
if(app_act_com != NULL && eth_busy() == false) {
/*Try to send the message again*/
lv_app_notice_add("Resend Ethernet message");
my_app_data_t * adata = app_act_com->app_data;
eth_tcp_transf(adata->last_msg_dp, adata->last_msg_size, tcp_transf_cb);
}
}
static void tcp_transf_cb(eth_state_t state, const char * txt)
{
if(state == ETH_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);
my_app_data_t * adata = app_act_com->app_data;
dm_free(adata->last_msg_dp);
adata->last_msg_dp = NULL;
adata->last_msg_size = 0;
app_act_com = NULL;
}else if(state == ETH_STATE_ERROR) {
lv_app_notice_add("Ethernet TCP transfer error\n%s", txt);
}
}
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_ETHERNET != 0*/

48
lv_appx/lv_app_ethernet.h Normal file
View File

@@ -0,0 +1,48 @@
/**
* @file lv_app_ethernet.h
*
*/
#ifndef LV_APP_ETHERNET_H
#define LV_APP_ETHERNET_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lvgl/lv_app/lv_app.h"
#if LV_APP_ENABLE != 0 && USE_LV_APP_ETHERNET != 0
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
typedef struct
{
}lv_app_ethernet_conf_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
const lv_app_dsc_t * lv_app_ethernet_init(void);
/**********************
* MACROS
**********************/
#endif /*LV_APP_ENABLE != 0 && USE_LV_APP_ETHERNET != 0*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* LV_APP_ETHERNET_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,20 +581,18 @@ 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);
/*Create the list of operations*/
lv_obj_t * liste;
liste = lv_list_add(win_data->file_list, "U:/icon_left", "Back", win_back_action);
liste = lv_list_add(win_data->file_list, SYMBOL_LEFT, "Back", win_back_action);
lv_obj_set_free_p(liste, app);
/*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 */

477
lv_appx/lv_app_gsm.c Normal file
View File

@@ -0,0 +1,477 @@
/**
* @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];
uint8_t * last_msg_dp;
uint16_t last_msg_size;
}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 void save_conf(lv_app_inst_t * app);
/**********************
* 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;
static char def_apn[128];
static char def_ip[32];
static char def_port[16];
/**********************
* 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)
{
#ifdef LV_APP_GSM_CONF_PATH
fs_file_t f;
fs_res_t res;
res = fs_open(&f, LV_APP_GSM_CONF_PATH, FS_MODE_RD);
if(res == FS_RES_NOT_EX) {
res = fs_open(&f, LV_APP_GSM_CONF_PATH, FS_MODE_WR | FS_MODE_RD);
if(res == FS_RES_OK) {
const char * def_conf = "apn\n100.101.102.103\n1234";
fs_write(&f, def_conf, strlen(def_conf) + 1, NULL);
fs_seek(&f, 0);
}
}
if(res == FS_RES_OK) {
volatile char buf[256];
volatile uint32_t rn;
fs_read(&f, (char *)buf, sizeof(buf) - 1, (uint32_t *)&rn);
volatile uint16_t i;
volatile uint16_t j = 0;
volatile uint8_t line_cnt = 0;
for(i = 0; i < rn; i++) {
if(buf[i] != '\n') {
if(line_cnt == 0) def_apn[j] = buf[i];
if(line_cnt == 1) def_ip[j] = buf[i];
if(line_cnt == 2) def_port[j] = buf[i];
j++;
} else {
if(line_cnt == 0) def_apn[j] = '\0';
if(line_cnt == 1) def_ip[j] = '\0';
if(line_cnt == 2) def_port[j] = '\0';
j = 0;
line_cnt ++;
}
}
fs_close(&f);
} else {
lv_app_notice_add("SD card error");
}
#else
strcpy(def_apn, LV_APP_GSM_APN_DEF);
strcpy(def_ip, LV_APP_GSM_IP_DEF);
strcpy(def_port, LV_APP_GSM_PORT_DEF);
#endif
#if LV_APP_GSM_AUTO_CONNECT != 0
gsmmng_set_last_apn(def_apn);
gsmmng_set_last_tcp(def_ip, def_port);
#endif
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, def_apn);
strcpy(adata->set_ip, def_ip);
strcpy(adata->set_port, def_port);
}
/**
* 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);
my_app_data_t * adata = app_act_com->app_data;
if(adata->last_msg_dp != NULL) dm_free(adata->last_msg_dp);
adata->last_msg_dp = dm_alloc(size);
memcpy(adata->last_msg_dp, data, size);
adata->last_msg_size = size;
}
}
/**
* 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();
}
/* The GSM should be busy if there is sg. to send.
* It means fail during last send. Try again*/
if(app_act_com != NULL) {
if(gsm_busy() == false && state_act == GSMMNG_STATE_READY) {
/*Try to send the message again*/
lv_app_notice_add("Resend GSM message");
my_app_data_t * adata = app_act_com->app_data;
gsm_tcp_transf(adata->last_msg_dp, adata->last_msg_size, tcp_transf_cb);
}
}
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();
save_conf(app);
lv_app_notice_add("Connecting to GSM network\n%s\n %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);
my_app_data_t * adata = app_act_com->app_data;
dm_free(adata->last_msg_dp);
adata->last_msg_dp = NULL;
adata->last_msg_size = 0;
app_act_com = NULL;
}else if(state == GSM_STATE_ERROR) {
lv_app_notice_add("GSM TCP transfer error\n%s", txt);
lv_app_notice_add("Reconnecting to GSM...");
gsmmng_reconnect();
}
}
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_IDLE) {
lv_label_set_text(wdata->title, "Not connected");
} else if(gsmmng_get_state() == GSMMNG_STATE_READY) {
lv_label_set_text(wdata->title, "Connecting ...");
} 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);
}
}
static void save_conf(lv_app_inst_t * app)
{
#ifdef LV_APP_GSM_CONF_PATH
my_app_data_t * adata = app->app_data;
fs_file_t f;
fs_res_t res;
res = fs_open(&f, LV_APP_GSM_CONF_PATH, FS_MODE_WR);
if(res == FS_RES_OK) {
char buf[256];
sprintf(buf,"%s\n%s\n%s", adata->set_apn, adata->set_ip, adata->set_port);
fs_write(&f, buf, strlen(buf) + 1, NULL);
fs_close(&f);
}
#endif
}
#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 */

593
lv_appx/lv_app_wifi.c Normal file
View File

@@ -0,0 +1,593 @@
/**
* @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 "misc/fs/fat32/integer.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];
uint8_t * last_msg_dp;
uint16_t last_msg_size;
}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 void save_conf(lv_app_inst_t * app);
/**********************
* 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 def_ssid[64];
static char def_pwd[64];
static char def_ip[32];
static char def_port[16];
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, "");
#ifdef LV_APP_WIFI_CONF_PATH
fs_file_t f;
fs_res_t res;
res = fs_open(&f, LV_APP_WIFI_CONF_PATH, FS_MODE_RD);
if(res == FS_RES_NOT_EX) {
res = fs_open(&f, LV_APP_WIFI_CONF_PATH, FS_MODE_WR | FS_MODE_RD);
if(res == FS_RES_OK) {
const char * def_conf = "ssid\npwd\n100.101.102.103\n1234";
fs_write(&f, def_conf, strlen(def_conf) + 1, NULL);
fs_seek(&f, 0);
}
}
if(res == FS_RES_OK) {
volatile char buf[256];
volatile uint32_t rn;
fs_read(&f, (char *)buf, sizeof(buf) - 1, (uint32_t *)&rn);
volatile uint16_t i;
volatile uint16_t j = 0;
volatile uint8_t line_cnt = 0;
for(i = 0; i < rn; i++) {
if(buf[i] != '\n') {
if(line_cnt == 0) def_ssid[j] = buf[i];
if(line_cnt == 1) def_pwd[j] = buf[i];
if(line_cnt == 2) def_ip[j] = buf[i];
if(line_cnt == 3) def_port[j] = buf[i];
j++;
} else {
if(line_cnt == 0) def_ssid[j] = '\0';
if(line_cnt == 1) def_pwd[j] = '\0';
if(line_cnt == 2) def_ip[j] = '\0';
if(line_cnt == 3) def_port[j] = '\0';
j = 0;
line_cnt ++;
}
}
fs_close(&f);
} else {
lv_app_notice_add("SD card error");
}
#else
strcpy(def_ssid, LV_APP_WIFI_SSID_DEF);
strcpy(def_pwd, LV_APP_WIFI_PWD_DEF);
strcpy(def_ip, LV_APP_WIFI_IP_DEF);
strcpy(def_port, LV_APP_WIFI_PORT_DEF);
#endif
#if LV_APP_WIFI_AUTO_CONNECT != 0
wifimng_set_last_netw(def_ssid, def_pwd);
wifimng_set_last_tcp(def_ip, def_port);
#endif
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, def_ssid);
strcpy(adata->set_pwd, def_pwd);
strcpy(adata->set_ip, def_ip);
strcpy(adata->set_port, def_port);
adata->last_msg_dp = NULL;
adata->last_msg_size = 0;
}
/**
* 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;
my_app_data_t * adata = app_act_com->app_data;
if(adata->last_msg_dp != NULL) dm_free(adata->last_msg_dp);
adata->last_msg_dp = dm_alloc(size);
memcpy(adata->last_msg_dp, data, size);
adata->last_msg_size = size;
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();
}
/* The wifi should be busy if there is sg. to send.
* It means fail during last send. Try again*/
if(app_act_com != NULL) {
if(wifi_busy() == false && state_act == WIFIMNG_STATE_READY) {
/*Try to send the message again*/
lv_app_notice_add("Resend WiFi message");
my_app_data_t * adata = app_act_com->app_data;
wifi_tcp_transf(adata->last_msg_dp, adata->last_msg_size, tcp_transf_cb);
}
}
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();
save_conf(app);
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);
my_app_data_t * adata = app_act_com->app_data;
dm_free(adata->last_msg_dp);
adata->last_msg_dp = NULL;
adata->last_msg_size = 0;
app_act_com = NULL;
}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();
}
}
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_IDLE) {
lv_label_set_text(wdata->title, "Not connected");
}
else if(wifimng_get_state() == WIFIMNG_STATE_READY) {
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);
}
else {
lv_label_set_text(wdata->title, "Connecting ...");
}
lv_obj_set_width(wdata->title, lv_win_get_width(app->win));
}
app = lv_app_get_next(app, &my_app_dsc);
}
}
static void save_conf(lv_app_inst_t * app)
{
#ifdef LV_APP_WIFI_CONF_PATH
my_app_data_t * adata = app->app_data;
fs_file_t f;
fs_res_t res;
res = fs_open(&f, LV_APP_WIFI_CONF_PATH, FS_MODE_WR);
if(res == FS_RES_OK) {
char buf[256];
sprintf(buf,"%s\n%s\n%s\n%s", adata->set_ssid, adata->set_pwd, adata->set_ip, adata->set_port);
fs_write(&f, buf, strlen(buf) + 1, NULL);
fs_close(&f);
}
#endif
}
#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*/

296
lv_conf_templ.h Normal file
View File

@@ -0,0 +1,296 @@
/**
* @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)
/* Enable anti-aliasing
* If enabled everything will half-sized
* Use LV_DOWNSCALE to compensate he down scaling effect of anti-aliasing*/
#define LV_ANTIALIAS 1
#define LV_DOWNSCALE (1 << LV_ANTIALIAS) /*Set the downscaling value*/
/* Buffered rendering: >= LV_DOWNSCALE * LV_HOR_RES or 0 to disable buffering*/
#define LV_VDB_SIZE (LV_HOR_RES * LV_VER_RES / 20)
#if LV_VDB_SIZE
/* Double virtual buffering
* One for rendering another to transfer former rendered image to frame buffer in the background*/
#define LV_VDB_DOUBLE 0
#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 (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*/
#define LV_OBJ_GROUP 1 /*Enable object groups*/
/*Others*/
#define LV_COLOR_TRANSP COLOR_LIME /*This could mean transparent pixel*/
#define USE_LV_EXAMPLE 1 /*Enable examples (lvgl/lv_examples/). Disable to save memory*/
/*==================
* 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
#if USE_LV_LIST != 0
#define LV_LIST_FOCUS_TIME 100 /*Animation time of focusing to the a list element [ms] (0: no animation) */
#endif
/*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*/
#define USE_LV_APP_WIFI 0
#if USE_LV_APP_WIFI != 0
#define LV_APP_WIFI_CONF_PATH "S:/wifi_conf.txt" /*Save config. here. Comment to use def. value*/
#ifndef LV_APP_WIFI_CONF_PATH
#define LV_APP_WIFI_SSID_DEF "ssid"
#define LV_APP_WIFI_PWD_DEF "pwd"
#define LV_APP_WIFI_IP_DEF "100.101.102.103"
#define LV_APP_WIFI_PORT_DEF "1234"
#endif /*LV_APP_WIFI_CONF_PATH*/
#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*/
#define USE_LV_APP_GSM 0
#if USE_LV_APP_GSM != 0
#define LV_APP_GSM_CONF_PATH "S:/gsm_conf.txt" /*Save config. here. Comment to use def. value*/
#ifndef LV_APP_GSM_CONF_PATH
#define LV_APP_GSM_APN_DEF "apn"
#define LV_APP_GSM_IP_DEF "101.102.103.104"
#define LV_APP_GSM_PORT_DEF "1234"
#endif /*LV_APP_GSM_CONF_PATH*/
#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*/
/*Ethernet*/
#define USE_LV_APP_ETHERNET 0
#if USE_LV_APP_ETHERNET != 0
/*No settings*/
#endif /*USE_LV_APP_ETHERNET != 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,46 @@ 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 +165,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 +244,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 +258,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 +301,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 +345,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 +356,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 +390,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

@@ -0,0 +1,67 @@
/**
* @file lv_ex_hello_world.c
*
*/
/*
* Greetings,
* this is the first example in the tutorial hence this is the most simple one.
* It only creates a Label, set its text, and align to the middle.
*
* Be sure in lv_conf.h LV_APP_ENEBLE is 0 (just for simplicity)
*/
/*********************
* INCLUDES
*********************/
#include "lv_ex_hello_world.h"
#if USE_LV_EXAMPLE != 0
#include "lvgl/lvgl.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
/**********************
* STATIC VARIABLES
**********************/
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/**
* Create a simple 'Hello world!' label
*/
void lv_ex_hello_world(void)
{
/*Create a Label on the current screen*/
lv_obj_t * label1 = lv_label_create(lv_scr_act(), NULL);
/*Modify the Label's text*/
lv_label_set_text(label1, "Hello world!");
/* Align the Label to the center
* NULL means align on parent (which is the screen now)
* 0, 0 at the and means an x, y offset after alignment*/
lv_obj_align_us(label1, NULL, LV_ALIGN_CENTER, 0, 0);
}
/**********************
* STATIC FUNCTIONS
**********************/
#endif /*USE_LV_EXAMPLE != 0*/

View File

@@ -0,0 +1,42 @@
/**
* @file lv_ex_hello_world.h
*
*/
#ifndef LV_EX_HELLO_WORLD_H
#define LV_EX_HELLO_WORLD_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lv_conf.h"
#if USE_LV_EXAMPLE != 0
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* GLOBAL PROTOTYPES
**********************/
void lv_ex_hello_world(void);
/**********************
* MACROS
**********************/
#endif /*USE_LV_EXAMPLE != 0*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_HELLO_WORLD_H*/

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1,218 @@
/**
* @file lv_hello_world.c
*
*/
/*
* The basic building blocks (components or widgets) in LittlevGL are the graphical objects.
* For example:
* - Buttons
* - Labels
* - Charts
* - Sliders etc
*
* In this part you can learn the basics of the objects like creating, positioning, sizing etc.
* You will also meet some different object types and their attributes.
*
* Regardless to the object type the 'lv_obj_t' variable type is used stores the objects
* and you can refer to an object with an lv_obj_t pointer (lv_obj_t *)
*
* INHERITANCE
* -------------
* Similarly to object oriented languages some kind of inheritance is used
* among the object types.
*
* Every object is derived from the 'Basic object'. (lv_obj)
*
* The types are backward compatible which means a type can use all the ancestor
* attributes/functions too.
*
* For example a 'Button' is derived from 'Container' which is derived from 'Basic objects'.
* Therefore a button can use container attributes like automatically fit size to the content.
*
* PARENT-CHILD
* -------------
* A parent can be considered as the container of its children.
* Every object has exactly one parent object (except screens).
* A parent can have unlimited number of children.
* There is no limitation for the type of the parent.
*
* The children are visible only on their parent. The parts outside will be cropped (not displayed)
*
* If the parent is moved the children will be moved with it.
*
* The earlier created object (and its children) will drawn earlier.
* Using this layers can be built.
*
* LEARN MORE
* -------------
* - General overview: http://www.gl.littlev.hu/objects
* - Detailed description of types: http://www.gl.littlev.hu/object-types
*
* NOTES
* -------------
* - Be sure 'LV_OBJ_FREE_P' is enabled in 'lv_conf.h'
*/
/*********************
* INCLUDES
*********************/
#include "lv_ex_objects.h"
#if USE_LV_EXAMPLE != 0
#include "lvgl/lvgl.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
static lv_action_res_t btn_rel_action(lv_obj_t * btn, lv_dispi_t * dispi);
static lv_action_res_t ddlist_action(lv_obj_t * ddlist, lv_dispi_t * dispi);
/**********************
* STATIC VARIABLES
**********************/
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/**
* Initialize the Object usage example
*/
void lv_ex_objects(void)
{
/********************
* CREATE A SCREEN
*******************/
/* Create a new screen and load it
* Screen can be created from any type object
* Now a Page is used which is an objects with scrollable content*/
lv_obj_t * scr = lv_page_create(NULL, NULL);
lv_scr_load(scr);
/****************
* ADD A TITLE
****************/
lv_obj_t * label = lv_label_create(scr, NULL); /*First parameters (scr) is the parent*/
lv_label_set_text(label, "Object usage demo"); /*Set the text*/
lv_obj_set_x(label, 50); /*Labels are inherited from Basic object so 'lv_obj_...' functions can be used*/
/********************
* CREATE TWO BUTTONS
********************/
/*Create a button*/
lv_obj_t * btn1 = lv_btn_create(lv_scr_act(), NULL); /*Create a button on the currently loaded screen*/
lv_btn_set_rel_action(btn1, btn_rel_action); /*Set function to call when the button is released*/
lv_obj_align(btn1, label, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 20); /*Align below the label*/
label = lv_label_create(btn1, NULL); /*Create a label on the button (the 'label' variable can be reused)*/
lv_label_set_text(label, "Button 1");
/*Copy the previous button*/
lv_obj_t * btn2 = lv_btn_create(lv_scr_act(), btn1); /*Second parameter is an object to copy*/
lv_obj_align(btn2, btn1, LV_ALIGN_OUT_RIGHT_MID, 50, 0);/*Align next to the prev. button.*/
label = lv_label_create(btn2, NULL); /*Create a label on the button*/
lv_label_set_text(label, "Button 2");
/****************
* ADD A SLIDER
****************/
/*Add a slider (inheritance: lv_obj -> lv_bar -> lv_slider)*/
lv_obj_t * slider = lv_slider_create(scr, NULL); /*Create a slider*/
lv_obj_set_size(slider, lv_obj_get_width(lv_scr_act()) / 3, LV_DPI / 3); /*Set the size*/
lv_obj_align(slider, btn1, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 20); /*Align below the first button*/
lv_bar_set_value(slider, 30); /*Slider is a 'bar' so set its value like a 'bar'*/
/***********************
* ADD A DROP DOWN LIST
************************/
lv_obj_t * ddlist = lv_ddlist_create(lv_scr_act(), NULL);
lv_obj_align(ddlist, slider, LV_ALIGN_OUT_RIGHT_TOP, 20, 0); /*Align next to the slider*/
lv_obj_set_free_p(ddlist, slider); /*Save the pointer of the slider in the ddlist (used in 'ddlist_action()')*/
lv_ddlist_set_options_str(ddlist, "None\nLittle\nHalf\nA lot\nAll"); /*Set the options*/
lv_ddlist_set_action(ddlist, ddlist_action); /*Set function to call on new option choose*/
lv_obj_set_top(ddlist, true); /*Enable the drop down list always be on the top*/
/****************
* CREATE A CHART
****************/
lv_obj_t * chart = lv_chart_create(lv_scr_act(), NULL); /*Craete the chart*/
lv_obj_set_size(chart, lv_obj_get_width(scr) / 2, lv_obj_get_width(scr) / 4); /*Set the size*/
lv_obj_align(chart, slider, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 20); /*Align below the slider*/
lv_chart_set_dl_width(chart, 3 * LV_DOWNSCALE); /*Set the line width (LV_DOWNSCALE compensates anti-aliasing if enabled)*/
/*Add a RED data line and set some points*/
lv_chart_dl_t * dl1 = lv_chart_add_data_line(chart, COLOR_RED);
lv_chart_set_next(chart, dl1, 10);
lv_chart_set_next(chart, dl1, 25);
lv_chart_set_next(chart, dl1, 45);
lv_chart_set_next(chart, dl1, 80);
/*Add a BLUE data line and set some points*/
lv_chart_dl_t * dl2 = lv_chart_add_data_line(chart, COLOR_MAKE(0x40, 0x70, 0xC0));
lv_chart_set_next(chart, dl2, 10);
lv_chart_set_next(chart, dl2, 25);
lv_chart_set_next(chart, dl2, 45);
lv_chart_set_next(chart, dl2, 80);
lv_chart_set_next(chart, dl2, 75);
lv_chart_set_next(chart, dl2, 505);
}
/**********************
* STATIC FUNCTIONS
**********************/
/**
* Called when a button is released
* @param btn pointer to the released button
* @param dispi pointer to caller display input (e.g. touchpad)
* @return LV_ACTION_RES_OK because the object is not deleted in this function
*/
static lv_action_res_t btn_rel_action(lv_obj_t * btn, lv_dispi_t * dispi)
{
/*Increase the button width*/
cord_t width = lv_obj_get_width(btn);
lv_obj_set_width(btn, width + 20);
return LV_ACTION_RES_OK;
}
/**
* Called when a new option is chosen in the drop down list
* @param ddlist pointer to the drop down list
* @param dispi pointer to caller display input (e.g. touchpad)
* @return LV_ACTION_RES_OK because the object is not deleted in this function
*/
static lv_action_res_t ddlist_action(lv_obj_t * ddlist, lv_dispi_t * dispi)
{
uint16_t opt = lv_ddlist_get_selected(ddlist); /*Get the id of selected option*/
lv_obj_t * slider = lv_obj_get_free_p(ddlist); /*Get the saved slider*/
lv_bar_set_value(slider, (opt * 100) / 4); /*Modify the slider value according to the selection*/
return LV_ACTION_RES_OK;
}
#endif /*USE_LV_EXAMPLE != 0*/

View File

@@ -0,0 +1,42 @@
/**
* @file lv_ex_objects.h
*
*/
#ifndef LV_EX_OBJECTS_H
#define LV_EX_OBJECTS_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lv_conf.h"
#if USE_LV_EXAMPLE != 0
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* GLOBAL PROTOTYPES
**********************/
void lv_ex_objects(void);
/**********************
* MACROS
**********************/
#endif /*USE_LV_EXAMPLE != 0*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_OBJ_USAGE_H*/

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,161 @@
/**
* @file lv_ex_styles.h
*
*/
/*
* You can modify the appearance of the graphical objects with styles.
* A style is simple 'lv_style_t' variable.
* Objects save the address of this variable so it has to be 'static or 'global'.
*
* A style contains various attributes to describe rectangle, image or text like
* objects at same time. To know which attribute is used by an object see:
* http://www.gl.littlev.hu/object-types
*
* To set a new style for an object use: 'lv_obj_set_style(obj, &style);
* If NULL is set as style then the object will inherit the parents style.
* For example is you create a style for button the label appearance can be defined there as well.
*
* You can use built-in styles. 'lv_style_get(LV_STYLE_... , &copy)' will give you a pointer to built in style
* and copy it to variable (second parameter) if it is not NULL.
* By default the objects use the built-in styles.
* The built-in styles can be modified in run time to give a new default skin to your GUI.
*
* Learn more here: http://www.gl.littlev.hu/objects#style
* */
/*********************
* INCLUDES
*********************/
#include "lv_ex_styles.h"
#if USE_LV_EXAMPLE != 0
#include "lvgl/lvgl.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
/**********************
* STATIC VARIABLES
**********************/
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/**
* Create a simple 'Hello world!' label
*/
void lv_ex_styles(void)
{
/****************************************
* BASE OBJECT + LABEL WITH DEFAULT STYLE
****************************************/
lv_obj_t * obj1;
obj1 = lv_obj_create(lv_scr_act(), NULL); /*Create a simple objects*/
lv_obj_set_pos(obj1, 10, 10);
lv_obj_t * label = lv_label_create(obj1, NULL);
/*Add a label to the object*/
lv_label_set_text(label, "Default");
lv_obj_align(label, NULL, LV_ALIGN_CENTER, 0, 0);
/****************************************
* BASE OBJECT WITH PRETTY COLOR STYLE
****************************************/
lv_obj_t * obj2;
obj2 = lv_obj_create(lv_scr_act(), NULL);
lv_obj_align(obj2, obj1, LV_ALIGN_OUT_RIGHT_MID, 20, 0); /*Align next to the previous object*/
lv_obj_set_style(obj2, lv_style_get(LV_STYLE_PRETTY_COLOR, NULL)); /*Set built in style*/
label = lv_label_create(obj2, NULL);
/* Add a label to the object.
* Labels by default inherit the parent's style */
lv_label_set_text(label, "Pretty\ncolor");
lv_obj_align(label, NULL, LV_ALIGN_CENTER, 0, 0);
/*****************************
* BASE OBJECT WITH NEW STYLE
*****************************/
/* Create a new style */
static lv_style_t style_new; /*Styles can't be local variables*/
lv_style_get(LV_STYLE_PRETTY_COLOR, &style_new); /*Copy a built-in style as a starting point*/
style_new.radius = LV_RADIUS_CIRCLE; /*Fully round corners*/
style_new.swidth = 8; /*8 px shadow*/
style_new.bwidth = 2; /*2 px border width*/
style_new.mcolor = COLOR_WHITE; /*White main color*/
style_new.gcolor = color_mix(COLOR_BLUE, COLOR_WHITE, OPA_40); /*light blue gradient color*/
style_new.scolor = COLOR_MAKE(0xa0, 0xa0, 0xa0); /*Light gray shadow color*/
style_new.ccolor = color_mix(COLOR_BLUE, COLOR_WHITE, OPA_90); /*Blue content color (text color)*/
style_new.letter_space = 10; /*10 px letter space*/
style_new.txt_align = LV_TXT_ALIGN_MID; /*Middel text align*/
/*Create a base object and apply the new style*/
lv_obj_t * obj3;
obj3 = lv_obj_create(lv_scr_act(), NULL);
lv_obj_align(obj3, obj2, LV_ALIGN_OUT_RIGHT_MID, 20, 0);
lv_obj_set_style(obj3, &style_new);
/* Add a label to the object.
* Labels by default inherit the parent's style */
label = lv_label_create(obj3, NULL);
lv_label_set_text(label, "New\nstyle");
lv_obj_align(label, NULL, LV_ALIGN_CENTER, 0, 0);
/************************
* CREATE A STYLED LED
***********************/
/*Create a style for the LED*/
static lv_style_t style_led;
lv_style_get(LV_STYLE_PRETTY_COLOR, &style_led);
style_led.swidth = 15;
style_led.radius = LV_RADIUS_CIRCLE;
style_led.bwidth = 3;
style_led.bopa = OPA_30;
style_led.mcolor = COLOR_MAKE(0xb5, 0x0f, 0x04);
style_led.gcolor = COLOR_MAKE(0x50, 0x07, 0x02);
style_led.bcolor = COLOR_MAKE(0xfa, 0x0f, 0x00);
style_led.scolor = COLOR_MAKE(0xb5, 0x0f, 0x04);
/*Create a LED and switch it ON*/
lv_obj_t * led1 = lv_led_create(lv_scr_act(), NULL);
lv_obj_set_style(led1, &style_led);
lv_obj_align_us(led1, obj1, LV_ALIGN_OUT_BOTTOM_MID, 0, 40);
lv_led_on(led1);
/*Copy the previous LED and set a brightness*/
lv_obj_t * led2 = lv_led_create(lv_scr_act(), led1);
lv_obj_align_us(led2, obj2, LV_ALIGN_OUT_BOTTOM_MID, 0, 40);
lv_led_set_bright(led2, 190);
/*Copy the previous LED and switch it OFF*/
lv_obj_t * led3 = lv_led_create(lv_scr_act(), led1);
lv_obj_align_us(led3, obj3, LV_ALIGN_OUT_BOTTOM_MID, 0, 40);
lv_led_off(led3);
}
/**********************
* STATIC FUNCTIONS
**********************/
#endif /*USE_LV_EXAMPLE != 0*/

View File

@@ -0,0 +1,42 @@
/**
* @file style_usage.h
*
*/
#ifndef STYLE_USAGE_H
#define STYLE_USAGE_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lv_conf.h"
#if USE_LV_EXAMPLE != 0
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* GLOBAL PROTOTYPES
**********************/
void lv_ex_styles(void);
/**********************
* MACROS
**********************/
#endif /*USE_LV_EXAMPLE != 0*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_HELLO_WORLD_H*/

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1 @@

View File

View File

View File

@@ -0,0 +1,328 @@
/**
* @file lv_ex_encoder_ctrl.c
*
*/
/*
* Create a simple GUI to demonstrate how to control it with an encoder
* using 'lv_group'.
*
* Be sure in lv_conf.h:
* - LV_OBJ_GROUP 1 to enable groups
* - LV_APP_ENABLE 0 to disable applications because they might bother now
*
* lv_group:
* - you can create groups and add object to them
* - it can be a focused object within a group
* - the style of the focused object will be automatically modified
* - different style modifier functions can be applied in each groups
* - you can focus on the next or previous object (lv_group_focus_next/prev)
* - letters can be sent to the focused object to do something (lv_group_send):
* - LV_GROUP_KEY_RIGHT/UP: increment action in the object
* - LV_GROUP_KEY_LEFT/DOWN: decrement action in the object
* - LV_GROUP_KEY_ENTER: ok or select action in the object
* - LV_GROUP_KEY_ESC: close or back action action in the object
* - or any character for example to a text area
*
* The encoder is replaced by 4 button on the screen:
* - [>] Next (lv_group_focus_next): focus on the next object in the group (simulates encoder press)
* - [+] IncrementNext (LV_GROUP_KEY_RIGHT): increment signal to the object (simulates rotate right)
* - [-] DecrementNext (LV_GROUP_KEY_LEFT): increment signal to the object (simulates rotate left)
* - [!] SelectNext (LV_GROUP_KEY_ENTER): Select something (simulates encoder long press or an 'Select' button)
*/
/*********************
* INCLUDES
*********************/
#include "lv_ex_encoder_ctrl.h"
#if USE_LV_EXAMPLE != 0
#include "lvgl/lvgl.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
static void gui_create(void);
static void enc_create(void);
static lv_action_res_t mbox_yes_action(lv_obj_t * btn, lv_dispi_t * dispi);
static lv_action_res_t mbox_no_action(lv_obj_t * btn, lv_dispi_t * dispi);
static lv_action_res_t enable_action(lv_obj_t * btn, lv_dispi_t * dispi);
static lv_action_res_t enc_next(lv_obj_t * btn, lv_dispi_t * dispi);
static lv_action_res_t enc_inc(lv_obj_t * btn, lv_dispi_t * dispi);
static lv_action_res_t enc_dec(lv_obj_t * btn, lv_dispi_t * dispi);
static lv_action_res_t enc_sel(lv_obj_t * btn, lv_dispi_t * dispi);
/**********************
* STATIC VARIABLES
**********************/
static lv_obj_t * scr; /*The screen for the demo*/
static lv_obj_t * btn_enable; /*An enable button*/
static lv_style_t style_mbox_bg; /*Black bg. style with opacity*/
static lv_group_t * g; /*An Object Group*/
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
/**
* Create a simple GUI to demonstrate encoder control capability
*/
void lv_ex_encoder_ctrl(void)
{
/* Create a Page screen (to make it scrollable)
* and use Pretty layout to make the content responsive.
* See the 'responsive' example for more information */
scr = lv_page_create(NULL, NULL);
lv_cont_set_layout(lv_page_get_scrl(scr), LV_CONT_LAYOUT_PRETTY);
lv_page_set_sb_mode(scr, LV_PAGE_SB_MODE_AUTO);
lv_scr_load(scr);
/*Create an object group for objects to focus*/
g = lv_group_create();
/* Create a dark plain style for a message box's background*/
lv_style_get(LV_STYLE_PLAIN, &style_mbox_bg);
style_mbox_bg.mcolor = COLOR_BLACK;
style_mbox_bg.gcolor = COLOR_BLACK;
style_mbox_bg.opa = OPA_50;
/*Create a demo GUI*/
gui_create();
/*Create virtual encoder*/
enc_create();
}
/**********************
* STATIC FUNCTIONS
**********************/
/**
* Create a demo GUI
*/
static void gui_create(void)
{
/*Create a title*/
lv_obj_t * title = lv_label_create(scr, NULL);
lv_label_set_text(title, "Encoder control");
lv_obj_set_protect(title, LV_PROTECT_FOLLOW); /*Make a line break in the layout*/
/*Create a drop down list*/
lv_obj_t * ddlist = lv_ddlist_create(scr, NULL);
lv_ddlist_set_options_str(ddlist, "Low\nMedium\nHigh");
lv_group_add_obj(g, ddlist); /*Add the object to the group*/
/*Create a holder an check boxes on it*/
lv_obj_t * holder = lv_cont_create(scr, NULL); /*Create a transparent holder*/
lv_cont_set_fit(holder, true, true);
lv_cont_set_layout(holder, LV_CONT_LAYOUT_COL_L);
lv_obj_set_style(holder, lv_style_get(LV_STYLE_TRANSP, NULL));
lv_obj_t * cb = lv_cb_create(holder, NULL); /*First check box*/
lv_cb_set_text(cb, "Red");
lv_group_add_obj(g, cb); /*Add to the group*/
cb = lv_cb_create(holder, cb); /*Copy the first check box. Automatically added to the same group*/
lv_cb_set_text(cb, "Green");
cb = lv_cb_create(holder, cb); /*Copy the second check box. Automatically added to the same group*/
lv_cb_set_text(cb, "Blue");
/*Create a sliders*/
lv_obj_t * slider = lv_slider_create(scr, NULL);
lv_obj_set_size_us(slider, 180, 30);
lv_bar_set_range(slider, 0, 20);
lv_group_add_obj(g, slider); /*Add to the group*/
/*Create a button*/
btn_enable = lv_btn_create(scr, NULL);
lv_btn_set_rel_action(btn_enable, enable_action);
lv_cont_set_fit(btn_enable, true, true);
lv_group_add_obj(g, btn_enable); /*Add to the group*/
lv_obj_t * l = lv_label_create(btn_enable, NULL);
lv_label_set_text(l, "Enable");
lv_obj_set_protect(btn_enable, LV_PROTECT_FOLLOW); /*Make a line break in the layout*/
}
/**
* Create virtual encoder using 4 buttons:
* - [>] Next: focus on the next object in the group (simulates encoder press)
* - [+] Increment: increment signal to the object (simulates rotate right)
* - [-] Decrement: increment signal to the object (simulates rotate left)
* - [!] Select: Select something (simulates encoder long press or an 'Select' button)
*/
static void enc_create(void)
{
/*Next button*/
lv_obj_t * btn = lv_btn_create(lv_scr_act(), NULL);
lv_btn_set_rel_action(btn, enc_next);
lv_cont_set_fit(btn, true, true);
lv_obj_t * l = lv_label_create(btn, NULL);
lv_label_set_text(l, ">");
/*Increment button*/
btn = lv_btn_create(lv_scr_act(), btn);
lv_btn_set_rel_action(btn, enc_dec);
l = lv_label_create(btn, NULL);
lv_label_set_text(l, "-");
/*Decrement button*/
btn = lv_btn_create(lv_scr_act(), btn);
lv_btn_set_rel_action(btn, enc_inc);
l = lv_label_create(btn, NULL);
lv_label_set_text(l, "+");
/*Select button*/
btn = lv_btn_create(lv_scr_act(), btn);
lv_btn_set_rel_action(btn, enc_sel);
l = lv_label_create(btn, NULL);
lv_label_set_text(l, "!");
}
/**
* Called when the Enable button is released. Show a message box to really enable or not?
* @param btn pointer to the Enable button
* @param dispi pointer to the caller display input or NULL if the encoder used
* @return LV_ACTION_RES_OK: because the button is not deleted
*/
static lv_action_res_t enable_action(lv_obj_t * btn, lv_dispi_t * dispi)
{
/*If the butto nsi released the show message box to be sure about the Enable*/
if(lv_btn_get_state(btn) == LV_BTN_STATE_REL) {
/* Create a dark screen sized bg. with opacity to show
* the other objects are not available now*/
lv_obj_t * bg = lv_obj_create(scr, NULL);
lv_obj_set_protect(bg, LV_PROTECT_PARENT); /*The page screen move it to scrollable area*/
lv_obj_set_parent(bg, scr); /*So movi it back ater protected*/
lv_obj_set_style(bg, &style_mbox_bg);
lv_obj_set_size(bg, LV_HOR_RES, LV_VER_RES);
lv_obj_set_pos(bg, 0, 0);
lv_obj_set_click(bg, false); /*For test disable click there fore buttons under it remain clickable*/
/*Create a message box*/
lv_obj_t * mbox = lv_mbox_create(bg, NULL);
lv_mbox_set_text(mbox, "Really Enable the outputs?");
lv_group_add_obj(g, mbox); /*Add to he group*/
/*Add two buttons*/
lv_mbox_add_btn(mbox, "Yes", mbox_yes_action);
lv_mbox_add_btn(mbox, "No", mbox_no_action);
lv_obj_align(mbox, NULL, LV_ALIGN_CENTER, 0, - LV_DPI / 2);
/*Focus on the new message box, can freeze focus on it*/
lv_group_focus_obj(mbox);
lv_group_focus_freeze(g, true);
}
/*Disable is not dangerous so just change the button state*/
else {
lv_btn_set_state(btn_enable, LV_BTN_STATE_REL);
}
return LV_ACTION_RES_OK;
}
/**
* Called when the message box's 'Yes' button is released
* @param btn pointer to the 'Yes' button
* @param dispi pointer to the caller display input or NULL if the encoder used
* @return LV_ACTION_RES_INV: because the button along with the message box will be deleted
*/
static lv_action_res_t mbox_yes_action(lv_obj_t * btn, lv_dispi_t * dispi)
{
lv_group_focus_freeze(g, false); /*Release the freeze*/
lv_obj_t * mbox = lv_mbox_get_from_btn(btn);
lv_obj_del(lv_obj_get_parent(mbox)); /*Delete the black background. (it will delete the mbox too)*/
/*Mark the enabled state by toggling the button*/
lv_btn_set_state(btn_enable, LV_BTN_STATE_TREL);
/* In a real case you can add some specific actions here
* to really enable something */
return LV_ACTION_RES_INV;
}
/**
* Called when the message box's 'No' button is released
* @param btn pointer to the 'No' button
* @param dispi pointer to the caller display input or NULL if the encoder used
* @return LV_ACTION_RES_INV: because the button along with the message box will be deleted
*/
static lv_action_res_t mbox_no_action(lv_obj_t * btn, lv_dispi_t * dispi)
{
lv_group_focus_freeze(g, false); /*Release the freeze*/
lv_obj_t * mbox = lv_mbox_get_from_btn(btn);
lv_obj_del(lv_obj_get_parent(mbox)); /*Delete the black background. (it will delete the mbox too)*/
return LV_ACTION_RES_INV;
}
/**
* Called when the Encoder emulator's Next button is released
* @param btn pointer to the button
* @param dispi pointer to the caller display input
* @return LV_ACTION_RES_OK: because the button is not deleted
*/
static lv_action_res_t enc_next(lv_obj_t * btn, lv_dispi_t * dispi)
{
/*Focus on the next object in the group*/
lv_group_focus_next(g);
return LV_ACTION_RES_OK;
}
/**
* Called when the Encoder emulator's Increment button is released
* @param btn pointer to the button
* @param dispi pointer to the caller display input
* @return LV_ACTION_RES_OK: because the button is not deleted
*/
static lv_action_res_t enc_inc(lv_obj_t * btn, lv_dispi_t * dispi)
{
/* Send RIGHT key when rotate to right.
* It will trigger an increment like action in the object */
lv_group_send(g, LV_GROUP_KEY_RIGHT);
return LV_ACTION_RES_OK;
}
/**
* Called when the Encoder emulator's Increment button is released
* @param btn pointer to the button
* @param dispi pointer to the caller display input
* @return LV_ACTION_RES_OK: because the button is not deleted
*/
static lv_action_res_t enc_dec(lv_obj_t * btn, lv_dispi_t * dispi)
{
/* Send LEFT key when rotate to left.
* It will trigger a decrement like action in the object */
lv_group_send(g, LV_GROUP_KEY_LEFT);
return LV_ACTION_RES_OK;
}
/**
* Called when the Encoder emulator's Send button is released
* @param btn pointer to the button
* @param dispi pointer to the caller display input
* @return LV_ACTION_RES_OK: because the button is not deleted
*/
static lv_action_res_t enc_sel(lv_obj_t * btn, lv_dispi_t * dispi)
{
/* Send ENTER key.
* It will trigger an 'OK' or 'Select' action in the object */
lv_group_send(g, LV_GROUP_KEY_ENTER);
return LV_ACTION_RES_OK;
}
#endif /*USE_LV_EXAMPLE != 0*/

View File

@@ -0,0 +1,42 @@
/**
* @file lv_ex_encoder_ctrl.h
*
*/
#ifndef LV_EX_ENCODER_CTRL_H
#define LV_EX_ENCODER_CTRL_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "lv_conf.h"
#if USE_LV_EXAMPLE != 0
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* GLOBAL PROTOTYPES
**********************/
void lv_ex_encoder_ctrl(void);
/**********************
* MACROS
**********************/
#endif /*USE_LV_EXAMPLE != 0*/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*ENCODER_CTRL_H*/

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

View File

View File

View File

41
lv_examples/README.md Normal file
View File

@@ -0,0 +1,41 @@
# EXAMPLES FOR LITTLEV GRAPHICS LIBRARY
## Introduction
In the folders you will find simple hardware independent examples to know the key features of Littlev Graphics Library.
The examples are organized in consistent way and can be used as a **Tutorial**.
Every example consist of least an *example_name.c* and *example_name.h* files. You can load an example in your *main* function with **example_name_init()**. The header file has to be included too.
You will find **detailed explanation** in the *c* and *h* files.
The examples can be enabled/disabled in *lv_conf.h* with **USE_LV_EXAMPLES**.
## 1_x Getting started
With examples in this section you can learn the basics from a simple *Hello world* label to a complex full featured GUI with animations and other effects. You will learn about
- creating, deleting graphical objects
- modify their attributes
- change their style
- and even creating a new object type
## 2_x GUI control without Touchpad
You can control your GUI not only with Touchpad. The most simple way to put real buttons next to the graphical ones and simulate *touch pad-like press* on the display. An other way is to organize the objects in groups and *focus* on one of objects. Then you can control the object-in-focus with simple character instructions. Or using a cursor and mouse is also possible. So an external control device can be
- push buttons
- encoders
- keyboard
- or a mouse
In this section you will find examples for them!
## 3_x Applications
The applications are high level components to do complex thing with a nice user interface. An application can be for example
- WiFi network manager
- File system browser
- System monitor
- Terminal etc.
Here you will find examples how to run application, and communicate with them.
## Final words
If you also have codes which could be useful for others, please share it via *Pull requests* on *GitHub*!
Thank you in advance!

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

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