AP_HAL: allow bus speed and SMBUS enable on I2C

this allows a driver to request a bus speed for a device, and whether
the device should be in SMBUS mode. It also allows a min timeout to be
specified, to allow for slow devices
This commit is contained in:
Andrew Tridgell 2018-01-10 15:25:20 +11:00
parent 4b5e617673
commit 8260b3f65f

View File

@ -77,7 +77,10 @@ public:
class I2CDeviceManager {
public:
/* Get a device handle */
virtual OwnPtr<AP_HAL::I2CDevice> get_device(uint8_t bus, uint8_t address) = 0;
virtual OwnPtr<AP_HAL::I2CDevice> get_device(uint8_t bus, uint8_t address,
uint32_t bus_clock=400000,
bool use_smbus = false,
uint32_t timeout_ms=4) = 0;
};
}