2019-05-28 19:18:38 -03:00
#!/bin/sh
#
# PX4 FMUv5X specific board sensors init
#------------------------------------------------------------------------------
2020-09-08 00:09:20 -03:00
board_adc start
2019-11-11 16:35:59 -04:00
2021-08-20 16:35:52 -03:00
if param compare SENS_EN_INA226 1
then
# Start Digital power monitors
ina226 -X -b 1 -t 1 -k start
ina226 -X -b 2 -t 2 -k start
fi
if param compare SENS_EN_INA228 1
then
# Start Digital power monitors
ina228 -X -b 1 -t 1 -k start
ina228 -X -b 2 -t 2 -k start
fi
2019-07-27 14:38:09 -03:00
2021-04-02 10:50:30 -03:00
if ver hwtypecmp V5X90 V5X91 V5X92 V5Xa0 V5Xa1 V5Xa2
2021-02-13 18:23:12 -04:00
then
#SKYNODE base fmu board orientation
2019-05-28 19:18:38 -03:00
2021-04-02 10:50:30 -03:00
if ver hwtypecmp V5X90 V5X91 V5Xa0 V5Xa1
then
# Internal SPI BMI088
bmi088 -A -R 2 -s start
bmi088 -G -R 2 -s start
else
# Internal SPI bus ICM20649
icm20649 -s -R 4 start
fi
2021-01-12 09:11:40 -04:00
2021-02-13 18:23:12 -04:00
# Internal SPI bus ICM42688p
icm42688p -R 4 -s start
2021-01-12 09:11:40 -04:00
2021-02-13 18:23:12 -04:00
# Internal SPI bus ICM-20602 (hard-mounted)
icm20602 -R 8 -s start
# Internal magnetometer on I2c
bmm150 -I -R 6 start
else
#FMUv5Xbase board orientation
2021-04-02 10:50:30 -03:00
if ver hwtypecmp V5X00 V5X01
then
# Internal SPI BMI088
bmi088 -A -R 4 -s start
bmi088 -G -R 4 -s start
else
# Internal SPI bus ICM20649
icm20649 -s -R 6 start
fi
2021-02-13 18:23:12 -04:00
# Internal SPI bus ICM42688p
icm42688p -R 6 -s start
# Internal SPI bus ICM-20602 (hard-mounted)
icm20602 -R 10 -s start
# Internal magnetometer on I2c
bmm150 -I start
fi
2019-05-28 19:18:38 -03:00
2021-08-12 14:15:51 -03:00
# External compass on GPS1/I2C1 (the 3rd external bus): standard Holybro Pixhawk 4 or CUAV V5 GPS/compass puck (with lights, safety button, and buzzer)
ist8310 -X -b 1 -R 10 start
2020-02-18 12:14:10 -04:00
# Possible internal Baro
2019-10-31 07:07:07 -03:00
2021-02-13 18:23:12 -04:00
# Disable startup of internal baros if param is set to false
if param compare SENS_INT_BARO_EN 1
then
bmp388 -I -a 0x77 start
2021-08-13 16:59:00 -03:00
if ver hwtypecmp V5X00 V5X90 V5Xa0
2021-02-13 18:23:12 -04:00
then
bmp388 -I start
2021-08-13 16:59:00 -03:00
else
bmp388 -X -b 2 start
2021-02-13 18:23:12 -04:00
fi
fi