2013-05-03 14:36:17 +00:00
|
|
|
/*
|
2013-06-15 11:37:22 +00:00
|
|
|
* This file is subject to the terms of the GFX License. If a copy of
|
2013-05-03 14:36:17 +00:00
|
|
|
* the license was not distributed with this file, you can obtain one at:
|
|
|
|
*
|
2013-07-21 20:20:37 +00:00
|
|
|
* http://ugfx.org/license.html
|
2013-05-03 14:36:17 +00:00
|
|
|
*/
|
2013-07-21 15:42:25 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @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) {
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2013-11-25 12:53:11 +00:00
|
|
|
* @brief Acquire the bus ready for readings
|
2013-07-21 15:42:25 +00:00
|
|
|
*
|
|
|
|
* @notapi
|
|
|
|
*/
|
2013-11-25 12:53:11 +00:00
|
|
|
static inline void aquire_bus(void) {
|
2013-07-21 15:42:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2013-11-25 12:53:11 +00:00
|
|
|
* @brief Release the bus after readings
|
2013-07-21 15:42:25 +00:00
|
|
|
*
|
|
|
|
* @notapi
|
|
|
|
*/
|
2013-11-25 12:53:11 +00:00
|
|
|
static inline void release_bus(void) {
|
|
|
|
}
|
2013-07-21 15:42:25 +00:00
|
|
|
|
2013-11-25 12:53:11 +00:00
|
|
|
/**
|
|
|
|
* @brief Set up the device for a x coordinate read
|
|
|
|
* @note This is performed once followed by multiple
|
|
|
|
* x coordinate read's (which are then median filtered)
|
|
|
|
*
|
|
|
|
* @notapi
|
|
|
|
*/
|
|
|
|
static inline void setup_x(void) {
|
2013-07-21 15:42:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2013-11-25 12:53:11 +00:00
|
|
|
* @brief Set up the device for a y coordinate read
|
|
|
|
* @note This is performed once followed by multiple
|
|
|
|
* y coordinate read's (which are then median filtered)
|
2013-07-21 15:42:25 +00:00
|
|
|
*
|
|
|
|
* @notapi
|
|
|
|
*/
|
2013-11-25 12:53:11 +00:00
|
|
|
static inline void setup_y(void) {
|
|
|
|
}
|
2013-07-21 15:42:25 +00:00
|
|
|
|
2013-11-25 12:53:11 +00:00
|
|
|
/**
|
|
|
|
* @brief Set up the device for a z coordinate (pressure) read
|
|
|
|
* @note This is performed once followed by multiple
|
|
|
|
* z coordinate read's (which are then median filtered)
|
|
|
|
*
|
|
|
|
* @notapi
|
|
|
|
*/
|
|
|
|
static inline void setup_z(void) {
|
|
|
|
palClearPad(GPIOB, GPIOB_DRIVEA);
|
|
|
|
palClearPad(GPIOB, GPIOB_DRIVEB);
|
|
|
|
chThdSleepMilliseconds(2);
|
2013-07-21 15:42:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Read an x value from touch controller
|
|
|
|
* @return The value read from the controller
|
|
|
|
*
|
|
|
|
* @notapi
|
|
|
|
*/
|
2013-11-25 12:53:11 +00:00
|
|
|
static inline uint16_t read_x(void) {
|
2013-07-21 15:42:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2013-11-25 12:53:11 +00:00
|
|
|
* @brief Read a y value from touch controller
|
2013-07-21 15:42:25 +00:00
|
|
|
* @return The value read from the controller
|
|
|
|
*
|
|
|
|
* @notapi
|
|
|
|
*/
|
2013-11-25 12:53:11 +00:00
|
|
|
static inline uint16_t read_y(void) {
|
|
|
|
}
|
2013-07-21 15:42:25 +00:00
|
|
|
|
2013-11-25 12:53:11 +00:00
|
|
|
/**
|
|
|
|
* @brief Read a z value from touch controller
|
|
|
|
* @return The value read from the controller.
|
|
|
|
* @note The return value must be scaled between 0 and 100.
|
|
|
|
* Values over 80 are considered as "touch" down.
|
|
|
|
*
|
|
|
|
* @notapi
|
|
|
|
*/
|
|
|
|
static inline uint16_t read_z(void) {
|
2013-07-21 15:42:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* _GINPUT_LLD_MOUSE_BOARD_H */
|
|
|
|
/** @} */
|
|
|
|
|