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

Committer:
the_sz
Date:
Mon Nov 09 17:53:22 2015 +0000
Revision:
5:13c70bcde7f6
Parent:
3:ecf7f1f8d749
Child:
6:aa51cc3b9f90
color button

Who changed what in which revision?

UserRevisionLine numberNew 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 3:ecf7f1f8d749 26
the_sz 3:ecf7f1f8d749 27 } UI_BOX_LIST_ITEM_STRUCT;
the_sz 3:ecf7f1f8d749 28
the_sz 3:ecf7f1f8d749 29 typedef struct UI_STRUCT_
the_sz 3:ecf7f1f8d749 30 {
the_sz 2:80026d18fcf3 31 int8_t flags; // UI_FLAG_...
the_sz 3:ecf7f1f8d749 32 UI_HANDLER_CALLBACK handler;
the_sz 2:80026d18fcf3 33
the_sz 2:80026d18fcf3 34 union
the_sz 2:80026d18fcf3 35 {
the_sz 2:80026d18fcf3 36 struct
the_sz 2:80026d18fcf3 37 {
the_sz 3:ecf7f1f8d749 38 UI_BOX_LIST_ITEM_STRUCT *items;
the_sz 3:ecf7f1f8d749 39 uint8_t count;
the_sz 3:ecf7f1f8d749 40
the_sz 2:80026d18fcf3 41 } boxList;
the_sz 2:80026d18fcf3 42
the_sz 2:80026d18fcf3 43 struct
the_sz 2:80026d18fcf3 44 {
the_sz 2:80026d18fcf3 45 } messageBox;
the_sz 2:80026d18fcf3 46
the_sz 2:80026d18fcf3 47 struct
the_sz 2:80026d18fcf3 48 {
the_sz 5:13c70bcde7f6 49 uint8_t count;
the_sz 5:13c70bcde7f6 50 uint32_t values[4];
the_sz 5:13c70bcde7f6 51
the_sz 5:13c70bcde7f6 52 } valueAdjust;
the_sz 2:80026d18fcf3 53
the_sz 2:80026d18fcf3 54 } data;
the_sz 2:80026d18fcf3 55
the_sz 2:80026d18fcf3 56 } UI_STRUCT;
the_sz 3:ecf7f1f8d749 57
the_sz 3:ecf7f1f8d749 58 extern UI_STRUCT uiClock;
the_sz 3:ecf7f1f8d749 59 extern UI_STRUCT uiClockInWords;
the_sz 5:13c70bcde7f6 60 extern UI_STRUCT uiColorTest;
the_sz 3:ecf7f1f8d749 61 extern UI_STRUCT uiWakeup;
the_sz 3:ecf7f1f8d749 62 extern UI_STRUCT uiMain;
the_sz 3:ecf7f1f8d749 63
the_sz 2:80026d18fcf3 64 void UI_Init(void);
the_sz 2:80026d18fcf3 65 void UI_Poll(void);
the_sz 2:80026d18fcf3 66 void UI_Show(UI_STRUCT *ui);
the_sz 2:80026d18fcf3 67
the_sz 5:13c70bcde7f6 68 void UI_MainHandler(UI_REASON_ENUM reason,int32_t index,UI_STRUCT *ui);
the_sz 3:ecf7f1f8d749 69
the_sz 5:13c70bcde7f6 70 void UI_WakeupHandler(UI_REASON_ENUM reason,int32_t index,UI_STRUCT *ui);
the_sz 5:13c70bcde7f6 71 void UI_ColorTestHandler(UI_REASON_ENUM reason,int32_t index,UI_STRUCT *ui);
the_sz 3:ecf7f1f8d749 72
the_sz 2:80026d18fcf3 73 #endif