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
Diff: UI.h
- Revision:
- 3:ecf7f1f8d749
- Parent:
- 2:80026d18fcf3
- Child:
- 5:13c70bcde7f6
--- a/UI.h Thu Oct 29 12:59:54 2015 +0000 +++ b/UI.h Thu Oct 29 18:09:31 2015 +0000 @@ -8,14 +8,35 @@ #define UI_FLAG_TYPE_TIMER_ADJUST (0x10 | UI_FLAG_NEEDS_CHROME) #define UI_FLAG_NEEDS_CHROME 0x20 +typedef enum +{ + UR_CLICK, + UR_TIMER, + UR_SHOW, + +} UI_REASON_ENUM; + +struct UI_STRUCT_; +typedef void (*UI_HANDLER_CALLBACK)(UI_REASON_ENUM reason,uint32_t index,UI_STRUCT_ *ui); + typedef struct { + char *name; + +} UI_BOX_LIST_ITEM_STRUCT; + +typedef struct UI_STRUCT_ +{ int8_t flags; // UI_FLAG_... + UI_HANDLER_CALLBACK handler; union { struct { + UI_BOX_LIST_ITEM_STRUCT *items; + uint8_t count; + } boxList; struct @@ -24,22 +45,23 @@ struct { - } clock; - - struct - { - } clockInWords; - - struct - { } timerAdjust; } data; } UI_STRUCT; - + +extern UI_STRUCT uiClock; +extern UI_STRUCT uiClockInWords; +extern UI_STRUCT uiWakeup; +extern UI_STRUCT uiMain; + void UI_Init(void); void UI_Poll(void); void UI_Show(UI_STRUCT *ui); +void UI_MainHandler(UI_REASON_ENUM reason,uint32_t index,UI_STRUCT *ui); + +void UI_WakeupHandler(UI_REASON_ENUM reason,uint32_t index,UI_STRUCT *ui); + #endif