Use IQS62X sensor and move motor by detected angle

Dependencies:   DRV8830 IQS62x IQSDisplayTerminal UIT_ACM1602NI mbed

Fork of Nucleo_ACM1602_I2C_DC by Thinkbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers IQS624_Init.cpp Source File

IQS624_Init.cpp

00001 #include "IQS62x.h"
00002 
00003 // Function to configure/initialize the IQS624
00004 // Uses the configuration data provided in "IQS624_Init.h"
00005 // The file "IQS624_Init.h" can be created/exported by the Azoteq software tools
00006 // The included version of "IQS624_Init.h" is a robust demo configuration
00007 // More info on IQS624: http://www.azoteq.com/products/proxfusion/iqs624?mbed
00008 
00009 #include "IQS624_Init.h"
00010 
00011 void IQS62xIO::configure() {
00012 
00013 /* Change the Prox Sensor Settings */
00014 /* Memory Map Position 0x40 - 0x49 */
00015   writeRegister( 0x40,  PXS_SETTINGS_0     );
00016   writeRegister( 0x41,  PXS_SETTINGS_1     );
00017   writeRegister( 0x42,  PXS_SETTINGS_2     );      
00018   writeRegister( 0x43,  PXS_SETTINGS_3     );
00019   writeRegister( 0x44,  PXS_SETTINGS_4     );
00020   writeRegister( 0x45,  PXS_SETTINGS_5     );
00021   writeRegister( 0x46,  PXS_SETTINGS_6     );     
00022   writeRegister( 0x47,  PXS_SETTINGS_7     );
00023   writeRegister( 0x48,  PXS_SETTINGS_8     );
00024   writeRegister( 0x49,  PXS_SETTINGS_9     );     
00025 
00026 /* Change the Prox UI Settings */
00027 /* Memory Map Position 0x50 - 0x54 */
00028   writeRegister( 0x50,  PXS_UI_SETTINGS_0  );
00029   writeRegister( 0x51,  PXS_UI_SETTINGS_1  );
00030   writeRegister( 0x52,  PXS_UI_SETTINGS_2  );
00031   writeRegister( 0x53,  PXS_UI_SETTINGS_3  );
00032   writeRegister( 0x54,  PXS_UI_SETTINGS_4  );
00033 
00034 /* Change the HALL Sensor Settings */
00035 /* Memory Map Position 0x70 - 0x7A */
00036   writeRegister( 0x70,  HALL_SETTINGS_0    );
00037   writeRegister( 0x71,  HALL_SETTINGS_1    );
00038   writeRegister( 0x72,  HALL_SETTINGS_2    );
00039   writeRegister( 0x73,  HALL_SETTINGS_3    );
00040   writeRegister( 0x74,  HALL_SETTINGS_4    );
00041   writeRegister( 0x75,  HALL_SETTINGS_5    );
00042   writeRegister( 0x76,  HALL_SETTINGS_6    );
00043   writeRegister( 0x77,  HALL_SETTINGS_7    );
00044   writeRegister( 0x78,  HALL_SETTINGS_8    );
00045   writeRegister( 0x79,  HALL_SETTINGS_9    );
00046   writeRegister( 0x7a,  HALL_SETTINGS_10   );           
00047 
00048 /* Change the Device & PMU Settings */
00049 /* Memory Map Position 0xD0 - 0xD7 */
00050   writeRegister( 0xd0,  SYSTEM_SETTINGS        );
00051   writeRegister( 0xd1,  ACTIVE_CHS             );            
00052   writeRegister( 0xd2,  PMU_SETTINGS           );
00053   writeRegister( 0xd3,  REPORT_RATES_TIMINGS_0 );    
00054   writeRegister( 0xd4,  REPORT_RATES_TIMINGS_1 );
00055   writeRegister( 0xd5,  REPORT_RATES_TIMINGS_2 );
00056   writeRegister( 0xd6,  REPORT_RATES_TIMINGS_3 );
00057   // NO 0xd7 in data sheet....    writeRegister( 0xd7,  REPORT_RATES_TIMINGS_4 );
00058 
00059 }
00060 // end of IQS624_Init.cpp