VSF Documented
vsf_template_dma.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2022 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18#ifndef __VSF_TEMPLATE_DMA_H__
19#define __VSF_TEMPLATE_DMA_H__
20
21/*============================ INCLUDES ======================================*/
22
24#include "hal/arch/vsf_arch.h"
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
30/*============================ MACROS ========================================*/
31
39#ifndef VSF_DMA_CFG_MULTI_CLASS
40# define VSF_DMA_CFG_MULTI_CLASS ENABLED
41#endif
42
52#ifndef VSF_DMA_CFG_PREFIX
53# if VSF_DMA_CFG_MULTI_CLASS == ENABLED
54# define VSF_DMA_CFG_PREFIX vsf
55# elif defined(VSF_HW_DMA_COUNT) && (VSF_HW_DMA_COUNT != 0)
56# define VSF_DMA_CFG_PREFIX vsf_hw
57# else
58# define VSF_DMA_CFG_PREFIX vsf
59# endif
60#endif
61
71#ifndef VSF_DMA_CFG_FUNCTION_RENAME
72# define VSF_DMA_CFG_FUNCTION_RENAME ENABLED
73#endif
74
82#ifndef VSF_DMA_CFG_REIMPLEMENT_TYPE_CHANNEL_MODE
83# define VSF_DMA_CFG_REIMPLEMENT_TYPE_CHANNEL_MODE DISABLED
84#endif
85
93#ifndef VSF_DMA_CFG_REIMPLEMENT_TYPE_IRQ_MASK
94# define VSF_DMA_CFG_REIMPLEMENT_TYPE_IRQ_MASK DISABLED
95#endif
96
97
105#ifndef VSF_DMA_CFG_REIMPLEMENT_CFG_TYPE_CFG
106# define VSF_DMA_CFG_REIMPLEMENT_CFG_TYPE_CFG DISABLED
107#endif
108
116#ifndef VSF_DMA_CFG_REIMPLEMENT_TYPE_CHANNEL_HINT
117# define VSF_DMA_CFG_REIMPLEMENT_TYPE_CHANNEL_HINT DISABLED
118#endif
119
129#ifndef VSF_DMA_CFG_REIMPLEMENT_TYPE_CHANNEL_CFG
130# define VSF_DMA_CFG_REIMPLEMENT_TYPE_CHANNEL_CFG DISABLED
131#endif
132
140#ifndef VSF_DMA_CFG_REIMPLEMENT_TYPE_CHANNEL_SG_CFG
141# define VSF_DMA_CFG_REIMPLEMENT_TYPE_CHANNEL_SG_CFG \
142 DISABLED
143#endif
144
156#ifndef VSF_DMA_CFG_REIMPLEMENT_TYPE_CFG
157# define VSF_DMA_CFG_REIMPLEMENT_TYPE_CFG DISABLED
158#endif
159
169#ifndef VSF_DMA_CFG_REIMPLEMENT_TYPE_CAPABILITY
170# define VSF_DMA_CFG_REIMPLEMENT_TYPE_CAPABILITY DISABLED
171#endif
172
180#ifndef VSF_DMA_CFG_INHERIT_HAL_CAPABILITY
181# define VSF_DMA_CFG_INHERIT_HAL_CAPABILITY ENABLED
182#endif
183
193#ifndef VSF_DMA_CHANNEL_SG_ARRAY
194# define VSF_DMA_CHANNEL_SG_ARRAY(__NAME, __COUNT, ...) \
195 vsf_dma_channel_sg_desc_t __NAME[__COUNT] = { \
196 __VA_ARGS__ \
197 };
198#endif
199
208#ifndef VSF_DMA_CHANNEL_SG_ITEM
209# define VSF_DMA_CHANNEL_SG_ITEM(__MODE, __SRC_ADDR, __DST_ADDR, __CNT, ...) \
210 { \
211 .mode = __MODE, \
212 .src_address = __SRC_ADDR, \
213 .dst_address = __DST_ADDR, \
214 .count = __CNT, \
215 __VA_ARGS__ \
216 }
217#endif
218
219/*============================ MACROFIED FUNCTIONS ===========================*/
220
230#define VSF_DMA_APIS(__prefix_name) \
231 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, dma, init, VSF_MCONNECT(__prefix_name, _t) *dma_ptr, vsf_dma_cfg_t *cfg_ptr) \
232 __VSF_HAL_TEMPLATE_API(__prefix_name, void, dma, fini, VSF_MCONNECT(__prefix_name, _t) *dma_ptr) \
233 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, dma, get_configuration, VSF_MCONNECT(__prefix_name, _t) *dma_ptr, vsf_dma_cfg_t *cfg_ptr) \
234 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_dma_capability_t, dma, capability, VSF_MCONNECT(__prefix_name, _t) *dma_ptr) \
235 __VSF_HAL_TEMPLATE_API(__prefix_name, int8_t, dma, channel_request, VSF_MCONNECT(__prefix_name, _t) *dma_ptr, vsf_dma_channel_hint_t *channel_hint_ptr) \
236 __VSF_HAL_TEMPLATE_API(__prefix_name, void, dma, channel_release, VSF_MCONNECT(__prefix_name, _t) *dma_ptr, uint8_t channel) \
237 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, dma, channel_config, VSF_MCONNECT(__prefix_name, _t) *dma_ptr, uint8_t channel, vsf_dma_channel_cfg_t *cfg_ptr) \
238 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, dma, channel_get_configuration, VSF_MCONNECT(__prefix_name, _t) *dma_ptr, uint8_t channel, vsf_dma_channel_cfg_t *cfg_ptr) \
239 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, dma, channel_start, VSF_MCONNECT(__prefix_name, _t) *dma_ptr, uint8_t channel, uint32_t src_address, uint32_t dst_address, uint32_t count) \
240 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, dma, channel_cancel, VSF_MCONNECT(__prefix_name, _t) *dma_ptr, uint8_t channel) \
241 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, dma, channel_sg_config_desc, VSF_MCONNECT(__prefix_name, _t) *dma_ptr, uint8_t channel, vsf_dma_isr_t isr, vsf_dma_channel_sg_desc_t *scatter_gather_cfg, uint32_t sg_count) \
242 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_err_t, dma, channel_sg_start, VSF_MCONNECT(__prefix_name, _t) *dma_ptr, uint8_t channel) \
243 __VSF_HAL_TEMPLATE_API(__prefix_name, uint32_t, dma, channel_get_transferred_count, VSF_MCONNECT(__prefix_name, _t) *dma_ptr, uint8_t channel) \
244 __VSF_HAL_TEMPLATE_API(__prefix_name, vsf_dma_channel_status_t, dma, channel_status, VSF_MCONNECT(__prefix_name, _t) *dma_ptr, uint8_t channel)
245
246/*============================ TYPES =========================================*/
247
248#if VSF_DMA_CFG_REIMPLEMENT_TYPE_CHANNEL_MODE == DISABLED
254
258
262
269
276
285
294
295 //prio
296 VSF_DMA_PRIOPIRY_LOW = (0x00 << 22),
298 VSF_DMA_PRIOPIRY_HIGH = (0x02 << 22),
300
302#endif
303
304enum {
310
315
320
328
336
346
356
362
372
373};
374
375#if VSF_DMA_CFG_REIMPLEMENT_TYPE_IRQ_MASK == DISABLED
376typedef enum vsf_dma_irq_mask_t {
377 VSF_DMA_IRQ_MASK_CPL = (0x1ul << 0),
381#endif
382
383enum {
388};
389
390
391#if VSF_DMA_CFG_REIMPLEMENT_CFG_TYPE_CFG == DISABLED
399typedef struct vsf_dma_cfg_t {
402#endif
403
404#if VSF_DMA_CFG_REIMPLEMENT_TYPE_CHANNEL_HINT == DISABLED
422#endif
423
424#if VSF_DMA_CFG_REIMPLEMENT_TYPE_CHANNEL_CFG == DISABLED
425typedef struct vsf_dma_t vsf_dma_t;
426
427typedef void vsf_dma_isr_handler_t(void *target_ptr, vsf_dma_t *dma_ptr, int8_t channel, vsf_dma_irq_mask_t irq_mask);
428
429typedef struct vsf_dma_isr_t {
433
435typedef struct vsf_dma_channel_cfg_t {
443#endif
444
445#if VSF_DMA_CFG_REIMPLEMENT_TYPE_CHANNEL_SG_CFG == DISABLED
466#endif
467
468#if VSF_DMA_CFG_REIMPLEMENT_TYPE_STATUS == DISABLED
470 union {
472 struct {
473 uint32_t is_busy : 1;
474 };
475 };
477#endif
478
479#if VSF_DMA_CFG_REIMPLEMENT_TYPE_CAPABILITY == DISABLED
480typedef struct vsf_dma_capability_t {
481#if VSF_DMA_CFG_INHERIT_HAL_CAPABILITY == ENABLED
483#endif
485
489#endif
490
491typedef struct vsf_dma_op_t {
493#undef __VSF_HAL_TEMPLATE_API
494#define __VSF_HAL_TEMPLATE_API VSF_HAL_TEMPLATE_API_FP
496
497 VSF_DMA_APIS(vsf_dma)
499
500#if VSF_DMA_CFG_MULTI_CLASS == ENABLED
501struct vsf_dma_t {
503};
504#endif
505
506/*============================ PROTOTYPES ====================================*/
507
527extern vsf_err_t vsf_dma_init(vsf_dma_t *dma_ptr, vsf_dma_cfg_t *cfg_ptr);
528
540extern void vsf_dma_fini(vsf_dma_t *dma_ptr);
541
556
569
583extern int8_t vsf_dma_channel_request(vsf_dma_t *dma_ptr, vsf_dma_channel_hint_t *channel_hint_ptr);
584
598extern void vsf_dma_channel_release(vsf_dma_t *dma_ptr, uint8_t channel);
599
619
636
659extern vsf_err_t vsf_dma_channel_start(vsf_dma_t *dma_ptr, uint8_t channel, uint32_t src_address, uint32_t dst_address, uint32_t count);
660
674extern vsf_err_t vsf_dma_channel_cancel(vsf_dma_t *dma_ptr, uint8_t channel);
675
703 vsf_dma_channel_sg_desc_t *sg_desc_ptr, uint32_t sg_count);
704
721extern vsf_err_t vsf_dma_channel_sg_start(vsf_dma_t *dma_ptr, uint8_t channel);
722
741
756
757/*============================ MACROFIED FUNCTIONS ===========================*/
758
760#if VSF_DMA_CFG_FUNCTION_RENAME == ENABLED
761# define __vsf_dma_t VSF_MCONNECT(VSF_DMA_CFG_PREFIX, _dma_t)
762# define vsf_dma_init(__DMA, ...) VSF_MCONNECT(VSF_DMA_CFG_PREFIX, _dma_init)((__vsf_dma_t *)(__DMA), ##__VA_ARGS__)
763# define vsf_dma_fini(__DMA) VSF_MCONNECT(VSF_DMA_CFG_PREFIX, _dma_fini)((__vsf_dma_t *)(__DMA))
764# define vsf_dma_get_configuration(__DMA, ...) VSF_MCONNECT(VSF_DMA_CFG_PREFIX, _dma_get_configuration)((__vsf_dma_t *)(__DMA), ##__VA_ARGS__)
765# define vsf_dma_capability(__DMA) VSF_MCONNECT(VSF_DMA_CFG_PREFIX, _dma_capability)((__vsf_dma_t *)(__DMA))
766# define vsf_dma_channel_request(__DMA, ...) VSF_MCONNECT(VSF_DMA_CFG_PREFIX, _dma_channel_request)((__vsf_dma_t *)(__DMA), ##__VA_ARGS__)
767# define vsf_dma_channel_release(__DMA, ...) VSF_MCONNECT(VSF_DMA_CFG_PREFIX, _dma_channel_release)((__vsf_dma_t *)(__DMA), ##__VA_ARGS__)
768# define vsf_dma_channel_config(__DMA, ...) VSF_MCONNECT(VSF_DMA_CFG_PREFIX, _dma_channel_config)((__vsf_dma_t *)(__DMA), ##__VA_ARGS__)
769# define vsf_dma_channel_get_configuration(__DMA, ...) VSF_MCONNECT(VSF_DMA_CFG_PREFIX, _dma_channel_get_configuration)((__vsf_dma_t *)(__DMA), ##__VA_ARGS__)
770# define vsf_dma_channel_start(__DMA, ...) VSF_MCONNECT(VSF_DMA_CFG_PREFIX, _dma_channel_start)((__vsf_dma_t *)(__DMA), ##__VA_ARGS__)
771# define vsf_dma_channel_sg_config_desc(__DMA, ...) VSF_MCONNECT(VSF_DMA_CFG_PREFIX, _dma_channel_sg_config_desc)((__vsf_dma_t *)(__DMA), ##__VA_ARGS__)
772# define vsf_dma_channel_sg_start(__DMA, ...) VSF_MCONNECT(VSF_DMA_CFG_PREFIX, _dma_channel_sg_start)((__vsf_dma_t *)(__DMA), ##__VA_ARGS__)
773# define vsf_dma_channel_cancel(__DMA, ...) VSF_MCONNECT(VSF_DMA_CFG_PREFIX, _dma_channel_cancel)((__vsf_dma_t *)(__DMA), ##__VA_ARGS__)
774# define vsf_dma_channel_get_transferred_count(__DMA, ...) VSF_MCONNECT(VSF_DMA_CFG_PREFIX, _dma_channel_get_transferred_count)((__vsf_dma_t *)(__DMA), ##__VA_ARGS__)
775# define vsf_dma_channel_status(__DMA, ...) VSF_MCONNECT(VSF_DMA_CFG_PREFIX, _dma_channel_status)((__vsf_dma_t *)(__DMA), ##__VA_ARGS__)
776#endif
778
779#ifdef __cplusplus
780}
781#endif
782
783#endif /*__VSF_TEMPLATE_DMA_H__*/
vsf_err_t
Definition __type.h:42
vsf_arch_prio_t
Definition cortex_a_generic.h:88
const i_spi_t vsf_spi_irq_mask_t irq_mask
Definition spi_interface.h:38
unsigned uint32_t
Definition stdint.h:9
unsigned char uint8_t
Definition stdint.h:5
signed char int8_t
Definition stdint.h:4
Definition vsf_template_dma.h:480
uint8_t channel_count
Definition vsf_template_dma.h:487
uint32_t max_request_count
Definition vsf_template_dma.h:486
inherit(vsf_peripheral_capability_t) vsf_dma_irq_mask_t irq_mask
Configuration structure for DMA.
Definition vsf_template_dma.h:399
vsf_arch_prio_t prio
Definition vsf_template_dma.h:400
dma configuration
Definition vsf_template_dma.h:435
uint8_t src_idx
Index of the peripheral or memory corresponding to the source address of the DMA.
Definition vsf_template_dma.h:439
vsf_dma_channel_mode_t mode
Definition vsf_template_dma.h:436
uint8_t dst_idx
Index of the peripheral or memory corresponding to the destination address of the DMA.
Definition vsf_template_dma.h:441
vsf_dma_isr_t isr
Definition vsf_template_dma.h:437
DMA channel hint structure.
Definition vsf_template_dma.h:412
uint8_t channel
Definition vsf_template_dma.h:415
uint8_t request_line
Definition vsf_template_dma.h:420
DMA scatter-gather descriptor structure.
Definition vsf_template_dma.h:459
uint32_t next
Next descriptor address.
Definition vsf_template_dma.h:464
uint32_t count
Number of bytes to be transferred.
Definition vsf_template_dma.h:463
uint32_t dst_address
Destination address.
Definition vsf_template_dma.h:462
vsf_dma_channel_mode_t mode
DMA channel mode.
Definition vsf_template_dma.h:460
uint32_t src_address
Source address.
Definition vsf_template_dma.h:461
Definition vsf_template_dma.h:469
Definition vsf_template_dma.h:429
vsf_dma_isr_handler_t * handler_fn
Definition vsf_template_dma.h:430
void * target_ptr
Definition vsf_template_dma.h:431
Definition vsf_template_dma.h:491
Definition vsf_template_dma.h:501
const vsf_dma_op_t * op
Definition vsf_template_dma.h:502
Definition vsf_template_hal_driver.h:203
Definition vsf_template_hal_driver.h:196
vsf_adc_isr_t isr
Definition adc.h:107
vsf_dma_channel_mode_t
Definition dma.h:116
void vsf_dma_isr_handler_t(void *target_ptr, vsf_dma_t *dma_ptr, int8_t channel, vsf_dma_irq_mask_t irq_mask)
Definition dma.h:179
vsf_dma_irq_mask_t
Definition dma.h:170
vsf_dma_channel_mode_t
Definition vsf_template_dma.h:249
@ VSF_DMA_DST_WIDTH_BYTES_32
Definition vsf_template_dma.h:275
@ VSF_DMA_SRC_BURST_LENGTH_64
Definition vsf_template_dma.h:283
@ VSF_DMA_DST_BURST_LENGTH_64
Definition vsf_template_dma.h:292
@ VSF_DMA_SRC_WIDTH_BYTES_8
Definition vsf_template_dma.h:266
@ VSF_DMA_SRC_WIDTH_BYTES_2
Definition vsf_template_dma.h:264
@ VSF_DMA_DST_WIDTH_BYTES_16
Definition vsf_template_dma.h:274
@ VSF_DMA_SRC_BURST_LENGTH_16
Definition vsf_template_dma.h:281
@ VSF_DMA_DST_BURST_LENGTH_128
Definition vsf_template_dma.h:293
@ VSF_DMA_DST_WIDTH_BYTE_1
Definition vsf_template_dma.h:270
@ VSF_DMA_SRC_WIDTH_BYTES_16
Definition vsf_template_dma.h:267
@ VSF_DMA_DST_ADDR_NO_CHANGE
Definition vsf_template_dma.h:261
@ VSF_DMA_DST_BURST_LENGTH_4
Definition vsf_template_dma.h:288
@ VSF_DMA_DST_BURST_LENGTH_1
Definition vsf_template_dma.h:286
@ VSF_DMA_SRC_ADDR_INCREMENT
Definition vsf_template_dma.h:255
@ VSF_DMA_MEMORY_TO_PERIPHERAL
Definition vsf_template_dma.h:251
@ VSF_DMA_DST_BURST_LENGTH_32
Definition vsf_template_dma.h:291
@ VSF_DMA_SRC_BURST_LENGTH_4
Definition vsf_template_dma.h:279
@ VSF_DMA_SRC_BURST_LENGTH_128
Definition vsf_template_dma.h:284
@ VSF_DMA_PRIOPIRY_VERY_HIGH
Definition vsf_template_dma.h:299
@ VSF_DMA_SRC_WIDTH_BYTE_1
Definition vsf_template_dma.h:263
@ VSF_DMA_MEMORY_TO_MEMORY
Definition vsf_template_dma.h:250
@ VSF_DMA_SRC_WIDTH_BYTES_4
Definition vsf_template_dma.h:265
@ VSF_DMA_DST_WIDTH_BYTES_8
Definition vsf_template_dma.h:273
@ VSF_DMA_SRC_BURST_LENGTH_1
Definition vsf_template_dma.h:277
@ VSF_DMA_PERIPHERA_TO_MEMORY
Definition vsf_template_dma.h:252
@ VSF_DMA_DST_WIDTH_BYTES_2
Definition vsf_template_dma.h:271
@ VSF_DMA_DST_WIDTH_BYTES_4
Definition vsf_template_dma.h:272
@ VSF_DMA_PRIOPIRY_LOW
Definition vsf_template_dma.h:296
@ VSF_DMA_SRC_BURST_LENGTH_2
Definition vsf_template_dma.h:278
@ VSF_DMA_SRC_ADDR_DECREMENT
Definition vsf_template_dma.h:256
@ VSF_DMA_DST_BURST_LENGTH_8
Definition vsf_template_dma.h:289
@ VSF_DMA_PERIPHERA_TO_PERIPHERAL
Definition vsf_template_dma.h:253
@ VSF_DMA_SRC_ADDR_NO_CHANGE
Definition vsf_template_dma.h:257
@ VSF_DMA_DST_BURST_LENGTH_16
Definition vsf_template_dma.h:290
@ VSF_DMA_SRC_BURST_LENGTH_8
Definition vsf_template_dma.h:280
@ VSF_DMA_DST_BURST_LENGTH_2
Definition vsf_template_dma.h:287
@ VSF_DMA_SRC_WIDTH_BYTES_32
Definition vsf_template_dma.h:268
@ VSF_DMA_SRC_BURST_LENGTH_32
Definition vsf_template_dma.h:282
@ VSF_DMA_PRIOPIRY_HIGH
Definition vsf_template_dma.h:298
@ VSF_DMA_PRIOPIRY_MEDIUM
Definition vsf_template_dma.h:297
@ VSF_DMA_DST_ADDR_DECREMENT
Definition vsf_template_dma.h:260
@ VSF_DMA_DST_ADDR_INCREMENT
Definition vsf_template_dma.h:259
struct vsf_dma_isr_t vsf_dma_isr_t
vsf_err_t vsf_dma_channel_sg_start(vsf_dma_t *dma_ptr, uint8_t channel)
Start a DMA scatter-gather transfer.
Definition dma_common.c:137
void vsf_dma_isr_handler_t(void *target_ptr, vsf_dma_t *dma_ptr, int8_t channel, vsf_dma_irq_mask_t irq_mask)
Definition vsf_template_dma.h:427
struct vsf_dma_capability_t vsf_dma_capability_t
@ VSF_DMA_PRIOPIRY_COUNT
Definition vsf_template_dma.h:357
@ VSF_DMA_DST_WIDTH_MASK
Definition vsf_template_dma.h:330
@ VSF_DMA_SRC_WIDTH_MASK
Definition vsf_template_dma.h:322
@ VSF_DMA_MODE_ALL_BITS_MASK
Definition vsf_template_dma.h:364
@ VSF_DMA_DST_ADDR_MASK
Definition vsf_template_dma.h:317
@ VSF_DMA_SRC_BURST_MASK
Definition vsf_template_dma.h:338
@ VSF_DMA_DST_ADDR_COUNT
Definition vsf_template_dma.h:316
@ VSF_DMA_DIRECTION_COUNT
Definition vsf_template_dma.h:305
@ VSF_DMA_DST_BURST_COUNT
Definition vsf_template_dma.h:347
@ VSF_DMA_SRC_BURST_COUNT
Definition vsf_template_dma.h:337
@ VSF_DMA_SRC_ADDR_COUNT
Definition vsf_template_dma.h:311
@ VSF_DMA_SRC_ADDR_MASK
Definition vsf_template_dma.h:312
@ VSF_DMA_DST_WIDTH_COUNT
Definition vsf_template_dma.h:329
@ VSF_DMA_DIRECTION_MASK
Definition vsf_template_dma.h:306
@ VSF_DMA_SRC_WIDTH_COUNT
Definition vsf_template_dma.h:321
@ VSF_DMA_PRIOPIRY_MASK
Definition vsf_template_dma.h:358
@ VSF_DMA_MODE_MASK_COUNT
Definition vsf_template_dma.h:363
@ VSF_DMA_DST_BURST_MASK
Definition vsf_template_dma.h:348
struct vsf_dma_channel_status_t vsf_dma_channel_status_t
vsf_err_t vsf_dma_get_configuration(vsf_dma_t *dma_ptr, vsf_dma_cfg_t *cfg_ptr)
Get the current configuration of DMA instance.
Definition dma_common.c:56
vsf_err_t vsf_dma_channel_get_configuration(vsf_dma_t *dma_ptr, uint8_t channel, vsf_dma_channel_cfg_t *cfg_ptr)
Get the current configuration of a DMA channel.
Definition dma_common.c:103
@ VSF_DMA_IRQ_COUNT
Definition vsf_template_dma.h:384
@ VSF_DMA_IRQ_ALL_BITS_MASK
Definition vsf_template_dma.h:385
vsf_err_t vsf_dma_channel_start(vsf_dma_t *dma_ptr, uint8_t channel, uint32_t src_address, uint32_t dst_address, uint32_t count)
Start a DMA channel transfer.
Definition dma_common.c:114
void vsf_dma_channel_release(vsf_dma_t *dma_ptr, uint8_t channel)
Release a DMA channel.
Definition dma_common.c:84
vsf_err_t vsf_dma_init(vsf_dma_t *dma_ptr, vsf_dma_cfg_t *cfg_ptr)
Initialize a DMA instance.
Definition dma_common.c:38
vsf_err_t vsf_dma_channel_sg_config_desc(vsf_dma_t *dma_ptr, uint8_t channel, vsf_dma_isr_t isr, vsf_dma_channel_sg_desc_t *sg_desc_ptr, uint32_t sg_count)
Configure a DMA channel for scatter-gather transfer.
Definition dma_common.c:126
int8_t vsf_dma_channel_request(vsf_dma_t *dma_ptr, vsf_dma_channel_hint_t *channel_hint_ptr)
DMA request a new channel.
Definition dma_common.c:75
vsf_err_t vsf_dma_channel_cancel(vsf_dma_t *dma_ptr, uint8_t channel)
Cancel the transmission of a specific DMA channel.
Definition dma_common.c:146
void vsf_dma_fini(vsf_dma_t *dma_ptr)
Finalize a DMA instance.
Definition dma_common.c:47
vsf_err_t vsf_dma_channel_config(vsf_dma_t *dma_ptr, uint8_t channel, vsf_dma_channel_cfg_t *cfg_ptr)
Configure a DMA channel.
Definition dma_common.c:93
vsf_dma_irq_mask_t
Definition vsf_template_dma.h:376
@ VSF_DMA_IRQ_MASK_HALF_CPL
Definition vsf_template_dma.h:378
@ VSF_DMA_IRQ_MASK_CPL
Definition vsf_template_dma.h:377
@ VSF_DMA_IRQ_MASK_ERROR
Definition vsf_template_dma.h:379
vsf_dma_channel_status_t vsf_dma_channel_status(vsf_dma_t *dma_ptr, uint8_t channel)
Get status of a DMA channel.
Definition dma_common.c:164
struct vsf_dma_channel_cfg_t vsf_dma_channel_cfg_t
dma configuration
vsf_dma_capability_t vsf_dma_capability(vsf_dma_t *dma_ptr)
Get the capabilities of DMA instance.
Definition dma_common.c:66
uint32_t vsf_dma_channel_get_transferred_count(vsf_dma_t *dma_ptr, uint8_t channel)
Get the counter of bytes transferred for a specific DMA channel.
Definition dma_common.c:155
#define VSF_DMA_APIS(__prefix_name)
DMA API template, used to generate DMA type, specific prefix function declarations,...
Definition vsf_template_dma.h:230
Generated from commit: vsfteam/vsf@74aa6ce