Skip to main content

ParlIoTx

Struct ParlIoTx 

Source
pub struct ParlIoTx<'d, Dm>
where Dm: DriverMode,
{ /* private fields */ }
Available on crate feature 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,

Source

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.

Source

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.

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.

Source

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.

Source

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

Stops listening for the given PARL_IO TX interrupt sources.

Source

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

Returns the asserted PARL_IO TX interrupt sources.

Source

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

Clears the given asserted PARL_IO TX interrupt sources.

Source

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.

Source

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.

Source

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

Stops listening for the given DMA TX interrupt sources.

Source

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

Returns the asserted DMA TX interrupt sources.

Source

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

Clears the given asserted DMA TX interrupt sources.

Trait Implementations§

Source§

impl<Dm> Debug for ParlIoTx<'_, 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 ParlIoTx<'d, Dm>

§

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

§

impl<'d, Dm> Freeze for ParlIoTx<'d, Dm>
where ChannelTx<Dm, <AhbGdmaChannel<'d> as DmaChannel>::Tx>: Freeze,

§

impl<'d, Dm> Send for ParlIoTx<'d, Dm>
where ChannelTx<Dm, <AhbGdmaChannel<'d> as DmaChannel>::Tx>: Send,

§

impl<'d, Dm> Sync for ParlIoTx<'d, Dm>
where ChannelTx<Dm, <AhbGdmaChannel<'d> as DmaChannel>::Tx>: Sync,

§

impl<'d, Dm> Unpin for ParlIoTx<'d, Dm>
where ChannelTx<Dm, <AhbGdmaChannel<'d> as DmaChannel>::Tx>: Unpin,

§

impl<'d, Dm> UnsafeUnpin for ParlIoTx<'d, Dm>
where ChannelTx<Dm, <AhbGdmaChannel<'d> as DmaChannel>::Tx>: 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.