![](/media/cache/group/Azoteq-logo-3.gif.50x50_q85.png)
Ultra Low Power (5uA) I2C Sensor With Ambient Light Sensing (ALS) + Capacitive Proximity/Touch + Hall Effect Sensor + Inductive Proximity (Metal Detect)
Dependencies: IQS621DisplayTerminal IQS62x mbed
Hello World! From Azoteq's IQS621 Ultra Low Power Multi-Sensor
This is a demo program for the Azoteq IQS621 ultra low power multi function sensor.
IQS621_Init/IQS621_Init.cpp@17:ffbe54dfe7b8, 2018-01-23 (annotated)
- Committer:
- AzqDev
- Date:
- Tue Jan 23 15:18:16 2018 +0000
- Revision:
- 17:ffbe54dfe7b8
- Parent:
- 15:a67f28ccea2c
Updated mbed library
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AzqDev | 6:f64e7e8d5283 | 1 | #include "IQS62x.h" |
AzqDev | 6:f64e7e8d5283 | 2 | |
AzqDev | 6:f64e7e8d5283 | 3 | // Function to configure/initialize the IQS624 |
AzqDev | 6:f64e7e8d5283 | 4 | // Uses the configuration data provided in "IQS624_Init.h" |
AzqDev | 6:f64e7e8d5283 | 5 | // The file "IQS624_Init.h" can be created/exported by the Azoteq software tools |
AzqDev | 6:f64e7e8d5283 | 6 | // The included version of "IQS624_Init.h" is a robust demo configuration |
AzqDev | 6:f64e7e8d5283 | 7 | // More info on IQS624: http://www.azoteq.com/products/proxfusion/iqs624?mbed |
AzqDev | 6:f64e7e8d5283 | 8 | |
AzqDev | 6:f64e7e8d5283 | 9 | #include "IQS621_Init.h" |
AzqDev | 6:f64e7e8d5283 | 10 | |
AzqDev | 6:f64e7e8d5283 | 11 | void IQS62xIO::configure() { |
AzqDev | 6:f64e7e8d5283 | 12 | |
AzqDev | 6:f64e7e8d5283 | 13 | /* Change the Prox Sensor Settings 0 */ |
AzqDev | 6:f64e7e8d5283 | 14 | /* Memory Map Position 0x40 - 0x4D */ |
AzqDev | 6:f64e7e8d5283 | 15 | writeRegister( 0x40, PXS_SETTINGS_0 ); |
AzqDev | 6:f64e7e8d5283 | 16 | writeRegister( 0x41, PXS_SETTINGS_1 ); |
AzqDev | 6:f64e7e8d5283 | 17 | writeRegister( 0x42, PXS_SETTINGS_2 ); |
AzqDev | 6:f64e7e8d5283 | 18 | writeRegister( 0x43, PXS_SETTINGS_3 ); |
AzqDev | 6:f64e7e8d5283 | 19 | writeRegister( 0x44, PXS_SETTINGS_4 ); |
AzqDev | 6:f64e7e8d5283 | 20 | writeRegister( 0x45, PXS_SETTINGS_5 ); |
AzqDev | 6:f64e7e8d5283 | 21 | writeRegister( 0x46, PXS_SETTINGS_6 ); |
AzqDev | 6:f64e7e8d5283 | 22 | writeRegister( 0x47, PXS_SETTINGS_7 ); |
AzqDev | 6:f64e7e8d5283 | 23 | writeRegister( 0x48, PXS_SETTINGS_8 ); |
AzqDev | 6:f64e7e8d5283 | 24 | writeRegister( 0x49, PXS_SETTINGS_9 ); |
AzqDev | 6:f64e7e8d5283 | 25 | writeRegister( 0x4a, PXS_SETTINGS_10 ); |
AzqDev | 6:f64e7e8d5283 | 26 | writeRegister( 0x4b, PXS_SETTINGS_11 ); |
AzqDev | 6:f64e7e8d5283 | 27 | writeRegister( 0x4c, PXS_SETTINGS_12 ); |
AzqDev | 6:f64e7e8d5283 | 28 | writeRegister( 0x4d, PXS_SETTINGS_13 ); |
AzqDev | 6:f64e7e8d5283 | 29 | |
AzqDev | 6:f64e7e8d5283 | 30 | /* Change the Prox UI Settings */ |
AzqDev | 6:f64e7e8d5283 | 31 | /* Memory Map Position 0x50 - 0x54 */ |
AzqDev | 6:f64e7e8d5283 | 32 | writeRegister( 0x50, PXS_UI_SETTINGS_0 ); |
AzqDev | 6:f64e7e8d5283 | 33 | writeRegister( 0x51, PXS_UI_SETTINGS_1 ); |
AzqDev | 6:f64e7e8d5283 | 34 | writeRegister( 0x52, PXS_UI_SETTINGS_2 ); |
AzqDev | 6:f64e7e8d5283 | 35 | writeRegister( 0x53, PXS_UI_SETTINGS_3 ); |
AzqDev | 7:5161c542cdda | 36 | writeRegister( 0x54, PXS_UI_SETTINGS_4 ); |
AzqDev | 6:f64e7e8d5283 | 37 | |
AzqDev | 6:f64e7e8d5283 | 38 | |
AzqDev | 6:f64e7e8d5283 | 39 | /* Change the Metal Detect UI Settings */ |
AzqDev | 6:f64e7e8d5283 | 40 | /* Memory Map Position 0x60 - 0x63 */ |
AzqDev | 6:f64e7e8d5283 | 41 | writeRegister( 0x60, METAL_UI_SETTINGS_0 ); |
AzqDev | 6:f64e7e8d5283 | 42 | writeRegister( 0x61, METAL_UI_SETTINGS_1 ); |
AzqDev | 6:f64e7e8d5283 | 43 | writeRegister( 0x62, METAL_UI_SETTINGS_2 ); |
AzqDev | 6:f64e7e8d5283 | 44 | writeRegister( 0x63, METAL_UI_SETTINGS_3 ); |
AzqDev | 6:f64e7e8d5283 | 45 | |
AzqDev | 6:f64e7e8d5283 | 46 | /* Change the Light Sensor Settings */ |
AzqDev | 6:f64e7e8d5283 | 47 | /* Memory Map Position 0x70 - 0x73 */ |
AzqDev | 6:f64e7e8d5283 | 48 | writeRegister( 0x70, LIGHT_SENSOR_SETTINGS_0 ); |
AzqDev | 6:f64e7e8d5283 | 49 | writeRegister( 0x71, LIGHT_SENSOR_SETTINGS_1 ); |
AzqDev | 6:f64e7e8d5283 | 50 | writeRegister( 0x72, LIGHT_SENSOR_SETTINGS_2 ); |
AzqDev | 6:f64e7e8d5283 | 51 | writeRegister( 0x73, LIGHT_SENSOR_SETTINGS_3 ); |
AzqDev | 6:f64e7e8d5283 | 52 | |
AzqDev | 6:f64e7e8d5283 | 53 | /* Change the ALS UI Settings */ |
AzqDev | 6:f64e7e8d5283 | 54 | /* Memory Map Position 0x80 - 0x83 */ |
AzqDev | 6:f64e7e8d5283 | 55 | writeRegister( 0x80, ALS_UI_SETTINGS_0 ); |
AzqDev | 6:f64e7e8d5283 | 56 | writeRegister( 0x81, ALS_UI_SETTINGS_1 ); |
AzqDev | 6:f64e7e8d5283 | 57 | writeRegister( 0x82, ALS_UI_SETTINGS_2 ); |
AzqDev | 6:f64e7e8d5283 | 58 | writeRegister( 0x83, ALS_UI_SETTINGS_3 ); |
AzqDev | 6:f64e7e8d5283 | 59 | |
AzqDev | 6:f64e7e8d5283 | 60 | /* Change the HALL Sensor Settings */ |
AzqDev | 6:f64e7e8d5283 | 61 | /* Memory Map Position 0x90 - 0x93 */ |
AzqDev | 6:f64e7e8d5283 | 62 | writeRegister( 0x90, HALL_SENSOR_SETTINGS_0 ); |
AzqDev | 6:f64e7e8d5283 | 63 | writeRegister( 0x91, HALL_SENSOR_SETTINGS_1 ); |
AzqDev | 6:f64e7e8d5283 | 64 | writeRegister( 0x92, HALL_SENSOR_SETTINGS_2 ); |
AzqDev | 6:f64e7e8d5283 | 65 | writeRegister( 0x93, HALL_SENSOR_SETTINGS_3 ); |
AzqDev | 6:f64e7e8d5283 | 66 | |
AzqDev | 6:f64e7e8d5283 | 67 | /* Change the HALL Switch UI Settings */ |
AzqDev | 6:f64e7e8d5283 | 68 | /* Memory Map Position 0xA0 - 0xA2 */ |
AzqDev | 6:f64e7e8d5283 | 69 | writeRegister( 0xa0, HALL_UI_SETTINGS_0 ); |
AzqDev | 6:f64e7e8d5283 | 70 | writeRegister( 0xa1, HALL_UI_SETTINGS_1 ); |
AzqDev | 6:f64e7e8d5283 | 71 | writeRegister( 0xa2, HALL_UI_SETTINGS_2 ); |
AzqDev | 6:f64e7e8d5283 | 72 | |
AzqDev | 6:f64e7e8d5283 | 73 | /* Change the Temperature UI Settings */ |
AzqDev | 6:f64e7e8d5283 | 74 | /* Memory Map Position 0xC0 - 0xC3 */ |
AzqDev | 6:f64e7e8d5283 | 75 | writeRegister( 0xc0, TEMP_UI_SETTINGS_0 ); |
AzqDev | 6:f64e7e8d5283 | 76 | writeRegister( 0xc1, TEMP_UI_SETTINGS_1 ); |
AzqDev | 6:f64e7e8d5283 | 77 | writeRegister( 0xc2, TEMP_UI_SETTINGS_2 ); |
AzqDev | 6:f64e7e8d5283 | 78 | writeRegister( 0xc3, TEMP_UI_SETTINGS_3 ); |
AzqDev | 6:f64e7e8d5283 | 79 | |
AzqDev | 6:f64e7e8d5283 | 80 | /* Change the Device & PMU Settings */ |
AzqDev | 6:f64e7e8d5283 | 81 | /* Memory Map Position 0xD0 - 0xD7 */ |
AzqDev | 6:f64e7e8d5283 | 82 | writeRegister( 0xd0, SYSTEM_SETTINGS ); |
AzqDev | 6:f64e7e8d5283 | 83 | writeRegister( 0xd1, ACTIVE_CHS ); |
AzqDev | 6:f64e7e8d5283 | 84 | writeRegister( 0xd2, PMU_SETTINGS ); |
AzqDev | 6:f64e7e8d5283 | 85 | writeRegister( 0xd3, REPORT_RATES_TIMINGS_0 ); |
AzqDev | 6:f64e7e8d5283 | 86 | writeRegister( 0xd4, REPORT_RATES_TIMINGS_1 ); |
AzqDev | 6:f64e7e8d5283 | 87 | writeRegister( 0xd5, REPORT_RATES_TIMINGS_2 ); |
AzqDev | 15:a67f28ccea2c | 88 | writeRegister( 0xd6, REPORT_RATES_TIMINGS_3 ); |
AzqDev | 15:a67f28ccea2c | 89 | writeRegister( 0xd7, GLOBAL_EVENT_MASK ); |
AzqDev | 6:f64e7e8d5283 | 90 | |
AzqDev | 6:f64e7e8d5283 | 91 | } |
AzqDev | 6:f64e7e8d5283 | 92 | // end of IQS624_Init.cpp |