diff options
-rw-r--r-- | demos/README | 14 | ||||
-rwxr-xr-x | demos/console/main.c | 30 |
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;
+}
|