MSP430 DriverLib for MSP430F5xx_6xx Devices  2.10.00.09
 All Data Structures Functions Variables Modules Pages
dma

Functions

void DMA_init (DMA_initParam *param)
 Initializes the specified DMA channel. More...
 
void DMA_setTransferSize (uint8_t channelSelect, uint16_t transferSize)
 Sets the specified amount of transfers for the selected DMA channel. More...
 
uint16_t DMA_getTransferSize (uint8_t channelSelect)
 Gets the amount of transfers for the selected DMA channel. More...
 
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. More...
 
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 transfer. More...
 
void DMA_enableTransfers (uint8_t channelSelect)
 Enables transfers to be triggered. More...
 
void DMA_disableTransfers (uint8_t channelSelect)
 Disables transfers from being triggered. More...
 
void DMA_startTransfer (uint8_t channelSelect)
 Starts a transfer if using the default trigger source selected in initialization. More...
 
void DMA_enableInterrupt (uint8_t channelSelect)
 Enables the DMA interrupt for the selected channel. More...
 
void DMA_disableInterrupt (uint8_t channelSelect)
 Disables the DMA interrupt for the selected channel. More...
 
uint16_t DMA_getInterruptStatus (uint8_t channelSelect)
 Returns the status of the interrupt flag for the selected channel. More...
 
void DMA_clearInterrupt (uint8_t channelSelect)
 Clears the interrupt flag for the selected channel. More...
 
uint16_t DMA_getNMIAbortStatus (uint8_t channelSelect)
 Returns the status of the NMIAbort for the selected channel. More...
 
void DMA_clearNMIAbort (uint8_t channelSelect)
 Clears the status of the NMIAbort to proceed with transfers for the selected channel. More...
 
void DMA_disableTransferDuringReadModifyWrite (void)
 Disables the DMA from stopping the CPU during a Read-Modify-Write Operation to start a transfer. More...
 
void DMA_enableTransferDuringReadModifyWrite (void)
 Enables the DMA to stop the CPU during a Read-Modify-Write Operation to start a transfer. More...
 
void DMA_enableRoundRobinPriority (void)
 Enables Round Robin prioritization. More...
 
void DMA_disableRoundRobinPriority (void)
 Disables Round Robin prioritization. More...
 
void DMA_enableNMIAbort (void)
 Enables a NMI to interrupt a DMA transfer. More...
 
void DMA_disableNMIAbort (void)
 Disables any NMI from interrupting a DMA transfer. More...
 

Detailed Description

Function Documentation

void DMA_clearInterrupt ( uint8_t  channelSelect)

Clears the interrupt flag for the selected channel.

This function clears the DMA interrupt flag is cleared, so that it no longer asserts.

Parameters
channelSelectis the specified channel to clear the interrupt flag for. Valid values are:
  • DMA_CHANNEL_0
  • DMA_CHANNEL_1
  • DMA_CHANNEL_2
  • DMA_CHANNEL_3
  • DMA_CHANNEL_4
  • DMA_CHANNEL_5
  • DMA_CHANNEL_6
  • DMA_CHANNEL_7
Returns
None
void DMA_clearNMIAbort ( uint8_t  channelSelect)

Clears the status of the NMIAbort to proceed with transfers for the selected channel.

This function clears the status of the NMI Abort flag for the selected channel to allow for transfers on the channel to continue.

Parameters
channelSelectis the specified channel to clear the NMI Abort flag for. Valid values are:
  • DMA_CHANNEL_0
  • DMA_CHANNEL_1
  • DMA_CHANNEL_2
  • DMA_CHANNEL_3
  • DMA_CHANNEL_4
  • DMA_CHANNEL_5
  • DMA_CHANNEL_6
  • DMA_CHANNEL_7
Returns
None
void DMA_disableInterrupt ( uint8_t  channelSelect)

Disables the DMA interrupt for the selected channel.

Disables the DMA interrupt source. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.

Parameters
channelSelectis the specified channel to disable the interrupt for. Valid values are:
  • DMA_CHANNEL_0
  • DMA_CHANNEL_1
  • DMA_CHANNEL_2
  • DMA_CHANNEL_3
  • DMA_CHANNEL_4
  • DMA_CHANNEL_5
  • DMA_CHANNEL_6
  • DMA_CHANNEL_7
Returns
None
void DMA_disableNMIAbort ( void  )

Disables any NMI from interrupting a DMA transfer.

This function disables NMI's from interrupting any DMA transfer currently in progress.

Returns
None
void DMA_disableRoundRobinPriority ( void  )

Disables Round Robin prioritization.

This function disables Round Robin Prioritization, enabling static prioritization of the DMA channels. In static prioritization, the DMA channels are prioritized with the lowest DMA channel index having the highest priority (i.e. DMA Channel 0 has the highest priority).

Returns
None
void DMA_disableTransferDuringReadModifyWrite ( void  )

Disables the DMA from stopping the CPU during a Read-Modify-Write Operation to start a transfer.

This function allows the CPU to finish any read-modify-write operations it may be in the middle of before transfers of and DMA channel stop the CPU.

Returns
None
void DMA_disableTransfers ( uint8_t  channelSelect)

Disables transfers from being triggered.

This function disables transfer from being triggered for the selected channel. This function should be called before any re-initialization of the selected DMA channel.

Parameters
channelSelectis the specified channel to disable transfers for. Valid values are:
  • DMA_CHANNEL_0
  • DMA_CHANNEL_1
  • DMA_CHANNEL_2
  • DMA_CHANNEL_3
  • DMA_CHANNEL_4
  • DMA_CHANNEL_5
  • DMA_CHANNEL_6
  • DMA_CHANNEL_7
Returns
None
void DMA_enableInterrupt ( uint8_t  channelSelect)

Enables the DMA interrupt for the selected channel.

Enables the DMA interrupt source. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor. Does not clear interrupt flags.

Parameters
channelSelectis the specified channel to enable the interrupt for. Valid values are:
  • DMA_CHANNEL_0
  • DMA_CHANNEL_1
  • DMA_CHANNEL_2
  • DMA_CHANNEL_3
  • DMA_CHANNEL_4
  • DMA_CHANNEL_5
  • DMA_CHANNEL_6
  • DMA_CHANNEL_7
Returns
None
void DMA_enableNMIAbort ( void  )

Enables a NMI to interrupt a DMA transfer.

This function allow NMI's to interrupting any DMA transfer currently in progress and stops any future transfers to begin before the NMI is done processing.

Returns
None
void DMA_enableRoundRobinPriority ( void  )

Enables Round Robin prioritization.

This function enables Round Robin Prioritization of DMA channels. In the case of Round Robin Prioritization, the last DMA channel to have transferred data then has the last priority, which comes into play when multiple DMA channels are ready to transfer at the same time.

Returns
None
void DMA_enableTransferDuringReadModifyWrite ( void  )

Enables the DMA to stop the CPU during a Read-Modify-Write Operation to start a transfer.

This function allows the DMA to stop the CPU in the middle of a read- modify-write operation to transfer data.

Returns
None
void DMA_enableTransfers ( uint8_t  channelSelect)

Enables transfers to be triggered.

This function enables transfers upon appropriate trigger of the selected trigger source for the selected channel.

Parameters
channelSelectis the specified channel to enable transfer for. Valid values are:
  • DMA_CHANNEL_0
  • DMA_CHANNEL_1
  • DMA_CHANNEL_2
  • DMA_CHANNEL_3
  • DMA_CHANNEL_4
  • DMA_CHANNEL_5
  • DMA_CHANNEL_6
  • DMA_CHANNEL_7
Returns
None
uint16_t DMA_getInterruptStatus ( uint8_t  channelSelect)

Returns the status of the interrupt flag for the selected channel.

Returns the status of the interrupt flag for the selected channel.

Parameters
channelSelectis the specified channel to return the interrupt flag status from. Valid values are:
  • DMA_CHANNEL_0
  • DMA_CHANNEL_1
  • DMA_CHANNEL_2
  • DMA_CHANNEL_3
  • DMA_CHANNEL_4
  • DMA_CHANNEL_5
  • DMA_CHANNEL_6
  • DMA_CHANNEL_7
Returns
One of the following:
  • DMA_INT_INACTIVE
  • DMA_INT_ACTIVE
    indicating the status of the current interrupt flag
uint16_t DMA_getNMIAbortStatus ( uint8_t  channelSelect)

Returns the status of the NMIAbort for the selected channel.

This function returns the status of the NMI Abort flag for the selected channel. If this flag has been set, it is because a transfer on this channel was aborted due to a interrupt from an NMI.

Parameters
channelSelectis the specified channel to return the status of the NMI Abort flag for. Valid values are:
  • DMA_CHANNEL_0
  • DMA_CHANNEL_1
  • DMA_CHANNEL_2
  • DMA_CHANNEL_3
  • DMA_CHANNEL_4
  • DMA_CHANNEL_5
  • DMA_CHANNEL_6
  • DMA_CHANNEL_7
Returns
One of the following:
  • DMA_NOTABORTED
  • DMA_ABORTED
    indicating the status of the NMIAbort for the selected channel
uint16_t DMA_getTransferSize ( uint8_t  channelSelect)

Gets the amount of transfers for the selected DMA channel.

This function gets the amount of transfers for the selected DMA channel without having to reinitialize the DMA channel.

Parameters
channelSelectis the specified channel to set source address direction for. Valid values are:
  • DMA_CHANNEL_0
  • DMA_CHANNEL_1
  • DMA_CHANNEL_2
  • DMA_CHANNEL_3
  • DMA_CHANNEL_4
  • DMA_CHANNEL_5
  • DMA_CHANNEL_6
  • DMA_CHANNEL_7
Returns
the amount of transfers
void DMA_init ( DMA_initParam param)

Initializes the specified DMA channel.

This function initializes the specified DMA channel. Upon successful completion of initialization of the selected channel the control registers will be cleared and the given variables will be set. Please note, if transfers have been enabled with the enableTransfers() function, then a call to disableTransfers() is necessary before re-initialization. Also note, that the trigger sources are device dependent and can be found in the device family data sheet. The amount of DMA channels available are also device specific.

Parameters
paramis the pointer to struct for initialization.
Returns
STATUS_SUCCESS or STATUS_FAILURE of the initialization process.

References DMA_initParam::channelSelect, DMA_initParam::transferModeSelect, DMA_initParam::transferSize, DMA_initParam::transferUnitSelect, DMA_initParam::triggerSourceSelect, and DMA_initParam::triggerTypeSelect.

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 transfer.

This function sets the destination address and the direction that the destination address will move after a transfer is complete. It may be incremented, decremented, or unchanged.

Parameters
channelSelectis the specified channel to set the destination address direction for. Valid values are:
  • DMA_CHANNEL_0
  • DMA_CHANNEL_1
  • DMA_CHANNEL_2
  • DMA_CHANNEL_3
  • DMA_CHANNEL_4
  • DMA_CHANNEL_5
  • DMA_CHANNEL_6
  • DMA_CHANNEL_7
dstAddressis the address of where the data will be transferred to.
Modified bits are DMAxDA of DMAxDA register.
directionSelectis the specified direction of the destination address after a transfer. Valid values are:
  • DMA_DIRECTION_UNCHANGED
  • DMA_DIRECTION_DECREMENT
  • DMA_DIRECTION_INCREMENT
    Modified bits are DMADSTINCR of DMAxCTL register.
Returns
None
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.

This function sets the source address and the direction that the source address will move after a transfer is complete. It may be incremented, decremented or unchanged.

Parameters
channelSelectis the specified channel to set source address direction for. Valid values are:
  • DMA_CHANNEL_0
  • DMA_CHANNEL_1
  • DMA_CHANNEL_2
  • DMA_CHANNEL_3
  • DMA_CHANNEL_4
  • DMA_CHANNEL_5
  • DMA_CHANNEL_6
  • DMA_CHANNEL_7
srcAddressis the address of where the data will be transferred from.
Modified bits are DMAxSA of DMAxSA register.
directionSelectis the specified direction of the source address after a transfer. Valid values are:
  • DMA_DIRECTION_UNCHANGED
  • DMA_DIRECTION_DECREMENT
  • DMA_DIRECTION_INCREMENT
    Modified bits are DMASRCINCR of DMAxCTL register.
Returns
None
void DMA_setTransferSize ( uint8_t  channelSelect,
uint16_t  transferSize 
)

Sets the specified amount of transfers for the selected DMA channel.

This function sets the specified amount of transfers for the selected DMA channel without having to reinitialize the DMA channel.

Parameters
channelSelectis the specified channel to set source address direction for. Valid values are:
  • DMA_CHANNEL_0
  • DMA_CHANNEL_1
  • DMA_CHANNEL_2
  • DMA_CHANNEL_3
  • DMA_CHANNEL_4
  • DMA_CHANNEL_5
  • DMA_CHANNEL_6
  • DMA_CHANNEL_7
transferSizeis the amount of transfers to complete in a block transfer mode, as well as how many transfers to complete before the interrupt flag is set. Valid value is between 1-65535, if 0, no transfers will occur.
Modified bits are DMAxSZ of DMAxSZ register.
Returns
None
void DMA_startTransfer ( uint8_t  channelSelect)

Starts a transfer if using the default trigger source selected in initialization.

This functions triggers a transfer of data from source to destination if the trigger source chosen from initialization is the DMA_TRIGGERSOURCE_0. Please note, this function needs to be called for each (repeated-)single transfer, and when transferAmount of transfers have been complete in (repeated-)block transfers.

Parameters
channelSelectis the specified channel to start transfers for. Valid values are:
  • DMA_CHANNEL_0
  • DMA_CHANNEL_1
  • DMA_CHANNEL_2
  • DMA_CHANNEL_3
  • DMA_CHANNEL_4
  • DMA_CHANNEL_5
  • DMA_CHANNEL_6
  • DMA_CHANNEL_7
Returns
None

Copyright 2015, Texas Instruments Incorporated