mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-10 18:08:30 -04:00
AP_HAL: added the concept of a board subtype, and default sensor types
this will make the vehicle code much more generic
This commit is contained in:
parent
e2a3a4e45c
commit
5693392838
@ -18,10 +18,40 @@
|
||||
#define HAL_BOARD_FLYMAPLE 6
|
||||
#define HAL_BOARD_LINUX 7
|
||||
#define HAL_BOARD_VRBRAIN 8
|
||||
#define HAL_BOARD_ERLE 9
|
||||
#define HAL_BOARD_EMPTY 99
|
||||
|
||||
|
||||
/**
|
||||
HAL Linux sub-types
|
||||
*/
|
||||
#define HAL_BOARD_SUBTYPE_LINUX_NONE 0
|
||||
#define HAL_BOARD_SUBTYPE_LINUX_ERLE 1
|
||||
#define HAL_BOARD_SUBTYPE_LINUX_PXF 2
|
||||
|
||||
// InertialSensor driver types
|
||||
#define HAL_INS_OILPAN 1
|
||||
#define HAL_INS_MPU6000 2
|
||||
#define HAL_INS_HIL 3
|
||||
#define HAL_INS_PX4 4
|
||||
#define HAL_INS_FLYMAPLE 5
|
||||
#define HAL_INS_L3G4200D 6
|
||||
#define HAL_INS_VRBRAIN 7
|
||||
#define HAL_INS_MPU9250 8
|
||||
|
||||
// barometer driver types
|
||||
#define HAL_BARO_BMP085 1
|
||||
#define HAL_BARO_MS5611 2
|
||||
#define HAL_BARO_MS5611_SPI 3
|
||||
#define HAL_BARO_PX4 4
|
||||
#define HAL_BARO_HIL 5
|
||||
#define HAL_BARO_VRBRAIN 6
|
||||
|
||||
// compass driver types
|
||||
#define HAL_COMPASS_HMC5843 1
|
||||
#define HAL_COMPASS_PX4 2
|
||||
#define HAL_COMPASS_HIL 3
|
||||
#define HAL_COMPASS_VRBRAIN 4
|
||||
|
||||
/**
|
||||
CPU classes, used to select if CPU intensive algorithms should be used
|
||||
|
||||
@ -57,6 +87,9 @@
|
||||
#define HAL_CPU_CLASS HAL_CPU_CLASS_16
|
||||
#define HAL_STORAGE_SIZE 4096
|
||||
#define HAL_STORAGE_SIZE_AVAILABLE HAL_STORAGE_SIZE
|
||||
#define HAL_INS_DEFAULT HAL_INS_OILPAN
|
||||
#define HAL_BARO_DEFAULT HAL_BARO_BMP085
|
||||
#define HAL_COMPASS_DEFAULT HAL_COMPASS_HMC5843
|
||||
|
||||
#elif CONFIG_HAL_BOARD == HAL_BOARD_APM2
|
||||
#define AP_HAL_BOARD_DRIVER AP_HAL_AVR_APM2
|
||||
@ -64,6 +97,13 @@
|
||||
#define HAL_CPU_CLASS HAL_CPU_CLASS_16
|
||||
#define HAL_STORAGE_SIZE 4096
|
||||
#define HAL_STORAGE_SIZE_AVAILABLE HAL_STORAGE_SIZE
|
||||
#define HAL_INS_DEFAULT HAL_INS_MPU6000
|
||||
#ifdef APM2_BETA_HARDWARE
|
||||
#define HAL_BARO_DEFAULT HAL_BARO_BMP085
|
||||
#else
|
||||
#define HAL_BARO_DEFAULT HAL_BARO_MS5611_SPI
|
||||
#endif
|
||||
#define HAL_COMPASS_DEFAULT HAL_COMPASS_HMC5843
|
||||
|
||||
#elif CONFIG_HAL_BOARD == HAL_BOARD_AVR_SITL
|
||||
#define AP_HAL_BOARD_DRIVER AP_HAL_AVR_SITL
|
||||
@ -72,6 +112,10 @@
|
||||
#define HAL_OS_POSIX_IO 1
|
||||
#define HAL_STORAGE_SIZE 4096
|
||||
#define HAL_STORAGE_SIZE_AVAILABLE HAL_STORAGE_SIZE
|
||||
#define HAL_BOARD_LOG_DIRECTORY "logs"
|
||||
#define HAL_INS_DEFAULT HAL_INS_HIL
|
||||
#define HAL_BARO_DEFAULT HAL_BARO_HIL
|
||||
#define HAL_COMPASS_DEFAULT HAL_COMPASS_HIL
|
||||
|
||||
#elif CONFIG_HAL_BOARD == HAL_BOARD_FLYMAPLE
|
||||
#define AP_HAL_BOARD_DRIVER AP_HAL_FLYMAPLE
|
||||
@ -79,6 +123,10 @@
|
||||
#define HAL_CPU_CLASS HAL_CPU_CLASS_75
|
||||
#define HAL_STORAGE_SIZE 4096
|
||||
#define HAL_STORAGE_SIZE_AVAILABLE HAL_STORAGE_SIZE
|
||||
#define HAL_INS_DEFAULT HAL_INS_FLYMAPLE
|
||||
#define HAL_BARO_DEFAULT HAL_BARO_BMP085
|
||||
#define HAL_COMPASS_DEFAULT HAL_COMPASS_HMC5843
|
||||
#define HAL_SERIAL0_BAUD_DEFAULT 115200
|
||||
|
||||
#elif CONFIG_HAL_BOARD == HAL_BOARD_PX4
|
||||
#define AP_HAL_BOARD_DRIVER AP_HAL_PX4
|
||||
@ -87,6 +135,11 @@
|
||||
#define HAL_OS_POSIX_IO 1
|
||||
#define HAL_STORAGE_SIZE 4096
|
||||
#define HAL_STORAGE_SIZE_AVAILABLE HAL_STORAGE_SIZE
|
||||
#define HAL_BOARD_LOG_DIRECTORY "/fs/microsd/APM/LOGS"
|
||||
#define HAL_INS_DEFAULT HAL_INS_PX4
|
||||
#define HAL_BARO_DEFAULT HAL_BARO_PX4
|
||||
#define HAL_COMPASS_DEFAULT HAL_COMPASS_PX4
|
||||
#define HAL_SERIAL0_BAUD_DEFAULT 115200
|
||||
|
||||
#elif CONFIG_HAL_BOARD == HAL_BOARD_LINUX
|
||||
#define AP_HAL_BOARD_DRIVER AP_HAL_Linux
|
||||
@ -95,14 +148,17 @@
|
||||
#define HAL_OS_POSIX_IO 1
|
||||
#define HAL_STORAGE_SIZE 4096
|
||||
#define HAL_STORAGE_SIZE_AVAILABLE HAL_STORAGE_SIZE
|
||||
|
||||
#elif CONFIG_HAL_BOARD == HAL_BOARD_ERLE
|
||||
#define AP_HAL_BOARD_DRIVER AP_HAL_Linux
|
||||
#define HAL_BOARD_NAME "Erle Linux"
|
||||
#define HAL_CPU_CLASS HAL_CPU_CLASS_1000
|
||||
#define HAL_OS_POSIX_IO 1
|
||||
#define HAL_STORAGE_SIZE 4096
|
||||
#define HAL_STORAGE_SIZE_AVAILABLE HAL_STORAGE_SIZE
|
||||
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_NONE
|
||||
#define HAL_BOARD_LOG_DIRECTORY "logs"
|
||||
#define HAL_INS_DEFAULT HAL_INS_HIL
|
||||
#define HAL_BARO_DEFAULT HAL_BARO_HIL
|
||||
#define HAL_COMPASS_DEFAULT HAL_COMPASS_HIL
|
||||
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_PXF || CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_ERLE
|
||||
#define HAL_BOARD_LOG_DIRECTORY "/var/APM/logs"
|
||||
#define HAL_INS_DEFAULT HAL_INS_MPU9250
|
||||
#define HAL_BARO_DEFAULT HAL_BARO_MS5611_SPI
|
||||
#define HAL_COMPASS_DEFAULT HAL_COMPASS_HMC5843
|
||||
#endif
|
||||
|
||||
#elif CONFIG_HAL_BOARD == HAL_BOARD_EMPTY
|
||||
#define AP_HAL_BOARD_DRIVER AP_HAL_Empty
|
||||
@ -110,6 +166,9 @@
|
||||
#define HAL_CPU_CLASS HAL_CPU_CLASS_16
|
||||
#define HAL_STORAGE_SIZE 4096
|
||||
#define HAL_STORAGE_SIZE_AVAILABLE HAL_STORAGE_SIZE
|
||||
#define HAL_INS_DEFAULT HAL_INS_HIL
|
||||
#define HAL_BARO_DEFAULT HAL_BARO_HIL
|
||||
#define HAL_COMPASS_DEFAULT HAL_COMPASS_HIL
|
||||
|
||||
#elif CONFIG_HAL_BOARD == HAL_BOARD_VRBRAIN
|
||||
#define AP_HAL_BOARD_DRIVER AP_HAL_VRBRAIN
|
||||
@ -118,6 +177,11 @@
|
||||
#define HAL_OS_POSIX_IO 1
|
||||
#define HAL_STORAGE_SIZE 4096
|
||||
#define HAL_STORAGE_SIZE_AVAILABLE HAL_STORAGE_SIZE
|
||||
#define HAL_BOARD_LOG_DIRECTORY "/fs/microsd/APM/LOGS"
|
||||
#define HAL_INS_DEFAULT HAL_INS_PX4
|
||||
#define HAL_BARO_DEFAULT HAL_BARO_PX4
|
||||
#define HAL_COMPASS_DEFAULT HAL_COMPASS_PX4
|
||||
#define HAL_SERIAL0_BAUD_DEFAULT 115200
|
||||
|
||||
#else
|
||||
#error "Unknown CONFIG_HAL_BOARD type"
|
||||
|
Loading…
Reference in New Issue
Block a user