2013-05-01 23:53:28 +00:00
|
|
|
/*
|
2013-06-15 11:37:22 +00:00
|
|
|
* This file is subject to the terms of the GFX License. If a copy of
|
2013-05-03 14:36:17 +00:00
|
|
|
* the license was not distributed with this file, you can obtain one at:
|
|
|
|
*
|
2013-07-21 20:20:37 +00:00
|
|
|
* http://ugfx.org/license.html
|
2013-05-03 14:36:17 +00:00
|
|
|
*/
|
2013-02-28 23:04:52 +00:00
|
|
|
|
|
|
|
/**
|
2014-02-18 14:36:52 +00:00
|
|
|
* @file gfx.h
|
2013-02-28 23:04:52 +00:00
|
|
|
* @brief GFX system header file.
|
|
|
|
*
|
|
|
|
* @addtogroup GFX
|
2013-07-21 20:02:57 +00:00
|
|
|
*
|
|
|
|
* @brief Main module to glue all the others together
|
|
|
|
*
|
2013-02-28 23:04:52 +00:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _GFX_H
|
|
|
|
#define _GFX_H
|
|
|
|
|
2013-05-24 15:26:52 +00:00
|
|
|
/**
|
|
|
|
* These two definitions below are required before anything else so that we can
|
|
|
|
* turn module definitions off and on.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Generic 'false' boolean constant.
|
|
|
|
*/
|
|
|
|
#if !defined(FALSE) || defined(__DOXYGEN__)
|
|
|
|
#define FALSE 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Generic 'true' boolean constant.
|
|
|
|
*/
|
|
|
|
#if !defined(TRUE) || defined(__DOXYGEN__)
|
2015-11-08 14:44:29 +00:00
|
|
|
#define TRUE -1
|
2013-05-24 15:26:52 +00:00
|
|
|
#endif
|
|
|
|
|
2017-06-30 09:43:51 +00:00
|
|
|
// Macro concatination and strify - not API documented
|
|
|
|
#define GFXCATX(a, b) GFXCAT(a, b)
|
|
|
|
#define GFXCAT(a, b) a ## b
|
|
|
|
#define GFXSTRX(a) GFXSTR(a)
|
|
|
|
#define GFXSTR(a) #a
|
|
|
|
|
2015-10-23 08:24:49 +00:00
|
|
|
/* gfxconf.h is the user's project configuration for the GFX system. */
|
|
|
|
#include "gfxconf.h"
|
|
|
|
|
2015-11-19 07:07:49 +00:00
|
|
|
/* Include Compiler and CPU support */
|
|
|
|
#include "src/gfx_compilers.h"
|
|
|
|
|
2013-02-28 23:04:52 +00:00
|
|
|
/**
|
|
|
|
* @name GFX sub-systems that can be turned on
|
|
|
|
* @{
|
|
|
|
*/
|
2014-08-23 07:55:42 +00:00
|
|
|
/**
|
|
|
|
* @brief GFX Driver API
|
|
|
|
* @details Defaults to TRUE
|
|
|
|
* @note Not much useful can be done without a driver
|
|
|
|
*/
|
|
|
|
#ifndef GFX_USE_GDRIVER
|
|
|
|
#define GFX_USE_GDRIVER TRUE
|
|
|
|
#endif
|
2013-02-28 23:04:52 +00:00
|
|
|
/**
|
|
|
|
* @brief GFX Graphics Display Basic API
|
|
|
|
* @details Defaults to FALSE
|
|
|
|
* @note Also add the specific hardware driver to your makefile.
|
2014-03-11 07:13:31 +00:00
|
|
|
* Eg. include $(GFXLIB)/drivers/gdisp/Nokia6610/driver.mk
|
2013-02-28 23:04:52 +00:00
|
|
|
*/
|
|
|
|
#ifndef GFX_USE_GDISP
|
|
|
|
#define GFX_USE_GDISP FALSE
|
|
|
|
#endif
|
|
|
|
/**
|
|
|
|
* @brief GFX Graphics Windowing API
|
|
|
|
* @details Defaults to FALSE
|
|
|
|
* @details 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
|
|
|
|
*/
|
|
|
|
#ifndef GFX_USE_GWIN
|
|
|
|
#define GFX_USE_GWIN FALSE
|
|
|
|
#endif
|
|
|
|
/**
|
|
|
|
* @brief GFX Event API
|
|
|
|
* @details Defaults to FALSE
|
|
|
|
* @details Defines the concept of a "Source" that can send "Events" to "Listeners".
|
|
|
|
*/
|
|
|
|
#ifndef GFX_USE_GEVENT
|
|
|
|
#define GFX_USE_GEVENT FALSE
|
|
|
|
#endif
|
|
|
|
/**
|
|
|
|
* @brief GFX Timer API
|
|
|
|
* @details Defaults to FALSE
|
|
|
|
* @details Provides thread context timers - both one-shot and periodic.
|
|
|
|
*/
|
|
|
|
#ifndef GFX_USE_GTIMER
|
|
|
|
#define GFX_USE_GTIMER FALSE
|
|
|
|
#endif
|
2013-05-25 16:06:55 +00:00
|
|
|
/**
|
|
|
|
* @brief GFX Queue API
|
|
|
|
* @details Defaults to FALSE
|
|
|
|
* @details Provides queue management.
|
|
|
|
*/
|
|
|
|
#ifndef GFX_USE_GQUEUE
|
|
|
|
#define GFX_USE_GQUEUE FALSE
|
|
|
|
#endif
|
2013-02-28 23:04:52 +00:00
|
|
|
/**
|
|
|
|
* @brief GFX Input Device API
|
|
|
|
* @details Defaults to FALSE
|
|
|
|
* @note Also add the specific hardware drivers to your makefile.
|
|
|
|
* Eg.
|
2014-03-11 07:13:31 +00:00
|
|
|
* include $(GFXLIB)/drivers/ginput/toggle/Pal/driver.mk
|
2013-02-28 23:04:52 +00:00
|
|
|
* and...
|
2014-03-11 07:13:31 +00:00
|
|
|
* include $(GFXLIB)/drivers/ginput/touch/MCU/driver.mk
|
2013-02-28 23:04:52 +00:00
|
|
|
*/
|
|
|
|
#ifndef GFX_USE_GINPUT
|
|
|
|
#define GFX_USE_GINPUT FALSE
|
|
|
|
#endif
|
|
|
|
/**
|
|
|
|
* @brief GFX Generic Periodic ADC API
|
|
|
|
* @details Defaults to FALSE
|
|
|
|
*/
|
|
|
|
#ifndef GFX_USE_GADC
|
|
|
|
#define GFX_USE_GADC FALSE
|
|
|
|
#endif
|
|
|
|
/**
|
2014-03-11 07:13:31 +00:00
|
|
|
* @brief GFX Audio API
|
2013-02-28 23:04:52 +00:00
|
|
|
* @details Defaults to FALSE
|
|
|
|
* @note Also add the specific hardware drivers to your makefile.
|
|
|
|
* Eg.
|
2014-03-11 07:13:31 +00:00
|
|
|
* include $(GFXLIB)/drivers/gaudio/GADC/driver.mk
|
2013-02-28 23:04:52 +00:00
|
|
|
*/
|
2014-03-11 07:13:31 +00:00
|
|
|
#ifndef GFX_USE_GAUDIO
|
|
|
|
#define GFX_USE_GAUDIO FALSE
|
2013-02-28 23:04:52 +00:00
|
|
|
#endif
|
|
|
|
/**
|
|
|
|
* @brief GFX Miscellaneous Routines API
|
|
|
|
* @details 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.
|
|
|
|
*/
|
|
|
|
#ifndef GFX_USE_GMISC
|
|
|
|
#define GFX_USE_GMISC FALSE
|
|
|
|
#endif
|
2014-02-06 15:35:31 +00:00
|
|
|
/**
|
|
|
|
* @brief GFX File API
|
|
|
|
* @details Defaults to FALSE
|
|
|
|
*/
|
|
|
|
#ifndef GFX_USE_GFILE
|
|
|
|
#define GFX_USE_GFILE FALSE
|
|
|
|
#endif
|
2016-02-07 21:59:35 +00:00
|
|
|
/**
|
|
|
|
* @brief GFX Translation Support API
|
|
|
|
* @details Defaults to FALSE
|
|
|
|
*/
|
|
|
|
#ifndef GFX_USE_GTRANS
|
|
|
|
#define GFX_USE_GTRANS FALSE
|
|
|
|
#endif
|
2013-02-28 23:04:52 +00:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get all the options for each sub-system.
|
|
|
|
*
|
|
|
|
*/
|
2015-01-21 07:26:24 +00:00
|
|
|
#include "src/gos/gos_options.h"
|
|
|
|
#include "src/gdriver/gdriver_options.h"
|
|
|
|
#include "src/gfile/gfile_options.h"
|
|
|
|
#include "src/gmisc/gmisc_options.h"
|
2016-02-07 21:59:35 +00:00
|
|
|
#include "src/gtrans/gtrans_options.h"
|
2015-01-21 07:26:24 +00:00
|
|
|
#include "src/gqueue/gqueue_options.h"
|
|
|
|
#include "src/gevent/gevent_options.h"
|
|
|
|
#include "src/gtimer/gtimer_options.h"
|
|
|
|
#include "src/gdisp/gdisp_options.h"
|
|
|
|
#include "src/gwin/gwin_options.h"
|
|
|
|
#include "src/ginput/ginput_options.h"
|
|
|
|
#include "src/gadc/gadc_options.h"
|
|
|
|
#include "src/gaudio/gaudio_options.h"
|
2013-02-28 23:04:52 +00:00
|
|
|
|
|
|
|
/**
|
2014-02-06 15:35:31 +00:00
|
|
|
* Interdependency safety checks on the sub-systems.
|
2014-02-18 14:36:52 +00:00
|
|
|
* These must be in dependency order.
|
2013-02-28 23:04:52 +00:00
|
|
|
*
|
|
|
|
*/
|
2014-02-18 14:36:52 +00:00
|
|
|
#ifndef GFX_DISPLAY_RULE_WARNINGS
|
|
|
|
#define GFX_DISPLAY_RULE_WARNINGS FALSE
|
|
|
|
#endif
|
2015-01-21 07:26:24 +00:00
|
|
|
#include "src/gwin/gwin_rules.h"
|
|
|
|
#include "src/ginput/ginput_rules.h"
|
|
|
|
#include "src/gdisp/gdisp_rules.h"
|
|
|
|
#include "src/gaudio/gaudio_rules.h"
|
|
|
|
#include "src/gadc/gadc_rules.h"
|
|
|
|
#include "src/gevent/gevent_rules.h"
|
|
|
|
#include "src/gtimer/gtimer_rules.h"
|
|
|
|
#include "src/gqueue/gqueue_rules.h"
|
|
|
|
#include "src/gmisc/gmisc_rules.h"
|
2016-02-07 21:59:35 +00:00
|
|
|
#include "src/gtrans/gtrans_rules.h"
|
2015-01-21 07:26:24 +00:00
|
|
|
#include "src/gfile/gfile_rules.h"
|
|
|
|
#include "src/gdriver/gdriver_rules.h"
|
|
|
|
#include "src/gos/gos_rules.h"
|
2013-02-28 23:04:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Include the sub-system header files
|
|
|
|
*/
|
2015-01-21 07:26:24 +00:00
|
|
|
#include "src/gos/gos.h"
|
|
|
|
//#include "src/gdriver/gdriver.h" // This module is only included by source that needs it.
|
|
|
|
#include "src/gfile/gfile.h"
|
|
|
|
#include "src/gmisc/gmisc.h"
|
2016-02-07 21:59:35 +00:00
|
|
|
#include "src/gtrans/gtrans.h"
|
2015-01-21 07:26:24 +00:00
|
|
|
#include "src/gqueue/gqueue.h"
|
|
|
|
#include "src/gevent/gevent.h"
|
|
|
|
#include "src/gtimer/gtimer.h"
|
|
|
|
#include "src/gdisp/gdisp.h"
|
|
|
|
#include "src/gwin/gwin.h"
|
|
|
|
#include "src/ginput/ginput.h"
|
|
|
|
#include "src/gadc/gadc.h"
|
|
|
|
#include "src/gaudio/gaudio.h"
|
2013-02-28 23:04:52 +00:00
|
|
|
|
2013-05-24 15:26:52 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief The one call to start it all
|
|
|
|
*
|
|
|
|
* @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.
|
2015-08-16 15:21:01 +00:00
|
|
|
* @note If you define GFX_OS_NO_INIT as TRUE in your gfxconf.h file then ugfx doesn't try to
|
2015-02-28 03:06:15 +00:00
|
|
|
* initialise the operating system for you when you call @p gfxInit().
|
|
|
|
* @note 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
|
2015-08-16 15:21:01 +00:00
|
|
|
* operating system initialisation (whether or not GFX_OS_NO_INIT is set).
|
2015-02-28 03:06:15 +00:00
|
|
|
* @note 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).
|
2017-03-04 07:35:17 +00:00
|
|
|
* @note If GFX_OS_CALL_UGFXMAIN is set uGFXMain() is called after all initialisation is complete.
|
2013-05-24 15:26:52 +00:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gfxInit(void);
|
|
|
|
|
2014-02-02 18:24:43 +00:00
|
|
|
/**
|
|
|
|
* @brief The one call to end it all
|
|
|
|
*
|
2014-03-11 07:13:31 +00:00
|
|
|
* @note This will de-initialise each sub-system that has been turned on.
|
2014-02-02 18:24:43 +00:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
|
|
|
void gfxDeinit(void);
|
2013-05-24 15:26:52 +00:00
|
|
|
|
2017-03-04 07:35:17 +00:00
|
|
|
#if GFX_OS_CALL_UGFXMAIN || defined(__DOXYGEN__)
|
|
|
|
/**
|
|
|
|
* @brief 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.
|
|
|
|
*
|
|
|
|
* @pre GFX_OS_CALL_UGFXMAIN is GFXON
|
|
|
|
*/
|
|
|
|
void uGFXMain(void);
|
|
|
|
#endif
|
2013-05-24 15:26:52 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-02-28 23:04:52 +00:00
|
|
|
#endif /* _GFX_H */
|
|
|
|
/** @} */
|
2013-12-11 13:50:09 +00:00
|
|
|
|