#pragma once #include #include #include #ifndef AP_COMPASS_DIAGONALS_ENABLED #define AP_COMPASS_DIAGONALS_ENABLED 1 #endif // Backend support #ifndef AP_COMPASS_BACKEND_DEFAULT_ENABLED #define AP_COMPASS_BACKEND_DEFAULT_ENABLED 1 #endif #ifndef AP_COMPASS_EXTERNALAHRS_ENABLED #define AP_COMPASS_EXTERNALAHRS_ENABLED (AP_COMPASS_BACKEND_DEFAULT_ENABLED && HAL_EXTERNAL_AHRS_ENABLED) #endif #ifndef AP_COMPASS_MSP_ENABLED #define AP_COMPASS_MSP_ENABLED (AP_COMPASS_BACKEND_DEFAULT_ENABLED && HAL_MSP_SENSORS_ENABLED) #endif #ifndef AP_COMPASS_SITL_ENABLED #define AP_COMPASS_SITL_ENABLED (AP_COMPASS_BACKEND_DEFAULT_ENABLED && AP_SIM_ENABLED) #endif #ifndef AP_COMPASS_UAVCAN_ENABLED #define AP_COMPASS_UAVCAN_ENABLED (AP_COMPASS_BACKEND_DEFAULT_ENABLED && HAL_ENABLE_LIBUAVCAN_DRIVERS) #endif // i2c-based compasses: #ifndef AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED #define AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED AP_COMPASS_BACKEND_DEFAULT_ENABLED #endif #ifndef AP_COMPASS_AK8963_ENABLED #define AP_COMPASS_AK8963_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED #endif #ifndef AP_COMPASS_BMM150_ENABLED #define AP_COMPASS_BMM150_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED && !defined(STM32F1) #endif // this define dictates whether we iterate over the external i2c // busses looking for BMM150. Ordinarily this should be true, but // SkyViper specifies its BMM150 and thus does not need to probe. // This is an interim arrangement until PCNC1 is eliminated as an // auto-detect board. #ifndef AP_COMPASS_BMM150_DETECT_BACKENDS_ENABLED #define AP_COMPASS_BMM150_DETECT_BACKENDS_ENABLED AP_COMPASS_BMM150_ENABLED #endif #ifndef AP_COMPASS_HMC5843_ENABLED #define AP_COMPASS_HMC5843_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED #endif #ifndef AP_COMPASS_IST8308_ENABLED #define AP_COMPASS_IST8308_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED #endif #ifndef AP_COMPASS_IST8310_ENABLED #define AP_COMPASS_IST8310_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED #endif #ifndef AP_COMPASS_LIS3MDL_ENABLED #define AP_COMPASS_LIS3MDL_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED #endif #ifndef AP_COMPASS_LSM303D_ENABLED #define AP_COMPASS_LSM303D_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED #endif #ifndef AP_COMPASS_LSM9DS1_ENABLED #define AP_COMPASS_LSM9DS1_ENABLED AP_COMPASS_I2C_BACKEND_DEFAULT_ENABLED #endif