'imu_period'=>'auto',// 0xFFFFFFFF, // 0 - off, >=0xff000000 - "when ready", else - number of SCLK periods
'sclk_freq'=>5000000,// $clkr_divr= 8, // 80MHz divisor to get half SCLK rate (defaulkt SCLK=5MHz)
functioninit_default_config(){
$default_config=array(
'imu_period'=>'auto',// 0xFFFFFFFF, // 0 - off, >=0xff000000 - "when ready", else - number of SCLK periods
'sclk_freq'=>5000000,// $clkr_divr= 8, // 80MHz divisor to get half SCLK rate (defaulkt SCLK=5MHz)
'stall'=>2,// SPI stall time in usec
'baud_rate'=>19200,// $rs232_div=80/2/$baud
'imu_slot'=>1,
'gps_slot'=>2,
'gps_mode'=>2,// 0 - pps neg, 1 - pps pos, 2 - start of first sentence after pause, 3 start of sentence
'msg_conf'=>10,// GPIO bit number for external (odometer) input (+16 - invert polarity). Timestamp uses leading edge, software may write to 56-byte buffer before the trailing edge
'extra_conf'=>4,// 0 - config_long_sda_en, 1 -config_late_clk, 2 - config_single_wire, should be set for 103695 rev "A"
'slow_spi'=>0,// set to 1 for slow SPI devices (0 for ADIS-16375)
'imu_sa'=>3,// i2c slave address modifier for the 103695A pca9500
'sleep_busy'=>30000,//microseconds
'imu_registers'=>array(/// Up to 28 total
'baud_rate'=>19200,// $rs232_div=80/2/$baud
'imu_slot'=>1,
'gps_slot'=>2,
'gps_mode'=>2,// 0 - pps neg, 1 - pps pos, 2 - start of first sentence after pause, 3 start of sentence
'msg_conf'=>10,// GPIO bit number for external (odometer) input (+16 - invert polarity). Timestamp uses leading edge, software may write to 56-byte buffer before the trailing edge
'extra_conf'=>4,// 0 - config_long_sda_en, 1 -config_late_clk, 2 - config_single_wire, should be set for 103695 rev "A"
'slow_spi'=>0,// set to 1 for slow SPI devices (0 for ADIS-16375)
'imu_sa'=>3,// i2c slave address modifier for the 103695A pca9500
'sleep_busy'=>30000,// microseconds
'imu_registers'=>array(// / Up to 28 total
0x10,// x gyro low
0x12,// x gyro high
0x14,// y gyro low
...
...
@@ -620,327 +675,379 @@ function init_default_config(){
0x0e,// temperature
0x70,// time m/s
0x72,// time d/h
0x74// time y/m
0x74
)// time y/m
,
'nmea'=>array(
// / first three letters - sentence to log (letters after "$GP"). next "n"/"b" (up to 24 total) - "n" number (will be encoded 2 digits/byte, follwed by "0xF"
// / "b" - byte - all but last will have MSB 0 (& 0x7f), the last one - with MSB set (| 0x80). If there are no characters in the field 0xff will be output
array(
'RMC',
'nbnbnbnnnnb'
),
'nmea'=>array(
/// first three letters - sentence to log (letters after "$GP"). next "n"/"b" (up to 24 total) - "n" number (will be encoded 2 digits/byte, follwed by "0xF"
/// "b" - byte - all but last will have MSB 0 (& 0x7f), the last one - with MSB set (| 0x80). If there are no characters in the field 0xff will be output
array('RMC','nbnbnbnnnnb'),
array('GGA','nnbnbnnnnbnbbb'),
array('GSA','bnnnnnnnnnnnnnnnn'),
array('VTG','nbnbnbnb')
array(
'GGA',
'nnbnbnnnnbnbbb'
),
'message'=>'Odometer message'// Message - up to 56 bytes
);
array(
'GSA',
'bnnnnnnnnnnnnnnnn'
),
array(
'VTG',
'nbnbnbnb'
)
),
'message'=>'Odometer message'
)// Message - up to 56 bytes
;
return$default_config;
}
/**
Combines $conf and $dflt arrays - all driver parameters are overwritten aftre the call
@@ -468,8 +473,7 @@ function init_default_config() {
0x70,// time m/s
0x72,// time d/h
0x74
)// time y/m
,
),// time y/m
'nmea'=>array(
// / first three letters - sentence to log (letters after "$GP"). next "n"/"b" (up to 24 total) - "n" number (will be encoded 4 digits/byte, follwed by "0xF"
// / "b" - byte - all but last will have MSB 0 (& 0x7f), the last one - with MSB set (| 0x80). If there are no characters in the field 0xff will be output
...
...
@@ -491,8 +495,8 @@ function init_default_config() {
)
),
'message'=>'Odometer message'
)// Message - up to 56 bytes
;
);// Message - up to 56 bytes
return$default_config;
}
/**
...
...
@@ -539,7 +543,7 @@ function combineLoggerConfigs($new_conf, $dflt = null) {
return$conf;
}
functionsetup_IMU_logger($conf){
global$verbose;
global$verbose,$binfile;
// $xclk_freq=80000000; // 80 MHz in NC353
$xclk_freq=100000000;// 100 MHz in NC393
$data=array();
...
...
@@ -610,12 +614,12 @@ function setup_IMU_logger($conf) {
// / (DFLT_SLAVE_ADDR << 24))
$logger_conf|=($conf['slow_spi']&0x1)<<23;
$logger_conf|=($conf['imu_sa']&0x7)<<24;
$data[$index++]=$logger_conf&0xff;
$data[$index++]=$logger_conf&0xff;// DWORD 0x03
$data[$index++]=($logger_conf>>8)&0xff;
$data[$index++]=($logger_conf>>16)&0xff;
$data[$index++]=($logger_conf>>24)&0xff;
// / Set time driver will go to sleep if the data is not ready yet (less than full sample in the buffer)