Nuvoton
/
NuMaker-mbed-emWin-example
NuMaker emWin HMI
emWin/Include/RADIO.h@10:c8165817d92a, 6 months ago (annotated)
- Committer:
- csyang2
- Date:
- Mon Mar 04 15:47:41 2024 +0800
- Revision:
- 10:c8165817d92a
- Parent:
- 1:c0f972361605
Support NuMaker-IoT-M467
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
csyang2 |
1:c0f972361605 | 1 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 2 | * SEGGER Software GmbH * |
csyang2 |
1:c0f972361605 | 3 | * Solutions for real time microcontroller applications * |
csyang2 |
1:c0f972361605 | 4 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 5 | * * |
csyang2 |
1:c0f972361605 | 6 | * (c) 1996 - 2018 SEGGER Microcontroller GmbH * |
csyang2 |
1:c0f972361605 | 7 | * * |
csyang2 |
1:c0f972361605 | 8 | * Internet: www.segger.com Support: support@segger.com * |
csyang2 |
1:c0f972361605 | 9 | * * |
csyang2 |
1:c0f972361605 | 10 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 11 | |
csyang2 |
1:c0f972361605 | 12 | ** emWin V5.48 - Graphical user interface for embedded applications ** |
csyang2 |
1:c0f972361605 | 13 | All Intellectual Property rights in the Software belongs to SEGGER. |
csyang2 |
1:c0f972361605 | 14 | emWin is protected by international copyright laws. Knowledge of the |
csyang2 |
1:c0f972361605 | 15 | source code may not be used to write a similar product. This file may |
csyang2 |
1:c0f972361605 | 16 | only be used in accordance with the following terms: |
csyang2 |
1:c0f972361605 | 17 | |
csyang2 |
1:c0f972361605 | 18 | The software has been licensed by SEGGER Software GmbH to Nuvoton Technology Corporationat the address: No. 4, Creation Rd. III, Hsinchu Science Park, Taiwan |
csyang2 |
1:c0f972361605 | 19 | for the purposes of creating libraries for its |
csyang2 |
1:c0f972361605 | 20 | Arm Cortex-M and Arm9 32-bit microcontrollers, commercialized and distributed by Nuvoton Technology Corporation |
csyang2 |
1:c0f972361605 | 21 | under the terms and conditions of an End User |
csyang2 |
1:c0f972361605 | 22 | License Agreement supplied with the libraries. |
csyang2 |
1:c0f972361605 | 23 | Full source code is available at: www.segger.com |
csyang2 |
1:c0f972361605 | 24 | |
csyang2 |
1:c0f972361605 | 25 | We appreciate your understanding and fairness. |
csyang2 |
1:c0f972361605 | 26 | ---------------------------------------------------------------------- |
csyang2 |
1:c0f972361605 | 27 | Licensing information |
csyang2 |
1:c0f972361605 | 28 | Licensor: SEGGER Software GmbH |
csyang2 |
1:c0f972361605 | 29 | Licensed to: Nuvoton Technology Corporation, No. 4, Creation Rd. III, Hsinchu Science Park, 30077 Hsinchu City, Taiwan |
csyang2 |
1:c0f972361605 | 30 | Licensed SEGGER software: emWin |
csyang2 |
1:c0f972361605 | 31 | License number: GUI-00735 |
csyang2 |
1:c0f972361605 | 32 | License model: emWin License Agreement, signed February 27, 2018 |
csyang2 |
1:c0f972361605 | 33 | Licensed platform: Cortex-M and ARM9 32-bit series microcontroller designed and manufactured by or for Nuvoton Technology Corporation |
csyang2 |
1:c0f972361605 | 34 | ---------------------------------------------------------------------- |
csyang2 |
1:c0f972361605 | 35 | Support and Update Agreement (SUA) |
csyang2 |
1:c0f972361605 | 36 | SUA period: 2018-03-26 - 2019-03-27 |
csyang2 |
1:c0f972361605 | 37 | Contact to extend SUA: sales@segger.com |
csyang2 |
1:c0f972361605 | 38 | ---------------------------------------------------------------------- |
csyang2 |
1:c0f972361605 | 39 | File : RADIO.h |
csyang2 |
1:c0f972361605 | 40 | Purpose : RADIO include |
csyang2 |
1:c0f972361605 | 41 | --------------------END-OF-HEADER------------------------------------- |
csyang2 |
1:c0f972361605 | 42 | */ |
csyang2 |
1:c0f972361605 | 43 | |
csyang2 |
1:c0f972361605 | 44 | #ifndef RADIO_H |
csyang2 |
1:c0f972361605 | 45 | #define RADIO_H |
csyang2 |
1:c0f972361605 | 46 | |
csyang2 |
1:c0f972361605 | 47 | #include "WM.h" |
csyang2 |
1:c0f972361605 | 48 | #include "DIALOG_Intern.h" /* Req. for Create indirect data structure */ |
csyang2 |
1:c0f972361605 | 49 | #include "WIDGET.h" |
csyang2 |
1:c0f972361605 | 50 | |
csyang2 |
1:c0f972361605 | 51 | #if GUI_WINSUPPORT |
csyang2 |
1:c0f972361605 | 52 | |
csyang2 |
1:c0f972361605 | 53 | #if defined(__cplusplus) |
csyang2 |
1:c0f972361605 | 54 | extern "C" { /* Make sure we have C-declarations in C++ programs */ |
csyang2 |
1:c0f972361605 | 55 | #endif |
csyang2 |
1:c0f972361605 | 56 | |
csyang2 |
1:c0f972361605 | 57 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 58 | * |
csyang2 |
1:c0f972361605 | 59 | * Bitmap indices |
csyang2 |
1:c0f972361605 | 60 | */ |
csyang2 |
1:c0f972361605 | 61 | #define RADIO_BI_INACTIV 0 |
csyang2 |
1:c0f972361605 | 62 | #define RADIO_BI_ACTIV 1 |
csyang2 |
1:c0f972361605 | 63 | #define RADIO_BI_CHECK 2 |
csyang2 |
1:c0f972361605 | 64 | |
csyang2 |
1:c0f972361605 | 65 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 66 | * |
csyang2 |
1:c0f972361605 | 67 | * Skinning property indices |
csyang2 |
1:c0f972361605 | 68 | */ |
csyang2 |
1:c0f972361605 | 69 | #define RADIO_SKINFLEX_PI_PRESSED 0 |
csyang2 |
1:c0f972361605 | 70 | #define RADIO_SKINFLEX_PI_UNPRESSED 1 |
csyang2 |
1:c0f972361605 | 71 | |
csyang2 |
1:c0f972361605 | 72 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 73 | * |
csyang2 |
1:c0f972361605 | 74 | * Defaults for public configuration switches |
csyang2 |
1:c0f972361605 | 75 | * |
csyang2 |
1:c0f972361605 | 76 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 77 | |
csyang2 |
1:c0f972361605 | 78 | The following are defaults for config switches which affect the |
csyang2 |
1:c0f972361605 | 79 | interface specified in this module |
csyang2 |
1:c0f972361605 | 80 | */ |
csyang2 |
1:c0f972361605 | 81 | |
csyang2 |
1:c0f972361605 | 82 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 83 | * |
csyang2 |
1:c0f972361605 | 84 | * Defines |
csyang2 |
1:c0f972361605 | 85 | * |
csyang2 |
1:c0f972361605 | 86 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 87 | */ |
csyang2 |
1:c0f972361605 | 88 | #define RADIO_TEXTPOS_RIGHT 0 |
csyang2 |
1:c0f972361605 | 89 | #define RADIO_TEXTPOS_LEFT WIDGET_STATE_USER0 /* Not implemented, TBD */ |
csyang2 |
1:c0f972361605 | 90 | |
csyang2 |
1:c0f972361605 | 91 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 92 | * |
csyang2 |
1:c0f972361605 | 93 | * Public Types |
csyang2 |
1:c0f972361605 | 94 | * |
csyang2 |
1:c0f972361605 | 95 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 96 | */ |
csyang2 |
1:c0f972361605 | 97 | typedef WM_HMEM RADIO_Handle; |
csyang2 |
1:c0f972361605 | 98 | |
csyang2 |
1:c0f972361605 | 99 | typedef struct { |
csyang2 |
1:c0f972361605 | 100 | GUI_COLOR aColorButton[4]; |
csyang2 |
1:c0f972361605 | 101 | int ButtonSize; |
csyang2 |
1:c0f972361605 | 102 | } RADIO_SKINFLEX_PROPS; |
csyang2 |
1:c0f972361605 | 103 | |
csyang2 |
1:c0f972361605 | 104 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 105 | * |
csyang2 |
1:c0f972361605 | 106 | * Create functions |
csyang2 |
1:c0f972361605 | 107 | * |
csyang2 |
1:c0f972361605 | 108 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 109 | */ |
csyang2 |
1:c0f972361605 | 110 | |
csyang2 |
1:c0f972361605 | 111 | RADIO_Handle RADIO_Create (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags, unsigned Para); |
csyang2 |
1:c0f972361605 | 112 | RADIO_Handle RADIO_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumItems, int Spacing); |
csyang2 |
1:c0f972361605 | 113 | RADIO_Handle RADIO_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumItems, int Spacing, int NumExtraBytes); |
csyang2 |
1:c0f972361605 | 114 | RADIO_Handle RADIO_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); |
csyang2 |
1:c0f972361605 | 115 | |
csyang2 |
1:c0f972361605 | 116 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 117 | * |
csyang2 |
1:c0f972361605 | 118 | * The callback ... |
csyang2 |
1:c0f972361605 | 119 | * |
csyang2 |
1:c0f972361605 | 120 | * Do not call it directly ! It is only to be used from within an |
csyang2 |
1:c0f972361605 | 121 | * overwritten callback. |
csyang2 |
1:c0f972361605 | 122 | */ |
csyang2 |
1:c0f972361605 | 123 | void RADIO_Callback(WM_MESSAGE * pMsg); |
csyang2 |
1:c0f972361605 | 124 | |
csyang2 |
1:c0f972361605 | 125 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 126 | * |
csyang2 |
1:c0f972361605 | 127 | * Managing default values |
csyang2 |
1:c0f972361605 | 128 | * |
csyang2 |
1:c0f972361605 | 129 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 130 | */ |
csyang2 |
1:c0f972361605 | 131 | |
csyang2 |
1:c0f972361605 | 132 | void RADIO_SetDefaultFont (const GUI_FONT * pFont); |
csyang2 |
1:c0f972361605 | 133 | GUI_COLOR RADIO_SetDefaultFocusColor(GUI_COLOR Color); |
csyang2 |
1:c0f972361605 | 134 | void RADIO_SetDefaultImage (const GUI_BITMAP * pBitmap, unsigned int Index); |
csyang2 |
1:c0f972361605 | 135 | void RADIO_SetDefaultTextColor (GUI_COLOR TextColor); |
csyang2 |
1:c0f972361605 | 136 | const GUI_FONT * RADIO_GetDefaultFont (void); |
csyang2 |
1:c0f972361605 | 137 | GUI_COLOR RADIO_GetDefaultTextColor (void); |
csyang2 |
1:c0f972361605 | 138 | |
csyang2 |
1:c0f972361605 | 139 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 140 | * |
csyang2 |
1:c0f972361605 | 141 | * Member functions |
csyang2 |
1:c0f972361605 | 142 | * |
csyang2 |
1:c0f972361605 | 143 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 144 | */ |
csyang2 |
1:c0f972361605 | 145 | |
csyang2 |
1:c0f972361605 | 146 | void RADIO_AddValue (RADIO_Handle hObj, int Add); |
csyang2 |
1:c0f972361605 | 147 | void RADIO_Dec (RADIO_Handle hObj); |
csyang2 |
1:c0f972361605 | 148 | GUI_COLOR RADIO_GetBkColor (RADIO_Handle hObj); |
csyang2 |
1:c0f972361605 | 149 | GUI_COLOR RADIO_GetFocusColor(RADIO_Handle hObj); |
csyang2 |
1:c0f972361605 | 150 | const GUI_FONT * RADIO_GetFont (RADIO_Handle hObj); |
csyang2 |
1:c0f972361605 | 151 | const GUI_BITMAP * RADIO_GetImage (RADIO_Handle hObj, unsigned int Index); |
csyang2 |
1:c0f972361605 | 152 | int RADIO_GetNumItems (RADIO_Handle hObj); |
csyang2 |
1:c0f972361605 | 153 | int RADIO_GetText (RADIO_Handle hObj, unsigned Index, char * pBuffer, int MaxLen); |
csyang2 |
1:c0f972361605 | 154 | GUI_COLOR RADIO_GetTextColor (RADIO_Handle hObj); |
csyang2 |
1:c0f972361605 | 155 | int RADIO_GetUserData (RADIO_Handle hObj, void * pDest, int NumBytes); |
csyang2 |
1:c0f972361605 | 156 | void RADIO_Inc (RADIO_Handle hObj); |
csyang2 |
1:c0f972361605 | 157 | void RADIO_SetBkColor (RADIO_Handle hObj, GUI_COLOR Color); |
csyang2 |
1:c0f972361605 | 158 | GUI_COLOR RADIO_SetFocusColor(RADIO_Handle hObj, GUI_COLOR Color); |
csyang2 |
1:c0f972361605 | 159 | void RADIO_SetFont (RADIO_Handle hObj, const GUI_FONT * pFont); |
csyang2 |
1:c0f972361605 | 160 | void RADIO_SetGroupId (RADIO_Handle hObj, U8 GroupId); |
csyang2 |
1:c0f972361605 | 161 | void RADIO_SetImage (RADIO_Handle hObj, const GUI_BITMAP * pBitmap, unsigned int Index); |
csyang2 |
1:c0f972361605 | 162 | void RADIO_SetText (RADIO_Handle hObj, const char* pText, unsigned Index); |
csyang2 |
1:c0f972361605 | 163 | void RADIO_SetTextColor (RADIO_Handle hObj, GUI_COLOR Color); |
csyang2 |
1:c0f972361605 | 164 | void RADIO_SetValue (RADIO_Handle hObj, int v); |
csyang2 |
1:c0f972361605 | 165 | int RADIO_SetUserData (RADIO_Handle hObj, const void * pSrc, int NumBytes); |
csyang2 |
1:c0f972361605 | 166 | |
csyang2 |
1:c0f972361605 | 167 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 168 | * |
csyang2 |
1:c0f972361605 | 169 | * Member functions: Skinning |
csyang2 |
1:c0f972361605 | 170 | * |
csyang2 |
1:c0f972361605 | 171 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 172 | */ |
csyang2 |
1:c0f972361605 | 173 | void RADIO_GetSkinFlexProps (RADIO_SKINFLEX_PROPS * pProps, int Index); |
csyang2 |
1:c0f972361605 | 174 | void RADIO_SetSkinClassic (RADIO_Handle hObj); |
csyang2 |
1:c0f972361605 | 175 | void RADIO_SetSkin (RADIO_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); |
csyang2 |
1:c0f972361605 | 176 | int RADIO_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); |
csyang2 |
1:c0f972361605 | 177 | void RADIO_SetSkinFlexProps (const RADIO_SKINFLEX_PROPS * pProps, int Index); |
csyang2 |
1:c0f972361605 | 178 | void RADIO_SetDefaultSkinClassic(void); |
csyang2 |
1:c0f972361605 | 179 | WIDGET_DRAW_ITEM_FUNC * RADIO_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); |
csyang2 |
1:c0f972361605 | 180 | |
csyang2 |
1:c0f972361605 | 181 | #define RADIO_SKIN_FLEX RADIO_DrawSkinFlex |
csyang2 |
1:c0f972361605 | 182 | |
csyang2 |
1:c0f972361605 | 183 | /********************************************************************* |
csyang2 |
1:c0f972361605 | 184 | * |
csyang2 |
1:c0f972361605 | 185 | * Query state |
csyang2 |
1:c0f972361605 | 186 | * |
csyang2 |
1:c0f972361605 | 187 | ********************************************************************** |
csyang2 |
1:c0f972361605 | 188 | */ |
csyang2 |
1:c0f972361605 | 189 | int RADIO_GetValue(RADIO_Handle hObj); |
csyang2 |
1:c0f972361605 | 190 | |
csyang2 |
1:c0f972361605 | 191 | #if defined(__cplusplus) |
csyang2 |
1:c0f972361605 | 192 | } |
csyang2 |
1:c0f972361605 | 193 | #endif |
csyang2 |
1:c0f972361605 | 194 | |
csyang2 |
1:c0f972361605 | 195 | #endif // GUI_WINSUPPORT |
csyang2 |
1:c0f972361605 | 196 | #endif // RADIO_H |
csyang2 |
1:c0f972361605 | 197 | |
csyang2 |
1:c0f972361605 | 198 | /*************************** End of file ****************************/ |