NuMaker emWin HMI

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers KNOB.h Source File

KNOB.h

00001 /*********************************************************************
00002 *                 SEGGER Software GmbH                               *
00003 *        Solutions for real time microcontroller applications        *
00004 **********************************************************************
00005 *                                                                    *
00006 *        (c) 1996 - 2018  SEGGER Microcontroller GmbH                *
00007 *                                                                    *
00008 *        Internet: www.segger.com    Support:  support@segger.com    *
00009 *                                                                    *
00010 **********************************************************************
00011 
00012 ** emWin V5.48 - Graphical user interface for embedded applications **
00013 All  Intellectual Property rights in the Software belongs to  SEGGER.
00014 emWin is protected by  international copyright laws.  Knowledge of the
00015 source code may not be used to write a similar product. This file may
00016 only be used in accordance with the following terms:
00017 
00018 The  software has  been licensed by SEGGER Software GmbH to Nuvoton Technology Corporationat the address: No. 4, Creation Rd. III, Hsinchu Science Park, Taiwan
00019 for the purposes  of  creating  libraries  for its 
00020 Arm Cortex-M and  Arm9 32-bit microcontrollers, commercialized and distributed by Nuvoton Technology Corporation
00021 under  the terms and conditions  of  an  End  User  
00022 License  Agreement  supplied  with  the libraries.
00023 Full source code is available at: www.segger.com
00024 
00025 We appreciate your understanding and fairness.
00026 ----------------------------------------------------------------------
00027 Licensing information
00028 Licensor:                 SEGGER Software GmbH
00029 Licensed to:              Nuvoton Technology Corporation, No. 4, Creation Rd. III, Hsinchu Science Park, 30077 Hsinchu City, Taiwan
00030 Licensed SEGGER software: emWin
00031 License number:           GUI-00735
00032 License model:            emWin License Agreement, signed February 27, 2018
00033 Licensed platform:        Cortex-M and ARM9 32-bit series microcontroller designed and manufactured by or for Nuvoton Technology Corporation
00034 ----------------------------------------------------------------------
00035 Support and Update Agreement (SUA)
00036 SUA period:               2018-03-26 - 2019-03-27
00037 Contact to extend SUA:    sales@segger.com
00038 ----------------------------------------------------------------------
00039 File        : KNOB.h
00040 Purpose     : KNOB include
00041 --------------------END-OF-HEADER-------------------------------------
00042 */
00043 
00044 #ifndef KNOB_H
00045 #define KNOB_H
00046 
00047 #include "WM.h"
00048 #include "DIALOG_Intern.h"      // Req. for Create indirect data structure
00049 #include "WIDGET.h"
00050 #include "GUI_Debug.h"
00051 
00052 #if (GUI_SUPPORT_MEMDEV && GUI_WINSUPPORT)
00053 
00054 #if defined(__cplusplus)
00055   extern "C" {                  // Make sure we have C-declarations in C++ programs
00056 #endif
00057 
00058 /*********************************************************************
00059 *
00060 *       Public Types
00061 *
00062 **********************************************************************
00063 */
00064 typedef WM_HMEM KNOB_Handle;
00065 
00066 /*********************************************************************
00067 *
00068 *       Create functions
00069 *
00070 **********************************************************************
00071 */
00072 KNOB_Handle KNOB_CreateEx      (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int Id);
00073 KNOB_Handle KNOB_CreateUser    (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int Id, int NumExtraBytes);
00074 KNOB_Handle KNOB_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
00075 
00076 /*********************************************************************
00077 *
00078 *       The callback ...
00079 *
00080 * Do not call it directly ! It is only to be used from within an
00081 * overwritten callback.
00082 */
00083 void KNOB_Callback(WM_MESSAGE * pMsg);
00084 
00085 /*********************************************************************
00086 *
00087 *       Member functions
00088 *
00089 **********************************************************************
00090 */
00091 void KNOB_AddValue   (KNOB_Handle hObj, I32 Value);
00092 int  KNOB_GetUserData(KNOB_Handle hObj, void * pDest, int NumBytes);               // Gets user defined data
00093 I32  KNOB_GetValue   (KNOB_Handle hObj);                                           // Returns the position of the knob in tenth of degree
00094 void KNOB_SetBkColor (KNOB_Handle hObj, GUI_COLOR Color);                          // Sets the BK color of the widget
00095 void KNOB_SetBkDevice(KNOB_Handle hObj, GUI_MEMDEV_Handle hMemBk);                 // Sets the background device
00096 void KNOB_SetDevice  (KNOB_Handle hObj, GUI_MEMDEV_Handle hMemSrc);                // Sets the memory device with the drawn knob
00097 void KNOB_SetKeyValue(KNOB_Handle hObj, I32 KeyValue);                             // Sets the value the knob will rotate on one key press
00098 void KNOB_SetOffset  (KNOB_Handle hObj, I32 Offset);                               // Sets the offset angle of the knob
00099 void KNOB_SetPeriod  (KNOB_Handle hObj, I32 Period);                               // Sets the period in which the knob stops
00100 void KNOB_SetPos     (KNOB_Handle hObj, I32 Pos);                                  // Sets position of the knob in tenth of degree
00101 void KNOB_SetRange   (KNOB_Handle hObj, I32 MinRange, I32 MaxRange);               // Sets the usable range of the knob widget
00102 void KNOB_SetSnap    (KNOB_Handle hObj, I32 Snap);                                 // Sets Snap positions where the knob stops
00103 void KNOB_SetTickSize(KNOB_Handle hObj, I32 TickSize);                             // Sets the ticksize, in 1/10 of degree
00104 int  KNOB_SetUserData(KNOB_Handle hObj, const void * pSrc, int NumBytes);          // Sets user defined data
00105 
00106 /*********************************************************************
00107 *
00108 *       Global functions
00109 *
00110 **********************************************************************
00111 */
00112 
00113 #if defined(__cplusplus)
00114   }
00115 #endif
00116 
00117 #endif  // (GUI_SUPPORT_MEMDEV && GUI_WINSUPPORT)
00118 #endif  // KNOB_H
00119 
00120 /*************************** End of file ****************************/