Struct mnemos_d1_core::drivers::twi::I2c0
source · pub struct I2c0 {
isr: &'static IsrData,
twi: &'static RegisterBlock,
int: (Interrupt, fn()),
}
Expand description
A TWI mapped to the Raspberry Pi header’s I²C0 pins.
Fields§
§isr: &'static IsrData
§twi: &'static RegisterBlock
§int: (Interrupt, fn())
Which TWI does this TWI Engine use?
Implementations§
source§impl I2c0
impl I2c0
sourcepub unsafe fn mq_pro(twi: TWI0, ccu: &mut Ccu, gpio: &mut GPIO) -> Self
pub unsafe fn mq_pro(twi: TWI0, ccu: &mut Ccu, gpio: &mut GPIO) -> Self
Initialize a TWI for the MangoPi MQ Pro’s Pi header I²C0 pins. This configures TWI0 in TWI engine mode, with the MangoPi MQ Pro pin mappings.
§Safety
- The TWI register block must not be concurrently written to.
- This function should be called only while running on a MangoPi MQ Pro board.
sourcepub unsafe fn lichee_rv_dock(twi: TWI2, ccu: &mut Ccu, gpio: &mut GPIO) -> Self
pub unsafe fn lichee_rv_dock(twi: TWI2, ccu: &mut Ccu, gpio: &mut GPIO) -> Self
Initialize a TWI for the Lichee RV Dock’s Pi header I²C0 pins. This configures TWI2 in TWI engine mode, with the Lichee RV pin mappings.
§Safety
- The TWI register block must not be concurrently written to.
- This function should be called only while running on a Lichee RV board.
sourcefn handle_twi0_interrupt()
fn handle_twi0_interrupt()
Handle a TWI 0 interrupt on the I2C0 pins.
sourcefn handle_twi1_interrupt()
fn handle_twi1_interrupt()
Handle a TWI 1 interrupt on the I2C0 pins.
sourcefn handle_twi2_interrupt()
fn handle_twi2_interrupt()
Handle a TWI 2 interrupt on the I2C0 pins.
sourcefn handle_twi3_interrupt()
fn handle_twi3_interrupt()
Handle a TWI 3 interrupt on the I2C0 pins.
sourceunsafe fn init(twi: &'static RegisterBlock, int: Interrupt, isr: fn()) -> Self
unsafe fn init(twi: &'static RegisterBlock, int: Interrupt, isr: fn()) -> Self
This assumes the GPIO pin mappings are already configured.
pub async fn register( self, kernel: &'static Kernel, queued: usize, ) -> Result<(), RegistrationError>
async fn run(self, rx: RequestStream<I2cService>)
async fn transaction(&self, addr: Addr, txn: KConsumer<Transfer>)
Auto Trait Implementations§
impl Freeze for I2c0
impl !RefUnwindSafe for I2c0
impl !Send for I2c0
impl !Sync for I2c0
impl Unpin for I2c0
impl !UnwindSafe for I2c0
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.