2018-12-18 04:26:22 -04:00
|
|
|
#!/bin/sh
|
2013-04-26 20:14:32 -03:00
|
|
|
#
|
2017-10-05 18:29:44 -03:00
|
|
|
# Standard startup script for sensor drivers.
|
2013-04-26 20:14:32 -03:00
|
|
|
#
|
2018-07-26 21:18:53 -03:00
|
|
|
# NOTE: Script variables are declared/initialized/unset in the rcS script.
|
|
|
|
#
|
2018-07-20 01:32:11 -03:00
|
|
|
###############################################################################
|
|
|
|
# Begin Optional drivers #
|
|
|
|
###############################################################################
|
2017-06-16 12:49:14 -03:00
|
|
|
|
2019-10-07 04:50:12 -03:00
|
|
|
if param compare -s SENS_EN_BATT 1
|
2018-12-05 10:49:58 -04:00
|
|
|
then
|
|
|
|
batt_smbus start -X
|
|
|
|
fi
|
|
|
|
|
2021-06-09 13:17:45 -03:00
|
|
|
# Start batmon driver if enabled using BATMON_DRIVER_EN
|
|
|
|
if param compare -s BATMON_DRIVER_EN 1
|
|
|
|
then
|
|
|
|
batmon start -X #start on external bus
|
|
|
|
fi
|
|
|
|
|
2017-06-16 12:49:14 -03:00
|
|
|
# Sensors on the PWM interface bank
|
2019-10-07 04:50:12 -03:00
|
|
|
if param compare -s SENS_EN_LL40LS 1
|
2017-06-16 12:49:14 -03:00
|
|
|
then
|
|
|
|
if pwm_input start
|
|
|
|
then
|
2020-03-03 14:01:59 -04:00
|
|
|
ll40ls_pwm start
|
2017-06-16 12:49:14 -03:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2020-01-06 21:14:06 -04:00
|
|
|
# External automatic trigger system
|
|
|
|
if param compare FD_EXT_ATS_EN 1
|
|
|
|
then
|
|
|
|
pwm_input start
|
|
|
|
fi
|
|
|
|
|
2017-06-16 12:49:14 -03:00
|
|
|
# Lidar-Lite on I2C
|
2019-10-07 04:50:12 -03:00
|
|
|
if param compare -s SENS_EN_LL40LS 2
|
2017-06-16 12:49:14 -03:00
|
|
|
then
|
2020-03-02 06:50:25 -04:00
|
|
|
ll40ls start -X
|
2017-06-16 12:49:14 -03:00
|
|
|
fi
|
|
|
|
|
2019-06-15 22:13:52 -03:00
|
|
|
# mappydot lidar sensor
|
2019-10-07 04:50:12 -03:00
|
|
|
if param compare -s SENS_EN_MPDT 1
|
2019-06-15 22:13:52 -03:00
|
|
|
then
|
2020-03-02 07:03:10 -04:00
|
|
|
mappydot start -X
|
2019-06-15 22:13:52 -03:00
|
|
|
fi
|
|
|
|
|
2018-05-19 12:33:20 -03:00
|
|
|
# mb12xx sonar sensor
|
2019-10-07 04:50:12 -03:00
|
|
|
if param greater -s SENS_EN_MB12XX 0
|
2018-05-19 12:33:20 -03:00
|
|
|
then
|
2020-03-02 08:55:55 -04:00
|
|
|
mb12xx start -X
|
2018-05-19 12:33:20 -03:00
|
|
|
fi
|
|
|
|
|
2018-08-23 21:01:08 -03:00
|
|
|
# pga460 sonar sensor
|
2019-10-07 04:50:12 -03:00
|
|
|
if param greater -s SENS_EN_PGA460 0
|
2018-08-23 21:01:08 -03:00
|
|
|
then
|
|
|
|
pga460 start
|
|
|
|
fi
|
|
|
|
|
2018-07-20 01:32:11 -03:00
|
|
|
# Lightware i2c lidar sensor
|
2019-10-07 04:50:12 -03:00
|
|
|
if param greater -s SENS_EN_SF1XX 0
|
2017-06-16 12:49:14 -03:00
|
|
|
then
|
2020-10-22 03:40:28 -03:00
|
|
|
lightware_laser_i2c start -X
|
2017-06-16 12:49:14 -03:00
|
|
|
fi
|
|
|
|
|
2020-11-08 14:25:58 -04:00
|
|
|
# Sensor HY-SRF05 or HC-SR05 ultrasonic sensor
|
|
|
|
if param compare -s SENS_EN_SR05 1
|
|
|
|
then
|
|
|
|
srf05 start
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2018-05-19 12:33:20 -03:00
|
|
|
# Heater driver for temperature regulated IMUs.
|
2019-10-07 04:50:12 -03:00
|
|
|
if param compare -s SENS_EN_THERMAL 1
|
2017-06-16 12:49:14 -03:00
|
|
|
then
|
2018-05-19 12:33:20 -03:00
|
|
|
heater start
|
2017-06-16 12:49:14 -03:00
|
|
|
fi
|
|
|
|
|
2018-07-20 01:32:11 -03:00
|
|
|
# Teraranger one tof sensor
|
2019-10-07 04:50:12 -03:00
|
|
|
if param greater -s SENS_EN_TRANGER 0
|
2017-06-16 12:49:14 -03:00
|
|
|
then
|
2020-03-02 10:03:57 -04:00
|
|
|
teraranger start -X
|
2017-06-16 12:49:14 -03:00
|
|
|
fi
|
|
|
|
|
2022-04-08 16:55:52 -03:00
|
|
|
# paa3905 optical flow sensor (external SPI)
|
|
|
|
if param greater -s SENS_EN_PAA3905 0
|
2019-09-02 12:08:51 -03:00
|
|
|
then
|
2022-04-08 16:55:52 -03:00
|
|
|
paa3905 -S start
|
2019-09-02 12:08:51 -03:00
|
|
|
fi
|
|
|
|
|
2022-04-08 16:55:52 -03:00
|
|
|
# paw3902 optical flow sensor (external SPI)
|
2020-03-26 12:24:48 -03:00
|
|
|
if param greater -s SENS_EN_PAW3902 0
|
|
|
|
then
|
|
|
|
paw3902 -S start
|
|
|
|
fi
|
|
|
|
|
2022-04-08 16:55:52 -03:00
|
|
|
# pmw3901 optical flow sensor (external SPI)
|
|
|
|
if param greater -s SENS_EN_PMW3901 0
|
|
|
|
then
|
|
|
|
pmw3901 -S start
|
|
|
|
fi
|
|
|
|
|
2023-01-08 19:33:43 -04:00
|
|
|
# vl53l0x i2c distance sensor
|
|
|
|
if param compare -s SENS_EN_VL53L0X 1
|
|
|
|
then
|
|
|
|
vl53l0x start -X
|
|
|
|
fi
|
|
|
|
|
2020-12-07 14:17:02 -04:00
|
|
|
# vl53l1x i2c distance sensor
|
2020-12-08 13:10:25 -04:00
|
|
|
if param compare -s SENS_EN_VL53L1X 1
|
2020-12-07 14:17:02 -04:00
|
|
|
then
|
|
|
|
vl53l1x start -X
|
|
|
|
fi
|
|
|
|
|
2023-01-03 05:21:06 -04:00
|
|
|
# tf02 pro i2c distance sensor
|
|
|
|
if param compare -s SENS_EN_TF02PRO 1
|
|
|
|
then
|
|
|
|
tf02pro start -X
|
|
|
|
fi
|
|
|
|
|
2021-04-03 12:48:29 -03:00
|
|
|
# ADIS16448 spi external IMU
|
|
|
|
if param compare -s SENS_EN_ADIS164X 1
|
|
|
|
then
|
2021-06-28 07:09:38 -03:00
|
|
|
if param compare -s SENS_OR_ADIS164X 0
|
|
|
|
then
|
|
|
|
adis16448 -S start
|
|
|
|
fi
|
|
|
|
if param compare -s SENS_OR_ADIS164X 4
|
|
|
|
then
|
|
|
|
adis16448 -S start -R 4
|
|
|
|
fi
|
2021-04-03 12:48:29 -03:00
|
|
|
fi
|
|
|
|
|
2023-05-05 17:23:06 -03:00
|
|
|
# ADIS16507 spi external IMU
|
|
|
|
if param greater -s SENS_EN_ADIS165X 0
|
|
|
|
then
|
|
|
|
adis16507 -S start
|
|
|
|
fi
|
|
|
|
|
2021-06-27 22:38:17 -03:00
|
|
|
# Eagle Tree airspeed sensor external I2C
|
|
|
|
if param compare -s SENS_EN_ETSASPD 1
|
|
|
|
then
|
|
|
|
ets_airspeed start -X
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Sensirion SDP3X differential pressure sensor external I2C
|
|
|
|
if param compare -s SENS_EN_SDP3X 1
|
|
|
|
then
|
2021-12-27 12:01:25 -04:00
|
|
|
if ! sdp3x start -X
|
2021-06-27 22:38:17 -03:00
|
|
|
then
|
|
|
|
# try another common address
|
2021-12-27 12:01:25 -04:00
|
|
|
sdp3x start -X -a 0x22
|
2021-06-27 22:38:17 -03:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2021-12-27 12:01:25 -04:00
|
|
|
# TE MS4515 differential pressure sensor external I2C
|
|
|
|
if param compare -s SENS_EN_MS4515 1
|
2022-01-03 16:04:29 -04:00
|
|
|
then
|
2021-12-27 12:01:25 -04:00
|
|
|
ms4515 start -X
|
2022-01-03 16:04:29 -04:00
|
|
|
fi
|
|
|
|
|
2021-12-27 12:01:25 -04:00
|
|
|
# TE MS4525DO differential pressure sensor external I2C
|
|
|
|
if param compare -s SENS_EN_MS4525DO 1
|
2021-06-27 22:38:17 -03:00
|
|
|
then
|
2021-12-27 12:01:25 -04:00
|
|
|
ms4525do start -X
|
2021-06-27 22:38:17 -03:00
|
|
|
fi
|
|
|
|
|
2021-12-27 12:01:25 -04:00
|
|
|
# TE MS5525DSO differential pressure sensor external I2C
|
|
|
|
if param compare -s SENS_EN_MS5525DS 1
|
2021-06-27 22:38:17 -03:00
|
|
|
then
|
2021-12-27 12:01:25 -04:00
|
|
|
ms5525dso start -X
|
|
|
|
fi
|
|
|
|
|
2023-09-04 19:21:05 -03:00
|
|
|
# TE ASP5033 differential pressure sensor external I2C
|
|
|
|
if param compare -s SENS_EN_ASP5033 1
|
|
|
|
then
|
|
|
|
asp5033 start -X
|
|
|
|
fi
|
|
|
|
|
2021-12-27 12:01:25 -04:00
|
|
|
# SHT3x temperature and hygrometer sensor, external I2C
|
|
|
|
if param compare -s SENS_EN_SHT3X 1
|
|
|
|
then
|
|
|
|
sht3x start -X
|
|
|
|
sht3x start -X -a 0x45
|
2021-06-27 22:38:17 -03:00
|
|
|
fi
|
|
|
|
|
2022-02-11 12:56:54 -04:00
|
|
|
# IR-LOCK sensor external I2C
|
|
|
|
if param compare -s SENS_EN_IRLOCK 1
|
|
|
|
then
|
|
|
|
irlock start -X
|
|
|
|
fi
|
|
|
|
|
2022-03-15 11:13:03 -03:00
|
|
|
# SPL06 sensor external I2C
|
|
|
|
if param compare -s SENS_EN_SPL06 1
|
|
|
|
then
|
|
|
|
spl06 -X start
|
|
|
|
spl06 -X -a 0x77 start
|
|
|
|
fi
|
|
|
|
|
2022-02-21 17:47:16 -04:00
|
|
|
# PCF8583 counter (RPM sensor)
|
|
|
|
if param compare -s SENS_EN_PCF8583 1
|
|
|
|
then
|
|
|
|
pcf8583 start -X
|
|
|
|
pcf8583 start -X -a 0x51
|
|
|
|
fi
|
|
|
|
|
2020-06-08 11:28:38 -03:00
|
|
|
# probe for optional external I2C devices
|
|
|
|
if param compare SENS_EXT_I2C_PRB 1
|
|
|
|
then
|
2021-04-04 22:18:16 -03:00
|
|
|
icm20948_i2c_passthrough -X -q start
|
|
|
|
|
2020-06-08 11:28:38 -03:00
|
|
|
# compasses
|
2020-08-26 03:46:35 -03:00
|
|
|
hmc5883 -T -X -q start
|
|
|
|
ist8308 -X -q start
|
|
|
|
ist8310 -X -q start
|
|
|
|
lis2mdl -X -q start
|
2022-11-01 03:42:27 -03:00
|
|
|
if ! lis3mdl -X -q start
|
|
|
|
then
|
|
|
|
lis3mdl -X -q -a 0x1c start
|
|
|
|
fi
|
2020-09-02 14:16:27 -03:00
|
|
|
qmc5883l -X -q start
|
2020-08-26 03:46:35 -03:00
|
|
|
rm3100 -X -q start
|
2020-06-08 11:28:38 -03:00
|
|
|
|
2021-04-04 22:18:16 -03:00
|
|
|
# start last (wait for possible icm20948 passthrough mode)
|
|
|
|
ak09916 -X -q start
|
2020-06-08 11:28:38 -03:00
|
|
|
fi
|