UDMALPF3 driver implementation.
============================================================================
The UDMALPF3 header file should be included in an application as follows:
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.
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 is handled by the overlying driver which uses the DMA.
Power management is handled by the overlying driver which uses the DMA.
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. |
No known limitations
In a system that has available SPI and UART peripherals, the following scenarios are possible:
#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)>
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 |
#define UDMALPF3_CONFIG_BASE 0x20000400 |
Base address for the DMA control table, must be 1024 bytes aligned
#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
#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
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).
__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 | ||
) |
const UDMALPF3_Config UDMALPF3_config |