Struct mcan::bus::Can

source ·
pub struct Can<'a, Id, D, C: Capacities> {
    pub interrupt_configuration: InterruptConfiguration<Id>,
    pub interrupts: OwnedInterruptSet<Id, Disabled>,
    pub rx_fifo_0: RxFifo<'a, Fifo0, Id, C::RxFifo0Message>,
    pub rx_fifo_1: RxFifo<'a, Fifo1, Id, C::RxFifo1Message>,
    pub rx_dedicated_buffers: RxDedicatedBuffer<'a, Id, C::RxBufferMessage>,
    pub tx: Tx<'a, Id, C>,
    pub tx_event_fifo: TxEventFifo<'a, Id>,
    pub aux: Aux<'a, Id, D>,
}
Expand description

A CAN bus that is not in configuration mode (CCE=0)

Some errors (including Bus_Off) can asynchronously stop bus operation (INIT=1), which will require user intervention to reactivate the bus to resume sending and receiving messages.

Fields§

§interrupt_configuration: InterruptConfiguration<Id>

Controls enabling and line selection of interrupts.

§interrupts: OwnedInterruptSet<Id, Disabled>

Initial set of interrupts in a disabled state.

§rx_fifo_0: RxFifo<'a, Fifo0, Id, C::RxFifo0Message>

Receive FIFO 0

§rx_fifo_1: RxFifo<'a, Fifo1, Id, C::RxFifo1Message>

Receive FIFO 1

§rx_dedicated_buffers: RxDedicatedBuffer<'a, Id, C::RxBufferMessage>

Dedicated receive buffers

§tx: Tx<'a, Id, C>

Message transmission

§tx_event_fifo: TxEventFifo<'a, Id>

Events for successfully transmitted messages

§aux: Aux<'a, Id, D>

Auxiliary bits and bobs

Implementations§

source§

impl<'a, Id: CanId, D: Dependencies<Id>, C: Capacities> Can<'a, Id, D, C>

source

pub unsafe fn registers(&self) -> &Can<Id>

Raw access to the registers.

§Safety

The abstraction assumes that it has exclusive ownership of the registers. Direct access can break such assumptions.

source

pub fn configure(self) -> CanConfigurable<'a, Id, D, C>

Return to configuration mode. This resets some status registers, which effectively clears received messages, messages pending transmission and tranmit events.

source

pub fn release(self) -> D

Disables the peripheral and makes the Dependencies available again.

Auto Trait Implementations§

§

impl<'a, Id, D, C> !RefUnwindSafe for Can<'a, Id, D, C>

§

impl<'a, Id, D, C> Send for Can<'a, Id, D, C>

§

impl<'a, Id, D, C> !Sync for Can<'a, Id, D, C>

§

impl<'a, Id, D, C> Unpin for Can<'a, Id, D, C>
where D: Unpin, Id: Unpin,

§

impl<'a, Id, D, C> !UnwindSafe for Can<'a, Id, D, C>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.