Data Structures | Macros | Functions | Variables
UDMALPF3.h File Reference

Detailed Description

UDMALPF3 driver implementation.

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

Driver include

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

Overview

The UDMALPF3 driver currently only supports internal use by the drivers that use the uDMA peripheral (e.g., SPILPF3DMA). In other words, the application should never call any of the functions in this file.

General Behavior

This driver is used implicitly by other drivers (e.g., the SPILPF3DMA driver) so users should not have to interface to this driver from the application. The uDMA hardware 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 simply by defining UDMALPF3_CONFIG_BASE. The SPILPF3DMA.h supports SPI0, and uses both TX and RX DMA channels. Each control table entry is 16 bytes, so if an application uses SPI0 the total RAM usage will be 2*16=32 bytes. Please see [Use cases] (UDMA_23XX_USE_CASES) for example.

Error handling

Error handling is handled by the overlying driver which uses the DMA.

Power management

Power management is handled by the overlying driver which uses the DMA.

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
UDMALPF3_init() Initialize the uDMA HW.
Note
These functions should not be called by code. These functions are called by drivers using the DMA.

Unsupported Functionality

No known limitations

Use Cases

In a system that has available SPI and UART peripherals, the following scenarios are possible:

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

Go to the source code of this file.

Data Structures

struct  UDMALPF3_Config
 UDMALPF3 Global configuration. More...
 

Macros

#define UDMALPF3_CONFIG_BASE   0x20000400
 
#define UDMALPF3_SET_TRANSFER_SIZE(SIZE)   (((SIZE - 1) << UDMA_XFER_SIZE_S) & UDMA_XFER_SIZE_M)
 
#define UDMALPF3_GET_TRANSFER_SIZE(CONTROL)   (((CONTROL & UDMA_XFER_SIZE_M) >> UDMA_XFER_SIZE_S) + 1)
 

Functions

void UDMALPF3_init (void)
 Function to initialize the LPF3 DMA driver and peripheral. More...
 
__STATIC_INLINE void UDMALPF3_channelEnable (uint32_t channelBitMask)
 
__STATIC_INLINE bool UDMALPF3_channelDone (uint32_t channelBitMask)
 
__STATIC_INLINE void UDMALPF3_clearInterrupt (uint32_t channelBitMask)
 
__STATIC_INLINE void UDMALPF3_channelDisable (uint32_t channelBitMask)
 
__STATIC_INLINE void UDMALPF3_disableAttribute (uint32_t channelBitMask, uint32_t attr)
 

Variables

const UDMALPF3_Config UDMALPF3_config
 

Macro Definition Documentation

§ UDMALPF3_CONFIG_BASE

#define UDMALPF3_CONFIG_BASE   0x20000400

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

§ UDMALPF3_SET_TRANSFER_SIZE

#define UDMALPF3_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

§ UDMALPF3_GET_TRANSFER_SIZE

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

Gets the DMA transfer size in number of items

Function Documentation

§ UDMALPF3_init()

void UDMALPF3_init ( void  )

Function to initialize the LPF3 DMA driver and peripheral.

The function will initialize the DMA peripheral and set the Control table base address. The call powers up and clocks the DMA module only during initialization. Each driver using DMA must set a power dependency on the module before starting to use it (e.g. when opening the driver) and release that dependency when DMA is no longer needed (e.g. when closing the driver).

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

§ UDMALPF3_channelEnable()

__STATIC_INLINE void UDMALPF3_channelEnable ( uint32_t  channelBitMask)

§ UDMALPF3_channelDone()

__STATIC_INLINE bool UDMALPF3_channelDone ( uint32_t  channelBitMask)

§ UDMALPF3_clearInterrupt()

__STATIC_INLINE void UDMALPF3_clearInterrupt ( uint32_t  channelBitMask)

§ UDMALPF3_channelDisable()

__STATIC_INLINE void UDMALPF3_channelDisable ( uint32_t  channelBitMask)

§ UDMALPF3_disableAttribute()

__STATIC_INLINE void UDMALPF3_disableAttribute ( uint32_t  channelBitMask,
uint32_t  attr 
)

Variable Documentation

§ UDMALPF3_config

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