version 2.8
GFX

Detailed Description

Main module to glue all the others together.

Functions

void gfxInit (void)
 The one call to start it all. More...
 
void gfxDeinit (void)
 The one call to end it all. More...
 
void uGFXMain (void)
 The function containing all the user uGFX application code. More...
 

GFX sub-systems that can be turned on

#define GFX_USE_GDRIVER   TRUE
 GFX Driver API. More...
 
#define GFX_USE_GDISP   FALSE
 GFX Graphics Display Basic API. More...
 
#define GFX_USE_GWIN   FALSE
 GFX Graphics Windowing API. More...
 
#define GFX_USE_GEVENT   FALSE
 GFX Event API. More...
 
#define GFX_USE_GTIMER   FALSE
 GFX Timer API. More...
 
#define GFX_USE_GQUEUE   FALSE
 GFX Queue API. More...
 
#define GFX_USE_GINPUT   FALSE
 GFX Input Device API. More...
 
#define GFX_USE_GADC   FALSE
 GFX Generic Periodic ADC API. More...
 
#define GFX_USE_GAUDIO   FALSE
 GFX Audio API. More...
 
#define GFX_USE_GMISC   FALSE
 GFX Miscellaneous Routines API. More...
 
#define GFX_USE_GFILE   FALSE
 GFX File API. More...
 
#define GFX_USE_GTRANS   FALSE
 GFX Translation Support API. More...
 

GFX compilation options

#define GFX_NO_INLINE   FALSE
 Should various inline ugfx functions be non-inline. More...
 
#define GFX_SHOW_COMPILER   FALSE
 Show which compiler we detected as a compiler warning message. More...
 
#define GFX_COMPILER   GFX_COMPILER_UNKNOWN
 Enable compiler specific code. More...
 
#define GFX_COMPILER   GFX_COMPILER_UNKNOWN
 Enable compiler specific code. More...
 
#define GFX_COMPILER_UNKNOWN   0
 
#define GFX_COMPILER_ACC   1
 
#define GFX_COMPILER_ALTIUM   2
 
#define GFX_COMPILER_ALTIUMHW   3
 
#define GFX_COMPILER_AMSTERDAM   4
 
#define GFX_COMPILER_ARMCC   5
 
#define GFX_COMPILER_AZTEC   6
 
#define GFX_COMPILER_BORLAND   7
 
#define GFX_COMPILER_CC65   8
 
#define GFX_COMPILER_CLANG   9
 
#define GFX_COMPILER_COMEAU   10
 
#define GFX_COMPILER_COMPAQ   11
 
#define GFX_COMPILER_COMPCERT   12
 
#define GFX_COMPILER_CONVEX   13
 
#define GFX_COMPILER_CRAY   14
 
#define GFX_COMPILER_CYGWIN   15
 
#define GFX_COMPILER_DAIB   16
 
#define GFX_COMPILER_DEC   17
 
#define GFX_COMPILER_DICE   18
 
#define GFX_COMPILER_DIGNUS   19
 
#define GFX_COMPILER_DJGPP   20
 
#define GFX_COMPILER_DMARS   21
 
#define GFX_COMPILER_EDG   22
 
#define GFX_COMPILER_EKOPATH   23
 
#define GFX_COMPILER_FUJITSU   24
 
#define GFX_COMPILER_GCC   25
 
#define GFX_COMPILER_GREENHILL   26
 
#define GFX_COMPILER_HIGHC   27
 
#define GFX_COMPILER_HP   28
 
#define GFX_COMPILER_IAR   29
 
#define GFX_COMPILER_IBMXL   30
 
#define GFX_COMPILER_IMAGECRAFT   31
 
#define GFX_COMPILER_INTEL   32
 
#define GFX_COMPILER_KAI   33
 
#define GFX_COMPILER_KEIL   34
 
#define GFX_COMPILER_LCC   35
 
#define GFX_COMPILER_METROWORKS   36
 
#define GFX_COMPILER_MICROTEC   37
 
#define GFX_COMPILER_MICROWAY   38
 
#define GFX_COMPILER_MINGW32   39
 
#define GFX_COMPILER_MINGW64   40
 
#define GFX_COMPILER_MIPSPRO   41
 
#define GFX_COMPILER_MIRACLE   42
 
#define GFX_COMPILER_MPW   43
 
#define GFX_COMPILER_NORCROFT   44
 
#define GFX_COMPILER_NWCC   45
 
#define GFX_COMPILER_OPEN64   46
 
#define GFX_COMPILER_OSS   47
 
#define GFX_COMPILER_PACIFIC   48
 
#define GFX_COMPILER_PALM   49
 
#define GFX_COMPILER_PELLES   50
 
#define GFX_COMPILER_PGCC   51
 
#define GFX_COMPILER_RENESAS   52
 
#define GFX_COMPILER_SASC   53
 
#define GFX_COMPILER_SCO   54
 
#define GFX_COMPILER_SDCC   55
 
#define GFX_COMPILER_SN   56
 
#define GFX_COMPILER_STRATUS   57
 
#define GFX_COMPILER_SYMANTEC   58
 
#define GFX_COMPILER_TENDRA   59
 
#define GFX_COMPILER_THINK   60
 
#define GFX_COMPILER_TI   61
 
#define GFX_COMPILER_TINYC   62
 
#define GFX_COMPILER_TURBOC   63
 
#define GFX_COMPILER_ULTIMATE   64
 
#define GFX_COMPILER_USL   65
 
#define GFX_COMPILER_VBCC   66
 
#define GFX_COMPILER_VS   67
 
#define GFX_COMPILER_WATCOM   68
 
#define GFX_COMPILER_ZTC   69
 
#define GFX_CPU   GFX_CPU_UNKNOWN
 Enable CPU specific code. More...
 
#define GFX_CPU   GFX_CPU_UNKNOWN
 Enable CPU specific code. More...
 
#define GFX_CPU_ENDIAN   GFX_CPU_ENDIAN_UNKNOWN
 The endianness of the CPU. More...
 
#define GFX_CPU_ENDIAN   GFX_CPU_ENDIAN_UNKNOWN
 The endianness of the CPU. More...
 

Macros

#define FALSE   0
 Generic 'false' boolean constant. More...
 
#define TRUE   -1
 Generic 'true' boolean constant. More...
 
#define GFX_DISPLAY_RULE_WARNINGS   FALSE
 
#define GFX_COMPILER_NAME   "Unknown"
 The name of the compiler set or auto-detected. More...
 
#define GFX_COMPILER_VERSION_MAJOR   0
 This compiler is tested with ugfx. More...
 
#define GFX_COMPILER_VERSION_MINOR   0
 The minor version number of the compiler. More...
 
#define GFX_COMPILER_VERSION_PATCH   0
 The patch version number of the compiler. More...
 
#define GFX_COMPILER_VERSION_BUILD   0
 The build number of the compiler. More...
 
#define GFX_CPU_NO_ALIGNMENT_FAULTS   FALSE
 Does this CPU automatically handle alignment faults. More...
 
#define DEPRECATED(msg)
 Mark a function as deprecated. More...
 
#define GFXINLINE   inline
 Mark a function as inline. More...
 

Function Documentation

void gfxDeinit ( void  )

The one call to end it all.

Note
This will de-initialise each sub-system that has been turned on.
Function Class:
Normal API, this function can be invoked by regular system threads.

Definition at line 140 of file gfx.c.

References FALSE.

void gfxInit ( void  )

The one call to start it all.

Include the sub-system header files

Note
This will initialise each sub-system that has been turned on. For example, if GFX_USE_GDISP is defined then display will be initialised and cleared to black.
If you define GFX_OS_NO_INIT as TRUE in your gfxconf.h file then ugfx doesn't try to initialise the operating system for you when you call gfxInit().
If you define GFX_OS_EXTRA_INIT_FUNCTION in your gfxconf.h file the macro is the name of a void function with no parameters that is called immediately after operating system initialisation (whether or not GFX_OS_NO_INIT is set).
If you define GFX_OS_EXTRA_DEINIT_FUNCTION in your gfxconf.h file the macro is the name of a void function with no parameters that is called immediately before operating system de-initialisation (as ugfx is exiting).
If GFX_OS_CALL_UGFXMAIN is set uGFXMain() is called after all initialisation is complete.
Function Class:
Normal API, this function can be invoked by regular system threads.

Definition at line 82 of file gfx.c.

References TRUE, and uGFXMain().

void uGFXMain ( void  )

The function containing all the user uGFX application code.

Note
This is called by gfxInit() and is expected to never return. It is defined by the user.
Precondition
GFX_OS_CALL_UGFXMAIN is GFXON

Referenced by gfxInit().

Macro Definition Documentation

#define DEPRECATED (   msg)

Mark a function as deprecated.

Definition at line 1141 of file gfx_compilers.h.

#define FALSE   0

Generic 'false' boolean constant.

These two definitions below are required before anything else so that we can turn module definitions off and on.

Definition at line 31 of file gfx.h.

Referenced by geventAttachSource(), gfxDeinit(), ginputGetToggleStatus(), gtimerIsActive(), and gwinCheckboxIsChecked().

#define GFX_COMPILER   GFX_COMPILER_UNKNOWN

Enable compiler specific code.

Auto detected by default but it can be overridden in gfxconf.h

Note
This is setting enables optimisations and code options that are compiler specific.
If the compiler can't be auto-detected it is set to GFX_COMPILER_UNKNOWN

Definition at line 279 of file gfx_compilers.h.

#define GFX_COMPILER   GFX_COMPILER_UNKNOWN

Enable compiler specific code.

Auto detected by default but it can be overridden in gfxconf.h

Note
This is setting enables optimisations and code options that are compiler specific.
If the compiler can't be auto-detected it is set to GFX_COMPILER_UNKNOWN

Definition at line 279 of file gfx_compilers.h.

#define GFX_COMPILER_NAME   "Unknown"

The name of the compiler set or auto-detected.

Read-Only

Note
If you successfully compile ugfx with an unknown compiler please report back to us via the ugfx forum so that we can add it to our list of compilers to detect.

Definition at line 951 of file gfx_compilers.h.

#define GFX_COMPILER_VERSION_BUILD   0

The build number of the compiler.

Read-Only. It will be set to 0 if it can't be automatically detected.

Note
If you know how to detect a version number for a compiler and we haven't, please report this on the ugfx forum.

Definition at line 1012 of file gfx_compilers.h.

#define GFX_COMPILER_VERSION_MAJOR   0

This compiler is tested with ugfx.

Read-Only

Note
If you successfully compile ugfx with an un-tested compiler please report back to us via the ugfx forum any compile errors or warnings so that we can add it to our list of tested compilers.
Although the compiler being used may be tested, it may have been tested with a different compiler version. Please report any problems on the ugfx forum. The major version number of the compiler

Read-Only. It will be set to 0 if it can't be automatically detected.

Note
If you know how to detect a version number for a compiler and we haven't, please report this on the ugfx forum.

Definition at line 985 of file gfx_compilers.h.

#define GFX_COMPILER_VERSION_MINOR   0

The minor version number of the compiler.

Read-Only. It will be set to 0 if it can't be automatically detected.

Note
If you know how to detect a version number for a compiler and we haven't, please report this on the ugfx forum.

Definition at line 994 of file gfx_compilers.h.

#define GFX_COMPILER_VERSION_PATCH   0

The patch version number of the compiler.

Read-Only. It will be set to 0 if it can't be automatically detected.

Note
If you know how to detect a version number for a compiler and we haven't, please report this on the ugfx forum.

Definition at line 1003 of file gfx_compilers.h.

#define GFX_CPU   GFX_CPU_UNKNOWN

Enable CPU specific code.

Auto detected by default but it can be overridden in gfxconf.h

Note
This is setting enables optimisations and code options that are CPU specific.
If the CPU can't be auto-detected it is set to GFX_CPU_UNKNOWN
Auto-detection is particularly weak currently particularly for ARM and other non-Intel platforms. This doesn't normally matter very much as everything is handled with more conservative code. Where you might want to add a manual CPU define is for operating systems such as RAW32 that use the generic ugfx thread code rather than operating system defined threading routines. For these platforms specifying the CPU can make a decent performance improvement.

Definition at line 1066 of file gfx_compilers.h.

#define GFX_CPU   GFX_CPU_UNKNOWN

Enable CPU specific code.

Auto detected by default but it can be overridden in gfxconf.h

Note
This is setting enables optimisations and code options that are CPU specific.
If the CPU can't be auto-detected it is set to GFX_CPU_UNKNOWN
Auto-detection is particularly weak currently particularly for ARM and other non-Intel platforms. This doesn't normally matter very much as everything is handled with more conservative code. Where you might want to add a manual CPU define is for operating systems such as RAW32 that use the generic ugfx thread code rather than operating system defined threading routines. For these platforms specifying the CPU can make a decent performance improvement.

Definition at line 1066 of file gfx_compilers.h.

#define GFX_CPU_ENDIAN   GFX_CPU_ENDIAN_UNKNOWN

The endianness of the CPU.

Auto detected by default but it can be overridden in gfxconf.h

Note
This is setting enables optimisations that are cpu endian specific.
If the endianness can't be auto-detected it is set to GFX_CPU_ENDIAN_UNKNOWN and safe (but potentially slow) code is generated

Definition at line 1132 of file gfx_compilers.h.

#define GFX_CPU_ENDIAN   GFX_CPU_ENDIAN_UNKNOWN

The endianness of the CPU.

Auto detected by default but it can be overridden in gfxconf.h

Note
This is setting enables optimisations that are cpu endian specific.
If the endianness can't be auto-detected it is set to GFX_CPU_ENDIAN_UNKNOWN and safe (but potentially slow) code is generated

Definition at line 1132 of file gfx_compilers.h.

#define GFX_CPU_NO_ALIGNMENT_FAULTS   FALSE

Does this CPU automatically handle alignment faults.

Defaults to FALSE

Note
Setting this to TRUE can decrease code size and increase speed but it should not be turned on with a CPU that can generate alignment segfaults.
If you are unsure leave this as FALSE as that generates the more conservative code.
For some CPU's this can be auto-detected.

Definition at line 1094 of file gfx_compilers.h.

#define GFX_DISPLAY_RULE_WARNINGS   FALSE

Get all the options for each sub-system. Interdependency safety checks on the sub-systems. These must be in dependency order.

Definition at line 187 of file gfx.h.

#define GFX_NO_INLINE   FALSE

Should various inline ugfx functions be non-inline.

Defaults to FALSE

Note
Generally there is no need to set this to TRUE as it will have huge performance impacts in the driver level.

Definition at line 33 of file gfx_compilers.h.

#define GFX_SHOW_COMPILER   FALSE

Show which compiler we detected as a compiler warning message.

Definition at line 45 of file gfx_compilers.h.

#define GFX_USE_GADC   FALSE

GFX Generic Periodic ADC API.

Defaults to FALSE

Definition at line 125 of file gfx.h.

#define GFX_USE_GAUDIO   FALSE

GFX Audio API.

Defaults to FALSE

Note
Also add the specific hardware drivers to your makefile. Eg. include /drivers/gaudio/GADC/driver.mk

Definition at line 135 of file gfx.h.

#define GFX_USE_GDISP   FALSE

GFX Graphics Display Basic API.

Defaults to FALSE

Note
Also add the specific hardware driver to your makefile. Eg. include /drivers/gdisp/Nokia6610/driver.mk

Definition at line 72 of file gfx.h.

#define GFX_USE_GDRIVER   TRUE

GFX Driver API.

Defaults to TRUE

Note
Not much useful can be done without a driver

Definition at line 63 of file gfx.h.

#define GFX_USE_GEVENT   FALSE

GFX Event API.

Defaults to FALSE

Defines the concept of a "Source" that can send "Events" to "Listeners".

Definition at line 90 of file gfx.h.

#define GFX_USE_GFILE   FALSE

GFX File API.

Defaults to FALSE

Definition at line 152 of file gfx.h.

#define GFX_USE_GINPUT   FALSE

GFX Input Device API.

Defaults to FALSE

Note
Also add the specific hardware drivers to your makefile. Eg. include /drivers/ginput/toggle/Pal/driver.mk and... include /drivers/ginput/touch/MCU/driver.mk

Definition at line 118 of file gfx.h.

#define GFX_USE_GMISC   FALSE

GFX Miscellaneous Routines API.

Defaults to FALSE

Note
Turning this on without turning on any GMISC_NEED_xxx macros will result in no extra code being compiled in. GMISC is made up from the sum of its parts.

Definition at line 145 of file gfx.h.

#define GFX_USE_GQUEUE   FALSE

GFX Queue API.

Defaults to FALSE

Provides queue management.

Definition at line 106 of file gfx.h.

#define GFX_USE_GTIMER   FALSE

GFX Timer API.

Defaults to FALSE

Provides thread context timers - both one-shot and periodic.

Definition at line 98 of file gfx.h.

#define GFX_USE_GTRANS   FALSE

GFX Translation Support API.

Defaults to FALSE

Definition at line 159 of file gfx.h.

#define GFX_USE_GWIN   FALSE

GFX Graphics Windowing API.

Defaults to FALSE

Extends the GDISP API to add the concept of graphic windows.

Note
Also supports high-level "window" objects such as console windows, buttons, graphing etc

Definition at line 82 of file gfx.h.

#define GFXINLINE   inline

Mark a function as inline.

Definition at line 1148 of file gfx_compilers.h.