Struct rp2040_pac::DMA

source ·
pub struct DMA { /* private fields */ }
Expand description

DMA with separate read and write masters

Implementations§

source§

impl DMA

source

pub const PTR: *const RegisterBlock = {0x50000000 as *const dma::RegisterBlock}

Pointer to the register block

source

pub const fn ptr() -> *const RegisterBlock

Return the pointer to the register block

source

pub unsafe fn steal() -> Self

Steal an instance of this peripheral

§Safety

Ensure that the new instance of the peripheral cannot be used in a way that may race with any existing instances, for example by only accessing read-only or write-only registers, or by consuming the original peripheral and using critical sections to coordinate access between multiple new instances.

Additionally, other software such as HALs may rely on only one peripheral instance existing to ensure memory safety; ensure no stolen instances are passed to such software.

Methods from Deref<Target = RegisterBlock>§

source

pub fn ch(&self, n: usize) -> &CH

0x00..0x300 - Cluster CH%s, containing CH?_READ_ADDR,CH??_READ_ADDR, CH?_WRITE_ADDR,CH??_WRITE_ADDR, CH?_TRANS_COUNT,CH??_TRANS_COUNT, CH?_CTRL_TRIG,CH??_CTRL_TRIG, CH?_AL1_CTRL,CH??_AL1_CTRL, CH?_AL1_READ_ADDR,CH??_AL1_READ_ADDR, CH?_AL1_WRITE_ADDR,CH??_AL1_WRITE_ADDR, CH?_AL1_TRANS_COUNT_TRIG,CH??_AL1_TRANS_COUNT_TRIG, CH?_AL2_CTRL,CH??_AL2_CTRL, CH?_AL2_TRANS_COUNT,CH??_AL2_TRANS_COUNT, CH?_AL2_READ_ADDR,CH??_AL2_READ_ADDR, CH?_AL2_WRITE_ADDR_TRIG,CH??_AL2_WRITE_ADDR_TRIG, CH?_AL3_CTRL,CH??_AL3_CTRL, CH?_AL3_WRITE_ADDR,CH??_AL3_WRITE_ADDR, CH?_AL3_TRANS_COUNT,CH??_AL3_TRANS_COUNT, CH?_AL3_READ_ADDR_TRIG,CH??_AL3_READ_ADDR_TRIG

source

pub fn ch_iter(&self) -> impl Iterator<Item = &CH>

Iterator for array of: 0x00..0x300 - Cluster CH%s, containing CH?_READ_ADDR,CH??_READ_ADDR, CH?_WRITE_ADDR,CH??_WRITE_ADDR, CH?_TRANS_COUNT,CH??_TRANS_COUNT, CH?_CTRL_TRIG,CH??_CTRL_TRIG, CH?_AL1_CTRL,CH??_AL1_CTRL, CH?_AL1_READ_ADDR,CH??_AL1_READ_ADDR, CH?_AL1_WRITE_ADDR,CH??_AL1_WRITE_ADDR, CH?_AL1_TRANS_COUNT_TRIG,CH??_AL1_TRANS_COUNT_TRIG, CH?_AL2_CTRL,CH??_AL2_CTRL, CH?_AL2_TRANS_COUNT,CH??_AL2_TRANS_COUNT, CH?_AL2_READ_ADDR,CH??_AL2_READ_ADDR, CH?_AL2_WRITE_ADDR_TRIG,CH??_AL2_WRITE_ADDR_TRIG, CH?_AL3_CTRL,CH??_AL3_CTRL, CH?_AL3_WRITE_ADDR,CH??_AL3_WRITE_ADDR, CH?_AL3_TRANS_COUNT,CH??_AL3_TRANS_COUNT, CH?_AL3_READ_ADDR_TRIG,CH??_AL3_READ_ADDR_TRIG

source

pub fn intr(&self) -> &INTR

0x400 - Interrupt Status (raw)

source

pub fn inte0(&self) -> &INTE0

0x404 - Interrupt Enables for IRQ 0

source

pub fn intf0(&self) -> &INTF0

0x408 - Force Interrupts

source

pub fn ints0(&self) -> &INTS0

0x40c - Interrupt Status for IRQ 0

source

pub fn inte1(&self) -> &INTE1

0x414 - Interrupt Enables for IRQ 1

source

pub fn intf1(&self) -> &INTF1

0x418 - Force Interrupts for IRQ 1

source

pub fn ints1(&self) -> &INTS1

0x41c - Interrupt Status (masked) for IRQ 1

source

pub fn timer0(&self) -> &TIMER0

0x420 - Pacing (X/Y) Fractional Timer
The pacing timer produces TREQ assertions at a rate set by ((X/Y) * sys_clk). This equation is evaluated every sys_clk cycles and therefore can only generate TREQs at a rate of 1 per sys_clk (i.e. permanent TREQ) or less.

source

pub fn timer1(&self) -> &TIMER1

0x424 - Pacing (X/Y) Fractional Timer
The pacing timer produces TREQ assertions at a rate set by ((X/Y) * sys_clk). This equation is evaluated every sys_clk cycles and therefore can only generate TREQs at a rate of 1 per sys_clk (i.e. permanent TREQ) or less.

source

pub fn timer2(&self) -> &TIMER2

0x428 - Pacing (X/Y) Fractional Timer
The pacing timer produces TREQ assertions at a rate set by ((X/Y) * sys_clk). This equation is evaluated every sys_clk cycles and therefore can only generate TREQs at a rate of 1 per sys_clk (i.e. permanent TREQ) or less.

source

pub fn timer3(&self) -> &TIMER3

0x42c - Pacing (X/Y) Fractional Timer
The pacing timer produces TREQ assertions at a rate set by ((X/Y) * sys_clk). This equation is evaluated every sys_clk cycles and therefore can only generate TREQs at a rate of 1 per sys_clk (i.e. permanent TREQ) or less.

source

pub fn multi_chan_trigger(&self) -> &MULTI_CHAN_TRIGGER

0x430 - Trigger one or more channels simultaneously

source

pub fn sniff_ctrl(&self) -> &SNIFF_CTRL

0x434 - Sniffer Control

source

pub fn sniff_data(&self) -> &SNIFF_DATA

0x438 - Data accumulator for sniff hardware
Write an initial seed value here before starting a DMA transfer on the channel indicated by SNIFF_CTRL_DMACH. The hardware will update this register each time it observes a read from the indicated channel. Once the channel completes, the final result can be read from this register.

source

pub fn fifo_levels(&self) -> &FIFO_LEVELS

0x440 - Debug RAF, WAF, TDF levels

source

pub fn chan_abort(&self) -> &CHAN_ABORT

0x444 - Abort an in-progress transfer sequence on one or more channels

source

pub fn n_channels(&self) -> &N_CHANNELS

0x448 - The number of channels this DMA instance is equipped with. This DMA supports up to 16 hardware channels, but can be configured with as few as one, to minimise silicon area.

source

pub fn ch0_dbg_ctdreq(&self) -> &CH0_DBG_CTDREQ

0x800 - Read: get channel DREQ counter (i.e. how many accesses the DMA expects it can perform on the peripheral without overflow/underflow. Write any value: clears the counter, and cause channel to re-initiate DREQ handshake.

source

pub fn ch0_dbg_tcr(&self) -> &CH0_DBG_TCR

0x804 - Read to get channel TRANS_COUNT reload value, i.e. the length of the next transfer

source

pub fn ch1_dbg_ctdreq(&self) -> &CH1_DBG_CTDREQ

0x840 - Read: get channel DREQ counter (i.e. how many accesses the DMA expects it can perform on the peripheral without overflow/underflow. Write any value: clears the counter, and cause channel to re-initiate DREQ handshake.

source

pub fn ch1_dbg_tcr(&self) -> &CH1_DBG_TCR

0x844 - Read to get channel TRANS_COUNT reload value, i.e. the length of the next transfer

source

pub fn ch2_dbg_ctdreq(&self) -> &CH2_DBG_CTDREQ

0x880 - Read: get channel DREQ counter (i.e. how many accesses the DMA expects it can perform on the peripheral without overflow/underflow. Write any value: clears the counter, and cause channel to re-initiate DREQ handshake.

source

pub fn ch2_dbg_tcr(&self) -> &CH2_DBG_TCR

0x884 - Read to get channel TRANS_COUNT reload value, i.e. the length of the next transfer

source

pub fn ch3_dbg_ctdreq(&self) -> &CH3_DBG_CTDREQ

0x8c0 - Read: get channel DREQ counter (i.e. how many accesses the DMA expects it can perform on the peripheral without overflow/underflow. Write any value: clears the counter, and cause channel to re-initiate DREQ handshake.

source

pub fn ch3_dbg_tcr(&self) -> &CH3_DBG_TCR

0x8c4 - Read to get channel TRANS_COUNT reload value, i.e. the length of the next transfer

source

pub fn ch4_dbg_ctdreq(&self) -> &CH4_DBG_CTDREQ

0x900 - Read: get channel DREQ counter (i.e. how many accesses the DMA expects it can perform on the peripheral without overflow/underflow. Write any value: clears the counter, and cause channel to re-initiate DREQ handshake.

source

pub fn ch4_dbg_tcr(&self) -> &CH4_DBG_TCR

0x904 - Read to get channel TRANS_COUNT reload value, i.e. the length of the next transfer

source

pub fn ch5_dbg_ctdreq(&self) -> &CH5_DBG_CTDREQ

0x940 - Read: get channel DREQ counter (i.e. how many accesses the DMA expects it can perform on the peripheral without overflow/underflow. Write any value: clears the counter, and cause channel to re-initiate DREQ handshake.

source

pub fn ch5_dbg_tcr(&self) -> &CH5_DBG_TCR

0x944 - Read to get channel TRANS_COUNT reload value, i.e. the length of the next transfer

source

pub fn ch6_dbg_ctdreq(&self) -> &CH6_DBG_CTDREQ

0x980 - Read: get channel DREQ counter (i.e. how many accesses the DMA expects it can perform on the peripheral without overflow/underflow. Write any value: clears the counter, and cause channel to re-initiate DREQ handshake.

source

pub fn ch6_dbg_tcr(&self) -> &CH6_DBG_TCR

0x984 - Read to get channel TRANS_COUNT reload value, i.e. the length of the next transfer

source

pub fn ch7_dbg_ctdreq(&self) -> &CH7_DBG_CTDREQ

0x9c0 - Read: get channel DREQ counter (i.e. how many accesses the DMA expects it can perform on the peripheral without overflow/underflow. Write any value: clears the counter, and cause channel to re-initiate DREQ handshake.

source

pub fn ch7_dbg_tcr(&self) -> &CH7_DBG_TCR

0x9c4 - Read to get channel TRANS_COUNT reload value, i.e. the length of the next transfer

source

pub fn ch8_dbg_ctdreq(&self) -> &CH8_DBG_CTDREQ

0xa00 - Read: get channel DREQ counter (i.e. how many accesses the DMA expects it can perform on the peripheral without overflow/underflow. Write any value: clears the counter, and cause channel to re-initiate DREQ handshake.

source

pub fn ch8_dbg_tcr(&self) -> &CH8_DBG_TCR

0xa04 - Read to get channel TRANS_COUNT reload value, i.e. the length of the next transfer

source

pub fn ch9_dbg_ctdreq(&self) -> &CH9_DBG_CTDREQ

0xa40 - Read: get channel DREQ counter (i.e. how many accesses the DMA expects it can perform on the peripheral without overflow/underflow. Write any value: clears the counter, and cause channel to re-initiate DREQ handshake.

source

pub fn ch9_dbg_tcr(&self) -> &CH9_DBG_TCR

0xa44 - Read to get channel TRANS_COUNT reload value, i.e. the length of the next transfer

source

pub fn ch10_dbg_ctdreq(&self) -> &CH10_DBG_CTDREQ

0xa80 - Read: get channel DREQ counter (i.e. how many accesses the DMA expects it can perform on the peripheral without overflow/underflow. Write any value: clears the counter, and cause channel to re-initiate DREQ handshake.

source

pub fn ch10_dbg_tcr(&self) -> &CH10_DBG_TCR

0xa84 - Read to get channel TRANS_COUNT reload value, i.e. the length of the next transfer

source

pub fn ch11_dbg_ctdreq(&self) -> &CH11_DBG_CTDREQ

0xac0 - Read: get channel DREQ counter (i.e. how many accesses the DMA expects it can perform on the peripheral without overflow/underflow. Write any value: clears the counter, and cause channel to re-initiate DREQ handshake.

source

pub fn ch11_dbg_tcr(&self) -> &CH11_DBG_TCR

0xac4 - Read to get channel TRANS_COUNT reload value, i.e. the length of the next transfer

Trait Implementations§

source§

impl Debug for DMA

source§

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

Formats the value using the given formatter. Read more
source§

impl Deref for DMA

source§

type Target = RegisterBlock

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl Send for DMA

Auto Trait Implementations§

§

impl Freeze for DMA

§

impl RefUnwindSafe for DMA

§

impl !Sync for DMA

§

impl Unpin for DMA

§

impl UnwindSafe for DMA

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

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, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

source§

type Error = <U as TryFrom<T>>::Error

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

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

Performs the conversion.