NXP
/
rt1050_emwin_gui_demo
RT1050 GUI demo using emWin library
emwin/emWin_header/GRAPH.h@0:dd702039127a, 2018-09-20 (annotated)
- Committer:
- alejandroRL
- Date:
- Thu Sep 20 19:16:34 2018 +0000
- Revision:
- 0:dd702039127a
emWin GUI Demo for RT1050
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
alejandroRL | 0:dd702039127a | 1 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 2 | * SEGGER Microcontroller GmbH & Co. KG * |
alejandroRL | 0:dd702039127a | 3 | * Solutions for real time microcontroller applications * |
alejandroRL | 0:dd702039127a | 4 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 5 | * * |
alejandroRL | 0:dd702039127a | 6 | * (c) 1996 - 2016 SEGGER Microcontroller GmbH & Co. KG * |
alejandroRL | 0:dd702039127a | 7 | * * |
alejandroRL | 0:dd702039127a | 8 | * Internet: www.segger.com Support: support@segger.com * |
alejandroRL | 0:dd702039127a | 9 | * * |
alejandroRL | 0:dd702039127a | 10 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 11 | |
alejandroRL | 0:dd702039127a | 12 | ** emWin V5.38 - Graphical user interface for embedded applications ** |
alejandroRL | 0:dd702039127a | 13 | All Intellectual Property rights in the Software belongs to SEGGER. |
alejandroRL | 0:dd702039127a | 14 | emWin is protected by international copyright laws. Knowledge of the |
alejandroRL | 0:dd702039127a | 15 | source code may not be used to write a similar product. This file may |
alejandroRL | 0:dd702039127a | 16 | only be used in accordance with the following terms: |
alejandroRL | 0:dd702039127a | 17 | |
alejandroRL | 0:dd702039127a | 18 | The software has been licensed to NXP Semiconductors USA, Inc. whose |
alejandroRL | 0:dd702039127a | 19 | registered office is situated at 411 E. Plumeria Drive, San Jose, |
alejandroRL | 0:dd702039127a | 20 | CA 95134, USA solely for the purposes of creating libraries for |
alejandroRL | 0:dd702039127a | 21 | NXPs M0, M3/M4 and ARM7/9 processor-based devices, sublicensed and |
alejandroRL | 0:dd702039127a | 22 | distributed under the terms and conditions of the NXP End User License |
alejandroRL | 0:dd702039127a | 23 | Agreement. |
alejandroRL | 0:dd702039127a | 24 | Full source code is available at: www.segger.com |
alejandroRL | 0:dd702039127a | 25 | |
alejandroRL | 0:dd702039127a | 26 | We appreciate your understanding and fairness. |
alejandroRL | 0:dd702039127a | 27 | ---------------------------------------------------------------------- |
alejandroRL | 0:dd702039127a | 28 | Licensing information |
alejandroRL | 0:dd702039127a | 29 | |
alejandroRL | 0:dd702039127a | 30 | Licensor: SEGGER Microcontroller Systems LLC |
alejandroRL | 0:dd702039127a | 31 | Licensed to: NXP Semiconductors, 1109 McKay Dr, M/S 76, San Jose, CA 95131, USA |
alejandroRL | 0:dd702039127a | 32 | Licensed SEGGER software: emWin |
alejandroRL | 0:dd702039127a | 33 | License number: GUI-00186 |
alejandroRL | 0:dd702039127a | 34 | License model: emWin License Agreement, dated August 20th 2011 |
alejandroRL | 0:dd702039127a | 35 | Licensed product: - |
alejandroRL | 0:dd702039127a | 36 | Licensed platform: NXP's ARM 7/9, Cortex-M0,M3,M4 |
alejandroRL | 0:dd702039127a | 37 | Licensed number of seats: - |
alejandroRL | 0:dd702039127a | 38 | ---------------------------------------------------------------------- |
alejandroRL | 0:dd702039127a | 39 | File : GRAPH.h |
alejandroRL | 0:dd702039127a | 40 | Purpose : GRAPH include |
alejandroRL | 0:dd702039127a | 41 | --------------------END-OF-HEADER------------------------------------- |
alejandroRL | 0:dd702039127a | 42 | */ |
alejandroRL | 0:dd702039127a | 43 | |
alejandroRL | 0:dd702039127a | 44 | #ifndef GRAPH_H |
alejandroRL | 0:dd702039127a | 45 | #define GRAPH_H |
alejandroRL | 0:dd702039127a | 46 | |
alejandroRL | 0:dd702039127a | 47 | #include "WM.h" |
alejandroRL | 0:dd702039127a | 48 | #include "DIALOG_Intern.h" /* Req. for Create indirect data structure */ |
alejandroRL | 0:dd702039127a | 49 | #include "WIDGET.h" |
alejandroRL | 0:dd702039127a | 50 | |
alejandroRL | 0:dd702039127a | 51 | #if GUI_WINSUPPORT |
alejandroRL | 0:dd702039127a | 52 | |
alejandroRL | 0:dd702039127a | 53 | #if defined(__cplusplus) |
alejandroRL | 0:dd702039127a | 54 | extern "C" { /* Make sure we have C-declarations in C++ programs */ |
alejandroRL | 0:dd702039127a | 55 | #endif |
alejandroRL | 0:dd702039127a | 56 | |
alejandroRL | 0:dd702039127a | 57 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 58 | * |
alejandroRL | 0:dd702039127a | 59 | * Defines |
alejandroRL | 0:dd702039127a | 60 | * |
alejandroRL | 0:dd702039127a | 61 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 62 | */ |
alejandroRL | 0:dd702039127a | 63 | #define GRAPH_CI_BK 0 |
alejandroRL | 0:dd702039127a | 64 | #define GRAPH_CI_BORDER 1 |
alejandroRL | 0:dd702039127a | 65 | #define GRAPH_CI_FRAME 2 |
alejandroRL | 0:dd702039127a | 66 | #define GRAPH_CI_GRID 3 |
alejandroRL | 0:dd702039127a | 67 | |
alejandroRL | 0:dd702039127a | 68 | #define GRAPH_SCALE_CF_HORIZONTAL (0 << 0) |
alejandroRL | 0:dd702039127a | 69 | #define GRAPH_SCALE_CF_VERTICAL (1 << 0) |
alejandroRL | 0:dd702039127a | 70 | |
alejandroRL | 0:dd702039127a | 71 | #define GRAPH_SCALE_SF_HORIZONTAL GRAPH_SCALE_CF_HORIZONTAL |
alejandroRL | 0:dd702039127a | 72 | #define GRAPH_SCALE_SF_VERTICAL GRAPH_SCALE_CF_VERTICAL |
alejandroRL | 0:dd702039127a | 73 | |
alejandroRL | 0:dd702039127a | 74 | #define GRAPH_DRAW_FIRST 0 |
alejandroRL | 0:dd702039127a | 75 | #define GRAPH_DRAW_AFTER_BORDER 1 |
alejandroRL | 0:dd702039127a | 76 | #define GRAPH_DRAW_LAST 2 |
alejandroRL | 0:dd702039127a | 77 | |
alejandroRL | 0:dd702039127a | 78 | #define GRAPH_ALIGN_RIGHT (0 << 0) |
alejandroRL | 0:dd702039127a | 79 | #define GRAPH_ALIGN_LEFT (1 << 0) |
alejandroRL | 0:dd702039127a | 80 | |
alejandroRL | 0:dd702039127a | 81 | // |
alejandroRL | 0:dd702039127a | 82 | // Creation flags (ExFlags) |
alejandroRL | 0:dd702039127a | 83 | // |
alejandroRL | 0:dd702039127a | 84 | #define GRAPH_CF_GRID_FIXED_X (1 << 0) |
alejandroRL | 0:dd702039127a | 85 | #define GRAPH_CF_AVOID_SCROLLBAR_H (1 << 1) |
alejandroRL | 0:dd702039127a | 86 | #define GRAPH_CF_AVOID_SCROLLBAR_V (1 << 2) |
alejandroRL | 0:dd702039127a | 87 | |
alejandroRL | 0:dd702039127a | 88 | // |
alejandroRL | 0:dd702039127a | 89 | // Status flags |
alejandroRL | 0:dd702039127a | 90 | // |
alejandroRL | 0:dd702039127a | 91 | #define GRAPH_SF_AVOID_SCROLLBAR_H GRAPH_CF_AVOID_SCROLLBAR_H |
alejandroRL | 0:dd702039127a | 92 | #define GRAPH_SF_AVOID_SCROLLBAR_V GRAPH_CF_AVOID_SCROLLBAR_V |
alejandroRL | 0:dd702039127a | 93 | |
alejandroRL | 0:dd702039127a | 94 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 95 | * |
alejandroRL | 0:dd702039127a | 96 | * Public Types |
alejandroRL | 0:dd702039127a | 97 | * |
alejandroRL | 0:dd702039127a | 98 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 99 | */ |
alejandroRL | 0:dd702039127a | 100 | typedef WM_HMEM GRAPH_Handle; |
alejandroRL | 0:dd702039127a | 101 | typedef WM_HMEM GRAPH_DATA_Handle; |
alejandroRL | 0:dd702039127a | 102 | typedef WM_HMEM GRAPH_SCALE_Handle; |
alejandroRL | 0:dd702039127a | 103 | |
alejandroRL | 0:dd702039127a | 104 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 105 | * |
alejandroRL | 0:dd702039127a | 106 | * Create functions |
alejandroRL | 0:dd702039127a | 107 | * |
alejandroRL | 0:dd702039127a | 108 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 109 | */ |
alejandroRL | 0:dd702039127a | 110 | |
alejandroRL | 0:dd702039127a | 111 | GRAPH_Handle GRAPH_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id); |
alejandroRL | 0:dd702039127a | 112 | GRAPH_Handle GRAPH_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes); |
alejandroRL | 0:dd702039127a | 113 | GRAPH_Handle GRAPH_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); |
alejandroRL | 0:dd702039127a | 114 | |
alejandroRL | 0:dd702039127a | 115 | GRAPH_DATA_Handle GRAPH_DATA_XY_Create(GUI_COLOR Color, unsigned MaxNumItems, const GUI_POINT * pData, unsigned NumItems); |
alejandroRL | 0:dd702039127a | 116 | GRAPH_DATA_Handle GRAPH_DATA_YT_Create(GUI_COLOR Color, unsigned MaxNumItems, const I16 * pData, unsigned NumItems); |
alejandroRL | 0:dd702039127a | 117 | GRAPH_SCALE_Handle GRAPH_SCALE_Create (int Pos, int TextAlign, unsigned Flags, unsigned TickDist); |
alejandroRL | 0:dd702039127a | 118 | |
alejandroRL | 0:dd702039127a | 119 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 120 | * |
alejandroRL | 0:dd702039127a | 121 | * The callback ... |
alejandroRL | 0:dd702039127a | 122 | * |
alejandroRL | 0:dd702039127a | 123 | * Do not call it directly ! It is only to be used from within an |
alejandroRL | 0:dd702039127a | 124 | * overwritten callback. |
alejandroRL | 0:dd702039127a | 125 | */ |
alejandroRL | 0:dd702039127a | 126 | void GRAPH_Callback(WM_MESSAGE * pMsg); |
alejandroRL | 0:dd702039127a | 127 | |
alejandroRL | 0:dd702039127a | 128 | /********************************************************************* |
alejandroRL | 0:dd702039127a | 129 | * |
alejandroRL | 0:dd702039127a | 130 | * Member functions |
alejandroRL | 0:dd702039127a | 131 | * |
alejandroRL | 0:dd702039127a | 132 | ********************************************************************** |
alejandroRL | 0:dd702039127a | 133 | */ |
alejandroRL | 0:dd702039127a | 134 | void GRAPH_AttachData (GRAPH_Handle hObj, GRAPH_DATA_Handle hData); |
alejandroRL | 0:dd702039127a | 135 | void GRAPH_AttachScale (GRAPH_Handle hObj, GRAPH_SCALE_Handle hScale); |
alejandroRL | 0:dd702039127a | 136 | void GRAPH_DetachData (GRAPH_Handle hObj, GRAPH_DATA_Handle hData); |
alejandroRL | 0:dd702039127a | 137 | void GRAPH_DetachScale (GRAPH_Handle hObj, GRAPH_SCALE_Handle hScale); |
alejandroRL | 0:dd702039127a | 138 | I32 GRAPH_GetScrollValue (GRAPH_Handle hObj, U8 Coord); |
alejandroRL | 0:dd702039127a | 139 | int GRAPH_GetUserData (GRAPH_Handle hObj, void * pDest, int NumBytes); |
alejandroRL | 0:dd702039127a | 140 | void GRAPH_SetAutoScrollbar (GRAPH_Handle hObj, U8 Coord, U8 OnOff); |
alejandroRL | 0:dd702039127a | 141 | void GRAPH_SetBorder (GRAPH_Handle hObj, unsigned BorderL, unsigned BorderT, unsigned BorderR, unsigned BorderB); |
alejandroRL | 0:dd702039127a | 142 | GUI_COLOR GRAPH_SetColor (GRAPH_Handle hObj, GUI_COLOR Color, unsigned Index); |
alejandroRL | 0:dd702039127a | 143 | unsigned GRAPH_SetGridFixedX (GRAPH_Handle hObj, unsigned OnOff); |
alejandroRL | 0:dd702039127a | 144 | unsigned GRAPH_SetGridOffY (GRAPH_Handle hObj, unsigned Value); |
alejandroRL | 0:dd702039127a | 145 | unsigned GRAPH_SetGridVis (GRAPH_Handle hObj, unsigned OnOff); |
alejandroRL | 0:dd702039127a | 146 | unsigned GRAPH_SetGridDistX (GRAPH_Handle hObj, unsigned Value); |
alejandroRL | 0:dd702039127a | 147 | unsigned GRAPH_SetGridDistY (GRAPH_Handle hObj, unsigned Value); |
alejandroRL | 0:dd702039127a | 148 | U8 GRAPH_SetLineStyleH (GRAPH_Handle hObj, U8 Value); |
alejandroRL | 0:dd702039127a | 149 | U8 GRAPH_SetLineStyleV (GRAPH_Handle hObj, U8 Value); |
alejandroRL | 0:dd702039127a | 150 | void GRAPH_SetLineStyle (GRAPH_Handle hObj, U8 Value); |
alejandroRL | 0:dd702039127a | 151 | void GRAPH_SetScrollValue (GRAPH_Handle hObj, U8 Coord, U32 Value); |
alejandroRL | 0:dd702039127a | 152 | unsigned GRAPH_SetVSizeX (GRAPH_Handle hObj, unsigned Value); |
alejandroRL | 0:dd702039127a | 153 | unsigned GRAPH_SetVSizeY (GRAPH_Handle hObj, unsigned Value); |
alejandroRL | 0:dd702039127a | 154 | int GRAPH_SetUserData (GRAPH_Handle hObj, const void * pSrc, int NumBytes); |
alejandroRL | 0:dd702039127a | 155 | void GRAPH_SetUserDraw (GRAPH_Handle hObj, void (* pOwnerDraw)(WM_HWIN, int)); |
alejandroRL | 0:dd702039127a | 156 | |
alejandroRL | 0:dd702039127a | 157 | void GRAPH_DATA_YT_AddValue (GRAPH_DATA_Handle hDataObj, I16 Value); |
alejandroRL | 0:dd702039127a | 158 | void GRAPH_DATA_YT_Clear (GRAPH_DATA_Handle hDataObj); |
alejandroRL | 0:dd702039127a | 159 | void GRAPH_DATA_YT_Delete (GRAPH_DATA_Handle hDataObj); |
alejandroRL | 0:dd702039127a | 160 | int GRAPH_DATA_YT_GetValue (GRAPH_DATA_Handle hDataObj, I16 * pValue, U32 Index); |
alejandroRL | 0:dd702039127a | 161 | |
alejandroRL | 0:dd702039127a | 162 | void GRAPH_DATA_YT_SetAlign (GRAPH_DATA_Handle hDataObj, int Align); |
alejandroRL | 0:dd702039127a | 163 | void GRAPH_DATA_YT_SetOffY (GRAPH_DATA_Handle hDataObj, int Off); |
alejandroRL | 0:dd702039127a | 164 | void GRAPH_DATA_YT_MirrorX (GRAPH_DATA_Handle hDataObj, int OnOff); |
alejandroRL | 0:dd702039127a | 165 | |
alejandroRL | 0:dd702039127a | 166 | void GRAPH_DATA_XY_AddPoint (GRAPH_DATA_Handle hDataObj, GUI_POINT * pPoint); |
alejandroRL | 0:dd702039127a | 167 | void GRAPH_DATA_XY_Clear (GRAPH_DATA_Handle hDataObj); |
alejandroRL | 0:dd702039127a | 168 | void GRAPH_DATA_XY_Delete (GRAPH_DATA_Handle hDataObj); |
alejandroRL | 0:dd702039127a | 169 | unsigned GRAPH_DATA_XY_GetLineVis (GRAPH_DATA_Handle hDataObj); |
alejandroRL | 0:dd702039127a | 170 | int GRAPH_DATA_XY_GetPoint (GRAPH_DATA_Handle hDataObj, GUI_POINT * pPoint, U32 Index); |
alejandroRL | 0:dd702039127a | 171 | unsigned GRAPH_DATA_XY_GetPointVis (GRAPH_DATA_Handle hDataObj); |
alejandroRL | 0:dd702039127a | 172 | void GRAPH_DATA_XY_SetLineStyle (GRAPH_DATA_Handle hDataObj, U8 LineStyle); |
alejandroRL | 0:dd702039127a | 173 | unsigned GRAPH_DATA_XY_SetLineVis (GRAPH_DATA_Handle hDataObj, unsigned OnOff); |
alejandroRL | 0:dd702039127a | 174 | void GRAPH_DATA_XY_SetOffX (GRAPH_DATA_Handle hDataObj, int Off); |
alejandroRL | 0:dd702039127a | 175 | void GRAPH_DATA_XY_SetOffY (GRAPH_DATA_Handle hDataObj, int Off); |
alejandroRL | 0:dd702039127a | 176 | void GRAPH_DATA_XY_SetPenSize (GRAPH_DATA_Handle hDataObj, U8 PenSize); |
alejandroRL | 0:dd702039127a | 177 | void GRAPH_DATA_XY_SetPointSize (GRAPH_DATA_Handle hDataObj, unsigned PointSize); |
alejandroRL | 0:dd702039127a | 178 | unsigned GRAPH_DATA_XY_SetPointVis (GRAPH_DATA_Handle hDataObj, unsigned OnOff); |
alejandroRL | 0:dd702039127a | 179 | void GRAPH_DATA_XY_SetOwnerDraw (GRAPH_DATA_Handle hDataObj, WIDGET_DRAW_ITEM_FUNC * pOwnerDraw); |
alejandroRL | 0:dd702039127a | 180 | |
alejandroRL | 0:dd702039127a | 181 | void GRAPH_SCALE_Delete (GRAPH_SCALE_Handle hScaleObj); |
alejandroRL | 0:dd702039127a | 182 | float GRAPH_SCALE_SetFactor (GRAPH_SCALE_Handle hScaleObj, float Factor); |
alejandroRL | 0:dd702039127a | 183 | const GUI_FONT * GRAPH_SCALE_SetFont (GRAPH_SCALE_Handle hScaleObj, const GUI_FONT * pFont); |
alejandroRL | 0:dd702039127a | 184 | int GRAPH_SCALE_SetNumDecs (GRAPH_SCALE_Handle hScaleObj, int NumDecs); |
alejandroRL | 0:dd702039127a | 185 | int GRAPH_SCALE_SetOff (GRAPH_SCALE_Handle hScaleObj, int Off); |
alejandroRL | 0:dd702039127a | 186 | int GRAPH_SCALE_SetPos (GRAPH_SCALE_Handle hScaleObj, int Pos); |
alejandroRL | 0:dd702039127a | 187 | GUI_COLOR GRAPH_SCALE_SetTextColor(GRAPH_SCALE_Handle hScaleObj, GUI_COLOR Color); |
alejandroRL | 0:dd702039127a | 188 | unsigned GRAPH_SCALE_SetTickDist (GRAPH_SCALE_Handle hScaleObj, unsigned Value); |
alejandroRL | 0:dd702039127a | 189 | |
alejandroRL | 0:dd702039127a | 190 | #if defined(__cplusplus) |
alejandroRL | 0:dd702039127a | 191 | } |
alejandroRL | 0:dd702039127a | 192 | #endif |
alejandroRL | 0:dd702039127a | 193 | |
alejandroRL | 0:dd702039127a | 194 | #endif // GUI_WINSUPPORT |
alejandroRL | 0:dd702039127a | 195 | #endif // GRAPH_H |
alejandroRL | 0:dd702039127a | 196 | |
alejandroRL | 0:dd702039127a | 197 | /*************************** End of file ****************************/ |