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:
- 1:65f5b13e6177
- Parent:
- 0:4907da2299a4
- Child:
- 2:bd4b620316aa
diff -r 4907da2299a4 -r 65f5b13e6177 main.cpp --- a/main.cpp Wed Jan 01 12:51:18 2020 +0000 +++ b/main.cpp Wed Jan 01 12:58:46 2020 +0000 @@ -17,144 +17,7 @@ int main() { - /* - //rdy.mode(PullUp); - - I2C i2c(p28,p27); - i2c.frequency(400000); - - ////////////////// - //AcknowledgeReset - ////////////////// - - //write - i2c.start(); - i2c.write(0x74<<1); - i2c.write(0x04); - i2c.write(0x31); - i2c.write(0x80); - i2c.stop(); - - ////////////// - // get version - ////////////// - - //read - i2c.start(); - i2c.write(0x74<<1); - i2c.write(0x00); - i2c.write(0x00); - i2c.start(); - i2c.write((0x74<<1) + 0x01); - int test0 = i2c.read(1); - int test1 = i2c.read(1); - int test2 = i2c.read(1); - int test3 = i2c.read(1); - int test4 = i2c.read(1); - int test5 = i2c.read(0); - i2c.stop(); - // out - printf("Product %d ", (test0<<8)+test1); - printf("Project %d ", (test2<<8)+test3); - printf("Version %d.%d\n", test4, test5); - - //////////////// - //get swipe dist - //////////////// - - //write - i2c.start(); - i2c.write(0x74<<1); - i2c.write(0x06); - i2c.write(0xC1); - i2c.write(0x00); - i2c.write(0xB4); - i2c.stop(); - //read - i2c.start(); - i2c.write(0x74<<1); - i2c.write(0x06); - i2c.write(0xC1); - i2c.start(); - i2c.write((0x74<<1) + 0x01); - test0 = i2c.read(1); - test1 = i2c.read(0); - i2c.stop(); - printf("Swp init dist. : %d\n", (test0<<8)+test1); - - //////////// - //Rx mapping - //////////// - - //read - i2c.start(); - i2c.write(0x74<<1); - i2c.write(0x06); - i2c.write(0x3F); - i2c.start(); - i2c.write((0x74<<1) + 0x01); - test0 = i2c.read(1); - test1 = i2c.read(1); - test2 = i2c.read(1); - test3 = i2c.read(1); - test4 = i2c.read(1); - test5 = i2c.read(1); - int test6 = i2c.read(1); - int test7 = i2c.read(0); - i2c.stop(); - printf("mapping Rx : %d, %d, %d, %d, %d, %d, %d, %d\n", test0, test1, test2, test3, test4, test5, test6, test7); - - //////////// - //Tx mapping - //////////// - - //read - i2c.start(); - i2c.write(0x74<<1); - i2c.write(0x06); - i2c.write(0x49); - i2c.start(); - i2c.write((0x74<<1) + 0x01); - test0 = i2c.read(1); - test1 = i2c.read(1); - test2 = i2c.read(1); - test3 = i2c.read(1); - test4 = i2c.read(1); - test5 = i2c.read(1); - test6 = i2c.read(1); - test7 = i2c.read(0); - i2c.stop(); - printf("mapping Tx : %d, %d, %d, %d, %d, %d, %d, %d\n", test0, test1, test2, test3, test4, test5, test6, test7); - - ///////////////////// - //nombre cannaux Rx : - ///////////////////// - - //read - i2c.start(); - i2c.write(0x74<<1); - i2c.write(0x06); - i2c.write(0x3D); - i2c.start(); - i2c.write((0x74<<1) + 0x01); - test0 = i2c.read(0); - i2c.stop(); - printf("nombre cannaux Rx : %d\n", test0); - - ///////////////////// - //nombre cannaux Tx : - ///////////////////// - - //read - i2c.start(); - i2c.write(0x74<<1); - i2c.write(0x06); - i2c.write(0x3E); - i2c.start(); - i2c.write((0x74<<1) + 0x01); - test0 = i2c.read(0); - i2c.stop(); - printf("nombre cannaux Tx : %d\n", test0); */ + rdy.mode(PullUp); //rdyInter.rise(&ISR1);