18#if VSF_HAL_USE_DMA == ENABLED
23#define vsf_real_dma_t VSF_MCONNECT(VSF_DMA_CFG_IMP_PREFIX, _dma_t)
24#define vsf_real_dma_capability VSF_MCONNECT(VSF_DMA_CFG_IMP_PREFIX, _dma_capability)
26#ifndef VSF_DMA_CFG_REIMPLEMENT_API_CAPABILITY
27# define VSF_DMA_CFG_REIMPLEMENT_API_CAPABILITY DISABLED
30#ifdef VSF_DMA_CFG_IMP_REMAP_PREFIX
31# undef VSF_DMA_CFG_REIMPLEMENT_API_CAPABILITY
32# define VSF_DMA_CFG_REIMPLEMENT_API_CAPABILITY ENABLED
35#if VSF_DMA_CFG_REIMPLEMENT_API_CAPABILITY == DISABLED
36# ifndef VSF_DMA_CFG_CAPABILITY_IRQ_MASK
37# define VSF_DMA_CFG_CAPABILITY_IRQ_MASK VSF_DMA_IRQ_ALL_BITS_MASK
39# ifndef VSF_DMA_CFG_CAPABILITY_MAX_REQUEST_COUNT
40# define VSF_DMA_CFG_CAPABILITY_MAX_REQUEST_COUNT 0xFFFFFFFF
42# ifndef VSF_DMA_CFG_CAPABILITY_CHANNEL_COUNT
43# define VSF_DMA_CFG_CAPABILITY_CHANNEL_COUNT 8
50#if VSF_DMA_CFG_REIMPLEMENT_API_CAPABILITY == DISABLED
54 .irq_mask = VSF_DMA_CFG_CAPABILITY_IRQ_MASK,
56 .channel_count = VSF_DMA_CFG_CAPABILITY_CHANNEL_COUNT,
59 return dma_capability;
65#undef VSF_DMA_CFG_REIMPLEMENT_API_CAPABILITY
66#undef VSF_DMA_CFG_CAPABILITY_IRQ_MASK
67#undef VSF_DMA_CFG_CAPABILITY_MAX_REQUEST_COUNT
68#undef VSF_DMA_CFG_CAPABILITY_CHANNEL_COUNT
70#undef vsf_real_dma_capability
77#ifdef VSF_DMA_CFG_IMP_REMAP_PREFIX
78# define vsf_imp_dma_t VSF_MCONNECT(VSF_DMA_CFG_IMP_PREFIX, _dma_t)
79# define vsf_imp_dma_init VSF_MCONNECT(VSF_DMA_CFG_IMP_PREFIX, _dma_init)
80# define vsf_imp_dma_fini VSF_MCONNECT(VSF_DMA_CFG_IMP_PREFIX, _dma_fini)
81# define vsf_imp_dma_capability VSF_MCONNECT(VSF_DMA_CFG_IMP_PREFIX, _dma_capability)
82# define vsf_imp_dma_channel_request VSF_MCONNECT(VSF_DMA_CFG_IMP_PREFIX, _dma_channel_request)
83# define vsf_imp_dma_channel_release VSF_MCONNECT(VSF_DMA_CFG_IMP_PREFIX, _dma_channel_release)
84# define vsf_imp_dma_channel_config VSF_MCONNECT(VSF_DMA_CFG_IMP_PREFIX, _dma_channel_config)
85# define vsf_imp_dma_channel_start VSF_MCONNECT(VSF_DMA_CFG_IMP_PREFIX, _dma_channel_start)
86# define vsf_imp_dma_channel_cancel VSF_MCONNECT(VSF_DMA_CFG_IMP_PREFIX, _dma_channel_cancel)
87# define vsf_imp_dma_channel_get_transferred_count VSF_MCONNECT(VSF_DMA_CFG_IMP_PREFIX, _dma_channel_get_transferred_count)
88# define vsf_imp_dma_channel_status VSF_MCONNECT(VSF_DMA_CFG_IMP_PREFIX, _dma_channel_status)
90# define vsf_remap_dma_t VSF_MCONNECT(VSF_DMA_CFG_IMP_REMAP_PREFIX, _dma_t)
91# define vsf_remap_dma_init VSF_MCONNECT(VSF_DMA_CFG_IMP_REMAP_PREFIX, _dma_init)
92# define vsf_remap_dma_fini VSF_MCONNECT(VSF_DMA_CFG_IMP_REMAP_PREFIX, _dma_fini)
93# define vsf_remap_dma_capability VSF_MCONNECT(VSF_DMA_CFG_IMP_REMAP_PREFIX, _dma_capability)
94# define vsf_remap_dma_channel_request VSF_MCONNECT(VSF_DMA_CFG_IMP_REMAP_PREFIX, _dma_channel_request)
95# define vsf_remap_dma_channel_release VSF_MCONNECT(VSF_DMA_CFG_IMP_REMAP_PREFIX, _dma_channel_release)
96# define vsf_remap_dma_channel_config VSF_MCONNECT(VSF_DMA_CFG_IMP_REMAP_PREFIX, _dma_channel_config)
97# define vsf_remap_dma_channel_start VSF_MCONNECT(VSF_DMA_CFG_IMP_REMAP_PREFIX, _dma_channel_start)
98# define vsf_remap_dma_channel_cancel VSF_MCONNECT(VSF_DMA_CFG_IMP_REMAP_PREFIX, _dma_channel_cancel)
99# define vsf_remap_dma_channel_get_transferred_count VSF_MCONNECT(VSF_DMA_CFG_IMP_REMAP_PREFIX, _dma_channel_get_transferred_count)
100# define vsf_remap_dma_channel_status VSF_MCONNECT(VSF_DMA_CFG_IMP_REMAP_PREFIX, _dma_channel_status)
102# define VSF_DMA_CFG_IMP_REMAP_FUNCTIONS \
103 vsf_err_t vsf_imp_dma_init(vsf_imp_dma_t *dma_ptr) \
105 VSF_HAL_ASSERT(dma_ptr != NULL); \
106 return vsf_remap_dma_init(dma_ptr); \
108 void vsf_imp_dma_fini(vsf_imp_dma_t *dma_ptr) \
110 VSF_HAL_ASSERT(dma_ptr != NULL); \
111 vsf_remap_dma_fini(dma_ptr); \
113 vsf_dma_capability_t vsf_imp_dma_capability(vsf_imp_dma_t *dma_ptr) \
115 VSF_HAL_ASSERT(dma_ptr != NULL); \
116 return vsf_remap_dma_capability(dma_ptr); \
118 int8_t vsf_imp_dma_channel_request(vsf_imp_dma_t *dma_ptr, void *filter_param) \
120 VSF_HAL_ASSERT(dma_ptr != NULL); \
121 return vsf_remap_dma_channel_request(dma_ptr, filter_param); \
123 void vsf_imp_dma_channel_release(vsf_imp_dma_t *dma_ptr, int8_t channel) \
125 VSF_HAL_ASSERT(dma_ptr != NULL); \
126 vsf_remap_dma_channel_release(dma_ptr, channel); \
128 vsf_err_t vsf_imp_dma_channel_config(vsf_imp_dma_t *dma_ptr, int8_t channel, \
129 vsf_dma_channel_cfg_t *cfg_ptr) \
131 VSF_HAL_ASSERT(dma_ptr != NULL); \
132 return vsf_remap_dma_channel_config(dma_ptr, channel, cfg_ptr); \
134 vsf_err_t vsf_imp_dma_channel_start(vsf_imp_dma_t *dma_ptr, int8_t channel, \
135 uint32_t src_address, uint32_t dst_address, \
138 VSF_HAL_ASSERT(dma_ptr != NULL); \
139 return vsf_remap_dma_channel_start(dma_ptr, channel, src_address, \
140 dst_address, count); \
142 vsf_err_t vsf_imp_dma_channel_cancel(vsf_imp_dma_t *dma_ptr, int8_t channel) \
144 VSF_HAL_ASSERT(dma_ptr != NULL); \
145 return vsf_remap_dma_channel_cancel(dma_ptr, channel); \
147 vsf_err_t vsf_imp_dma_channel_get_transferred_count(vsf_imp_dma_t *dma_ptr, \
150 VSF_HAL_ASSERT(dma_ptr != NULL); \
151 return vsf_remap_dma_channel_get_transferred_count(dma_ptr, channel); \
153 vsf_dma_channel_status_t vsf_imp_dma_channel_status(vsf_imp_dma_t *dma_ptr, \
156 VSF_HAL_ASSERT(dma_ptr != NULL); \
157 return vsf_remap_dma_channel_status(dma_ptr, channel); \
164#define VSF_HAL_TEMPLATE_IMP_NAME _dma
165#define VSF_HAL_TEMPLATE_IMP_UPCASE_NAME _DMA
167#ifndef VSF_DMA_CFG_IMP_PREFIX
168# error "Please define VSF_DMA_CFG_IMP_PREFIX in dma driver"
171#ifndef VSF_DMA_CFG_IMP_UPCASE_PREFIX
172# error "Please define VSF_DMA_CFG_IMP_UPCASE_PREFIX in dma driver"
175#ifndef VSF_DMA_CFG_IMP_COUNT_MASK_PREFIX
176# define VSF_DMA_CFG_IMP_COUNT_MASK_PREFIX VSF_DMA_CFG_IMP_UPCASE_PREFIX
179#ifdef VSF_DMA_CFG_IMP_REMAP_FUNCTIONS
180# define VSF_HAL_CFG_IMP_REMAP_FUNCTIONS VSF_DMA_CFG_IMP_REMAP_FUNCTIONS
185#undef VSF_DMA_CFG_IMP_PREFIX
186#undef VSF_DMA_CFG_IMP_COUNT_MASK_PREFIX
187#undef VSF_DMA_CFG_IMP_UPCASE_PREFIX
188#undef VSF_DMA_CFG_IMP_LV0
189#undef VSF_DMA_CFG_IMP_REMAP_FUNCTIONS
190#undef VSF_DMA_CFG_IMP_HAS_OP
191#undef VSF_DMA_CFG_IMP_EXTERN_OP
194#undef vsf_imp_dma_init
195#undef vsf_imp_dma_fini
196#undef vsf_imp_dma_capability
197#undef vsf_imp_dma_channel_request
198#undef vsf_imp_dma_channel_release
199#undef vsf_imp_dma_channel_config
200#undef vsf_imp_dma_channel_start
201#undef vsf_imp_dma_channel_cancel
202#undef vsf_imp_dma_channel_get_transferred_count
203#undef vsf_imp_dma_channel_status
205#undef vsf_remap_dma_t
206#undef vsf_remap_dma_init
207#undef vsf_remap_dma_fini
208#undef vsf_remap_dma_capability
209#undef vsf_remap_dma_channel_request
210#undef vsf_remap_dma_channel_release
211#undef vsf_remap_dma_channel_config
212#undef vsf_remap_dma_channel_start
213#undef vsf_remap_dma_channel_cancel
214#undef vsf_remap_dma_channel_get_transferred_count
215#undef vsf_remap_dma_channel_status
Definition vsf_template_dma.h:281
uint32_t max_request_count
Definition vsf_template_dma.h:287