Nuvoton
/
NuMaker-mbed-emWin-example
NuMaker emWin HMI
Embed:
(wiki syntax)
Show/hide line numbers
SEGGER.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 : SEGGER.h 00040 Purpose : Global types etc & general purpose utility functions 00041 Revision: $Rev: 6176 $ 00042 ---------------------------END-OF-HEADER------------------------------ 00043 */ 00044 00045 #ifndef SEGGER_H // Guard against multiple inclusion 00046 #define SEGGER_H 00047 00048 #include <stdarg.h> 00049 #include "Global.h" // Type definitions: U8, U16, U32, I8, I16, I32 00050 00051 #if defined(__cplusplus) 00052 extern "C" { /* Make sure we have C-declarations in C++ programs */ 00053 #endif 00054 00055 /********************************************************************* 00056 * 00057 * Keywords/specifiers 00058 * 00059 ********************************************************************** 00060 */ 00061 00062 #ifndef INLINE 00063 #ifdef _WIN32 00064 // 00065 // Microsoft VC6 and newer. 00066 // Force inlining without cost checking. 00067 // 00068 #define INLINE __forceinline 00069 #else 00070 #if (defined(__GNUC__)) 00071 // 00072 // Force inlining with GCC 00073 // 00074 #define INLINE inline __attribute__((always_inline)) 00075 #elif (defined(__ICCARM__) || defined(__CC_ARM) || defined(__RX) || defined(__ICCRX__)) 00076 // 00077 // Other known compilers. 00078 // 00079 #define INLINE inline 00080 #else 00081 // 00082 // Unknown compilers. 00083 // 00084 #define INLINE 00085 #endif 00086 #endif 00087 #endif 00088 00089 /********************************************************************* 00090 * 00091 * Function-like macros 00092 * 00093 ********************************************************************** 00094 */ 00095 00096 #define SEGGER_COUNTOF(a) (sizeof((a))/sizeof((a)[0])) 00097 #define SEGGER_MIN(a,b) (((a) < (b)) ? (a) : (b)) 00098 #define SEGGER_MAX(a,b) (((a) > (b)) ? (a) : (b)) 00099 00100 #ifndef SEGGER_USE_PARA // Some compiler complain about unused parameters. 00101 #define SEGGER_USE_PARA(Para) (void)Para // This works for most compilers. 00102 #endif 00103 00104 /********************************************************************* 00105 * 00106 * Defines 00107 * 00108 ********************************************************************** 00109 */ 00110 00111 #define SEGGER_PRINTF_FLAG_ADJLEFT (1 << 0) 00112 #define SEGGER_PRINTF_FLAG_SIGNFORCE (1 << 1) 00113 #define SEGGER_PRINTF_FLAG_SIGNSPACE (1 << 2) 00114 #define SEGGER_PRINTF_FLAG_PRECEED (1 << 3) 00115 #define SEGGER_PRINTF_FLAG_ZEROPAD (1 << 4) 00116 #define SEGGER_PRINTF_FLAG_NEGATIVE (1 << 5) 00117 00118 /********************************************************************* 00119 * 00120 * Types 00121 * 00122 ********************************************************************** 00123 */ 00124 00125 typedef struct { 00126 char* pBuffer; 00127 int BufferSize; 00128 int Cnt; 00129 } SEGGER_BUFFER_DESC; 00130 00131 typedef struct { 00132 int CacheLineSize; // 0: No Cache. Most Systems such as ARM9 use a 32 bytes cache line size. 00133 void (*pfDMB) (void); // Optional DMB function for Data Memory Barrier to make sure all memory operations are completed. 00134 void (*pfClean) (void *p, unsigned NumBytes); // Optional clean function for cached memory. 00135 void (*pfInvalidate)(void *p, unsigned NumBytes); // Optional invalidate function for cached memory. 00136 } SEGGER_CACHE_CONFIG; 00137 00138 typedef struct SEGGER_SNPRINTF_CONTEXT_struct SEGGER_SNPRINTF_CONTEXT; 00139 00140 struct SEGGER_SNPRINTF_CONTEXT_struct { 00141 void* pContext; // Application specific context. 00142 SEGGER_BUFFER_DESC* pBufferDesc; // Buffer descriptor to use for output. 00143 void (*pfFlush)(SEGGER_SNPRINTF_CONTEXT *); // Callback executed once the buffer is full. Callback decides if the buffer gets cleared to store more or not. 00144 }; 00145 00146 typedef struct { 00147 void (*pfStoreChar) (SEGGER_BUFFER_DESC* pBufferDesc, SEGGER_SNPRINTF_CONTEXT* pContext, char c); 00148 int (*pfPrintUnsigned) (SEGGER_BUFFER_DESC* pBufferDesc, SEGGER_SNPRINTF_CONTEXT* pContext, U32 v, unsigned Base, char Flags, int Width, int Precision); 00149 int (*pfPrintInt) (SEGGER_BUFFER_DESC* pBufferDesc, SEGGER_SNPRINTF_CONTEXT* pContext, I32 v, unsigned Base, char Flags, int Width, int Precision); 00150 } SEGGER_PRINTF_API; 00151 00152 typedef void (*SEGGER_pFormatter)(SEGGER_BUFFER_DESC* pBufferDesc, SEGGER_SNPRINTF_CONTEXT* pContext, const SEGGER_PRINTF_API* pApi, va_list* pParamList, char Lead, int Width, int Precision); 00153 00154 typedef struct SEGGER_PRINTF_FORMATTER { 00155 struct SEGGER_PRINTF_FORMATTER* pNext; // Pointer to next formatter. 00156 SEGGER_pFormatter pfFormatter; // Formatter function. 00157 char Specifier; // Format specifier. 00158 } SEGGER_PRINTF_FORMATTER; 00159 00160 /********************************************************************* 00161 * 00162 * Utility functions 00163 * 00164 ********************************************************************** 00165 */ 00166 00167 void SEGGER_ARM_memcpy(void* pDest, const void* pSrc, int NumBytes); 00168 void SEGGER_memcpy (void* pDest, const void* pSrc, int NumBytes); 00169 void SEGGER_memxor (void* pDest, const void* pSrc, unsigned NumBytes); 00170 00171 void SEGGER_StoreChar (SEGGER_BUFFER_DESC* pBufferDesc, char c); 00172 void SEGGER_PrintUnsigned(SEGGER_BUFFER_DESC* pBufferDesc, U32 v, unsigned Base, int Precision); 00173 void SEGGER_PrintInt (SEGGER_BUFFER_DESC* pBufferDesc, I32 v, unsigned Base, int Precision); 00174 //int SEGGER_snprintf (char* pBuffer, int BufferSize, const char* sFormat, ...); 00175 int SEGGER_vsnprintf (char* pBuffer, int BufferSize, const char* sFormat, va_list ParamList); 00176 int SEGGER_vsnprintfEx (SEGGER_SNPRINTF_CONTEXT* pContext, const char* sFormat, va_list ParamList); 00177 00178 int SEGGER_PRINTF_AddFormatter (SEGGER_PRINTF_FORMATTER* pFormatter, SEGGER_pFormatter pfFormatter, char c); 00179 void SEGGER_PRINTF_AddDoubleFormatter(void); 00180 void SEGGER_PRINTF_AddIPFormatter (void); 00181 void SEGGER_PRINTF_AddHTMLFormatter (void); 00182 00183 #if defined(__cplusplus) 00184 } /* Make sure we have C-declarations in C++ programs */ 00185 #endif 00186 00187 #endif // Avoid multiple inclusion 00188 00189 /*************************** End of file ****************************/
Generated on Mon Mar 4 2024 07:48:13 by 1.7.2