added console demo
This commit is contained in:
parent
1634d54697
commit
c8662cad57
14
demos/README
14
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
|
||||
|
||||
|
30
demos/console/main.c
Executable file
30
demos/console/main.c
Executable 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user