Register Display On Serial Terminal For Azoteq IQS622 Ultra Low Power (5uA) I2C Multi-Function Sensor with Light Sensor + Active (Reflective) IR + Touch + Hall Effect Sensor
A library that performs a register dump of the Azoteq IQS622 ultra low power multisensor registers.
More information on the IQS622 here:
Diff: IQS622DisplayTerminal.cpp
- Revision:
- 4:a9a7666d8a98
- Parent:
- 3:fc73ce1a283a
- Child:
- 5:d095cb71bef0
diff -r fc73ce1a283a -r a9a7666d8a98 IQS622DisplayTerminal.cpp --- a/IQS622DisplayTerminal.cpp Sat May 13 02:35:22 2017 +0000 +++ b/IQS622DisplayTerminal.cpp Sat May 13 20:03:57 2017 +0000 @@ -65,19 +65,20 @@ } // formatted hex display of IQS622 registers -void IQS622Display::showRegisters(char * buffer,char * color) +void IQS622Display::showRegisters(char * buffer,char * color, bool showAll) { - printf("\r\n\r\n Device ID & Version (42) [00] "); showLine(buffer,color,0x00,0x02); - printf("\r\n\r\n Events and Flags [10] "); showLine(buffer,color,0x10,0x1a); - printf("\r\n\r\n Channel 0-6 Raw Values [20] "); showLine(buffer,color,0x20,0x2d); - printf("\r\n\r\n Long Term Average Data [30] "); showLine(buffer,color,0x30,0x33); - printf("\r\n\r\n Proxfusion Settings [40] "); showLine(buffer,color,0x40,0x4d); - printf("\r\n\r\n Proxfusion Thresholds [50] "); showLine(buffer,color,0x50,0x54); - printf("\r\n\r\n SAR Thresholds [60] "); showLine(buffer,color,0x60,0x65); - printf("\r\n\r\n Light/IR Sensor Settings [70] "); showLine(buffer,color,0x70,0x75); - printf("\r\n\r\n IR Threshold Settings [90] "); showLine(buffer,color,0x90,0x92); - printf("\r\n\r\n Hall Switch Thresholds [A0] "); showLine(buffer,color,0xa0,0xa3); - printf("\r\n\r\n Temperature Thresholds [B0] "); showLine(buffer,color,0xb0,0xb2); - printf("\r\n\r\n Device & Power Settings [D0] "); showLine(buffer,color,0xd0,0xd7); + bool d = showAll; // for debugging, if true show all 16 registers in a line + printf("\r\n\r\n Device ID & Version (42) [00] "); showLine(buffer,color,0x00,d?0x0f:0x02); + printf("\r\n\r\n Events and Flags [10] "); showLine(buffer,color,0x10,d?0x1f:0x1a); + printf("\r\n\r\n Channel 0-6 Raw Values [20] "); showLine(buffer,color,0x20,d?0x2f:0x2d); + printf("\r\n\r\n Long Term Average Data [30] "); showLine(buffer,color,0x30,d?0x3f:0x33); + printf("\r\n\r\n Proxfusion Settings [40] "); showLine(buffer,color,0x40,d?0x4f:0x4d); + printf("\r\n\r\n Proxfusion Thresholds [50] "); showLine(buffer,color,0x50,d?0x5f:0x54); + printf("\r\n\r\n SAR Thresholds [60] "); showLine(buffer,color,0x60,d?0x6f:0x65); + printf("\r\n\r\n Light/IR Sensor Settings [70] "); showLine(buffer,color,0x70,d?0x7f:0x75); + printf("\r\n\r\n IR Threshold Settings [90] "); showLine(buffer,color,0x90,d?0x9f:0x92); + printf("\r\n\r\n Hall Switch Thresholds [A0] "); showLine(buffer,color,0xa0,d?0xaf:0xa3); + printf("\r\n\r\n Temperature Thresholds [B0] "); showLine(buffer,color,0xb0,d?0xbf:0xb2); + printf("\r\n\r\n Device & Power Settings [D0] "); showLine(buffer,color,0xd0,d?0xdf:0xd7); printf("\r\n\r\n"); } \ No newline at end of file