aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--demos/README18
-rwxr-xr-xdemos/drawing/main.c33
-rw-r--r--glcdconf.h14
3 files changed, 65 insertions, 0 deletions
diff --git a/demos/README b/demos/README
new file mode 100644
index 00000000..e95314f7
--- /dev/null
+++ b/demos/README
@@ -0,0 +1,18 @@
+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/drawing/main.c b/demos/drawing/main.c
new file mode 100755
index 00000000..d38166fe
--- /dev/null
+++ b/demos/drawing/main.c
@@ -0,0 +1,33 @@
+#include "ch.h"
+#include "hal.h"
+#include "glcd.h"
+
+static WORKING_AREA(waThread1, 128);
+static void Thread1(void *arg) {
+ (void)arg;
+
+ while (TRUE) {
+ palTogglePad(GPIOD, GPIOD_LED1);
+ chThdSleepMilliseconds(500);
+ }
+}
+
+int main(void) {
+ halInit();
+ chSysInit();
+
+ lcdInit();
+ lcdClear(Black);
+ lcdDrawString(100, 100, "Hello World", White, Black);
+ lcdDrawCircle(150, 150, 10, filled, Green);
+ lcdDrawLine(0, 0, lcdGetWidth(), lcdGetHeight(), Yellow);
+
+ chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
+
+ while (TRUE) {
+
+ chThdSleepMilliseconds(200);
+ }
+
+ return 0;
+}
diff --git a/glcdconf.h b/glcdconf.h
new file mode 100644
index 00000000..b623f54b
--- /dev/null
+++ b/glcdconf.h
@@ -0,0 +1,14 @@
+#ifndef GLCDCONF_H
+#define GLCDCONF_H
+
+
+/***** LCD CONTROLLER *****/
+#define LCD_USE_SSD1289
+//#define LCD_USE_S6D1121
+
+
+/***** TOUCHPAD CONTROLLER *****/
+#define TOUCHPAD_USE_ADS7843
+
+
+#endif