Select one of the symbols to view example projects that use it.
 
Outline
#define SEGGER_H
#include <stdarg.h>
#include "Global.h"
#define INLINE
#define INLINE
#define INLINE
#define INLINE
#define SEGGER_COUNTOF
#define SEGGER_MIN
#define SEGGER_MAX
#define SEGGER_USE_PARA
#define SEGGER_PRINTF_FLAG_ADJLEFT
#define SEGGER_PRINTF_FLAG_SIGNFORCE
#define SEGGER_PRINTF_FLAG_SIGNSPACE
#define SEGGER_PRINTF_FLAG_PRECEED
#define SEGGER_PRINTF_FLAG_ZEROPAD
#define SEGGER_PRINTF_FLAG_NEGATIVE
SEGGER_BUFFER_DESC
SEGGER_CACHE_CONFIG
SEGGER_SNPRINTF_CONTEXT_struct
SEGGER_SNPRINTF_CONTEXT_struct
SEGGER_PRINTF_API
SEGGER_pFormatter
SEGGER_PRINTF_FORMATTER
SEGGER_ARM_memcpy(void *, const void *, int);
SEGGER_memcpy(void *, const void *, int);
SEGGER_memxor(void *, const void *, unsigned int);
SEGGER_StoreChar(SEGGER_BUFFER_DESC *, char);
SEGGER_PrintUnsigned(SEGGER_BUFFER_DESC *, unsigned long, unsigned int, int);
SEGGER_PrintInt(SEGGER_BUFFER_DESC *, long, unsigned int, int);
SEGGER_vsnprintf(char *, int, const char *, va_list);
SEGGER_vsnprintfEx(SEGGER_SNPRINTF_CONTEXT *, const char *, va_list);
SEGGER_PRINTF_AddFormatter(SEGGER_PRINTF_FORMATTER *, SEGGER_pFormatter, char);
SEGGER_PRINTF_AddDoubleFormatter();
SEGGER_PRINTF_AddIPFormatter();
SEGGER_PRINTF_AddHTMLFormatter();
Files
loading...
CodeScopeSTM32 Libraries and SamplesSTemWininc/SEGGER.h
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/********************************************************************* * SEGGER Microcontroller GmbH & Co. KG * * Solutions for real time microcontroller applications * ********************************************************************** * * * (c) 1996 - 2017 SEGGER Microcontroller GmbH & Co. KG * * * * Internet: www.segger.com Support: support@segger.com * * * ********************************************************************** ** emWin V5.44 - Graphical user interface for embedded applications ** All Intellectual Property rights in the Software belongs to SEGGER. emWin is protected by international copyright laws. Knowledge of the source code may not be used to write a similar product. This file may only be used in accordance with the following terms: The software has been licensed to STMicroelectronics International N.V. a Dutch company with a Swiss branch and its headquarters in Plan- les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_ troller products commercialized by Licensee only, sublicensed and dis_ tributed under the terms and conditions of the End User License Agree_ ment supplied by STMicroelectronics International N.V. Full source code is available at: www.segger.com We appreciate your understanding and fairness. ---------------------------------------------------------------------- ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under Ultimate Liberty license SLA0044, * the "License"; You may not use this file except in compliance with the License. * You may obtain a copy of the License at: * http://www.st.com/SLA0044 * ****************************************************************************** ---------------------------------------------------------------------- File : SEGGER.h Purpose : Global types etc & general purpose utility functions Revision: $Rev: 6176 $ ---------------------------END-OF-HEADER------------------------------ *//* ... */ #ifndef SEGGER_H // Guard against multiple inclusion #define SEGGER_H #include <stdarg.h> #include "Global.h" // Type definitions: U8, U16, U32, I8, I16, I32 #if defined(__cplusplus) extern "C" { /* Make sure we have C-declarations in C++ programs */ #endif /********************************************************************* * * Keywords/specifiers * ********************************************************************** *//* ... */ #ifndef INLINE #ifdef _WIN32 // // Microsoft VC6 and newer. // Force inlining without cost checking. // #define INLINE __forceinline /* ... */ #else #if (defined(__GNUC__)) // // Force inlining with GCC // #define INLINE inline __attribute__((always_inline)) /* ... */ #elif (defined(__ICCARM__) || defined(__CC_ARM) || defined(__RX) || defined(__ICCRX__)) // // Other known compilers. // #define INLINE inline /* ... */ #else // // Unknown compilers. // #define INLINE /* ... */ #endif/* ... */ #endif/* ... */ #endif /********************************************************************* * * Function-like macros * ********************************************************************** *//* ... */ #define SEGGER_COUNTOF(a) (sizeof((a))/sizeof((a)[0])) #define SEGGER_MIN(a,b) (((a) < (b)) ? (a) : (b)) #define SEGGER_MAX(a,b) (((a) > (b)) ? (a) : (b)) #ifndef SEGGER_USE_PARA // Some compiler complain about unused parameters. #define SEGGER_USE_PARA(Para) (void)Para // This works for most compilers. #endif /********************************************************************* * * Defines * ********************************************************************** *//* ... */ #define SEGGER_PRINTF_FLAG_ADJLEFT (1 << 0) #define SEGGER_PRINTF_FLAG_SIGNFORCE (1 << 1) #define SEGGER_PRINTF_FLAG_SIGNSPACE (1 << 2) #define SEGGER_PRINTF_FLAG_PRECEED (1 << 3) #define SEGGER_PRINTF_FLAG_ZEROPAD (1 << 4) #define SEGGER_PRINTF_FLAG_NEGATIVE (1 << 5) 6 defines /********************************************************************* * * Types * ********************************************************************** *//* ... */ typedef struct { char* pBuffer; int BufferSize; int Cnt; ...} SEGGER_BUFFER_DESC; typedef struct { int CacheLineSize; // 0: No Cache. Most Systems such as ARM9 use a 32 bytes cache line size. void (*pfDMB) (void); // Optional DMB function for Data Memory Barrier to make sure all memory operations are completed. void (*pfClean) (void *p, unsigned NumBytes); // Optional clean function for cached memory. void (*pfInvalidate)(void *p, unsigned NumBytes); // Optional invalidate function for cached memory. ...} SEGGER_CACHE_CONFIG; typedef struct SEGGER_SNPRINTF_CONTEXT_struct SEGGER_SNPRINTF_CONTEXT; struct SEGGER_SNPRINTF_CONTEXT_struct { void* pContext; // Application specific context. SEGGER_BUFFER_DESC* pBufferDesc; // Buffer descriptor to use for output. void (*pfFlush)(SEGGER_SNPRINTF_CONTEXT *); // Callback executed once the buffer is full. Callback decides if the buffer gets cleared to store more or not. ...}; typedef struct { void (*pfStoreChar) (SEGGER_BUFFER_DESC* pBufferDesc, SEGGER_SNPRINTF_CONTEXT* pContext, char c); int (*pfPrintUnsigned) (SEGGER_BUFFER_DESC* pBufferDesc, SEGGER_SNPRINTF_CONTEXT* pContext, U32 v, unsigned Base, char Flags, int Width, int Precision); int (*pfPrintInt) (SEGGER_BUFFER_DESC* pBufferDesc, SEGGER_SNPRINTF_CONTEXT* pContext, I32 v, unsigned Base, char Flags, int Width, int Precision); ...} SEGGER_PRINTF_API; 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); typedef struct SEGGER_PRINTF_FORMATTER { struct SEGGER_PRINTF_FORMATTER* pNext; // Pointer to next formatter. SEGGER_pFormatter pfFormatter; // Formatter function. char Specifier; // Format specifier. ...} SEGGER_PRINTF_FORMATTER; /********************************************************************* * * Utility functions * ********************************************************************** *//* ... */ void SEGGER_ARM_memcpy(void* pDest, const void* pSrc, int NumBytes); void SEGGER_memcpy (void* pDest, const void* pSrc, int NumBytes); void SEGGER_memxor (void* pDest, const void* pSrc, unsigned NumBytes); void SEGGER_StoreChar (SEGGER_BUFFER_DESC* pBufferDesc, char c); void SEGGER_PrintUnsigned(SEGGER_BUFFER_DESC* pBufferDesc, U32 v, unsigned Base, int Precision); void SEGGER_PrintInt (SEGGER_BUFFER_DESC* pBufferDesc, I32 v, unsigned Base, int Precision); //int SEGGER_snprintf (char* pBuffer, int BufferSize, const char* sFormat, ...); int SEGGER_vsnprintf (char* pBuffer, int BufferSize, const char* sFormat, va_list ParamList); int SEGGER_vsnprintfEx (SEGGER_SNPRINTF_CONTEXT* pContext, const char* sFormat, va_list ParamList); int SEGGER_PRINTF_AddFormatter (SEGGER_PRINTF_FORMATTER* pFormatter, SEGGER_pFormatter pfFormatter, char c); void SEGGER_PRINTF_AddDoubleFormatter(void); void SEGGER_PRINTF_AddIPFormatter (void); void SEGGER_PRINTF_AddHTMLFormatter (void); #if defined(__cplusplus) }extern "C" { ... } /* Make sure we have C-declarations in C++ programs */ #endif /* ... */ #endif // Avoid multiple inclusion /*************************** End of file ****************************/