pub struct ParlIoRx<'d, Dm>where
Dm: DriverMode,{ /* private fields */ }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.
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.
Sourcepub fn listen(&mut self, interrupts: impl Into<EnumSet<ParlIoRxInterrupt>>)
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.
Sourcepub fn unlisten(&mut self, interrupts: impl Into<EnumSet<ParlIoRxInterrupt>>)
pub fn unlisten(&mut self, interrupts: impl Into<EnumSet<ParlIoRxInterrupt>>)
Stops listening for the given PARL_IO RX interrupt sources.
Sourcepub fn interrupts(&mut self) -> EnumSet<ParlIoRxInterrupt>
pub fn interrupts(&mut self) -> EnumSet<ParlIoRxInterrupt>
Returns the asserted PARL_IO RX interrupt sources.
Sourcepub fn clear_interrupts(
&mut self,
interrupts: impl Into<EnumSet<ParlIoRxInterrupt>>,
)
pub fn clear_interrupts( &mut self, interrupts: impl Into<EnumSet<ParlIoRxInterrupt>>, )
Clears the given asserted PARL_IO RX interrupt sources.
Sourcepub fn set_dma_interrupt_handler(&mut self, handler: InterruptHandler)
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.
Sourcepub fn listen_dma(&mut self, interrupts: impl Into<EnumSet<DmaRxInterrupt>>)
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.
Sourcepub fn unlisten_dma(&mut self, interrupts: impl Into<EnumSet<DmaRxInterrupt>>)
pub fn unlisten_dma(&mut self, interrupts: impl Into<EnumSet<DmaRxInterrupt>>)
Stops listening for the given DMA RX interrupt sources.
Sourcepub fn interrupts_dma(&mut self) -> EnumSet<DmaRxInterrupt>
pub fn interrupts_dma(&mut self) -> EnumSet<DmaRxInterrupt>
Returns the asserted DMA RX interrupt sources.
Sourcepub fn clear_interrupts_dma(
&mut self,
interrupts: impl Into<EnumSet<DmaRxInterrupt>>,
)
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,
impl<'d, Dm> ParlIoRx<'d, Dm>where
Dm: DriverMode,
Sourcepub fn read<BUF>(
self,
number_of_bytes: Option<usize>,
buffer: BUF,
) -> Result<ParlIoRxTransfer<'d, BUF, Dm>, (Error, Self, BUF)>where
BUF: DmaRxBuffer,
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.
Sourcepub fn apply_config(&mut self, config: &RxConfig) -> Result<(), ConfigError>
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.