Data Structures | Typedefs | Functions
UDMAMSP432.h File Reference

Detailed Description

uDMA driver implementation for MSP432.

============================================================================

This driver is intended for use only by drivers that use the uDMA peripheral (e.g., SPI). This driver is mainly used for management of the control table base address of the UDMA peripheral, and to create the DMA error Hwi.

The application should only define the memory for the control table and set up the UDMAMSP432_HWAttrs and UDMAMSP432_Config structures.

The UDMAMSP432 header file should be included in an application as follows:


#include <stdint.h>
#include <stdbool.h>
#include <ti/drivers/dpl/HwiP.h>
Include dependency graph for UDMAMSP432.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  UDMAMSP432_HWAttrs
 UDMAMSP432 Hardware attributes. More...
 
struct  UDMAMSP432_Config
 UDMAMSP432 Global configuration. More...
 
struct  UDMAMSP432_Object
 UDMAMSP432 object. More...
 
struct  UDMAMSP432_Transfer
 UDMAMSP432 Transfer configuration. More...
 
struct  UDMAMSP432_PingPongTransfer
 UDMAMSP432 Ping Pong Transfer configuration. More...
 

Typedefs

typedef void(* UDMAMSP432_ErrorFxn) (uintptr_t arg)
 UDMA error function pointer. More...
 
typedef UDMAMSP432_ConfigUDMAMSP432_Handle
 A handle that is returned from a UDMAMSP432_open() call. More...
 

Functions

void UDMAMSP432_close (UDMAMSP432_Handle handle, uint32_t channelNum, uint8_t intNum)
 Function to close the DMA driver. More...
 
void UDMAMSP432_init ()
 Function to initialize the MSP432 DMA driver. More...
 
UDMAMSP432_Handle UDMAMSP432_open (uint32_t channelNum, uint8_t intNum, uint32_t priority, void(*hwiFxn)(uintptr_t), uintptr_t arg)
 Function to initialize the MSP432 DMA peripheral and corresponding interrupt. More...
 
bool UDMAMSP432_setupTransfer (UDMAMSP432_Transfer *transfer)
 Function to set up a DMA channel for data transfer. More...
 
bool UDMAMSP432_setupPingPongTransfer (UDMAMSP432_PingPongTransfer *transfer)
 Function to set up a DMA channel for ping pong data transfer. More...
 
void UDMAMSP432_PingPongToggleBuffer (UDMAMSP432_PingPongTransfer *transfer)
 Function to toggle between two buffers during ping pong mode. More...
 

Typedef Documentation

§ UDMAMSP432_ErrorFxn

typedef void(* UDMAMSP432_ErrorFxn) (uintptr_t arg)

UDMA error function pointer.

§ UDMAMSP432_Handle

A handle that is returned from a UDMAMSP432_open() call.

Function Documentation

§ UDMAMSP432_close()

void UDMAMSP432_close ( UDMAMSP432_Handle  handle,
uint32_t  channelNum,
uint8_t  intNum 
)

Function to close the DMA driver.

Close a DMA handle returned from UDMAMSP432_open().

Precondition
UDMAMSP432_open() has to be called first. Calling context: Task
Parameters
handleA UDMAMSP432_Handle returned from UDMAMSP432_open()
channelNumA DMA channel defined in dma.h (e.g. DMA_CH0_EUSCIB0TX0)
intNumDMA_INT0 - DMA_INT3 associated with the channelNum
Returns
none
See also
UDMAMSP432_open

§ UDMAMSP432_init()

void UDMAMSP432_init ( )

Function to initialize the MSP432 DMA driver.

The function will set the isOpen flag to false, and should be called prior to opening the DMA driver.

Returns
none
See also
UDMAMSP432_open()

§ UDMAMSP432_open()

UDMAMSP432_Handle UDMAMSP432_open ( uint32_t  channelNum,
uint8_t  intNum,
uint32_t  priority,
void(*)(uintptr_t)  hwiFxn,
uintptr_t  arg 
)

Function to initialize the MSP432 DMA peripheral and corresponding interrupt.

UDMAMSP432_open() opens the DMA peripheral. It calls UDMAMSP432_setupInterrupt() This function can be called multiple times.

Precondition
UDMAMSP432_init() has to be called first. Calling context: Task
Parameters
channelNumA DMA channel defined in dma.h (e.g. DMA_CH0_EUSCIB0TX0)
intNumThe DMA interrupt to be used for the module (DMA_INT0 - DMA_INT3)
priorityThe interrupt priority used in the module
hwiFxnA pointer to the desired ISR to call
argA pointer to a struct of args for the ISR
Returns
UDMAMSP432_Handle on success or NULL if an error has occurred.
See also
UDMAMSP432_close()

§ UDMAMSP432_setupTransfer()

bool UDMAMSP432_setupTransfer ( UDMAMSP432_Transfer transfer)

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
UDMAMSP432_open() has to be called first.
Parameters
transferPointer to a UDMAMSP432_Transfer param struct
Returns
true on success or false if an error has occurred

§ UDMAMSP432_setupPingPongTransfer()

bool UDMAMSP432_setupPingPongTransfer ( UDMAMSP432_PingPongTransfer transfer)

Function to set up a DMA channel for ping pong data transfer.

The function will set the channel control, set the channel transfer, assign the channel, and enable the channel. It will also set up the alternate data structure for use with ping pong mode. For continuous transfering, set transfer.transferMode = UDMA_MODE_PING_PONG. For one-shot across two buffers, set transfer.transferMode = UDMA_MODE_BASIC.

Precondition
UDMAMSP432_open() has to be called first.
Parameters
transferPointer to a UDMAMSP432_PingPongTransfer param struct
Returns
true on success or false if an error has occurred

§ UDMAMSP432_PingPongToggleBuffer()

void UDMAMSP432_PingPongToggleBuffer ( UDMAMSP432_PingPongTransfer transfer)

Function to toggle between two buffers during ping pong mode.

The function will alternate setting the destination buffer between transfer's dmaTransferDestinationOne and dmaTransferDestinationTwo parameters. This should be called in the ISR that the peripheral using DMA is using.

Precondition
UDMAMSP432_setupPingPongTransfer() has to be called first.
Parameters
transferPointer to a UDMAMSP432_PingPongTransfer param struct
© Copyright 1995-2019, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale