aboutsummaryrefslogtreecommitdiffstats
path: root/halext/src/gdisp.c
diff options
context:
space:
mode:
authorAndrew Hannam <andrewh@inmarket.com.au>2012-08-02 02:03:46 +1000
committerAndrew Hannam <andrewh@inmarket.com.au>2012-08-02 02:03:46 +1000
commitc99accc70e476c32cd5994633db9127acfdb8a58 (patch)
tree555132775692308901ed41303c6cf39835bcbeb3 /halext/src/gdisp.c
parent9ac85166b20d791c2c081dd78f9a39ee050c1897 (diff)
downloaduGFX-c99accc70e476c32cd5994633db9127acfdb8a58.tar.gz
uGFX-c99accc70e476c32cd5994633db9127acfdb8a58.tar.bz2
uGFX-c99accc70e476c32cd5994633db9127acfdb8a58.zip
Extracted font structure definitions, re-organised some files, added gdispS6d1121 driver
Created gdisp_fonts.h to describe the internal structure of a font. Moved template directory to templates and created a sub-folder for each low level driver type. Moved the pre-defined font data and emulation code into better locations. Changed the emulation code to be included in the low level driver (where it should be) instead of the high level driver. Added new low level driver gdispS6d1121 (someone please test) Updated and added new readme's.
Diffstat (limited to 'halext/src/gdisp.c')
-rw-r--r--halext/src/gdisp.c54
1 files changed, 8 insertions, 46 deletions
diff --git a/halext/src/gdisp.c b/halext/src/gdisp.c
index 7259db0a..e7b0bc49 100644
--- a/halext/src/gdisp.c
+++ b/halext/src/gdisp.c
@@ -50,6 +50,7 @@
#if GDISP_NEED_MULTITHREAD
#warning "GDISP: Multithread support not complete"
+ #define MUTEX_INIT /* Not defined yet */
#define MUTEX_ENTER /* Not defined yet */
#define MUTEX_EXIT /* Not defined yet */
#endif
@@ -67,51 +68,12 @@
# define UNUSED(x) x
#endif
-#if GDISP_NEED_TEXT || defined(__DOXYGEN__)
- /**
- * @brief The size of a font column.
- * @note If you font heights > 16 you would need to redefine this
- * as a uint32_t instead of a uint16_t. Fonts would then take
- * twice the internal program memory.
- */
- typedef uint16_t fontcolumn_t;
-
- /**
- * @brief Internal font structure.
- * @note This structure is followed by:
- * An array of column data offsets (relative to the font structure)
- * An array of character widths (uint8_t)
- * Each characters array of column data (fontcolumn_t)
- */
- struct font {
- uint8_t height;
- uint8_t charPadding;
- uint8_t lineSpacing;
- uint8_t descenderHeight;
- uint8_t minWidth;
- uint8_t maxWidth;
- char minChar;
- char maxChar;
- uint16_t offsetTableOffset;
- uint16_t unused1; /* ensure next field is padded to 8 byte boundary */
- uint8_t widthTable[];
- };
-
- /**
- * @brief Macro's to get to the complex parts of the font structure.
- */
- #define _getFontPart(f,o,t) ((t)(&((const uint8_t *)(f))[(o)]))
- #define _getCharWidth(f,c) (((c) < (f)->minChar || (c) > (f)->maxChar) ? 0 : (f)->widthTable[c - (f)->minChar])
- #define _getCharOffset(f,c) (_getFontPart((f), (f)->offsetTableOffset, const uint16_t *)[c - (f)->minChar])
- #define _getCharData(f,c) _getFontPart((f), _getCharOffset((f),(c)), const fontcolumn_t *)
-#endif
-
/*===========================================================================*/
/* Driver exported variables. */
/*===========================================================================*/
#if GDISP_NEED_TEXT || defined(__DOXYGEN__)
- #include "gdisp_inc_fonts.c"
+ #include "gdisp_inc_fonts.c.h"
#endif
/*===========================================================================*/
@@ -126,9 +88,6 @@
/* Driver exported functions. */
/*===========================================================================*/
-/* Include the software emulation routines */
-#include "gdisp_inc_emulation.c"
-
#if GDISP_NEED_MULTITHREAD || defined(__DOXYGEN__)
/**
* @brief GDISP Driver initialization.
@@ -138,10 +97,13 @@
* @init
*/
void gdispInit(GDISPDriver * UNUSED(gdisp)) {
- /* No mutex required as nothing should happen until the init is complete */
+ /* Initialise Mutex */
+ MUTEX_INIT
+
+ /* Initialise driver */
+ MUTEX_ENTER
gdisp_lld_init();
-
- /* ToDo - Initialise Mutex */
+ MUTEX_EXIT
}
#endif