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.

74 lines
1.9 KiB

#!/bin/sh
#
# PX4 FMUv4 specific board sensors init
#------------------------------------------------------------------------------
# We know there are sketchy boards out there
# as chinese companies produce Pixracers without
# fully understanding the critical parts of the
# schematic and BOM, leading to sensor brownouts
# on boot. Original Pixracers following the
# open hardware design do not require this.
fmu sensor_reset 50
# External I2C bus
hmc5883 -C -T -X start
lis3mdl -X start
ist8310 start
bmp280 -X start
qmc5883 -X start
# expansion i2c used for BMM150 rotated by 90deg
bmm150 -X -R 2 start
# Internal SPI
ms5611 -s start
# For Teal One airframe
if param compare SYS_AUTOSTART 4250
then
mpu9250 -s -R 14 start
mpu9250 -t -R 14 start
fi
# hmc5883 internal SPI bus is rotated 90 deg yaw
if ! hmc5883 -C -T -S -R 2 start
then
# lis3mdl internal SPI bus is rotated 90 deg yaw
if ! lis3mdl start
then
# BMI055 gyro internal SPI bus
bmi055 -G start
fi
fi
# Start either ICM2060X or BMI055. They are both connected to the same SPI bus and use the same
# chip select pin. There are different boards with either one of them and the WHO_AM_I register
# will prevent the incorrect driver from a successful initialization.
# ICM20602 internal SPI bus ICM-20608-G is rotated 90 deg yaw
if ! mpu6000 -R 2 -T 20602 start
then
# ICM20608 internal SPI bus ICM-20602-G is rotated 90 deg yaw
if ! mpu6000 -R 2 -T 20608 start
then
# BMI055 accel internal SPI bus
bmi055 -A start
fi
fi
# Start either MPU9250 or BMI160. They are both connected to the same SPI bus and use the same
# chip select pin. There are different boards with either one of them and the WHO_AM_I register
# will prevent the incorrect driver from a successful initialization.
# mpu9250 internal SPI bus mpu9250 is rotated 90 deg yaw
if ! mpu9250 -R 2 start
then
# BMI160 internal SPI bus
bmi160 start
fi
# External RM3100 (I2C or SPI)
rm3100 start