|
#define | NUM_DMA_CHANNELS (DMA_SYS_N_DMA_CHANNEL) |
| Number of DMA channels supported by Device. The same can be used to define the number of interrupts. More...
|
|
The DMA header file should be included in an application as follows:
Overview
This driver is intended for use only by drivers that use the DMA peripheral (e.g., SPI). This driver is mainly used for management of the control table base address of the DMA peripheral.
The application should set up the DMAMSPM0_HWAttrs and DMAMSPM0_Config structures.
The DMAMSPM0 header file should be included in an application as follows:
§ NUM_DMA_CHANNELS
#define NUM_DMA_CHANNELS (DMA_SYS_N_DMA_CHANNEL) |
Number of DMA channels supported by Device. The same can be used to define the number of interrupts.
- Note
- DMA_SYS_N_DMA_CHANNEL can be found in the device specific header file (e.g. source/ti/devices/msp/m0p/mspm0g350x.h)
§ DMAMSPM0_close()
void DMAMSPM0_close |
( |
DMA_Regs * |
handle, |
|
|
uint8_t |
channelNum |
|
) |
| |
Function to close the DMA channel.
Close a DMA handle returned from DMAMSPM0_open(). After this function if a new channel can be initialize then just call DMAMSPM0_open(). It is not necessary to call DMA init again.
- Precondition
- DMAMSPM0_open() has to be called first. Calling context: Task
- Parameters
-
handle | A DMAMSPM0_Handle returned from DMAMSPM0_open() |
channelNum | A DMA channel defined in dl_dma.h (e.g. DL_DMA_EVENT_IIDX_DMACHX) |
- Returns
- none
- See also
- DMAMSPM0_open
§ DMAMSPM0_init()
bool DMAMSPM0_init |
( |
void |
| ) |
|
Function to initialize the MSPM0 DMA driver.
The function initialize the DMA HWI, and should be called prior to opening the DMA driver. This function will be called in DMA_Init().
- Returns
- bool : Status if DMA is successfully initialized.
- See also
- DMAMSPM0_open()
§ DMAMSPM0_open()
Function to initialize the MSPM0 DMA peripheral and corresponding interrupt.
DMAMSPM0_open() opens the DMA peripheral. It setup an interrupt for specified channel This function can be called multiple times. This function is being called in DMA_Init().
- Precondition
- DMAMSPM0_init() has to be called first. Calling context: Task
- Parameters
-
index | A DMA config index. |
channelNum | A DMA channel. |
- Returns
- DMAMSPM0_Handle on success or NULL if an error has occurred.
- See also
- DMAMSPM0_close()
§ DMAMSPM0_setupTransfer()
Function to set up a DMA channel for data transfer.
The function will set the channel control, set the channel transfer, assign the channel, and enable the channel.
- Precondition
- DMAMSPM0_open() has to be called first.
- Parameters
-
transfer | Pointer to a DMAMSPM0_Transfer param struct. |
DMACfg | Pointer to the DL_DMA_Config struct. |
- Returns
- true on success or false if an error has occurred.
§ DMA_Init()
One Function that initialize DMA by calling all needed functions in sequence. User may call this function to initialize DMA without calling other needed functions separately.
- Precondition
- Config Parameters. Calling context: Task
- Parameters
-
dmaParams | Pointer to DMA transfer params. |
DMACfg | Pointer to DMA config params. |
noOfChs | No of DMA channels being used |
- Returns
- DMAMSPM0_Handle on success or NULL if an error has occurred.
- See also
- DMAMSPM0_close()
§ DMAMSPM0_disableChannel()
void DMAMSPM0_disableChannel |
( |
DMAMSPM0_Handle |
handle, |
|
|
uint8_t |
dmaChannel |
|
) |
| |
This function will disable the channel and related flags.
- Precondition
- Config Parameters. Calling context: Task
- Parameters
-
handle | DMA Config Handle. |
dmaChannel | DMA Channel |
- Returns
- void
- See also
- DMAMSPM0_close()
§ DMAMSPM0_getCurrTransferSize()
uint16_t DMAMSPM0_getCurrTransferSize |
( |
uint8_t |
dmaChannel | ) |
|
This function will return the DMA transfer size in bytes for given channel.
- Precondition
- Config Parameters. Calling context: Task
- Parameters
-
- Returns
- Returns the current transfer size in bytes.
- See also
- DMAMSPM0_close()
§ DMA_Params_init()
This function will initialize the default params.
- Precondition
- Config Parameters. Calling context: Task
- Parameters
-
params | Pointer to the DMA Transfer Params |
- Returns
- void
- See also
- DMAMSPM0_close()
§ DMAMSPM0_copyDMAParams()
void DMAMSPM0_copyDMAParams |
( |
DMAMSPM0_Transfer * |
dmaParams, |
|
|
DL_DMA_Config * |
dmaConfig |
|
) |
| |
This function will extract parameters from DMA Config struct to DMA Transfer struct.
- Precondition
- Config Parameters. Calling context: Task
- Parameters
-
dmaParams | Current DMA Transfer Params. |
dmaConfig | DMA Config Params. |
- Returns
- void
- See also
- DMAMSPM0_close()