![](/media/cache/group/Azoteq-logo-3.gif.50x50_q85.png)
Ultra Low Power (5uA) I2C Multi-Function Sensor with Light Sensor + Active (Reflective) IR + Touch + Hall Effect Sensor
Dependencies: IQS622DisplayTerminal IQS62x mbed
Hello World! From Azoteq's IQS622 Ultra Low Power Multi-Sensor
This is a demo program for the Azoteq IQS622 ultra low power multi function sensor.
More details on the IQS622 component pages here:
IQS622_Init/IQS622_Init.cpp@13:84494b9f6711, 2017-05-14 (annotated)
- Committer:
- AzqDev
- Date:
- Sun May 14 21:17:41 2017 +0000
- Revision:
- 13:84494b9f6711
- Parent:
- 5:c88aa2de6f61
Init of 0xd6 and 0xd7 commented out
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AzqDev | 4:2c5ea9dc0662 | 1 | #include "IQS62x.h" |
AzqDev | 4:2c5ea9dc0662 | 2 | |
AzqDev | 4:2c5ea9dc0662 | 3 | // Function to configure/initialize the IQS624 |
AzqDev | 4:2c5ea9dc0662 | 4 | // Uses the configuration data provided in "IQS624_Init.h" |
AzqDev | 4:2c5ea9dc0662 | 5 | // The file "IQS624_Init.h" can be created/exported by the Azoteq software tools |
AzqDev | 4:2c5ea9dc0662 | 6 | // The included version of "IQS624_Init.h" is a robust demo configuration |
AzqDev | 4:2c5ea9dc0662 | 7 | // More info on IQS624: http://www.azoteq.com/products/proxfusion/iqs624?mbed |
AzqDev | 4:2c5ea9dc0662 | 8 | |
AzqDev | 4:2c5ea9dc0662 | 9 | #include "IQS622_Init.h" |
AzqDev | 4:2c5ea9dc0662 | 10 | |
AzqDev | 4:2c5ea9dc0662 | 11 | void IQS62xIO::configure() { |
AzqDev | 4:2c5ea9dc0662 | 12 | |
AzqDev | 4:2c5ea9dc0662 | 13 | /* Change the Prox Sensor Settings */ |
AzqDev | 5:c88aa2de6f61 | 14 | /* Memory Map Position 0x40 - 0x4D */ |
AzqDev | 4:2c5ea9dc0662 | 15 | writeRegister( 0x40, PXS_SETTINGS_0 ); |
AzqDev | 4:2c5ea9dc0662 | 16 | writeRegister( 0x41, PXS_SETTINGS_1 ); |
AzqDev | 4:2c5ea9dc0662 | 17 | writeRegister( 0x42, PXS_SETTINGS_2 ); |
AzqDev | 4:2c5ea9dc0662 | 18 | writeRegister( 0x43, PXS_SETTINGS_3 ); |
AzqDev | 4:2c5ea9dc0662 | 19 | writeRegister( 0x44, PXS_SETTINGS_4 ); |
AzqDev | 4:2c5ea9dc0662 | 20 | writeRegister( 0x45, PXS_SETTINGS_5 ); |
AzqDev | 4:2c5ea9dc0662 | 21 | writeRegister( 0x46, PXS_SETTINGS_6 ); |
AzqDev | 4:2c5ea9dc0662 | 22 | writeRegister( 0x47, PXS_SETTINGS_7 ); |
AzqDev | 4:2c5ea9dc0662 | 23 | writeRegister( 0x48, PXS_SETTINGS_8 ); |
AzqDev | 5:c88aa2de6f61 | 24 | writeRegister( 0x49, PXS_SETTINGS_9 ); |
AzqDev | 5:c88aa2de6f61 | 25 | writeRegister( 0x4a, PXS_SETTINGS_10 ); |
AzqDev | 5:c88aa2de6f61 | 26 | writeRegister( 0x4b, PXS_SETTINGS_11 ); |
AzqDev | 5:c88aa2de6f61 | 27 | writeRegister( 0x4c, PXS_SETTINGS_12 ); |
AzqDev | 5:c88aa2de6f61 | 28 | writeRegister( 0x4d, PXS_SETTINGS_13 ); |
AzqDev | 4:2c5ea9dc0662 | 29 | |
AzqDev | 4:2c5ea9dc0662 | 30 | /* Change the Prox UI Settings */ |
AzqDev | 4:2c5ea9dc0662 | 31 | /* Memory Map Position 0x50 - 0x54 */ |
AzqDev | 4:2c5ea9dc0662 | 32 | writeRegister( 0x50, PXS_UI_SETTINGS_0 ); |
AzqDev | 4:2c5ea9dc0662 | 33 | writeRegister( 0x51, PXS_UI_SETTINGS_1 ); |
AzqDev | 4:2c5ea9dc0662 | 34 | writeRegister( 0x52, PXS_UI_SETTINGS_2 ); |
AzqDev | 4:2c5ea9dc0662 | 35 | writeRegister( 0x53, PXS_UI_SETTINGS_3 ); |
AzqDev | 4:2c5ea9dc0662 | 36 | writeRegister( 0x54, PXS_UI_SETTINGS_4 ); |
AzqDev | 4:2c5ea9dc0662 | 37 | |
AzqDev | 5:c88aa2de6f61 | 38 | /* Change the Prox UI Settings */ |
AzqDev | 5:c88aa2de6f61 | 39 | /* Memory Map Position 0x60 - 0x65 */ |
AzqDev | 5:c88aa2de6f61 | 40 | writeRegister( 0x60, SAR_UI_SETTINGS_0 ); |
AzqDev | 5:c88aa2de6f61 | 41 | writeRegister( 0x61, SAR_UI_SETTINGS_1 ); |
AzqDev | 5:c88aa2de6f61 | 42 | writeRegister( 0x62, SAR_UI_SETTINGS_2 ); |
AzqDev | 5:c88aa2de6f61 | 43 | writeRegister( 0x63, SAR_UI_SETTINGS_3 ); |
AzqDev | 5:c88aa2de6f61 | 44 | writeRegister( 0x64, SAR_UI_SETTINGS_4 ); |
AzqDev | 5:c88aa2de6f61 | 45 | writeRegister( 0x65, SAR_UI_SETTINGS_5 ); |
AzqDev | 5:c88aa2de6f61 | 46 | |
AzqDev | 5:c88aa2de6f61 | 47 | /* Change the Light Sensor Settings */ |
AzqDev | 5:c88aa2de6f61 | 48 | /* Memory Map Position 0x70 - 0x75 */ |
AzqDev | 5:c88aa2de6f61 | 49 | writeRegister( 0x70, LIGHT_SENSOR_SETTINGS_0 ); |
AzqDev | 5:c88aa2de6f61 | 50 | writeRegister( 0x71, LIGHT_SENSOR_SETTINGS_1 ); |
AzqDev | 5:c88aa2de6f61 | 51 | writeRegister( 0x72, LIGHT_SENSOR_SETTINGS_2 ); |
AzqDev | 5:c88aa2de6f61 | 52 | writeRegister( 0x73, LIGHT_SENSOR_SETTINGS_3 ); |
AzqDev | 5:c88aa2de6f61 | 53 | writeRegister( 0x74, LIGHT_SENSOR_SETTINGS_4 ); |
AzqDev | 5:c88aa2de6f61 | 54 | writeRegister( 0x75, LIGHT_SENSOR_SETTINGS_5 ); |
AzqDev | 5:c88aa2de6f61 | 55 | |
AzqDev | 5:c88aa2de6f61 | 56 | /* Change the Active IR UI Settings */ |
AzqDev | 5:c88aa2de6f61 | 57 | /* Memory Map Position 0x90 - 0x93 */ |
AzqDev | 5:c88aa2de6f61 | 58 | writeRegister( 0x90, IR_UI_SETTINGS_0 ); |
AzqDev | 5:c88aa2de6f61 | 59 | writeRegister( 0x91, IR_UI_SETTINGS_1 ); |
AzqDev | 5:c88aa2de6f61 | 60 | writeRegister( 0x92, IR_UI_SETTINGS_2 ); |
AzqDev | 5:c88aa2de6f61 | 61 | writeRegister( 0x93, IR_UI_SETTINGS_3 ); |
AzqDev | 5:c88aa2de6f61 | 62 | |
AzqDev | 4:2c5ea9dc0662 | 63 | /* Change the HALL Sensor Settings */ |
AzqDev | 5:c88aa2de6f61 | 64 | /* Memory Map Position 0xA0 - 0xA3 */ |
AzqDev | 5:c88aa2de6f61 | 65 | writeRegister( 0xa0, HALL_SENSOR_SETTINGS_0 ); |
AzqDev | 5:c88aa2de6f61 | 66 | writeRegister( 0xa1, HALL_SENSOR_SETTINGS_1 ); |
AzqDev | 5:c88aa2de6f61 | 67 | writeRegister( 0xa2, HALL_SENSOR_SETTINGS_2 ); |
AzqDev | 5:c88aa2de6f61 | 68 | writeRegister( 0xa3, HALL_SENSOR_SETTINGS_3 ); |
AzqDev | 5:c88aa2de6f61 | 69 | |
AzqDev | 5:c88aa2de6f61 | 70 | /* Change the HALL Switch UI Settings */ |
AzqDev | 5:c88aa2de6f61 | 71 | /* Memory Map Position 0xB0 - 0xB2 */ |
AzqDev | 5:c88aa2de6f61 | 72 | writeRegister( 0xb0, HALL_UI_SETTINGS_0 ); |
AzqDev | 5:c88aa2de6f61 | 73 | writeRegister( 0xb1, HALL_UI_SETTINGS_1 ); |
AzqDev | 5:c88aa2de6f61 | 74 | writeRegister( 0xb2, HALL_UI_SETTINGS_2 ); |
AzqDev | 5:c88aa2de6f61 | 75 | |
AzqDev | 4:2c5ea9dc0662 | 76 | /* Change the Device & PMU Settings */ |
AzqDev | 4:2c5ea9dc0662 | 77 | /* Memory Map Position 0xD0 - 0xD7 */ |
AzqDev | 4:2c5ea9dc0662 | 78 | writeRegister( 0xd0, SYSTEM_SETTINGS ); |
AzqDev | 4:2c5ea9dc0662 | 79 | writeRegister( 0xd1, ACTIVE_CHS ); |
AzqDev | 4:2c5ea9dc0662 | 80 | writeRegister( 0xd2, PMU_SETTINGS ); |
AzqDev | 4:2c5ea9dc0662 | 81 | writeRegister( 0xd3, REPORT_RATES_TIMINGS_0 ); |
AzqDev | 4:2c5ea9dc0662 | 82 | writeRegister( 0xd4, REPORT_RATES_TIMINGS_1 ); |
AzqDev | 4:2c5ea9dc0662 | 83 | writeRegister( 0xd5, REPORT_RATES_TIMINGS_2 ); |
AzqDev | 13:84494b9f6711 | 84 | // TO FIX writeRegister( 0xd6, REPORT_RATES_TIMINGS_3 ); |
AzqDev | 13:84494b9f6711 | 85 | // TO FIX writeRegister( 0xd7, GLOBAL_EVENT_MASK ); |
AzqDev | 4:2c5ea9dc0662 | 86 | |
AzqDev | 4:2c5ea9dc0662 | 87 | } |
AzqDev | 4:2c5ea9dc0662 | 88 | // end of IQS624_Init.cpp |