µGFX  2.9
version 2.9
GFX

Detailed Description

Main module to glue all the others together.

Functions

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

GFX compatibility options

#define GFX_COMPAT_V2   GFXON
 Include the uGFX V2.x API. More...
 

GFX compilation options

#define GFX_NO_INLINE   GFXOFF
 Should various inline ugfx functions be non-inline. More...
 
#define GFX_SHOW_COMPILER   GFXOFF
 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...
 

GFX sub-systems that can be turned on

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

GFX compatibility options

#define GFX_COMPAT_OLDCOLORS   GFXON
 Include the uGFX V2.x Old Colors. More...
 

Macros

#define GFX_COMPILESTAGE   GFX_COMPILESTAGE_PREP
 
#define GFX_COMPILESTAGE   GFX_COMPILESTAGE_USERCONFIG
 
#define GFX_COMPILESTAGE   GFX_COMPILESTAGE_COMPILECONFIG
 
#define GFX_COMPILESTAGE   GFX_COMPILESTAGE_OPTIONS
 
#define GFX_COMPILESTAGE   GFX_COMPILESTAGE_RULES
 
#define GFX_COMPILESTAGE   GFX_COMPILESTAGE_APIDEFS
 
#define GFX_COMPILESTAGE   GFX_COMPILESTAGE_USERPROGRAM
 
#define GFX_DISPLAY_RULE_WARNINGS   GFXOFF
 
#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   GFXOFF
 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

◆ gfxDeinit()

void GFXAPI 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.

◆ gfxInit()

void GFXAPI 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 GFXON 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.

◆ uGFXMain()

void GFXUSERFN uGFXMain ( void  )

The user supplied 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

Macro Definition Documentation

◆ DEPRECATED

#define DEPRECATED (   msg)

Mark a function as deprecated.

Definition at line 1141 of file gfx_compilers.h.

◆ GFX_COMPAT_OLDCOLORS

#define GFX_COMPAT_OLDCOLORS   GFXON

Include the uGFX V2.x Old Colors.

Defaults to GFXON

Precondition
Requires GFX_COMPAT_V2 to be GFXON
Note
The old color definitions (particularly Red, Green & Blue) can cause symbol conflicts with many platforms eg Win32, STM32 HAL etc. Although officially these symbols are part of the V2.x API, this option allows them to be turned off even when the rest of the V2.x API is turned on.

Definition at line 141 of file gfx_options.h.

◆ GFX_COMPAT_V2

#define GFX_COMPAT_V2   GFXON

Include the uGFX V2.x API.

Defaults to GFXON

Definition at line 67 of file src/gfx.h.

◆ GFX_COMPILER [1/2]

#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.

◆ GFX_COMPILER [2/2]

#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.

◆ GFX_COMPILER_NAME

#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.

◆ GFX_COMPILER_VERSION_BUILD

#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.

◆ GFX_COMPILER_VERSION_MAJOR

#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.

◆ GFX_COMPILER_VERSION_MINOR

#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.

◆ GFX_COMPILER_VERSION_PATCH

#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.

◆ GFX_COMPILESTAGE [1/7]

#define GFX_COMPILESTAGE   GFX_COMPILESTAGE_PREP

Get all the options for each sub-system.

Definition at line 226 of file src/gfx.h.

◆ GFX_COMPILESTAGE [2/7]

#define GFX_COMPILESTAGE   GFX_COMPILESTAGE_USERCONFIG

Get all the options for each sub-system.

Definition at line 226 of file src/gfx.h.

◆ GFX_COMPILESTAGE [3/7]

#define GFX_COMPILESTAGE   GFX_COMPILESTAGE_COMPILECONFIG

Get all the options for each sub-system.

Definition at line 226 of file src/gfx.h.

◆ GFX_COMPILESTAGE [4/7]

#define GFX_COMPILESTAGE   GFX_COMPILESTAGE_OPTIONS

Get all the options for each sub-system.

Definition at line 226 of file src/gfx.h.

◆ GFX_COMPILESTAGE [5/7]

#define GFX_COMPILESTAGE   GFX_COMPILESTAGE_RULES

Get all the options for each sub-system.

Definition at line 226 of file src/gfx.h.

◆ GFX_COMPILESTAGE [6/7]

#define GFX_COMPILESTAGE   GFX_COMPILESTAGE_APIDEFS

Get all the options for each sub-system.

Definition at line 226 of file src/gfx.h.

◆ GFX_COMPILESTAGE [7/7]

#define GFX_COMPILESTAGE   GFX_COMPILESTAGE_USERPROGRAM

Get all the options for each sub-system.

Definition at line 226 of file src/gfx.h.

◆ GFX_CPU [1/2]

#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.

◆ GFX_CPU [2/2]

#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.

◆ GFX_CPU_ENDIAN [1/2]

#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.

◆ GFX_CPU_ENDIAN [2/2]

#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.

◆ GFX_CPU_NO_ALIGNMENT_FAULTS

#define GFX_CPU_NO_ALIGNMENT_FAULTS   GFXOFF

Does this CPU automatically handle alignment faults.

Defaults to GFXOFF

Note
Setting this to GFXON 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 GFXOFF 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.

◆ GFX_DISPLAY_RULE_WARNINGS

#define GFX_DISPLAY_RULE_WARNINGS   GFXOFF

Interdependency safety checks on the sub-systems. These must be in dependency order.

Definition at line 144 of file src/gfx.h.

◆ GFX_NO_INLINE

#define GFX_NO_INLINE   GFXOFF

Should various inline ugfx functions be non-inline.

Defaults to GFXOFF

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

Definition at line 33 of file gfx_compilers.h.

◆ GFX_SHOW_COMPILER

#define GFX_SHOW_COMPILER   GFXOFF

Show which compiler we detected as a compiler warning message.

Definition at line 45 of file gfx_compilers.h.

◆ GFX_USE_GADC

#define GFX_USE_GADC   GFXOFF

GFX Generic Periodic ADC API.

Defaults to GFXOFF

Definition at line 88 of file gfx_options.h.

◆ GFX_USE_GAUDIO

#define GFX_USE_GAUDIO   GFXOFF

GFX Audio API.

Defaults to GFXOFF

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

Definition at line 98 of file gfx_options.h.

◆ GFX_USE_GDISP

#define GFX_USE_GDISP   GFXOFF

GFX Graphics Display Basic API.

Defaults to GFXOFF

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

Definition at line 35 of file gfx_options.h.

◆ GFX_USE_GDRIVER

#define GFX_USE_GDRIVER   GFXON

GFX Driver API.

Defaults to GFXON

Note
Not much useful can be done without a driver

Definition at line 26 of file gfx_options.h.

◆ GFX_USE_GEVENT

#define GFX_USE_GEVENT   GFXOFF

GFX Event API.

Defaults to GFXOFF

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

Definition at line 53 of file gfx_options.h.

◆ GFX_USE_GFILE

#define GFX_USE_GFILE   GFXOFF

GFX File API.

Defaults to GFXOFF

Definition at line 115 of file gfx_options.h.

◆ GFX_USE_GINPUT

#define GFX_USE_GINPUT   GFXOFF

GFX Input Device API.

Defaults to GFXOFF

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 81 of file gfx_options.h.

◆ GFX_USE_GMISC

#define GFX_USE_GMISC   GFXOFF

GFX Miscellaneous Routines API.

Defaults to GFXOFF

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 108 of file gfx_options.h.

◆ GFX_USE_GQUEUE

#define GFX_USE_GQUEUE   GFXOFF

GFX Queue API.

Defaults to GFXOFF

Provides queue management.

Definition at line 69 of file gfx_options.h.

◆ GFX_USE_GTIMER

#define GFX_USE_GTIMER   GFXOFF

GFX Timer API.

Defaults to GFXOFF

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

Definition at line 61 of file gfx_options.h.

◆ GFX_USE_GTRANS

#define GFX_USE_GTRANS   GFXOFF

GFX Translation Support API.

Defaults to GFXOFF

Definition at line 122 of file gfx_options.h.

◆ GFX_USE_GWIN

#define GFX_USE_GWIN   GFXOFF

GFX Graphics Windowing API.

Defaults to GFXOFF

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 45 of file gfx_options.h.

◆ GFXINLINE

#define GFXINLINE   inline

Mark a function as inline.

Definition at line 1148 of file gfx_compilers.h.