EFR32 Blue Gecko 12 Software Documentation  efr32bg12-doc-5.1.2
dmadrv.h
Go to the documentation of this file.
1 /***************************************************************************/
16 #ifndef __SILICON_LABS_DMADRV_H__
17 #define __SILICON_LABS_DMADRV_H__
18 
19 #include "em_device.h"
20 #include "ecode.h"
21 
22 #if defined( DMA_PRESENT ) && ( DMA_COUNT == 1 )
23 #define EMDRV_DMADRV_UDMA
24 #define EMDRV_DMADRV_DMA_PRESENT
25 #include "em_dma.h"
26 #elif defined( LDMA_PRESENT ) && ( LDMA_COUNT == 1 )
27 #define EMDRV_DMADRV_LDMA
28 #define EMDRV_DMADRV_DMA_PRESENT
29 #include "em_ldma.h"
30 #else
31 #error "No valid DMA engine defined."
32 #endif
33 
34 #include "dmadrv_config.h"
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 /***************************************************************************/
45 /***************************************************************************/
50 #define ECODE_EMDRV_DMADRV_OK ( ECODE_OK )
51 #define ECODE_EMDRV_DMADRV_PARAM_ERROR ( ECODE_EMDRV_DMADRV_BASE | 0x00000001 )
52 #define ECODE_EMDRV_DMADRV_NOT_INITIALIZED ( ECODE_EMDRV_DMADRV_BASE | 0x00000002 )
53 #define ECODE_EMDRV_DMADRV_ALREADY_INITIALIZED ( ECODE_EMDRV_DMADRV_BASE | 0x00000003 )
54 #define ECODE_EMDRV_DMADRV_CHANNELS_EXHAUSTED ( ECODE_EMDRV_DMADRV_BASE | 0x00000004 )
55 #define ECODE_EMDRV_DMADRV_IN_USE ( ECODE_EMDRV_DMADRV_BASE | 0x00000005 )
56 #define ECODE_EMDRV_DMADRV_ALREADY_FREED ( ECODE_EMDRV_DMADRV_BASE | 0x00000006 )
57 #define ECODE_EMDRV_DMADRV_CH_NOT_ALLOCATED ( ECODE_EMDRV_DMADRV_BASE | 0x00000007 )
58 
59 /***************************************************************************/
80 typedef bool (*DMADRV_Callback_t)( unsigned int channel,
81  unsigned int sequenceNo,
82  void *userParam );
83 
84 #if defined( DMA_PRESENT ) && ( DMA_COUNT == 1 )
85 
87 #define DMADRV_MAX_XFER_COUNT ((int)((_DMA_CTRL_N_MINUS_1_MASK >> _DMA_CTRL_N_MINUS_1_SHIFT) + 1))
88 
90 typedef enum
91 {
93  #if defined( DMAREQ_ADC0_SCAN )
95  #endif
96  #if defined( DMAREQ_ADC0_SINGLE )
98  #endif
99  #if defined( DMAREQ_AES_DATARD )
100  dmadrvPeripheralSignal_AES_DATARD = DMAREQ_AES_DATARD,
101  #endif
102  #if defined( DMAREQ_AES_DATAWR )
103  dmadrvPeripheralSignal_AES_DATAWR = DMAREQ_AES_DATAWR,
104  #endif
105  #if defined( DMAREQ_AES_KEYWR )
106  dmadrvPeripheralSignal_AES_KEYWR = DMAREQ_AES_KEYWR,
107  #endif
108  #if defined( DMAREQ_AES_XORDATAWR )
109  dmadrvPeripheralSignal_AES_XORDATAWR = DMAREQ_AES_XORDATAWR,
110  #endif
111  #if defined( DMAREQ_DAC0_CH0 )
112  dmadrvPeripheralSignal_DAC0_CH0 = DMAREQ_DAC0_CH0,
113  #endif
114  #if defined( DMAREQ_DAC0_CH1 )
115  dmadrvPeripheralSignal_DAC0_CH1 = DMAREQ_DAC0_CH1,
116  #endif
117  #if defined( DMAREQ_EBI_DDEMPTY )
118  dmadrvPeripheralSignal_EBI_DDEMPTY = DMAREQ_EBI_DDEMPTY,
119  #endif
120  #if defined( DMAREQ_EBI_PXL0EMPTY )
121  dmadrvPeripheralSignal_EBI_PXL0EMPTY = DMAREQ_EBI_PXL0EMPTY,
122  #endif
123  #if defined( DMAREQ_EBI_PXL1EMPTY )
124  dmadrvPeripheralSignal_EBI_PXL1EMPTY = DMAREQ_EBI_PXL1EMPTY,
125  #endif
126  #if defined( DMAREQ_EBI_PXLFULL )
127  dmadrvPeripheralSignal_EBI_PXLFULL = DMAREQ_EBI_PXLFULL,
128  #endif
129  #if defined( DMAREQ_I2C0_RXDATAV )
131  #endif
132  #if defined( DMAREQ_I2C0_TXBL )
134  #endif
135  #if defined( DMAREQ_I2C1_RXDATAV )
136  dmadrvPeripheralSignal_I2C1_RXDATAV = DMAREQ_I2C1_RXDATAV,
137  #endif
138  #if defined( DMAREQ_I2C1_TXBL )
139  dmadrvPeripheralSignal_I2C1_TXBL = DMAREQ_I2C1_TXBL,
140  #endif
141  #if defined( DMAREQ_LESENSE_BUFDATAV )
142  dmadrvPeripheralSignal_LESENSE_BUFDATAV = DMAREQ_LESENSE_BUFDATAV,
143  #endif
144  #if defined( DMAREQ_LEUART0_RXDATAV )
146  #endif
147  #if defined( DMAREQ_LEUART0_TXBL )
149  #endif
150  #if defined( DMAREQ_LEUART0_TXEMPTY )
152  #endif
153  #if defined( DMAREQ_LEUART1_RXDATAV )
154  dmadrvPeripheralSignal_LEUART1_RXDATAV = DMAREQ_LEUART1_RXDATAV,
155  #endif
156  #if defined( DMAREQ_LEUART1_TXBL )
157  dmadrvPeripheralSignal_LEUART1_TXBL = DMAREQ_LEUART1_TXBL,
158  #endif
159  #if defined( DMAREQ_LEUART1_TXEMPTY )
160  dmadrvPeripheralSignal_LEUART1_TXEMPTY = DMAREQ_LEUART1_TXEMPTY,
161  #endif
162  #if defined( DMAREQ_MSC_WDATA )
164  #endif
165  #if defined( DMAREQ_TIMER0_CC0 )
167  #endif
168  #if defined( DMAREQ_TIMER0_CC1 )
170  #endif
171  #if defined( DMAREQ_TIMER0_CC2 )
173  #endif
174  #if defined( DMAREQ_TIMER0_UFOF )
176  #endif
177  #if defined( DMAREQ_TIMER1_CC0 )
179  #endif
180  #if defined( DMAREQ_TIMER1_CC1 )
182  #endif
183  #if defined( DMAREQ_TIMER1_CC2 )
185  #endif
186  #if defined( DMAREQ_TIMER1_UFOF )
188  #endif
189  #if defined( DMAREQ_TIMER2_CC0 )
190  dmadrvPeripheralSignal_TIMER2_CC0 = DMAREQ_TIMER2_CC0,
191  #endif
192  #if defined( DMAREQ_TIMER2_CC1 )
193  dmadrvPeripheralSignal_TIMER2_CC1 = DMAREQ_TIMER2_CC1,
194  #endif
195  #if defined( DMAREQ_TIMER2_CC2 )
196  dmadrvPeripheralSignal_TIMER2_CC2 = DMAREQ_TIMER2_CC2,
197  #endif
198  #if defined( DMAREQ_TIMER2_UFOF )
199  dmadrvPeripheralSignal_TIMER2_UFOF = DMAREQ_TIMER2_UFOF,
200  #endif
201  #if defined( DMAREQ_TIMER3_CC0 )
202  dmadrvPeripheralSignal_TIMER3_CC0 = DMAREQ_TIMER3_CC0,
203  #endif
204  #if defined( DMAREQ_TIMER3_CC1 )
205  dmadrvPeripheralSignal_TIMER3_CC1 = DMAREQ_TIMER3_CC1,
206  #endif
207  #if defined( DMAREQ_TIMER3_CC2 )
208  dmadrvPeripheralSignal_TIMER3_CC2 = DMAREQ_TIMER3_CC2,
209  #endif
210  #if defined( DMAREQ_TIMER3_UFOF )
211  dmadrvPeripheralSignal_TIMER3_UFOF = DMAREQ_TIMER3_UFOF,
212  #endif
213  #if defined( DMAREQ_UART0_RXDATAV )
214  dmadrvPeripheralSignal_UART0_RXDATAV = DMAREQ_UART0_RXDATAV,
215  #endif
216  #if defined( DMAREQ_UART0_TXBL )
217  dmadrvPeripheralSignal_UART0_TXBL = DMAREQ_UART0_TXBL,
218  #endif
219  #if defined( DMAREQ_UART0_TXEMPTY )
220  dmadrvPeripheralSignal_UART0_TXEMPTY = DMAREQ_UART0_TXEMPTY,
221  #endif
222  #if defined( DMAREQ_UART1_RXDATAV )
223  dmadrvPeripheralSignal_UART1_RXDATAV = DMAREQ_UART1_RXDATAV,
224  #endif
225  #if defined( DMAREQ_UART1_TXBL )
226  dmadrvPeripheralSignal_UART1_TXBL = DMAREQ_UART1_TXBL,
227  #endif
228  #if defined( DMAREQ_UART1_TXEMPTY )
229  dmadrvPeripheralSignal_UART1_TXEMPTY = DMAREQ_UART1_TXEMPTY,
230  #endif
231  #if defined( DMAREQ_USART0_RXDATAV )
233  #endif
234  #if defined( DMAREQ_USART0_TXBL )
236  #endif
237  #if defined( DMAREQ_USART0_TXEMPTY )
239  #endif
240  #if defined( DMAREQ_USARTRF0_RXDATAV )
241  dmadrvPeripheralSignal_USARTRF0_RXDATAV = DMAREQ_USARTRF0_RXDATAV,
242  #endif
243  #if defined( DMAREQ_USARTRF0_TXBL )
244  dmadrvPeripheralSignal_USARTRF0_TXBL = DMAREQ_USARTRF0_TXBL,
245  #endif
246  #if defined( DMAREQ_USARTRF0_TXEMPTY )
247  dmadrvPeripheralSignal_USARTRF0_TXEMPTY = DMAREQ_USARTRF0_TXEMPTY,
248  #endif
249  #if defined( DMAREQ_USARTRF1_RXDATAV )
250  dmadrvPeripheralSignal_USARTRF1_RXDATAV = DMAREQ_USARTRF1_RXDATAV,
251  #endif
252  #if defined( DMAREQ_USARTRF1_TXBL )
253  dmadrvPeripheralSignal_USARTRF1_TXBL = DMAREQ_USARTRF1_TXBL,
254  #endif
255  #if defined( DMAREQ_USARTRF1_TXEMPTY )
256  dmadrvPeripheralSignal_USARTRF1_TXEMPTY = DMAREQ_USARTRF1_TXEMPTY,
257  #endif
258  #if defined( DMAREQ_USART1_RXDATAV )
260  #endif
261  #if defined( DMAREQ_USART1_RXDATAVRIGHT )
263  #endif
264  #if defined( DMAREQ_USART1_TXBL )
266  #endif
267  #if defined( DMAREQ_USART1_TXBLRIGHT )
269  #endif
270  #if defined( DMAREQ_USART1_TXEMPTY )
272  #endif
273  #if defined( DMAREQ_USART2_RXDATAV )
275  #endif
276  #if defined( DMAREQ_USART2_RXDATAVRIGHT )
277  dmadrvPeripheralSignal_USART2_RXDATAVRIGHT = DMAREQ_USART2_RXDATAVRIGHT,
278  #endif
279  #if defined( DMAREQ_USART2_TXBL )
281  #endif
282  #if defined( DMAREQ_USART2_TXBLRIGHT )
283  dmadrvPeripheralSignal_USART2_TXBLRIGHT = DMAREQ_USART2_TXBLRIGHT,
284  #endif
285  #if defined( DMAREQ_USART2_TXEMPTY )
287  #endif
288 #ifdef DOXY_DOC_ONLY
289 } DMADRV_Peripheralsignal_t;
290 #else
292 #endif
293 
295 typedef enum
296 {
297  dmadrvDataSize1 = dmaDataSize1,
298  dmadrvDataSize2 = dmaDataSize2,
299  dmadrvDataSize4 = dmaDataSize4
300 #ifdef DOXY_DOC_ONLY
301 } DMADRV_Datasize_t;
302 #else
304 #endif
305 
306 #endif // defined( DMA_PRESENT ) && ( DMA_COUNT == 1 )
307 
308 #if defined( LDMA_PRESENT ) && ( LDMA_COUNT == 1 )
309 
311 #define DMADRV_MAX_XFER_COUNT ((int)((_LDMA_CH_CTRL_XFERCNT_MASK >> _LDMA_CH_CTRL_XFERCNT_SHIFT) + 1))
312 
314 typedef enum
315 {
317  #if defined( LDMA_CH_REQSEL_SIGSEL_ADC0SCAN )
319  #endif
320  #if defined( LDMA_CH_REQSEL_SIGSEL_ADC0SINGLE )
322  #endif
323  #if defined( LDMA_CH_REQSEL_SIGSEL_AGCRSSI )
324  dmadrvPeripheralSignal_AGC_RSSI = LDMA_CH_REQSEL_SIGSEL_AGCRSSI | LDMA_CH_REQSEL_SOURCESEL_AGC,
325  #endif
326  #if defined( LDMA_CH_REQSEL_SIGSEL_CRYPTODATA0RD )
327  dmadrvPeripheralSignal_CRYPTO_DATA0RD = LDMA_CH_REQSEL_SIGSEL_CRYPTODATA0RD | LDMA_CH_REQSEL_SOURCESEL_CRYPTO,
328  #endif
329  #if defined( LDMA_CH_REQSEL_SIGSEL_CRYPTODATA0WR )
330  dmadrvPeripheralSignal_CRYPTO_DATA0WR = LDMA_CH_REQSEL_SIGSEL_CRYPTODATA0WR | LDMA_CH_REQSEL_SOURCESEL_CRYPTO,
331  #endif
332  #if defined( LDMA_CH_REQSEL_SIGSEL_CRYPTODATA0XWR )
333  dmadrvPeripheralSignal_CRYPTO_DATA0XWR = LDMA_CH_REQSEL_SIGSEL_CRYPTODATA0XWR | LDMA_CH_REQSEL_SOURCESEL_CRYPTO,
334  #endif
335  #if defined( LDMA_CH_REQSEL_SIGSEL_CRYPTODATA1RD )
336  dmadrvPeripheralSignal_CRYPTO_DATA1RD = LDMA_CH_REQSEL_SIGSEL_CRYPTODATA1RD | LDMA_CH_REQSEL_SOURCESEL_CRYPTO,
337  #endif
338  #if defined( LDMA_CH_REQSEL_SIGSEL_CRYPTODATA1WR )
339  dmadrvPeripheralSignal_CRYPTO_DATA1WR = LDMA_CH_REQSEL_SIGSEL_CRYPTODATA1WR | LDMA_CH_REQSEL_SOURCESEL_CRYPTO,
340  #endif
341  #if defined( LDMA_CH_REQSEL_SIGSEL_CRYPTO0DATA0RD )
343  #endif
344  #if defined( LDMA_CH_REQSEL_SIGSEL_CRYPTO0DATA0WR )
346  #endif
347  #if defined( LDMA_CH_REQSEL_SIGSEL_CRYPTO0DATA0XWR )
349  #endif
350  #if defined( LDMA_CH_REQSEL_SIGSEL_CRYPTO0DATA1RD )
352  #endif
353  #if defined( LDMA_CH_REQSEL_SIGSEL_CRYPTO0DATA1WR )
355  #endif
356  #if defined( LDMA_CH_REQSEL_SIGSEL_CRYPTO1DATA0RD )
358  #endif
359  #if defined( LDMA_CH_REQSEL_SIGSEL_CRYPTO1DATA0WR )
361  #endif
362  #if defined( LDMA_CH_REQSEL_SIGSEL_CRYPTO1DATA0XWR )
364  #endif
365  #if defined( LDMA_CH_REQSEL_SIGSEL_CRYPTO1DATA1RD )
367  #endif
368  #if defined( LDMA_CH_REQSEL_SIGSEL_CRYPTO1DATA1WR )
370  #endif
371  #if defined( LDMA_CH_REQSEL_SIGSEL_I2C0RXDATAV )
373  #endif
374  #if defined( LDMA_CH_REQSEL_SIGSEL_I2C0TXBL )
376  #endif
377  #if defined( LDMA_CH_REQSEL_SIGSEL_LEUART0RXDATAV )
379  #endif
380  #if defined( LDMA_CH_REQSEL_SIGSEL_LEUART0TXBL )
382  #endif
383  #if defined( LDMA_CH_REQSEL_SIGSEL_LEUART0TXEMPTY )
385  #endif
386  #if defined( LDMA_CH_REQSEL_SIGSEL_MODEMDEBUG )
387  dmadrvPeripheralSignal_MODEM_DEBUG = LDMA_CH_REQSEL_SIGSEL_MODEMDEBUG | LDMA_CH_REQSEL_SOURCESEL_MODEM,
388  #endif
389  #if defined( LDMA_CH_REQSEL_SIGSEL_MSCWDATA )
391  #endif
392  #if defined( LDMA_CH_REQSEL_SIGSEL_PROTIMERBOF )
393  dmadrvPeripheralSignal_PROTIMER_BOF = LDMA_CH_REQSEL_SIGSEL_PROTIMERBOF | LDMA_CH_REQSEL_SOURCESEL_PROTIMER,
394  #endif
395  #if defined( LDMA_CH_REQSEL_SIGSEL_PROTIMERCC0 )
396  dmadrvPeripheralSignal_PROTIMER_CC0 = LDMA_CH_REQSEL_SIGSEL_PROTIMERCC0 | LDMA_CH_REQSEL_SOURCESEL_PROTIMER,
397  #endif
398  #if defined( LDMA_CH_REQSEL_SIGSEL_PROTIMERCC1 )
399  dmadrvPeripheralSignal_PROTIMER_CC1 = LDMA_CH_REQSEL_SIGSEL_PROTIMERCC1 | LDMA_CH_REQSEL_SOURCESEL_PROTIMER,
400  #endif
401  #if defined( LDMA_CH_REQSEL_SIGSEL_PROTIMERCC2 )
402  dmadrvPeripheralSignal_PROTIMER_CC2 = LDMA_CH_REQSEL_SIGSEL_PROTIMERCC2 | LDMA_CH_REQSEL_SOURCESEL_PROTIMER,
403  #endif
404  #if defined( LDMA_CH_REQSEL_SIGSEL_PROTIMERCC3 )
405  dmadrvPeripheralSignal_PROTIMER_CC3 = LDMA_CH_REQSEL_SIGSEL_PROTIMERCC3 | LDMA_CH_REQSEL_SOURCESEL_PROTIMER,
406  #endif
407  #if defined( LDMA_CH_REQSEL_SIGSEL_PROTIMERCC4 )
408  dmadrvPeripheralSignal_PROTIMER_CC4 = LDMA_CH_REQSEL_SIGSEL_PROTIMERCC4 | LDMA_CH_REQSEL_SOURCESEL_PROTIMER,
409  #endif
410  #if defined( LDMA_CH_REQSEL_SIGSEL_PROTIMERPOF )
411  dmadrvPeripheralSignal_PROTIMER_POF = LDMA_CH_REQSEL_SIGSEL_PROTIMERPOF | LDMA_CH_REQSEL_SOURCESEL_PROTIMER,
412  #endif
413  #if defined( LDMA_CH_REQSEL_SIGSEL_PROTIMERWOF )
414  dmadrvPeripheralSignal_PROTIMER_WOF = LDMA_CH_REQSEL_SIGSEL_PROTIMERWOF | LDMA_CH_REQSEL_SOURCESEL_PROTIMER,
415  #endif
416  #if defined( LDMA_CH_REQSEL_SIGSEL_PRSREQ0 )
418  #endif
419  #if defined( LDMA_CH_REQSEL_SIGSEL_PRSREQ1 )
421  #endif
422  #if defined( LDMA_CH_REQSEL_SIGSEL_TIMER0CC0 )
424  #endif
425  #if defined( LDMA_CH_REQSEL_SIGSEL_TIMER0CC1 )
427  #endif
428  #if defined( LDMA_CH_REQSEL_SIGSEL_TIMER0CC2 )
430  #endif
431  #if defined( LDMA_CH_REQSEL_SIGSEL_TIMER0UFOF )
433  #endif
434  #if defined( LDMA_CH_REQSEL_SIGSEL_TIMER1CC0 )
436  #endif
437  #if defined( LDMA_CH_REQSEL_SIGSEL_TIMER1CC1 )
439  #endif
440  #if defined( LDMA_CH_REQSEL_SIGSEL_TIMER1CC2 )
442  #endif
443  #if defined( LDMA_CH_REQSEL_SIGSEL_TIMER1CC3 )
445  #endif
446  #if defined( LDMA_CH_REQSEL_SIGSEL_TIMER1UFOF )
448  #endif
449  #if defined( LDMA_CH_REQSEL_SIGSEL_USART0RXDATAV )
451  #endif
452  #if defined( LDMA_CH_REQSEL_SIGSEL_USART0TXBL )
454  #endif
455  #if defined( LDMA_CH_REQSEL_SIGSEL_USART0TXEMPTY )
457  #endif
458  #if defined( LDMA_CH_REQSEL_SIGSEL_USART1RXDATAV )
460  #endif
461  #if defined( LDMA_CH_REQSEL_SIGSEL_USART1RXDATAVRIGHT )
463  #endif
464  #if defined( LDMA_CH_REQSEL_SIGSEL_USART1TXBL )
466  #endif
467  #if defined( LDMA_CH_REQSEL_SIGSEL_USART1TXBLRIGHT )
469  #endif
470  #if defined( LDMA_CH_REQSEL_SIGSEL_USART1TXEMPTY )
472  #endif
473  #if defined( LDMA_CH_REQSEL_SIGSEL_USART2RXDATAV )
475  #endif
476  #if defined( LDMA_CH_REQSEL_SIGSEL_USART2RXDATAVRIGHT )
477  dmadrvPeripheralSignal_USART2_RXDATAVRIGHT = LDMA_CH_REQSEL_SIGSEL_USART2RXDATAVRIGHT | LDMA_CH_REQSEL_SOURCESEL_USART2,
478  #endif
479  #if defined( LDMA_CH_REQSEL_SIGSEL_USART2TXBL )
481  #endif
482  #if defined( LDMA_CH_REQSEL_SIGSEL_USART2TXBLRIGHT )
483  dmadrvPeripheralSignal_USART2_TXBLRIGHT = LDMA_CH_REQSEL_SIGSEL_USART2TXBLRIGHT | LDMA_CH_REQSEL_SOURCESEL_USART2,
484  #endif
485  #if defined( LDMA_CH_REQSEL_SIGSEL_USART2TXEMPTY )
487  #endif
488  #if defined( LDMA_CH_REQSEL_SIGSEL_USART3RXDATAV )
490  #endif
491  #if defined( LDMA_CH_REQSEL_SIGSEL_USART3RXDATAVRIGHT )
493  #endif
494  #if defined( LDMA_CH_REQSEL_SIGSEL_USART3TXBL )
496  #endif
497  #if defined( LDMA_CH_REQSEL_SIGSEL_USART3TXBLRIGHT )
499  #endif
500  #if defined( LDMA_CH_REQSEL_SIGSEL_USART3TXEMPTY )
502  #endif
503 
504 
506 
508 typedef enum
509 {
514 
515 #endif /* defined( LDMA_PRESENT ) && ( LDMA_COUNT == 1 ) */
516 
517 Ecode_t DMADRV_AllocateChannel( unsigned int *channelId, void *capabilities );
518 Ecode_t DMADRV_DeInit( void );
519 Ecode_t DMADRV_FreeChannel( unsigned int channelId );
520 Ecode_t DMADRV_Init( void );
521 
522 #if !defined( EMDRV_DMADRV_USE_NATIVE_API ) || defined( DOXY_DOC_ONLY )
523 Ecode_t DMADRV_MemoryPeripheral( unsigned int channelId,
525  peripheralSignal,
526  void *dst,
527  void *src,
528  bool srcInc,
529  int len,
530  DMADRV_DataSize_t size,
531  DMADRV_Callback_t callback,
532  void *cbUserParam );
533 Ecode_t DMADRV_PeripheralMemory( unsigned int channelId,
535  peripheralSignal,
536  void *dst,
537  void *src,
538  bool dstInc,
539  int len,
540  DMADRV_DataSize_t size,
541  DMADRV_Callback_t callback,
542  void *cbUserParam );
544  unsigned int channelId,
546  peripheralSignal,
547  void *dst,
548  void *src0,
549  void *src1,
550  bool srcInc,
551  int len,
552  DMADRV_DataSize_t size,
553  DMADRV_Callback_t callback,
554  void *cbUserParam );
556  unsigned int channelId,
558  peripheralSignal,
559  void *dst0,
560  void *dst1,
561  void *src,
562  bool dstInc,
563  int len,
564  DMADRV_DataSize_t size,
565  DMADRV_Callback_t callback,
566  void *cbUserParam );
567 #endif
568 
569 #if defined( EMDRV_DMADRV_LDMA ) && defined( EMDRV_DMADRV_USE_NATIVE_API )
570 
572  int channelId,
573  LDMA_TransferCfg_t *transfer,
574  LDMA_Descriptor_t *descriptor,
575  DMADRV_Callback_t callback,
576  void *cbUserParam );
577 
578 #endif /* !defined( EMDRV_DMADRV_USE_NATIVE_API ) */
579 
580 Ecode_t DMADRV_PauseTransfer( unsigned int channelId );
581 Ecode_t DMADRV_ResumeTransfer( unsigned int channelId );
582 Ecode_t DMADRV_StopTransfer( unsigned int channelId );
583 Ecode_t DMADRV_TransferActive( unsigned int channelId, bool *active );
584 Ecode_t DMADRV_TransferCompletePending( unsigned int channelId, bool *pending );
585 Ecode_t DMADRV_TransferDone( unsigned int channelId, bool *done );
586 Ecode_t DMADRV_TransferRemainingCount( unsigned int channelId,
587  int *remaining );
588 
592 #ifdef __cplusplus
593 }
594 #endif
595 
596 #endif /* __SILICON_LABS_DMADRV_H__ */
Trig on TIMER1_UFOF.
Definition: dmadrv.h:447
Byte.
Definition: dmadrv.h:510
DMA transfer configuration structure.
Definition: em_ldma.h:564
#define DMAREQ_TIMER0_CC0
Trig on USART1_RXDATAV.
Definition: dmadrv.h:459
Trig on USART2_TXBL.
Definition: dmadrv.h:480
Trig on USART2_TXEMPTY.
Definition: dmadrv.h:486
Trig on CRYPTO0_DATA0XWR.
Definition: dmadrv.h:348
#define DMAREQ_TIMER0_UFOF
#define DMAREQ_I2C0_TXBL
#define LDMA_CH_REQSEL_SIGSEL_CRYPTO0DATA0WR
#define DMAREQ_TIMER1_CC2
Trig on CRYPTO1_DATA0RD.
Definition: dmadrv.h:357
#define LDMA_CH_REQSEL_SIGSEL_LEUART0TXEMPTY
Trig on TIMER0_UFOF.
Definition: dmadrv.h:432
#define LDMA_CH_REQSEL_SOURCESEL_USART3
Ecode_t DMADRV_PeripheralMemory(unsigned int channelId, DMADRV_PeripheralSignal_t peripheralSignal, void *dst, void *src, bool dstInc, int len, DMADRV_DataSize_t size, DMADRV_Callback_t callback, void *cbUserParam)
Start a peripheral to memory DMA transfer.
Definition: dmadrv.c:539
#define LDMA_CH_REQSEL_SOURCESEL_ADC0
Trig on ADC0_SCAN.
Definition: dmadrv.h:318
Ecode_t DMADRV_TransferActive(unsigned int channelId, bool *active)
Check if a transfer is running.
Definition: dmadrv.c:759
Trig on USART0_RXDATAV.
Definition: dmadrv.h:450
Energy Aware drivers error code definitions.
#define DMAREQ_I2C1_TXBL
Trig on MSC_WDATA.
Definition: dmadrv.h:390
bool(* DMADRV_Callback_t)(unsigned int channel, unsigned int sequenceNo, void *userParam)
DMADRV transfer completion callback function.
Definition: dmadrv.h:80
#define DMAREQ_ADC0_SINGLE
Trig on USART1_TXEMPTY.
Definition: dmadrv.h:471
#define DMAREQ_ADC0_SCAN
#define LDMA_CH_REQSEL_SIGSEL_USART0RXDATAV
Ecode_t DMADRV_StopTransfer(unsigned int channelId)
Stop an ongoing DMA transfer.
Definition: dmadrv.c:719
#define DMAREQ_USART0_TXEMPTY
#define LDMA_CH_REQSEL_SIGSEL_TIMER1UFOF
#define DMAREQ_USART2_TXEMPTY
#define LDMA_CH_REQSEL_SIGSEL_TIMER0UFOF
#define LDMA_CH_REQSEL_SOURCESEL_I2C0
Trig on CRYPTO0_DATA1RD.
Definition: dmadrv.h:351
#define DMAREQ_I2C0_RXDATAV
CMSIS Cortex-M Peripheral Access Layer for Silicon Laboratories microcontroller devices.
#define LDMA_CH_REQSEL_SIGSEL_USART2TXBL
DMADRV_DataSize_t
Data size of one LDMA transfer item.
Definition: dmadrv.h:508
#define DMAREQ_USART2_RXDATAV
#define LDMA_CH_REQSEL_SOURCESEL_TIMER1
#define DMAREQ_LEUART0_RXDATAV
#define LDMA_CH_REQSEL_SIGSEL_TIMER1CC3
#define LDMA_CH_REQSEL_SIGSEL_USART0TXEMPTY
#define LDMA_CH_REQSEL_SIGSEL_TIMER1CC0
#define LDMA_CH_REQSEL_SIGSEL_USART1RXDATAV
#define LDMA_CH_REQSEL_SIGSEL_USART1TXBLRIGHT
#define LDMA_CH_REQSEL_SIGSEL_USART1TXEMPTY
#define LDMA_CH_REQSEL_SIGSEL_CRYPTO0DATA1WR
Ecode_t DMADRV_TransferDone(unsigned int channelId, bool *done)
Check if a transfer has completed.
Definition: dmadrv.c:864
Trig on PRS_REQ1.
Definition: dmadrv.h:420
#define LDMA_CH_REQSEL_SIGSEL_PRSREQ0
#define DMAREQ_USART0_TXBL
#define LDMA_CH_REQSEL_SIGSEL_CRYPTO1DATA0WR
#define DMAREQ_LEUART0_TXBL
#define LDMA_CH_REQSEL_SIGSEL_TIMER1CC1
Trig on ADC0_SINGLE.
Definition: dmadrv.h:321
Trig on TIMER0_CC2.
Definition: dmadrv.h:429
#define LDMA_CH_REQSEL_SOURCESEL_TIMER0
Trig on CRYPTO1_DATA1WR.
Definition: dmadrv.h:369
#define LDMA_CH_REQSEL_SIGSEL_USART3TXBLRIGHT
#define DMAREQ_USART0_RXDATAV
#define LDMA_CH_REQSEL_SIGSEL_CRYPTO1DATA1WR
Trig on USART1_TXBLRIGHT.
Definition: dmadrv.h:468
Ecode_t DMADRV_TransferRemainingCount(unsigned int channelId, int *remaining)
Get number of items remaining in a transfer.
Definition: dmadrv.c:930
#define LDMA_CH_REQSEL_SIGSEL_LEUART0RXDATAV
Ecode_t DMADRV_ResumeTransfer(unsigned int channelId)
Resume an ongoing DMA transfer.
Definition: dmadrv.c:682
Trig on USART0_TXEMPTY.
Definition: dmadrv.h:456
#define DMAREQ_TIMER0_CC2
#define LDMA_CH_REQSEL_SIGSEL_TIMER0CC1
Halfword.
Definition: dmadrv.h:511
#define LDMA_CH_REQSEL_SIGSEL_TIMER1CC2
#define LDMA_CH_REQSEL_SIGSEL_MSCWDATA
Trig on TIMER0_CC1.
Definition: dmadrv.h:426
Ecode_t DMADRV_LdmaStartTransfer(int channelId, LDMA_TransferCfg_t *transfer, LDMA_Descriptor_t *descriptor, DMADRV_Callback_t callback, void *cbUserParam)
Start a LDMA transfer.
Definition: dmadrv.c:335
Trig on USART1_TXBL.
Definition: dmadrv.h:465
#define LDMA_CH_REQSEL_SOURCESEL_CRYPTO0
#define LDMA_CH_REQSEL_SIGSEL_ADC0SINGLE
Word.
Definition: dmadrv.h:512
Trig on USART3_TXBLRIGHT.
Definition: dmadrv.h:498
Ecode_t DMADRV_MemoryPeripheralPingPong(unsigned int channelId, DMADRV_PeripheralSignal_t peripheralSignal, void *dst, void *src0, void *src1, bool srcInc, int len, DMADRV_DataSize_t size, DMADRV_Callback_t callback, void *cbUserParam)
Start a memory to peripheral ping-pong DMA transfer.
Definition: dmadrv.c:473
#define LDMA_CH_REQSEL_SIGSEL_I2C0TXBL
Trig on USART2_RXDATAV.
Definition: dmadrv.h:474
uint32_t Ecode_t
Typedef for API function error code return values.
Definition: ecode.h:51
Trig on USART0_TXBL.
Definition: dmadrv.h:453
No peripheral selected for DMA triggering.
Definition: dmadrv.h:316
Trig on USART1_RXDATAVRIGHT.
Definition: dmadrv.h:462
#define LDMA_CH_REQSEL_SIGSEL_USART2RXDATAV
Trig on CRYPTO1_DATA1RD.
Definition: dmadrv.h:366
#define LDMA_CH_REQSEL_SIGSEL_TIMER0CC0
#define DMAREQ_TIMER0_CC1
Ecode_t DMADRV_Init(void)
Initialize DMADRV.
Definition: dmadrv.c:262
Trig on CRYPTO1_DATA0XWR.
Definition: dmadrv.h:363
#define LDMA_CH_REQSEL_SIGSEL_TIMER0CC2
#define LDMA_CH_REQSEL_SIGSEL_PRSREQ1
#define LDMA_CH_REQSEL_SIGSEL_USART1TXBL
#define LDMA_CH_REQSEL_SOURCESEL_NONE
Trig on CRYPTO0_DATA0WR.
Definition: dmadrv.h:345
Trig on PRS_REQ0.
Definition: dmadrv.h:417
#define LDMA_CH_REQSEL_SOURCESEL_LEUART0
#define DMAREQ_TIMER1_UFOF
Trig on USART3_TXEMPTY.
Definition: dmadrv.h:501
#define LDMA_CH_REQSEL_SIGSEL_CRYPTO0DATA0RD
Direct memory access (LDMA) API.
Trig on USART3_TXBL.
Definition: dmadrv.h:495
DMA descriptor.
Definition: em_ldma.h:456
#define LDMA_CH_REQSEL_SIGSEL_USART3RXDATAVRIGHT
#define LDMA_CH_REQSEL_SIGSEL_USART0TXBL
#define LDMA_CH_REQSEL_SIGSEL_ADC0SCAN
Ecode_t DMADRV_DeInit(void)
Deinitialize DMADRV.
Definition: dmadrv.c:177
#define LDMA_CH_REQSEL_SIGSEL_USART3TXBL
#define DMAREQ_USART1_TXBL
Trig on CRYPTO0_DATA1WR.
Definition: dmadrv.h:354
#define DMAREQ_LESENSE_BUFDATAV
#define DMAREQ_I2C1_RXDATAV
Ecode_t DMADRV_AllocateChannel(unsigned int *channelId, void *capabilities)
Allocate (reserve) a DMA channel.
Definition: dmadrv.c:131
Trig on TIMER1_CC2.
Definition: dmadrv.h:441
Trig on I2C0_TXBL.
Definition: dmadrv.h:375
#define LDMA_CH_REQSEL_SIGSEL_CRYPTO1DATA0XWR
#define LDMA_CH_REQSEL_SIGSEL_USART3RXDATAV
#define LDMA_CH_REQSEL_SIGSEL_USART3TXEMPTY
#define DMAREQ_USART2_TXBL
#define DMAREQ_USART1_RXDATAVRIGHT
Ecode_t DMADRV_MemoryPeripheral(unsigned int channelId, DMADRV_PeripheralSignal_t peripheralSignal, void *dst, void *src, bool srcInc, int len, DMADRV_DataSize_t size, DMADRV_Callback_t callback, void *cbUserParam)
Start a memory to peripheral DMA transfer.
Definition: dmadrv.c:406
#define DMAREQ_LEUART0_TXEMPTY
DMADRV_PeripheralSignal_t
Peripherals that can trigger LDMA transfers.
Definition: dmadrv.h:314
Trig on I2C0_RXDATAV.
Definition: dmadrv.h:372
Trig on CRYPTO0_DATA0RD.
Definition: dmadrv.h:342
Trig on TIMER0_CC0.
Definition: dmadrv.h:423
Trig on TIMER1_CC3.
Definition: dmadrv.h:444
#define DMAREQ_USART1_TXBLRIGHT
Ecode_t DMADRV_TransferCompletePending(unsigned int channelId, bool *pending)
Check if a transfer complete is pending.
Definition: dmadrv.c:811
Trig on TIMER1_CC0.
Definition: dmadrv.h:435
#define DMAREQ_MSC_WDATA
#define DMAREQ_USART1_RXDATAV
Trig on USART3_RXDATAVRIGHT.
Definition: dmadrv.h:492
#define LDMA_CH_REQSEL_SOURCESEL_CRYPTO1
#define LDMA_CH_REQSEL_SOURCESEL_USART2
#define LDMA_CH_REQSEL_SIGSEL_I2C0RXDATAV
#define LDMA_CH_REQSEL_SIGSEL_USART2TXEMPTY
#define LDMA_CH_REQSEL_SIGSEL_CRYPTO1DATA1RD
#define LDMA_CH_REQSEL_SOURCESEL_MSC
#define LDMA_CH_REQSEL_SOURCESEL_PRS
#define LDMA_CH_REQSEL_SIGSEL_CRYPTO0DATA1RD
#define LDMA_CH_REQSEL_SIGSEL_LEUART0TXBL
#define DMAREQ_TIMER1_CC0
Trig on LEUART0_TXEMPTY.
Definition: dmadrv.h:384
Trig on LEUART0_TXBL.
Definition: dmadrv.h:381
Ecode_t DMADRV_PeripheralMemoryPingPong(unsigned int channelId, DMADRV_PeripheralSignal_t peripheralSignal, void *dst0, void *dst1, void *src, bool dstInc, int len, DMADRV_DataSize_t size, DMADRV_Callback_t callback, void *cbUserParam)
Start a peripheral to memory ping-pong DMA transfer.
Definition: dmadrv.c:606
Trig on LEUART0_RXDATAV.
Definition: dmadrv.h:378
Direct memory access (DMA) API.
Trig on USART3_RXDATAV.
Definition: dmadrv.h:489
Trig on CRYPTO1_DATA0WR.
Definition: dmadrv.h:360
#define DMAREQ_USART1_TXEMPTY
#define LDMA_CH_REQSEL_SOURCESEL_USART0
#define LDMA_CH_REQSEL_SIGSEL_CRYPTO1DATA0RD
#define LDMA_CH_REQSEL_SOURCESEL_USART1
Ecode_t DMADRV_PauseTransfer(unsigned int channelId)
Pause an ongoing DMA transfer.
Definition: dmadrv.c:645
Ecode_t DMADRV_FreeChannel(unsigned int channelId)
Free an allocate (reserved) DMA channel.
Definition: dmadrv.c:225
#define LDMA_CH_REQSEL_SIGSEL_USART1RXDATAVRIGHT
#define LDMA_CH_REQSEL_SIGSEL_CRYPTO0DATA0XWR
Trig on TIMER1_CC1.
Definition: dmadrv.h:438
#define DMAREQ_TIMER1_CC1