version 2.8
gos_options.h
Go to the documentation of this file.
1 /*
2  * This file is subject to the terms of the GFX License. If a copy of
3  * the license was not distributed with this file, you can obtain one at:
4  *
5  * http://ugfx.org/license.html
6  */
7 
8 /**
9  * @file src/gos/gos_options.h
10  * @brief GOS - Operating System options header file.
11  *
12  * @addtogroup GOS
13  * @{
14  */
15 
16 #ifndef _GOS_OPTIONS_H
17 #define _GOS_OPTIONS_H
18 
19 /**
20  * @name The operating system to use. One (and only one) of these must be defined.
21  * @{
22  */
23  /**
24  * @brief Use ChibiOS
25  * @details Defaults to FALSE
26  */
27  #ifndef GFX_USE_OS_CHIBIOS
28  #define GFX_USE_OS_CHIBIOS FALSE
29  #endif
30  /**
31  * @brief Use FreeRTOS
32  * @details Defaults to FALSE
33  */
34  #ifndef GFX_USE_OS_FREERTOS
35  #define GFX_USE_OS_FREERTOS FALSE
36  #endif
37  /**
38  * @brief Use Win32
39  * @details Defaults to FALSE
40  */
41  #ifndef GFX_USE_OS_WIN32
42  #define GFX_USE_OS_WIN32 FALSE
43  #endif
44  /**
45  * @brief Use a linux based system running X11
46  * @details Defaults to FALSE
47  */
48  #ifndef GFX_USE_OS_LINUX
49  #define GFX_USE_OS_LINUX FALSE
50  #endif
51  /**
52  * @brief Use a Mac OS-X based system
53  * @details Defaults to FALSE
54  */
55  #ifndef GFX_USE_OS_OSX
56  #define GFX_USE_OS_OSX FALSE
57  #endif
58  /**
59  * @brief Use a Raw 32-bit CPU based system (Bare Metal)
60  * @details Defaults to FALSE
61  */
62  #ifndef GFX_USE_OS_RAW32
63  #define GFX_USE_OS_RAW32 FALSE
64  #endif
65  /**
66  * @brief Use a eCos
67  * @details Defaults to FALSE
68  */
69  #ifndef GFX_USE_OS_ECOS
70  #define GFX_USE_OS_ECOS FALSE
71  #endif
72  /**
73  * @brief Use RAWRTOS
74  * @details Defaults to FALSE
75  */
76  #ifndef GFX_USE_OS_RAWRTOS
77  #define GFX_USE_OS_RAWRTOS FALSE
78  #endif
79  /**
80  * @brief Use Arduino
81  * @details Defaults to FALSE
82  */
83  #ifndef GFX_USE_OS_ARDUINO
84  #define GFX_USE_OS_ARDUINO FALSE
85  #endif
86  /**
87  * @brief Use CMSIS RTOS compatible OS
88  * @details Defaults to FALSE
89  */
90  #ifndef GFX_USE_OS_CMSIS
91  #define GFX_USE_OS_CMSIS FALSE
92  #endif
93  /**
94  * @brief Use CMSIS2 RTOS compatible OS
95  * @details Defaults to FALSE
96  */
97  #ifndef GFX_USE_OS_CMSIS2
98  #define GFX_USE_OS_CMSIS2 FALSE
99  #endif
100  /**
101  * @brief Use Keil CMSIS 1.x (RTOS, RTX4)
102  * @details Defaults to FALSE
103  */
104  #ifndef GFX_USE_OS_KEIL
105  #define GFX_USE_OS_KEIL FALSE
106  #endif
107  /**
108  * @brief Use Keil RTX5
109  * @details Defaults to FALSE
110  */
111  #ifndef GFX_USE_OS_RTX5
112  #define GFX_USE_OS_RTX5 FALSE
113  #endif
114  /**
115  * @brief Use NIOS-II
116  * @details Defaults to FALSE
117  */
118  #ifndef GFX_USE_OS_NIOS
119  #define GFX_USE_OS_NIOS FALSE
120  #endif
121  /**
122  * @brief Use Zephyr
123  * @details Defaults to FALSE
124  */
125  #ifndef GFX_USE_OS_ZEPHYR
126  #define GFX_USE_OS_ZEPHYR FALSE
127  #endif
128  /**
129  * @brief Use Qt
130  * @details Defaults to FALSE
131  */
132  #ifndef GFX_USE_OS_QT
133  #define GFX_USE_OS_QT FALSE
134  #endif
135 /**
136  * @}
137  *
138  * @name GOS Optional Parameters
139  * @{
140  */
141  /**
142  * @name GFX_OS_PRE_INIT_FUNCTION
143  * @brief A macro that defines a function that uGFX calls as part of gfxInit() in order to initialize hardware
144  * @details Defaults to undefined
145  * @note If defined the specified function is called before any other initialization.
146  * It is typically used to initialize hardware or the C runtime.
147  * @note Eg. In your source:
148  * void myHardwareInitRoutine(void);
149  * In gfxconf.h:
150  * #define GFX_OS_PRE_INIT_FUNCTION myHardwareInitRoutine
151  */
152  //#define GFX_OS_PRE_INIT_FUNCTION myHardwareInitRoutine
153  /**
154  * @name GFX_OS_EXTRA_INIT_FUNCTION
155  * @brief A macro that defines a function that uGFX calls as part of gfxInit() just after initializing
156  * the operating system.
157  * @details Defaults to undefined
158  * @note If defined the specified function is called just after the operating system is initialized by
159  * gfxInit(). Note that if gfxInit() is set up to not initialize an operating system it is called after
160  * the GFX_OS_PRE_INIT_FUNCTION function (if any).
161  * @note Eg. In your source:
162  * void myOSInitRoutine(void);
163  * In gfxconf.h:
164  * #define GFX_OS_EXTRA_INIT_FUNCTION myOSInitRoutine
165  */
166  //#define GFX_OS_EXTRA_INIT_FUNCTION myOSInitRoutine
167  /**
168  * @name GFX_OS_EXTRA_DEINIT_FUNCTION
169  * @brief A macro that defines a function that uGFX calls as part of gfxDeInit() just before de-initializing
170  * the operating system.
171  * @details Defaults to undefined
172  * @note If defined the specified function is called just before the operating system is de-initialized by
173  * gfxDeInit().
174  * @note Eg. In your source:
175  * void myOSDeInitRoutine(void);
176  * In gfxconf.h:
177  * #define GFX_OS_EXTRA_DEINIT_FUNCTION myOSDeInitRoutine
178  */
179  //#define GFX_OS_EXTRA_DEINIT_FUNCTION myOSDeInitRoutine
180  /**
181  * @brief Should uGFX avoid initializing the operating system
182  * @details Defaults to FALSE
183  * @note This is not relevant to all operating systems eg Win32 never initializes the
184  * operating system as uGFX runs as an application outside the boot process.
185  * @note Operating system initialization is not necessarily implemented for all
186  * operating systems yet even when it is relevant. These operating systems
187  * will display a compile warning reminding you to initialize the operating
188  * system in your application code. Note that on these operating systems the
189  * demo applications will not work without modification.
190  */
191  #ifndef GFX_OS_NO_INIT
192  #define GFX_OS_NO_INIT FALSE
193  #endif
194  /**
195  * @brief Turn off warnings about initializing the operating system
196  * @details Defaults to FALSE
197  * @note This is only relevant where GOS cannot initialize the operating
198  * system automatically or the operating system initialization has been
199  * explicitly turned off.
200  */
201  #ifndef GFX_OS_INIT_NO_WARNING
202  #define GFX_OS_INIT_NO_WARNING FALSE
203  #endif
204  /**
205  * @brief Call uGFXMain() after all initialisation
206  * @details Defaults to FALSE
207  * @note uGFXMain() is a function defined by the user in their project
208  * that contains the application main code. This is not expected to return
209  * and thus gfxInit() will also never return. This is required for some
210  * operating systems whose main thread never returns after starting the
211  * scheduler.<br>
212  * Its prototype is:<br>
213  * void uGFXMain(void);<br>
214  */
215  #ifndef GFX_OS_CALL_UGFXMAIN
216  #define GFX_OS_CALL_UGFXMAIN FALSE
217  #endif
218  /**
219  * @brief When uGFXMain() is started as a thread, what stack size should be used
220  * @details Defaults to 0
221  * @note uGFXMain() contains the application main code. Some operating systems
222  * will start this as a thread. eg FreeRTOS. When it is started as a thread
223  * this defines how many bytes should be used for the thread stack.
224  * @note 0 means to use the operating systems default stack size.
225  */
226  #ifndef GFX_OS_UGFXMAIN_STACKSIZE
227  #define GFX_OS_UGFXMAIN_STACKSIZE 0
228  #endif
229  /**
230  * @brief Should uGFX stuff be added to the FreeRTOS+Tracer
231  * @details Defaults to FALSE
232  */
233  #ifndef GFX_FREERTOS_USE_TRACE
234  #define GFX_FREERTOS_USE_TRACE FALSE
235  #endif
236  /**
237  * @brief How much RAM should uGFX use for the heap when using its own internal heap allocator
238  * @details Defaults to 0.
239  * @note Only used when the internal ugfx heap allocator is used
240  * (GFX_USE_OS_RAW32, GFX_USE_OS_ARDUINO, GFX_US_OS_KEIL, GFX_USE_OS_CMSIS)
241  * @note If 0 then the standard C runtime malloc(), free() and realloc()
242  * are used.
243  * @note If it is non-zero then this is the number of bytes of RAM
244  * to use for the heap (gfxAlloc() and gfxFree()). No C
245  * runtime routines will be used and a new routine @p gfxAddHeapBlock()
246  * is added allowing the user to add extra memory blocks to the heap.
247  */
248  #ifndef GFX_OS_HEAP_SIZE
249  #define GFX_OS_HEAP_SIZE 0
250  #endif
251  /**
252  * @brief Enable wrappers for malloc() and free()
253  * @details Defaults to FALSE
254  * @note If enabled, malloc() and free() will be implemented as wrappers that call gfxAlloc() and
255  * gfxFree() in order to provide portability to libraries using these function.
256  * @note Enabling this can solve 'unresolved _sbrk' issues
257  * @note It is strongly recommended to always use gfxAlloc() and gfxFree() directy to ensure
258  * portability of uGFX applications across all platforms.
259  */
260  #ifndef GFX_EMULATE_MALLOC
261  #define GFX_EMULATE_MALLOC FALSE
262  #endif
263 /** @} */
264 
265 #endif /* _GOS_OPTIONS_H */
266 /** @} */