Difference between revisions of "GOS"
(→Existing ports) |
|||
Line 1: | Line 1: | ||
GOS is the module which builds the abstraction layer between µGFX and the underlying system. The underlying system can be an RTOS such as [http://chibios.org ChibiOS] or [http://freertos.org FreeRTOS], or also just a stand-alone library like the [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743?icmp=ss1743_pron_pr1_jun2014&sc=stm32cube-pr5 STDperiph library] from STmicroelectronics. The GOS module allows to write completely platform independent application code. | GOS is the module which builds the abstraction layer between µGFX and the underlying system. The underlying system can be an RTOS such as [http://chibios.org ChibiOS] or [http://freertos.org FreeRTOS], or also just a stand-alone library like the [http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743?icmp=ss1743_pron_pr1_jun2014&sc=stm32cube-pr5 STDperiph library] from STmicroelectronics. The GOS module allows to write completely platform independent application code. | ||
+ | |||
+ | == API reference == | ||
+ | The API reference of the GOS module can be found [http://ugfx.org/images/resources/doxygen/master/group___g_o_s.html here]. | ||
== Existing ports == | == Existing ports == |
Revision as of 01:15, 3 July 2014
GOS is the module which builds the abstraction layer between µGFX and the underlying system. The underlying system can be an RTOS such as ChibiOS or FreeRTOS, or also just a stand-alone library like the STDperiph library from STmicroelectronics. The GOS module allows to write completely platform independent application code.
Contents
API reference
The API reference of the GOS module can be found here.
Existing ports
The following ports already exist and are part of the official repository:
- ChibiOS/RT
- FreeRTOS
- BareMetal (no OS at all)
- Linux
- Mac OS X
- Window
BareMetal
It's possible to run µGFX directly on a bare-metal system like the stdperipheral library for the STM controller without any underlying OS. Start with the RAW32 implementation. This supports a simple non-preemptive scheduler. You still need to provide some basic routines such as a routine to get the system tick count.
Porting
Porting uGFX to a new underlying system is fairly easy. Only a couple of functions and data types have to be implemented and declared.
Functions
ToDo
void gfxHalt(const char *msg); void gfxExit(void); void* gfxAlloc(size_t sz); void* gfxRealloc(void *p, size_t oldsz, size_t newsz); void gfxFree(void *ptr); void gfxYield(void); void gfxSleepMilliseconds(delaytime_t ms); void gfxSleepMicroseconds(delaytime_t ms); systemticks_t gfxSystemTicks(void); systemticks_t gfxMillisecondsToTicks(delaytime_t ms); void gfxSystemLock(void); void gfxSystemUnlock(void); void gfxMutexInit(gfxMutex *pmutex); void gfxMutexDestroy(gfxMutex *pmutex); void gfxMutexEnter(gfxMutex *pmutex); void gfxMutexExit(gfxMutex *pmutex); void gfxSemInit(gfxSem *psem, semcount_t val, semcount_t limit); void gfxSemDestroy(gfxSem *psem); bool_t gfxSemWait(gfxSem *psem, delaytime_t ms); void gfxSemSignal(gfxSem *psem); void gfxSemSignalI(gfxSem *psem); semcount_t gfxSemCounter(gfxSem *pSem); semcount_t gfxSemCounterI(gfxSem *pSem); gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, threadpriority_t prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param); threadreturn_t gfxThreadWait(gfxThreadHandle thread); gfxThreadHandle gfxThreadMe(void) void gfxThreadClose(gfxThreadHandle thread);
Data types
ToDo
Examples
When creating a new port, taking a look at existing ones can help a lot. The existing ports can be found under /src/gos/'