2016-09-24 07:42:22 -03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#define HAL_BOARD_NAME "PX4"
|
|
|
|
#define HAL_CPU_CLASS HAL_CPU_CLASS_150
|
|
|
|
#define HAL_OS_POSIX_IO 1
|
|
|
|
#define HAL_BOARD_LOG_DIRECTORY "/fs/microsd/APM/LOGS"
|
|
|
|
#define HAL_BOARD_TERRAIN_DIRECTORY "/fs/microsd/APM/TERRAIN"
|
|
|
|
#define HAL_PARAM_DEFAULTS_PATH "/etc/defaults.parm"
|
|
|
|
#define HAL_INS_DEFAULT HAL_INS_PX4
|
|
|
|
#define HAL_BARO_DEFAULT HAL_BARO_PX4
|
|
|
|
#define HAL_COMPASS_DEFAULT HAL_COMPASS_PX4
|
|
|
|
|
2018-02-13 21:39:37 -04:00
|
|
|
#define HAL_HAVE_GETTIME_SETTIME 1
|
|
|
|
|
2016-09-24 07:42:22 -03:00
|
|
|
#ifdef CONFIG_ARCH_BOARD_PX4FMU_V1
|
|
|
|
#define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_PX4_V1
|
|
|
|
#define HAL_STORAGE_SIZE 8192
|
2017-05-25 01:35:56 -03:00
|
|
|
#elif defined(CONFIG_ARCH_BOARD_PX4FMU_V3)
|
|
|
|
// check for V3 before V2 as V3 also defines V2
|
|
|
|
#define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_PX4_V3
|
2016-09-24 07:42:22 -03:00
|
|
|
#define HAL_STORAGE_SIZE 16384
|
|
|
|
#define HAL_HAVE_IMU_HEATER 1 // for Pixhawk2
|
|
|
|
#define HAL_IMU_TEMP_DEFAULT -1 // disabled
|
2017-01-27 00:52:51 -04:00
|
|
|
#define HAL_WITH_UAVCAN 1
|
2017-05-25 01:35:56 -03:00
|
|
|
#elif defined(CONFIG_ARCH_BOARD_PX4FMU_V2)
|
|
|
|
#define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_PX4_V2
|
2016-12-09 22:04:47 -04:00
|
|
|
#define HAL_STORAGE_SIZE 16384
|
|
|
|
#define HAL_HAVE_IMU_HEATER 1 // for Pixhawk2
|
|
|
|
#define HAL_IMU_TEMP_DEFAULT -1 // disabled
|
2016-12-10 03:01:49 -04:00
|
|
|
#define HAL_WITH_UAVCAN 1
|
2017-05-25 01:35:56 -03:00
|
|
|
#define HAL_MINIMIZE_FEATURES 1
|
2016-11-02 19:34:36 -03:00
|
|
|
#elif defined(CONFIG_ARCH_BOARD_PX4FMU_V4)
|
|
|
|
#define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_PX4_V4
|
|
|
|
#define HAL_STORAGE_SIZE 16384
|
2017-07-15 02:12:39 -03:00
|
|
|
#define HAL_WITH_UAVCAN 1
|
|
|
|
#elif defined(CONFIG_ARCH_BOARD_PX4FMU_V4PRO)
|
|
|
|
#define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_PX4_V4PRO
|
|
|
|
#define HAL_STORAGE_SIZE 16384
|
|
|
|
#define HAL_WITH_UAVCAN 1
|
2017-01-27 05:21:12 -04:00
|
|
|
#elif defined(CONFIG_ARCH_BOARD_AEROFC_V1)
|
|
|
|
#define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_PX4_AEROFC_V1
|
|
|
|
#define HAL_STORAGE_SIZE 16384
|
|
|
|
#define USE_FLASH_STORAGE 1
|
2017-05-19 02:55:57 -03:00
|
|
|
#define HAL_RCOUTPUT_TAP_DEVICE "/dev/ttyS0"
|
2017-01-27 05:21:12 -04:00
|
|
|
// we don't have any sdcard
|
2017-06-05 18:56:21 -03:00
|
|
|
#undef HAL_BOARD_LOG_DIRECTORY
|
|
|
|
#undef HAL_BOARD_TERRAIN_DIRECTORY
|
2016-11-02 19:34:36 -03:00
|
|
|
#else
|
|
|
|
#error "Unknown PX4 board type"
|
2016-09-24 07:42:22 -03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define HAL_GPIO_A_LED_PIN 27
|
|
|
|
#define HAL_GPIO_B_LED_PIN 26
|
|
|
|
#define HAL_GPIO_C_LED_PIN 25
|
2018-02-11 17:51:12 -04:00
|
|
|
#define HAL_GPIO_LED_ON 0
|
|
|
|
#define HAL_GPIO_LED_OFF 1
|
2016-09-24 07:42:22 -03:00
|
|
|
|
2016-11-01 07:28:40 -03:00
|
|
|
#define HAL_BARO_MS5611_NAME "ms5611"
|
2016-11-02 19:35:10 -03:00
|
|
|
#define HAL_BARO_MS5611_SPI_INT_NAME "ms5611_int"
|
|
|
|
#define HAL_BARO_MS5611_SPI_EXT_NAME "ms5611_ext"
|
|
|
|
|
2016-11-01 07:28:40 -03:00
|
|
|
#define HAL_INS_MPU60x0_NAME "mpu6000"
|
2016-11-04 03:58:08 -03:00
|
|
|
#define HAL_INS_MPU60x0_EXT_NAME "mpu6000_ext"
|
|
|
|
|
2016-11-01 07:28:40 -03:00
|
|
|
#define HAL_INS_LSM9DS0_G_NAME "lsm9ds0_g"
|
2016-11-03 07:04:12 -03:00
|
|
|
#define HAL_INS_LSM9DS0_A_NAME "lsm9ds0_am"
|
2016-11-01 07:28:40 -03:00
|
|
|
|
2016-11-04 03:58:08 -03:00
|
|
|
#define HAL_INS_LSM9DS0_EXT_G_NAME "lsm9ds0_ext_g"
|
|
|
|
#define HAL_INS_LSM9DS0_EXT_A_NAME "lsm9ds0_ext_am"
|
|
|
|
|
2016-11-03 21:07:04 -03:00
|
|
|
#define HAL_INS_MPU9250_NAME "mpu9250"
|
|
|
|
#define HAL_INS_MPU9250_EXT_NAME "mpu9250_ext"
|
2016-11-04 03:58:08 -03:00
|
|
|
|
2017-02-06 19:51:58 -04:00
|
|
|
#define HAL_INS_MPU6500_NAME "mpu6500"
|
|
|
|
|
2016-11-05 06:42:56 -03:00
|
|
|
#define HAL_INS_ICM20608_NAME "icm20608"
|
2016-11-08 20:31:54 -04:00
|
|
|
#define HAL_INS_ICM20608_AM_NAME "icm20608-am"
|
2016-11-10 00:28:57 -04:00
|
|
|
#define HAL_INS_ICM20608_EXT_NAME "icm20608_ext"
|
2016-11-05 06:42:56 -03:00
|
|
|
|
2016-11-04 03:58:08 -03:00
|
|
|
#define HAL_COMPASS_HMC5843_NAME "hmc5843"
|
2017-07-15 02:12:39 -03:00
|
|
|
#define HAL_COMPASS_LIS3MDL_NAME "lis3mdl"
|
2016-11-07 23:41:09 -04:00
|
|
|
|
2017-03-20 14:55:01 -03:00
|
|
|
/* px4fmu-v1 */
|
2016-11-07 23:41:09 -04:00
|
|
|
#ifdef CONFIG_ARCH_BOARD_PX4FMU_V1
|
2016-11-13 01:21:05 -04:00
|
|
|
#define HAL_BARO_MS5611_I2C_ADDR 0x76
|
2016-11-07 23:41:09 -04:00
|
|
|
#define HAL_BARO_MS5611_I2C_BUS 0
|
2017-03-20 14:57:14 -03:00
|
|
|
#define HAL_HAVE_BOARD_VOLTAGE 0
|
2017-03-20 16:32:49 -03:00
|
|
|
#define HAL_PX4_HAVE_PWM_INPUT 0
|
2016-11-07 23:41:09 -04:00
|
|
|
#endif
|
|
|
|
|
2017-03-20 15:23:42 -03:00
|
|
|
/* px4fmu-v4 */
|
|
|
|
#ifdef CONFIG_ARCH_BOARD_PX4FMU_V4
|
|
|
|
#define HAL_PX4_HAVE_PX4IO 0
|
|
|
|
#endif
|
|
|
|
|
2017-03-20 14:55:01 -03:00
|
|
|
/* aerofc-v1 */
|
2017-02-03 20:52:55 -04:00
|
|
|
#ifdef CONFIG_ARCH_BOARD_AEROFC_V1
|
|
|
|
#define HAL_BARO_MS5607_I2C_ADDR 0x77
|
|
|
|
#define HAL_BARO_MS5607_I2C_BUS 0
|
2017-02-08 22:47:30 -04:00
|
|
|
#define HAL_COMPASS_IST8310_I2C_ADDR 0x0E
|
|
|
|
#define HAL_COMPASS_IST8310_I2C_BUS 1
|
2017-08-30 20:58:00 -03:00
|
|
|
#define HAL_SERIAL0_BAUD_DEFAULT 921600
|
2017-03-20 15:58:26 -03:00
|
|
|
|
2017-03-20 14:57:14 -03:00
|
|
|
#define HAL_HAVE_BOARD_VOLTAGE 0
|
2017-03-20 15:58:26 -03:00
|
|
|
#define HAL_HAVE_SAFETY_SWITCH 0
|
2017-03-20 15:16:20 -03:00
|
|
|
#define HAL_PX4_HAVE_MTD_SUPPORT 0
|
2017-03-20 15:23:42 -03:00
|
|
|
#define HAL_PX4_HAVE_PX4IO 0
|
2017-03-20 16:32:49 -03:00
|
|
|
#define HAL_PX4_HAVE_PWM_INPUT 0
|
2017-02-03 20:52:55 -04:00
|
|
|
#endif
|
2017-03-20 14:55:01 -03:00
|
|
|
|
|
|
|
/* default values */
|
|
|
|
#ifndef HAL_SERIAL0_BAUD_DEFAULT
|
|
|
|
#define HAL_SERIAL0_BAUD_DEFAULT 115200
|
|
|
|
#endif
|
2017-03-20 14:57:14 -03:00
|
|
|
|
|
|
|
#ifndef HAL_HAVE_BOARD_VOLTAGE
|
|
|
|
#define HAL_HAVE_BOARD_VOLTAGE 1
|
|
|
|
#endif
|
2017-03-20 15:16:20 -03:00
|
|
|
|
|
|
|
#ifndef HAL_PX4_HAVE_MTD_SUPPORT
|
|
|
|
#define HAL_PX4_HAVE_MTD_SUPPORT 1
|
|
|
|
#endif
|
2017-03-20 15:23:42 -03:00
|
|
|
|
|
|
|
#ifndef HAL_PX4_HAVE_PX4IO
|
|
|
|
#define HAL_PX4_HAVE_PX4IO 1
|
|
|
|
#endif
|
2017-03-20 15:58:26 -03:00
|
|
|
|
2017-03-20 16:32:49 -03:00
|
|
|
#ifndef HAL_PX4_HAVE_PWM_INPUT
|
|
|
|
#define HAL_PX4_HAVE_PWM_INPUT 1
|
|
|
|
#endif
|
|
|
|
|
2017-03-20 15:58:26 -03:00
|
|
|
#ifndef HAL_HAVE_SAFETY_SWITCH
|
|
|
|
#define HAL_HAVE_SAFETY_SWITCH 1
|
|
|
|
#endif
|
2018-01-19 18:42:42 -04:00
|
|
|
|
|
|
|
#ifndef AP_FEATURE_RTSCTS
|
|
|
|
#define AP_FEATURE_RTSCTS 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef AP_FEATURE_SBUS_OUT
|
|
|
|
#define AP_FEATURE_SBUS_OUT 1
|
|
|
|
#endif
|
2018-08-07 03:37:37 -03:00
|
|
|
|
|
|
|
#include <AP_HAL_PX4/Semaphores.h>
|
|
|
|
#define HAL_Semaphore PX4::Semaphore
|
2018-08-19 22:07:02 -03:00
|
|
|
#define HAL_Semaphore_Recursive PX4::Semaphore_Recursive
|
|
|
|
|