STMPE811 fixes - still not working
This commit is contained in:
parent
d6b4af4ff6
commit
6343a2e844
2 changed files with 5 additions and 4 deletions
|
@ -31,6 +31,9 @@
|
||||||
// If TRUE this is a really slow CPU and we should always clear the FIFO between reads.
|
// If TRUE this is a really slow CPU and we should always clear the FIFO between reads.
|
||||||
#define GMOUSE_STMPE811_SLOW_CPU FALSE
|
#define GMOUSE_STMPE811_SLOW_CPU FALSE
|
||||||
|
|
||||||
|
// Maximum timeout
|
||||||
|
#define STMPE811_TIMEOUT 0x3000
|
||||||
|
|
||||||
static const I2CConfig i2ccfg = {
|
static const I2CConfig i2ccfg = {
|
||||||
OPMODE_I2C,
|
OPMODE_I2C,
|
||||||
400000,
|
400000,
|
||||||
|
@ -41,7 +44,7 @@ static bool_t init_board(GMouse* m, unsigned driverinstance) {
|
||||||
(void) m;
|
(void) m;
|
||||||
|
|
||||||
// This board only supports one touch panel
|
// This board only supports one touch panel
|
||||||
if (driverInstance)
|
if (driverinstance)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
palSetPadMode(GPIOC, 13, PAL_MODE_INPUT | PAL_STM32_PUDR_FLOATING); /* TP IRQ */
|
palSetPadMode(GPIOC, 13, PAL_MODE_INPUT | PAL_STM32_PUDR_FLOATING); /* TP IRQ */
|
||||||
|
@ -49,6 +52,7 @@ static bool_t init_board(GMouse* m, unsigned driverinstance) {
|
||||||
palSetPadMode(GPIOB, 9, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN); /* SDA */
|
palSetPadMode(GPIOB, 9, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN); /* SDA */
|
||||||
|
|
||||||
i2cStart(&I2CD1, &i2ccfg);
|
i2cStart(&I2CD1, &i2ccfg);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,9 +11,6 @@
|
||||||
// Slave address
|
// Slave address
|
||||||
#define STMPE811_ADDR (0x82 >> 1)
|
#define STMPE811_ADDR (0x82 >> 1)
|
||||||
|
|
||||||
// Maximum timeout
|
|
||||||
#define STMPE811_TIMEOUT 0x3000
|
|
||||||
|
|
||||||
// Identification registers
|
// Identification registers
|
||||||
#define STMPE811_REG_CHP_ID 0x00 // 16-bit
|
#define STMPE811_REG_CHP_ID 0x00 // 16-bit
|
||||||
#define STMPE811_REG_ID_VER 0x02
|
#define STMPE811_REG_ID_VER 0x02
|
||||||
|
|
Loading…
Add table
Reference in a new issue