mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-09 09:28:31 -04:00
HAL_Linux: implement I2C bus masks
This commit is contained in:
parent
98f241c7e4
commit
15ff760601
libraries/AP_HAL_Linux
@ -417,4 +417,28 @@ void I2CDeviceManager::teardown()
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
get mask of bus numbers for all configured I2C buses
|
||||
*/
|
||||
uint32_t I2CDeviceManager::get_bus_mask(void) const
|
||||
{
|
||||
return HAL_LINUX_I2C_BUS_MASK;
|
||||
}
|
||||
|
||||
/*
|
||||
get mask of bus numbers for all configured internal I2C buses
|
||||
*/
|
||||
uint32_t I2CDeviceManager::get_bus_mask_internal(void) const
|
||||
{
|
||||
return HAL_LINUX_I2C_INTERNAL_BUS_MASK;
|
||||
}
|
||||
|
||||
/*
|
||||
get mask of bus numbers for all configured external I2C buses
|
||||
*/
|
||||
uint32_t I2CDeviceManager::get_bus_mask_external(void) const
|
||||
{
|
||||
return HAL_LINUX_I2C_EXTERNAL_BUS_MASK;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -110,6 +110,21 @@ public:
|
||||
*/
|
||||
void teardown();
|
||||
|
||||
/*
|
||||
get mask of bus numbers for all configured I2C buses
|
||||
*/
|
||||
uint32_t get_bus_mask(void) const override;
|
||||
|
||||
/*
|
||||
get mask of bus numbers for all configured external I2C buses
|
||||
*/
|
||||
uint32_t get_bus_mask_external(void) const override;
|
||||
|
||||
/*
|
||||
get mask of bus numbers for all configured internal I2C buses
|
||||
*/
|
||||
uint32_t get_bus_mask_internal(void) const override;
|
||||
|
||||
protected:
|
||||
void _unregister(I2CBus &b);
|
||||
AP_HAL::OwnPtr<AP_HAL::I2CDevice> _create_device(I2CBus &b, uint8_t address) const;
|
||||
|
Loading…
Reference in New Issue
Block a user