Ulta Low Power I2C Multi-Sensor: Capacitive Touch, Magnetic Field & Inductive Proximity.
Dependencies: IQS620DisplayTerminal IQS62x mbed
Fork of IQS620_HelloWorld by
Hello World! From Azoteq's IQS620 Ultra Low Power Multi-Sensor
This is an mbed hardware demo program for the Azoteq IQS620 ultra low power multisensor.
More details on the IQS620 (and verified mbed boards) on these component pages:
IQS620 Eval Kit board Connected to mbed LPC1768 board.
IQS620_Init/IQS620_Init.cpp@11:ec335b94291b, 2017-05-14 (annotated)
- Committer:
- AzqDev
- Date:
- Sun May 14 20:32:32 2017 +0000
- Revision:
- 11:ec335b94291b
- Parent:
- 7:7abb59b94800
- Child:
- 15:a6cffc00d61a
Library update
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AzqDev | 6:250df5794541 | 1 | #include "IQS62x.h" |
AzqDev | 6:250df5794541 | 2 | |
AzqDev | 6:250df5794541 | 3 | // Function to configure/initialize the IQS624 |
AzqDev | 6:250df5794541 | 4 | // Uses the configuration data provided in "IQS624_Init.h" |
AzqDev | 6:250df5794541 | 5 | // The file "IQS624_Init.h" can be created/exported by the Azoteq software tools |
AzqDev | 6:250df5794541 | 6 | // The included version of "IQS624_Init.h" is a robust demo configuration |
AzqDev | 6:250df5794541 | 7 | // More info on IQS624: http://www.azoteq.com/products/proxfusion/iqs624?mbed |
AzqDev | 6:250df5794541 | 8 | |
AzqDev | 6:250df5794541 | 9 | #include "IQS620_Init.h" |
AzqDev | 6:250df5794541 | 10 | |
AzqDev | 6:250df5794541 | 11 | void IQS62xIO::configure() { |
AzqDev | 6:250df5794541 | 12 | |
AzqDev | 6:250df5794541 | 13 | /* Change the Prox Sensor Settings 0 */ |
AzqDev | 6:250df5794541 | 14 | /* Memory Map Position 0x40 - 0x4B */ |
AzqDev | 6:250df5794541 | 15 | writeRegister( 0x40, PXS_SETTINGS0_0 ); |
AzqDev | 6:250df5794541 | 16 | writeRegister( 0x41, PXS_SETTINGS0_1 ); |
AzqDev | 6:250df5794541 | 17 | writeRegister( 0x42, PXS_SETTINGS0_2 ); |
AzqDev | 6:250df5794541 | 18 | writeRegister( 0x43, PXS_SETTINGS0_3 ); |
AzqDev | 6:250df5794541 | 19 | writeRegister( 0x44, PXS_SETTINGS0_4 ); |
AzqDev | 6:250df5794541 | 20 | writeRegister( 0x45, PXS_SETTINGS0_5 ); |
AzqDev | 6:250df5794541 | 21 | writeRegister( 0x46, PXS_SETTINGS0_6 ); |
AzqDev | 6:250df5794541 | 22 | writeRegister( 0x47, PXS_SETTINGS0_7 ); |
AzqDev | 6:250df5794541 | 23 | writeRegister( 0x48, PXS_SETTINGS0_8 ); |
AzqDev | 6:250df5794541 | 24 | writeRegister( 0x49, PXS_SETTINGS0_9 ); |
AzqDev | 6:250df5794541 | 25 | writeRegister( 0x4a, PXS_SETTINGS0_10 ); |
AzqDev | 6:250df5794541 | 26 | writeRegister( 0x4b, PXS_SETTINGS0_11 ); |
AzqDev | 6:250df5794541 | 27 | |
AzqDev | 6:250df5794541 | 28 | /* Change the Prox Sensor Settings 1 */ |
AzqDev | 6:250df5794541 | 29 | /* Memory Map Position 0x50 - 0x57 */ |
AzqDev | 6:250df5794541 | 30 | writeRegister( 0x50, PXS_SETTINGS1_0 ); |
AzqDev | 6:250df5794541 | 31 | writeRegister( 0x51, PXS_SETTINGS1_1 ); |
AzqDev | 6:250df5794541 | 32 | writeRegister( 0x52, PXS_SETTINGS1_2 ); |
AzqDev | 6:250df5794541 | 33 | writeRegister( 0x53, PXS_SETTINGS1_3 ); |
AzqDev | 6:250df5794541 | 34 | writeRegister( 0x54, PXS_SETTINGS1_4 ); |
AzqDev | 6:250df5794541 | 35 | writeRegister( 0x55, PXS_SETTINGS1_5 ); |
AzqDev | 6:250df5794541 | 36 | writeRegister( 0x56, PXS_SETTINGS1_6 ); |
AzqDev | 6:250df5794541 | 37 | writeRegister( 0x57, PXS_SETTINGS1_7 ); |
AzqDev | 6:250df5794541 | 38 | |
AzqDev | 6:250df5794541 | 39 | /* Change the Prox UI Settings */ |
AzqDev | 6:250df5794541 | 40 | /* Memory Map Position 0x60 - 0x66 */ |
AzqDev | 6:250df5794541 | 41 | writeRegister( 0x60, PXS_UI_SETTINGS_0 ); |
AzqDev | 6:250df5794541 | 42 | writeRegister( 0x61, PXS_UI_SETTINGS_1 ); |
AzqDev | 6:250df5794541 | 43 | writeRegister( 0x62, PXS_UI_SETTINGS_2 ); |
AzqDev | 6:250df5794541 | 44 | writeRegister( 0x63, PXS_UI_SETTINGS_3 ); |
AzqDev | 6:250df5794541 | 45 | writeRegister( 0x64, PXS_UI_SETTINGS_4 ); |
AzqDev | 6:250df5794541 | 46 | writeRegister( 0x65, PXS_UI_SETTINGS_5 ); |
AzqDev | 6:250df5794541 | 47 | writeRegister( 0x66, PXS_UI_SETTINGS_6 ); |
AzqDev | 6:250df5794541 | 48 | |
AzqDev | 6:250df5794541 | 49 | /* Change the SAR UI Settings */ |
AzqDev | 6:250df5794541 | 50 | /* Memory Map Position 0x70 - 0x75 */ |
AzqDev | 6:250df5794541 | 51 | writeRegister( 0x70, SAR_UI_SETTINGS_0 ); |
AzqDev | 6:250df5794541 | 52 | writeRegister( 0x71, SAR_UI_SETTINGS_1 ); |
AzqDev | 6:250df5794541 | 53 | writeRegister( 0x72, SAR_UI_SETTINGS_2 ); |
AzqDev | 6:250df5794541 | 54 | writeRegister( 0x73, SAR_UI_SETTINGS_3 ); |
AzqDev | 6:250df5794541 | 55 | writeRegister( 0x74, SAR_UI_SETTINGS_4 ); |
AzqDev | 6:250df5794541 | 56 | writeRegister( 0x75, SAR_UI_SETTINGS_5 ); |
AzqDev | 6:250df5794541 | 57 | |
AzqDev | 6:250df5794541 | 58 | /* Change the Metal Detect UI Settings */ |
AzqDev | 6:250df5794541 | 59 | /* Memory Map Position 0x80 - 0x83 */ |
AzqDev | 6:250df5794541 | 60 | writeRegister( 0x80, METAL_DETECT_UI_SETTINGS_0 ); |
AzqDev | 6:250df5794541 | 61 | writeRegister( 0x81, METAL_DETECT_UI_SETTINGS_1 ); |
AzqDev | 6:250df5794541 | 62 | writeRegister( 0x82, METAL_DETECT_UI_SETTINGS_2 ); |
AzqDev | 6:250df5794541 | 63 | writeRegister( 0x83, METAL_DETECT_UI_SETTINGS_3 ); |
AzqDev | 6:250df5794541 | 64 | |
AzqDev | 6:250df5794541 | 65 | /* Change the HALL Sensor Settings */ |
AzqDev | 6:250df5794541 | 66 | /* Memory Map Position 0x90 - 0x93 */ |
AzqDev | 6:250df5794541 | 67 | writeRegister( 0x90, HALL_SENSOR_SETTINGS_0 ); |
AzqDev | 6:250df5794541 | 68 | writeRegister( 0x91, HALL_SENSOR_SETTINGS_1 ); |
AzqDev | 6:250df5794541 | 69 | writeRegister( 0x92, HALL_SENSOR_SETTINGS_2 ); |
AzqDev | 6:250df5794541 | 70 | writeRegister( 0x93, HALL_SENSOR_SETTINGS_3 ); |
AzqDev | 6:250df5794541 | 71 | |
AzqDev | 6:250df5794541 | 72 | /* Change the HALL Switch UI Settings */ |
AzqDev | 6:250df5794541 | 73 | /* Memory Map Position 0xA0 - 0xA2 */ |
AzqDev | 6:250df5794541 | 74 | writeRegister( 0xa0, HALL_UI_SETTINGS_0 ); |
AzqDev | 6:250df5794541 | 75 | writeRegister( 0xa1, HALL_UI_SETTINGS_1 ); |
AzqDev | 6:250df5794541 | 76 | writeRegister( 0xa2, HALL_UI_SETTINGS_2 ); |
AzqDev | 6:250df5794541 | 77 | |
AzqDev | 6:250df5794541 | 78 | /* Change the Temperature UI Settings */ |
AzqDev | 6:250df5794541 | 79 | /* Memory Map Position 0xC0 - 0xC3 */ |
AzqDev | 6:250df5794541 | 80 | writeRegister( 0xc0, TEMP_UI_SETTINGS_0 ); |
AzqDev | 6:250df5794541 | 81 | writeRegister( 0xc1, TEMP_UI_SETTINGS_1 ); |
AzqDev | 6:250df5794541 | 82 | writeRegister( 0xc2, TEMP_UI_SETTINGS_2 ); |
AzqDev | 6:250df5794541 | 83 | writeRegister( 0xc3, TEMP_UI_SETTINGS_3 ); |
AzqDev | 6:250df5794541 | 84 | |
AzqDev | 6:250df5794541 | 85 | /* Change the Device & PMU Settings */ |
AzqDev | 7:7abb59b94800 | 86 | /* Memory Map Position 0xD0 - 0xD8 */ |
AzqDev | 6:250df5794541 | 87 | writeRegister( 0xd0, SYSTEM_SETTINGS ); |
AzqDev | 6:250df5794541 | 88 | writeRegister( 0xd1, ACTIVE_CHS ); |
AzqDev | 6:250df5794541 | 89 | writeRegister( 0xd2, PMU_SETTINGS ); |
AzqDev | 6:250df5794541 | 90 | writeRegister( 0xd3, REPORT_RATES_TIMINGS_0 ); |
AzqDev | 6:250df5794541 | 91 | writeRegister( 0xd4, REPORT_RATES_TIMINGS_1 ); |
AzqDev | 6:250df5794541 | 92 | writeRegister( 0xd5, REPORT_RATES_TIMINGS_2 ); |
AzqDev | 7:7abb59b94800 | 93 | writeRegister( 0xd6, REPORT_RATES_TIMINGS_3 ); |
AzqDev | 7:7abb59b94800 | 94 | writeRegister( 0xd7, GLOBAL_EVENT_MASK ); |
AzqDev | 7:7abb59b94800 | 95 | writeRegister( 0xd8, PWM_DUTY_CYCLE ); |
AzqDev | 6:250df5794541 | 96 | |
AzqDev | 6:250df5794541 | 97 | } |
AzqDev | 6:250df5794541 | 98 | // end of IQS624_Init.cpp |