aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorTectu <joel@unormal.org>2012-07-22 23:55:46 +0200
committerTectu <joel@unormal.org>2012-07-22 23:55:46 +0200
commitc8662cad57ce842b12897ad8de4ab404b5559ddf (patch)
tree9ec97b4fd99ca4b3e5800e3696d809aae082c978 /demos
parent1634d546972073df17d04e2089e9d8418acedfee (diff)
downloaduGFX-c8662cad57ce842b12897ad8de4ab404b5559ddf.tar.gz
uGFX-c8662cad57ce842b12897ad8de4ab404b5559ddf.tar.bz2
uGFX-c8662cad57ce842b12897ad8de4ab404b5559ddf.zip
added console demo
Diffstat (limited to 'demos')
-rw-r--r--demos/README14
-rwxr-xr-xdemos/console/main.c30
2 files changed, 30 insertions, 14 deletions
diff --git a/demos/README b/demos/README
index e95314f7..a15ebd51 100644
--- a/demos/README
+++ b/demos/README
@@ -2,17 +2,3 @@ This are a few demos, showing how to use the library.
Please note that this are not compilable projects.
-
-Your boarfile do need to contain the following informations:
-
- #define TP_PORT GPIOC
- #define TP_IRQ 4
- #define TP_CS 6
-
- #define LCD_DATA_PORT GPIOE
- #define LCD_CMD_PORT GPIOD
- #define LCD_CS 12
- #define LCD_RS 13
- #define LCD_WR 14
- #define LCD_RD 15
-
diff --git a/demos/console/main.c b/demos/console/main.c
new file mode 100755
index 00000000..c629e2cd
--- /dev/null
+++ b/demos/console/main.c
@@ -0,0 +1,30 @@
+#include "ch.h"
+#include "hal.h"
+#include "glcd.h"
+#include "test.h"
+#include "console.h"
+
+static GLCDDriver GLCDD1;
+static GLCDConsole CON1;
+
+int main(void) {
+ halInit();
+ chSysInit();
+
+ // init LCD and clear it
+ lcdInit(&GLCDD1);
+ lcdClear(Black);
+
+ // init console
+ lcdConsoleInit(&CON1, 0, 0, lcdGetWidth(), lcdGetHeight(), font_Small, Black, White);
+
+ // use test thread for console output
+ TestThread((BaseSequentialStream*)&CON1);
+
+ while (TRUE) {
+
+ chThdSleepMilliseconds(200);
+ }
+
+ return 0;
+}