From f0cb18c2cf747c2a9fed1717298a44dae96c119c Mon Sep 17 00:00:00 2001 From: Tectu Date: Fri, 10 Aug 2012 00:36:05 +0200 Subject: removed demos since out of date --- demos/README | 24 --------------- demos/console/main.c | 51 ------------------------------- demos/drawing/main.c | 48 ------------------------------ demos/gui/main.c | 79 ------------------------------------------------- demos/powermodes/main.c | 55 ---------------------------------- 5 files changed, 257 deletions(-) delete mode 100644 demos/README delete mode 100755 demos/console/main.c delete mode 100755 demos/drawing/main.c delete mode 100755 demos/gui/main.c delete mode 100755 demos/powermodes/main.c (limited to 'demos') diff --git a/demos/README b/demos/README deleted file mode 100644 index 3d3d6013..00000000 --- a/demos/README +++ /dev/null @@ -1,24 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2012 - Joel Bodenmann aka Tectu - - This file is part of ChibiOS-LCD-Driver. - - ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS-LCD-Driver is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -This are a few demos, showing how to use the library. - -Please note that this are not compilable projects. - diff --git a/demos/console/main.c b/demos/console/main.c deleted file mode 100755 index b8ccd633..00000000 --- a/demos/console/main.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2012 - Joel Bodenmann aka Tectu - - This file is part of ChibiOS-LCD-Driver. - - ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS-LCD-Driver is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#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; -} - diff --git a/demos/drawing/main.c b/demos/drawing/main.c deleted file mode 100755 index 391b0786..00000000 --- a/demos/drawing/main.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2012 - Joel Bodenmann aka Tectu - - This file is part of ChibiOS-LCD-Driver. - - ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS-LCD-Driver is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "ch.h" -#include "hal.h" -#include "glcd.h" - -static GLCDDriver GLCDD1; - -int main(void) { - halInit(); - chSysInit(); - - lcdInit(&GLCDD1); - lcdClear(Black); - lcdDrawString(100, 100, "Hello World", White, Black); - - lcdMoveCursor(10,10,White, Black); - chprintf((BaseSequentialStream *)&GLCDD1, "chTimeNow: %d", chTimeNow()); - - lcdDrawCircle(150, 150, 10, filled, Green); - lcdDrawLine(0, 0, lcdGetWidth(), lcdGetHeight(), Yellow); - - while (TRUE) { - - chThdSleepMilliseconds(200); - } - - return 0; -} - diff --git a/demos/gui/main.c b/demos/gui/main.c deleted file mode 100755 index ca1a499b..00000000 --- a/demos/gui/main.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2012 - Joel Bodenmann aka Tectu - - This file is part of ChibiOS-LCD-Driver. - - ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS-LCD-Driver is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "ch.h" -#include "hal.h" -#include "gui.h" -#include "glcd.h" -#include "touchpad.h" - -// GLCD driver object -static GLCDDriver GLCDD1; - -int main(void) { - uint8_t setActive, setState, clearActive, clearState; - - halInit(); - chSysInit(); - - // Initializes the LCD - lcdInit(&GLCDD1); - - // Initializes the touchpad - tpInit(&SPID1); - - // clear the entire LCD screen - lcdClear(Black); - - // Initializes the GUI thread - // 10ms interval - // HIGHPRIO thread priority level - guiInit(10, HIGHPRIO); - - // set the following buttons to active - // buttons wouldn't have any effect if you set these variables to 'inactive' - setActive = active; - clearActive = active; - - // draw a button to set, and one to clear the LED - guiDrawButton(10, 10, 60, 60, "Set", font_Larger, Black, Yellow, 6, "SetButton", &setActive, &setState); - guiDrawButton(70, 10, 120, 60, "Clear", font_Larger, Black, Red, 6, "ClearButton", &clearActive, &clearState); - - // you can delete a GUI element at any time from the GUI. You have to pass the GUI element name here. - // please note that you have to redraw the screen to delete the element yourself. - // guiDeleteElement("SetButton"); - // guiDeleteElement("ClearButton"); - - while (TRUE) { - - // check if button 'set' is pressed - if(setState) - palSetPad(GPIOD, GPIOD_LED3); - - // check if button 'clear' is pressed - if(clearState) - palClearPad(GPIOD, GPIOD_LED3); - - chThdSleepMilliseconds(200); - } - - return 0; -} - diff --git a/demos/powermodes/main.c b/demos/powermodes/main.c deleted file mode 100755 index 8a138d06..00000000 --- a/demos/powermodes/main.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - ChibiOS/RT - Copyright (C) 2012 - Joel Bodenmann aka Tectu - - This file is part of ChibiOS-LCD-Driver. - - ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - ChibiOS-LCD-Driver is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "ch.h" -#include "hal.h" -#include "glcd.h" - -static GLCDDriver GLCDD1; - -int main(void) { - halInit(); - chSysInit(); - - lcdInit(&GLCDD1); - lcdClear(Black); - lcdDrawString(100, 100, "Hello World", White, Black); - - // wait two seconds to see current LCD content - chThdSleepSeconds(2); - - // brings LCD to sleep mode - lcdSetPowerMode(sleepOn); - - // wait two seconds to see current LCD content - chThdSleepSeconds(2); - - // brings LCD back from sleep mode - // content displayed before gets displayed again - lcdSetPowerMode(sleepOff); - - while (TRUE) { - - chThdSleepMilliseconds(200); - } - - return 0; -} - -- cgit v1.2.3 From 1c105a40cfc676f2166ad93251147ab52ca06874 Mon Sep 17 00:00:00 2001 From: Tectu Date: Mon, 13 Aug 2012 02:45:49 +0200 Subject: added demos readme --- demos/readme.txt | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 demos/readme.txt (limited to 'demos') diff --git a/demos/readme.txt b/demos/readme.txt new file mode 100644 index 00000000..fbea2090 --- /dev/null +++ b/demos/readme.txt @@ -0,0 +1,4 @@ +This folder contains a few demos which explain how to use the library. + +Only the main files are contained. No compile-able projects + -- cgit v1.2.3 From 2285ddfc63b852e60fa0a95d32ffb6cc1d59c8a2 Mon Sep 17 00:00:00 2001 From: Tectu Date: Mon, 13 Aug 2012 02:48:05 +0200 Subject: added touchpad demo --- demos/touchpad/main.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 demos/touchpad/main.c (limited to 'demos') diff --git a/demos/touchpad/main.c b/demos/touchpad/main.c new file mode 100644 index 00000000..1651a3bf --- /dev/null +++ b/demos/touchpad/main.c @@ -0,0 +1,26 @@ +#include "ch.h" +#include "hal.h" +#include "gdisp.h" +#include "touchpad.h" + +TOUCHPADDriver TOUCHPADD1 = { + &SPID1, +}; + +int main(void) { + halInit(); + chSysInit(); + + gdispInit(); + gdispClear(Lime); + + tpInit(&TOUCHPADD1); + tpCalibrate(); + + while (TRUE) { + gdispFillCircle(tpReadX(), tpReadY(), 3, Black); + + chThdSleepMilliseconds(100); + } +} + -- cgit v1.2.3 From e7f0c8e2c2791fd2e571c762f03e277161f98a4b Mon Sep 17 00:00:00 2001 From: Tectu Date: Mon, 13 Aug 2012 02:51:30 +0200 Subject: added lcd demo dummy --- demos/lcd/main.c | 19 +++++++++++++++++++ demos/touchpad/main.c | 26 -------------------------- 2 files changed, 19 insertions(+), 26 deletions(-) create mode 100644 demos/lcd/main.c delete mode 100644 demos/touchpad/main.c (limited to 'demos') diff --git a/demos/lcd/main.c b/demos/lcd/main.c new file mode 100644 index 00000000..99b87948 --- /dev/null +++ b/demos/lcd/main.c @@ -0,0 +1,19 @@ +#include "ch.h" +#include "hal.h" +#include "gdisp.h" + +int main(void) { + halInit(); + chSysInit(); + + gdispInit(); + gdispClear(Black); + + // gdispDrawXXX(...); + + while (TRUE) { + + chThdSleepMilliseconds(100); + } +} + diff --git a/demos/touchpad/main.c b/demos/touchpad/main.c deleted file mode 100644 index 1651a3bf..00000000 --- a/demos/touchpad/main.c +++ /dev/null @@ -1,26 +0,0 @@ -#include "ch.h" -#include "hal.h" -#include "gdisp.h" -#include "touchpad.h" - -TOUCHPADDriver TOUCHPADD1 = { - &SPID1, -}; - -int main(void) { - halInit(); - chSysInit(); - - gdispInit(); - gdispClear(Lime); - - tpInit(&TOUCHPADD1); - tpCalibrate(); - - while (TRUE) { - gdispFillCircle(tpReadX(), tpReadY(), 3, Black); - - chThdSleepMilliseconds(100); - } -} - -- cgit v1.2.3 From 1a6eed0c07806b5d5129024eb3645907e25a4139 Mon Sep 17 00:00:00 2001 From: Tectu Date: Mon, 13 Aug 2012 20:59:29 +0200 Subject: added touchpad demo --- demos/touchpad/main.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 demos/touchpad/main.c (limited to 'demos') diff --git a/demos/touchpad/main.c b/demos/touchpad/main.c new file mode 100644 index 00000000..8a1d3275 --- /dev/null +++ b/demos/touchpad/main.c @@ -0,0 +1,26 @@ +#include "ch.h" +#include "hal.h" +#include "gdisp.h" +#include "touchpad.h" + +TOUCHPADDriver TOUCHPADD1 = { + &SPID1, +}; + +int main(void) { + halInit(); + chSysInit(); + + gdispInit(); + gdispClear(Lime); + + tpInit(&TOUCHPADD1); + tpCalibrate(); + + gdispClear(Lime); + + while (TRUE) { + gdispDrawFillCircle(tpReadX(), tpReadY(), 3, Black); + } +} + -- cgit v1.2.3 From f8a0e45cbffb9884e6980f3e636053c11a47a1ba Mon Sep 17 00:00:00 2001 From: Tectu Date: Tue, 14 Aug 2012 01:57:43 +0200 Subject: added console demo --- demos/console/main.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 demos/console/main.c (limited to 'demos') diff --git a/demos/console/main.c b/demos/console/main.c new file mode 100755 index 00000000..78e24a9c --- /dev/null +++ b/demos/console/main.c @@ -0,0 +1,47 @@ +/* + ChibiOS-LCD-Driver - Copyright (C) 2012 + Joel Bodenmann aka Tectu + + This file is part of ChibiOS-LCD-Driver. + + ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS-LCD-Driver is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "ch.h" +#include "hal.h" +#include "gdisp.h" +#include "chprintf.h" +#include "console.h" + +static GLCDConsole CON1; + +int main(void) { + halInit(); + chSysInit(); + + gdispInit(); + gdispClear(Lime); + + lcdConsoleInit(&CON1, 0, 0, gdispGetWidth(), gdispGetHeight(), &fontLarger, Black, White); + + + chprintf((BaseSequentialStream *)&CON1, "Hello the time is %d\nGoodbye.", chTimeNow()); + + + while (TRUE) { + + chThdSleepMilliseconds(100); + } +} + -- cgit v1.2.3 From 975faaab679c7a872e0390ac533abf79b08dedbf Mon Sep 17 00:00:00 2001 From: Tectu Date: Tue, 14 Aug 2012 01:58:24 +0200 Subject: demos license header --- demos/lcd/main.c | 20 ++++++++++++++++++++ demos/touchpad/main.c | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) (limited to 'demos') diff --git a/demos/lcd/main.c b/demos/lcd/main.c index 99b87948..aec1b9ab 100644 --- a/demos/lcd/main.c +++ b/demos/lcd/main.c @@ -1,3 +1,23 @@ +/* + ChibiOS-LCD-Driver - Copyright (C) 2012 + Joel Bodenmann aka Tectu + + This file is part of ChibiOS-LCD-Driver. + + ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS-LCD-Driver is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "ch.h" #include "hal.h" #include "gdisp.h" diff --git a/demos/touchpad/main.c b/demos/touchpad/main.c index 8a1d3275..52f52e83 100644 --- a/demos/touchpad/main.c +++ b/demos/touchpad/main.c @@ -1,3 +1,23 @@ +/* + ChibiOS-LCD-Driver - Copyright (C) 2012 + Joel Bodenmann aka Tectu + + This file is part of ChibiOS-LCD-Driver. + + ChibiOS-LCD-Driver is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + ChibiOS-LCD-Driver is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "ch.h" #include "hal.h" #include "gdisp.h" -- cgit v1.2.3