Function omnisensor::i2c::get_i2cdev
source · [−]pub fn get_i2cdev(
devmap: &mut HashMap<I2CDeviceParams, Weak<I2CDevice>>,
params: &I2CDeviceParams
) -> Result<Option<Arc<I2CDevice>>, Box<dyn Error>>
Expand description
Find an existing I2CDevice
in devmap
for the given params
, or instantiate one
and add it to devmap
if not. Returns:
Ok(Some(_))
if an existing device was found or a new one successfully instantiated.Ok(None)
if the device is static.Err(_)
on error.