HAL_PX4: implement I2C bus masks

This commit is contained in:
Andrew Tridgell 2018-06-21 13:09:43 +10:00 committed by Randy Mackay
parent 15ff760601
commit ac3886e27e
2 changed files with 38 additions and 0 deletions

View File

@ -189,4 +189,28 @@ I2CDeviceManager::get_device(uint8_t bus, uint8_t address,
return dev;
}
/*
get mask of bus numbers for all configured I2C buses
*/
uint32_t I2CDeviceManager::get_bus_mask(void) const
{
return 0x03;
}
/*
get mask of bus numbers for all configured internal I2C buses
*/
uint32_t I2CDeviceManager::get_bus_mask_internal(void) const
{
return 0x01;
}
/*
get mask of bus numbers for all configured external I2C buses
*/
uint32_t I2CDeviceManager::get_bus_mask_external(void) const
{
return 0x02;
}
}

View File

@ -94,6 +94,20 @@ public:
uint32_t bus_clock=400000,
bool use_smbus = false,
uint32_t timeout_ms=4) override;
/*
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;
};
}