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@6:aa51cc3b9f90, 2015-11-10 (annotated)
- Committer:
- the_sz
- Date:
- Tue Nov 10 22:39:50 2015 +0000
- Revision:
- 6:aa51cc3b9f90
- Parent:
- 5:13c70bcde7f6
- Child:
- 7:dc29f6647486
alpha picture support
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 | 5:13c70bcde7f6 | 8 | #define UI_FLAG_TYPE_VALUE_ADJUST (0x10 | UI_FLAG_NEEDS_CHROME | UI_FLAG_HAS_BACK_BUTTON) |
the_sz | 2:80026d18fcf3 | 9 | #define UI_FLAG_NEEDS_CHROME 0x20 |
the_sz | 5:13c70bcde7f6 | 10 | #define UI_FLAG_HAS_BACK_BUTTON 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 | 2:80026d18fcf3 | 46 | } messageBox; |
the_sz | 2:80026d18fcf3 | 47 | |
the_sz | 2:80026d18fcf3 | 48 | struct |
the_sz | 2:80026d18fcf3 | 49 | { |
the_sz | 5:13c70bcde7f6 | 50 | uint8_t count; |
the_sz | 5:13c70bcde7f6 | 51 | uint32_t values[4]; |
the_sz | 5:13c70bcde7f6 | 52 | |
the_sz | 5:13c70bcde7f6 | 53 | } valueAdjust; |
the_sz | 2:80026d18fcf3 | 54 | |
the_sz | 2:80026d18fcf3 | 55 | } data; |
the_sz | 2:80026d18fcf3 | 56 | |
the_sz | 2:80026d18fcf3 | 57 | } UI_STRUCT; |
the_sz | 3:ecf7f1f8d749 | 58 | |
the_sz | 3:ecf7f1f8d749 | 59 | extern UI_STRUCT uiClock; |
the_sz | 3:ecf7f1f8d749 | 60 | extern UI_STRUCT uiClockInWords; |
the_sz | 5:13c70bcde7f6 | 61 | extern UI_STRUCT uiColorTest; |
the_sz | 3:ecf7f1f8d749 | 62 | extern UI_STRUCT uiWakeup; |
the_sz | 3:ecf7f1f8d749 | 63 | extern UI_STRUCT uiMain; |
the_sz | 3:ecf7f1f8d749 | 64 | |
the_sz | 2:80026d18fcf3 | 65 | void UI_Init(void); |
the_sz | 2:80026d18fcf3 | 66 | void UI_Poll(void); |
the_sz | 2:80026d18fcf3 | 67 | void UI_Show(UI_STRUCT *ui); |
the_sz | 2:80026d18fcf3 | 68 | |
the_sz | 5:13c70bcde7f6 | 69 | void UI_MainHandler(UI_REASON_ENUM reason,int32_t index,UI_STRUCT *ui); |
the_sz | 3:ecf7f1f8d749 | 70 | |
the_sz | 5:13c70bcde7f6 | 71 | void UI_WakeupHandler(UI_REASON_ENUM reason,int32_t index,UI_STRUCT *ui); |
the_sz | 5:13c70bcde7f6 | 72 | void UI_ColorTestHandler(UI_REASON_ENUM reason,int32_t index,UI_STRUCT *ui); |
the_sz | 3:ecf7f1f8d749 | 73 | |
the_sz | 2:80026d18fcf3 | 74 | #endif |