DMA channel configurationA DMA channel needs to be configured, these functions provide handy helpers to set up configuration structures. See dma_channel_config.
More...
|
static void | channel_config_set_read_increment (dma_channel_config *c, bool incr) |
| Set DMA channel read increment in a channel configuration object. More...
|
|
static void | channel_config_set_write_increment (dma_channel_config *c, bool incr) |
| Set DMA channel write increment in a channel configuration object. More...
|
|
static void | channel_config_set_dreq (dma_channel_config *c, uint dreq) |
| Select a transfer request signal in a channel configuration objectThe 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 0x3b -> Select Timer 0 as TREQ 0x3c -> Select Timer 1 as TREQ 0x3d -> Select Timer 2 as TREQ (Optional) 0x3e -> Select Timer 3 as TREQ (Optional) 0x3f -> Permanent request, for unpaced transfers. More...
|
|
static void | channel_config_set_chain_to (dma_channel_config *c, uint chain_to) |
| Set DMA channel chain_to channel in a channel configuration objectWhen this channel completes, it will trigger the channel indicated by chain_to. Disable by setting chain_to to itself (the same channel) More...
|
|
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 objectSet the size of each bus transfer (byte/halfword/word). The read and write addresses advance by the specific amount (1/2/4 bytes) with each transfer. More...
|
|
static void | channel_config_set_ring (dma_channel_config *c, bool write, uint size_bits) |
| Set address wrapping parameters in a channel configuration objectSize 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 (size_bits from 1 - 15) More...
|
|
static void | channel_config_set_bswap (dma_channel_config *c, bool bswap) |
| Set DMA byte swapping config in a channel configuration objectNo effect for byte data, for halfword data, the two bytes of each halfword are swapped. For word data, the four bytes of each word are swapped to reverse their order. More...
|
|
static void | channel_config_set_irq_quiet (dma_channel_config *c, bool irq_quiet) |
| Set IRQ quiet mode in a channel configuration objectIn 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. More...
|
|
static void | channel_config_set_high_priority (dma_channel_config *c, bool high_priority) |
| Set the channel priority in a channel configuration objectWhen true, 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. More...
|
|
static void | channel_config_set_enable (dma_channel_config *c, bool enable) |
| Enable/Disable the DMA channel in a channel configuration objectWhen false, the channel will ignore triggers, stop issuing transfers, and pause the current transfer sequence (i.e. BUSY will remain high if already high) More...
|
|
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 objectSniff HW must be enabled and have this channel selected. More...
|
|
static dma_channel_config | dma_channel_get_default_config (uint channel) |
| Get the default channel configuration for a given channel
Setting | Default |
Read Increment | true |
Write Increment | false |
DReq | DREQ_FORCE |
Chain to | self |
Data size | DMA_SIZE_32 |
Ring | write=false, size=0 (i.e. off) |
Byte Swap | false |
Quiet IRQs | false |
High Priority | false |
Channel Enable | true |
Sniff Enable | false |
More...
|
|
static dma_channel_config | dma_get_channel_config (uint channel) |
| Get the current configuration for the specified channel. More...
|
|
static uint32_t | channel_config_get_ctrl_value (const dma_channel_config *config) |
| Get the raw configuration register from a channel configuration. More...
|
|
A DMA channel needs to be configured, these functions provide handy helpers to set up configuration structures. See dma_channel_config.
static void channel_config_set_high_priority |
( |
dma_channel_config * |
c, |
|
|
bool |
high_priority |
|
) |
| |
|
inlinestatic |
Set the channel priority in a channel configuration objectWhen true, 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.
- Parameters
-
c | Pointer to channel configuration object |
high_priority | True to enable high priority |