aboutsummaryrefslogtreecommitdiffstats
path: root/boards
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2014-11-07 12:05:23 +1000
committerinmarket <andrewh@inmarket.com.au>2014-11-07 12:05:23 +1000
commit2a1c7785ccd0cb0b4675c06c2c48e270e7d926e4 (patch)
treedb076068f876343bcc409fb7df26ec526bb3e88f /boards
parentd0f8c12a2d79d6328269a7931fdf673bd23f4dc7 (diff)
downloaduGFX-2a1c7785ccd0cb0b4675c06c2c48e270e7d926e4.tar.gz
uGFX-2a1c7785ccd0cb0b4675c06c2c48e270e7d926e4.tar.bz2
uGFX-2a1c7785ccd0cb0b4675c06c2c48e270e7d926e4.zip
Fix the newmouse STMPE811 driver.
Finalise the STM32F429i-Discovery board file for that touch controller
Diffstat (limited to 'boards')
-rw-r--r--boards/base/Embest-STM32-DMSTF4BB/gmouse_lld_STMPE811_board.h15
-rw-r--r--boards/base/STM32F429i-Discovery/gmouse_lld_STMPE811_board.h18
2 files changed, 20 insertions, 13 deletions
diff --git a/boards/base/Embest-STM32-DMSTF4BB/gmouse_lld_STMPE811_board.h b/boards/base/Embest-STM32-DMSTF4BB/gmouse_lld_STMPE811_board.h
index f6d0e74c..bbb17010 100644
--- a/boards/base/Embest-STM32-DMSTF4BB/gmouse_lld_STMPE811_board.h
+++ b/boards/base/Embest-STM32-DMSTF4BB/gmouse_lld_STMPE811_board.h
@@ -19,18 +19,21 @@
// How much extra data to allocate at the end of the GMouse structure for the board's use
#define GMOUSE_STMPE811_BOARD_DATA_SIZE 0
-// Set this to TRUE if you want self-calibration.
-// NOTE: This is not as accurate as real calibration.
-// It requires the orientation of the touch panel to match the display.
-// It requires the active area of the touch panel to exactly match the display size.
-#define GMOUSE_STMPE811_SELF_CALIBRATE FALSE
+// Options - Leave these commented to make it user configurable in the gfxconf.h
+//#define GMOUSE_STMPE811_READ_PRESSURE FALSE
+//#define GMOUSE_STMPE811_SELF_CALIBRATE FALSE
+//#define GMOUSE_STMPE811_TEST_MODE FALSE
// If TRUE this board has the STMPE811 IRQ pin connected to a GPIO.
-#define GMOUSE_STMPE811_GPIO_IRQPIN TRUE
+// Note: Although this board has such a pin its reliability has not been tested on this board!!!!!
+#define GMOUSE_STMPE811_GPIO_IRQPIN FALSE
// If TRUE this is a really slow CPU and we should always clear the FIFO between reads.
#define GMOUSE_STMPE811_SLOW_CPU FALSE
+// Slave address
+#define STMPE811_ADDR (0x82 >> 1)
+
// Maximum timeout
#define STMPE811_TIMEOUT 0x3000
diff --git a/boards/base/STM32F429i-Discovery/gmouse_lld_STMPE811_board.h b/boards/base/STM32F429i-Discovery/gmouse_lld_STMPE811_board.h
index 53c15e86..f5bab2b9 100644
--- a/boards/base/STM32F429i-Discovery/gmouse_lld_STMPE811_board.h
+++ b/boards/base/STM32F429i-Discovery/gmouse_lld_STMPE811_board.h
@@ -19,18 +19,20 @@
// How much extra data to allocate at the end of the GMouse structure for the board's use
#define GMOUSE_STMPE811_BOARD_DATA_SIZE 0
-// Set this to TRUE if you want self-calibration.
-// NOTE: This is not as accurate as real calibration.
-// It requires the orientation of the touch panel to match the display.
-// It requires the active area of the touch panel to exactly match the display size.
-#define GMOUSE_STMPE811_SELF_CALIBRATE FALSE
+// Options - Leave these commented to make it user configurable in the gfxconf.h
+//#define GMOUSE_STMPE811_READ_PRESSURE FALSE
+//#define GMOUSE_STMPE811_SELF_CALIBRATE FALSE
+//#define GMOUSE_STMPE811_TEST_MODE FALSE
-// If TRUE this board has the STMPE811 IRQ pin connected to a GPIO.
-#define GMOUSE_STMPE811_GPIO_IRQPIN TRUE
+// Set to FALSE because it does not work properly on this board even though the pin exists.
+#define GMOUSE_STMPE811_GPIO_IRQPIN FALSE
// If TRUE this is a really slow CPU and we should always clear the FIFO between reads.
#define GMOUSE_STMPE811_SLOW_CPU FALSE
+// Slave address
+#define STMPE811_ADDR 0x41
+
// Maximum timeout
#define STMPE811_TIMEOUT 0x3000
@@ -47,10 +49,12 @@ static bool_t init_board(GMouse* m, unsigned driverinstance) {
if (driverinstance)
return FALSE;
+ // Set pin modes
palSetPadMode(GPIOA, 15, PAL_MODE_INPUT | PAL_STM32_PUDR_FLOATING); /* TP IRQ */
palSetPadMode(GPIOA, 8, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN); /* SCL */
palSetPadMode(GPIOC, 9, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN); /* SDA */
+ // Start the I2C
i2cStart(&I2CD3, &i2ccfg);
return TRUE;