added console demo

This commit is contained in:
Tectu 2012-07-22 23:55:46 +02:00
parent 1634d54697
commit c8662cad57
2 changed files with 30 additions and 14 deletions

View File

@ -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

30
demos/console/main.c Executable file
View File

@ -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;
}