DMAWFF3.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023-2025, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
88 #ifndef ti_drivers_DMAWFF3__include
89 #define ti_drivers_DMAWFF3__include
90 
91 #include <stdint.h>
92 #include <stdbool.h>
93 
94 #include <ti/drivers/Power.h>
95 
96 #include <ti/devices/DeviceFamily.h>
97 #include DeviceFamily_constructPath(inc/hw_types.h)
98 #include DeviceFamily_constructPath(driverlib/dma.h)
99 
100 #ifdef __cplusplus
101 extern "C" {
102 #endif
103 
109 typedef enum
110 {
112  DMAWFF3_CONFIG_SRC_PTR_WRAP = DMA_CONFIG_SRC_PTR_WRAP,
114  DMAWFF3_CONFIG_DST_PTR_WRAP = DMA_CONFIG_DST_PTR_WRAP,
116  DMAWFF3_CONFIG_FORCE_REQ = DMA_CONFIG_FORCE_REQ,
118  DMAWFF3_CONFIG_SRC_PTR_FIFO = DMA_CONFIG_SRC_PTR_FIFO,
120  DMAWFF3_CONFIG_DST_PTR_FIFO = DMA_CONFIG_DST_PTR_FIFO,
122  DMAWFF3_CONFIG_RX = DMA_CONFIG_RX,
124  DMAWFF3_CONFIG_TX = DMA_CONFIG_TX,
126  DMAWFF3_CONFIG_CLEAR_AT_JOB_START = DMA_CONFIG_CLEAR_AT_JOB_START,
128 
133 typedef enum
134 {
136  DMAWFF3_WORD_SIZE_1B = DMA_WORD_SIZE_1B,
138  DMAWFF3_WORD_SIZE_2B = DMA_WORD_SIZE_2B,
140  DMAWFF3_WORD_SIZE_4B = DMA_WORD_SIZE_4B,
142 
147 typedef enum
148 {
150  DMAWFF3_BLOCK_SIZE_1B = DMA_WORD_SIZE_1B,
152  DMAWFF3_BLOCK_SIZE_2B = DMA_WORD_SIZE_2B,
154  DMAWFF3_BLOCK_SIZE_4B = DMA_WORD_SIZE_4B,
156 
161 typedef enum
162 {
163  DMAWFF3_PERIPH_UARTLIN_0 = DMA_PERIPH_UARTLIN_0,
164  DMAWFF3_PERIPH_UARTLIN_1 = DMA_PERIPH_UARTLIN_1,
165  DMAWFF3_PERIPH_SPI_0 = DMA_PERIPH_SPI_0,
166  DMAWFF3_PERIPH_SPI_1 = DMA_PERIPH_SPI_1,
167  DMAWFF3_PERIPH_I2C_0 = DMA_PERIPH_I2C_0,
168  DMAWFF3_PERIPH_I2C_1 = DMA_PERIPH_I2C_1,
169  DMAWFF3_PERIPH_SDMMC = DMA_PERIPH_SDMMC,
170  DMAWFF3_PERIPH_SDIO = DMA_PERIPH_SDIO,
171  DMAWFF3_PERIPH_MCAN = DMA_PERIPH_MCAN,
172  DMAWFF3_PERIPH_ADC = DMA_PERIPH_ADC,
173  DMAWFF3_PERIPH_PDM = DMA_PERIPH_PDM,
174  DMAWFF3_PERIPH_HIF = DMA_PERIPH_HIF,
175  DMAWFF3_PERIPH_UARTLIN_2 = DMA_PERIPH_UARTLIN_2,
177 
191 extern void DMAWFF3_disableChannel(uint32_t channel);
192 
204 extern uint16_t DMAWFF3_getRemainingBytes(uint32_t channel);
205 
215 extern void DMAWFF3_init(void);
216 
226 extern void DMAWFF3_initChannel(uint32_t channel);
227 
259 __STATIC_INLINE void DMAWFF3_configureChannel(uint32_t channel,
260  uint8_t blockSize,
261  DMAWFF3_WordSize wordSize,
262  DMAWFF3_ChConfig config)
263 {
264  /* Configure DMA channel */
265  DMAConfigureChannel(channel, blockSize, wordSize, config);
266 }
267 
280 __STATIC_INLINE void DMAWFF3_connectChannel(uint32_t channel, DMAWFF3_Peripheral peripheral)
281 {
282  /* Connect DMA channel to peripheral */
283  DMAInitChannel(channel, (DMAPeripheral)peripheral);
284 }
285 
297 __STATIC_INLINE void DMAWFF3_clearInterrupt(uint32_t channelBitmask)
298 {
299  /* Clear DMA interrupts */
300  DMAClearInt(channelBitmask);
301 }
302 
322 __STATIC_INLINE void DMAWFF3_startTransaction(uint32_t channel,
323  const uint32_t *srcStartAddr,
324  uint32_t *dstStartAddr,
325  uint16_t transLenByte,
326  bool remainingBytesBurst)
327 {
328  /* Start DMA transaction */
329  DMAStartTransaction(channel, srcStartAddr, dstStartAddr, transLenByte, remainingBytesBurst);
330 }
331 
332 #ifdef __cplusplus
333 }
334 #endif
335 
336 #endif /* ti_drivers_DMAWFF3__include */
DMAWFF3_WordSize
Definitions for the wordSize argument of the DMAWFF3_configureChannel() function. ...
Definition: DMAWFF3.h:133
Definition: DMAWFF3.h:165
Definition: DMAWFF3.h:169
Definition: DMAWFF3.h:175
Definition: DMAWFF3.h:136
Definition: DMAWFF3.h:170
__STATIC_INLINE void DMAWFF3_startTransaction(uint32_t channel, const uint32_t *srcStartAddr, uint32_t *dstStartAddr, uint16_t transLenByte, bool remainingBytesBurst)
Function to start a DMA transaction.
Definition: DMAWFF3.h:322
Definition: DMAWFF3.h:172
Power Manager.
Definition: DMAWFF3.h:138
Definition: DMAWFF3.h:118
__STATIC_INLINE void DMAWFF3_connectChannel(uint32_t channel, DMAWFF3_Peripheral peripheral)
Definition: DMAWFF3.h:280
__STATIC_INLINE void DMAWFF3_clearInterrupt(uint32_t channelBitmask)
Definition: DMAWFF3.h:297
Definition: DMAWFF3.h:174
Definition: DMAWFF3.h:140
void DMAWFF3_initChannel(uint32_t channel)
Function to initialize a DMA channel.
DMAWFF3_Peripheral
Definitions for the peripheral argument of the DMAWFF3_connectChannel() function. ...
Definition: DMAWFF3.h:161
Definition: DMAWFF3.h:168
Definition: DMAWFF3.h:163
Definition: DMAWFF3.h:114
Definition: DMAWFF3.h:152
__STATIC_INLINE void DMAWFF3_configureChannel(uint32_t channel, uint8_t blockSize, DMAWFF3_WordSize wordSize, DMAWFF3_ChConfig config)
Function to configure the given DMA channel.
Definition: DMAWFF3.h:259
void DMAWFF3_disableChannel(uint32_t channel)
Function to disable a DMA channel.
void DMAWFF3_init(void)
Function to initialize the WFF3 DMA driver and peripheral.
Definition: DMAWFF3.h:173
Definition: DMAWFF3.h:120
Definition: DMAWFF3.h:164
Definition: DMAWFF3.h:126
Definition: DMAWFF3.h:116
Definition: DMAWFF3.h:124
Definition: DMAWFF3.h:167
uint16_t DMAWFF3_getRemainingBytes(uint32_t channel)
Function to get the number of remaining bytes of a DMA transaction.
Definition: DMAWFF3.h:112
Definition: DMAWFF3.h:171
Definition: DMAWFF3.h:150
DMAWFF3_BlockSize
Definitions for the blockSize argument of the DMAWFF3_configureChannel() function.
Definition: DMAWFF3.h:147
Definition: DMAWFF3.h:154
Definition: DMAWFF3.h:166
DMAWFF3_ChConfig
Definitions for the config argument of the DMAWFF3_configureChannel() function. The argument value mu...
Definition: DMAWFF3.h:109
Definition: DMAWFF3.h:122
© Copyright 1995-2026, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale