2018-01-05 03:07:23 -04:00
|
|
|
#pragma once
|
|
|
|
|
2018-01-11 19:13:18 -04:00
|
|
|
#include <hwdef.h>
|
|
|
|
|
2018-01-05 03:07:23 -04:00
|
|
|
#define HAL_BOARD_NAME "ChibiOS"
|
2019-09-22 19:51:30 -03:00
|
|
|
|
|
|
|
#if HAL_MEMORY_TOTAL_KB >= 1000
|
|
|
|
#define HAL_MEM_CLASS HAL_MEM_CLASS_1000
|
|
|
|
#elif HAL_MEMORY_TOTAL_KB >= 500
|
|
|
|
#define HAL_MEM_CLASS HAL_MEM_CLASS_500
|
|
|
|
#elif HAL_MEMORY_TOTAL_KB >= 300
|
|
|
|
#define HAL_MEM_CLASS HAL_MEM_CLASS_300
|
|
|
|
#elif HAL_MEMORY_TOTAL_KB >= 192
|
|
|
|
#define HAL_MEM_CLASS HAL_MEM_CLASS_192
|
|
|
|
#elif HAL_MEMORY_TOTAL_KB >= 64
|
|
|
|
#define HAL_MEM_CLASS HAL_MEM_CLASS_64
|
|
|
|
#else
|
|
|
|
#define HAL_MEM_CLASS HAL_MEM_CLASS_20
|
|
|
|
#endif
|
2018-01-05 03:07:23 -04:00
|
|
|
|
2018-01-14 04:00:09 -04:00
|
|
|
#ifndef HAL_GPIO_LED_ON
|
2018-02-11 19:43:21 -04:00
|
|
|
#define HAL_GPIO_LED_ON 0
|
2018-01-14 04:00:09 -04:00
|
|
|
#endif
|
|
|
|
#ifndef HAL_GPIO_LED_OFF
|
2018-02-11 19:43:21 -04:00
|
|
|
#define HAL_GPIO_LED_OFF 1
|
2018-01-14 04:00:09 -04:00
|
|
|
#endif
|
2018-01-05 03:07:23 -04:00
|
|
|
|
2020-05-31 09:12:02 -03:00
|
|
|
#ifndef HAL_NUM_CAN_IFACES
|
|
|
|
#define HAL_NUM_CAN_IFACES 0
|
2018-02-01 15:19:08 -04:00
|
|
|
#endif
|
|
|
|
|
2018-01-14 04:00:09 -04:00
|
|
|
#ifndef HAL_HAVE_BOARD_VOLTAGE
|
2018-01-05 03:07:23 -04:00
|
|
|
#define HAL_HAVE_BOARD_VOLTAGE 0
|
2018-01-14 04:00:09 -04:00
|
|
|
#endif
|
2018-01-11 17:26:40 -04:00
|
|
|
|
2018-11-10 17:41:29 -04:00
|
|
|
#ifndef HAL_HAVE_SERVO_VOLTAGE
|
|
|
|
#define HAL_HAVE_SERVO_VOLTAGE 0
|
|
|
|
#endif
|
|
|
|
|
2018-08-01 20:34:23 -03:00
|
|
|
#ifdef HAL_GPIO_PIN_SAFETY_IN
|
|
|
|
#define HAL_HAVE_SAFETY_SWITCH 1
|
|
|
|
#endif
|
|
|
|
|
2018-01-14 04:00:09 -04:00
|
|
|
#ifndef HAL_HAVE_SAFETY_SWITCH
|
|
|
|
#define HAL_HAVE_SAFETY_SWITCH 0
|
|
|
|
#endif
|
2018-01-05 03:07:23 -04:00
|
|
|
|
2018-01-14 04:00:09 -04:00
|
|
|
#define HAL_STORAGE_SIZE_AVAILABLE HAL_STORAGE_SIZE
|
2018-01-05 03:07:23 -04:00
|
|
|
|
|
|
|
#ifndef HAL_WITH_IO_MCU
|
|
|
|
#define HAL_WITH_IO_MCU 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HAL_WITH_RAMTRON
|
|
|
|
#define HAL_WITH_RAMTRON 0
|
|
|
|
#endif
|
2018-01-10 06:33:57 -04:00
|
|
|
|
2021-05-04 08:12:23 -03:00
|
|
|
#ifndef HAL_WITH_EKF_DOUBLE
|
|
|
|
#define HAL_WITH_EKF_DOUBLE HAL_HAVE_HARDWARE_DOUBLE
|
|
|
|
#endif
|
|
|
|
|
2018-08-07 03:37:37 -03:00
|
|
|
// allow for static semaphores
|
|
|
|
#include <AP_HAL_ChibiOS/Semaphores.h>
|
|
|
|
#define HAL_Semaphore ChibiOS::Semaphore
|
|
|
|
|
2020-05-31 09:09:21 -03:00
|
|
|
#include <AP_HAL/EventHandle.h>
|
|
|
|
#define HAL_EventHandle AP_HAL::EventHandle
|
|
|
|
|
2018-01-10 06:33:57 -04:00
|
|
|
/* string names for well known SPI devices */
|
|
|
|
#define HAL_BARO_MS5611_NAME "ms5611"
|
2018-03-31 18:56:03 -03:00
|
|
|
#ifndef HAL_BARO_MS5611_SPI_INT_NAME
|
2018-01-10 06:33:57 -04:00
|
|
|
#define HAL_BARO_MS5611_SPI_INT_NAME "ms5611_int"
|
2018-03-31 18:56:03 -03:00
|
|
|
#endif
|
2018-01-10 06:33:57 -04:00
|
|
|
#define HAL_BARO_MS5611_SPI_EXT_NAME "ms5611_ext"
|
2018-02-06 06:39:55 -04:00
|
|
|
#define HAL_BARO_LPS22H_NAME "lps22h"
|
2018-03-04 06:04:41 -04:00
|
|
|
#define HAL_BARO_BMP280_NAME "bmp280"
|
2018-01-10 06:33:57 -04:00
|
|
|
|
|
|
|
#define HAL_INS_MPU60x0_NAME "mpu6000"
|
|
|
|
#define HAL_INS_MPU60x0_EXT_NAME "mpu6000_ext"
|
|
|
|
|
|
|
|
#define HAL_INS_LSM9DS0_G_NAME "lsm9ds0_g"
|
|
|
|
#define HAL_INS_LSM9DS0_A_NAME "lsm9ds0_am"
|
|
|
|
|
|
|
|
#define HAL_INS_LSM9DS0_EXT_G_NAME "lsm9ds0_ext_g"
|
|
|
|
#define HAL_INS_LSM9DS0_EXT_A_NAME "lsm9ds0_ext_am"
|
|
|
|
|
|
|
|
#define HAL_INS_MPU9250_NAME "mpu9250"
|
|
|
|
#define HAL_INS_MPU9250_EXT_NAME "mpu9250_ext"
|
|
|
|
|
|
|
|
#define HAL_INS_MPU6500_NAME "mpu6500"
|
|
|
|
|
|
|
|
#define HAL_INS_ICM20608_NAME "icm20608"
|
|
|
|
#define HAL_INS_ICM20608_AM_NAME "icm20608-am"
|
|
|
|
#define HAL_INS_ICM20608_EXT_NAME "icm20608_ext"
|
|
|
|
|
|
|
|
#define HAL_COMPASS_HMC5843_NAME "hmc5843"
|
|
|
|
#define HAL_COMPASS_LIS3MDL_NAME "lis3mdl"
|
2018-02-06 06:39:55 -04:00
|
|
|
|
2018-06-29 04:54:23 -03:00
|
|
|
// allow for short names overridden in hwdef.dat
|
|
|
|
#ifndef CHIBIOS_SHORT_BOARD_NAME
|
|
|
|
#define CHIBIOS_SHORT_BOARD_NAME CHIBIOS_BOARD_NAME
|
|
|
|
#endif
|
2018-02-06 06:39:55 -04:00
|
|
|
|
2018-03-01 20:45:39 -04:00
|
|
|
#ifndef CONFIG_HAL_BOARD_SUBTYPE
|
|
|
|
// allow for generic boards
|
|
|
|
#define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_CHIBIOS_GENERIC
|
|
|
|
#endif
|
2018-04-01 22:15:46 -03:00
|
|
|
|
2018-04-06 20:59:13 -03:00
|
|
|
// we support RC serial for BLHeli pass-thru
|
2020-11-21 01:24:04 -04:00
|
|
|
#ifndef HAL_SUPPORT_RCOUT_SERIAL
|
2023-03-09 22:59:57 -04:00
|
|
|
#define HAL_SUPPORT_RCOUT_SERIAL 1
|
2020-11-21 01:24:04 -04:00
|
|
|
#endif
|
2018-07-13 06:47:29 -03:00
|
|
|
|
|
|
|
// by default assume first I2C bus is internal
|
|
|
|
#ifndef HAL_I2C_INTERNAL_MASK
|
|
|
|
#define HAL_I2C_INTERNAL_MASK 1
|
|
|
|
#endif
|
|
|
|
|
2018-11-15 21:06:08 -04:00
|
|
|
// put all storage of files under /APM directory
|
|
|
|
#ifndef HAL_BOARD_STORAGE_DIRECTORY
|
|
|
|
#define HAL_BOARD_STORAGE_DIRECTORY "/APM"
|
|
|
|
#endif
|