Data Structures | Macros | Typedefs | Functions
UDMACC26XX.h File Reference

Detailed Description

UDMACC26XX driver implementation.

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

Driver include

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

Overview

The UDMACC26XX driver currently only supports being used by the SPICC26XXDMA.h. module. In other words, the application should never call any of the functions in this file.

General Behavior

This driver is used implicitly by the SPICC26XXDMA.h driver so user should not have to interface to this driver from the application. The uDMA HW makes use of a control table in RAM which must be 1024 bytes aligned. The default base address of this control table is 0x20000400, however this can be changed by simply changing UDMACC26XX_CONFIG_BASE. The SPICC26XXDMA.h supports SPI0 and SPI1, and uses both TX and RX DMA channels. Each control table entry is 16 bytes, so if an application uses both SSI0 and SSI1 the total RAM usage will be 4*16=64 bytes. If only one SSI module is used only 2*16=32 bytes of RAM is used. Please see Use cases for example.

Error handling

Error handling is handled by the overlying driver which uses the DMA, currently this is only SPICC26XXDMA.h

Power management

Power management is handled by the overlying driver which uses the DMA, currently this is only SPICC26XXDMA.h

Supported functions

Note that these functions should never be called from the application, they are only called from other drivers. They are however included here for completeness:

API function Description
UDMACC26XX_open() Initialize and enable the uDMA HW and set system dependencies.
UDMACC26XX_close() Disable uUDMA HW and release system dependencies
Note
These functions should not be called by code. These functions are called by drivers who're using the DMA.

Unsupported Functionality

No known limitations

Use Cases

The DMA is only used together with the SPICC26XXDMA.h driver, so the application should never call any of the functions in this driver directly. The only thing that the application is allowed to modify is the base address of the DMA control table in RAM. (Default value is 0x2000_0400) Remember it must be 1024 bytes aligned.

#define UDMACC26XX_CONFIG_BASE 0x2000_0400

Instrumentation

The SPI driver interface produces log statements if instrumentation is enabled.

Diagnostics Mask Log details
Diags_USER1 basic SPI operations performed
Diags_USER2 detailed SPI operations performed

#include <stdint.h>
#include <stdbool.h>
#include <ti/drivers/Power.h>
#include <ti/drivers/power/PowerCC26XX.h>
#include <ti/devices/DeviceFamily.h>
#include <DeviceFamily_constructPath(inc/hw_types.h)>
#include <DeviceFamily_constructPath(driverlib/udma.h)>
Include dependency graph for UDMACC26XX.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  UDMACC26XX_Object
 UDMACC26XX object. More...
 
struct  UDMACC26XX_HWAttrs
 UDMACC26XX hardware attributes. More...
 
struct  UDMACC26XX_Config
 UDMACC26XX Global configuration. More...
 

Macros

#define UDMACC26XX_CONFIG_BASE   0x20001800
 
#define UDMACC26XX_SET_TRANSFER_SIZE(SIZE)   (((SIZE - 1) << UDMA_XFER_SIZE_S) & UDMA_XFER_SIZE_M)
 
#define UDMACC26XX_GET_TRANSFER_SIZE(CONTROL)   (((CONTROL & UDMA_XFER_SIZE_M) >> UDMA_XFER_SIZE_S) + 1)
 

Typedefs

typedef struct UDMACC26XX_Object UDMACC26XX_Object
 UDMACC26XX object. More...
 
typedef struct UDMACC26XX_HWAttrs UDMACC26XX_HWAttrs
 UDMACC26XX hardware attributes. More...
 
typedef struct UDMACC26XX_Config UDMACC26XX_Config
 UDMACC26XX Global configuration. More...
 
typedef struct UDMACC26XX_ConfigUDMACC26XX_Handle
 A handle that is returned from a UDMACC26XX_open() call. More...
 

Functions

void UDMACC26XX_hwiIntFxn (uintptr_t callbacks)
 
__STATIC_INLINE void UDMACC26XX_init (UDMACC26XX_Handle handle)
 Function to initialize the CC26XX DMA driver. More...
 
UDMACC26XX_Handle UDMACC26XX_open ()
 Function to initialize the CC26XX DMA peripheral. More...
 
__STATIC_INLINE void UDMACC26XX_channelEnable (UDMACC26XX_Handle handle, uint32_t channelBitMask)
 
__STATIC_INLINE bool UDMACC26XX_channelDone (UDMACC26XX_Handle handle, uint32_t channelBitMask)
 
__STATIC_INLINE void UDMACC26XX_clearInterrupt (UDMACC26XX_Handle handle, uint32_t channelBitMask)
 
__STATIC_INLINE void UDMACC26XX_channelDisable (UDMACC26XX_Handle handle, uint32_t channelBitMask)
 
__STATIC_INLINE void UDMACC26XX_disableAttribute (UDMACC26XX_Handle handle, uint32_t channelNum, uint32_t attr)
 
void UDMACC26XX_close (UDMACC26XX_Handle handle)
 Function to close the DMA driver. More...
 

Macro Definition Documentation

§ UDMACC26XX_CONFIG_BASE

#define UDMACC26XX_CONFIG_BASE   0x20001800

Base address for the DMA control table, must be 1024 bytes aligned

§ UDMACC26XX_SET_TRANSFER_SIZE

#define UDMACC26XX_SET_TRANSFER_SIZE (   SIZE)    (((SIZE - 1) << UDMA_XFER_SIZE_S) & UDMA_XFER_SIZE_M)

Make sure DMA control table base address is 1024 bytes aligned

Compiler specific macros to allocate DMA control table entries

Sets the DMA transfer size in number of items

§ UDMACC26XX_GET_TRANSFER_SIZE

#define UDMACC26XX_GET_TRANSFER_SIZE (   CONTROL)    (((CONTROL & UDMA_XFER_SIZE_M) >> UDMA_XFER_SIZE_S) + 1)

Gets the DMA transfer size in number of items

Typedef Documentation

§ UDMACC26XX_Object

UDMACC26XX object.

§ UDMACC26XX_HWAttrs

UDMACC26XX hardware attributes.

§ UDMACC26XX_Config

UDMACC26XX Global configuration.

§ UDMACC26XX_Handle

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

Function Documentation

§ UDMACC26XX_hwiIntFxn()

void UDMACC26XX_hwiIntFxn ( uintptr_t  callbacks)

§ UDMACC26XX_init()

__STATIC_INLINE void UDMACC26XX_init ( UDMACC26XX_Handle  handle)

Function to initialize the CC26XX DMA driver.

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

Precondition
Calling context: Hwi, Swi, Task
Returns
none
See also
UDMACC26XX_open()

References UDMACC26XX_Config::object, and UDMACC26XX_open().

§ UDMACC26XX_open()

UDMACC26XX_Handle UDMACC26XX_open ( )

Function to initialize the CC26XX DMA peripheral.

The function will set a dependency on the peripheral power domain, i.e. power up the module and enable the clock. Note this function always uses the first DMA entry in the global UDMACC26XX_config list.

Precondition
UDMACC26XX_init() has to be called first. Calling context: Task
Returns
UDMACC26XX_Handle on success or NULL if error or if it has been already opened
See also
UDMACC26XX_close()

Referenced by UDMACC26XX_init().

§ UDMACC26XX_channelEnable()

__STATIC_INLINE void UDMACC26XX_channelEnable ( UDMACC26XX_Handle  handle,
uint32_t  channelBitMask 
)

§ UDMACC26XX_channelDone()

__STATIC_INLINE bool UDMACC26XX_channelDone ( UDMACC26XX_Handle  handle,
uint32_t  channelBitMask 
)

§ UDMACC26XX_clearInterrupt()

__STATIC_INLINE void UDMACC26XX_clearInterrupt ( UDMACC26XX_Handle  handle,
uint32_t  channelBitMask 
)

§ UDMACC26XX_channelDisable()

__STATIC_INLINE void UDMACC26XX_channelDisable ( UDMACC26XX_Handle  handle,
uint32_t  channelBitMask 
)

§ UDMACC26XX_disableAttribute()

__STATIC_INLINE void UDMACC26XX_disableAttribute ( UDMACC26XX_Handle  handle,
uint32_t  channelNum,
uint32_t  attr 
)

§ UDMACC26XX_close()

void UDMACC26XX_close ( UDMACC26XX_Handle  handle)

Function to close the DMA driver.

Will disable the DMA hardware, release the power dependency and destruct the HWI interrupt.

Precondition
UDMACC26XX_open() has to be called first. Calling context: Task
Parameters
handleA SPI_Handle returned from SPI_open()
Returns
none
See also
SPICC26XXDMA_open

Referenced by UDMACC26XX_disableAttribute().

© Copyright 1995-2019, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale