mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-12 19:08:29 -04:00
HAL_PX4: implement I2C bus masks
This commit is contained in:
parent
15ff760601
commit
ac3886e27e
@ -189,4 +189,28 @@ I2CDeviceManager::get_device(uint8_t bus, uint8_t address,
|
|||||||
return dev;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -94,6 +94,20 @@ public:
|
|||||||
uint32_t bus_clock=400000,
|
uint32_t bus_clock=400000,
|
||||||
bool use_smbus = false,
|
bool use_smbus = false,
|
||||||
uint32_t timeout_ms=4) override;
|
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;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user