i2c_spi_buses: add support for multiple instances of the same device on a bus

This also simplifies the API a bit, since we anyway have to change the
drivers to pass additional information (the bus device index).

The orientation flag is merged with the rotation.
This commit is contained in:
Beat Küng
2021-07-08 12:59:35 -04:00
committed by Daniel Agar
parent e4983ab88c
commit c5aef9d512
19 changed files with 252 additions and 60 deletions
@@ -158,11 +158,13 @@ public:
bool external() const { return px4_spi_bus_external(bus()); }
int busDeviceIndex() const { return _bus_device_index; }
private:
const FilterType _filter;
const uint16_t _devid_driver_index;
const int _bus;
int _index{-1};
int _external_bus_counter{0};
int _bus_device_index{0};
int _index{0};
int _external_bus_counter{1};
int _bus_device_index{-1};
};