pub struct ParlIoTx<'d, Dm>where
Dm: DriverMode,{ /* private fields */ }unstable only.Expand description
Parallel IO TX 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, Dm> ParlIoTx<'d, Dm>where
Dm: DriverMode,
impl<'d, Dm> ParlIoTx<'d, Dm>where
Dm: DriverMode,
Sourcepub fn write<BUF>(
self,
number_of_bytes: usize,
buffer: BUF,
) -> Result<ParlIoTxTransfer<'d, BUF, Dm>, (Error, Self, BUF)>where
BUF: DmaTxBuffer,
pub fn write<BUF>(
self,
number_of_bytes: usize,
buffer: BUF,
) -> Result<ParlIoTxTransfer<'d, BUF, Dm>, (Error, Self, BUF)>where
BUF: DmaTxBuffer,
Performs a DMA write.
Returns a ParlIoTxTransfer that can be used to wait for the
transfer to complete.
§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: &TxConfig) -> Result<(), ConfigError>
pub fn apply_config(&mut self, config: &TxConfig) -> Result<(), ConfigError>
Changes the bus configuration.
§Errors
Returns ConfigError::UnreachableClockRate when the requested
frequency cannot be reached.
Source§impl<'d> ParlIoTx<'d, Blocking>
DMA interrupt management for the TX driver.
impl<'d> ParlIoTx<'d, Blocking>
DMA interrupt management for the TX driver.
These methods manage the DMA TX 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<ParlIoTxInterrupt>>)
pub fn listen(&mut self, interrupts: impl Into<EnumSet<ParlIoTxInterrupt>>)
Listens for the given PARL_IO TX 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<ParlIoTxInterrupt>>)
pub fn unlisten(&mut self, interrupts: impl Into<EnumSet<ParlIoTxInterrupt>>)
Stops listening for the given PARL_IO TX interrupt sources.
Sourcepub fn interrupts(&mut self) -> EnumSet<ParlIoTxInterrupt>
pub fn interrupts(&mut self) -> EnumSet<ParlIoTxInterrupt>
Returns the asserted PARL_IO TX interrupt sources.
Sourcepub fn clear_interrupts(
&mut self,
interrupts: impl Into<EnumSet<ParlIoTxInterrupt>>,
)
pub fn clear_interrupts( &mut self, interrupts: impl Into<EnumSet<ParlIoTxInterrupt>>, )
Clears the given asserted PARL_IO TX 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 TX 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 TX interrupt
sources, so this function must be called before
Self::listen_dma. It must also be called before Self::write,
which consumes the driver.
Sourcepub fn listen_dma(&mut self, interrupts: impl Into<EnumSet<DmaTxInterrupt>>)
pub fn listen_dma(&mut self, interrupts: impl Into<EnumSet<DmaTxInterrupt>>)
Listens for the given DMA TX 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<DmaTxInterrupt>>)
pub fn unlisten_dma(&mut self, interrupts: impl Into<EnumSet<DmaTxInterrupt>>)
Stops listening for the given DMA TX interrupt sources.
Sourcepub fn interrupts_dma(&mut self) -> EnumSet<DmaTxInterrupt>
pub fn interrupts_dma(&mut self) -> EnumSet<DmaTxInterrupt>
Returns the asserted DMA TX interrupt sources.
Sourcepub fn clear_interrupts_dma(
&mut self,
interrupts: impl Into<EnumSet<DmaTxInterrupt>>,
)
pub fn clear_interrupts_dma( &mut self, interrupts: impl Into<EnumSet<DmaTxInterrupt>>, )
Clears the given asserted DMA TX interrupt sources.