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... | |
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.
channelSelect | is the specified channel to clear the interrupt flag for. Valid values are:
|
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.
channelSelect | is the specified channel to clear the NMI Abort flag for. Valid values are:
|
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.
channelSelect | is the specified channel to disable the interrupt for. Valid values are:
|
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.
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).
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.
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.
channelSelect | is the specified channel to disable transfers for. Valid values are:
|
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.
channelSelect | is the specified channel to enable the interrupt for. Valid values are:
|
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.
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.
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.
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.
channelSelect | is the specified channel to enable transfer for. Valid values are:
|
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.
channelSelect | is the specified channel to return the interrupt flag status from. Valid values are:
|
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.
channelSelect | is the specified channel to return the status of the NMI Abort flag for. Valid values are:
|
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.
channelSelect | is the specified channel to set source address direction for. Valid values are:
|
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.
param | is the pointer to struct for initialization. |
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.
channelSelect | is the specified channel to set the destination address direction for. Valid values are:
|
dstAddress | is the address of where the data will be transferred to. Modified bits are DMAxDA of DMAxDA register. |
directionSelect | is the specified direction of the destination address after a transfer. Valid values are:
|
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.
channelSelect | is the specified channel to set source address direction for. Valid values are:
|
srcAddress | is the address of where the data will be transferred from. Modified bits are DMAxSA of DMAxSA register. |
directionSelect | is the specified direction of the source address after a transfer. Valid values are:
|
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.
channelSelect | is the specified channel to set source address direction for. Valid values are:
|
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. |
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.
channelSelect | is the specified channel to start transfers for. Valid values are:
|