Lines Matching defs:I2cAdapter
377 /// A [`I2cAdapter`] instance represents a valid `struct i2c_adapter` created by the C portion of
380 pub struct I2cAdapter<Ctx: device::DeviceContext = device::Normal>(
385 impl<Ctx: device::DeviceContext> I2cAdapter<Ctx> {
391 impl I2cAdapter {
407 // `I2cAdapter` is #[repr(transparent)], so this cast is valid.
408 Ok(unsafe { (&*adapter.as_ptr().cast::<I2cAdapter<device::Normal>>()).into() })
412 // SAFETY: `I2cAdapter` is a transparent wrapper of a type that doesn't depend on
413 // `I2cAdapter`'s generic argument.
414 kernel::impl_device_context_deref!(unsafe { I2cAdapter });
415 kernel::impl_device_context_into_aref!(I2cAdapter);
417 // SAFETY: Instances of `I2cAdapter` are always reference-counted.
418 unsafe impl AlwaysRefCounted for I2cAdapter {
560 i2c_adapter: &I2cAdapter,
567 fn try_new(i2c_adapter: &I2cAdapter, i2c_board_info: &I2cBoardInfo) -> Result<Self> {