Azoteq / Mbed 2 deprecated IQS620_HelloWorld Featured

Dependencies:   IQS620DisplayTerminal IQS62x mbed

Fork of IQS620_HelloWorld by Azq Dev

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers IQS620_Init.cpp Source File

IQS620_Init.cpp

00001 #include "IQS62x.h"
00002 
00003 // Function to configure/initialize the IQS620
00004 // Uses the configuration data provided in "IQS620_Init.h"
00005 // The file "IQS620_Init.h" can be created/exported by the Azoteq software tools
00006 // The included version of "IQS620_Init.h" is a robust demo configuration
00007 // More info on IQS620: http://www.azoteq.com/products/proxfusion/iqs620?mbed
00008 
00009 #include "IQS620_Init.h"
00010 
00011 void IQS62xIO::configure() {
00012 
00013 /* Change the Prox Sensor Settings 0 */
00014 /* Memory Map Position 0x40 - 0x4B */
00015   writeRegister( 0x40,  PXS_SETTINGS0_0     );
00016   writeRegister( 0x41,  PXS_SETTINGS0_1     );
00017   writeRegister( 0x42,  PXS_SETTINGS0_2     );      
00018   writeRegister( 0x43,  PXS_SETTINGS0_3     );
00019   writeRegister( 0x44,  PXS_SETTINGS0_4     );
00020   writeRegister( 0x45,  PXS_SETTINGS0_5     );
00021   writeRegister( 0x46,  PXS_SETTINGS0_6     );     
00022   writeRegister( 0x47,  PXS_SETTINGS0_7     );
00023   writeRegister( 0x48,  PXS_SETTINGS0_8     );
00024   writeRegister( 0x49,  PXS_SETTINGS0_9     );     
00025   writeRegister( 0x4a,  PXS_SETTINGS0_10    );     
00026   writeRegister( 0x4b,  PXS_SETTINGS0_11    );     
00027 
00028 /* Change the Prox Sensor Settings 1 */
00029 /* Memory Map Position 0x50 - 0x57 */
00030   writeRegister( 0x50,  PXS_SETTINGS1_0  );
00031   writeRegister( 0x51,  PXS_SETTINGS1_1  );
00032   writeRegister( 0x52,  PXS_SETTINGS1_2  );
00033   writeRegister( 0x53,  PXS_SETTINGS1_3  );
00034   writeRegister( 0x54,  PXS_SETTINGS1_4  );
00035   writeRegister( 0x55,  PXS_SETTINGS1_5  );
00036   writeRegister( 0x56,  PXS_SETTINGS1_6  );
00037   writeRegister( 0x57,  PXS_SETTINGS1_7  );
00038   
00039 /* Change the Prox UI Settings */
00040 /* Memory Map Position 0x60 - 0x66 */
00041   writeRegister( 0x60,  PXS_UI_SETTINGS_0    );
00042   writeRegister( 0x61,  PXS_UI_SETTINGS_1    );
00043   writeRegister( 0x62,  PXS_UI_SETTINGS_2    );
00044   writeRegister( 0x63,  PXS_UI_SETTINGS_3    );
00045   writeRegister( 0x64,  PXS_UI_SETTINGS_4    );
00046   writeRegister( 0x65,  PXS_UI_SETTINGS_5    );
00047   writeRegister( 0x66,  PXS_UI_SETTINGS_6    );
00048 
00049 /* Change the SAR UI Settings */
00050 /* Memory Map Position 0x70 - 0x75 */
00051   writeRegister( 0x70,  SAR_UI_SETTINGS_0    );
00052   writeRegister( 0x71,  SAR_UI_SETTINGS_1    );
00053   writeRegister( 0x72,  SAR_UI_SETTINGS_2    );
00054   writeRegister( 0x73,  SAR_UI_SETTINGS_3    );
00055   writeRegister( 0x74,  SAR_UI_SETTINGS_4    );
00056   writeRegister( 0x75,  SAR_UI_SETTINGS_5    );
00057   
00058 /* Change the Metal Detect UI Settings */
00059 /* Memory Map Position 0x80 - 0x83 */
00060   writeRegister( 0x80,  METAL_DETECT_UI_SETTINGS_0    );
00061   writeRegister( 0x81,  METAL_DETECT_UI_SETTINGS_1    );
00062   writeRegister( 0x82,  METAL_DETECT_UI_SETTINGS_2    );
00063   writeRegister( 0x83,  METAL_DETECT_UI_SETTINGS_3    );
00064 
00065 /* Change the HALL Sensor Settings */
00066 /* Memory Map Position 0x90 - 0x93 */
00067   writeRegister( 0x90,  HALL_SENSOR_SETTINGS_0    );
00068   writeRegister( 0x91,  HALL_SENSOR_SETTINGS_1    );
00069   writeRegister( 0x92,  HALL_SENSOR_SETTINGS_2    );
00070   writeRegister( 0x93,  HALL_SENSOR_SETTINGS_3    );
00071 
00072 /* Change the HALL Switch UI Settings */
00073 /* Memory Map Position 0xA0 - 0xA2 */
00074   writeRegister( 0xa0,  HALL_UI_SETTINGS_0    );
00075   writeRegister( 0xa1,  HALL_UI_SETTINGS_1    );
00076   writeRegister( 0xa2,  HALL_UI_SETTINGS_2    );
00077 
00078 /* Change the Temperature UI Settings */
00079 /* Memory Map Position 0xC0 - 0xC3 */
00080   writeRegister( 0xc0,  TEMP_UI_SETTINGS_0    );
00081   writeRegister( 0xc1,  TEMP_UI_SETTINGS_1    );
00082   writeRegister( 0xc2,  TEMP_UI_SETTINGS_2    );
00083   writeRegister( 0xc3,  TEMP_UI_SETTINGS_3    );
00084 
00085 /* Change the Device & PMU Settings */
00086 /* Memory Map Position 0xD0 - 0xD8 */
00087   writeRegister( 0xd0,  SYSTEM_SETTINGS        );
00088   writeRegister( 0xd1,  ACTIVE_CHS             );            
00089   writeRegister( 0xd2,  PMU_SETTINGS           );
00090   writeRegister( 0xd3,  REPORT_RATES_TIMINGS_0 );    
00091   writeRegister( 0xd4,  REPORT_RATES_TIMINGS_1 );
00092   writeRegister( 0xd5,  REPORT_RATES_TIMINGS_2 );
00093   writeRegister( 0xd6,  REPORT_RATES_TIMINGS_3 );
00094   writeRegister( 0xd7,  GLOBAL_EVENT_MASK      );
00095   writeRegister( 0xd8,  PWM_DUTY_CYCLE         );
00096 
00097 }
00098 // end of IQS620_Init.cpp