#include "driverlib/5xx_6xx/dma.h"
#include "inc/hw_types.h"
#include "deprecated/CCS/msp430xgeneric.h"
#include "driverlib/5xx_6xx/debug.h"
Functions | |
unsigned short | DMA_init (unsigned int baseAddress, unsigned char channelSelect, unsigned int transferModeSelect, unsigned int transferSize, unsigned char triggerSourceSelect, unsigned char transferUnitSelect, unsigned char triggerTypeSelect) |
void | DMA_setTransferSize (unsigned int baseAddress, unsigned char channelSelect, unsigned int transferSize) |
void | DMA_setSrcAddress (unsigned int baseAddress, unsigned char channelSelect, unsigned long srcAddress, unsigned int directionSelect) |
void | DMA_setDstAddress (unsigned int baseAddress, unsigned char channelSelect, unsigned long dstAddress, unsigned int directionSelect) |
void | DMA_enableTransfers (unsigned int baseAddress, unsigned char channelSelect) |
void | DMA_disableTransfers (unsigned int baseAddress, unsigned char channelSelect) |
void | DMA_startTransfer (unsigned int baseAddress, unsigned char channelSelect) |
void | DMA_enableInterrupt (unsigned int baseAddress, unsigned char channelSelect) |
void | DMA_disableInterrupt (unsigned int baseAddress, unsigned char channelSelect) |
unsigned short | DMA_getInterruptStatus (unsigned int baseAddress, unsigned char channelSelect) |
void | DMA_clearInterrupt (unsigned int baseAddress, unsigned char channelSelect) |
unsigned short | DMA_NMIAbortStatus (unsigned int baseAddress, unsigned char channelSelect) |
void | DMA_clearNMIAbort (unsigned int baseAddress, unsigned char channelSelect) |
void | DMA_disableTransferDuringReadModifyWrite (unsigned int baseAddress) |
void | DMA_enableTransferDuringReadModifyWrite (unsigned int baseAddress) |
void | DMA_enableRoundRobinPriority (unsigned int baseAddress) |
void | DMA_disableRoundRobinPriority (unsigned int baseAddress) |
void | DMA_enableNMIAbort (unsigned int baseAddress) |
void | DMA_disableNMIAbort (unsigned int baseAddress) |
unsigned short DMA_init | ( | unsigned int | baseAddress, |
unsigned char | channelSelect, | ||
unsigned int | transferModeSelect, | ||
unsigned int | transferSize, | ||
unsigned char | triggerSourceSelect, | ||
unsigned char | transferUnitSelect, | ||
unsigned char | triggerTypeSelect | ||
) |
Initializes the specified DMA channel.
baseAddress | is the base address of the DMA module. |
channelSelect | is the specified channel to initialize. 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 |
transferModeSelect | is the transfer mode of the selected channel. Valid values are DMA_TRANSFER_SINGLE - Single transfer, transfers disabled after transferAmount of transfers. [Default] DMA_TRANSFER_BLOCK - Multiple transfers of transferAmount, transfers disabled once finished. DMA_TRANSFER_BURSTBLOCK - Multiple transfers of transferAmount interleaved with CPU activity, transfers disabled once finished. DMA_TRANSFER_REPEATED_SINGLE - Repeated single transfer by trigger. DMA_TRANSFER_REPEATED_BLOCK - Multiple transfers of transferAmount by trigger. DMA_TRANSFER_REPEATED_BURSTBLOCK - Multiple transfers of transferAmount by trigger interleaved with CPU activity. Modified bits are DMADT of DMAxCTL register. |
transferSize | is 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 DMAzSZ register. |
triggerSourceSelect | is the source that will trigger the start of each transfer, note that the sources are device specific. Valid values are DMA_TRIGGERSOURCE_0 [Default] DMA_TRIGGERSOURCE_1 DMA_TRIGGERSOURCE_2 DMA_TRIGGERSOURCE_3 DMA_TRIGGERSOURCE_4 DMA_TRIGGERSOURCE_5 DMA_TRIGGERSOURCE_6 DMA_TRIGGERSOURCE_7 DMA_TRIGGERSOURCE_8 DMA_TRIGGERSOURCE_9 DMA_TRIGGERSOURCE_10 DMA_TRIGGERSOURCE_11 DMA_TRIGGERSOURCE_12 DMA_TRIGGERSOURCE_13 DMA_TRIGGERSOURCE_14 DMA_TRIGGERSOURCE_15 DMA_TRIGGERSOURCE_16 DMA_TRIGGERSOURCE_17 DMA_TRIGGERSOURCE_18 DMA_TRIGGERSOURCE_19 DMA_TRIGGERSOURCE_20 DMA_TRIGGERSOURCE_21 DMA_TRIGGERSOURCE_22 DMA_TRIGGERSOURCE_23 DMA_TRIGGERSOURCE_24 DMA_TRIGGERSOURCE_25 DMA_TRIGGERSOURCE_26 DMA_TRIGGERSOURCE_27 DMA_TRIGGERSOURCE_28 DMA_TRIGGERSOURCE_29 DMA_TRIGGERSOURCE_30 DMA_TRIGGERSOURCE_31 This parameter is device specific and trigger sources should be found in device's datasheet. Modified bits are DMAxTSEL of DMACTLx register. |
transferUnitSelect | is the specified size of transfers. Valid values are DMA_UNIT_SRCWORD_DSTWORD [Default] DMA_UNIT_SRCBYTE_DSTWORD DMA_UNIT_SRCWORD_DSTBYTE DMA_UNIT_SRCBYTE_DSTBYTE Modified bits are DMADSTBYTE and DMASRCBYTE of DMAxCTL register. |
triggerTypeSelect | is the type of trigger that the trigger signal needs to be to start a transfer. Valid values are DMA_TRIGGER_RISINGEDGE [Default] DMA_TRIGGER_HIGH - A trigger would be a high signal from the trigger source, to be held high through the length of the transfer(s). Modified bits are DMALEVEL of DMAxCTL register. |
This function initializes the specified DMA channel. Upon successful completion of initializtion of the selected channel the control registers will be cleared and the given variables will be set. Please note, if tranfers 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.
References ASSERT, DMA_CHANNEL_7, DMA_SIZE_SRCBYTE_DSTBYTE, DMA_TRANSFER_REPEATED_BURSTBLOCK, DMA_TRIGGER_HIGH, DMA_TRIGGERSOURCE_31, HWREG, and STATUS_SUCCESS.
void DMA_setTransferSize | ( | unsigned int | baseAddress, |
unsigned char | channelSelect, | ||
unsigned int | transferSize | ||
) |
Sets the specified amount of transfers for the selected DMA channel.
baseAddress | is the base address of the DMA module. |
channelSelect | is 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 |
transferSize | is 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. |
This function sets the specified amount of transfers for the selected DMA channel without having to reinitialize the DMA channel.
References HWREG.
void DMA_setSrcAddress | ( | unsigned int | baseAddress, |
unsigned char | channelSelect, | ||
unsigned long | srcAddress, | ||
unsigned int | directionSelect | ||
) |
Sets source address and the direction that the source address will move after a transfer.
baseAddress | is the base address of the DMA module. |
channelSelect | is 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 |
srcAddress | is the address of where the data will be transfered from. Modified bits are DMAxSA of DMAxSA register. |
directionSelect | is 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. |
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.
References ASSERT, DMA_CHANNEL_7, DMA_DIRECTION_INCREMENT, and HWREG.
void DMA_setDstAddress | ( | unsigned int | baseAddress, |
unsigned char | channelSelect, | ||
unsigned long | dstAddress, | ||
unsigned int | directionSelect | ||
) |
Sets the destination address and the direction that the destination address will move after a transfer.
baseAddress | is the base address of the DMA module. |
channelSelect | is 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 |
dstAddress | is the address of where the data will be transfered to. Modified bits are DMAxDA of DMAxDA register. |
directionSelect | is 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. |
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.
References ASSERT, DMA_CHANNEL_7, DMA_DIRECTION_INCREMENT, and HWREG.
void DMA_enableTransfers | ( | unsigned int | baseAddress, |
unsigned char | channelSelect | ||
) |
Enables transfers to be triggered.
baseAddress | is the base address of the DMA module. |
channelSelect | is 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 |
This function enables transfers upon appropriate trigger of the selected trigger source for the selected channel.
References ASSERT, DMA_CHANNEL_7, and HWREG.
void DMA_disableTransfers | ( | unsigned int | baseAddress, |
unsigned char | channelSelect | ||
) |
Disables transfers from being triggered.
baseAddress | is the base address of the DMA module. |
channelSelect | is 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 |
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.
References ASSERT, DMA_CHANNEL_7, and HWREG.
void DMA_startTransfer | ( | unsigned int | baseAddress, |
unsigned char | channelSelect | ||
) |
Starts a transfer if using the default trigger source selected in initialization.
baseAddress | is the base address of the DMA module. |
channelSelect | is 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 |
Thgis 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 tranfser, and when transferAmount of transfers have been complete in (repeated-)block transfers.
References ASSERT, DMA_CHANNEL_7, and HWREG.
void DMA_enableInterrupt | ( | unsigned int | baseAddress, |
unsigned char | channelSelect | ||
) |
Enables the DMA interrupt for the selected channel.
baseAddress | is the base address of the DMA module. |
channelSelect | is 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 |
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.
References ASSERT, DMA_CHANNEL_7, and HWREG.
void DMA_disableInterrupt | ( | unsigned int | baseAddress, |
unsigned char | channelSelect | ||
) |
Disables the DMA interrupt for the selected channel.
baseAddress | is the base address of the DMA module. |
channelSelect | is 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 |
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.
References ASSERT, DMA_CHANNEL_7, and HWREG.
unsigned short DMA_getInterruptStatus | ( | unsigned int | baseAddress, |
unsigned char | channelSelect | ||
) |
Returns the status of the interrupt flag for the selected channel.
baseAddress | is the base address of the DMA module. |
channelSelect | is 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 the status of the interrupt flag for the selected channel.
References ASSERT, DMA_CHANNEL_7, DMA_INT_ACTIVE, DMA_INT_INACTIVE, and HWREG.
void DMA_clearInterrupt | ( | unsigned int | baseAddress, |
unsigned char | channelSelect | ||
) |
Clears the interrupt flag for the selected channel.
baseAddress | is the base address of the DMA module. |
channelSelect | is 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 |
This function clears the DMA interrupt flag is cleared, so that it no longer asserts.
References ASSERT, DMA_CHANNEL_7, and HWREG.
unsigned short DMA_NMIAbortStatus | ( | unsigned int | baseAddress, |
unsigned char | channelSelect | ||
) |
Returns the status of the NMIAbort for the selected channel.
baseAddress | is the base address of the DMA module. |
channelSelect | is 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 |
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.
References ASSERT, DMA_ABORTED, DMA_CHANNEL_7, DMA_NOTABORTED, and HWREG.
void DMA_clearNMIAbort | ( | unsigned int | baseAddress, |
unsigned char | channelSelect | ||
) |
Clears the status of the NMIAbort to proceed with transfers for the selected channel.
baseAddress | is the base address of the DMA module. |
channelSelect | is 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 |
This function clears the status of the NMI Abort flag for the selected channel to allow for transfers on the channel to continue.
References ASSERT, DMA_CHANNEL_7, and HWREG.
void DMA_disableTransferDuringReadModifyWrite | ( | unsigned int | baseAddress | ) |
Disables the DMA from stopping the CPU during a Read-Modify-Write Operation to start a transfer.
baseAddress | is the base address of the DMA module. |
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.
References HWREG.
void DMA_enableTransferDuringReadModifyWrite | ( | unsigned int | baseAddress | ) |
Enables the DMA to stop the CPU during a Read-Modify-Write Operation to start a transfer.
baseAddress | is the base address of the DMA module. |
This function allows the DMA to stop the CPU in the middle of a read-modify-write operation to transfer data. (default)
References HWREG.
void DMA_enableRoundRobinPriority | ( | unsigned int | baseAddress | ) |
Enables Round Robin prioritzation.
baseAddress | is the base address of the DMA module. |
This function enables Round Robin Prioritization of DMA channels. In the case of Round Robin Prioritization, the last DMA channel to have transfered data then has the last priority, which comes into play when multiple DMA channels are ready to transfer at the same time.
References HWREG.
void DMA_disableRoundRobinPriority | ( | unsigned int | baseAddress | ) |
Disables Round Robin prioritzation.
baseAddress | is the base address of the DMA module. |
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). (default)
References HWREG.
void DMA_enableNMIAbort | ( | unsigned int | baseAddress | ) |
Enables a NMI to interrupt a DMA transfer.
baseAddress | is the base address of the DMA module. |
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.
References HWREG.
void DMA_disableNMIAbort | ( | unsigned int | baseAddress | ) |
Disables any NMI from interrupting a DMA transfer.
baseAddress | is the base address of the DMA module. |
This function disables NMI's from interrupting any DMA transfer currently in progress. (default)
References HWREG.