From d98e6c5d0d6c048c99aeda810da10e6a6a130325 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Sun, 21 Jul 2013 17:42:25 +0200 Subject: cleaned up board file mess --- drivers/ginput/touch/ADS7843/ginput_lld_mouse.c | 12 +-- .../touch/ADS7843/ginput_lld_mouse_board_example.h | 75 -------------- .../ADS7843/ginput_lld_mouse_board_template.h | 71 +++++++++++++ drivers/ginput/touch/ADS7843/readme.txt | 8 -- .../ginput/touch/FT5x06/ginput_lld_mouse_board.h | 111 --------------------- .../touch/FT5x06/ginput_lld_mouse_board_example.h | 72 ------------- .../touch/FT5x06/ginput_lld_mouse_board_marlin.h | 111 +++++++++++++++++++++ .../touch/FT5x06/ginput_lld_mouse_board_template.h | 68 +++++++++++++ drivers/ginput/touch/FT5x06/readme.txt | 8 -- .../touch/MCU/ginput_lld_mouse_board_example.h | 85 ---------------- .../touch/MCU/ginput_lld_mouse_board_template.h | 80 +++++++++++++++ drivers/ginput/touch/MCU/readme.txt | 8 -- drivers/ginput/touch/STMPE811/ginput_lld_mouse.c | 8 +- .../STMPE811/ginput_lld_mouse_board_example.h | 75 -------------- .../STMPE811/ginput_lld_mouse_board_template.h | 68 +++++++++++++ drivers/ginput/touch/STMPE811/readme.txt | 20 ---- 16 files changed, 400 insertions(+), 480 deletions(-) delete mode 100644 drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_example.h create mode 100644 drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_template.h delete mode 100644 drivers/ginput/touch/ADS7843/readme.txt delete mode 100644 drivers/ginput/touch/FT5x06/ginput_lld_mouse_board.h delete mode 100644 drivers/ginput/touch/FT5x06/ginput_lld_mouse_board_example.h create mode 100644 drivers/ginput/touch/FT5x06/ginput_lld_mouse_board_marlin.h create mode 100644 drivers/ginput/touch/FT5x06/ginput_lld_mouse_board_template.h delete mode 100644 drivers/ginput/touch/FT5x06/readme.txt delete mode 100644 drivers/ginput/touch/MCU/ginput_lld_mouse_board_example.h create mode 100644 drivers/ginput/touch/MCU/ginput_lld_mouse_board_template.h delete mode 100644 drivers/ginput/touch/MCU/readme.txt delete mode 100644 drivers/ginput/touch/STMPE811/ginput_lld_mouse_board_example.h create mode 100644 drivers/ginput/touch/STMPE811/ginput_lld_mouse_board_template.h delete mode 100644 drivers/ginput/touch/STMPE811/readme.txt (limited to 'drivers/ginput') diff --git a/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c b/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c index a25e6bac..f9ebe56d 100644 --- a/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c +++ b/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c @@ -20,17 +20,7 @@ #include "ginput/lld/mouse.h" -#if defined(GINPUT_MOUSE_USE_CUSTOM_BOARD) && GINPUT_MOUSE_USE_CUSTOM_BOARD - #include "ginput_lld_mouse_board.h" -#elif defined(BOARD_FIREBULL_STM32_F103) - #include "ginput_lld_mouse_board_firebull_stm32f103.h" -#elif defined(BOARD_OLIMEX_STM32_E407) - #include "ginput_lld_mouse_board_olimex_stm32_e407.h" -#elif defined(BOARD_ST_STM32F4_DISCOVERY) - #include "ginput_lld_mouse_board_st_stm32f4_discovery.h" -#else - #include "ginput_lld_mouse_board_example.h" -#endif +#include "ginput_lld_mouse_board.h" #if defined(GINPUT_MOUSE_YX_INVERTED) && GINPUT_MOUSE_YX_INVERTED #define CMD_X 0x91 diff --git a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_example.h b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_example.h deleted file mode 100644 index 61f2ee50..00000000 --- a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_example.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * This file is subject to the terms of the GFX License. If a copy of - * the license was not distributed with this file, you can obtain one at: - * - * http://chibios-gfx.com/license.html - */ - -/** - * @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. - * - * @defgroup Mouse Mouse - * @ingroup GINPUT - * @{ - */ - -#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) { - /* Code here */ - #error "ginputADS7843: You must supply a definition for init_board for your board" -} - -/** - * @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 "ginputADS7843: You must supply a definition for getpin_pressed for your board" -} - -/** - * @brief Aquire the bus ready for readings - * - * @notapi - */ -static inline void aquire_bus(void) { - /* Code here */ - #error "ginputADS7843: 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 "ginputADS7843: You must supply a definition for release_bus for your board" -} - -/** - * @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) { - /* Code here */ - #error "ginputADS7843: You must supply a definition for read_value for your board" -} - -#endif /* _GINPUT_LLD_MOUSE_BOARD_H */ -/** @} */ diff --git a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_template.h b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_template.h new file mode 100644 index 00000000..8808d24d --- /dev/null +++ b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_template.h @@ -0,0 +1,71 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://chibios-gfx.com/license.html + */ + +/** + * @file drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_template.h + * @brief GINPUT Touch low level driver source for the ADS7843 on the example board. + * + * @defgroup Mouse Mouse + * @ingroup GINPUT + * @{ + */ + +#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) { + +} + +/** + * @brief Check whether the surface is currently touched + * @return TRUE if the surface is currently touched + * + * @notapi + */ +static inline bool_t getpin_pressed(void) { + +} + +/** + * @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 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) { + +} + +#endif /* _GINPUT_LLD_MOUSE_BOARD_H */ +/** @} */ + diff --git a/drivers/ginput/touch/ADS7843/readme.txt b/drivers/ginput/touch/ADS7843/readme.txt deleted file mode 100644 index abc4b0e9..00000000 --- a/drivers/ginput/touch/ADS7843/readme.txt +++ /dev/null @@ -1,8 +0,0 @@ -To use this driver: - -1. Add in your gfxconf.h: - a) #define GFX_USE_GINPUT TRUE - b) #define GINPUT_NEED_MOUSE TRUE - -2. To your makefile add the following lines: - include $(GFXLIB)/drivers/ginput/touch/ADS7843/ginput_lld.mk diff --git a/drivers/ginput/touch/FT5x06/ginput_lld_mouse_board.h b/drivers/ginput/touch/FT5x06/ginput_lld_mouse_board.h deleted file mode 100644 index 06b408dd..00000000 --- a/drivers/ginput/touch/FT5x06/ginput_lld_mouse_board.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * This file is subject to the terms of the GFX License. If a copy of - * the license was not distributed with this file, you can obtain one at: - * - * http://chibios-gfx.com/license.html - */ - -/** - * @file drivers/ginput/touch/FT5x06/ginput_lld_mouse_board.h - * @brief GINPUT Touch low level driver source for the FT5x06. - * - * @defgroup Mouse Mouse - * @ingroup GINPUT - * @{ - */ - -#ifndef _GINPUT_LLD_MOUSE_BOARD_H -#define _GINPUT_LLD_MOUSE_BOARD_H - -/* I2C interface #2 - Touchscreen controller */ -static const I2CConfig i2ccfg2 = { - OPMODE_I2C, - 400000, - FAST_DUTY_CYCLE_2, -}; - -/** - * @brief Initialise the board for the touch. - * - * @notapi - */ -static void init_board(void) { - -} - - -/** - * @brief Write a value into a certain register - * - * @param[in] reg The register address - * @param[in] n The amount of bytes (one or two) - * @param[in] val The value - * - * @notapi - */ -static void write_reg(uint8_t reg, uint8_t n, uint16_t val) { - uint8_t txbuf[3]; - - i2cAcquireBus(&I2CD2); - - txbuf[0] = reg; - - if (n == 1) { - txbuf[1] = val; - i2cMasterTransmitTimeout(&I2CD2, FT5x06_ADDR, txbuf, 2, NULL, 0, MS2ST(FT5x06_TIMEOUT)); - } else if (n == 2) { - txbuf[1] = ((val & 0xFF00) >> 8); - txbuf[2] = (val & 0x00FF); - i2cMasterTransmitTimeout(&I2CD2, FT5x06_ADDR, txbuf, 3, NULL, 0, MS2ST(FT5x06_TIMEOUT)); - } - - i2cReleaseBus(&I2CD2); -} - -/** - * @brief Read the value of a certain register - * - * @param[in] reg The register address - * @param[in] n The amount of bytes (one or two) - * - * @return Data read from device (one byte or two depending on n param) - * - * @notapi - */ -static uint16_t read_reg(uint8_t reg, uint8_t n) { - uint8_t txbuf[1], rxbuf[2]; - uint16_t ret; - - rxbuf[0] = 0; - rxbuf[1] = 0; - - i2cAcquireBus(&I2CD2); - - txbuf[0] = reg; - i2cMasterTransmitTimeout(&I2CD2, FT5x06_ADDR, txbuf, 1, rxbuf, n, MS2ST(FT5x06_TIMEOUT)); - - if (n == 1) { - ret = rxbuf[0]; - } else if (n == 2) { - ret = ((rxbuf[0] << 8) | (rxbuf[1] & 0xFF)); - } - - i2cReleaseBus(&I2CD2); - - return ret; -} - -static void read_reg_n(uint8_t reg, uint8_t n, uint8_t *rxbuf) { - uint8_t txbuf[1]; - - i2cAcquireBus(&I2CD2); - - txbuf[0] = reg; - i2cMasterTransmitTimeout(&I2CD2, FT5x06_ADDR, txbuf, 1, rxbuf, n, MS2ST(FT5x06_TIMEOUT)); - - i2cReleaseBus(&I2CD2); -} - -#endif /* _GINPUT_LLD_MOUSE_BOARD_H */ -/** @} */ - diff --git a/drivers/ginput/touch/FT5x06/ginput_lld_mouse_board_example.h b/drivers/ginput/touch/FT5x06/ginput_lld_mouse_board_example.h deleted file mode 100644 index 19e824e5..00000000 --- a/drivers/ginput/touch/FT5x06/ginput_lld_mouse_board_example.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * This file is subject to the terms of the GFX License. If a copy of - * the license was not distributed with this file, you can obtain one at: - * - * http://chibios-gfx.com/license.html - */ - -/** - * @file drivers/ginput/touch/FT5x06/ginput_lld_mouse_board_example.h - * @brief GINPUT Touch low level driver source for the FT5x06 on the example board. - * - * @defgroup Mouse Mouse - * @ingroup GINPUT - * @{ - */ - -#ifndef _GINPUT_LLD_MOUSE_BOARD_H -#define _GINPUT_LLD_MOUSE_BOARD_H - -/** - * @brief Initialise the board for the touch. - * - * @notapi - */ -static void init_board(void) { - /* Code here */ - #error "ginputFT5x06: You must supply a definition for init_board for your board" -} - -/** - * @brief Check whether an interrupt is raised - * @return TRUE if there is an interrupt signal present - * - * @notapi - */ -static inline bool_t getpin_irq(void) { - /* Code here */ - #error "ginputFT5x06: You must supply a definition for getpin_irq for your board" -} - -/** - * @brief Write a value into a certain register - * - * @param[in] reg The register address - * @param[in] n The amount of bytes (one or two) - * @param[in] val The value - * - * @notapi - */ -static void write_reg(uint8_t reg, uint8_t n, uint16_t val) { - /* Code here */ - #error "ginputFT5x06: You must supply a definition for write_reg for your board" -} - -/** - * @brief Read the value of a certain register - * - * @param[in] reg The register address - * @param[in] n The amount of bytes (one or two) - * - * @return Data read from device (one byte or two depending on n param) - * - * @notapi - */ -static uint16_t read_reg(uint8_t reg, uint8_t n) { - /* Code here */ - #error "ginputFT5x06: You must supply a definition for read_reg for your board" -} - -#endif /* _GINPUT_LLD_MOUSE_BOARD_H */ -/** @} */ - diff --git a/drivers/ginput/touch/FT5x06/ginput_lld_mouse_board_marlin.h b/drivers/ginput/touch/FT5x06/ginput_lld_mouse_board_marlin.h new file mode 100644 index 00000000..06b408dd --- /dev/null +++ b/drivers/ginput/touch/FT5x06/ginput_lld_mouse_board_marlin.h @@ -0,0 +1,111 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://chibios-gfx.com/license.html + */ + +/** + * @file drivers/ginput/touch/FT5x06/ginput_lld_mouse_board.h + * @brief GINPUT Touch low level driver source for the FT5x06. + * + * @defgroup Mouse Mouse + * @ingroup GINPUT + * @{ + */ + +#ifndef _GINPUT_LLD_MOUSE_BOARD_H +#define _GINPUT_LLD_MOUSE_BOARD_H + +/* I2C interface #2 - Touchscreen controller */ +static const I2CConfig i2ccfg2 = { + OPMODE_I2C, + 400000, + FAST_DUTY_CYCLE_2, +}; + +/** + * @brief Initialise the board for the touch. + * + * @notapi + */ +static void init_board(void) { + +} + + +/** + * @brief Write a value into a certain register + * + * @param[in] reg The register address + * @param[in] n The amount of bytes (one or two) + * @param[in] val The value + * + * @notapi + */ +static void write_reg(uint8_t reg, uint8_t n, uint16_t val) { + uint8_t txbuf[3]; + + i2cAcquireBus(&I2CD2); + + txbuf[0] = reg; + + if (n == 1) { + txbuf[1] = val; + i2cMasterTransmitTimeout(&I2CD2, FT5x06_ADDR, txbuf, 2, NULL, 0, MS2ST(FT5x06_TIMEOUT)); + } else if (n == 2) { + txbuf[1] = ((val & 0xFF00) >> 8); + txbuf[2] = (val & 0x00FF); + i2cMasterTransmitTimeout(&I2CD2, FT5x06_ADDR, txbuf, 3, NULL, 0, MS2ST(FT5x06_TIMEOUT)); + } + + i2cReleaseBus(&I2CD2); +} + +/** + * @brief Read the value of a certain register + * + * @param[in] reg The register address + * @param[in] n The amount of bytes (one or two) + * + * @return Data read from device (one byte or two depending on n param) + * + * @notapi + */ +static uint16_t read_reg(uint8_t reg, uint8_t n) { + uint8_t txbuf[1], rxbuf[2]; + uint16_t ret; + + rxbuf[0] = 0; + rxbuf[1] = 0; + + i2cAcquireBus(&I2CD2); + + txbuf[0] = reg; + i2cMasterTransmitTimeout(&I2CD2, FT5x06_ADDR, txbuf, 1, rxbuf, n, MS2ST(FT5x06_TIMEOUT)); + + if (n == 1) { + ret = rxbuf[0]; + } else if (n == 2) { + ret = ((rxbuf[0] << 8) | (rxbuf[1] & 0xFF)); + } + + i2cReleaseBus(&I2CD2); + + return ret; +} + +static void read_reg_n(uint8_t reg, uint8_t n, uint8_t *rxbuf) { + uint8_t txbuf[1]; + + i2cAcquireBus(&I2CD2); + + txbuf[0] = reg; + i2cMasterTransmitTimeout(&I2CD2, FT5x06_ADDR, txbuf, 1, rxbuf, n, MS2ST(FT5x06_TIMEOUT)); + + i2cReleaseBus(&I2CD2); +} + +#endif /* _GINPUT_LLD_MOUSE_BOARD_H */ +/** @} */ + diff --git a/drivers/ginput/touch/FT5x06/ginput_lld_mouse_board_template.h b/drivers/ginput/touch/FT5x06/ginput_lld_mouse_board_template.h new file mode 100644 index 00000000..3ae7f85c --- /dev/null +++ b/drivers/ginput/touch/FT5x06/ginput_lld_mouse_board_template.h @@ -0,0 +1,68 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://chibios-gfx.com/license.html + */ + +/** + * @file drivers/ginput/touch/FT5x06/ginput_lld_mouse_board_template.h + * @brief GINPUT Touch low level driver source for the FT5x06 on the example board. + * + * @defgroup Mouse Mouse + * @ingroup GINPUT + * @{ + */ + +#ifndef _GINPUT_LLD_MOUSE_BOARD_H +#define _GINPUT_LLD_MOUSE_BOARD_H + +/** + * @brief Initialise the board for the touch. + * + * @notapi + */ +static void init_board(void) { + +} + +/** + * @brief Check whether an interrupt is raised + * @return TRUE if there is an interrupt signal present + * + * @notapi + */ +static inline bool_t getpin_irq(void) { + +} + +/** + * @brief Write a value into a certain register + * + * @param[in] reg The register address + * @param[in] n The amount of bytes (one or two) + * @param[in] val The value + * + * @notapi + */ +static void write_reg(uint8_t reg, uint8_t n, uint16_t val) { + +} + +/** + * @brief Read the value of a certain register + * + * @param[in] reg The register address + * @param[in] n The amount of bytes (one or two) + * + * @return Data read from device (one byte or two depending on n param) + * + * @notapi + */ +static uint16_t read_reg(uint8_t reg, uint8_t n) { + +} + +#endif /* _GINPUT_LLD_MOUSE_BOARD_H */ +/** @} */ + diff --git a/drivers/ginput/touch/FT5x06/readme.txt b/drivers/ginput/touch/FT5x06/readme.txt deleted file mode 100644 index ec3ae757..00000000 --- a/drivers/ginput/touch/FT5x06/readme.txt +++ /dev/null @@ -1,8 +0,0 @@ -To use this driver: - -1. Add in your gfxconf.h: - a) #define GFX_USE_GINPUT TRUE - b) #define GINPUT_NEED_MOUSE TRUE - -2. To your makefile add the following lines: - include $(GFXLIB)/drivers/ginput/touch/FT5x06/ginput_lld.mk diff --git a/drivers/ginput/touch/MCU/ginput_lld_mouse_board_example.h b/drivers/ginput/touch/MCU/ginput_lld_mouse_board_example.h deleted file mode 100644 index 3109f818..00000000 --- a/drivers/ginput/touch/MCU/ginput_lld_mouse_board_example.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * This file is subject to the terms of the GFX License. If a copy of - * the license was not distributed with this file, you can obtain one at: - * - * http://chibios-gfx.com/license.html - */ - -/** - * @file drivers/ginput/touch/MCU/ginput_lld_mouse_board_example.h - * @brief GINPUT Touch low level driver source for the MCU on the example board. - * - * @defgroup Mouse Mouse - * @ingroup GINPUT - * - * @{ - */ - -#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) { - /* Code here */ - #error "ginputMCU: You must supply a definition for init_board for your board" -} - -/** - * @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" -} - -/** - * @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" -} - -/** - * @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" -} - -#endif /* _GINPUT_LLD_MOUSE_BOARD_H */ -/** @} */ diff --git a/drivers/ginput/touch/MCU/ginput_lld_mouse_board_template.h b/drivers/ginput/touch/MCU/ginput_lld_mouse_board_template.h new file mode 100644 index 00000000..e835f020 --- /dev/null +++ b/drivers/ginput/touch/MCU/ginput_lld_mouse_board_template.h @@ -0,0 +1,80 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://chibios-gfx.com/license.html + */ + +/** + * @file drivers/ginput/touch/MCU/ginput_lld_mouse_board_template.h + * @brief GINPUT Touch low level driver source for the MCU on the example board. + * + * @defgroup Mouse Mouse + * @ingroup GINPUT + * + * @{ + */ + +#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) { + +} + +/** + * @brief Check whether the surface is currently touched + * @return TRUE if the surface is currently touched + * + * @notapi + */ +static inline bool_t getpin_pressed(void) { + +} + +/** + * @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) { + +} + +/** + * @brief Read an y value from touch controller + * @return The value read from the controller + * + * @notapi + */ +static inline uint16_t read_y_value(void) { + +} + +#endif /* _GINPUT_LLD_MOUSE_BOARD_H */ +/** @} */ + diff --git a/drivers/ginput/touch/MCU/readme.txt b/drivers/ginput/touch/MCU/readme.txt deleted file mode 100644 index c7bb90f8..00000000 --- a/drivers/ginput/touch/MCU/readme.txt +++ /dev/null @@ -1,8 +0,0 @@ -To use this driver: - -1. Add in your gfxconf.h: - a) #define GFX_USE_GINPUT TRUE - b) #define GINPUT_NEED_MOUSE TRUE - -2. To your makefile add the following lines: - include $(GFXLIB)/drivers/ginput/touch/MCU/ginput_lld.mk diff --git a/drivers/ginput/touch/STMPE811/ginput_lld_mouse.c b/drivers/ginput/touch/STMPE811/ginput_lld_mouse.c index 5e4b78ef..0d6aa147 100644 --- a/drivers/ginput/touch/STMPE811/ginput_lld_mouse.c +++ b/drivers/ginput/touch/STMPE811/ginput_lld_mouse.c @@ -22,13 +22,7 @@ #include "ginput/lld/mouse.h" -#if defined(GINPUT_MOUSE_USE_CUSTOM_BOARD) && GINPUT_MOUSE_USE_CUSTOM_BOARD - #include "ginput_lld_mouse_board.h" -#elif defined(BOARD_EMBEST_DMSTF4BB) - #include "ginput_lld_mouse_board_embest_dmstf4bb.h" -#else - #include "ginput_lld_mouse_board_example.h" -#endif +#include "ginput_lld_mouse_board.h" #ifndef STMP811_NO_GPIO_IRQPIN #define STMP811_NO_GPIO_IRQPIN FALSE diff --git a/drivers/ginput/touch/STMPE811/ginput_lld_mouse_board_example.h b/drivers/ginput/touch/STMPE811/ginput_lld_mouse_board_example.h deleted file mode 100644 index 926fd3fa..00000000 --- a/drivers/ginput/touch/STMPE811/ginput_lld_mouse_board_example.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * This file is subject to the terms of the GFX License. If a copy of - * the license was not distributed with this file, you can obtain one at: - * - * http://chibios-gfx.com/license.html - */ - -/** - * @file drivers/ginput/touch/STMPE811/ginput_lld_mouse_board_example.h - * @brief GINPUT Touch low level driver source for the STMPE811 on the example board. - * - * @defgroup Mouse Mouse - * @ingroup GINPUT - * @{ - */ - -#ifndef _GINPUT_LLD_MOUSE_BOARD_H -#define _GINPUT_LLD_MOUSE_BOARD_H - -/** - * @brief Initialise the board for the touch. - * - * @notapi - */ -static void init_board(void) -{ - /* Code here */ - #error "ginputSTMPE811: You must supply a definition for init_board for your board" -} - -/** - * @brief Check whether an interrupt is raised - * @return TRUE if there is an interrupt signal present - * - * @notapi - */ -static inline bool_t getpin_irq(void) -{ - /* Code here */ - #error "ginputSTMPE811: You must supply a definition for getpin_irq for your board" -} - -/** - * @brief Write a value into a certain register - * - * @param[in] reg The register address - * @param[in] n The amount of bytes (one or two) - * @param[in] val The value - * - * @notapi - */ -static void write_reg(uint8_t reg, uint8_t n, uint16_t val) -{ - /* Code here */ - #error "ginputSTMPE811: You must supply a definition for write_reg for your board" -} - -/** - * @brief Read the value of a certain register - * - * @param[in] reg The register address - * @param[in] n The amount of bytes (one or two) - * - * @return Data read from device (one byte or two depending on n param) - * - * @notapi - */ -static uint16_t read_reg(uint8_t reg, uint8_t n) -{ - /* Code here */ - #error "ginputSTMPE811: You must supply a definition for read_reg for your board" -} - -#endif /* _GINPUT_LLD_MOUSE_BOARD_H */ -/** @} */ diff --git a/drivers/ginput/touch/STMPE811/ginput_lld_mouse_board_template.h b/drivers/ginput/touch/STMPE811/ginput_lld_mouse_board_template.h new file mode 100644 index 00000000..a60da459 --- /dev/null +++ b/drivers/ginput/touch/STMPE811/ginput_lld_mouse_board_template.h @@ -0,0 +1,68 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://chibios-gfx.com/license.html + */ + +/** + * @file drivers/ginput/touch/STMPE811/ginput_lld_mouse_board_template.h + * @brief GINPUT Touch low level driver source for the STMPE811 on the example board. + * + * @defgroup Mouse Mouse + * @ingroup GINPUT + * @{ + */ + +#ifndef _GINPUT_LLD_MOUSE_BOARD_H +#define _GINPUT_LLD_MOUSE_BOARD_H + +/** + * @brief Initialise the board for the touch. + * + * @notapi + */ +static void init_board(void) { + +} + +/** + * @brief Check whether an interrupt is raised + * @return TRUE if there is an interrupt signal present + * + * @notapi + */ +static inline bool_t getpin_irq(void) { + +} + +/** + * @brief Write a value into a certain register + * + * @param[in] reg The register address + * @param[in] n The amount of bytes (one or two) + * @param[in] val The value + * + * @notapi + */ +static void write_reg(uint8_t reg, uint8_t n, uint16_t val) { + +} + +/** + * @brief Read the value of a certain register + * + * @param[in] reg The register address + * @param[in] n The amount of bytes (one or two) + * + * @return Data read from device (one byte or two depending on n param) + * + * @notapi + */ +static uint16_t read_reg(uint8_t reg, uint8_t n) { + +} + +#endif /* _GINPUT_LLD_MOUSE_BOARD_H */ +/** @} */ + diff --git a/drivers/ginput/touch/STMPE811/readme.txt b/drivers/ginput/touch/STMPE811/readme.txt deleted file mode 100644 index 065840d8..00000000 --- a/drivers/ginput/touch/STMPE811/readme.txt +++ /dev/null @@ -1,20 +0,0 @@ -The STMPE811 driver comes with two different #defines to perfectly fit -your application: - - -STMPE811_NO_GPIO_IRQPIN -This Macro is meant to be set in your board file. When you set this macro to -TRUE, the GINPUT module will not use the IRQ lane which might be connected -to a GPIO pin to recognize interrupts by the STMPE811 controller. This -costs a few more I2C calls. -When the interrupt IRQ pin is connected to a GPIO of your MCU, set this -macro to FALSE. - - -STMP811_SLOW_CPU -If you have a slow CPU and you need to take care of your resources, you can -set this macro TRUE. This will save some IRQs and therefore a few I2C calls. -The disadvantage is a little higher response time. -If you don't want to draw continious lines on your display, it's recommended -to set this to TRUE anyways. - -- cgit v1.2.3