Hi Tectu, let's move to another topic with this driver.
I have seen that you uploaded some code for STMPE811. That's great news, and big thanks:)
But I must also say: arrrgh... It was this magic "| PAL_STM32_OTYPE_OPENDRAIN" that prevented me from running my demo:/
I made a few changes/bugfixes in my merge request. It's faaar from being finished but let's have initialization, readings etc. done at least.
I changed STMPE811_REG_ADC_CTRL1 value from 0x49 to 0x48 because its "0" bit is reserved.
Also, for STMPE811_REG_TSC_CFG having 0x9A value the comment is wrong; 0x9A gives: 4 samples averaging, 500 us touch detect delay and 500 us settling time. Value from comment should be 0xA3 - please make a decision (I think 0x9A should be fine, didn't compare to other drivers). I marked it with @TODO.
I made reading working:) But so-called interrupts are not working yet.
And rather esotheric question: how reading should really be done? It's just my rambling, I may be totally wrong:
Code: Select all
uint8_t interrupts;
interrupts = read_reg(STMPE811_REG_INT_STA, 1); // Find out what caused an interrupt
if (interrupts & 0x02) { // If it is FIFO threshold, clear it
write_reg(STMPE811_REG_INT_STA, 1, 0x02);
// Read XYZ values
}