rp2__common_2hardware__dma_2include_2hardware_2dma_8h
dma.h File Reference
#include "pico.h"
#include "hardware/structs/dma.h"
#include "hardware/regs/dreq.h"
#include "pico/assert.h"
Go to the source code of this file.
Data Structures
-
struct dma_channel_config
Macros
-
#define DREQ_DMA_TIMER0 DMA_CH0_CTRL_TRIG_TREQ_SEL_VALUE_TIMER0
-
#define DREQ_DMA_TIMER1 DMA_CH0_CTRL_TRIG_TREQ_SEL_VALUE_TIMER1
-
#define DREQ_DMA_TIMER2 DMA_CH0_CTRL_TRIG_TREQ_SEL_VALUE_TIMER2
-
#define DREQ_DMA_TIMER3 DMA_CH0_CTRL_TRIG_TREQ_SEL_VALUE_TIMER3
-
#define DREQ_FORCE DMA_CH0_CTRL_TRIG_TREQ_SEL_VALUE_PERMANENT
Enumerations
-
enum dma_channel_transfer_size { DMA_SIZE_8 = 0 , DMA_SIZE_16 = 1 , DMA_SIZE_32 = 2 }
-
Enumeration of available DMA channel transfer sizes. More...
Functions
-
static dma_channel_hw_t * dma_channel_hw_addr (uint channel)
-
void dma_channel_claim (uint channel)
-
Mark a dma channel as used.
-
void dma_claim_mask (uint32_t channel_mask)
-
Mark multiple dma channels as used.
-
void dma_channel_unclaim (uint channel)
-
Mark a dma channel as no longer used.
-
void dma_unclaim_mask (uint32_t channel_mask)
-
Mark multiple dma channels as no longer used.
-
int dma_claim_unused_channel (bool required)
-
Claim a free dma channel.
-
bool dma_channel_is_claimed (uint channel)
-
Determine if a dma channel is claimed.
-
static void channel_config_set_read_increment (dma_channel_config *c, bool incr)
-
Set DMA channel read increment in a channel configuration object.
-
static void channel_config_set_write_increment (dma_channel_config *c, bool incr)
-
Set DMA channel write increment in a channel configuration object.
-
static void channel_config_set_dreq (dma_channel_config *c, uint dreq)
-
Select a transfer request signal in a channel configuration object.
-
static void channel_config_set_chain_to (dma_channel_config *c, uint chain_to)
-
Set DMA channel chain_to channel in a channel configuration object.
-
static void channel_config_set_transfer_data_size (dma_channel_config *c, enum dma_channel_transfer_size size)
-
Set the size of each DMA bus transfer in a channel configuration object.
-
static void channel_config_set_ring (dma_channel_config *c, bool write, uint size_bits)
-
Set address wrapping parameters in a channel configuration object.
-
static void channel_config_set_bswap (dma_channel_config *c, bool bswap)
-
Set DMA byte swapping config in a channel configuration object.
-
static void channel_config_set_irq_quiet (dma_channel_config *c, bool irq_quiet)
-
Set IRQ quiet mode in a channel configuration object.
-
static void channel_config_set_high_priority (dma_channel_config *c, bool high_priority)
-
Set the channel priority in a channel configuration object.
-
static void channel_config_set_enable (dma_channel_config *c, bool enable)
-
Enable/Disable the DMA channel in a channel configuration object.
-
static void channel_config_set_sniff_enable (dma_channel_config *c, bool sniff_enable)
-
Enable access to channel by sniff hardware in a channel configuration object.
-
static dma_channel_config dma_channel_get_default_config (uint channel)
-
Get the default channel configuration for a given channel.
-
static dma_channel_config dma_get_channel_config (uint channel)
-
Get the current configuration for the specified channel.
-
static uint32_t channel_config_get_ctrl_value (const dma_channel_config *config)
-
Get the raw configuration register from a channel configuration.
-
static void dma_channel_set_config (uint channel, const dma_channel_config *config, bool trigger)
-
Set a channel configuration.
-
static void dma_channel_set_read_addr (uint channel, const volatile void *read_addr, bool trigger)
-
Set the DMA initial read address.
-
static void dma_channel_set_write_addr (uint channel, volatile void *write_addr, bool trigger)
-
Set the DMA initial write address.
-
static void dma_channel_set_trans_count (uint channel, uint32_t trans_count, bool trigger)
-
Set the number of bus transfers the channel will do.
-
static void dma_channel_configure (uint channel, const dma_channel_config *config, volatile void *write_addr, const volatile void *read_addr, uint transfer_count, bool trigger)
-
Configure all DMA parameters and optionally start transfer.
-
static void dma_channel_transfer_from_buffer_now (uint channel, const volatile void *read_addr, uint32_t transfer_count)
-
Start a DMA transfer from a buffer immediately.
-
static void dma_channel_transfer_to_buffer_now (uint channel, volatile void *write_addr, uint32_t transfer_count)
-
Start a DMA transfer to a buffer immediately.
-
static void dma_start_channel_mask (uint32_t chan_mask)
-
Start one or more channels simultaneously.
-
static void dma_channel_start (uint channel)
-
Start a single DMA channel.
-
static void dma_channel_abort (uint channel)
-
Stop a DMA transfer.
-
static void dma_channel_set_irq0_enabled (uint channel, bool enabled)
-
Enable single DMA channel's interrupt via DMA_IRQ_0.
-
static void dma_set_irq0_channel_mask_enabled (uint32_t channel_mask, bool enabled)
-
Enable multiple DMA channels' interrupts via DMA_IRQ_0.
-
static void dma_channel_set_irq1_enabled (uint channel, bool enabled)
-
Enable single DMA channel's interrupt via DMA_IRQ_1.
-
static void dma_set_irq1_channel_mask_enabled (uint32_t channel_mask, bool enabled)
-
Enable multiple DMA channels' interrupts via DMA_IRQ_1.
-
static void dma_irqn_set_channel_enabled (uint irq_index, uint channel, bool enabled)
-
Enable single DMA channel interrupt on either DMA_IRQ_0 or DMA_IRQ_1.
-
static void dma_irqn_set_channel_mask_enabled (uint irq_index, uint32_t channel_mask, bool enabled)
-
Enable multiple DMA channels' interrupt via either DMA_IRQ_0 or DMA_IRQ_1.
-
static bool dma_channel_get_irq0_status (uint channel)
-
Determine if a particular channel is a cause of DMA_IRQ_0.
-
static bool dma_channel_get_irq1_status (uint channel)
-
Determine if a particular channel is a cause of DMA_IRQ_1.
-
static bool dma_irqn_get_channel_status (uint irq_index, uint channel)
-
Determine if a particular channel is a cause of DMA_IRQ_N.
-
static void dma_channel_acknowledge_irq0 (uint channel)
-
Acknowledge a channel IRQ, resetting it as the cause of DMA_IRQ_0.
-
static void dma_channel_acknowledge_irq1 (uint channel)
-
Acknowledge a channel IRQ, resetting it as the cause of DMA_IRQ_1.
-
static void dma_irqn_acknowledge_channel (uint irq_index, uint channel)
-
Acknowledge a channel IRQ, resetting it as the cause of DMA_IRQ_N.
-
static bool dma_channel_is_busy (uint channel)
-
Check if DMA channel is busy.
-
static void dma_channel_wait_for_finish_blocking (uint channel)
-
Wait for a DMA channel transfer to complete.
-
static void dma_sniffer_enable (uint channel, uint mode, bool force_channel_enable)
-
Enable the DMA sniffing targeting the specified channel.
-
static void dma_sniffer_set_byte_swap_enabled (bool swap)
-
Enable the Sniffer byte swap function.
-
static void dma_sniffer_set_output_invert_enabled (bool invert)
-
Enable the Sniffer output invert function.
-
static void dma_sniffer_set_output_reverse_enabled (bool reverse)
-
Enable the Sniffer output bit reversal function.
-
static void dma_sniffer_disable (void)
-
Disable the DMA sniffer.
-
static void dma_sniffer_set_data_accumulator (uint32_t seed_value)
-
Set the sniffer's data accumulator with initial value.
-
static uint32_t dma_sniffer_get_data_accumulator (void)
-
Get the sniffer's data accumulator value.
-
void dma_timer_claim (uint timer)
-
Mark a dma timer as used.
-
void dma_timer_unclaim (uint timer)
-
Mark a dma timer as no longer used.
-
int dma_claim_unused_timer (bool required)
-
Claim a free dma timer.
-
bool dma_timer_is_claimed (uint timer)
-
Determine if a dma timer is claimed.
-
static void dma_timer_set_fraction (uint timer, uint16_t numerator, uint16_t denominator)
-
Set the divider for the given DMA timer.
-
static uint dma_get_timer_dreq (uint timer_num)
-
Return the DREQ number for a given DMA timer.
-
void print_dma_ctrl (dma_channel_hw_t *channel)