You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
176 lines
3.6 KiB
176 lines
3.6 KiB
#!nsh |
|
# |
|
# Standard startup script for sensor drivers. |
|
# |
|
# NOTE: Script variables are declared/initialized/unset in the rcS script. |
|
# |
|
|
|
############################################################################### |
|
# Begin Setup for board specific configurations. # |
|
############################################################################### |
|
|
|
if ! ver hwcmp AEROFC_V1 OMNIBUS_F4SD |
|
then |
|
if ! ver hwcmp BITCRAZE_CRAZYFLIE |
|
then |
|
# Configure all I2C buses to 100 KHz as they |
|
# are all external or slow |
|
fmu i2c 1 100000 |
|
fmu i2c 2 100000 |
|
fi |
|
|
|
# External SPI |
|
ms5611 -S start |
|
|
|
# Internal SPI (auto detect ms5611 or ms5607) |
|
ms5611 -T 0 -s start |
|
|
|
# Blacksheep telemetry |
|
bst start |
|
|
|
adc start |
|
fi |
|
|
|
if ver hwcmp GUMSTIX_AEROCORE2 |
|
then |
|
l3gd20 -R 12 start |
|
lsm303d start |
|
fi |
|
|
|
if ver hwcmp AUAV_X21 |
|
then |
|
# External I2C bus |
|
hmc5883 -C -T -X start |
|
lis3mdl -X start |
|
|
|
# Internal SPI bus ICM-20608-G is rotated 90 deg yaw |
|
mpu6000 -R 2 -T 20608 start |
|
|
|
# Internal SPI bus ICM-20602-G is rotated 90 deg yaw |
|
mpu6000 -R 2 -T 20602 start |
|
|
|
# Internal SPI bus mpu9250 is rotated 90 deg yaw |
|
mpu9250 -R 2 start |
|
fi |
|
|
|
if ver hwcmp BITCRAZE_CRAZYFLIE |
|
then |
|
# Onboard I2C |
|
mpu9250 -R 12 start |
|
|
|
# I2C bypass of mpu |
|
lps25h start |
|
|
|
# Optical flow deck |
|
vl53lxx start |
|
pmw3901 start |
|
|
|
fi |
|
|
|
if ver hwcmp AIRMIND_MINDPX_V2 |
|
then |
|
# External I2C bus |
|
hmc5883 -C -T -X start |
|
|
|
# Internal I2C bus |
|
hmc5883 -C -T -I -R 12 start |
|
|
|
mpu6000 -s -R 8 start |
|
mpu9250 -s -R 8 start |
|
lsm303d -R 10 start |
|
l3gd20 -R 14 start |
|
fi |
|
|
|
if ver hwcmp ATMEL_SAME70XPLAINED_V1 |
|
then |
|
# External I2C bus |
|
hmc5883 -C -T -X start |
|
|
|
# Internal SPI bus mpu9250 is rotated 90 deg yaw |
|
mpu9250 -R 2 start |
|
fi |
|
|
|
############################################################################### |
|
# End Setup for board specific configurations. # |
|
############################################################################### |
|
|
|
############################################################################### |
|
# Begin Optional drivers # |
|
############################################################################### |
|
|
|
if [ ${VEHICLE_TYPE} = fw -o ${VEHICLE_TYPE} = vtol ] |
|
then |
|
if param compare CBRK_AIRSPD_CHK 0 |
|
then |
|
sdp3x_airspeed start -a |
|
|
|
# Pixhawk 2.1 has a MS5611 on I2C which gets wrongly |
|
# detected as MS5525 because the chip manufacturer was so |
|
# clever to assign the same I2C address and skip a WHO_AM_I |
|
# register. |
|
if [ $BOARD_FMUV3 = 21 ] |
|
then |
|
ms5525_airspeed start -b 2 |
|
else |
|
ms5525_airspeed start -a |
|
fi |
|
|
|
ms4525_airspeed start -a |
|
|
|
ets_airspeed start -a |
|
|
|
fi |
|
fi |
|
|
|
# Sensors on the PWM interface bank |
|
if param compare SENS_EN_LL40LS 1 |
|
then |
|
if pwm_input start |
|
then |
|
ll40ls start pwm |
|
fi |
|
fi |
|
|
|
# Lidar-Lite on I2C |
|
if param compare SENS_EN_LL40LS 2 |
|
then |
|
ll40ls start i2c |
|
fi |
|
|
|
# mb12xx sonar sensor |
|
if param greater SENS_EN_MB12XX 0 |
|
then |
|
mb12xx start -a |
|
fi |
|
|
|
# pga460 sonar sensor |
|
if param greater SENS_EN_PGA460 0 |
|
then |
|
pga460 start |
|
fi |
|
|
|
# Lightware i2c lidar sensor |
|
if param greater SENS_EN_SF1XX 0 |
|
then |
|
sf1xx start -a |
|
fi |
|
|
|
# Heater driver for temperature regulated IMUs. |
|
if param compare SENS_EN_THERMAL 1 |
|
then |
|
heater start |
|
fi |
|
|
|
# Teraranger one tof sensor |
|
if param greater SENS_EN_TRANGER 0 |
|
then |
|
teraranger start -a |
|
fi |
|
|
|
############################################################################### |
|
# End Optional drivers # |
|
############################################################################### |
|
|
|
# Wait 20 ms for sensors (because we need to wait for the HRT and work queue callbacks to fire) |
|
usleep 20000 |
|
sensors start
|
|
|