From b7a836614008086e3f745cbe8dd95d75f1e57bf7 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Mon, 26 Nov 2012 18:23:29 +0100 Subject: macro fix on src/gwin/button.c --- src/gwin/button.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gwin/button.c b/src/gwin/button.c index f62a86a4..89117fba 100644 --- a/src/gwin/button.c +++ b/src/gwin/button.c @@ -30,12 +30,12 @@ #include "gwin.h" #include "ginput.h" -#if !defined(GFX_USE_GINPUT) || !GFX_USE_GINPUT +#if (GFX_USE_GWIN && GWIN_NEED_BUTTON) || defined(__DOXYGEN__) + +#if !GFX_USE_GINPUT #error "GWIN Buttons require GFX_USE_GINPUT" #endif -#if (GFX_USE_GWIN && GWIN_NEED_BUTTON) || defined(__DOXYGEN__) - #include #include "gwin_internal.h" @@ -47,7 +47,7 @@ static const GButtonStyle GButtonDefaultStyle = { HTML2COLOR(0x404040), // color_dn_edge; HTML2COLOR(0x808080), // color_dn_fill; HTML2COLOR(0x404040), // color_dn_txt; - }; +}; // Process an event callback static void gwinButtonCallback(void *param, GEvent *pe) { -- cgit v1.2.3 From f1fb0a9b98551e538da15e778043c9fe39e3add9 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Mon, 26 Nov 2012 19:56:22 +0100 Subject: Revert "macro fix on src/gwin/button.c" This reverts commit b7a836614008086e3f745cbe8dd95d75f1e57bf7. --- src/gwin/button.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gwin/button.c b/src/gwin/button.c index 89117fba..f62a86a4 100644 --- a/src/gwin/button.c +++ b/src/gwin/button.c @@ -30,12 +30,12 @@ #include "gwin.h" #include "ginput.h" -#if (GFX_USE_GWIN && GWIN_NEED_BUTTON) || defined(__DOXYGEN__) - -#if !GFX_USE_GINPUT +#if !defined(GFX_USE_GINPUT) || !GFX_USE_GINPUT #error "GWIN Buttons require GFX_USE_GINPUT" #endif +#if (GFX_USE_GWIN && GWIN_NEED_BUTTON) || defined(__DOXYGEN__) + #include #include "gwin_internal.h" @@ -47,7 +47,7 @@ static const GButtonStyle GButtonDefaultStyle = { HTML2COLOR(0x404040), // color_dn_edge; HTML2COLOR(0x808080), // color_dn_fill; HTML2COLOR(0x404040), // color_dn_txt; -}; + }; // Process an event callback static void gwinButtonCallback(void *param, GEvent *pe) { -- cgit v1.2.3 From 1aef326a77d7d5428291a8eda885280a63e0e029 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Mon, 26 Nov 2012 20:46:56 +0100 Subject: src/gwin/button.c macro fix --- src/gwin/button.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gwin/button.c b/src/gwin/button.c index f62a86a4..fce82a20 100644 --- a/src/gwin/button.c +++ b/src/gwin/button.c @@ -30,12 +30,12 @@ #include "gwin.h" #include "ginput.h" -#if !defined(GFX_USE_GINPUT) || !GFX_USE_GINPUT +#if (GFX_USE_GWIN && GWIN_NEED_BUTTON) || defined(__DOXYGEN__) + +#if !GFX_USE_GINPUT #error "GWIN Buttons require GFX_USE_GINPUT" #endif -#if (GFX_USE_GWIN && GWIN_NEED_BUTTON) || defined(__DOXYGEN__) - #include #include "gwin_internal.h" -- cgit v1.2.3 From ba08afef3ec1af2412f526623156f5f50d102ec0 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Mon, 26 Nov 2012 21:19:32 +0100 Subject: doxygen --- drivers/ginput/toggle/Pal/ginput_lld_toggle.c | 2 +- drivers/ginput/toggle/Pal/ginput_lld_toggle_board_example.h | 2 +- .../ginput/toggle/Pal/ginput_lld_toggle_board_olimexsam7ex256.h | 2 +- drivers/ginput/toggle/Pal/ginput_lld_toggle_config.h | 2 +- drivers/multiple/Win32/gdisp_lld.c | 4 ++-- drivers/multiple/Win32/gdisp_lld_config.h | 8 ++++---- drivers/multiple/Win32/ginput_lld_mouse_config.h | 2 +- include/gdisp/fonts.h | 2 +- include/lld/gdisp/gdisp_lld.h | 2 +- include/lld/gdisp/gdisp_lld_msgs.h | 2 +- include/lld/touchscreen/touchscreen_lld.h | 2 +- src/gtimer.c | 2 ++ 12 files changed, 17 insertions(+), 15 deletions(-) diff --git a/drivers/ginput/toggle/Pal/ginput_lld_toggle.c b/drivers/ginput/toggle/Pal/ginput_lld_toggle.c index 98c2f61b..9da5ca46 100644 --- a/drivers/ginput/toggle/Pal/ginput_lld_toggle.c +++ b/drivers/ginput/toggle/Pal/ginput_lld_toggle.c @@ -19,7 +19,7 @@ */ /** - * @file drivers/ginput/togglePal/ginput_lld_toggle.c + * @file drivers/ginput/toggle/Pal/ginput_lld_toggle.c * @brief GINPUT Toggle low level driver source for the ChibiOS PAL hardware. * * @addtogroup GINPUT_TOGGLE diff --git a/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_example.h b/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_example.h index e8262b9a..3698a81c 100644 --- a/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_example.h +++ b/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_example.h @@ -19,7 +19,7 @@ */ /** - * @file drivers/ginput/togglePal/ginput_lld_toggle_board_example.h + * @file drivers/ginput/toggle/Pal/ginput_lld_toggle_board_example.h * @brief GINPUT Toggle low level driver source for the ChibiOS PAL hardware on the example board. * * @addtogroup GINPUT_TOGGLE diff --git a/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_olimexsam7ex256.h b/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_olimexsam7ex256.h index 3858ad0c..a2b50adf 100644 --- a/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_olimexsam7ex256.h +++ b/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_olimexsam7ex256.h @@ -19,7 +19,7 @@ */ /** - * @file drivers/ginput/togglePal/ginput_lld_toggle_board_olimexsam7ex256.h + * @file drivers/ginput/toggle/Pal/ginput_lld_toggle_board_olimexsam7ex256.h * @brief GINPUT Toggle low level driver source for the ChibiOS PAL hardware on the Olimex SAM7EX256 board. * * @addtogroup GINPUT_TOGGLE diff --git a/drivers/ginput/toggle/Pal/ginput_lld_toggle_config.h b/drivers/ginput/toggle/Pal/ginput_lld_toggle_config.h index f58221f9..3d0d55aa 100644 --- a/drivers/ginput/toggle/Pal/ginput_lld_toggle_config.h +++ b/drivers/ginput/toggle/Pal/ginput_lld_toggle_config.h @@ -19,7 +19,7 @@ */ /** - * @file drivers/ginput/togglePal/ginput_lld_toggle_config.h + * @file drivers/ginput/toggle/Pal/ginput_lld_toggle_config.h * @brief GINPUT Toggle Driver configuration header. * * @addtogroup GDISP diff --git a/drivers/multiple/Win32/gdisp_lld.c b/drivers/multiple/Win32/gdisp_lld.c index 72ad0554..30cd3389 100644 --- a/drivers/multiple/Win32/gdisp_lld.c +++ b/drivers/multiple/Win32/gdisp_lld.c @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. @@ -19,7 +19,7 @@ */ /** - * @file drivers/gdisp/Win32/gdisp_lld.c + * @file drivers/multiple/Win32/gdisp_lld.c * @brief GDISP Graphics Driver subsystem low level driver source for Win32. * * @addtogroup GDISP diff --git a/drivers/multiple/Win32/gdisp_lld_config.h b/drivers/multiple/Win32/gdisp_lld_config.h index bf018eea..92f5bd4d 100644 --- a/drivers/multiple/Win32/gdisp_lld_config.h +++ b/drivers/multiple/Win32/gdisp_lld_config.h @@ -1,15 +1,15 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - 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 + ChibiOS-GFX 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, + ChibiOS-GFX 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. @@ -19,7 +19,7 @@ */ /** - * @file drivers/gdisp/Win32/gdisp_lld_config.h + * @file drivers/multiple/Win32/gdisp_lld_config.h * @brief GDISP Graphic Driver subsystem low level driver header for Win32. * * @addtogroup GDISP diff --git a/drivers/multiple/Win32/ginput_lld_mouse_config.h b/drivers/multiple/Win32/ginput_lld_mouse_config.h index bf063d6d..fc70a4d2 100644 --- a/drivers/multiple/Win32/ginput_lld_mouse_config.h +++ b/drivers/multiple/Win32/ginput_lld_mouse_config.h @@ -18,7 +18,7 @@ along with this program. If not, see . */ /** - * @file drivers/gdisp/Win32/ginput_lld_mouse_config.h + * @file drivers/multiple/Win32/ginput_lld_mouse_config.h * @brief GINPUT LLD header file for mouse/touch driver. * * @addtogroup GINPUT_LLD_MOUSE diff --git a/include/gdisp/fonts.h b/include/gdisp/fonts.h index e3b07e86..e0c7f7de 100644 --- a/include/gdisp/fonts.h +++ b/include/gdisp/fonts.h @@ -19,7 +19,7 @@ */ /** - * @file include/gdisp_fonts.h + * @file include/gdisp/fonts.h * @brief GDISP internal font definitions. * @details This is not generally needed by an application. It is used * by the low level drivers that need to understand a font. diff --git a/include/lld/gdisp/gdisp_lld.h b/include/lld/gdisp/gdisp_lld.h index fecd710a..4e29dc48 100644 --- a/include/lld/gdisp/gdisp_lld.h +++ b/include/lld/gdisp/gdisp_lld.h @@ -19,7 +19,7 @@ */ /** - * @file include/gdisp_lld.h + * @file include/lld/gdisp/gdisp_lld.h * @brief GDISP Graphic Driver subsystem low level driver header. * * @addtogroup GDISP diff --git a/include/lld/gdisp/gdisp_lld_msgs.h b/include/lld/gdisp/gdisp_lld_msgs.h index 5885a70c..f5d29ea1 100644 --- a/include/lld/gdisp/gdisp_lld_msgs.h +++ b/include/lld/gdisp/gdisp_lld_msgs.h @@ -19,7 +19,7 @@ */ /** - * @file include/gdisp_lld_msgs.h + * @file include/lld/gdisp/gdisp_lld_msgs.h * @brief GDISP Graphic Driver subsystem low level driver message structures. * * @addtogroup GDISP diff --git a/include/lld/touchscreen/touchscreen_lld.h b/include/lld/touchscreen/touchscreen_lld.h index 9dd29629..912d2464 100644 --- a/include/lld/touchscreen/touchscreen_lld.h +++ b/include/lld/touchscreen/touchscreen_lld.h @@ -19,7 +19,7 @@ */ /** - * @file include/touchscreen_lld.h + * @file include/lld/touchscreen/touchscreen_lld.h * @brief TOUCHSCREEN Driver subsystem low level driver header. * * @addtogroup TOUCHSCREEN diff --git a/src/gtimer.c b/src/gtimer.c index 8956a190..164822f3 100644 --- a/src/gtimer.c +++ b/src/gtimer.c @@ -258,6 +258,8 @@ void gtimerStop(GTimer *pt) { * * @param[in] pt Pointer to a GTimer structure * + * @return TRUE if active, FALSE otherwise + * * @api */ bool_t gtimerIsActive(GTimer *pt) { -- cgit v1.2.3 From e89bb0b4d84fe7623e5b7ab80b5c7b40f69a31e8 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Mon, 26 Nov 2012 23:33:41 +0100 Subject: few fixes and FireBull STM32 F103 GINPUT dummy board file --- drivers/ginput/touch/ADS7843/ginput_lld_mouse.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c b/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c index de32c493..57508171 100644 --- a/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c +++ b/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. @@ -31,15 +31,17 @@ #if (GFX_USE_GINPUT && GINPUT_NEED_MOUSE) /*|| defined(__DOXYGEN__)*/ +#include "gdisp.h" /* for coord_t */ +#include "ginput/ginput_mouse.h" /* for GINPUT_TOUCH_PRESSED */ #include "lld/ginput/mouse.h" +#include "gevent.h" #if defined(GINPUT_MOUSE_USE_CUSTOM_BOARD) && GINPUT_MOUSE_USE_CUSTOM_BOARD - /* Include the user supplied board definitions */ #include "ginput_lld_mouse_board.h" -//#elif defined(BOARD_OLIMEX_SAM7_EX256) -// #include "ginput_lld_mouse_board_olimexsam7ex256.h" +#elif defined(BOARD_FIREBULL_STM32_F103) + #include "ginput_lld_mouse_board_firebull_stm32f103.h" #else - #include "ginput_lld_mouse_board.h" + #include "ginput_lld_mouse_board_example.h" #endif static uint16_t sampleBuf[7]; @@ -92,6 +94,8 @@ void ginput_lld_mouse_init(void) { * @notapi */ void ginput_lld_mouse_get_reading(MouseReading *pt) { + uint16_t i; + // If touch-off return the previous results if (!getpin_pressed()) { pt->x = lastx; -- cgit v1.2.3 From c71022132cbac0507bb8d07d4310b6a418aa3815 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Mon, 26 Nov 2012 23:34:08 +0100 Subject: FireBull STM32 F103 GINPUT dummy board file (forgot to add at last commit) --- .../ginput_lld_mouse_board_firebull_stm32f103.h | 89 ++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_firebull_stm32f103.h diff --git a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_firebull_stm32f103.h b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_firebull_stm32f103.h new file mode 100644 index 00000000..72d5932c --- /dev/null +++ b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_firebull_stm32f103.h @@ -0,0 +1,89 @@ +/* + ChibiOS/RT - Copyright (C) 2012 + Joel Bodenmann aka Tectu + + This file is part of ChibiOS/GFX. + + ChibiOS/GFX 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/GFX 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 . +*/ + +/** + * @file drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_example.h + * @brief GINPUT Touch low level driver source for the ADS7843 on the example board. + * + * @addtogroup GINPUT_MOUSE + * @{ + */ + +#ifndef _GINPUT_LLD_MOUSE_BOARD_H +#define _GINPUT_LLD_MOUSE_BOARD_H + +static const SPIConfig spicfg = { + NULL, + GPIOC, + 6, + /* SPI_CR1_BR_2 |*/ SPI_CR1_BR_1 | SPI_CR1_BR_0, +}; + +/** + * @brief Initialise the board for the touch. + * + * @notapi + */ +static __inline void init_board(void) { + spiStart(&SPID1, &spicfg); +} + +/** + * @brief Check whether the surface is currently touched + * @return TRUE if the surface is currently touched + * + * @notapi + */ +static __inline bool_t getpin_pressed(void) { + return; +} + +/** + * @brief Aquire the bus ready for readings + * + * @notapi + */ +static __inline void aquire_bus(void) { + return; +} + +/** + * @brief Release the bus after readings + * + * @notapi + */ +static __inline void release_bus(void) { + return; +} + +/** + * @brief Read a value from touch controller + * @return The value read from the controller + * + * params[in] port The controller port to read. + * + * @notapi + */ +static __inline uint16_t read_value(uint16_t port) { + (void)port; +} + +#endif /* _GINPUT_LLD_MOUSE_BOARD_H */ +/** @} */ -- cgit v1.2.3 From e6bb13be05b9633dd65f834f8be1948dc7603f6b Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Mon, 26 Nov 2012 23:38:11 +0100 Subject: copyright header fixes... --- drivers/gdisp/ILI9320/gdisp_lld.c | 2 +- drivers/gdisp/ILI9320/gdisp_lld_board_example.h | 2 +- drivers/gdisp/ILI9320/gdisp_lld_board_olimex_stm32_lcd.h | 2 +- drivers/gdisp/ILI9320/gdisp_lld_config.h | 2 +- drivers/gdisp/Nokia6610/GE12.h | 2 +- drivers/gdisp/Nokia6610/GE8.h | 2 +- drivers/gdisp/Nokia6610/gdisp_lld.c | 2 +- drivers/gdisp/Nokia6610/gdisp_lld_board_example.h | 2 +- drivers/gdisp/Nokia6610/gdisp_lld_board_olimexsam7ex256.h | 2 +- drivers/gdisp/Nokia6610/gdisp_lld_config.h | 2 +- drivers/gdisp/S6D1121/gdisp_lld.c | 2 +- drivers/gdisp/S6D1121/gdisp_lld_board_example.h | 2 +- drivers/gdisp/S6D1121/gdisp_lld_board_olimex_e407.h | 2 +- drivers/gdisp/S6D1121/gdisp_lld_config.h | 2 +- drivers/gdisp/SSD1289/gdisp_lld.c | 2 +- drivers/gdisp/SSD1289/gdisp_lld_board_example.h | 2 +- drivers/gdisp/SSD1289/gdisp_lld_board_example_fsmc.h | 2 +- drivers/gdisp/SSD1289/gdisp_lld_board_firebullstm32f103.h | 2 +- drivers/gdisp/SSD1289/gdisp_lld_config.h | 2 +- drivers/gdisp/TestStub/gdisp_lld.c | 2 +- drivers/gdisp/TestStub/gdisp_lld_config.h | 2 +- drivers/gdisp/VMT/gdisp_lld.c | 2 +- drivers/gdisp/VMT/gdisp_lld_config.h | 2 +- drivers/gdisp/VMT/gdisp_lld_driver1.c | 2 +- drivers/gdisp/VMT/gdisp_lld_driver2.c | 2 +- drivers/ginput/toggle/Pal/ginput_lld_toggle.c | 2 +- drivers/ginput/toggle/Pal/ginput_lld_toggle_board_example.h | 2 +- drivers/ginput/toggle/Pal/ginput_lld_toggle_board_olimexsam7ex256.h | 2 +- drivers/ginput/toggle/Pal/ginput_lld_toggle_config.h | 2 +- drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_example.h | 2 +- .../ginput/touch/ADS7843/ginput_lld_mouse_board_firebull_stm32f103.h | 2 +- drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_unknown.h | 2 +- drivers/ginput/touch/MCU/ginput_lld_mouse.c | 2 +- drivers/ginput/touch/MCU/ginput_lld_mouse_board_example.h | 2 +- drivers/ginput/touch/MCU/ginput_lld_mouse_board_unknown.h | 2 +- drivers/multiple/Win32/gdisp_lld_config.h | 2 +- 36 files changed, 36 insertions(+), 36 deletions(-) diff --git a/drivers/gdisp/ILI9320/gdisp_lld.c b/drivers/gdisp/ILI9320/gdisp_lld.c index 0d1e969c..f670966c 100644 --- a/drivers/gdisp/ILI9320/gdisp_lld.c +++ b/drivers/gdisp/ILI9320/gdisp_lld.c @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/gdisp/ILI9320/gdisp_lld_board_example.h b/drivers/gdisp/ILI9320/gdisp_lld_board_example.h index b929a3c3..48221b3a 100644 --- a/drivers/gdisp/ILI9320/gdisp_lld_board_example.h +++ b/drivers/gdisp/ILI9320/gdisp_lld_board_example.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/gdisp/ILI9320/gdisp_lld_board_olimex_stm32_lcd.h b/drivers/gdisp/ILI9320/gdisp_lld_board_olimex_stm32_lcd.h index 0b926bb8..e9b808c0 100644 --- a/drivers/gdisp/ILI9320/gdisp_lld_board_olimex_stm32_lcd.h +++ b/drivers/gdisp/ILI9320/gdisp_lld_board_olimex_stm32_lcd.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/gdisp/ILI9320/gdisp_lld_config.h b/drivers/gdisp/ILI9320/gdisp_lld_config.h index 2fe89a14..ca534568 100644 --- a/drivers/gdisp/ILI9320/gdisp_lld_config.h +++ b/drivers/gdisp/ILI9320/gdisp_lld_config.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/gdisp/Nokia6610/GE12.h b/drivers/gdisp/Nokia6610/GE12.h index 668f475d..6c980e2e 100644 --- a/drivers/gdisp/Nokia6610/GE12.h +++ b/drivers/gdisp/Nokia6610/GE12.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/gdisp/Nokia6610/GE8.h b/drivers/gdisp/Nokia6610/GE8.h index ea835e1b..789308a9 100644 --- a/drivers/gdisp/Nokia6610/GE8.h +++ b/drivers/gdisp/Nokia6610/GE8.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/gdisp/Nokia6610/gdisp_lld.c b/drivers/gdisp/Nokia6610/gdisp_lld.c index 661d6a77..47df5bb2 100644 --- a/drivers/gdisp/Nokia6610/gdisp_lld.c +++ b/drivers/gdisp/Nokia6610/gdisp_lld.c @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/gdisp/Nokia6610/gdisp_lld_board_example.h b/drivers/gdisp/Nokia6610/gdisp_lld_board_example.h index de8eb6ce..c8528f9e 100644 --- a/drivers/gdisp/Nokia6610/gdisp_lld_board_example.h +++ b/drivers/gdisp/Nokia6610/gdisp_lld_board_example.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/gdisp/Nokia6610/gdisp_lld_board_olimexsam7ex256.h b/drivers/gdisp/Nokia6610/gdisp_lld_board_olimexsam7ex256.h index 3d1e6ceb..0b5756d0 100644 --- a/drivers/gdisp/Nokia6610/gdisp_lld_board_olimexsam7ex256.h +++ b/drivers/gdisp/Nokia6610/gdisp_lld_board_olimexsam7ex256.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/gdisp/Nokia6610/gdisp_lld_config.h b/drivers/gdisp/Nokia6610/gdisp_lld_config.h index f751020f..e7583b54 100644 --- a/drivers/gdisp/Nokia6610/gdisp_lld_config.h +++ b/drivers/gdisp/Nokia6610/gdisp_lld_config.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/gdisp/S6D1121/gdisp_lld.c b/drivers/gdisp/S6D1121/gdisp_lld.c index 49116ec1..5fac4b29 100644 --- a/drivers/gdisp/S6D1121/gdisp_lld.c +++ b/drivers/gdisp/S6D1121/gdisp_lld.c @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/gdisp/S6D1121/gdisp_lld_board_example.h b/drivers/gdisp/S6D1121/gdisp_lld_board_example.h index c47a6ed6..00c4b869 100644 --- a/drivers/gdisp/S6D1121/gdisp_lld_board_example.h +++ b/drivers/gdisp/S6D1121/gdisp_lld_board_example.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/gdisp/S6D1121/gdisp_lld_board_olimex_e407.h b/drivers/gdisp/S6D1121/gdisp_lld_board_olimex_e407.h index ad71d343..9abfa74c 100644 --- a/drivers/gdisp/S6D1121/gdisp_lld_board_olimex_e407.h +++ b/drivers/gdisp/S6D1121/gdisp_lld_board_olimex_e407.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/gdisp/S6D1121/gdisp_lld_config.h b/drivers/gdisp/S6D1121/gdisp_lld_config.h index 95046946..c662d0e7 100644 --- a/drivers/gdisp/S6D1121/gdisp_lld_config.h +++ b/drivers/gdisp/S6D1121/gdisp_lld_config.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/gdisp/SSD1289/gdisp_lld.c b/drivers/gdisp/SSD1289/gdisp_lld.c index 6ac55865..abcc4736 100644 --- a/drivers/gdisp/SSD1289/gdisp_lld.c +++ b/drivers/gdisp/SSD1289/gdisp_lld.c @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/gdisp/SSD1289/gdisp_lld_board_example.h b/drivers/gdisp/SSD1289/gdisp_lld_board_example.h index c47a6ed6..00c4b869 100644 --- a/drivers/gdisp/SSD1289/gdisp_lld_board_example.h +++ b/drivers/gdisp/SSD1289/gdisp_lld_board_example.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/gdisp/SSD1289/gdisp_lld_board_example_fsmc.h b/drivers/gdisp/SSD1289/gdisp_lld_board_example_fsmc.h index dd492f9d..76a5c04c 100644 --- a/drivers/gdisp/SSD1289/gdisp_lld_board_example_fsmc.h +++ b/drivers/gdisp/SSD1289/gdisp_lld_board_example_fsmc.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/gdisp/SSD1289/gdisp_lld_board_firebullstm32f103.h b/drivers/gdisp/SSD1289/gdisp_lld_board_firebullstm32f103.h index 07cdfa12..9cff5a19 100644 --- a/drivers/gdisp/SSD1289/gdisp_lld_board_firebullstm32f103.h +++ b/drivers/gdisp/SSD1289/gdisp_lld_board_firebullstm32f103.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/gdisp/SSD1289/gdisp_lld_config.h b/drivers/gdisp/SSD1289/gdisp_lld_config.h index bc49c764..dafbc90f 100644 --- a/drivers/gdisp/SSD1289/gdisp_lld_config.h +++ b/drivers/gdisp/SSD1289/gdisp_lld_config.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/gdisp/TestStub/gdisp_lld.c b/drivers/gdisp/TestStub/gdisp_lld.c index f1373ccd..79181036 100644 --- a/drivers/gdisp/TestStub/gdisp_lld.c +++ b/drivers/gdisp/TestStub/gdisp_lld.c @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/gdisp/TestStub/gdisp_lld_config.h b/drivers/gdisp/TestStub/gdisp_lld_config.h index ecf383a9..18c2de59 100644 --- a/drivers/gdisp/TestStub/gdisp_lld_config.h +++ b/drivers/gdisp/TestStub/gdisp_lld_config.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/gdisp/VMT/gdisp_lld.c b/drivers/gdisp/VMT/gdisp_lld.c index 6291f3ce..1bacf1a7 100644 --- a/drivers/gdisp/VMT/gdisp_lld.c +++ b/drivers/gdisp/VMT/gdisp_lld.c @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/gdisp/VMT/gdisp_lld_config.h b/drivers/gdisp/VMT/gdisp_lld_config.h index 5f02f1d8..8c7bfc9c 100644 --- a/drivers/gdisp/VMT/gdisp_lld_config.h +++ b/drivers/gdisp/VMT/gdisp_lld_config.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/gdisp/VMT/gdisp_lld_driver1.c b/drivers/gdisp/VMT/gdisp_lld_driver1.c index 5bfaaa85..06dadc54 100644 --- a/drivers/gdisp/VMT/gdisp_lld_driver1.c +++ b/drivers/gdisp/VMT/gdisp_lld_driver1.c @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/gdisp/VMT/gdisp_lld_driver2.c b/drivers/gdisp/VMT/gdisp_lld_driver2.c index 961c43b3..5dca0b27 100644 --- a/drivers/gdisp/VMT/gdisp_lld_driver2.c +++ b/drivers/gdisp/VMT/gdisp_lld_driver2.c @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/ginput/toggle/Pal/ginput_lld_toggle.c b/drivers/ginput/toggle/Pal/ginput_lld_toggle.c index 9da5ca46..560d11b9 100644 --- a/drivers/ginput/toggle/Pal/ginput_lld_toggle.c +++ b/drivers/ginput/toggle/Pal/ginput_lld_toggle.c @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_example.h b/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_example.h index 3698a81c..46d32b47 100644 --- a/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_example.h +++ b/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_example.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_olimexsam7ex256.h b/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_olimexsam7ex256.h index a2b50adf..b767f32c 100644 --- a/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_olimexsam7ex256.h +++ b/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_olimexsam7ex256.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/ginput/toggle/Pal/ginput_lld_toggle_config.h b/drivers/ginput/toggle/Pal/ginput_lld_toggle_config.h index 3d0d55aa..a3fcf22e 100644 --- a/drivers/ginput/toggle/Pal/ginput_lld_toggle_config.h +++ b/drivers/ginput/toggle/Pal/ginput_lld_toggle_config.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_example.h b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_example.h index 45563bee..9fbbaa56 100644 --- a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_example.h +++ b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_example.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_firebull_stm32f103.h b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_firebull_stm32f103.h index 72d5932c..ea939858 100644 --- a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_firebull_stm32f103.h +++ b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_firebull_stm32f103.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_unknown.h b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_unknown.h index 2c23472a..510a1525 100644 --- a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_unknown.h +++ b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_unknown.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/ginput/touch/MCU/ginput_lld_mouse.c b/drivers/ginput/touch/MCU/ginput_lld_mouse.c index ac42033b..b3405989 100644 --- a/drivers/ginput/touch/MCU/ginput_lld_mouse.c +++ b/drivers/ginput/touch/MCU/ginput_lld_mouse.c @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/ginput/touch/MCU/ginput_lld_mouse_board_example.h b/drivers/ginput/touch/MCU/ginput_lld_mouse_board_example.h index 21e55e74..5a09b274 100644 --- a/drivers/ginput/touch/MCU/ginput_lld_mouse_board_example.h +++ b/drivers/ginput/touch/MCU/ginput_lld_mouse_board_example.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/ginput/touch/MCU/ginput_lld_mouse_board_unknown.h b/drivers/ginput/touch/MCU/ginput_lld_mouse_board_unknown.h index 4780806e..f16661c8 100644 --- a/drivers/ginput/touch/MCU/ginput_lld_mouse_board_unknown.h +++ b/drivers/ginput/touch/MCU/ginput_lld_mouse_board_unknown.h @@ -1,5 +1,5 @@ /* - ChibiOS/RT - Copyright (C) 2012 + ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu This file is part of ChibiOS/GFX. diff --git a/drivers/multiple/Win32/gdisp_lld_config.h b/drivers/multiple/Win32/gdisp_lld_config.h index 92f5bd4d..bebd76b9 100644 --- a/drivers/multiple/Win32/gdisp_lld_config.h +++ b/drivers/multiple/Win32/gdisp_lld_config.h @@ -2,7 +2,7 @@ ChibiOS/GFX - Copyright (C) 2012 Joel Bodenmann aka Tectu - This file is part of ChibiOS-LCD-Driver. + This file is part of ChibiOS/GFX. ChibiOS-GFX is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -- cgit v1.2.3 From 8bdfc52efed023b492c47bbfd5976db145074b55 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Tue, 27 Nov 2012 00:42:51 +0100 Subject: FireBull STM32F103 board file for GINPUT --- drivers/ginput/touch/ADS7843/ginput_lld_mouse.c | 2 +- .../ginput_lld_mouse_board_firebull_stm32f103.h | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c b/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c index 57508171..9c1a582b 100644 --- a/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c +++ b/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c @@ -32,9 +32,9 @@ #if (GFX_USE_GINPUT && GINPUT_NEED_MOUSE) /*|| defined(__DOXYGEN__)*/ #include "gdisp.h" /* for coord_t */ +#include "gevent.h" #include "ginput/ginput_mouse.h" /* for GINPUT_TOUCH_PRESSED */ #include "lld/ginput/mouse.h" -#include "gevent.h" #if defined(GINPUT_MOUSE_USE_CUSTOM_BOARD) && GINPUT_MOUSE_USE_CUSTOM_BOARD #include "ginput_lld_mouse_board.h" diff --git a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_firebull_stm32f103.h b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_firebull_stm32f103.h index ea939858..cba9497d 100644 --- a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_firebull_stm32f103.h +++ b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_firebull_stm32f103.h @@ -52,16 +52,15 @@ static __inline void init_board(void) { * @notapi */ static __inline bool_t getpin_pressed(void) { - return; + return (!palReadPad(GPIOC, 4)); } - /** * @brief Aquire the bus ready for readings * * @notapi */ static __inline void aquire_bus(void) { - return; + spiAcquireBus(&SPID1); } /** @@ -70,7 +69,7 @@ static __inline void aquire_bus(void) { * @notapi */ static __inline void release_bus(void) { - return; + spiReleaseBus(&SPID1); } /** @@ -82,7 +81,17 @@ static __inline void release_bus(void) { * @notapi */ static __inline uint16_t read_value(uint16_t port) { - (void)port; + static uint8_t txbuf[3] = {0}; + static uint8_t rxbuf[3] = {0}; + uint16_t ret; + + txbuf[0] = port; + + spiExchange(&SPID1, 3, txbuf, rxbuf); + + ret = (rxbuf[1] << 5) | (rxbuf[2] >> 3); + + return ret; } #endif /* _GINPUT_LLD_MOUSE_BOARD_H */ -- cgit v1.2.3 From fa82491a0badcb1d6afb46554655deec35a4a9f3 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Tue, 27 Nov 2012 23:11:34 +0100 Subject: ILI9320 fix --- drivers/gdisp/ILI9320/gdisp_lld.c | 8 ++++---- drivers/gdisp/ILI9320/gdisp_lld_board_olimex_stm32_lcd.h | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/gdisp/ILI9320/gdisp_lld.c b/drivers/gdisp/ILI9320/gdisp_lld.c index f670966c..5ca5dceb 100644 --- a/drivers/gdisp/ILI9320/gdisp_lld.c +++ b/drivers/gdisp/ILI9320/gdisp_lld.c @@ -244,10 +244,10 @@ static void lld_lcdSetCursor(uint16_t x, uint16_t y) { static void lld_lcdSetViewPort(uint16_t x, uint16_t y, uint16_t cx, uint16_t cy) { switch(GDISP.Orientation) { case GDISP_ROTATE_0: - lld_lcdWriteReg(0x0050, x - 1); - lld_lcdWriteReg(0x0051, x + cx - 2); - lld_lcdWriteReg(0x0052, y - 1); - lld_lcdWriteReg(0x0053, y + cy - 2); + lld_lcdWriteReg(0x0050, x); + lld_lcdWriteReg(0x0051, x + cx - 1); + lld_lcdWriteReg(0x0052, y); + lld_lcdWriteReg(0x0053, y + cy - 1); break; case GDISP_ROTATE_90: diff --git a/drivers/gdisp/ILI9320/gdisp_lld_board_olimex_stm32_lcd.h b/drivers/gdisp/ILI9320/gdisp_lld_board_olimex_stm32_lcd.h index e9b808c0..a6d9d631 100644 --- a/drivers/gdisp/ILI9320/gdisp_lld_board_olimex_stm32_lcd.h +++ b/drivers/gdisp/ILI9320/gdisp_lld_board_olimex_stm32_lcd.h @@ -44,8 +44,7 @@ static __inline void GDISP_LLD(init_board)(void) { palSetPadMode(GPIOE, GPIOE_TFT_RST, PAL_MODE_OUTPUT_PUSHPULL); palSetPadMode(GPIOD, GPIOD_TFT_LIGHT, PAL_MODE_OUTPUT_PUSHPULL); - /* const unsigned char FSMC_Bank = 0; */ - const unsigned char FSMC_Bank = 6; + const unsigned char FSMC_Bank = 0; /* FSMC timing */ FSMC_Bank1->BTCR[FSMC_Bank+1] = (6) | (10 << 8) | (10 << 16); -- cgit v1.2.3 From 7b2e0d06d4cd8a472a9162460f5cf8d2d263cee4 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Wed, 28 Nov 2012 22:40:23 +0100 Subject: ILI9320 landscape mode --- drivers/gdisp/ILI9320/gdisp_lld.c | 43 ++++++++++++++++++---- drivers/ginput/touch/ADS7843/ginput_lld_mouse.c | 4 +- .../ginput_lld_mouse_board_firebull_stm32f103.h | 2 +- .../ginput/touch/ADS7843/ginput_lld_mouse_config.h | 4 +- 4 files changed, 40 insertions(+), 13 deletions(-) diff --git a/drivers/gdisp/ILI9320/gdisp_lld.c b/drivers/gdisp/ILI9320/gdisp_lld.c index 5ca5dceb..ada0f27d 100644 --- a/drivers/gdisp/ILI9320/gdisp_lld.c +++ b/drivers/gdisp/ILI9320/gdisp_lld.c @@ -237,8 +237,23 @@ static void lld_lcdSetCursor(uint16_t x, uint16_t y) { addr = y * 0x100 + x; - lld_lcdWriteReg(0x0020, addr & 0xff); /* low addr */ - lld_lcdWriteReg(0x0021, (addr >> 8) & 0x1ff); /* high addr */ + switch(GDISP.Orientation) { + case GDISP_ROTATE_0: + lld_lcdWriteReg(0x0020, addr & 0xff); /* low addr */ + lld_lcdWriteReg(0x0021, (addr >> 8) & 0x1ff); /* high addr */ + break; + + case GDISP_ROTATE_90: + lld_lcdWriteReg(0x0020, (addr >> 8) & 0x1ff); /* low addr */ + lld_lcdWriteReg(0x0021, addr & 0xff); /* high addr */ + break; + + case GDISP_ROTATE_180: + break; + + case GDISP_ROTATE_270: + break; + } } static void lld_lcdSetViewPort(uint16_t x, uint16_t y, uint16_t cx, uint16_t cy) { @@ -251,6 +266,10 @@ static void lld_lcdSetViewPort(uint16_t x, uint16_t y, uint16_t cx, uint16_t cy) break; case GDISP_ROTATE_90: + lld_lcdWriteReg(0x0050, y); + lld_lcdWriteReg(0x0051, y + cy - 1); + lld_lcdWriteReg(0x0052, x); + lld_lcdWriteReg(0x0053, x + cx - 1); break; case GDISP_ROTATE_180: @@ -265,7 +284,16 @@ static void lld_lcdSetViewPort(uint16_t x, uint16_t y, uint16_t cx, uint16_t cy) } static __inline void lld_lcdResetViewPort(void) { - /* ToDo */ + switch(GDISP.Orientation) { + case GDISP_ROTATE_0: + case GDISP_ROTATE_180: + lld_lcdSetViewPort(0, 0, GDISP_SCREEN_WIDTH, GDISP_SCREEN_HEIGHT); + break; + case GDISP_ROTATE_90: + case GDISP_ROTATE_270: + lld_lcdSetViewPort(0, 0, GDISP_SCREEN_HEIGHT, GDISP_SCREEN_WIDTH); + break; + } } void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) { @@ -479,20 +507,20 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) { GDISP.Powermode = (gdisp_powermode_t)value; return; -#if 0 - // NOT IMPLEMENTED YET case GDISP_CONTROL_ORIENTATION: if(GDISP.Orientation == (gdisp_orientation_t)value) return; switch((gdisp_orientation_t)value) { case GDISP_ROTATE_0: - /* ToDo */ + lld_lcdWriteReg(0x0001, 0x0100); + lld_lcdWriteReg(0x0003, 0x1038); GDISP.Height = GDISP_SCREEN_HEIGHT; GDISP.Width = GDISP_SCREEN_WIDTH; break; case GDISP_ROTATE_90: - /* ToDo */ + lld_lcdWriteReg(0x0001, 0x0000); + lld_lcdWriteReg(0x0003, 0x1030); GDISP.Height = GDISP_SCREEN_WIDTH; GDISP.Width = GDISP_SCREEN_HEIGHT; break; @@ -521,7 +549,6 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) { #endif GDISP.Orientation = (gdisp_orientation_t)value; return; -#endif case GDISP_CONTROL_BACKLIGHT: if((unsigned)value > 100) value = (void *)100; diff --git a/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c b/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c index 9c1a582b..5e390399 100644 --- a/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c +++ b/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c @@ -119,7 +119,7 @@ void ginput_lld_mouse_get_reading(MouseReading *pt) { sampleBuf[i] = read_value(0xD1); read_value(0xD0); filter(); - lastx = (coord_t)sampleBuf[3]; + lastx = 42;//(coord_t)sampleBuf[3]; /* Get the Y value using the same process as above */ read_value(0x91); @@ -127,7 +127,7 @@ void ginput_lld_mouse_get_reading(MouseReading *pt) { sampleBuf[i] = read_value(0x91); read_value(0x90); filter(); - lasty = (coord_t)sampleBuf[3]; + lasty = 42;//(coord_t)sampleBuf[3]; // Release the bus release_bus(); diff --git a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_firebull_stm32f103.h b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_firebull_stm32f103.h index cba9497d..d213cd17 100644 --- a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_firebull_stm32f103.h +++ b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_firebull_stm32f103.h @@ -90,7 +90,7 @@ static __inline uint16_t read_value(uint16_t port) { spiExchange(&SPID1, 3, txbuf, rxbuf); ret = (rxbuf[1] << 5) | (rxbuf[2] >> 3); - +return 42; return ret; } diff --git a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_config.h b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_config.h index 1ab568f5..de04e1f0 100644 --- a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_config.h +++ b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_config.h @@ -28,9 +28,9 @@ #define _LLD_GINPUT_MOUSE_CONFIG_H #define GINPUT_MOUSE_EVENT_TYPE GEVENT_TOUCH -#define GINPUT_MOUSE_NEED_CALIBRATION TRUE +#define GINPUT_MOUSE_NEED_CALIBRATION FALSE #define GINPUT_MOUSE_LLD_CALIBRATION_LOADSAVE FALSE -#define GINPUT_MOUSE_MAX_CALIBRATION_ERROR 2 +#define GINPUT_MOUSE_MAX_CALIBRATION_ERROR 4 #define GINPUT_MOUSE_READ_CYCLES 4 #define GINPUT_MOUSE_POLL_PERIOD 100 #define GINPUT_MOUSE_MAX_CLICK_JITTER 2 -- cgit v1.2.3 From b1b117bffa149c05e1cb7f131c8893e02d232643 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Wed, 28 Nov 2012 23:59:30 +0100 Subject: ADS7843 fix --- drivers/ginput/touch/ADS7843/ginput_lld_mouse.c | 4 ++-- .../touch/ADS7843/ginput_lld_mouse_board_firebull_stm32f103.h | 8 ++++++-- drivers/ginput/touch/ADS7843/ginput_lld_mouse_config.h | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c b/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c index 5e390399..9c1a582b 100644 --- a/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c +++ b/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c @@ -119,7 +119,7 @@ void ginput_lld_mouse_get_reading(MouseReading *pt) { sampleBuf[i] = read_value(0xD1); read_value(0xD0); filter(); - lastx = 42;//(coord_t)sampleBuf[3]; + lastx = (coord_t)sampleBuf[3]; /* Get the Y value using the same process as above */ read_value(0x91); @@ -127,7 +127,7 @@ void ginput_lld_mouse_get_reading(MouseReading *pt) { sampleBuf[i] = read_value(0x91); read_value(0x90); filter(); - lasty = 42;//(coord_t)sampleBuf[3]; + lasty = (coord_t)sampleBuf[3]; // Release the bus release_bus(); diff --git a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_firebull_stm32f103.h b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_firebull_stm32f103.h index d213cd17..9df301a4 100644 --- a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_firebull_stm32f103.h +++ b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_firebull_stm32f103.h @@ -61,6 +61,8 @@ static __inline bool_t getpin_pressed(void) { */ static __inline void aquire_bus(void) { spiAcquireBus(&SPID1); + //TOUCHSCREEN_SPI_PROLOGUE(); + palClearPad(GPIOC, 6); } /** @@ -69,7 +71,9 @@ static __inline void aquire_bus(void) { * @notapi */ static __inline void release_bus(void) { + palSetPad(GPIOC, 6); spiReleaseBus(&SPID1); + //TOUCHSCREEN_SPI_EPILOGUE(); } /** @@ -90,8 +94,8 @@ static __inline uint16_t read_value(uint16_t port) { spiExchange(&SPID1, 3, txbuf, rxbuf); ret = (rxbuf[1] << 5) | (rxbuf[2] >> 3); -return 42; - return ret; + + return ret; } #endif /* _GINPUT_LLD_MOUSE_BOARD_H */ diff --git a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_config.h b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_config.h index de04e1f0..7462b9f2 100644 --- a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_config.h +++ b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_config.h @@ -28,7 +28,7 @@ #define _LLD_GINPUT_MOUSE_CONFIG_H #define GINPUT_MOUSE_EVENT_TYPE GEVENT_TOUCH -#define GINPUT_MOUSE_NEED_CALIBRATION FALSE +#define GINPUT_MOUSE_NEED_CALIBRATION TRUE #define GINPUT_MOUSE_LLD_CALIBRATION_LOADSAVE FALSE #define GINPUT_MOUSE_MAX_CALIBRATION_ERROR 4 #define GINPUT_MOUSE_READ_CYCLES 4 -- cgit v1.2.3 From de85a1496e28bdbeb716c432161e7271ca3358ec Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Thu, 29 Nov 2012 00:45:17 +0100 Subject: removed xxx_unknown.h board files from ginput drivers --- .../touch/ADS7843/ginput_lld_mouse_board_unknown.h | 97 ------------ .../touch/MCU/ginput_lld_mouse_board_unknown.h | 174 --------------------- 2 files changed, 271 deletions(-) delete mode 100644 drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_unknown.h delete mode 100644 drivers/ginput/touch/MCU/ginput_lld_mouse_board_unknown.h diff --git a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_unknown.h b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_unknown.h deleted file mode 100644 index 510a1525..00000000 --- a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_unknown.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - ChibiOS/GFX - Copyright (C) 2012 - Joel Bodenmann aka Tectu - - This file is part of ChibiOS/GFX. - - ChibiOS/GFX 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/GFX 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 . -*/ - -/** - * @file drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_unknown.h - * @brief GINPUT Touch low level driver source for the ADS7843 on some unknown board. - * - * @addtogroup GINPUT_MOUSE - * @{ - */ - -#ifndef _GINPUT_LLD_MOUSE_BOARD_H -#define _GINPUT_LLD_MOUSE_BOARD_H - -/** - * @brief Initialise the board for the touch. - * - * @notapi - */ -static __inline void init_board(void) { - spiStart(TOUCH_SPIDriver, TOUCH_SPIConfig); -} - -/** - * @brief Check whether the surface is currently touched - * @return TRUE if the surface is currently touched - * - * @notapi - */ -static __inline bool_t getpin_pressed(void) { - return !palReadPad(TOUCH_PressedPort, TOUCH_PressedPin); -} - -/** - * @brief Aquire the bus ready for readings - * - * @notapi - */ -static __inline void aquire_bus(void) { - #if defined(SPI_USE_MUTUAL_EXCLUSION) - spiAcquireBus(TOUCH_SPIDriver); - #endif - - GINPUT_TOUCH_SPI_PROLOGUE(); - palClearPad(TOUCH_SPIConfig->ssport, TOUCH_SPIConfig->sspad); -} - -/** - * @brief Release the bus after readings - * - * @notapi - */ -static __inline void release_bus(void) { - palSetPad(TOUCH_SPIConfig->ssport, TOUCH_SPIConfig->sspad); - GINPUT_TOUCH_SPI_EPILOGUE(); - - #if defined(SPI_USE_MUTUAL_EXCLUSION) - spiReleaseBus(tsDriver->spip); - #endif -} - -/** - * @brief Read a value from touch controller - * @return The value read from the controller - * - * params[in] port The controller port to read. - * - * @notapi - */ -static __inline uint16_t read_value(uint16_t port) { - static uint8_t txbuf[3] = {0}; - static uint8_t rxbuf[3] = {0}; - - txbuf[0] = cmd; - spiExchange(TOUCH_SPIDriver, 3, txbuf, rxbuf); - return (rxbuf[1] << 5) | (rxbuf[2] >> 3); -} - -#endif /* _GINPUT_LLD_MOUSE_BOARD_H */ -/** @} */ diff --git a/drivers/ginput/touch/MCU/ginput_lld_mouse_board_unknown.h b/drivers/ginput/touch/MCU/ginput_lld_mouse_board_unknown.h deleted file mode 100644 index f16661c8..00000000 --- a/drivers/ginput/touch/MCU/ginput_lld_mouse_board_unknown.h +++ /dev/null @@ -1,174 +0,0 @@ -/* - ChibiOS/GFX - Copyright (C) 2012 - Joel Bodenmann aka Tectu - - This file is part of ChibiOS/GFX. - - ChibiOS/GFX 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/GFX 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 . -*/ - -/** - * @file drivers/ginput/touch/MCU/ginput_lld_mouse_board_unknown.h - * @brief GINPUT Touch low level driver source for the MCU on some unknown board. - * - * @addtogroup GINPUT_MOUSE - * @{ - */ - -#ifndef _GINPUT_LLD_MOUSE_BOARD_H -#define _GINPUT_LLD_MOUSE_BOARD_H - -#define ADC_NUM_CHANNELS 2 -#define ADC_BUF_DEPTH 1 - -static const ADCConversionGroup adc_y_config = { - FALSE, - ADC_NUM_CHANNELS, - NULL, - NULL, - 0, 0, - 0, 0, - ADC_SQR1_NUM_CH(ADC_NUM_CHANNELS), - 0, - ADC_SQR3_SQ2_N(ADC_CHANNEL_IN12) | ADC_SQR3_SQ1_N(ADC_CHANNEL_IN13) -}; - -static const ADCConversionGroup adc_x_config = { - FALSE, - ADC_NUM_CHANNELS, - NULL, - NULL, - 0, 0, - 0, 0, - ADC_SQR1_NUM_CH(ADC_NUM_CHANNELS), - 0, - ADC_SQR3_SQ2_N(ADC_CHANNEL_IN10) | ADC_SQR3_SQ1_N(ADC_CHANNEL_IN11) -}; - -/** - * @brief Initialise the board for the mouse/touch. - * - * @notapi - */ -static __inline void init_board(void) { - /* Code here */ - #error "ginputMCU: You must supply a definition for init_board for your board - - adcStart(ts->adc_driver, NULL); -} - -/** - * @brief Check whether the surface is currently touched - * @return TRUE if the surface is currently touched - * - * @notapi - */ -static __inline bool_t getpin_pressed(void) { - /* Code here */ - #error "ginputMCU: You must supply a definition for getpin_pressed for your board" - palSetPadMode(ts->yd_port, ts->yd_pin, PAL_MODE_INPUT_PULLDOWN); - palSetPadMode(ts->yu_port, ts->yu_pin, PAL_MODE_INPUT); - palSetPadMode(ts->xl_port, ts->xl_pin, PAL_MODE_INPUT); - palSetPadMode(ts->xr_port, ts->xr_pin, PAL_MODE_OUTPUT_PUSHPULL); - palSetPad(ts->xr_port, ts->xr_pin); - - return palReadPad(ts->yd_port, ts->yd_pin); -} - -/** - * @brief Aquire the bus ready for readings - * - * @notapi - */ -static __inline void aquire_bus(void) { - /* Code here */ - #error "ginputMCU: You must supply a definition for aquire_bus for your board" -} - -/** - * @brief Release the bus after readings - * - * @notapi - */ -static __inline void release_bus(void) { - /* Code here */ - #error "ginputMCU: You must supply a definition for release_bus for your board" -} - -/** - * @brief Read an x value from touch controller - * @return The value read from the controller - * - * @notapi - */ -static __inline uint16_t read_x_value(void) { - /* Code here */ - #error "ginputMCU: You must supply a definition for read_x_value for your board" - uint16_t val1, val2; - adcsample_t samples[ADC_NUM_CHANNELS * ADC_BUF_DEPTH]; - - palSetPadMode(ts->yd_port, ts->yd_pin, PAL_MODE_INPUT_ANALOG); - palSetPadMode(ts->yu_port, ts->yu_pin, PAL_MODE_INPUT_ANALOG); - palSetPadMode(ts->xl_port, ts->xl_pin, PAL_MODE_OUTPUT_PUSHPULL); - palSetPadMode(ts->xr_port, ts->xr_pin, PAL_MODE_OUTPUT_PUSHPULL); - - palSetPad(ts->xl_port, ts->xl_pin); - palClearPad(ts->xr_port, ts->xr_pin); - chThdSleepMilliseconds(1); - adcConvert(ts->adc_driver, &adc_x_config, samples, ADC_BUF_DEPTH); - val1 = ((samples[0] + samples[1])/2); - - palClearPad(ts->xl_port, ts->xl_pin); - palSetPad(ts->xr_port, ts->xr_pin); - chThdSleepMilliseconds(1); - adcConvert(ts->adc_driver, &adc_x_config, samples, ADC_BUF_DEPTH); - val2 = ((samples[0] + samples[1])/2); - - return ((val1+((1<<12)-val2))/4); -} - -/** - * @brief Read an y value from touch controller - * @return The value read from the controller - * - * @notapi - */ -static __inline uint16_t read_y_value(void) { - /* Code here */ - #error "ginputMCU: You must supply a definition for read_y_value for your board" - uint16_t val1, val2; - adcsample_t samples[ADC_NUM_CHANNELS * ADC_BUF_DEPTH]; - - palSetPadMode(ts->xl_port, ts->xl_pin, PAL_MODE_INPUT_ANALOG); - palSetPadMode(ts->xr_port, ts->xr_pin, PAL_MODE_INPUT_ANALOG); - palSetPadMode(ts->yd_port, ts->yd_pin, PAL_MODE_OUTPUT_PUSHPULL); - palSetPadMode(ts->yu_port, ts->yu_pin, PAL_MODE_OUTPUT_PUSHPULL); - - palSetPad(ts->yu_port, ts->yu_pin); - palClearPad(ts->yd_port, ts->yd_pin); - chThdSleepMilliseconds(1); - adcConvert(ts->adc_driver, &adc_y_config, samples, ADC_BUF_DEPTH); - val1 = ((samples[0] + samples[1])/2); - - palClearPad(ts->yu_port, ts->yu_pin); - palSetPad(ts->yd_port, ts->yd_pin); - chThdSleepMilliseconds(1); - adcConvert(ts->adc_driver, &adc_y_config, samples, ADC_BUF_DEPTH); - val2 = ((samples[0] + samples[1])/2); - - return ((val1+((1<<12)-val2))/4); -} - -#endif /* _GINPUT_LLD_MOUSE_BOARD_H */ -/** @} */ -- cgit v1.2.3 From 62dee0d3515a63a0fa25f4506dc765ecab29c1f5 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Thu, 29 Nov 2012 01:20:54 +0100 Subject: porting of the touchscreen/MCU driver to ginput - not working yet --- drivers/ginput/touch/MCU/ginput_lld_mouse.c | 12 ++++++++---- drivers/ginput/touch/MCU/ginput_lld_mouse_config.h | 8 ++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/ginput/touch/MCU/ginput_lld_mouse.c b/drivers/ginput/touch/MCU/ginput_lld_mouse.c index b3405989..d0a3c42e 100644 --- a/drivers/ginput/touch/MCU/ginput_lld_mouse.c +++ b/drivers/ginput/touch/MCU/ginput_lld_mouse.c @@ -31,13 +31,15 @@ #if (GFX_USE_GINPUT && GINPUT_NEED_MOUSE) /*|| defined(__DOXYGEN__)*/ -#include "lld/ginput/touch.h" +#include "gdisp.h" /* for coord_t */ +#include "gevent.h" +#include "ginput/ginput_mouse.h" /* for GINPUT_TOUCH_PRESSED */ +#include "lld/ginput/mouse.h" #if defined(GINPUT_MOUSE_USE_CUSTOM_BOARD) && GINPUT_MOUSE_USE_CUSTOM_BOARD - /* Include the user supplied board definitions */ #include "ginput_lld_mouse_board.h" -//#elif defined(BOARD_OLIMEX_SAM7_EX256) -// #include "ginput_lld_mouse_board_olimexsam7ex256.h" +#elif defined(BOARD_OLIMEX_STM32_LCD) + #include "ginput_lld_mouse_board_olimex_stm32_lcd.h" #else #include "ginput_lld_mouse_board.h" #endif @@ -92,6 +94,8 @@ void ginput_lld_mouse_init(void) { * @notapi */ void ginput_lld_mouse_get_reading(MouseReading *pt) { + uint16_t i; + // If touch-off return the previous results if (!getpin_pressed()) { pt->x = lastx; diff --git a/drivers/ginput/touch/MCU/ginput_lld_mouse_config.h b/drivers/ginput/touch/MCU/ginput_lld_mouse_config.h index d56be229..e1aa15f3 100644 --- a/drivers/ginput/touch/MCU/ginput_lld_mouse_config.h +++ b/drivers/ginput/touch/MCU/ginput_lld_mouse_config.h @@ -28,13 +28,13 @@ #define _LLD_GINPUT_MOUSE_CONFIG_H #define GINPUT_MOUSE_EVENT_TYPE GEVENT_TOUCH -#define GINPUT_MOUSE_NEED_CALIBRATION TRUE +#define GINPUT_MOUSE_NEED_CALIBRATION FALSE #define GINPUT_MOUSE_LLD_CALIBRATION_LOADSAVE FALSE -#define GINPUT_MOUSE_MAX_CALIBRATION_ERROR 2 +#define GINPUT_MOUSE_MAX_CALIBRATION_ERROR -1 #define GINPUT_MOUSE_READ_CYCLES 4 #define GINPUT_MOUSE_POLL_PERIOD 100 -#define GINPUT_MOUSE_MAX_CLICK_JITTER 2 -#define GINPUT_MOUSE_MAX_MOVE_JITTER 2 +#define GINPUT_MOUSE_MAX_CLICK_JITTER 4 +#define GINPUT_MOUSE_MAX_MOVE_JITTER 4 #define GINPUT_MOUSE_CLICK_TIME 700 #endif /* _LLD_GINPUT_MOUSE_CONFIG_H */ -- cgit v1.2.3 From 5bfa0f26220588359342d4bf14add6dc53b4788b Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Thu, 29 Nov 2012 01:21:36 +0100 Subject: ginput/touch/MCU Olimex STM32 LCD board file --- .../MCU/ginput_lld_mouse_board_olimex_stm32_lcd.h | 163 +++++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 drivers/ginput/touch/MCU/ginput_lld_mouse_board_olimex_stm32_lcd.h diff --git a/drivers/ginput/touch/MCU/ginput_lld_mouse_board_olimex_stm32_lcd.h b/drivers/ginput/touch/MCU/ginput_lld_mouse_board_olimex_stm32_lcd.h new file mode 100644 index 00000000..cde1ba77 --- /dev/null +++ b/drivers/ginput/touch/MCU/ginput_lld_mouse_board_olimex_stm32_lcd.h @@ -0,0 +1,163 @@ +/* + ChibiOS/GFX - Copyright (C) 2012 + Joel Bodenmann aka Tectu + + This file is part of ChibiOS/GFX. + + ChibiOS/GFX 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/GFX 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 . +*/ + +/** + * @file drivers/ginput/touch/MCU/ginput_lld_mouse_board_olimex_stm32_lcd.h + * @brief GINPUT Touch low level driver source for the MCU on the example board. + * + * @addtogroup GINPUT_MOUSE + * @{ + */ + +#ifndef _GINPUT_LLD_MOUSE_BOARD_H +#define _GINPUT_LLD_MOUSE_BOARD_H + +#define ADC_NUM_CHANNELS 2 +#define ADC_BUF_DEPTH 1 + +static const ADCConversionGroup adc_y_config = { + FALSE, + ADC_NUM_CHANNELS, + NULL, + NULL, + 0, 0, + 0, 0, + ADC_SQR1_NUM_CH(ADC_NUM_CHANNELS), + 0, + ADC_SQR3_SQ2_N(ADC_CHANNEL_IN12) | ADC_SQR3_SQ1_N(ADC_CHANNEL_IN13) +}; + +static const ADCConversionGroup adc_x_config = { + FALSE, + ADC_NUM_CHANNELS, + NULL, + NULL, + 0, 0, + 0, 0, + ADC_SQR1_NUM_CH(ADC_NUM_CHANNELS), + 0, + ADC_SQR3_SQ2_N(ADC_CHANNEL_IN10) | ADC_SQR3_SQ1_N(ADC_CHANNEL_IN11) +}; + +/** + * @brief Initialise the board for the touch. + * + * @notapi + */ +static __inline void init_board(void) { + adcStart(&ADCD1, NULL); +} + +/** + * @brief Check whether the surface is currently touched + * @return TRUE if the surface is currently touched + * + * @notapi + */ +static __inline bool_t getpin_pressed(void) { + palSetPadMode(GPIOC, 0, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOC, 1, PAL_MODE_INPUT); + palSetPadMode(GPIOC, 2, PAL_MODE_INPUT); + palSetPadMode(GPIOC, 3, PAL_MODE_OUTPUT_PUSHPULL); + palSetPad(GPIOC, 3); + + return palReadPad(GPIOC, 0); +} + +/** + * @brief Aquire the bus ready for readings + * + * @notapi + */ +static __inline void aquire_bus(void) { + +} + +/** + * @brief Release the bus after readings + * + * @notapi + */ +static __inline void release_bus(void) { + +} + +/** + * @brief Read an x value from touch controller + * @return The value read from the controller + * + * @notapi + */ +static __inline uint16_t read_x_value(void) { + uint16_t val1, val2; + adcsample_t samples[ADC_NUM_CHANNELS * ADC_BUF_DEPTH]; + + palSetPadMode(GPIOC, 0, PAL_MODE_INPUT_ANALOG); + palSetPadMode(GPIOC, 1, PAL_MODE_INPUT_ANALOG); + palSetPadMode(GPIOC, 2, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOC, 3, PAL_MODE_OUTPUT_PUSHPULL); + + palSetPad(GPIOC, 2); + palClearPad(GPIOC, 3); + chThdSleepMilliseconds(1); + adcConvert(&ADCD1, &adc_x_config, samples, ADC_BUF_DEPTH); + val1 = ((samples[0] + samples[1])/2); + + palClearPad(GPIOC, 2); + palSetPad(GPIOC, 3); + chThdSleepMilliseconds(1); + adcConvert(&ADCD1, &adc_x_config, samples, ADC_BUF_DEPTH); + val2 = ((samples[0] + samples[1])/2); + + return ((val1+((1<<12)-val2))/4); +} + +/** + * @brief Read an y value from touch controller + * @return The value read from the controller + * + * @notapi + */ +static __inline uint16_t read_y_value(void) { + uint16_t val1, val2; + adcsample_t samples[ADC_NUM_CHANNELS * ADC_BUF_DEPTH]; + + palSetPadMode(GPIOC, 2, PAL_MODE_INPUT_ANALOG); + palSetPadMode(GPIOC, 3, PAL_MODE_INPUT_ANALOG); + palSetPadMode(GPIOC, 0, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOC, 1, PAL_MODE_OUTPUT_PUSHPULL); + + palSetPad(GPIOC, 1); + palClearPad(GPIOC, 0); + chThdSleepMilliseconds(1); + adcConvert(&ADCD1, &adc_y_config, samples, ADC_BUF_DEPTH); + val1 = ((samples[0] + samples[1])/2); + + palClearPad(GPIOC, 0); + palSetPad(GPIOC, 1); + chThdSleepMilliseconds(1); + adcConvert(&ADCD1, &adc_y_config, samples, ADC_BUF_DEPTH); + val2 = ((samples[0] + samples[1])/2); + + return ((val1+((1<<12)-val2))/4); +} + +#endif /* _GINPUT_LLD_MOUSE_BOARD_H */ +/** @} */ -- cgit v1.2.3