Wakeup Light with touch user interface, anti-aliased Font, SD card access and RTC usage on STM32F746NG-DISCO board
Dependencies: BSP_DISCO_F746NG_patch_fixed LCD_DISCO_F746NG TS_DISCO_F746NG FATFileSystem TinyJpgDec_interwork mbed-src
UI.h@14:2044ad5cd3fe, 2016-02-21 (annotated)
- Committer:
- the_sz
- Date:
- Sun Feb 21 04:26:17 2016 +0000
- Revision:
- 14:2044ad5cd3fe
- Parent:
- 12:a89096944f20
all fonts are working
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
the_sz | 2:80026d18fcf3 | 1 | #ifndef __UI_h |
the_sz | 2:80026d18fcf3 | 2 | #define __UI_h |
the_sz | 2:80026d18fcf3 | 3 | |
the_sz | 2:80026d18fcf3 | 4 | #define UI_FLAG_TYPE_BOX_LIST (0x01 | UI_FLAG_NEEDS_CHROME) |
the_sz | 9:fe2c9b3a312b | 5 | #define UI_FLAG_TYPE_CLOCK 0x02 |
the_sz | 9:fe2c9b3a312b | 6 | #define UI_FLAG_TYPE_CLOCK_IN_WORDS (0x04 | UI_FLAG_NEEDS_CHROME) |
the_sz | 9:fe2c9b3a312b | 7 | #define UI_FLAG_TYPE_VALUE_ADJUST (0x08 | UI_FLAG_NEEDS_CHROME | UI_FLAG_HAS_BACK_BUTTON) |
the_sz | 9:fe2c9b3a312b | 8 | #define UI_FLAG_NEEDS_CHROME 0x10 |
the_sz | 9:fe2c9b3a312b | 9 | #define UI_FLAG_HAS_BACK_BUTTON 0x20 |
the_sz | 9:fe2c9b3a312b | 10 | #define UI_FLAG_TYPE_SLIDESHOW 0x40 |
the_sz | 2:80026d18fcf3 | 11 | |
the_sz | 3:ecf7f1f8d749 | 12 | typedef enum |
the_sz | 3:ecf7f1f8d749 | 13 | { |
the_sz | 3:ecf7f1f8d749 | 14 | UR_CLICK, |
the_sz | 3:ecf7f1f8d749 | 15 | UR_TIMER, |
the_sz | 3:ecf7f1f8d749 | 16 | UR_SHOW, |
the_sz | 3:ecf7f1f8d749 | 17 | |
the_sz | 3:ecf7f1f8d749 | 18 | } UI_REASON_ENUM; |
the_sz | 3:ecf7f1f8d749 | 19 | |
the_sz | 3:ecf7f1f8d749 | 20 | struct UI_STRUCT_; |
the_sz | 5:13c70bcde7f6 | 21 | typedef void (*UI_HANDLER_CALLBACK)(UI_REASON_ENUM reason,int32_t index,UI_STRUCT_ *ui); |
the_sz | 3:ecf7f1f8d749 | 22 | |
the_sz | 2:80026d18fcf3 | 23 | typedef struct |
the_sz | 2:80026d18fcf3 | 24 | { |
the_sz | 3:ecf7f1f8d749 | 25 | char *name; |
the_sz | 6:aa51cc3b9f90 | 26 | uint8_t *image; |
the_sz | 3:ecf7f1f8d749 | 27 | |
the_sz | 3:ecf7f1f8d749 | 28 | } UI_BOX_LIST_ITEM_STRUCT; |
the_sz | 3:ecf7f1f8d749 | 29 | |
the_sz | 3:ecf7f1f8d749 | 30 | typedef struct UI_STRUCT_ |
the_sz | 3:ecf7f1f8d749 | 31 | { |
the_sz | 2:80026d18fcf3 | 32 | int8_t flags; // UI_FLAG_... |
the_sz | 3:ecf7f1f8d749 | 33 | UI_HANDLER_CALLBACK handler; |
the_sz | 2:80026d18fcf3 | 34 | |
the_sz | 2:80026d18fcf3 | 35 | union |
the_sz | 2:80026d18fcf3 | 36 | { |
the_sz | 2:80026d18fcf3 | 37 | struct |
the_sz | 2:80026d18fcf3 | 38 | { |
the_sz | 3:ecf7f1f8d749 | 39 | UI_BOX_LIST_ITEM_STRUCT *items; |
the_sz | 3:ecf7f1f8d749 | 40 | uint8_t count; |
the_sz | 3:ecf7f1f8d749 | 41 | |
the_sz | 2:80026d18fcf3 | 42 | } boxList; |
the_sz | 2:80026d18fcf3 | 43 | |
the_sz | 2:80026d18fcf3 | 44 | struct |
the_sz | 2:80026d18fcf3 | 45 | { |
the_sz | 5:13c70bcde7f6 | 46 | uint8_t count; |
the_sz | 12:a89096944f20 | 47 | bool isTime; |
the_sz | 7:dc29f6647486 | 48 | int32_t values[10]; |
the_sz | 5:13c70bcde7f6 | 49 | |
the_sz | 5:13c70bcde7f6 | 50 | } valueAdjust; |
the_sz | 2:80026d18fcf3 | 51 | |
the_sz | 2:80026d18fcf3 | 52 | } data; |
the_sz | 2:80026d18fcf3 | 53 | |
the_sz | 2:80026d18fcf3 | 54 | } UI_STRUCT; |
the_sz | 3:ecf7f1f8d749 | 55 | |
the_sz | 3:ecf7f1f8d749 | 56 | extern UI_STRUCT uiClock; |
the_sz | 3:ecf7f1f8d749 | 57 | extern UI_STRUCT uiClockInWords; |
the_sz | 5:13c70bcde7f6 | 58 | extern UI_STRUCT uiColorTest; |
the_sz | 3:ecf7f1f8d749 | 59 | extern UI_STRUCT uiWakeup; |
the_sz | 9:fe2c9b3a312b | 60 | extern UI_STRUCT uiSlideshow; |
the_sz | 3:ecf7f1f8d749 | 61 | extern UI_STRUCT uiMain; |
the_sz | 3:ecf7f1f8d749 | 62 | |
the_sz | 2:80026d18fcf3 | 63 | void UI_Init(void); |
the_sz | 2:80026d18fcf3 | 64 | void UI_Poll(void); |
the_sz | 2:80026d18fcf3 | 65 | void UI_Show(UI_STRUCT *ui); |
the_sz | 2:80026d18fcf3 | 66 | |
the_sz | 5:13c70bcde7f6 | 67 | void UI_MainHandler(UI_REASON_ENUM reason,int32_t index,UI_STRUCT *ui); |
the_sz | 3:ecf7f1f8d749 | 68 | |
the_sz | 5:13c70bcde7f6 | 69 | void UI_WakeupHandler(UI_REASON_ENUM reason,int32_t index,UI_STRUCT *ui); |
the_sz | 7:dc29f6647486 | 70 | void UI_WakeupShow(void); |
the_sz | 7:dc29f6647486 | 71 | |
the_sz | 12:a89096944f20 | 72 | void UI_TimeShow(void); |
the_sz | 12:a89096944f20 | 73 | |
the_sz | 5:13c70bcde7f6 | 74 | void UI_ColorTestHandler(UI_REASON_ENUM reason,int32_t index,UI_STRUCT *ui); |
the_sz | 3:ecf7f1f8d749 | 75 | |
the_sz | 9:fe2c9b3a312b | 76 | extern LCD_DISCO_F746NG uiLcd; |
the_sz | 9:fe2c9b3a312b | 77 | |
the_sz | 2:80026d18fcf3 | 78 | #endif |