#[repr(transparent)]pub struct CtrlTrig(pub u32);
Expand description
DMA Channel 0 Control and Status
Tuple Fields§
§0: u32
Implementations§
source§impl CtrlTrig
impl CtrlTrig
sourcepub const fn en(&self) -> bool
pub const fn en(&self) -> bool
DMA Channel Enable. When 1, the channel will respond to triggering events, which will cause it to become BUSY and start transferring data. When 0, the channel will ignore triggers, stop issuing transfers, and pause the current transfer sequence (i.e. BUSY will remain high if already high)
sourcepub fn set_en(&mut self, val: bool)
pub fn set_en(&mut self, val: bool)
DMA Channel Enable. When 1, the channel will respond to triggering events, which will cause it to become BUSY and start transferring data. When 0, the channel will ignore triggers, stop issuing transfers, and pause the current transfer sequence (i.e. BUSY will remain high if already high)
sourcepub const fn high_priority(&self) -> bool
pub const fn high_priority(&self) -> bool
HIGH_PRIORITY gives a channel preferential treatment in issue scheduling: in each scheduling round, all high priority channels are considered first, and then only a single low priority channel, before returning to the high priority channels. This only affects the order in which the DMA schedules channels. The DMA’s bus priority is not changed. If the DMA is not saturated then a low priority channel will see no loss of throughput.
sourcepub fn set_high_priority(&mut self, val: bool)
pub fn set_high_priority(&mut self, val: bool)
HIGH_PRIORITY gives a channel preferential treatment in issue scheduling: in each scheduling round, all high priority channels are considered first, and then only a single low priority channel, before returning to the high priority channels. This only affects the order in which the DMA schedules channels. The DMA’s bus priority is not changed. If the DMA is not saturated then a low priority channel will see no loss of throughput.
sourcepub const fn data_size(&self) -> DataSize
pub const fn data_size(&self) -> DataSize
Set the size of each bus transfer (byte/halfword/word). READ_ADDR and WRITE_ADDR advance by this amount (1/2/4 bytes) with each transfer.
sourcepub fn set_data_size(&mut self, val: DataSize)
pub fn set_data_size(&mut self, val: DataSize)
Set the size of each bus transfer (byte/halfword/word). READ_ADDR and WRITE_ADDR advance by this amount (1/2/4 bytes) with each transfer.
sourcepub const fn incr_read(&self) -> bool
pub const fn incr_read(&self) -> bool
If 1, the read address increments with each transfer. If 0, each read is directed to the same, initial address. Generally this should be disabled for peripheral-to-memory transfers.
sourcepub fn set_incr_read(&mut self, val: bool)
pub fn set_incr_read(&mut self, val: bool)
If 1, the read address increments with each transfer. If 0, each read is directed to the same, initial address. Generally this should be disabled for peripheral-to-memory transfers.
sourcepub const fn incr_read_rev(&self) -> bool
pub const fn incr_read_rev(&self) -> bool
If 1, and INCR_READ is 1, the read address is decremented rather than incremented with each transfer. If 1, and INCR_READ is 0, this otherwise-unused combination causes the read address to be incremented by twice the transfer size, i.e. skipping over alternate addresses.
sourcepub fn set_incr_read_rev(&mut self, val: bool)
pub fn set_incr_read_rev(&mut self, val: bool)
If 1, and INCR_READ is 1, the read address is decremented rather than incremented with each transfer. If 1, and INCR_READ is 0, this otherwise-unused combination causes the read address to be incremented by twice the transfer size, i.e. skipping over alternate addresses.
sourcepub const fn incr_write(&self) -> bool
pub const fn incr_write(&self) -> bool
If 1, the write address increments with each transfer. If 0, each write is directed to the same, initial address. Generally this should be disabled for memory-to-peripheral transfers.
sourcepub fn set_incr_write(&mut self, val: bool)
pub fn set_incr_write(&mut self, val: bool)
If 1, the write address increments with each transfer. If 0, each write is directed to the same, initial address. Generally this should be disabled for memory-to-peripheral transfers.
sourcepub const fn incr_write_rev(&self) -> bool
pub const fn incr_write_rev(&self) -> bool
If 1, and INCR_WRITE is 1, the write address is decremented rather than incremented with each transfer. If 1, and INCR_WRITE is 0, this otherwise-unused combination causes the write address to be incremented by twice the transfer size, i.e. skipping over alternate addresses.
sourcepub fn set_incr_write_rev(&mut self, val: bool)
pub fn set_incr_write_rev(&mut self, val: bool)
If 1, and INCR_WRITE is 1, the write address is decremented rather than incremented with each transfer. If 1, and INCR_WRITE is 0, this otherwise-unused combination causes the write address to be incremented by twice the transfer size, i.e. skipping over alternate addresses.
sourcepub const fn ring_size(&self) -> u8
pub const fn ring_size(&self) -> u8
Size of address wrap region. If 0, don’t wrap. For values n > 0, only the lower n bits of the address will change. This wraps the address on a (1 << n) byte boundary, facilitating access to naturally-aligned ring buffers. Ring sizes between 2 and 32768 bytes are possible. This can apply to either read or write addresses, based on value of RING_SEL.
sourcepub fn set_ring_size(&mut self, val: u8)
pub fn set_ring_size(&mut self, val: u8)
Size of address wrap region. If 0, don’t wrap. For values n > 0, only the lower n bits of the address will change. This wraps the address on a (1 << n) byte boundary, facilitating access to naturally-aligned ring buffers. Ring sizes between 2 and 32768 bytes are possible. This can apply to either read or write addresses, based on value of RING_SEL.
sourcepub const fn ring_sel(&self) -> bool
pub const fn ring_sel(&self) -> bool
Select whether RING_SIZE applies to read or write addresses. If 0, read addresses are wrapped on a (1 << RING_SIZE) boundary. If 1, write addresses are wrapped.
sourcepub fn set_ring_sel(&mut self, val: bool)
pub fn set_ring_sel(&mut self, val: bool)
Select whether RING_SIZE applies to read or write addresses. If 0, read addresses are wrapped on a (1 << RING_SIZE) boundary. If 1, write addresses are wrapped.
sourcepub const fn chain_to(&self) -> u8
pub const fn chain_to(&self) -> u8
When this channel completes, it will trigger the channel indicated by CHAIN_TO. Disable by setting CHAIN_TO = (this channel). Note this field resets to 0, so channels 1 and above will chain to channel 0 by default. Set this field to avoid this behaviour.
sourcepub fn set_chain_to(&mut self, val: u8)
pub fn set_chain_to(&mut self, val: u8)
When this channel completes, it will trigger the channel indicated by CHAIN_TO. Disable by setting CHAIN_TO = (this channel). Note this field resets to 0, so channels 1 and above will chain to channel 0 by default. Set this field to avoid this behaviour.
sourcepub const fn treq_sel(&self) -> TreqSel
pub const fn treq_sel(&self) -> TreqSel
Select a Transfer Request signal. The channel uses the transfer request signal to pace its data transfer rate. Sources for TREQ signals are internal (TIMERS) or external (DREQ, a Data Request from the system). 0x0 to 0x3a -> select DREQ n as TREQ
sourcepub fn set_treq_sel(&mut self, val: TreqSel)
pub fn set_treq_sel(&mut self, val: TreqSel)
Select a Transfer Request signal. The channel uses the transfer request signal to pace its data transfer rate. Sources for TREQ signals are internal (TIMERS) or external (DREQ, a Data Request from the system). 0x0 to 0x3a -> select DREQ n as TREQ
sourcepub const fn irq_quiet(&self) -> bool
pub const fn irq_quiet(&self) -> bool
In QUIET mode, the channel does not generate IRQs at the end of every transfer block. Instead, an IRQ is raised when NULL is written to a trigger register, indicating the end of a control block chain. This reduces the number of interrupts to be serviced by the CPU when transferring a DMA chain of many small control blocks.
sourcepub fn set_irq_quiet(&mut self, val: bool)
pub fn set_irq_quiet(&mut self, val: bool)
In QUIET mode, the channel does not generate IRQs at the end of every transfer block. Instead, an IRQ is raised when NULL is written to a trigger register, indicating the end of a control block chain. This reduces the number of interrupts to be serviced by the CPU when transferring a DMA chain of many small control blocks.
sourcepub const fn bswap(&self) -> bool
pub const fn bswap(&self) -> bool
Apply byte-swap transformation to DMA data. For byte data, this has no effect. For halfword data, the two bytes of each halfword are swapped. For word data, the four bytes of each word are swapped to reverse order.
sourcepub fn set_bswap(&mut self, val: bool)
pub fn set_bswap(&mut self, val: bool)
Apply byte-swap transformation to DMA data. For byte data, this has no effect. For halfword data, the two bytes of each halfword are swapped. For word data, the four bytes of each word are swapped to reverse order.
sourcepub const fn sniff_en(&self) -> bool
pub const fn sniff_en(&self) -> bool
If 1, this channel’s data transfers are visible to the sniff hardware, and each transfer will advance the state of the checksum. This only applies if the sniff hardware is enabled, and has this channel selected. This allows checksum to be enabled or disabled on a per-control- block basis.
sourcepub fn set_sniff_en(&mut self, val: bool)
pub fn set_sniff_en(&mut self, val: bool)
If 1, this channel’s data transfers are visible to the sniff hardware, and each transfer will advance the state of the checksum. This only applies if the sniff hardware is enabled, and has this channel selected. This allows checksum to be enabled or disabled on a per-control- block basis.
sourcepub const fn busy(&self) -> bool
pub const fn busy(&self) -> bool
This flag goes high when the channel starts a new transfer sequence, and low when the last transfer of that sequence completes. Clearing EN while BUSY is high pauses the channel, and BUSY will stay high while paused. To terminate a sequence early (and clear the BUSY flag), see CHAN_ABORT.
sourcepub fn set_busy(&mut self, val: bool)
pub fn set_busy(&mut self, val: bool)
This flag goes high when the channel starts a new transfer sequence, and low when the last transfer of that sequence completes. Clearing EN while BUSY is high pauses the channel, and BUSY will stay high while paused. To terminate a sequence early (and clear the BUSY flag), see CHAN_ABORT.
sourcepub const fn write_error(&self) -> bool
pub const fn write_error(&self) -> bool
If 1, the channel received a write bus error. Write one to clear. WRITE_ADDR shows the approximate address where the bus error was encountered (will not be earlier, or more than 5 transfers later)
sourcepub fn set_write_error(&mut self, val: bool)
pub fn set_write_error(&mut self, val: bool)
If 1, the channel received a write bus error. Write one to clear. WRITE_ADDR shows the approximate address where the bus error was encountered (will not be earlier, or more than 5 transfers later)
sourcepub const fn read_error(&self) -> bool
pub const fn read_error(&self) -> bool
If 1, the channel received a read bus error. Write one to clear. READ_ADDR shows the approximate address where the bus error was encountered (will not be earlier, or more than 3 transfers later)
sourcepub fn set_read_error(&mut self, val: bool)
pub fn set_read_error(&mut self, val: bool)
If 1, the channel received a read bus error. Write one to clear. READ_ADDR shows the approximate address where the bus error was encountered (will not be earlier, or more than 3 transfers later)
sourcepub const fn ahb_error(&self) -> bool
pub const fn ahb_error(&self) -> bool
Logical OR of the READ_ERROR and WRITE_ERROR flags. The channel halts when it encounters any bus error, and always raises its channel IRQ flag.
sourcepub fn set_ahb_error(&mut self, val: bool)
pub fn set_ahb_error(&mut self, val: bool)
Logical OR of the READ_ERROR and WRITE_ERROR flags. The channel halts when it encounters any bus error, and always raises its channel IRQ flag.
Trait Implementations§
impl Copy for CtrlTrig
impl Eq for CtrlTrig
impl StructuralPartialEq for CtrlTrig
Auto Trait Implementations§
impl Freeze for CtrlTrig
impl RefUnwindSafe for CtrlTrig
impl Send for CtrlTrig
impl Sync for CtrlTrig
impl Unpin for CtrlTrig
impl UnwindSafe for CtrlTrig
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)