###Structure to access bits in registers var REGval={ #### Who AM I Registers ##### CHIP_ID returns 0xA0 ##### ACC_ID returns 0xFB ##### MAG_ID returns 0x32 ##### GYRO_ID returns 0x0F ##### SW_REV_ID_LSB returns software ID low byte ##### SW_REV_ID_MSB returns software ID high byte ##### BL_Rev_ID returns boot loader version #### Select Register Page ##### PageID 0 or 1 #### Is it calibrated returns 0= no, 3=fully calibrated ##### SYS_Calib_Status ##### GYR_Calib_Status ##### ACC_Calib_Status ##### MAG_Calib_Status #### Self Test Status 0= fail, 1= passed ##### ST_MCU ##### ST_GYR ##### ST_MAG ##### ST_ACC #### Interrupt Status 0=none, 1=triggered ##### ACC_NM accelerometer no motion ##### ACC_AM accelerometer any motion ##### ACC_HIGH_G accelerometer high-g ##### GYR_HIGH_RATE gyro ##### GYRO_AM gyro any motion #### System Clock Status 0= free to configure, 1= in configuration state ##### ST_MAIN_CLK #### System Status ##### System_Status_Code 0 System idle, 1 System Error, 2 Initializing peripherals 3 System Initializat ion 4 Executing selftest , 5 Sensor fusion algorithm running, 6 System running without fusion algorithm #### System Error ##### System_Error_Code Read the error status from this register if the SYS_STATUS (0x39) register is SYSTEM ERROR (0x01) Read : 0 No error 1 Peripheral initializat ion error 2 System initializat ion error 3 Self test result failed 4 Register map value out of range 5 Register map address out of range 6 Register map write error 7 BNO low power mode not available for selected operation mode 8 Accelerometer power mode not available 9 Fusion algorithm configuration error 10 Sensor configuration error #### Measurement Unit Selection ##### ORI_Android_Windows orientation 0=Windows,1=Android ##### TEMP_Unit temperature 0=Celcius,1=Fahrenheit(F=2*reading) ##### EUL_Unit Euler units 0=degrees,1=radians ##### GYR_Unit Gyro units 0= degrees/sec, 1= radians per second ##### ACC_Unit Accelerometer units 0=m/s^2, 1=mg #### Select or Read Operating Mode ##### Operation_Mode 0=CONFIG MODE 1=ACCONLY 2=MAGONLY 3=GYROONLY 4=ACCMAG 5=ACCGYRO 6=MAGGYRO 7=AMG 8=IMU 9=COMPASS 10=M4G 11=NDOF_FMC_OFF 12=NDOF #### Select or Read Power Mode ##### Power_Mode 0=Normal Mode 1=Low Power Mode 2=Suspend Mode #### System Triggers (write only) These are now separate functions in the module. ##### CLK_SEL 0=internal clock, 1=external clock ##### RST_INT 1= reset all interrupt status bits and INT output ##### RST_SYS 1= reset system ##### Self_Test 1=start self test #### Temperature Source ##### TEMP_Source 0= Accelerometer, 1= Gyro #### Axis Mapping Value Axis Representation 00 X - Axis 01 Y - Axis 10 Z- Axis 11 Invalid Also, when user tries to configure the same axis to two or more then BNO055 will take this as an invalid condition and previous configuration will be restored in the register map. The default values are X Axis = X, Y Axis = Y and Z Axis = Z ##### Remapped_Z_value ##### Remapped_Y_value ##### Remapped_X_value #### Select Sign for each axis Value Sign 0 Positive 1 Negative The default value is 0x00. ##### Remapped_X_sign ##### Remapped_Y_sign ##### Remapped_Z_sign //// PAGE 1 bits #### Accelerometer Configuration r/w Write: can only be changed in sensor mode ##### ACC_PWR_Mode 0=Normal 1=Suspend 2=Low Power 1 3=Standby 4=Low Power 2 5=Deep Suspend ##### ACC_BW Bandwidth 0=7.81Hz 1=15.63Hz 2=31.25Hz 3=62.5Hz 4=125Hz 5=250Hz 6=500Hz 7=1000Hz ##### ACC_Range G Range 0=2G 1=4G 2=8G 3=16G #### Magnetometer Configuration r/w Write: can only be changed in sensor mode ##### MAG_Power_mode Power Mode 0=Normal 1=Sleep 2=Suspend 3=Force Mode ##### MAG_OPR_Mode Operation Mode 0= Low Power 1=Regular 2=Enhanced Regular 3=High Accuracy ##### MAG_Data_output_rate Data output rate 0=2Hz 1=6Hz 2=8Hz 3=10Hz 4=15Hz 5=20Hz 6=25Hz 7=30Hz #### Gyro Configuration0 r/w ##### GYR_Bandwidth 0=523Hz 1=230Hz 2=116Hz 3=47Hz 4=23Hz 5=12Hz 6=64Hz 7=32Hz ##### GYR_Range 0=2000 dps 1=1000 dps 2=500 dps 3=250 dps 4=125 dps #### Gyro Configuration1 r/w GYR_Power_Mode 0=Normal 1=Fast Power up 2=Deep Suspend 3=Suspend 4=Advanced Powersave ####ACC_Sleep_Config r/w ##### ACC_SLP_DURATION 0=0.5 ms 1=0.5 ms 2=0.5 ms 3=0.5 ms 4=0.5 ms 5=0.5 ms 6= 1 ms 7= 2 ms 8= 4 ms 9= 6 ms 10= 10 ms 11= 25 ms 12= 50 ms 13= 100 ms 14= 500 ms 15= 1 ms ##### ACC_SLP_MODE The sleep timer mode for accelerometer low power mode can be only configured in the sensor operation mode where no fusion library is running Write 0: use event driven time-base mode 1: use equidistant sampling time-base mode #### GYRO Sleep Configuration r/w ##### GYR_AUTO_SLP_DURATION Auto sleep duration Time (ms) 0= Not allowed 1= 4 ms 2= 5 ms 3= 8 ms 4= 10 ms 5= 15 ms 6= 20 ms 7= 40 ms ##### GYR_SLP_DURATION Sleep duration Time (ms) 0= 2 ms 1= 4 ms 2= 5 ms 3= 8 ms 4= 10 ms 5= 15 ms 6= 18 ms 7= 20 ms #### Interrupt Mask r/w ##### ACC_NM_MSK Masking of Accelerometer no mot ion or slow mot ion interrupt , when enabled the interrupt will update the INT_STA register and t rigger a change on the INT pin, when disabled only the INT_STA register will be updated. Read: 1: Enabled / 0: Disabled Write: 1: Enable / 0: Disable ##### ACC_AM_MSK Masking of Accelerometer any motion interrupt , when enabled the interrupt will update the INT_STA register and trigger a change on the INT pin, when disabled only the INT_STA register will be updated. Read: 1: Enabled / 0: Disabled Write: 1: Enable / 0: Disable ##### ACC_HIGH_G_MSK Masking of Accelerometer high-g interrupt , when enabled the interrupt will update the INT_STA register and trigger a change on the INT pin, when disabled only the INT_STA register will be updated. Read: 1: Enabled / 0: Disabled Write: 1: Enable / 0: Disable ##### GYR_HIGH_RATE_MSK Masking of gyroscope high rate interrupt , when enabled the interrupt will update the INT_STA register and trigger a change on the INT pin, when disabled only the INT_STA register will be updated. Read: 1: Enabled / 0: Disabled Write: 1: Enable / 0: Disable ##### GYRO_AM_MSK Masking of gyroscope any mot ion interrupt , when enabled the interrupt will update the INT_STA register and trigger a change on the INT pin, when disabled only the INT_STA register will be updated. Read: 1: Enabled / 0: Disabled Write: 1: Enable / 0: Disable #### Interrupt Enable r/w ##### ACC_NM_EN Status of Accelerometer no motion or slow motion interrupt Read: 1: Enabled / 0: Disabled Write: 1: Enable / 0: Disable interrupt ##### ACC_AM_EN Status of Accelerometer any motion interrupt Read: 1: Enabled / 0: Disabled Write: 1: Enable / 0: Disable interrupt ##### ACC_HIGH_G_EN Status of Accelerometer high-g interrupt Read: 1: Enabled / 0: Disabled Write: 1: Enable / 0: Disable interrupt ##### GYR_HIGH_RATE_EN Status of gyroscope high rate interrupt Read: 1: Enabled / 0: Disabled Write: 1: Enable / 0: Disable interrupt ##### GYRO_AM_EN Status of gyroscope any motion interrupt Read: 1: Enabled / 0: Disabled Write: 1: Enable / 0: Disable interrupt #### Accelerometer Any Motion Threshold r/w ##### AccelerometerAnymotionthreshold Threshold used for the any-motion interrupt. The threshold value is dependent on the accelerometer range selected in the ACC_Config register. 1 LSB = 3.91 mg (2-g range) 1 LSB = 7.81 mg (4-g range) 1 LSB = 15.63 mg (8-g range) 1 LSB = 31.25 mg (16-g range) #### Accelerometer Interrupt Settings r/w ##### HG_Z_AXIS ##### HG_Y_AXIS ##### HG_X_AXIS Select which axis of the accelerometer is used to trigger a high-G interrupt 1: Enabled; 0: Disabled ##### AM_NM_Z_AXIS ##### AM_NM_Y_AXIS ##### AM_NM_X_AXIS Select which axis of the accelerometer is used to trigger a any motion or no motion interrupt 1: Enabled; 0: Disabled ##### AM_DUR Any motion interrupt triggers if AM_DUR+1 consecutive data points are above the any motion interrupt threshold defined in ACC_AM_THRES register #### Accelerometer High G Duration r/w ##### AccelerometerHighGDuration The high-g interrupt trigger delay according to [ACC_HG_DURATION + 1] * 2 ms in a range from 2 ms to 512 ms; #### Accelerometer High G Threshold r/w ##### AccelerometerHighGThreshold Threshold used high-g interrupt. The threshold value is dependent on the accelerometer range selected in the ACC_Config register. 1 LSB = 7.81 mg (2-g range 1 LSB = 15.63 mg (4-g range) 1 LSB = 31.25 mg (8-g range) 1 LSB = 62.5 mg (16-g range) #### Accelerometer No/Slow motion threshold r/w ##### AccelerometerNO_SLOWmotionthreshold Threshold used for the Slow mot ion or no motion interrupt. The threshold value is dependent on the accelerometer range selected in the ACC_Config register. 1 LSB = 3.91 mg (2-g range) 1 LSB = 7.81 mg (4-g range) 1 LSB = 15.63 mg (8-g range) 1 LSB = 31.25 mg (16-g range) #### Acceleration No/Slow Motion Interrupt Duration r/w ##### NO_SLOWMotionDuration Function depends on whether the slow-mot ion or no-motion interrupt function has been selected. If the slow-motion interrupt function has been enabled (SMNM = ‘0’) then [slo_no_mot_dur+1] consecutive slope data points must be above the slow/no-motion threshold (ACC_NM_THRES) for the slow-/no-motion interrupt to trigger. If the no-motion interrupt function has been enabled (SMNM = ‘1’) then slo_no_motion_dur defines the time for which no slope data points must exceed the slow/no-motion threshold (ACC_NM_THRES) for the slow/no-motion interrupt to trigger. The delay time in seconds may be calculated according with the following equat ion: slo_no_mot_dur=’b00’ ? [slo_no_mot_dur + 1] slo_no_mot_dur=’b01’ ? [slo_no_mot_dur * 4 + 20] slo_no_mot_dur=’1’ ? [slo_no_mot_dur * 8 + 88] ##### SMNM Select slow motion or no motion interrupt 1: Slow motion; 0: No motion #### Gyroscope Interrupt Setup r/w ##### HR_FILT ##### AM_FILT ‘1’ (‘0’) selects unfiltered (filtered) data for interrupt ##### HR_ZAXIS ##### HR_Y_AXIS ##### HR_X_AXIS 1’ (‘0’) enables (disables) high rate interrupt for axis ##### AM_Z_AXIS ##### AM_Y_AXIS ##### AM_X_AXIS 1’ (‘0’) enables (disables) any motion interrupt for axis #### Gyroscope High Rate Threshold Hysteresis and Threshold r/w ##### HR_X_THRES_HYST ##### HR_Y_THRES_HYST ##### HR_Z_THRES_HYST High rate hysteresis for axis =(255+ 256*HR_X_THRES_HYST) *4 LSB The high rate value scales with the range setting 1 LSB = 62.26°/s in 2000°/s-range 1 LSB = 31.13°/s in 1000°/s-range 1 LSB = 15.56°/s in 500°/s -range ##### HR_X_Threshold ##### HR_Y_Threshold ##### HR_Z_Threshold High rate threshold is for the gyroscope axis. The threshold value is dependent on the gyroscope range selected in the GRY_Config_0 register. 1 LSB = 62.5°/s in 2000°/s-range 1 LSB = 31.25°/s in 1000°/s-range 1 LSB = 15.625°/s in 500°/s -range #### Gyroscope High Rate Duration r/w ##### HR_X_Duration ##### HR_Y_Duration ##### HR_Z_Duration High rate duration = (1 + HR_X_Duration)*2.5ms #### Gyroscope Any Motion Threshold r/w ##### GyroAnyMotionThreshold Any motion threshold is for the gyroscope any motion interrupt . The threshold value is dependent on the gyroscope range selected in the GRY_Config_0 register. 1 LSB = 1 °/s in 2000°/s-range 1 LSB = 0.5°/s in 1000°/s-range 1 LSB = 0.25°/s in 500°/s -range #### Setup Any Motion Interrupt r/w ##### Awake_Durat_ion 0=8 samples, 1=16 samples, 2=32 samples, 3=64 samples ##### Slope_Samples Any motion interrupt triggers if [Slope Samples + 1]*4 consecutive data points are above the any motion interrupt threshold define in GYRO_AM_THRES register //5F - 50 UNIQUE_ID n.a. BNO unique ID };