TI-RTOS Drivers  tidrivers_full_2_20_00_08
Data Structures | Typedefs | Functions
UDMAMSP432.h File Reference

Detailed Description

uDMA driver implementation for MSP432.

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

This driver is intended for use only by TI-RTOS 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/ports/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...
 

Typedefs

typedef void(* UDMAMSP432_ErrorFxn) (uintptr_t arg)
 UDMA error function pointer. More...
 
typedef struct UDMAMSP432_HWAttrs UDMAMSP432_HWAttrs
 UDMAMSP432 Hardware attributes. More...
 
typedef struct UDMAMSP432_Config UDMAMSP432_Config
 UDMAMSP432 Global configuration. More...
 
typedef struct UDMAMSP432_ConfigUDMAMSP432_Handle
 A handle that is returned from a UDMAMSP432_open() call. More...
 
typedef struct UDMAMSP432_Object UDMAMSP432_Object
 UDMAMSP432 object. More...
 

Functions

void UDMAMSP432_close (UDMAMSP432_Handle handle)
 Function to close the DMA driver. More...
 
void UDMAMSP432_init ()
 Function to initialize the MSP432 DMA driver. More...
 
UDMAMSP432_Handle UDMAMSP432_open ()
 Function to initialize the MSP432 DMA peripheral. More...
 

Typedef Documentation

typedef void(* UDMAMSP432_ErrorFxn) (uintptr_t arg)

UDMA error function pointer.

UDMAMSP432 Hardware attributes.

This structure contains the base address of the uDMA control table, and uDMA error interrupt attributes.

The control table is used by the uDMA controller to store channel control structures. The control table can be located anywhere in system memory, but must be contiguous and aligned on a 1024-byte boundary.

dmaErrorFxn is the uDMA peripheral's error interrupt handler.

intPriority is priority of the uDMA peripheral's error interrupt, as defined by the underlying OS. It is passed unmodified to the underlying OS's interrupt handler creation code, so you need to refer to the OS documentation for usage. For example, for SYS/BIOS applications, refer to the ti.sysbios.family.arm.m3.Hwi documentation for SYS/BIOS usage of interrupt priorities. If the driver uses the ti.drivers.ports interface instead of making OS calls directly, then the HwiP port handles the interrupt priority in an OS specific way. In the case of the SYS/BIOS port, intPriority is passed unmodified to Hwi_create().

A sample structure is shown below:

1 #include <driverlib/udma.h>
2 
3 #if defined(__TI_COMPILER_VERSION__)
4 #pragma DATA_ALIGN(dmaControlTable, 1024)
5 #elif defined(__IAR_SYSTEMS_ICC__)
6 #pragma data_alignment=1024
7 #elif defined(__GNUC__)
8 __attribute__ ((aligned (1024)))
9 #endif
10 
11 static tDMAControlTable dmaControlTable[64];
12 
13 #include <ti/drivers/dma/UDMAMSP432.h>
14 
15 UDMAMSP432_Object udmaMSP432Object;
16 
17 const UDMAMSP432_HWAttrs udmaMSP432HWAttrs = {
18  .controlBaseAddr = (void *)dmaControlTable,
19  .dmaErrorFxn = UDMAMSP432_errorFxn,
20  .intNum = INT_UDMAERR,
21  .intPriority = (~0)
22 };

UDMAMSP432 Global configuration.

The UDMAMSP432_Config structure contains pointers used by the UDMAMSP432 driver.

This structure needs to be defined before calling UDMAMSP432_init() and it must not be changed thereafter.

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

UDMAMSP432 object.

The application must not access any member variables of this structure!

Function Documentation

void UDMAMSP432_close ( UDMAMSP432_Handle  handle)

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()
Returns
none
See also
UDMAMSP432_open
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_Handle UDMAMSP432_open ( )

Function to initialize the MSP432 DMA peripheral.

UDMAMSP432_open() can be called multiple times. *

Precondition
UDMAMSP432_init() has to be called first. Calling context: Task
Returns
UDMAMSP432_Handle on success or NULL if an error has occurred.
See also
UDMAMSP432_close()
Copyright 2016, Texas Instruments Incorporated