VSF Documented
Data Fields
vsf_dma_channel_hint_t Struct Reference

DMA channel hint structure for channel allocation. More...

#include <dma.h>

Data Fields

int8_t channel
 
uint8_t request_line
 
vsf_arch_prio_t prio
 

Detailed Description

DMA channel hint structure for channel allocation.

Note
This structure is used only during channel acquire phase to provide hints for channel allocation. It contains only information needed for channel selection.
Examples
/github/workspace/source/hal/driver/common/template/vsf_template_dma.h.

Field Documentation

◆ channel

int8_t vsf_dma_channel_hint_t::channel

Specify the DMA channel number. Use negative value (e.g., -1) for automatic allocation. (Some chips have fixed functionality configurations for DMA channels) Channel allocation modes:

Examples
/github/workspace/source/hal/driver/common/template/vsf_template_dma.h.

◆ request_line

uint8_t vsf_dma_channel_hint_t::request_line

Peripheral request line number, specifying the peripheral request source using DMA service. (Some chips provide a mapping table between peripherals and request lines, refer to chip manual to select the correct request line number).

Examples
/github/workspace/source/hal/driver/common/template/vsf_template_dma.h.

◆ prio

vsf_arch_prio_t vsf_dma_channel_hint_t::prio

Optional interrupt priority for channel allocation. Priority handling behavior:

  • If prio is vsf_arch_prio_invalid: Use default priority from vsf_dma_cfg_t (set during vsf_dma_init()).
  • If prio is valid and DMA supports per-channel independent interrupts: Configure this priority during channel allocation.
  • If prio is valid and multiple channels share the same interrupt: Driver should check if the requested priority matches the existing shared interrupt priority. If matched, allocate a channel from the shared interrupt group. If not matched and no compatible channel is available, return VSF_ERR_NOT_AVAILABLE. Priority override order (from highest to lowest priority):
    1. Priority specified in channel_config() (highest priority, overrides all others)
    2. Priority specified in channel_acquire() (medium priority)
    3. Default priority from vsf_dma_cfg_t (lowest priority, used as fallback) Note: For static allocation (channels fixed to peripherals), channel_acquire() is not called, so only options 1 and 3 apply.
Examples
/github/workspace/source/hal/driver/common/template/vsf_template_dma.h.
Generated from commit: vsfteam/vsf@3f77d3b