aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ginput/touch
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@unormal.org>2012-11-27 00:42:51 +0100
committerJoel Bodenmann <joel@unormal.org>2012-11-27 00:42:51 +0100
commit8bdfc52efed023b492c47bbfd5976db145074b55 (patch)
treec2fa3d86f20832963ff784d25c997930bcf35696 /drivers/ginput/touch
parente6bb13be05b9633dd65f834f8be1948dc7603f6b (diff)
downloaduGFX-8bdfc52efed023b492c47bbfd5976db145074b55.tar.gz
uGFX-8bdfc52efed023b492c47bbfd5976db145074b55.tar.bz2
uGFX-8bdfc52efed023b492c47bbfd5976db145074b55.zip
FireBull STM32F103 board file for GINPUT
Diffstat (limited to 'drivers/ginput/touch')
-rw-r--r--drivers/ginput/touch/ADS7843/ginput_lld_mouse.c2
-rw-r--r--drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_firebull_stm32f103.h19
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 */