MSP430 DriverLib for MSP430FR5xx_6xx Devices  2.21.00.08
 All Data Structures Functions Variables Modules Pages
dma.h
1 //*****************************************************************************
2 //
3 // dma.h - Driver for the DMA Module.
4 //
5 //*****************************************************************************
6 
7 #ifndef __MSP430WARE_DMA_H__
8 #define __MSP430WARE_DMA_H__
9 
10 #include "inc/hw_memmap.h"
11 
12 #if defined(__MSP430_HAS_DMAX_3__) || defined(__MSP430_HAS_DMAX_6__)
13 
14 //*****************************************************************************
15 //
16 // If building with a C++ compiler, make all of the definitions in this header
17 // have a C binding.
18 //
19 //*****************************************************************************
20 #ifdef __cplusplus
21 extern "C"
22 {
23 #endif
24 
25 #include "inc/hw_memmap.h"
26 //*****************************************************************************
27 //
28 //! \brief Used in the DMA_init() function as the param parameter.
29 //
30 //*****************************************************************************
31 typedef struct DMA_initParam {
32  //! Is the specified channel to initialize.
33  //! \n Valid values are:
34  //! - \b DMA_CHANNEL_0
35  //! - \b DMA_CHANNEL_1
36  //! - \b DMA_CHANNEL_2
37  //! - \b DMA_CHANNEL_3
38  //! - \b DMA_CHANNEL_4
39  //! - \b DMA_CHANNEL_5
40  //! - \b DMA_CHANNEL_6
41  //! - \b DMA_CHANNEL_7
42  uint8_t channelSelect;
43  //! Is the transfer mode of the selected channel.
44  //! \n Valid values are:
45  //! - \b DMA_TRANSFER_SINGLE [Default] - Single transfer, transfers
46  //! disabled after transferAmount of transfers.
47  //! - \b DMA_TRANSFER_BLOCK - Multiple transfers of transferAmount,
48  //! transfers disabled once finished.
49  //! - \b DMA_TRANSFER_BURSTBLOCK - Multiple transfers of transferAmount
50  //! interleaved with CPU activity, transfers disabled once finished.
51  //! - \b DMA_TRANSFER_REPEATED_SINGLE - Repeated single transfer by
52  //! trigger.
53  //! - \b DMA_TRANSFER_REPEATED_BLOCK - Multiple transfers of transferAmount
54  //! by trigger.
55  //! - \b DMA_TRANSFER_REPEATED_BURSTBLOCK - Multiple transfers of
56  //! transferAmount by trigger interleaved with CPU activity.
58  //! Is the amount of transfers to complete in a block transfer mode, as
59  //! well as how many transfers to complete before the interrupt flag is
60  //! set. Valid value is between 1-65535, if 0, no transfers will occur.
61  uint16_t transferSize;
62  //! Is the source that will trigger the start of each transfer, note that
63  //! the sources are device specific.
64  //! \n Valid values are:
65  //! - \b DMA_TRIGGERSOURCE_0 [Default]
66  //! - \b DMA_TRIGGERSOURCE_1
67  //! - \b DMA_TRIGGERSOURCE_2
68  //! - \b DMA_TRIGGERSOURCE_3
69  //! - \b DMA_TRIGGERSOURCE_4
70  //! - \b DMA_TRIGGERSOURCE_5
71  //! - \b DMA_TRIGGERSOURCE_6
72  //! - \b DMA_TRIGGERSOURCE_7
73  //! - \b DMA_TRIGGERSOURCE_8
74  //! - \b DMA_TRIGGERSOURCE_9
75  //! - \b DMA_TRIGGERSOURCE_10
76  //! - \b DMA_TRIGGERSOURCE_11
77  //! - \b DMA_TRIGGERSOURCE_12
78  //! - \b DMA_TRIGGERSOURCE_13
79  //! - \b DMA_TRIGGERSOURCE_14
80  //! - \b DMA_TRIGGERSOURCE_15
81  //! - \b DMA_TRIGGERSOURCE_16
82  //! - \b DMA_TRIGGERSOURCE_17
83  //! - \b DMA_TRIGGERSOURCE_18
84  //! - \b DMA_TRIGGERSOURCE_19
85  //! - \b DMA_TRIGGERSOURCE_20
86  //! - \b DMA_TRIGGERSOURCE_21
87  //! - \b DMA_TRIGGERSOURCE_22
88  //! - \b DMA_TRIGGERSOURCE_23
89  //! - \b DMA_TRIGGERSOURCE_24
90  //! - \b DMA_TRIGGERSOURCE_25
91  //! - \b DMA_TRIGGERSOURCE_26
92  //! - \b DMA_TRIGGERSOURCE_27
93  //! - \b DMA_TRIGGERSOURCE_28
94  //! - \b DMA_TRIGGERSOURCE_29
95  //! - \b DMA_TRIGGERSOURCE_30
96  //! - \b DMA_TRIGGERSOURCE_31
98  //! Is the specified size of transfers.
99  //! \n Valid values are:
100  //! - \b DMA_SIZE_SRCWORD_DSTWORD [Default]
101  //! - \b DMA_SIZE_SRCBYTE_DSTWORD
102  //! - \b DMA_SIZE_SRCWORD_DSTBYTE
103  //! - \b DMA_SIZE_SRCBYTE_DSTBYTE
105  //! Is the type of trigger that the trigger signal needs to be to start a
106  //! transfer.
107  //! \n Valid values are:
108  //! - \b DMA_TRIGGER_RISINGEDGE [Default]
109  //! - \b DMA_TRIGGER_HIGH - A trigger would be a high signal from the
110  //! trigger source, to be held high through the length of the
111  //! transfer(s).
113 } DMA_initParam;
114 
115 
116 
117 //*****************************************************************************
118 //
119 // The following are values that can be passed to the triggerSourceSelect
120 // parameter for functions: DMA_init(); the param parameter for functions:
121 // DMA_init().
122 //
123 //*****************************************************************************
124 #define DMA_TRIGGERSOURCE_0 (0x00)
125 #define DMA_TRIGGERSOURCE_1 (0x01)
126 #define DMA_TRIGGERSOURCE_2 (0x02)
127 #define DMA_TRIGGERSOURCE_3 (0x03)
128 #define DMA_TRIGGERSOURCE_4 (0x04)
129 #define DMA_TRIGGERSOURCE_5 (0x05)
130 #define DMA_TRIGGERSOURCE_6 (0x06)
131 #define DMA_TRIGGERSOURCE_7 (0x07)
132 #define DMA_TRIGGERSOURCE_8 (0x08)
133 #define DMA_TRIGGERSOURCE_9 (0x09)
134 #define DMA_TRIGGERSOURCE_10 (0x0A)
135 #define DMA_TRIGGERSOURCE_11 (0x0B)
136 #define DMA_TRIGGERSOURCE_12 (0x0C)
137 #define DMA_TRIGGERSOURCE_13 (0x0D)
138 #define DMA_TRIGGERSOURCE_14 (0x0E)
139 #define DMA_TRIGGERSOURCE_15 (0x0F)
140 #define DMA_TRIGGERSOURCE_16 (0x10)
141 #define DMA_TRIGGERSOURCE_17 (0x11)
142 #define DMA_TRIGGERSOURCE_18 (0x12)
143 #define DMA_TRIGGERSOURCE_19 (0x13)
144 #define DMA_TRIGGERSOURCE_20 (0x14)
145 #define DMA_TRIGGERSOURCE_21 (0x15)
146 #define DMA_TRIGGERSOURCE_22 (0x16)
147 #define DMA_TRIGGERSOURCE_23 (0x17)
148 #define DMA_TRIGGERSOURCE_24 (0x18)
149 #define DMA_TRIGGERSOURCE_25 (0x19)
150 #define DMA_TRIGGERSOURCE_26 (0x1A)
151 #define DMA_TRIGGERSOURCE_27 (0x1B)
152 #define DMA_TRIGGERSOURCE_28 (0x1C)
153 #define DMA_TRIGGERSOURCE_29 (0x1D)
154 #define DMA_TRIGGERSOURCE_30 (0x1E)
155 #define DMA_TRIGGERSOURCE_31 (0x1F)
156 
157 //*****************************************************************************
158 //
159 // The following are values that can be passed to the param parameter for
160 // functions: DMA_init(); the transferModeSelect parameter for functions:
161 // DMA_init().
162 //
163 //*****************************************************************************
164 #define DMA_TRANSFER_SINGLE (DMADT_0)
165 #define DMA_TRANSFER_BLOCK (DMADT_1)
166 #define DMA_TRANSFER_BURSTBLOCK (DMADT_2)
167 #define DMA_TRANSFER_REPEATED_SINGLE (DMADT_4)
168 #define DMA_TRANSFER_REPEATED_BLOCK (DMADT_5)
169 #define DMA_TRANSFER_REPEATED_BURSTBLOCK (DMADT_6)
170 
171 //*****************************************************************************
172 //
173 // The following are values that can be passed to the channelSelect parameter
174 // for functions: DMA_init(), DMA_setTransferSize(), DMA_getTransferSize(),
175 // DMA_setSrcAddress(), DMA_setDstAddress(), DMA_enableTransfers(),
176 // DMA_disableTransfers(), DMA_startTransfer(), DMA_enableInterrupt(),
177 // DMA_disableInterrupt(), DMA_getInterruptStatus(), DMA_clearInterrupt(),
178 // DMA_getNMIAbortStatus(), and DMA_clearNMIAbort(); the param parameter for
179 // functions: DMA_init().
180 //
181 //*****************************************************************************
182 #define DMA_CHANNEL_0 (0x00)
183 #define DMA_CHANNEL_1 (0x10)
184 #define DMA_CHANNEL_2 (0x20)
185 #define DMA_CHANNEL_3 (0x30)
186 #define DMA_CHANNEL_4 (0x40)
187 #define DMA_CHANNEL_5 (0x50)
188 #define DMA_CHANNEL_6 (0x60)
189 #define DMA_CHANNEL_7 (0x70)
190 
191 //*****************************************************************************
192 //
193 // The following are values that can be passed to the triggerTypeSelect
194 // parameter for functions: DMA_init(); the param parameter for functions:
195 // DMA_init().
196 //
197 //*****************************************************************************
198 #define DMA_TRIGGER_RISINGEDGE (!(DMALEVEL))
199 #define DMA_TRIGGER_HIGH (DMALEVEL)
200 
201 //*****************************************************************************
202 //
203 // The following are values that can be passed to the transferUnitSelect
204 // parameter for functions: DMA_init(); the param parameter for functions:
205 // DMA_init().
206 //
207 //*****************************************************************************
208 #define DMA_SIZE_SRCWORD_DSTWORD (!(DMASRCBYTE + DMADSTBYTE))
209 #define DMA_SIZE_SRCBYTE_DSTWORD (DMASRCBYTE)
210 #define DMA_SIZE_SRCWORD_DSTBYTE (DMADSTBYTE)
211 #define DMA_SIZE_SRCBYTE_DSTBYTE (DMASRCBYTE + DMADSTBYTE)
212 
213 //*****************************************************************************
214 //
215 // The following are values that can be passed to the directionSelect parameter
216 // for functions: DMA_setSrcAddress(), and DMA_setDstAddress().
217 //
218 //*****************************************************************************
219 #define DMA_DIRECTION_UNCHANGED (DMASRCINCR_0)
220 #define DMA_DIRECTION_DECREMENT (DMASRCINCR_2)
221 #define DMA_DIRECTION_INCREMENT (DMASRCINCR_3)
222 
223 //*****************************************************************************
224 //
225 // The following are values that can be passed toThe following are values that
226 // can be returned by the DMA_getInterruptStatus() function.
227 //
228 //*****************************************************************************
229 #define DMA_INT_INACTIVE (0x0)
230 #define DMA_INT_ACTIVE (DMAIFG)
231 
232 //*****************************************************************************
233 //
234 // The following are values that can be passed toThe following are values that
235 // can be returned by the DMA_getNMIAbortStatus() function.
236 //
237 //*****************************************************************************
238 #define DMA_NOTABORTED (0x0)
239 #define DMA_ABORTED (DMAABORT)
240 
241 //*****************************************************************************
242 //
243 // Prototypes for the APIs.
244 //
245 //*****************************************************************************
246 
247 //*****************************************************************************
248 //
249 //! \brief Initializes the specified DMA channel.
250 //!
251 //! This function initializes the specified DMA channel. Upon successful
252 //! completion of initialization of the selected channel the control registers
253 //! will be cleared and the given variables will be set. Please note, if
254 //! transfers have been enabled with the enableTransfers() function, then a
255 //! call to disableTransfers() is necessary before re-initialization. Also
256 //! note, that the trigger sources are device dependent and can be found in the
257 //! device family data sheet. The amount of DMA channels available are also
258 //! device specific.
259 //!
260 //! \param param is the pointer to struct for initialization.
261 //!
262 //! \return STATUS_SUCCESS or STATUS_FAILURE of the initialization process.
263 //
264 //*****************************************************************************
265 extern void DMA_init(DMA_initParam *param);
266 
267 //*****************************************************************************
268 //
269 //! \brief Sets the specified amount of transfers for the selected DMA channel.
270 //!
271 //! This function sets the specified amount of transfers for the selected DMA
272 //! channel without having to reinitialize the DMA channel.
273 //!
274 //! \param channelSelect is the specified channel to set source address
275 //! direction for.
276 //! Valid values are:
277 //! - \b DMA_CHANNEL_0
278 //! - \b DMA_CHANNEL_1
279 //! - \b DMA_CHANNEL_2
280 //! - \b DMA_CHANNEL_3
281 //! - \b DMA_CHANNEL_4
282 //! - \b DMA_CHANNEL_5
283 //! - \b DMA_CHANNEL_6
284 //! - \b DMA_CHANNEL_7
285 //! \param transferSize is the amount of transfers to complete in a block
286 //! transfer mode, as well as how many transfers to complete before the
287 //! interrupt flag is set. Valid value is between 1-65535, if 0, no
288 //! transfers will occur.
289 //! \n Modified bits are \b DMAxSZ of \b DMAxSZ register.
290 //!
291 //! \return None
292 //
293 //*****************************************************************************
294 extern void DMA_setTransferSize(uint8_t channelSelect,
295  uint16_t transferSize);
296 
297 //*****************************************************************************
298 //
299 //! \brief Gets the amount of transfers for the selected DMA channel.
300 //!
301 //! This function gets the amount of transfers for the selected DMA channel
302 //! without having to reinitialize the DMA channel.
303 //!
304 //! \param channelSelect is the specified channel to set source address
305 //! direction for.
306 //! Valid values are:
307 //! - \b DMA_CHANNEL_0
308 //! - \b DMA_CHANNEL_1
309 //! - \b DMA_CHANNEL_2
310 //! - \b DMA_CHANNEL_3
311 //! - \b DMA_CHANNEL_4
312 //! - \b DMA_CHANNEL_5
313 //! - \b DMA_CHANNEL_6
314 //! - \b DMA_CHANNEL_7
315 //!
316 //! \return the amount of transfers
317 //
318 //*****************************************************************************
319 extern uint16_t DMA_getTransferSize(uint8_t channelSelect);
320 
321 //*****************************************************************************
322 //
323 //! \brief Sets source address and the direction that the source address will
324 //! move after a transfer.
325 //!
326 //! This function sets the source address and the direction that the source
327 //! address will move after a transfer is complete. It may be incremented,
328 //! decremented or unchanged.
329 //!
330 //! \param channelSelect is the specified channel to set source address
331 //! direction for.
332 //! Valid values are:
333 //! - \b DMA_CHANNEL_0
334 //! - \b DMA_CHANNEL_1
335 //! - \b DMA_CHANNEL_2
336 //! - \b DMA_CHANNEL_3
337 //! - \b DMA_CHANNEL_4
338 //! - \b DMA_CHANNEL_5
339 //! - \b DMA_CHANNEL_6
340 //! - \b DMA_CHANNEL_7
341 //! \param srcAddress is the address of where the data will be transferred
342 //! from.
343 //! \n Modified bits are \b DMAxSA of \b DMAxSA register.
344 //! \param directionSelect is the specified direction of the source address
345 //! after a transfer.
346 //! Valid values are:
347 //! - \b DMA_DIRECTION_UNCHANGED
348 //! - \b DMA_DIRECTION_DECREMENT
349 //! - \b DMA_DIRECTION_INCREMENT
350 //! \n Modified bits are \b DMASRCINCR of \b DMAxCTL register.
351 //!
352 //! \return None
353 //
354 //*****************************************************************************
355 extern void DMA_setSrcAddress(uint8_t channelSelect,
356  uint32_t srcAddress,
357  uint16_t directionSelect);
358 
359 //*****************************************************************************
360 //
361 //! \brief Sets the destination address and the direction that the destination
362 //! address will move after a transfer.
363 //!
364 //! This function sets the destination address and the direction that the
365 //! destination address will move after a transfer is complete. It may be
366 //! incremented, decremented, or unchanged.
367 //!
368 //! \param channelSelect is the specified channel to set the destination
369 //! address direction for.
370 //! Valid values are:
371 //! - \b DMA_CHANNEL_0
372 //! - \b DMA_CHANNEL_1
373 //! - \b DMA_CHANNEL_2
374 //! - \b DMA_CHANNEL_3
375 //! - \b DMA_CHANNEL_4
376 //! - \b DMA_CHANNEL_5
377 //! - \b DMA_CHANNEL_6
378 //! - \b DMA_CHANNEL_7
379 //! \param dstAddress is the address of where the data will be transferred to.
380 //! \n Modified bits are \b DMAxDA of \b DMAxDA register.
381 //! \param directionSelect is the specified direction of the destination
382 //! address after a transfer.
383 //! Valid values are:
384 //! - \b DMA_DIRECTION_UNCHANGED
385 //! - \b DMA_DIRECTION_DECREMENT
386 //! - \b DMA_DIRECTION_INCREMENT
387 //! \n Modified bits are \b DMADSTINCR of \b DMAxCTL register.
388 //!
389 //! \return None
390 //
391 //*****************************************************************************
392 extern void DMA_setDstAddress(uint8_t channelSelect,
393  uint32_t dstAddress,
394  uint16_t directionSelect);
395 
396 //*****************************************************************************
397 //
398 //! \brief Enables transfers to be triggered.
399 //!
400 //! This function enables transfers upon appropriate trigger of the selected
401 //! trigger source for the selected channel.
402 //!
403 //! \param channelSelect is the specified channel to enable transfer for.
404 //! Valid values are:
405 //! - \b DMA_CHANNEL_0
406 //! - \b DMA_CHANNEL_1
407 //! - \b DMA_CHANNEL_2
408 //! - \b DMA_CHANNEL_3
409 //! - \b DMA_CHANNEL_4
410 //! - \b DMA_CHANNEL_5
411 //! - \b DMA_CHANNEL_6
412 //! - \b DMA_CHANNEL_7
413 //!
414 //! \return None
415 //
416 //*****************************************************************************
417 extern void DMA_enableTransfers(uint8_t channelSelect);
418 
419 //*****************************************************************************
420 //
421 //! \brief Disables transfers from being triggered.
422 //!
423 //! This function disables transfer from being triggered for the selected
424 //! channel. This function should be called before any re-initialization of the
425 //! selected DMA channel.
426 //!
427 //! \param channelSelect is the specified channel to disable transfers for.
428 //! Valid values are:
429 //! - \b DMA_CHANNEL_0
430 //! - \b DMA_CHANNEL_1
431 //! - \b DMA_CHANNEL_2
432 //! - \b DMA_CHANNEL_3
433 //! - \b DMA_CHANNEL_4
434 //! - \b DMA_CHANNEL_5
435 //! - \b DMA_CHANNEL_6
436 //! - \b DMA_CHANNEL_7
437 //!
438 //! \return None
439 //
440 //*****************************************************************************
441 extern void DMA_disableTransfers(uint8_t channelSelect);
442 
443 //*****************************************************************************
444 //
445 //! \brief Starts a transfer if using the default trigger source selected in
446 //! initialization.
447 //!
448 //! This functions triggers a transfer of data from source to destination if
449 //! the trigger source chosen from initialization is the DMA_TRIGGERSOURCE_0.
450 //! Please note, this function needs to be called for each (repeated-)single
451 //! transfer, and when transferAmount of transfers have been complete in
452 //! (repeated-)block transfers.
453 //!
454 //! \param channelSelect is the specified channel to start transfers for.
455 //! Valid values are:
456 //! - \b DMA_CHANNEL_0
457 //! - \b DMA_CHANNEL_1
458 //! - \b DMA_CHANNEL_2
459 //! - \b DMA_CHANNEL_3
460 //! - \b DMA_CHANNEL_4
461 //! - \b DMA_CHANNEL_5
462 //! - \b DMA_CHANNEL_6
463 //! - \b DMA_CHANNEL_7
464 //!
465 //! \return None
466 //
467 //*****************************************************************************
468 extern void DMA_startTransfer(uint8_t channelSelect);
469 
470 //*****************************************************************************
471 //
472 //! \brief Enables the DMA interrupt for the selected channel.
473 //!
474 //! Enables the DMA interrupt source. Only the sources that are enabled can be
475 //! reflected to the processor interrupt; disabled sources have no effect on
476 //! the processor. Does not clear interrupt flags.
477 //!
478 //! \param channelSelect is the specified channel to enable the interrupt for.
479 //! Valid values are:
480 //! - \b DMA_CHANNEL_0
481 //! - \b DMA_CHANNEL_1
482 //! - \b DMA_CHANNEL_2
483 //! - \b DMA_CHANNEL_3
484 //! - \b DMA_CHANNEL_4
485 //! - \b DMA_CHANNEL_5
486 //! - \b DMA_CHANNEL_6
487 //! - \b DMA_CHANNEL_7
488 //!
489 //! \return None
490 //
491 //*****************************************************************************
492 extern void DMA_enableInterrupt(uint8_t channelSelect);
493 
494 //*****************************************************************************
495 //
496 //! \brief Disables the DMA interrupt for the selected channel.
497 //!
498 //! Disables the DMA interrupt source. Only the sources that are enabled can be
499 //! reflected to the processor interrupt; disabled sources have no effect on
500 //! the processor.
501 //!
502 //! \param channelSelect is the specified channel to disable the interrupt for.
503 //! Valid values are:
504 //! - \b DMA_CHANNEL_0
505 //! - \b DMA_CHANNEL_1
506 //! - \b DMA_CHANNEL_2
507 //! - \b DMA_CHANNEL_3
508 //! - \b DMA_CHANNEL_4
509 //! - \b DMA_CHANNEL_5
510 //! - \b DMA_CHANNEL_6
511 //! - \b DMA_CHANNEL_7
512 //!
513 //! \return None
514 //
515 //*****************************************************************************
516 extern void DMA_disableInterrupt(uint8_t channelSelect);
517 
518 //*****************************************************************************
519 //
520 //! \brief Returns the status of the interrupt flag for the selected channel.
521 //!
522 //! Returns the status of the interrupt flag for the selected channel.
523 //!
524 //! \param channelSelect is the specified channel to return the interrupt flag
525 //! status from.
526 //! Valid values are:
527 //! - \b DMA_CHANNEL_0
528 //! - \b DMA_CHANNEL_1
529 //! - \b DMA_CHANNEL_2
530 //! - \b DMA_CHANNEL_3
531 //! - \b DMA_CHANNEL_4
532 //! - \b DMA_CHANNEL_5
533 //! - \b DMA_CHANNEL_6
534 //! - \b DMA_CHANNEL_7
535 //!
536 //! \return One of the following:
537 //! - \b DMA_INT_INACTIVE
538 //! - \b DMA_INT_ACTIVE
539 //! \n indicating the status of the current interrupt flag
540 //
541 //*****************************************************************************
542 extern uint16_t DMA_getInterruptStatus(uint8_t channelSelect);
543 
544 //*****************************************************************************
545 //
546 //! \brief Clears the interrupt flag for the selected channel.
547 //!
548 //! This function clears the DMA interrupt flag is cleared, so that it no
549 //! longer asserts.
550 //!
551 //! \param channelSelect is the specified channel to clear the interrupt flag
552 //! for.
553 //! Valid values are:
554 //! - \b DMA_CHANNEL_0
555 //! - \b DMA_CHANNEL_1
556 //! - \b DMA_CHANNEL_2
557 //! - \b DMA_CHANNEL_3
558 //! - \b DMA_CHANNEL_4
559 //! - \b DMA_CHANNEL_5
560 //! - \b DMA_CHANNEL_6
561 //! - \b DMA_CHANNEL_7
562 //!
563 //! \return None
564 //
565 //*****************************************************************************
566 extern void DMA_clearInterrupt(uint8_t channelSelect);
567 
568 //*****************************************************************************
569 //
570 //! \brief Returns the status of the NMIAbort for the selected channel.
571 //!
572 //! This function returns the status of the NMI Abort flag for the selected
573 //! channel. If this flag has been set, it is because a transfer on this
574 //! channel was aborted due to a interrupt from an NMI.
575 //!
576 //! \param channelSelect is the specified channel to return the status of the
577 //! NMI Abort flag for.
578 //! Valid values are:
579 //! - \b DMA_CHANNEL_0
580 //! - \b DMA_CHANNEL_1
581 //! - \b DMA_CHANNEL_2
582 //! - \b DMA_CHANNEL_3
583 //! - \b DMA_CHANNEL_4
584 //! - \b DMA_CHANNEL_5
585 //! - \b DMA_CHANNEL_6
586 //! - \b DMA_CHANNEL_7
587 //!
588 //! \return One of the following:
589 //! - \b DMA_NOTABORTED
590 //! - \b DMA_ABORTED
591 //! \n indicating the status of the NMIAbort for the selected channel
592 //
593 //*****************************************************************************
594 extern uint16_t DMA_getNMIAbortStatus(uint8_t channelSelect);
595 
596 //*****************************************************************************
597 //
598 //! \brief Clears the status of the NMIAbort to proceed with transfers for the
599 //! selected channel.
600 //!
601 //! This function clears the status of the NMI Abort flag for the selected
602 //! channel to allow for transfers on the channel to continue.
603 //!
604 //! \param channelSelect is the specified channel to clear the NMI Abort flag
605 //! for.
606 //! Valid values are:
607 //! - \b DMA_CHANNEL_0
608 //! - \b DMA_CHANNEL_1
609 //! - \b DMA_CHANNEL_2
610 //! - \b DMA_CHANNEL_3
611 //! - \b DMA_CHANNEL_4
612 //! - \b DMA_CHANNEL_5
613 //! - \b DMA_CHANNEL_6
614 //! - \b DMA_CHANNEL_7
615 //!
616 //! \return None
617 //
618 //*****************************************************************************
619 extern void DMA_clearNMIAbort(uint8_t channelSelect);
620 
621 //*****************************************************************************
622 //
623 //! \brief Disables the DMA from stopping the CPU during a Read-Modify-Write
624 //! Operation to start a transfer.
625 //!
626 //! This function allows the CPU to finish any read-modify-write operations it
627 //! may be in the middle of before transfers of and DMA channel stop the CPU.
628 //!
629 //!
630 //! \return None
631 //
632 //*****************************************************************************
634 
635 //*****************************************************************************
636 //
637 //! \brief Enables the DMA to stop the CPU during a Read-Modify-Write Operation
638 //! to start a transfer.
639 //!
640 //! This function allows the DMA to stop the CPU in the middle of a read-
641 //! modify-write operation to transfer data.
642 //!
643 //!
644 //! \return None
645 //
646 //*****************************************************************************
648 
649 //*****************************************************************************
650 //
651 //! \brief Enables Round Robin prioritization.
652 //!
653 //! This function enables Round Robin Prioritization of DMA channels. In the
654 //! case of Round Robin Prioritization, the last DMA channel to have
655 //! transferred data then has the last priority, which comes into play when
656 //! multiple DMA channels are ready to transfer at the same time.
657 //!
658 //!
659 //! \return None
660 //
661 //*****************************************************************************
662 extern void DMA_enableRoundRobinPriority(void);
663 
664 //*****************************************************************************
665 //
666 //! \brief Disables Round Robin prioritization.
667 //!
668 //! This function disables Round Robin Prioritization, enabling static
669 //! prioritization of the DMA channels. In static prioritization, the DMA
670 //! channels are prioritized with the lowest DMA channel index having the
671 //! highest priority (i.e. DMA Channel 0 has the highest priority).
672 //!
673 //!
674 //! \return None
675 //
676 //*****************************************************************************
677 extern void DMA_disableRoundRobinPriority(void);
678 
679 //*****************************************************************************
680 //
681 //! \brief Enables a NMI to interrupt a DMA transfer.
682 //!
683 //! This function allow NMI's to interrupting any DMA transfer currently in
684 //! progress and stops any future transfers to begin before the NMI is done
685 //! processing.
686 //!
687 //!
688 //! \return None
689 //
690 //*****************************************************************************
691 extern void DMA_enableNMIAbort(void);
692 
693 //*****************************************************************************
694 //
695 //! \brief Disables any NMI from interrupting a DMA transfer.
696 //!
697 //! This function disables NMI's from interrupting any DMA transfer currently
698 //! in progress.
699 //!
700 //!
701 //! \return None
702 //
703 //*****************************************************************************
704 extern void DMA_disableNMIAbort(void);
705 
706 //*****************************************************************************
707 //
708 // Mark the end of the C bindings section for C++ compilers.
709 //
710 //*****************************************************************************
711 #ifdef __cplusplus
712 }
713 #endif
714 
715 #endif
716 #endif // __MSP430WARE_DMA_H__
uint8_t transferUnitSelect
Definition: dma.h:104
void DMA_startTransfer(uint8_t channelSelect)
Starts a transfer if using the default trigger source selected in initialization. ...
Definition: dma.c:91
void DMA_enableRoundRobinPriority(void)
Enables Round Robin prioritization.
Definition: dma.c:136
void DMA_enableNMIAbort(void)
Enables a NMI to interrupt a DMA transfer.
Definition: dma.c:146
uint16_t DMA_getTransferSize(uint8_t channelSelect)
Gets the amount of transfers for the selected DMA channel.
Definition: dma.c:49
void DMA_setTransferSize(uint8_t channelSelect, uint16_t transferSize)
Sets the specified amount of transfers for the selected DMA channel.
Definition: dma.c:42
uint16_t transferModeSelect
Definition: dma.h:57
void DMA_disableTransfers(uint8_t channelSelect)
Disables transfers from being triggered.
Definition: dma.c:86
void DMA_disableRoundRobinPriority(void)
Disables Round Robin prioritization.
Definition: dma.c:141
uint16_t DMA_getInterruptStatus(uint8_t channelSelect)
Returns the status of the interrupt flag for the selected channel.
Definition: dma.c:106
uint8_t channelSelect
Definition: dma.h:42
void DMA_enableTransfers(uint8_t channelSelect)
Enables transfers to be triggered.
Definition: dma.c:81
void DMA_enableTransferDuringReadModifyWrite(void)
Enables the DMA to stop the CPU during a Read-Modify-Write Operation to start a transfer.
Definition: dma.c:131
void DMA_clearNMIAbort(uint8_t channelSelect)
Clears the status of the NMIAbort to proceed with transfers for the selected channel.
Definition: dma.c:121
void DMA_setDstAddress(uint8_t channelSelect, uint32_t dstAddress, uint16_t directionSelect)
Sets the destination address and the direction that the destination address will move after a transfe...
Definition: dma.c:68
uint8_t triggerSourceSelect
Definition: dma.h:97
void DMA_setSrcAddress(uint8_t channelSelect, uint32_t srcAddress, uint16_t directionSelect)
Sets source address and the direction that the source address will move after a transfer.
Definition: dma.c:55
void DMA_init(DMA_initParam *param)
Initializes the specified DMA channel.
Definition: dma.c:21
void DMA_disableTransferDuringReadModifyWrite(void)
Disables the DMA from stopping the CPU during a Read-Modify-Write Operation to start a transfer...
Definition: dma.c:126
void DMA_enableInterrupt(uint8_t channelSelect)
Enables the DMA interrupt for the selected channel.
Definition: dma.c:96
uint8_t triggerTypeSelect
Definition: dma.h:112
void DMA_disableNMIAbort(void)
Disables any NMI from interrupting a DMA transfer.
Definition: dma.c:151
uint16_t transferSize
Definition: dma.h:61
uint16_t DMA_getNMIAbortStatus(uint8_t channelSelect)
Returns the status of the NMIAbort for the selected channel.
Definition: dma.c:116
Used in the DMA_init() function as the param parameter.
Definition: dma.h:31
void DMA_clearInterrupt(uint8_t channelSelect)
Clears the interrupt flag for the selected channel.
Definition: dma.c:111
void DMA_disableInterrupt(uint8_t channelSelect)
Disables the DMA interrupt for the selected channel.
Definition: dma.c:101

Copyright 2015, Texas Instruments Incorporated