FireBull STM32F103 board file for GINPUT
This commit is contained in:
parent
e6bb13be05
commit
8bdfc52efe
2 changed files with 15 additions and 6 deletions
|
@ -32,9 +32,9 @@
|
||||||
#if (GFX_USE_GINPUT && GINPUT_NEED_MOUSE) /*|| defined(__DOXYGEN__)*/
|
#if (GFX_USE_GINPUT && GINPUT_NEED_MOUSE) /*|| defined(__DOXYGEN__)*/
|
||||||
|
|
||||||
#include "gdisp.h" /* for coord_t */
|
#include "gdisp.h" /* for coord_t */
|
||||||
|
#include "gevent.h"
|
||||||
#include "ginput/ginput_mouse.h" /* for GINPUT_TOUCH_PRESSED */
|
#include "ginput/ginput_mouse.h" /* for GINPUT_TOUCH_PRESSED */
|
||||||
#include "lld/ginput/mouse.h"
|
#include "lld/ginput/mouse.h"
|
||||||
#include "gevent.h"
|
|
||||||
|
|
||||||
#if defined(GINPUT_MOUSE_USE_CUSTOM_BOARD) && GINPUT_MOUSE_USE_CUSTOM_BOARD
|
#if defined(GINPUT_MOUSE_USE_CUSTOM_BOARD) && GINPUT_MOUSE_USE_CUSTOM_BOARD
|
||||||
#include "ginput_lld_mouse_board.h"
|
#include "ginput_lld_mouse_board.h"
|
||||||
|
|
|
@ -52,16 +52,15 @@ static __inline void init_board(void) {
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline bool_t getpin_pressed(void) {
|
static __inline bool_t getpin_pressed(void) {
|
||||||
return;
|
return (!palReadPad(GPIOC, 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Aquire the bus ready for readings
|
* @brief Aquire the bus ready for readings
|
||||||
*
|
*
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void aquire_bus(void) {
|
static __inline void aquire_bus(void) {
|
||||||
return;
|
spiAcquireBus(&SPID1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -70,7 +69,7 @@ static __inline void aquire_bus(void) {
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline void release_bus(void) {
|
static __inline void release_bus(void) {
|
||||||
return;
|
spiReleaseBus(&SPID1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -82,7 +81,17 @@ static __inline void release_bus(void) {
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
static __inline uint16_t read_value(uint16_t port) {
|
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 */
|
#endif /* _GINPUT_LLD_MOUSE_BOARD_H */
|
||||||
|
|
Loading…
Add table
Reference in a new issue