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@3:ecf7f1f8d749, 2015-10-29 (annotated)
- Committer:
- the_sz
- Date:
- Thu Oct 29 18:09:31 2015 +0000
- Revision:
- 3:ecf7f1f8d749
- Parent:
- 2:80026d18fcf3
- Child:
- 5:13c70bcde7f6
ui menu working, time() added
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 | 2:80026d18fcf3 | 5 | #define UI_FLAG_TYPE_MESSAGE_BOX (0x02 | UI_FLAG_NEEDS_CHROME) |
the_sz | 2:80026d18fcf3 | 6 | #define UI_FLAG_TYPE_CLOCK 0x04 |
the_sz | 2:80026d18fcf3 | 7 | #define UI_FLAG_TYPE_CLOCK_IN_WORDS (0x08 | UI_FLAG_NEEDS_CHROME) |
the_sz | 2:80026d18fcf3 | 8 | #define UI_FLAG_TYPE_TIMER_ADJUST (0x10 | UI_FLAG_NEEDS_CHROME) |
the_sz | 2:80026d18fcf3 | 9 | #define UI_FLAG_NEEDS_CHROME 0x20 |
the_sz | 2:80026d18fcf3 | 10 | |
the_sz | 3:ecf7f1f8d749 | 11 | typedef enum |
the_sz | 3:ecf7f1f8d749 | 12 | { |
the_sz | 3:ecf7f1f8d749 | 13 | UR_CLICK, |
the_sz | 3:ecf7f1f8d749 | 14 | UR_TIMER, |
the_sz | 3:ecf7f1f8d749 | 15 | UR_SHOW, |
the_sz | 3:ecf7f1f8d749 | 16 | |
the_sz | 3:ecf7f1f8d749 | 17 | } UI_REASON_ENUM; |
the_sz | 3:ecf7f1f8d749 | 18 | |
the_sz | 3:ecf7f1f8d749 | 19 | struct UI_STRUCT_; |
the_sz | 3:ecf7f1f8d749 | 20 | typedef void (*UI_HANDLER_CALLBACK)(UI_REASON_ENUM reason,uint32_t index,UI_STRUCT_ *ui); |
the_sz | 3:ecf7f1f8d749 | 21 | |
the_sz | 2:80026d18fcf3 | 22 | typedef struct |
the_sz | 2:80026d18fcf3 | 23 | { |
the_sz | 3:ecf7f1f8d749 | 24 | char *name; |
the_sz | 3:ecf7f1f8d749 | 25 | |
the_sz | 3:ecf7f1f8d749 | 26 | } UI_BOX_LIST_ITEM_STRUCT; |
the_sz | 3:ecf7f1f8d749 | 27 | |
the_sz | 3:ecf7f1f8d749 | 28 | typedef struct UI_STRUCT_ |
the_sz | 3:ecf7f1f8d749 | 29 | { |
the_sz | 2:80026d18fcf3 | 30 | int8_t flags; // UI_FLAG_... |
the_sz | 3:ecf7f1f8d749 | 31 | UI_HANDLER_CALLBACK handler; |
the_sz | 2:80026d18fcf3 | 32 | |
the_sz | 2:80026d18fcf3 | 33 | union |
the_sz | 2:80026d18fcf3 | 34 | { |
the_sz | 2:80026d18fcf3 | 35 | struct |
the_sz | 2:80026d18fcf3 | 36 | { |
the_sz | 3:ecf7f1f8d749 | 37 | UI_BOX_LIST_ITEM_STRUCT *items; |
the_sz | 3:ecf7f1f8d749 | 38 | uint8_t count; |
the_sz | 3:ecf7f1f8d749 | 39 | |
the_sz | 2:80026d18fcf3 | 40 | } boxList; |
the_sz | 2:80026d18fcf3 | 41 | |
the_sz | 2:80026d18fcf3 | 42 | struct |
the_sz | 2:80026d18fcf3 | 43 | { |
the_sz | 2:80026d18fcf3 | 44 | } messageBox; |
the_sz | 2:80026d18fcf3 | 45 | |
the_sz | 2:80026d18fcf3 | 46 | struct |
the_sz | 2:80026d18fcf3 | 47 | { |
the_sz | 2:80026d18fcf3 | 48 | } timerAdjust; |
the_sz | 2:80026d18fcf3 | 49 | |
the_sz | 2:80026d18fcf3 | 50 | } data; |
the_sz | 2:80026d18fcf3 | 51 | |
the_sz | 2:80026d18fcf3 | 52 | } UI_STRUCT; |
the_sz | 3:ecf7f1f8d749 | 53 | |
the_sz | 3:ecf7f1f8d749 | 54 | extern UI_STRUCT uiClock; |
the_sz | 3:ecf7f1f8d749 | 55 | extern UI_STRUCT uiClockInWords; |
the_sz | 3:ecf7f1f8d749 | 56 | extern UI_STRUCT uiWakeup; |
the_sz | 3:ecf7f1f8d749 | 57 | extern UI_STRUCT uiMain; |
the_sz | 3:ecf7f1f8d749 | 58 | |
the_sz | 2:80026d18fcf3 | 59 | void UI_Init(void); |
the_sz | 2:80026d18fcf3 | 60 | void UI_Poll(void); |
the_sz | 2:80026d18fcf3 | 61 | void UI_Show(UI_STRUCT *ui); |
the_sz | 2:80026d18fcf3 | 62 | |
the_sz | 3:ecf7f1f8d749 | 63 | void UI_MainHandler(UI_REASON_ENUM reason,uint32_t index,UI_STRUCT *ui); |
the_sz | 3:ecf7f1f8d749 | 64 | |
the_sz | 3:ecf7f1f8d749 | 65 | void UI_WakeupHandler(UI_REASON_ENUM reason,uint32_t index,UI_STRUCT *ui); |
the_sz | 3:ecf7f1f8d749 | 66 | |
the_sz | 2:80026d18fcf3 | 67 | #endif |