MSPM0G1X0X_G3X0X TI-Driver Library  1.20.01.06
Data Structures | Macros | Typedefs | Functions | Variables
Direct Memory Access (DMA)

Data Structures

struct  DMAMSPM0_HWAttrs
 DMAMSPM0 Hardware attributes. More...
 
struct  DMAMSPM0_Transfer
 DMAMSPM0 channel based Transfer configuration. More...
 
struct  DMAMSPM0_Object
 DMAMSPM0 object. More...
 
struct  DMAMSPM0_Cfg
 DMAMSPM0 Global configuration. More...
 

Macros

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

Typedefs

typedef void(* DMAMSPM0_IsrFxn) (uintptr_t arg)
 DMA error function pointers.
 
typedef DMAMSPM0_CfgDMAMSPM0_Handle
 A handle that is returned from a DMAMSPM0_open() call.
 

Functions

void DMAMSPM0_close (DMA_Regs *handle, uint8_t channelNum)
 Function to close the DMA channel. More...
 
bool DMAMSPM0_init (void)
 Function to initialize the MSPM0 DMA driver. More...
 
DMAMSPM0_Handle DMAMSPM0_open (uint_least8_t index, uint8_t channelNum)
 Function to initialize the MSPM0 DMA peripheral and corresponding interrupt. More...
 
bool DMAMSPM0_setupTransfer (DMAMSPM0_Transfer *transfer, DL_DMA_Config *DMACfg)
 Function to set up a DMA channel for data transfer. More...
 
DMAMSPM0_Handle DMA_Init (DMAMSPM0_Transfer *dmaParams, DL_DMA_Config *DMACfg, uint8_t noOfChs)
 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. More...
 
void DMAMSPM0_disableChannel (DMAMSPM0_Handle handle, uint8_t dmaChannel)
 This function will disable the channel and related flags. More...
 
uint16_t DMAMSPM0_getCurrTransferSize (uint8_t dmaChannel)
 This function will return the DMA transfer size in bytes for given channel. More...
 
void DMA_Params_init (DMAMSPM0_Transfer *params)
 This function will initialize the default params. More...
 
void DMAMSPM0_copyDMAParams (DMAMSPM0_Transfer *dmaParams, DL_DMA_Config *dmaConfig)
 This function will extract parameters from DMA Config struct to DMA Transfer struct. More...
 

Variables

const DMAMSPM0_Cfg DMAMSPM0_Config []
 Instance of a DMA Config structure.
 
const uint_least8_t DMA_Count
 Number of DMA channels.
 

Detailed Description

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:

Macro Definition Documentation

§ 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)

Function Documentation

§ 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
handleA DMAMSPM0_Handle returned from DMAMSPM0_open()
channelNumA 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()

DMAMSPM0_Handle DMAMSPM0_open ( uint_least8_t  index,
uint8_t  channelNum 
)

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
indexA DMA config index.
channelNumA DMA channel.
Returns
DMAMSPM0_Handle on success or NULL if an error has occurred.
See also
DMAMSPM0_close()

§ DMAMSPM0_setupTransfer()

bool DMAMSPM0_setupTransfer ( DMAMSPM0_Transfer transfer,
DL_DMA_Config *  DMACfg 
)

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
transferPointer to a DMAMSPM0_Transfer param struct.
DMACfgPointer to the DL_DMA_Config struct.
Returns
true on success or false if an error has occurred.

§ DMA_Init()

DMAMSPM0_Handle DMA_Init ( DMAMSPM0_Transfer dmaParams,
DL_DMA_Config *  DMACfg,
uint8_t  noOfChs 
)

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
dmaParamsPointer to DMA transfer params.
DMACfgPointer to DMA config params.
noOfChsNo 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
handleDMA Config Handle.
dmaChannelDMA 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
dmaChannelDMA Channel
Returns
Returns the current transfer size in bytes.
See also
DMAMSPM0_close()

§ DMA_Params_init()

void DMA_Params_init ( DMAMSPM0_Transfer params)

This function will initialize the default params.

Precondition
Config Parameters. Calling context: Task
Parameters
paramsPointer 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
dmaParamsCurrent DMA Transfer Params.
dmaConfigDMA Config Params.
Returns
void
See also
DMAMSPM0_close()
© Copyright 1995-2023, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale