Added the compass app which needs a lot of refinement and corrections, reworked the way menu screen icon callback is handled and other minor changes
This commit is contained in:
parent
ca6a45f132
commit
748f7465e3
183
src/W800 SDK v1.00.08/app/gfx/assets/compass_assets.c
Normal file
183
src/W800 SDK v1.00.08/app/gfx/assets/compass_assets.c
Normal file
@ -0,0 +1,183 @@
|
|||||||
|
#include "lvgl.h"
|
||||||
|
|
||||||
|
const LV_ATTRIBUTE_LARGE_CONST uint8_t compass_marker_north_map[] = {
|
||||||
|
#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8
|
||||||
|
/*Pixel format: Red: 3 bit, Green: 3 bit, Blue: 2 bit*/
|
||||||
|
0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0xf7, 0x69, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
|
||||||
|
0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0xb2, 0xa0, 0xd7, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
|
||||||
|
0x1c, 0x1c, 0x1c, 0x1c, 0xfb, 0x89, 0xe0, 0xa9, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
|
||||||
|
0x1c, 0x1c, 0x1c, 0x1c, 0xb2, 0xa0, 0xe0, 0xe0, 0xb6, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
|
||||||
|
0x1c, 0x1c, 0x1c, 0xff, 0xae, 0xc0, 0xe0, 0xe0, 0x89, 0xff, 0x1c, 0x1c, 0x1c, 0x1c,
|
||||||
|
0x1c, 0x1c, 0x1c, 0xfb, 0x80, 0xe0, 0xe0, 0xe0, 0xc0, 0xb6, 0x1c, 0x1c, 0x1c, 0x1c,
|
||||||
|
0x1c, 0x1c, 0x1c, 0xd2, 0xc0, 0xe0, 0xe0, 0xe0, 0xe0, 0x89, 0xfb, 0x1c, 0x1c, 0x1c,
|
||||||
|
0x1c, 0x1c, 0xff, 0x84, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xa0, 0xb7, 0x1c, 0x1c, 0x1c,
|
||||||
|
0x1c, 0x1c, 0xdb, 0x80, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0x89, 0xfb, 0x1c, 0x1c,
|
||||||
|
0x1c, 0xff, 0x89, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xa0, 0xdb, 0x1c, 0x1c,
|
||||||
|
0x1c, 0xff, 0x60, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0x85, 0xff, 0x1c,
|
||||||
|
0x1c, 0xa9, 0xc0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xa0, 0xd7, 0x1c,
|
||||||
|
0xff, 0x60, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0x64, 0xff,
|
||||||
|
0xd2, 0xa0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xa0, 0xd2,
|
||||||
|
0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24,
|
||||||
|
#endif
|
||||||
|
#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP == 0
|
||||||
|
/*Pixel format: Red: 5 bit, Green: 6 bit, Blue: 5 bit*/
|
||||||
|
0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0x96, 0xed, 0x49, 0x62, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07,
|
||||||
|
0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0x10, 0x9c, 0x00, 0x98, 0x75, 0xc5, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07,
|
||||||
|
0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0x59, 0xe6, 0xc7, 0x81, 0x00, 0xf0, 0xc7, 0x99, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07,
|
||||||
|
0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0x10, 0xa4, 0x82, 0xb0, 0x00, 0xf8, 0x00, 0xd0, 0x92, 0xac, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07,
|
||||||
|
0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0x1c, 0xf7, 0x4d, 0xa3, 0x00, 0xc8, 0x20, 0xf8, 0x00, 0xf8, 0x49, 0x92, 0xfc, 0xf6, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07,
|
||||||
|
0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0x18, 0xd6, 0x82, 0x88, 0x21, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x41, 0xc0, 0xb2, 0xa4, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07,
|
||||||
|
0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0x72, 0xb4, 0x00, 0xb0, 0x20, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x49, 0x82, 0x7a, 0xf6, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07,
|
||||||
|
0xe0, 0x07, 0xe0, 0x07, 0x5d, 0xf7, 0xc3, 0x78, 0x21, 0xf0, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x20, 0xf8, 0x41, 0xb0, 0x55, 0xad, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07,
|
||||||
|
0xe0, 0x07, 0xe0, 0x07, 0x96, 0xd5, 0x00, 0x88, 0x20, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf0, 0x28, 0x8a, 0x7a, 0xf6, 0xe0, 0x07, 0xe0, 0x07,
|
||||||
|
0xe0, 0x07, 0x5d, 0xf7, 0xc7, 0x81, 0x00, 0xd8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x20, 0xf8, 0x20, 0xa0, 0xd7, 0xbd, 0xe0, 0x07, 0xe0, 0x07,
|
||||||
|
0xe0, 0x07, 0xfb, 0xee, 0x00, 0x58, 0x20, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x20, 0xf0, 0x66, 0x81, 0xbb, 0xfe, 0xe0, 0x07,
|
||||||
|
0xe0, 0x07, 0x8a, 0x92, 0x00, 0xc0, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0x98, 0x75, 0xc5, 0xe0, 0x07,
|
||||||
|
0x5d, 0xff, 0x41, 0x60, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf0, 0xe3, 0x68, 0x5d, 0xff,
|
||||||
|
0xcf, 0xc3, 0x00, 0xa8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0x90, 0x92, 0xb4,
|
||||||
|
0xe3, 0x20, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xc3, 0x18,
|
||||||
|
#endif
|
||||||
|
#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP != 0
|
||||||
|
/*Pixel format: Red: 5 bit, Green: 6 bit, Blue: 5 bit BUT the 2 bytes are swapped*/
|
||||||
|
0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0xed, 0x96, 0x62, 0x49, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0,
|
||||||
|
0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x9c, 0x10, 0x98, 0x00, 0xc5, 0x75, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0,
|
||||||
|
0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0xe6, 0x59, 0x81, 0xc7, 0xf0, 0x00, 0x99, 0xc7, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0,
|
||||||
|
0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0xa4, 0x10, 0xb0, 0x82, 0xf8, 0x00, 0xd0, 0x00, 0xac, 0x92, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0,
|
||||||
|
0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0xf7, 0x1c, 0xa3, 0x4d, 0xc8, 0x00, 0xf8, 0x20, 0xf8, 0x00, 0x92, 0x49, 0xf6, 0xfc, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0,
|
||||||
|
0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0xd6, 0x18, 0x88, 0x82, 0xf8, 0x21, 0xf8, 0x00, 0xf8, 0x00, 0xc0, 0x41, 0xa4, 0xb2, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0,
|
||||||
|
0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0xb4, 0x72, 0xb0, 0x00, 0xf8, 0x20, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0x82, 0x49, 0xf6, 0x7a, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0,
|
||||||
|
0x07, 0xe0, 0x07, 0xe0, 0xf7, 0x5d, 0x78, 0xc3, 0xf0, 0x21, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x20, 0xb0, 0x41, 0xad, 0x55, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0,
|
||||||
|
0x07, 0xe0, 0x07, 0xe0, 0xd5, 0x96, 0x88, 0x00, 0xf8, 0x20, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf0, 0x00, 0x8a, 0x28, 0xf6, 0x7a, 0x07, 0xe0, 0x07, 0xe0,
|
||||||
|
0x07, 0xe0, 0xf7, 0x5d, 0x81, 0xc7, 0xd8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x20, 0xa0, 0x20, 0xbd, 0xd7, 0x07, 0xe0, 0x07, 0xe0,
|
||||||
|
0x07, 0xe0, 0xee, 0xfb, 0x58, 0x00, 0xf8, 0x20, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf0, 0x20, 0x81, 0x66, 0xfe, 0xbb, 0x07, 0xe0,
|
||||||
|
0x07, 0xe0, 0x92, 0x8a, 0xc0, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0x98, 0x00, 0xc5, 0x75, 0x07, 0xe0,
|
||||||
|
0xff, 0x5d, 0x60, 0x41, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf0, 0x00, 0x68, 0xe3, 0xff, 0x5d,
|
||||||
|
0xc3, 0xcf, 0xa8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0xf8, 0x00, 0x90, 0x00, 0xb4, 0x92,
|
||||||
|
0x20, 0xe3, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x18, 0xc3,
|
||||||
|
#endif
|
||||||
|
#if LV_COLOR_DEPTH == 32
|
||||||
|
/*Pixel format: Fix 0xFF: 8 bit, Red: 8 bit, Green: 8 bit, Blue: 8 bit*/
|
||||||
|
0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xaf, 0xaf, 0xe5, 0xff, 0x48, 0x48, 0x5e, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
|
||||||
|
0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x80, 0x80, 0x9a, 0xff, 0x01, 0x01, 0x99, 0xff, 0xaa, 0xaa, 0xc1, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
|
||||||
|
0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xc9, 0xc9, 0xe1, 0xff, 0x37, 0x37, 0x82, 0xff, 0x00, 0x00, 0xed, 0xff, 0x37, 0x37, 0x95, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
|
||||||
|
0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x81, 0x81, 0x9e, 0xff, 0x0e, 0x0e, 0xac, 0xff, 0x01, 0x01, 0xff, 0xff, 0x00, 0x00, 0xd1, 0xff, 0x90, 0x90, 0xab, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
|
||||||
|
0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xe0, 0xe0, 0xf1, 0xff, 0x67, 0x67, 0xa0, 0xff, 0x00, 0x00, 0xcb, 0xff, 0x02, 0x02, 0xfe, 0xff, 0x00, 0x00, 0xf8, 0xff, 0x48, 0x48, 0x8d, 0xff, 0xdd, 0xdd, 0xef, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
|
||||||
|
0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xbf, 0xbf, 0xd1, 0xff, 0x0f, 0x0f, 0x8a, 0xff, 0x04, 0x04, 0xf7, 0xff, 0x00, 0x00, 0xfc, 0xff, 0x01, 0x01, 0xff, 0xff, 0x08, 0x08, 0xbc, 0xff, 0x92, 0x92, 0xa0, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
|
||||||
|
0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x8c, 0x8c, 0xb2, 0xff, 0x00, 0x00, 0xb0, 0xff, 0x02, 0x02, 0xff, 0xff, 0x00, 0x00, 0xfa, 0xff, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0xf8, 0xff, 0x49, 0x49, 0x83, 0xff, 0xcc, 0xcc, 0xed, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
|
||||||
|
0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xe9, 0xe9, 0xee, 0xff, 0x18, 0x18, 0x77, 0xff, 0x05, 0x05, 0xef, 0xff, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0xfc, 0xff, 0x00, 0x00, 0xfb, 0xff, 0x03, 0x03, 0xff, 0xff, 0x06, 0x06, 0xae, 0xff, 0xa9, 0xa9, 0xab, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
|
||||||
|
0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xb1, 0xb1, 0xcc, 0xff, 0x00, 0x00, 0x89, 0xff, 0x03, 0x03, 0xff, 0xff, 0x00, 0x00, 0xfa, 0xff, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0xfd, 0xff, 0x00, 0x00, 0xfd, 0xff, 0x01, 0x01, 0xf2, 0xff, 0x42, 0x42, 0x87, 0xff, 0xcc, 0xcc, 0xf1, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
|
||||||
|
0x00, 0xff, 0x00, 0xff, 0xe7, 0xe7, 0xee, 0xff, 0x39, 0x39, 0x7c, 0xff, 0x01, 0x01, 0xd6, 0xff, 0x00, 0x00, 0xfd, 0xff, 0x00, 0x00, 0xfb, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xf9, 0xff, 0x03, 0x03, 0xff, 0xff, 0x02, 0x02, 0xa1, 0xff, 0xb7, 0xb7, 0xb9, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
|
||||||
|
0x00, 0xff, 0x00, 0xff, 0xdb, 0xdb, 0xe5, 0xff, 0x01, 0x01, 0x55, 0xff, 0x03, 0x03, 0xff, 0xff, 0x00, 0x00, 0xf9, 0xff, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0xfd, 0xff, 0x00, 0x00, 0xfd, 0xff, 0x02, 0x02, 0xed, 0xff, 0x2d, 0x2d, 0x7f, 0xff, 0xd5, 0xd5, 0xf4, 0xff, 0x00, 0xff, 0x00, 0xff,
|
||||||
|
0x00, 0xff, 0x00, 0xff, 0x4e, 0x4e, 0x90, 0xff, 0x00, 0x00, 0xbc, 0xff, 0x00, 0x00, 0xfd, 0xff, 0x00, 0x00, 0xfb, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0xfb, 0xff, 0x01, 0x01, 0xff, 0xff, 0x00, 0x00, 0x9a, 0xff, 0xab, 0xab, 0xbc, 0xff, 0x00, 0xff, 0x00, 0xff,
|
||||||
|
0xe7, 0xe7, 0xfb, 0xff, 0x07, 0x07, 0x5e, 0xff, 0x00, 0x00, 0xfa, 0xff, 0x00, 0x00, 0xfc, 0xff, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0xfe, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xfd, 0xff, 0x00, 0x00, 0xfc, 0xff, 0x00, 0x00, 0xee, 0xff, 0x1a, 0x1a, 0x65, 0xff, 0xe7, 0xe7, 0xfb, 0xff,
|
||||||
|
0x77, 0x77, 0xc2, 0xff, 0x00, 0x00, 0xa9, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x93, 0xff, 0x8e, 0x8e, 0xb3, 0xff,
|
||||||
|
0x1a, 0x1a, 0x1c, 0xff, 0x00, 0x00, 0x04, 0xff, 0x00, 0x00, 0x02, 0xff, 0x00, 0x00, 0x03, 0xff, 0x00, 0x00, 0x02, 0xff, 0x00, 0x00, 0x03, 0xff, 0x00, 0x00, 0x03, 0xff, 0x00, 0x00, 0x03, 0xff, 0x00, 0x00, 0x03, 0xff, 0x00, 0x00, 0x03, 0xff, 0x00, 0x00, 0x02, 0xff, 0x00, 0x00, 0x02, 0xff, 0x00, 0x00, 0x04, 0xff, 0x18, 0x18, 0x18, 0xff,
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
const lv_img_dsc_t compass_marker_north = {
|
||||||
|
.header.cf = LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED,
|
||||||
|
.header.always_zero = 0,
|
||||||
|
.header.reserved = 0,
|
||||||
|
.header.w = 14,
|
||||||
|
.header.h = 15,
|
||||||
|
.data_size = 210 * LV_COLOR_SIZE / 8,
|
||||||
|
.data = compass_marker_north_map,
|
||||||
|
};
|
||||||
|
|
||||||
|
const LV_ATTRIBUTE_LARGE_CONST uint8_t compass_marker_map[] = {
|
||||||
|
#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8
|
||||||
|
/*Pixel format: Red: 3 bit, Green: 3 bit, Blue: 2 bit*/
|
||||||
|
0x49, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x49,
|
||||||
|
0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6e,
|
||||||
|
0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdb,
|
||||||
|
0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c,
|
||||||
|
0x1c, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x1c,
|
||||||
|
0x1c, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x1c,
|
||||||
|
0x1c, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdb, 0x1c,
|
||||||
|
0x1c, 0x1c, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x1c, 0x1c,
|
||||||
|
0x1c, 0x1c, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x1c, 0x1c,
|
||||||
|
0x1c, 0x1c, 0xb7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb7, 0x1c, 0x1c,
|
||||||
|
0x1c, 0x1c, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x1c, 0x1c,
|
||||||
|
0x1c, 0x1c, 0x1c, 0x49, 0x00, 0x00, 0x00, 0x00, 0x49, 0x1c, 0x1c, 0x1c,
|
||||||
|
0x1c, 0x1c, 0x1c, 0x92, 0x00, 0x00, 0x00, 0x00, 0x92, 0x1c, 0x1c, 0x1c,
|
||||||
|
0x1c, 0x1c, 0x1c, 0xdb, 0x00, 0x00, 0x00, 0x00, 0xdb, 0x1c, 0x1c, 0x1c,
|
||||||
|
0x1c, 0x1c, 0x1c, 0x1c, 0x24, 0x00, 0x00, 0x24, 0x1c, 0x1c, 0x1c, 0x1c,
|
||||||
|
0x1c, 0x1c, 0x1c, 0x1c, 0x6d, 0x00, 0x00, 0x6d, 0x1c, 0x1c, 0x1c, 0x1c,
|
||||||
|
0x1c, 0x1c, 0x1c, 0x1c, 0xb6, 0x00, 0x00, 0xb6, 0x1c, 0x1c, 0x1c, 0x1c,
|
||||||
|
0x1c, 0x1c, 0x1c, 0x1c, 0xff, 0x25, 0x25, 0xff, 0x1c, 0x1c, 0x1c, 0x1c,
|
||||||
|
#endif
|
||||||
|
#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP == 0
|
||||||
|
/*Pixel format: Red: 5 bit, Green: 6 bit, Blue: 5 bit*/
|
||||||
|
0xc7, 0x39, 0xa3, 0x18, 0xa3, 0x18, 0xa3, 0x18, 0xa3, 0x18, 0xa3, 0x18, 0xa3, 0x18, 0xa3, 0x18, 0xa3, 0x18, 0xa3, 0x18, 0xa3, 0x18, 0xc7, 0x39,
|
||||||
|
0x4d, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x6b,
|
||||||
|
0x96, 0xb5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0xb5,
|
||||||
|
0xe0, 0x07, 0x41, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x08, 0xe0, 0x07,
|
||||||
|
0xe0, 0x07, 0x08, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x42, 0xe0, 0x07,
|
||||||
|
0xe0, 0x07, 0x51, 0x8c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x8c, 0xe0, 0x07,
|
||||||
|
0xe0, 0x07, 0x7a, 0xd6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7a, 0xd6, 0xe0, 0x07,
|
||||||
|
0xe0, 0x07, 0xe0, 0x07, 0xc3, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x18, 0xe0, 0x07, 0xe0, 0x07,
|
||||||
|
0xe0, 0x07, 0xe0, 0x07, 0xec, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x62, 0xe0, 0x07, 0xe0, 0x07,
|
||||||
|
0xe0, 0x07, 0xe0, 0x07, 0x35, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x35, 0xad, 0xe0, 0x07, 0xe0, 0x07,
|
||||||
|
0xe0, 0x07, 0xe0, 0x07, 0x5d, 0xef, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x5d, 0xef, 0xe0, 0x07, 0xe0, 0x07,
|
||||||
|
0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xa6, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x31, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07,
|
||||||
|
0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xcf, 0x7b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcf, 0x7b, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07,
|
||||||
|
0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0x38, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0xc6, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07,
|
||||||
|
0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0x82, 0x10, 0x00, 0x00, 0x00, 0x00, 0x82, 0x10, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07,
|
||||||
|
0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0x8a, 0x52, 0x00, 0x00, 0x00, 0x00, 0x8a, 0x52, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07,
|
||||||
|
0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xd3, 0x9c, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x9c, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07,
|
||||||
|
0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0x1c, 0xe7, 0x66, 0x31, 0x66, 0x31, 0x1c, 0xe7, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07,
|
||||||
|
#endif
|
||||||
|
#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP != 0
|
||||||
|
/*Pixel format: Red: 5 bit, Green: 6 bit, Blue: 5 bit BUT the 2 bytes are swapped*/
|
||||||
|
0x39, 0xc7, 0x18, 0xa3, 0x18, 0xa3, 0x18, 0xa3, 0x18, 0xa3, 0x18, 0xa3, 0x18, 0xa3, 0x18, 0xa3, 0x18, 0xa3, 0x18, 0xa3, 0x18, 0xa3, 0x39, 0xc7,
|
||||||
|
0x6b, 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6b, 0x4d,
|
||||||
|
0xb5, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb5, 0x96,
|
||||||
|
0x07, 0xe0, 0x08, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x41, 0x07, 0xe0,
|
||||||
|
0x07, 0xe0, 0x42, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x08, 0x07, 0xe0,
|
||||||
|
0x07, 0xe0, 0x8c, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8c, 0x51, 0x07, 0xe0,
|
||||||
|
0x07, 0xe0, 0xd6, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0x7a, 0x07, 0xe0,
|
||||||
|
0x07, 0xe0, 0x07, 0xe0, 0x18, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xc3, 0x07, 0xe0, 0x07, 0xe0,
|
||||||
|
0x07, 0xe0, 0x07, 0xe0, 0x62, 0xec, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x62, 0xec, 0x07, 0xe0, 0x07, 0xe0,
|
||||||
|
0x07, 0xe0, 0x07, 0xe0, 0xad, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xad, 0x35, 0x07, 0xe0, 0x07, 0xe0,
|
||||||
|
0x07, 0xe0, 0x07, 0xe0, 0xef, 0x5d, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xef, 0x5d, 0x07, 0xe0, 0x07, 0xe0,
|
||||||
|
0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x31, 0xa6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0xa6, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0,
|
||||||
|
0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x7b, 0xcf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7b, 0xcf, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0,
|
||||||
|
0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0xc6, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x38, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0,
|
||||||
|
0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x10, 0x82, 0x00, 0x00, 0x00, 0x00, 0x10, 0x82, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0,
|
||||||
|
0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x52, 0x8a, 0x00, 0x00, 0x00, 0x00, 0x52, 0x8a, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0,
|
||||||
|
0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x9c, 0xd3, 0x00, 0x00, 0x00, 0x00, 0x9c, 0xd3, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0,
|
||||||
|
0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0xe7, 0x1c, 0x31, 0x66, 0x31, 0x66, 0xe7, 0x1c, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0, 0x07, 0xe0,
|
||||||
|
#endif
|
||||||
|
#if LV_COLOR_DEPTH == 32
|
||||||
|
/*Pixel format: Fix 0xFF: 8 bit, Red: 8 bit, Green: 8 bit, Blue: 8 bit*/
|
||||||
|
0x39, 0x39, 0x39, 0xff, 0x15, 0x15, 0x15, 0xff, 0x15, 0x15, 0x15, 0xff, 0x15, 0x15, 0x15, 0xff, 0x15, 0x15, 0x15, 0xff, 0x15, 0x15, 0x15, 0xff, 0x15, 0x15, 0x15, 0xff, 0x15, 0x15, 0x15, 0xff, 0x15, 0x15, 0x15, 0xff, 0x15, 0x15, 0x15, 0xff, 0x15, 0x15, 0x15, 0xff, 0x39, 0x39, 0x39, 0xff,
|
||||||
|
0x66, 0x66, 0x66, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x66, 0x66, 0x66, 0xff,
|
||||||
|
0xb0, 0xb0, 0xb0, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0xb0, 0xb0, 0xb0, 0xff,
|
||||||
|
0x00, 0xff, 0x00, 0xff, 0x06, 0x06, 0x06, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x06, 0x06, 0x06, 0xff, 0x00, 0xff, 0x00, 0xff,
|
||||||
|
0x00, 0xff, 0x00, 0xff, 0x3e, 0x3e, 0x3e, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x3e, 0x3e, 0x3e, 0xff, 0x00, 0xff, 0x00, 0xff,
|
||||||
|
0x00, 0xff, 0x00, 0xff, 0x88, 0x88, 0x88, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x88, 0x88, 0x88, 0xff, 0x00, 0xff, 0x00, 0xff,
|
||||||
|
0x00, 0xff, 0x00, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0xcc, 0xcc, 0xcc, 0xff, 0x00, 0xff, 0x00, 0xff,
|
||||||
|
0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x17, 0x17, 0x17, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x17, 0x17, 0x17, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
|
||||||
|
0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x5c, 0x5c, 0x5c, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x5c, 0x5c, 0x5c, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
|
||||||
|
0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xa4, 0xa4, 0xa4, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0xa4, 0xa4, 0xa4, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
|
||||||
|
0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xe9, 0xe9, 0xe9, 0xff, 0x03, 0x03, 0x03, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x03, 0x03, 0x03, 0xff, 0xe9, 0xe9, 0xe9, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
|
||||||
|
0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x33, 0x33, 0x33, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x33, 0x33, 0x33, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
|
||||||
|
0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x78, 0x78, 0x78, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x78, 0x78, 0x78, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
|
||||||
|
0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xc2, 0xc2, 0xc2, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0xc2, 0xc2, 0xc2, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
|
||||||
|
0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x10, 0x10, 0x10, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x10, 0x10, 0x10, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
|
||||||
|
0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x50, 0x50, 0x50, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x50, 0x50, 0x50, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
|
||||||
|
0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x99, 0x99, 0x99, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x99, 0x99, 0x99, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
|
||||||
|
0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0xde, 0xde, 0xde, 0xff, 0x2c, 0x2c, 0x2c, 0xff, 0x2c, 0x2c, 0x2c, 0xff, 0xde, 0xde, 0xde, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
const lv_img_dsc_t compass_marker = {
|
||||||
|
.header.cf = LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED,
|
||||||
|
.header.always_zero = 0,
|
||||||
|
.header.reserved = 0,
|
||||||
|
.header.w = 12,
|
||||||
|
.header.h = 18,
|
||||||
|
.data_size = 216 * LV_COLOR_SIZE / 8,
|
||||||
|
.data = compass_marker_map,
|
||||||
|
};
|
File diff suppressed because it is too large
Load Diff
254
src/W800 SDK v1.00.08/app/gfx/compass_screen.c
Normal file
254
src/W800 SDK v1.00.08/app/gfx/compass_screen.c
Normal file
@ -0,0 +1,254 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <math.h>
|
||||||
|
#include "lvgl.h"
|
||||||
|
#include "compass_screen.h"
|
||||||
|
#include "menu_screen.h"
|
||||||
|
|
||||||
|
static const char *cardinals[] =
|
||||||
|
{
|
||||||
|
"N",
|
||||||
|
"NE",
|
||||||
|
"E",
|
||||||
|
"SE",
|
||||||
|
"S",
|
||||||
|
"SW",
|
||||||
|
"W",
|
||||||
|
"NW"
|
||||||
|
};
|
||||||
|
|
||||||
|
static void gesture_event_cb(lv_event_t * e)
|
||||||
|
{
|
||||||
|
CompassScreen_t *compassScreen = e->user_data;
|
||||||
|
|
||||||
|
lv_dir_t gesture;
|
||||||
|
switch(gesture = lv_indev_get_gesture_dir(lv_indev_get_act()))
|
||||||
|
{
|
||||||
|
case LV_DIR_LEFT:
|
||||||
|
LV_LOG_USER("GESTURE : LEFT");
|
||||||
|
break;
|
||||||
|
case LV_DIR_RIGHT:
|
||||||
|
LV_LOG_USER("GESTURE : RIGHT");
|
||||||
|
// We create the menu screen and switch to it
|
||||||
|
extern MenuScreen_t menuScreen;
|
||||||
|
menu_screen_create(&menuScreen);
|
||||||
|
lv_scr_load_anim(menuScreen.display, LV_SCR_LOAD_ANIM_MOVE_RIGHT, 400, 0, true);
|
||||||
|
break;
|
||||||
|
case LV_DIR_TOP:
|
||||||
|
LV_LOG_USER("GESTURE : TOP");
|
||||||
|
break;
|
||||||
|
case LV_DIR_BOTTOM:
|
||||||
|
LV_LOG_USER("GESTURE : BOTTOM");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
LV_LOG_USER("GESTURE : %u", gesture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void cleanup_event_cb(lv_event_t * e)
|
||||||
|
{
|
||||||
|
CompassScreen_t *compassScreen = e->user_data;
|
||||||
|
compass_screen_destroy(compassScreen);
|
||||||
|
LV_LOG_USER("cleanup");
|
||||||
|
}
|
||||||
|
|
||||||
|
//To delete
|
||||||
|
/*static void timer_anim_cb(lv_timer_t *timer)
|
||||||
|
{
|
||||||
|
CompassScreen_t *compassScreen = timer->user_data;
|
||||||
|
static uint16_t azimuth = 0;
|
||||||
|
compass_screen_set_azimuth(compassScreen, azimuth++);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
static void create_cardinal(CompassCardinal_t *cardidanl, const char *cardinalText, lv_color_t textColor, lv_coord_t x, lv_coord_t y, lv_obj_t *parent)
|
||||||
|
{
|
||||||
|
cardidanl->label = lv_label_create(parent);
|
||||||
|
lv_label_set_text_static(cardidanl->label, cardinalText);
|
||||||
|
lv_obj_set_style_text_font(cardidanl->label, &lv_font_montserrat_24, LV_PART_MAIN);
|
||||||
|
lv_obj_set_style_text_color(cardidanl->label, textColor, LV_PART_MAIN);
|
||||||
|
lv_obj_update_layout(cardidanl->label); //Needed to compute the height and width of the label, if not called, lv_obj_get_width and height return 0.
|
||||||
|
//Let's compute the offset to move the origin of the letter to it's center :
|
||||||
|
cardidanl->offset.x = lv_obj_get_width(cardidanl->label)/2;
|
||||||
|
cardidanl->offset.y = lv_obj_get_height(cardidanl->label)/2;
|
||||||
|
|
||||||
|
cardidanl->position.x = x - cardidanl->offset.x;
|
||||||
|
cardidanl->position.y = y - cardidanl->offset.y;
|
||||||
|
lv_obj_set_pos(cardidanl->label, cardidanl->position.x, cardidanl->position.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void rotate_cardinal(CompassCardinal_t *cardinal, uint16_t azimuth)
|
||||||
|
{
|
||||||
|
lv_coord_t rotated_x, rotated_y;
|
||||||
|
float azimuth_in_rads = (float)azimuth*M_PI/180.0;
|
||||||
|
|
||||||
|
rotated_x = (float)(cardinal->position.x-120+cardinal->offset.x)*cos(azimuth_in_rads) - (float)(cardinal->position.y-120+cardinal->offset.y)*sin(azimuth_in_rads) + 120-cardinal->offset.x;
|
||||||
|
rotated_y = (float)(cardinal->position.y-120+cardinal->offset.y)*cos(azimuth_in_rads) + (float)(cardinal->position.x-120+cardinal->offset.x)*sin(azimuth_in_rads) + 120-cardinal->offset.y;
|
||||||
|
lv_obj_set_pos(cardinal->label, rotated_x, rotated_y);
|
||||||
|
}
|
||||||
|
|
||||||
|
void compass_screen_init(CompassScreen_t * const compassScreen)
|
||||||
|
{
|
||||||
|
if(!compassScreen)
|
||||||
|
{
|
||||||
|
LV_LOG_ERROR("NULL pointer given !");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
memset(compassScreen, 0, sizeof(CompassScreen_t));
|
||||||
|
strcpy(compassScreen->compassAzimuth.text, "0° N");
|
||||||
|
}
|
||||||
|
|
||||||
|
void compass_screen_set_azimuth(CompassScreen_t * const compassScreen, uint16_t azimuth)
|
||||||
|
{
|
||||||
|
if(!compassScreen)
|
||||||
|
{
|
||||||
|
LV_LOG_ERROR("NULL pointer given !");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Mandatory, if the screen is not displayed anymore, we should still be able to call this function !
|
||||||
|
if(!compassScreen->display) return;
|
||||||
|
|
||||||
|
//We make sure the azimuth is in the right range ie 0 to 359
|
||||||
|
azimuth %= 360;
|
||||||
|
|
||||||
|
uint8_t index;
|
||||||
|
|
||||||
|
if(azimuth >= 23 && azimuth <= 67)
|
||||||
|
index = 1;//NE
|
||||||
|
else if(azimuth >= 68 && azimuth <= 112)
|
||||||
|
index = 2;//E
|
||||||
|
else if(azimuth >= 113 && azimuth <= 157)
|
||||||
|
index = 3;//SE
|
||||||
|
else if(azimuth >= 158 && azimuth <= 202)
|
||||||
|
index = 4;//S
|
||||||
|
else if(azimuth >= 203 && azimuth <= 247)
|
||||||
|
index = 5;//SW
|
||||||
|
else if(azimuth >= 248 && azimuth <= 292)
|
||||||
|
index = 6;//W
|
||||||
|
else if(azimuth >= 293 && azimuth <= 337)
|
||||||
|
index = 7;//NW
|
||||||
|
else
|
||||||
|
index = 0;//N
|
||||||
|
|
||||||
|
//Update the center label
|
||||||
|
sprintf(compassScreen->compassAzimuth.text, "%u° %s", azimuth, cardinals[index]);
|
||||||
|
lv_label_set_text_static(compassScreen->compassAzimuth.label, compassScreen->compassAzimuth.text);
|
||||||
|
|
||||||
|
//Rotate each cardinal with the current azimuth
|
||||||
|
rotate_cardinal(&compassScreen->northCardinal, azimuth);
|
||||||
|
lv_img_set_angle(compassScreen->northMarker, azimuth*10);
|
||||||
|
rotate_cardinal(&compassScreen->eastCardinal, azimuth);
|
||||||
|
rotate_cardinal(&compassScreen->southCardinal, azimuth);
|
||||||
|
rotate_cardinal(&compassScreen->westCardinal, azimuth);
|
||||||
|
}
|
||||||
|
|
||||||
|
void compass_screen_create(CompassScreen_t * const compassScreen)
|
||||||
|
{
|
||||||
|
if(!compassScreen)
|
||||||
|
{
|
||||||
|
LV_LOG_ERROR("NULL pointer given !");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//We declare all the needed assets by the compass screen:
|
||||||
|
LV_IMG_DECLARE(compass_marker)
|
||||||
|
LV_IMG_DECLARE(compass_marker_north)
|
||||||
|
|
||||||
|
//We create our parent screen :
|
||||||
|
if(compassScreen->display)
|
||||||
|
{
|
||||||
|
LV_LOG_ERROR("display should be NULL here !");
|
||||||
|
lv_obj_del(compassScreen->display);
|
||||||
|
compassScreen->display = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
compassScreen->display = lv_obj_create(NULL);
|
||||||
|
lv_obj_set_style_bg_color(compassScreen->display, lv_color_white(), LV_PART_MAIN);
|
||||||
|
|
||||||
|
//Marker images are created here
|
||||||
|
lv_obj_t *compassMarker = lv_img_create(compassScreen->display);
|
||||||
|
lv_img_set_src(compassMarker, &compass_marker);
|
||||||
|
lv_obj_set_pos(compassMarker, 113, 0);
|
||||||
|
|
||||||
|
if(compassScreen->northMarker)
|
||||||
|
{
|
||||||
|
LV_LOG_ERROR("img should be NULL here !");
|
||||||
|
lv_obj_del(compassScreen->northMarker);
|
||||||
|
compassScreen->northMarker = NULL;
|
||||||
|
}
|
||||||
|
compassScreen->northMarker = lv_img_create(compassScreen->display);
|
||||||
|
lv_img_set_src(compassScreen->northMarker, &compass_marker_north);
|
||||||
|
lv_obj_set_pos(compassScreen->northMarker, 113, 20);
|
||||||
|
lv_img_set_pivot(compassScreen->northMarker, 7, 100);
|
||||||
|
|
||||||
|
//Azimuth label is created here
|
||||||
|
if(compassScreen->compassAzimuth.label)
|
||||||
|
{
|
||||||
|
LV_LOG_ERROR("label should be NULL here !");
|
||||||
|
lv_obj_del(compassScreen->compassAzimuth.label);
|
||||||
|
compassScreen->compassAzimuth.label = NULL;
|
||||||
|
}
|
||||||
|
compassScreen->compassAzimuth.label = lv_label_create(compassScreen->display);
|
||||||
|
lv_label_set_text_static(compassScreen->compassAzimuth.label, compassScreen->compassAzimuth.text);
|
||||||
|
lv_obj_set_style_text_font(compassScreen->compassAzimuth.label, &lv_font_montserrat_28, LV_PART_MAIN);
|
||||||
|
lv_obj_center(compassScreen->compassAzimuth.label);
|
||||||
|
|
||||||
|
//Cardinal labels are created here
|
||||||
|
if(compassScreen->northCardinal.label)
|
||||||
|
{
|
||||||
|
LV_LOG_ERROR("label should be NULL here !");
|
||||||
|
lv_obj_del(compassScreen->northCardinal.label);
|
||||||
|
compassScreen->northCardinal.label = NULL;
|
||||||
|
}
|
||||||
|
create_cardinal(&compassScreen->northCardinal, cardinals[0], lv_palette_main(LV_PALETTE_RED), 120, 50, compassScreen->display);
|
||||||
|
|
||||||
|
|
||||||
|
if(compassScreen->eastCardinal.label)
|
||||||
|
{
|
||||||
|
LV_LOG_ERROR("label should be NULL here !");
|
||||||
|
lv_obj_del(compassScreen->eastCardinal.label);
|
||||||
|
compassScreen->eastCardinal.label = NULL;
|
||||||
|
}
|
||||||
|
create_cardinal(&compassScreen->eastCardinal, cardinals[2], lv_color_black(), 190, 120, compassScreen->display);
|
||||||
|
|
||||||
|
if(compassScreen->southCardinal.label)
|
||||||
|
{
|
||||||
|
LV_LOG_ERROR("label should be NULL here !");
|
||||||
|
lv_obj_del(compassScreen->southCardinal.label);
|
||||||
|
compassScreen->southCardinal.label = NULL;
|
||||||
|
}
|
||||||
|
create_cardinal(&compassScreen->southCardinal, cardinals[4], lv_color_black(), 120, 190, compassScreen->display);
|
||||||
|
|
||||||
|
if(compassScreen->westCardinal.label)
|
||||||
|
{
|
||||||
|
LV_LOG_ERROR("label should be NULL here !");
|
||||||
|
lv_obj_del(compassScreen->westCardinal.label);
|
||||||
|
compassScreen->westCardinal.label = NULL;
|
||||||
|
}
|
||||||
|
create_cardinal(&compassScreen->westCardinal, cardinals[6], lv_color_black(), 50, 120, compassScreen->display);
|
||||||
|
|
||||||
|
//We register the event callback to handle gestures
|
||||||
|
lv_obj_add_event_cb(compassScreen->display, &(gesture_event_cb), LV_EVENT_GESTURE, compassScreen);
|
||||||
|
//We register the event callback to handle the cleanup
|
||||||
|
lv_obj_add_event_cb(compassScreen->display, &(cleanup_event_cb), LV_EVENT_DELETE, compassScreen);
|
||||||
|
|
||||||
|
//To delete
|
||||||
|
//lv_timer_create(&(timer_anim_cb), 2, compassScreen);
|
||||||
|
}
|
||||||
|
|
||||||
|
void compass_screen_destroy(CompassScreen_t * const compassScreen)
|
||||||
|
{
|
||||||
|
if(!compassScreen)
|
||||||
|
{
|
||||||
|
LV_LOG_ERROR("NULL pointer given !");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
compassScreen->display = NULL;
|
||||||
|
compassScreen->compassAzimuth.label = NULL;
|
||||||
|
compassScreen->northCardinal.label = NULL;
|
||||||
|
compassScreen->eastCardinal.label = NULL;
|
||||||
|
compassScreen->southCardinal.label = NULL;
|
||||||
|
compassScreen->westCardinal.label = NULL;
|
||||||
|
compassScreen->northMarker = NULL;
|
||||||
|
}
|
45
src/W800 SDK v1.00.08/app/gfx/compass_screen.h
Normal file
45
src/W800 SDK v1.00.08/app/gfx/compass_screen.h
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
#ifndef COMPASS_SCREEN_H
|
||||||
|
#define COMPASS_SCREEN_H
|
||||||
|
|
||||||
|
#include "lvgl.h"
|
||||||
|
|
||||||
|
typedef struct CompassAzimuthLabel
|
||||||
|
{
|
||||||
|
lv_obj_t *label;
|
||||||
|
char text[9];
|
||||||
|
} CompassAzimuth_t;
|
||||||
|
|
||||||
|
typedef struct CompassCardinal
|
||||||
|
{
|
||||||
|
lv_obj_t *label;
|
||||||
|
lv_point_t position;
|
||||||
|
lv_point_t offset;
|
||||||
|
} CompassCardinal_t;
|
||||||
|
|
||||||
|
/* Compass screen context object */
|
||||||
|
typedef struct CompassScreen
|
||||||
|
{
|
||||||
|
CompassCardinal_t northCardinal;
|
||||||
|
CompassCardinal_t eastCardinal;
|
||||||
|
CompassCardinal_t southCardinal;
|
||||||
|
CompassCardinal_t westCardinal;
|
||||||
|
|
||||||
|
lv_obj_t *northMarker;
|
||||||
|
lv_obj_t *display;
|
||||||
|
|
||||||
|
CompassAzimuth_t compassAzimuth;
|
||||||
|
} CompassScreen_t;
|
||||||
|
|
||||||
|
/* Initializes the compass screen context object */
|
||||||
|
void compass_screen_init(CompassScreen_t * const compassScreen);
|
||||||
|
|
||||||
|
/* Set the compassAzimuth in degrees to show */
|
||||||
|
void compass_screen_set_azimuth(CompassScreen_t * const compassScreen, uint16_t azimuth);
|
||||||
|
|
||||||
|
/* Builds the compass screen graphically */
|
||||||
|
void compass_screen_create(CompassScreen_t * const compassScreen);
|
||||||
|
|
||||||
|
/* Frees all resources used by the CompassScreen object */
|
||||||
|
void compass_screen_destroy(CompassScreen_t * const compassScreen);
|
||||||
|
|
||||||
|
#endif // COMPASS_SCREEN_H
|
@ -5,7 +5,9 @@
|
|||||||
#include "lcd.h"
|
#include "lcd.h"
|
||||||
#include "watch_face.h"
|
#include "watch_face.h"
|
||||||
#include "menu_screen.h"
|
#include "menu_screen.h"
|
||||||
|
#include "compass_screen.h"
|
||||||
#include "i2c.h"
|
#include "i2c.h"
|
||||||
|
#include "QMC5883L.h"
|
||||||
|
|
||||||
#include "lv_port_indev.h"
|
#include "lv_port_indev.h"
|
||||||
|
|
||||||
@ -57,6 +59,8 @@ static void date_time_cb(struct tm * const dateTime)
|
|||||||
|
|
||||||
WatchFace_t watchFace;
|
WatchFace_t watchFace;
|
||||||
MenuScreen_t menuScreen;
|
MenuScreen_t menuScreen;
|
||||||
|
CompassScreen_t compassScreen;
|
||||||
|
|
||||||
|
|
||||||
void gfx_task(void *param)
|
void gfx_task(void *param)
|
||||||
{
|
{
|
||||||
@ -108,6 +112,7 @@ void gfx_task(void *param)
|
|||||||
|
|
||||||
watch_face_init(&watchFace);
|
watch_face_init(&watchFace);
|
||||||
menu_screen_init(&menuScreen);
|
menu_screen_init(&menuScreen);
|
||||||
|
compass_screen_init(&compassScreen);
|
||||||
|
|
||||||
watch_face_register_cb(&watchFace, &(date_time_cb));
|
watch_face_register_cb(&watchFace, &(date_time_cb));
|
||||||
watch_face_create(&watchFace);
|
watch_face_create(&watchFace);
|
||||||
@ -115,58 +120,68 @@ void gfx_task(void *param)
|
|||||||
lv_scr_load(watchFace.display);
|
lv_scr_load(watchFace.display);
|
||||||
|
|
||||||
/* Let's init the I2C interface */
|
/* Let's init the I2C interface */
|
||||||
i2c_init(WM_IO_PA_04, WM_IO_PA_01, 100000);
|
i2c_init(WM_IO_PA_04, WM_IO_PA_01, 400000);
|
||||||
|
|
||||||
uint8_t aliveCounter = 0;
|
uint8_t aliveCounter = 0;
|
||||||
uint8_t data = 0;
|
|
||||||
|
|
||||||
/*i2c_write_reg(0x0D, 0x09, 0x01|0x0C|0x10|0X00);
|
QMC5883L_MData_calibrated_t temp;
|
||||||
i2c_write_reg(0x0D, 0x0B, 0x01);*/
|
uint8_t average = 0;
|
||||||
|
|
||||||
i2c_read_reg(0x76, 0xF4, &data);
|
if(!QMC5883L_init())
|
||||||
APP_LOG_INFO("0xF4 -> 0x%02X", data);
|
APP_LOG_INFO("Failed to init QMC5883L");
|
||||||
i2c_write_reg(0x76, 0xF4, 0b11111111);
|
else
|
||||||
i2c_read_reg(0x76, 0xF4, &data);
|
APP_LOG_INFO("Inited QMC5883L");
|
||||||
APP_LOG_INFO("0xF4 -> 0x%02X", data);
|
|
||||||
|
if(!QMC5883L_set_power_mode(Continuous))
|
||||||
|
APP_LOG_INFO("Failed to set QMC5883L mode");
|
||||||
|
else
|
||||||
|
APP_LOG_INFO("QMC5883L Mode set");
|
||||||
|
|
||||||
|
if(!QMC5883L_configure_1(ODR_10HZ, FS_2G, OSR_512))
|
||||||
|
APP_LOG_INFO("Failed to configure 1 QMC5883L");
|
||||||
|
else
|
||||||
|
APP_LOG_INFO("QMC5883L configured");
|
||||||
|
|
||||||
|
QMC5883L_set_calibration_data(-900, 2500, -1400, 1400, 2300, 7500);
|
||||||
|
|
||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
lv_timer_handler();
|
lv_timer_handler();
|
||||||
tls_os_time_delay(5);
|
tls_os_time_delay(5);
|
||||||
|
|
||||||
if(++aliveCounter % 200 == 0)
|
if(QMC5883L_is_data_available())
|
||||||
{
|
{
|
||||||
if(!i2c_read_reg(0x76, 0xD0, &data))
|
//QMC5883L_MData_t MDataRaw = QMC5883L_get_MFields_raw();
|
||||||
|
//APP_LOG_TRACE("X %d Y %d Z %d", MDataRaw.MFieldX, MDataRaw.MFieldY, MDataRaw.MFieldZ);
|
||||||
|
|
||||||
|
QMC5883L_MData_calibrated_t MData = QMC5883L_get_MFields_calibrated();
|
||||||
|
|
||||||
|
if(average++ == 0)
|
||||||
{
|
{
|
||||||
APP_LOG_ERROR("Failed to read BMP280 data");
|
temp.MFieldX = MData.MFieldX;
|
||||||
|
temp.MFieldY = MData.MFieldY;
|
||||||
|
temp.MFieldZ = MData.MFieldZ;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
APP_LOG_INFO("Read BMP280 reg 0xD0 -> 0x%02X", data);
|
temp.MFieldX += MData.MFieldX;
|
||||||
|
temp.MFieldX /= 2;
|
||||||
|
temp.MFieldY += MData.MFieldY;
|
||||||
|
temp.MFieldY /= 2;
|
||||||
|
temp.MFieldZ += MData.MFieldZ;
|
||||||
|
temp.MFieldZ /= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_read_reg(0x76, 0xFC, &data);
|
if(average == 1)
|
||||||
APP_LOG_INFO("0xFC -> 0x%02X", data);
|
{
|
||||||
i2c_read_reg(0x76, 0xFB, &data);
|
average = 0;
|
||||||
APP_LOG_INFO("0xFB -> 0x%02X", data);
|
int16_t angle = QMC5883L_get_azimuth(temp);
|
||||||
i2c_read_reg(0x76, 0xFA, &data);
|
compass_screen_set_azimuth(&compassScreen, angle-180);
|
||||||
APP_LOG_INFO("0xFA -> 0x%02X", data);
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*i2c_read_reg(0x0D, 0x00, &data);
|
|
||||||
APP_LOG_INFO("Read HMC5883L reg 0x00 -> 0x%02X", data);
|
|
||||||
i2c_read_reg(0x0D, 0x01, &data);
|
|
||||||
APP_LOG_INFO("Read HMC5883L reg 0x01 -> 0x%02X", data);
|
|
||||||
i2c_read_reg(0x0D, 0x02, &data);
|
|
||||||
APP_LOG_INFO("Read HMC5883L reg 0x02 -> 0x%02X", data);
|
|
||||||
i2c_read_reg(0x0D, 0x03, &data);
|
|
||||||
APP_LOG_INFO("Read HMC5883L reg 0x03 -> 0x%02X", data);
|
|
||||||
i2c_read_reg(0x0D, 0x04, &data);
|
|
||||||
APP_LOG_INFO("Read HMC5883L reg 0x04 -> 0x%02X", data);
|
|
||||||
i2c_read_reg(0x0D, 0x05, &data);
|
|
||||||
APP_LOG_INFO("Read HMC5883L reg 0x05 -> 0x%02X", data);*/
|
|
||||||
|
|
||||||
|
|
||||||
|
if(++aliveCounter % 200 == 0)
|
||||||
|
{
|
||||||
APP_LOG_DEBUG("GFX thread");
|
APP_LOG_DEBUG("GFX thread");
|
||||||
aliveCounter = 0;
|
aliveCounter = 0;
|
||||||
}
|
}
|
||||||
|
@ -2,26 +2,40 @@
|
|||||||
#include "menu_screen.h"
|
#include "menu_screen.h"
|
||||||
//#include "config_screen.h"
|
//#include "config_screen.h"
|
||||||
#include "watch_face.h"
|
#include "watch_face.h"
|
||||||
|
#include "compass_screen.h"
|
||||||
|
|
||||||
#define array_size(array) (sizeof(array)/sizeof(array[0]))
|
#define array_size(array) (sizeof(array)/sizeof(array[0]))
|
||||||
|
|
||||||
void watch_item_cb(lv_event_t *e)
|
static void menu_item_cb(lv_event_t *e)
|
||||||
{
|
{
|
||||||
LV_LOG_USER("Watch btn pressed");
|
uint32_t icon_id = (uint32_t)e->user_data;
|
||||||
|
LV_LOG_USER("Menu icon pressed : %u", icon_id);
|
||||||
|
|
||||||
extern WatchFace_t watchFace;
|
switch(icon_id)
|
||||||
watch_face_create(&watchFace);
|
{
|
||||||
//lv_scr_load_anim(watchFace.display, LV_SCR_LOAD_ANIM_FADE_ON, 700, 0, true);
|
case 0:
|
||||||
lv_scr_load_anim(watchFace.display, LV_SCR_LOAD_ANIM_MOVE_LEFT, 400, 0, true);
|
{
|
||||||
}
|
extern WatchFace_t watchFace;
|
||||||
|
watch_face_create(&watchFace);
|
||||||
void settings_item_cb(lv_event_t *e)
|
lv_scr_load_anim(watchFace.display, LV_SCR_LOAD_ANIM_FADE_ON, 400, 0, true);
|
||||||
{
|
}
|
||||||
LV_LOG_USER("Settings btn pressed");
|
break;
|
||||||
|
case 1:
|
||||||
/*extern lv_obj_t *conf_screen;
|
{
|
||||||
//config_screen();
|
extern CompassScreen_t compassScreen;
|
||||||
lv_scr_load_anim(conf_screen, LV_SCR_LOAD_ANIM_FADE_ON, 400, 0, false);*/
|
compass_screen_create(&compassScreen);
|
||||||
|
lv_scr_load_anim(compassScreen.display, LV_SCR_LOAD_ANIM_FADE_ON, 400, 0, true);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
{
|
||||||
|
//extern lv_obj_t *conf_screen;
|
||||||
|
//lv_scr_load_anim(conf_screen, LV_SCR_LOAD_ANIM_FADE_ON, 400, 0, false);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
LV_LOG_USER("Not handled");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cleanup_event_cb(lv_event_t * e)
|
static void cleanup_event_cb(lv_event_t * e)
|
||||||
@ -63,7 +77,7 @@ static void menu_screen_add_item(lv_obj_t *scroll_item_container, uint8_t positi
|
|||||||
lv_obj_set_size(item_btn, itemImg->header.w, itemImg->header.h);
|
lv_obj_set_size(item_btn, itemImg->header.w, itemImg->header.h);
|
||||||
lv_obj_set_pos(item_btn, 42, 52 * position);
|
lv_obj_set_pos(item_btn, 42, 52 * position);
|
||||||
lv_imgbtn_set_src(item_btn, LV_IMGBTN_STATE_RELEASED, NULL, itemImg, NULL);
|
lv_imgbtn_set_src(item_btn, LV_IMGBTN_STATE_RELEASED, NULL, itemImg, NULL);
|
||||||
lv_obj_add_event_cb(item_btn, itemClickEventCb, LV_EVENT_CLICKED, NULL);
|
lv_obj_add_event_cb(item_btn, itemClickEventCb, LV_EVENT_CLICKED, (void *)(uint32_t)position);
|
||||||
|
|
||||||
//We add the click-able label with the title of the item
|
//We add the click-able label with the title of the item
|
||||||
lv_obj_t *item_label = lv_label_create(scroll_item_container);
|
lv_obj_t *item_label = lv_label_create(scroll_item_container);
|
||||||
@ -73,7 +87,7 @@ static void menu_screen_add_item(lv_obj_t *scroll_item_container, uint8_t positi
|
|||||||
lv_obj_set_style_text_color(item_label, lv_color_make(145, 145, 145), LV_PART_MAIN);
|
lv_obj_set_style_text_color(item_label, lv_color_make(145, 145, 145), LV_PART_MAIN);
|
||||||
lv_obj_set_ext_click_area(item_label, 10);
|
lv_obj_set_ext_click_area(item_label, 10);
|
||||||
lv_obj_add_flag(item_label, LV_OBJ_FLAG_CLICKABLE);
|
lv_obj_add_flag(item_label, LV_OBJ_FLAG_CLICKABLE);
|
||||||
lv_obj_add_event_cb(item_label, itemClickEventCb, LV_EVENT_CLICKED , NULL);
|
lv_obj_add_event_cb(item_label, itemClickEventCb, LV_EVENT_CLICKED , (void *)(uint32_t)position);
|
||||||
}
|
}
|
||||||
|
|
||||||
void menu_screen_create(MenuScreen_t * const menuScreen)
|
void menu_screen_create(MenuScreen_t * const menuScreen)
|
||||||
@ -83,6 +97,7 @@ void menu_screen_create(MenuScreen_t * const menuScreen)
|
|||||||
LV_LOG_ERROR("NULL pointer given !");
|
LV_LOG_ERROR("NULL pointer given !");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//We declare all the needed assets by the menu screen:
|
//We declare all the needed assets by the menu screen:
|
||||||
LV_IMG_DECLARE(watch_menu_clock_icon)
|
LV_IMG_DECLARE(watch_menu_clock_icon)
|
||||||
LV_IMG_DECLARE(watch_menu_dialer_icon)
|
LV_IMG_DECLARE(watch_menu_dialer_icon)
|
||||||
@ -91,6 +106,7 @@ void menu_screen_create(MenuScreen_t * const menuScreen)
|
|||||||
LV_IMG_DECLARE(watch_menu_alarm_icon)
|
LV_IMG_DECLARE(watch_menu_alarm_icon)
|
||||||
LV_IMG_DECLARE(watch_menu_settings_icon)
|
LV_IMG_DECLARE(watch_menu_settings_icon)
|
||||||
LV_IMG_DECLARE(watch_menu_messages_icon)
|
LV_IMG_DECLARE(watch_menu_messages_icon)
|
||||||
|
LV_IMG_DECLARE(watch_menu_compass_icon)
|
||||||
|
|
||||||
//We create our parent screen :
|
//We create our parent screen :
|
||||||
if(menuScreen->display)
|
if(menuScreen->display)
|
||||||
@ -114,13 +130,14 @@ void menu_screen_create(MenuScreen_t * const menuScreen)
|
|||||||
lv_obj_set_style_border_width(scroll_item_container, 0, LV_PART_MAIN);
|
lv_obj_set_style_border_width(scroll_item_container, 0, LV_PART_MAIN);
|
||||||
lv_obj_set_style_pad_right(scroll_item_container, 15, LV_PART_SCROLLBAR);
|
lv_obj_set_style_pad_right(scroll_item_container, 15, LV_PART_SCROLLBAR);
|
||||||
|
|
||||||
menu_screen_add_item(scroll_item_container, 0, &watch_menu_clock_icon, "Watch", &(watch_item_cb));
|
menu_screen_add_item(scroll_item_container, 0, &watch_menu_clock_icon, "Watch", &(menu_item_cb));
|
||||||
menu_screen_add_item(scroll_item_container, 1, &watch_menu_alarm_icon, "Alarm", NULL);
|
menu_screen_add_item(scroll_item_container, 1, &watch_menu_compass_icon, "Compass", &(menu_item_cb));
|
||||||
menu_screen_add_item(scroll_item_container, 2, &watch_menu_messages_icon, "Text messages", NULL);
|
menu_screen_add_item(scroll_item_container, 2, &watch_menu_alarm_icon, "Alarm", &(menu_item_cb));
|
||||||
menu_screen_add_item(scroll_item_container, 3, &watch_menu_mail_icon, "Mails", NULL);
|
menu_screen_add_item(scroll_item_container, 3, &watch_menu_messages_icon, "Text messages", &(menu_item_cb));
|
||||||
menu_screen_add_item(scroll_item_container, 4, &watch_menu_dialer_icon, "Phone", NULL);
|
menu_screen_add_item(scroll_item_container, 4, &watch_menu_mail_icon, "Mails", &(menu_item_cb));
|
||||||
menu_screen_add_item(scroll_item_container, 5,&watch_menu_contacts_icon, "Contacts", NULL);
|
menu_screen_add_item(scroll_item_container, 5, &watch_menu_dialer_icon, "Phone", &(menu_item_cb));
|
||||||
menu_screen_add_item(scroll_item_container, 6,&watch_menu_settings_icon, "Settings", &(settings_item_cb));
|
menu_screen_add_item(scroll_item_container, 6, &watch_menu_contacts_icon, "Contacts", &(menu_item_cb));
|
||||||
|
menu_screen_add_item(scroll_item_container, 7, &watch_menu_settings_icon, "Settings", &(menu_item_cb));
|
||||||
|
|
||||||
//We register the event callback to handle the cleanup
|
//We register the event callback to handle the cleanup
|
||||||
lv_obj_add_event_cb(menuScreen->display, &(cleanup_event_cb), LV_EVENT_DELETE, menuScreen);
|
lv_obj_add_event_cb(menuScreen->display, &(cleanup_event_cb), LV_EVENT_DELETE, menuScreen);
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include "lvgl.h"
|
#include "lvgl.h"
|
||||||
|
|
||||||
|
// Menu screen context object
|
||||||
typedef struct MenuScreen
|
typedef struct MenuScreen
|
||||||
{
|
{
|
||||||
lv_obj_t *display;
|
lv_obj_t *display;
|
||||||
|
@ -162,7 +162,7 @@ void watch_face_create(WatchFace_t * const watchFace)
|
|||||||
//Date window is created here
|
//Date window is created here
|
||||||
if(watchFace->dateWindow.dateWindowWidget)
|
if(watchFace->dateWindow.dateWindowWidget)
|
||||||
{
|
{
|
||||||
LV_LOG_ERROR("dateWindow should be NULL here !");
|
LV_LOG_ERROR("dateWindowWidget should be NULL here !");
|
||||||
lv_obj_del(watchFace->dateWindow.dateWindowWidget);
|
lv_obj_del(watchFace->dateWindow.dateWindowWidget);
|
||||||
watchFace->dateWindow.dateWindowWidget = NULL;
|
watchFace->dateWindow.dateWindowWidget = NULL;
|
||||||
}
|
}
|
||||||
|
BIN
src/lvgl_win_sim/lv_port_win_codeblocks/rsrc/compass_marker.png
Normal file
BIN
src/lvgl_win_sim/lv_port_win_codeblocks/rsrc/compass_marker.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 252 B |
Binary file not shown.
After Width: | Height: | Size: 406 B |
Loading…
Reference in New Issue
Block a user