Skip to main content

ParlIoRx

Struct ParlIoRx 

Source
pub struct ParlIoRx<'d, Dm>
where Dm: DriverMode,
{ /* private fields */ }
Available on crate feature unstable only.
Expand description

Parallel IO RX channel

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Implementations§

Source§

impl<'d> ParlIoRx<'d, Blocking>

DMA interrupt management for the RX driver.

These methods manage the DMA RX channel’s own interrupt, which is separate from the PARL_IO interrupt managed by ParlIo’s interrupt methods.

§Stability

This API is marked as unstable and is only available when the unstable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn listen(&mut self, interrupts: impl Into<EnumSet<ParlIoRxInterrupt>>)

Listens for the given PARL_IO RX interrupt sources.

The handler serving these sources must have been registered via ParlIo::set_interrupt_handler.

Source

pub fn unlisten(&mut self, interrupts: impl Into<EnumSet<ParlIoRxInterrupt>>)

Stops listening for the given PARL_IO RX interrupt sources.

Source

pub fn interrupts(&mut self) -> EnumSet<ParlIoRxInterrupt>

Returns the asserted PARL_IO RX interrupt sources.

Source

pub fn clear_interrupts( &mut self, interrupts: impl Into<EnumSet<ParlIoRxInterrupt>>, )

Clears the given asserted PARL_IO RX interrupt sources.

Source

pub fn set_dma_interrupt_handler(&mut self, handler: InterruptHandler)

Registers an interrupt handler for the DMA RX channel used by this driver.

The handler services the sources enabled via Self::listen_dma. It fires on the channel’s own interrupt, which is separate from the PARL_IO interrupt used by ParlIo::set_interrupt_handler.

Binding the handler unlistens from and clears all DMA RX interrupt sources, so this function must be called before Self::listen_dma. It must also be called before Self::read, which consumes the driver.

Source

pub fn listen_dma(&mut self, interrupts: impl Into<EnumSet<DmaRxInterrupt>>)

Listens for the given DMA RX interrupt sources.

A handler must have been registered via Self::set_dma_interrupt_handler first.

Source

pub fn unlisten_dma(&mut self, interrupts: impl Into<EnumSet<DmaRxInterrupt>>)

Stops listening for the given DMA RX interrupt sources.

Source

pub fn interrupts_dma(&mut self) -> EnumSet<DmaRxInterrupt>

Returns the asserted DMA RX interrupt sources.

Source

pub fn clear_interrupts_dma( &mut self, interrupts: impl Into<EnumSet<DmaRxInterrupt>>, )

Clears the given asserted DMA RX interrupt sources.

Source§

impl<'d, Dm> ParlIoRx<'d, Dm>
where Dm: DriverMode,

Source

pub fn read<BUF>( self, number_of_bytes: Option<usize>, buffer: BUF, ) -> Result<ParlIoRxTransfer<'d, BUF, Dm>, (Error, Self, BUF)>
where BUF: DmaRxBuffer,

Performs a DMA read.

Returns a ParlIoRxTransfer that can be used to wait for the transfer to complete.

When the number of bytes is specified, the transfer ends when the number of specified bytes is received.

When the number of bytes is unspecified, there is no limit to the amount of data transferred and the transfer ends when the enable signal signals the end or the DMA buffer runs out of space.

§Errors

Returns Error::MaxDmaTransferSizeExceeded when more than 65535 bytes are requested. Returns Error::DmaError when the DMA transfer cannot be prepared or started.

Source

pub fn apply_config(&mut self, config: &RxConfig) -> Result<(), ConfigError>

Changes the bus configuration.

§Errors

Returns ConfigError::UnreachableClockRate when the requested frequency cannot be reached.

Trait Implementations§

Source§

impl<Dm> Debug for ParlIoRx<'_, Dm>
where Dm: DriverMode,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'d, Dm> !RefUnwindSafe for ParlIoRx<'d, Dm>

§

impl<'d, Dm> !UnwindSafe for ParlIoRx<'d, Dm>

§

impl<'d, Dm> Freeze for ParlIoRx<'d, Dm>
where ChannelRx<Dm, <AhbGdmaChannel<'d> as DmaChannel>::Rx>: Freeze,

§

impl<'d, Dm> Send for ParlIoRx<'d, Dm>
where ChannelRx<Dm, <AhbGdmaChannel<'d> as DmaChannel>::Rx>: Send,

§

impl<'d, Dm> Sync for ParlIoRx<'d, Dm>
where ChannelRx<Dm, <AhbGdmaChannel<'d> as DmaChannel>::Rx>: Sync,

§

impl<'d, Dm> Unpin for ParlIoRx<'d, Dm>
where ChannelRx<Dm, <AhbGdmaChannel<'d> as DmaChannel>::Rx>: Unpin,

§

impl<'d, Dm> UnsafeUnpin for ParlIoRx<'d, Dm>
where ChannelRx<Dm, <AhbGdmaChannel<'d> as DmaChannel>::Rx>: UnsafeUnpin,

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

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

Source§

type Output = T

Should always be Self
§

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

§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
§

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.
§

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

Performs the conversion.