![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Use IQS62X sensor and move motor by detected angle
Dependencies: DRV8830 IQS62x IQSDisplayTerminal UIT_ACM1602NI mbed
Fork of Nucleo_ACM1602_I2C_DC by
IQS624_Init/IQS624_Init.cpp@12:8464be95bf76, 2018-01-30 (annotated)
- Committer:
- 8mona
- Date:
- Tue Jan 30 06:55:27 2018 +0000
- Revision:
- 12:8464be95bf76
- Parent:
- 5:2b9614aa1171
Up version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
8mona | 5:2b9614aa1171 | 1 | #include "IQS62x.h" |
8mona | 5:2b9614aa1171 | 2 | |
8mona | 5:2b9614aa1171 | 3 | // Function to configure/initialize the IQS624 |
8mona | 5:2b9614aa1171 | 4 | // Uses the configuration data provided in "IQS624_Init.h" |
8mona | 5:2b9614aa1171 | 5 | // The file "IQS624_Init.h" can be created/exported by the Azoteq software tools |
8mona | 5:2b9614aa1171 | 6 | // The included version of "IQS624_Init.h" is a robust demo configuration |
8mona | 5:2b9614aa1171 | 7 | // More info on IQS624: http://www.azoteq.com/products/proxfusion/iqs624?mbed |
8mona | 5:2b9614aa1171 | 8 | |
8mona | 5:2b9614aa1171 | 9 | #include "IQS624_Init.h" |
8mona | 5:2b9614aa1171 | 10 | |
8mona | 5:2b9614aa1171 | 11 | void IQS62xIO::configure() { |
8mona | 5:2b9614aa1171 | 12 | |
8mona | 5:2b9614aa1171 | 13 | /* Change the Prox Sensor Settings */ |
8mona | 5:2b9614aa1171 | 14 | /* Memory Map Position 0x40 - 0x49 */ |
8mona | 5:2b9614aa1171 | 15 | writeRegister( 0x40, PXS_SETTINGS_0 ); |
8mona | 5:2b9614aa1171 | 16 | writeRegister( 0x41, PXS_SETTINGS_1 ); |
8mona | 5:2b9614aa1171 | 17 | writeRegister( 0x42, PXS_SETTINGS_2 ); |
8mona | 5:2b9614aa1171 | 18 | writeRegister( 0x43, PXS_SETTINGS_3 ); |
8mona | 5:2b9614aa1171 | 19 | writeRegister( 0x44, PXS_SETTINGS_4 ); |
8mona | 5:2b9614aa1171 | 20 | writeRegister( 0x45, PXS_SETTINGS_5 ); |
8mona | 5:2b9614aa1171 | 21 | writeRegister( 0x46, PXS_SETTINGS_6 ); |
8mona | 5:2b9614aa1171 | 22 | writeRegister( 0x47, PXS_SETTINGS_7 ); |
8mona | 5:2b9614aa1171 | 23 | writeRegister( 0x48, PXS_SETTINGS_8 ); |
8mona | 5:2b9614aa1171 | 24 | writeRegister( 0x49, PXS_SETTINGS_9 ); |
8mona | 5:2b9614aa1171 | 25 | |
8mona | 5:2b9614aa1171 | 26 | /* Change the Prox UI Settings */ |
8mona | 5:2b9614aa1171 | 27 | /* Memory Map Position 0x50 - 0x54 */ |
8mona | 5:2b9614aa1171 | 28 | writeRegister( 0x50, PXS_UI_SETTINGS_0 ); |
8mona | 5:2b9614aa1171 | 29 | writeRegister( 0x51, PXS_UI_SETTINGS_1 ); |
8mona | 5:2b9614aa1171 | 30 | writeRegister( 0x52, PXS_UI_SETTINGS_2 ); |
8mona | 5:2b9614aa1171 | 31 | writeRegister( 0x53, PXS_UI_SETTINGS_3 ); |
8mona | 5:2b9614aa1171 | 32 | writeRegister( 0x54, PXS_UI_SETTINGS_4 ); |
8mona | 5:2b9614aa1171 | 33 | |
8mona | 5:2b9614aa1171 | 34 | /* Change the HALL Sensor Settings */ |
8mona | 5:2b9614aa1171 | 35 | /* Memory Map Position 0x70 - 0x7A */ |
8mona | 5:2b9614aa1171 | 36 | writeRegister( 0x70, HALL_SETTINGS_0 ); |
8mona | 5:2b9614aa1171 | 37 | writeRegister( 0x71, HALL_SETTINGS_1 ); |
8mona | 5:2b9614aa1171 | 38 | writeRegister( 0x72, HALL_SETTINGS_2 ); |
8mona | 5:2b9614aa1171 | 39 | writeRegister( 0x73, HALL_SETTINGS_3 ); |
8mona | 5:2b9614aa1171 | 40 | writeRegister( 0x74, HALL_SETTINGS_4 ); |
8mona | 5:2b9614aa1171 | 41 | writeRegister( 0x75, HALL_SETTINGS_5 ); |
8mona | 5:2b9614aa1171 | 42 | writeRegister( 0x76, HALL_SETTINGS_6 ); |
8mona | 5:2b9614aa1171 | 43 | writeRegister( 0x77, HALL_SETTINGS_7 ); |
8mona | 5:2b9614aa1171 | 44 | writeRegister( 0x78, HALL_SETTINGS_8 ); |
8mona | 5:2b9614aa1171 | 45 | writeRegister( 0x79, HALL_SETTINGS_9 ); |
8mona | 5:2b9614aa1171 | 46 | writeRegister( 0x7a, HALL_SETTINGS_10 ); |
8mona | 5:2b9614aa1171 | 47 | |
8mona | 5:2b9614aa1171 | 48 | /* Change the Device & PMU Settings */ |
8mona | 5:2b9614aa1171 | 49 | /* Memory Map Position 0xD0 - 0xD7 */ |
8mona | 5:2b9614aa1171 | 50 | writeRegister( 0xd0, SYSTEM_SETTINGS ); |
8mona | 5:2b9614aa1171 | 51 | writeRegister( 0xd1, ACTIVE_CHS ); |
8mona | 5:2b9614aa1171 | 52 | writeRegister( 0xd2, PMU_SETTINGS ); |
8mona | 5:2b9614aa1171 | 53 | writeRegister( 0xd3, REPORT_RATES_TIMINGS_0 ); |
8mona | 5:2b9614aa1171 | 54 | writeRegister( 0xd4, REPORT_RATES_TIMINGS_1 ); |
8mona | 5:2b9614aa1171 | 55 | writeRegister( 0xd5, REPORT_RATES_TIMINGS_2 ); |
8mona | 5:2b9614aa1171 | 56 | writeRegister( 0xd6, REPORT_RATES_TIMINGS_3 ); |
8mona | 5:2b9614aa1171 | 57 | // NO 0xd7 in data sheet.... writeRegister( 0xd7, REPORT_RATES_TIMINGS_4 ); |
8mona | 5:2b9614aa1171 | 58 | |
8mona | 5:2b9614aa1171 | 59 | } |
8mona | 5:2b9614aa1171 | 60 | // end of IQS624_Init.cpp |