diff options
author | Tectu <joel@unormal.org> | 2012-06-27 10:03:05 -0700 |
---|---|---|
committer | Tectu <joel@unormal.org> | 2012-06-27 10:03:05 -0700 |
commit | 1f43c6d654b9cbb86138c40e1f7f133d0bb5d214 (patch) | |
tree | 781a53c2ba5ffa6b607db156f85bfc8544dcd371 /console.h | |
parent | 3a5be9c67812c2ef16f335078f2ec8e8773d2144 (diff) | |
parent | bb69ed37aad36fac6bdf1e2c9669caee5689630f (diff) | |
download | uGFX-1f43c6d654b9cbb86138c40e1f7f133d0bb5d214.tar.gz uGFX-1f43c6d654b9cbb86138c40e1f7f133d0bb5d214.tar.bz2 uGFX-1f43c6d654b9cbb86138c40e1f7f133d0bb5d214.zip |
Merge pull request #11 from trsaunders/master
Console support
Diffstat (limited to 'console.h')
-rw-r--r-- | console.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/console.h b/console.h new file mode 100644 index 00000000..fcdef293 --- /dev/null +++ b/console.h @@ -0,0 +1,66 @@ +#ifndef CONSOLE_H +#define CONSOLE_H + +#include "glcd.h" + +/** + * @brief Structure representing a GLCD driver. + */ +typedef struct GLCDConsole GLCDConsole; + +/** + * @brief @p GLCDConsole specific methods. + */ +#define _glcd_driver_methods \ + _base_asynchronous_channel_methods + +/** + * @extends BaseAsynchronousChannelVMT + * + * @brief @p GLCDConsole virtual methods table. + */ +struct GLCDConsoleVMT { + _glcd_driver_methods +}; + +/** + * @extends BaseAsynchronousChannel + * + * @brief GLCD Console class. + * @details This class extends @p BaseAsynchronousChannel by adding physical + * I/O queues. + */ +struct GLCDConsole { + /** @brief Virtual Methods Table.*/ + const struct GLCDConsoleVMT *vmt; + _base_asynchronous_channel_data + /* WARNING: Do not add any data to this struct above this comment, only below */ + /* font */ + font_t font; + /* lcd area to use */ + uint16_t x0,y0; + /* current cursor position, in pixels */ + uint16_t cx,cy; + /* console size in pixels */ + uint16_t sx,sy; + /* foreground and background colour */ + uint16_t bkcolor, color; + /* font size in pixels */ + uint8_t fy; +}; + +#ifdef __cplusplus +extern "C" { +#endif + +msg_t lcdConsoleInit(GLCDConsole *console, uint16_t x0, uint16_t y0, uint16_t width, uint16_t height, + font_t font, uint16_t bkcolor, uint16_t color); + +msg_t lcdConsolePut(GLCDConsole *console, char c); +msg_t lcdConsoleWrite(GLCDConsole *console, uint8_t *bp, size_t n); + +#ifdef __cplusplus +} +#endif + +#endif /* CONSOLE_H */ |