aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ginput
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2013-11-25 22:53:11 +1000
committerinmarket <andrewh@inmarket.com.au>2013-11-25 22:53:11 +1000
commitc24ec8daf2f610c24dc8e6fd49be9b7022e9405e (patch)
tree16c1730496c93ec749af40043e8d9f85e50be28b /drivers/ginput
parent299311b4809f225f2757d5f687c48e9667ea34d7 (diff)
downloaduGFX-c24ec8daf2f610c24dc8e6fd49be9b7022e9405e.tar.gz
uGFX-c24ec8daf2f610c24dc8e6fd49be9b7022e9405e.tar.bz2
uGFX-c24ec8daf2f610c24dc8e6fd49be9b7022e9405e.zip
Update template files for the MCU touch driver.
Diffstat (limited to 'drivers/ginput')
-rw-r--r--drivers/ginput/touch/MCU/ginput_lld_mouse_board_template.h55
-rw-r--r--drivers/ginput/touch/MCU/ginput_lld_mouse_config_template.h (renamed from drivers/ginput/touch/MCU/ginput_lld_mouse_config.h)2
2 files changed, 43 insertions, 14 deletions
diff --git a/drivers/ginput/touch/MCU/ginput_lld_mouse_board_template.h b/drivers/ginput/touch/MCU/ginput_lld_mouse_board_template.h
index 2ec5c10b..52af9269 100644
--- a/drivers/ginput/touch/MCU/ginput_lld_mouse_board_template.h
+++ b/drivers/ginput/touch/MCU/ginput_lld_mouse_board_template.h
@@ -24,35 +24,55 @@
* @notapi
*/
static inline void init_board(void) {
-
}
/**
- * @brief Check whether the surface is currently touched
- * @return TRUE if the surface is currently touched
+ * @brief Acquire the bus ready for readings
*
* @notapi
*/
-static inline bool_t getpin_pressed(void) {
-
+static inline void aquire_bus(void) {
}
/**
- * @brief Aquire the bus ready for readings
+ * @brief Release the bus after readings
*
* @notapi
*/
-static inline void aquire_bus(void) {
+static inline void release_bus(void) {
+}
+/**
+ * @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) {
}
/**
- * @brief Release the bus after readings
+ * @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)
*
* @notapi
*/
-static inline void release_bus(void) {
+static inline void setup_y(void) {
+}
+/**
+ * @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);
}
/**
@@ -61,18 +81,27 @@ static inline void release_bus(void) {
*
* @notapi
*/
-static inline uint16_t read_x_value(void) {
-
+static inline uint16_t read_x(void) {
}
/**
- * @brief Read an y value from touch controller
+ * @brief Read a y value from touch controller
* @return The value read from the controller
*
* @notapi
*/
-static inline uint16_t read_y_value(void) {
+static inline uint16_t read_y(void) {
+}
+/**
+ * @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) {
}
#endif /* _GINPUT_LLD_MOUSE_BOARD_H */
diff --git a/drivers/ginput/touch/MCU/ginput_lld_mouse_config.h b/drivers/ginput/touch/MCU/ginput_lld_mouse_config_template.h
index 9864cb3e..0c9e9300 100644
--- a/drivers/ginput/touch/MCU/ginput_lld_mouse_config.h
+++ b/drivers/ginput/touch/MCU/ginput_lld_mouse_config_template.h
@@ -22,7 +22,7 @@
#define GINPUT_MOUSE_NEED_CALIBRATION TRUE
#define GINPUT_MOUSE_LLD_CALIBRATION_LOADSAVE FALSE
#define GINPUT_MOUSE_MAX_CALIBRATION_ERROR 12
-#define GINPUT_MOUSE_READ_CYCLES 4
+#define GINPUT_MOUSE_READ_CYCLES 1
#define GINPUT_MOUSE_POLL_PERIOD 25
#define GINPUT_MOUSE_MAX_CLICK_JITTER 2
#define GINPUT_MOUSE_MAX_MOVE_JITTER 2