this is a first compilation of a library for IQS5xx. For now, it work with the iqs572ev02 devellopment board. The code is inspired with the sample code provide by Azotech. I have some issu with the interrupt pin RDY, which seem to be high even I don't touch de board.
Diff: main.cpp
- Revision:
- 2:bd4b620316aa
- Parent:
- 1:65f5b13e6177
--- a/main.cpp Wed Jan 01 12:58:46 2020 +0000 +++ b/main.cpp Wed Jan 01 16:39:19 2020 +0000 @@ -5,36 +5,13 @@ IQS5xx trackPad(p28, p27, p17); DigitalOut led1(LED1); -DigitalOut led3(LED3); -DigitalOut led4(LED4); -DigitalIn rdy(p17); -//InterruptIn rdyInter(p17); +//DigitalIn rdy(p17); +InterruptIn rdyInter(p17); void ISR1() { //this is the response to interrupt, i.e. the ISR - led3 = !led3; -} -int main() { - - rdy.mode(PullUp); - - //rdyInter.rise(&ISR1); - - trackPad.AcknowledgeReset(); - - trackPad.checkVersion(); - - while(1) { - - uint8_t ui8TempData[30], i; - - while(!rdy) { - led4 = 1; - wait(0.05); - led4 = 0; - wait(0.05); - } + uint8_t ui8TempData[30], i; trackPad.I2C_Read(GestureEvents0_adr, &trackPad.Data_Buff[0], 44); @@ -59,11 +36,26 @@ // Process received data // trackPad.Process_XY(); +} + +int main() { + + //rdy.mode(PullUp); + + rdyInter.rise(&ISR1); + + trackPad.AcknowledgeReset(); + + trackPad.checkVersion(); + + while(1) { + + led1 = 1; - wait(0.01); + wait(0.5); led1 = 0; - wait(0.01); + wait(0.5); } }