diff options
author | Tectu <joel@unormal.org> | 2012-06-13 10:14:02 +0200 |
---|---|---|
committer | Tectu <joel@unormal.org> | 2012-06-13 10:14:02 +0200 |
commit | d53551fb38418a063dcca0898c92349006c0e3e4 (patch) | |
tree | d201d4f6c2fe4ed44727931a392d89f133d1787d /demos | |
parent | cb0cbb29e89bc84e1a56794177c9e8325bf4a32d (diff) | |
download | uGFX-d53551fb38418a063dcca0898c92349006c0e3e4.tar.gz uGFX-d53551fb38418a063dcca0898c92349006c0e3e4.tar.bz2 uGFX-d53551fb38418a063dcca0898c92349006c0e3e4.zip |
added demos folder
Diffstat (limited to 'demos')
-rw-r--r-- | demos/README | 18 | ||||
-rwxr-xr-x | demos/drawing/main.c | 33 |
2 files changed, 51 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;
+}
|