Files
bizhang_-obav/boards/px4/fmu-v4/init/rc.board_sensors

45 lines
1.2 KiB
Plaintext
Raw Normal View History

#!/bin/sh
2018-11-30 14:05:31 -05:00
#
# PX4 FMUv4 specific board sensors init
2018-11-30 14:05:31 -05:00
#------------------------------------------------------------------------------
board_adc start
2019-11-11 15:35:59 -05:00
2018-11-30 14:05:31 -05:00
# 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.
2020-04-11 14:18:55 -04:00
pwm_out sensor_reset 50
2018-11-30 14:05:31 -05:00
# Internal SPI
ms5611 -s start
2018-11-30 14:05:31 -05:00
# hmc5883 internal SPI bus is rotated 90 deg yaw
if ! hmc5883 -T -s -R 2 start
2018-11-30 14:05:31 -05:00
then
# lis3mdl internal SPI bus is rotated 90 deg yaw
lis3mdl -s start
2018-11-30 14:05:31 -05:00
fi
# Start either ICM2060X. They are both connected to the same SPI bus and use the same
2018-11-30 14:05:31 -05:00
# 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
if ! icm20602 -s -R 8 start
2018-11-30 14:05:31 -05:00
then
# ICM20608 internal SPI bus ICM-20602-G
icm20608g -s -R 8 start
2018-11-30 14:05:31 -05:00
fi
# For Teal One airframe
if param compare SYS_AUTOSTART 4250
then
mpu6500 -s -R 0 start
else
# mpu9250 internal SPI bus mpu9250
mpu9250 -s -R 8 start
fi