FireBull STM32F103 board file for GINPUT

ugfx_release_2.6
Joel Bodenmann 2012-11-27 00:42:51 +01:00
parent e6bb13be05
commit 8bdfc52efe
2 changed files with 15 additions and 6 deletions

View File

@ -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"

View File

@ -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 */