i2c_spi_buses: respect CONFIG_I2C and CONFIG_SPI

- bmp280, dps310, and ms5611 barometers support boards without I2C
This commit is contained in:
Daniel Agar
2021-11-15 15:57:33 -05:00
parent eade2915c1
commit 7b7b7acd36
54 changed files with 529 additions and 282 deletions
@@ -35,6 +35,7 @@
#include <px4_platform_common/i2c.h>
#if defined(CONFIG_I2C)
static inline constexpr px4_i2c_bus_t initI2CBusInternal(int bus)
{
@@ -51,3 +52,4 @@ static inline constexpr px4_i2c_bus_t initI2CBusExternal(int bus)
ret.is_external = true;
return ret;
}
#endif // CONFIG_I2C
@@ -35,6 +35,8 @@
#include <px4_platform_common/spi.h>
#if defined(CONFIG_SPI)
static inline constexpr px4_spi_bus_device_t initSPIDevice(uint8_t devid_driver, uint8_t cs_index)
{
px4_spi_bus_device_t ret{};
@@ -57,3 +59,4 @@ static inline constexpr px4_spi_bus_t initSPIBus(int bus, const px4_spi_bus_devi
ret.requires_locking = false;
return ret;
}
#endif // CONFIG_SPI