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

Detailed Description

uDMA driver implementation for CC3200.

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

This driver is intended for use only by TI-RTOS drivers that use the uDMA peripheral (e.g., SPI and I2S). This driver is mainly used for Power management of the UDMA peripheral.

The application should only define the memory for the control table and set up the UDMACC3200_HWAttrs and UDMACC3200_Config structures.

The UDMACC3200 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 UDMACC3200.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  UDMACC3200_HWAttrs
 UDMACC3200 Hardware attributes. More...
 
struct  UDMACC3200_Config
 UDMACC3200 Global configuration. More...
 
struct  UDMACC3200_Object
 UDMACC3200 object. More...
 

Typedefs

typedef void(* UDMACC3200_ErrorFxn) (uintptr_t arg)
 UDMA error function pointer. More...
 
typedef struct UDMACC3200_HWAttrs UDMACC3200_HWAttrs
 UDMACC3200 Hardware attributes. More...
 
typedef struct UDMACC3200_Config UDMACC3200_Config
 UDMACC3200 Global configuration. More...
 
typedef struct UDMACC3200_ConfigUDMACC3200_Handle
 A handle that is returned from a UDMACC3200_open() call. More...
 
typedef struct UDMACC3200_Object UDMACC3200_Object
 UDMACC3200 object. More...
 

Functions

void UDMACC3200_close (UDMACC3200_Handle handle)
 Function to close the DMA driver. More...
 
void UDMACC3200_init ()
 Function to initialize the CC3200 DMA driver. More...
 
UDMACC3200_Handle UDMACC3200_open ()
 Function to initialize the CC3200 DMA peripheral. More...
 

Typedef Documentation

typedef void(* UDMACC3200_ErrorFxn) (uintptr_t arg)

UDMA error function pointer.

UDMACC3200 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/UDMACC3200.h>
14 
15 UDMACC3200_Object udmaCC3200Object;
16 
17 const UDMACC3200_HWAttrs udmaCC3200HWAttrs = {
18  .controlBaseAddr = (void *)dmaControlTable,
19  .dmaErrorFxn = UDMACC3200_errorFxn,
20  .intNum = INT_UDMAERR,
21  .intPriority = (~0)
22 };

UDMACC3200 Global configuration.

The UDMACC3200_Config structure contains pointers used by the UDMACC3200 driver.

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

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

UDMACC3200 object.

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

Function Documentation

void UDMACC3200_close ( UDMACC3200_Handle  handle)

Function to close the DMA driver.

This function releases Power dependency on UDMA that was previously set with a call to UDMACC3200_open(). If there is only one outstanding UDMACC3200_open() call (i.e. all but one UDMACC3200_open() calls have been matched by a corresponding call to UDMACC3200_close()), this function will disable the UDMA.

Precondition
UDMACC3200_open() has to be called first. Calling context: Task
Parameters
handleA UDMACC3200_Handle returned from UDMACC3200_open()
Returns
none
See also
UDMACC3200_open
void UDMACC3200_init ( )

Function to initialize the CC3200 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
UDMACC3200_open()
UDMACC3200_Handle UDMACC3200_open ( )

Function to initialize the CC3200 DMA peripheral.

UDMACC3200_open() can be called multiple times. Each time the function is called, it will set a dependency on the peripheral and enable the clock. The Power dependency count on the UDMA will be equal to the number of outstanding calls to UDMACC3200_open(). Calling UDMACC3200_close() will decrement the Power dependency count, and the last call to UDMACC3200_close() will disable the UDMA.

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