VSF Documented
sthal_dma.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2024 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18#ifndef __ST_HAL_DMA_H__
19#define __ST_HAL_DMA_H__
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
25/*============================ INCLUDES ======================================*/
26
27#include "sthal_def.h"
28
29/*============================ MACROS ========================================*/
30
31#define HAL_DMA_ERROR_NONE 0x00000000U
32#define HAL_DMA_ERROR_TE 0x00000001U
33#define HAL_DMA_ERROR_FE 0x00000002U
34#define HAL_DMA_ERROR_DME 0x00000004U
35#define HAL_DMA_ERROR_TIMEOUT 0x00000020U
36#define HAL_DMA_ERROR_PARAM 0x00000040U
37#define HAL_DMA_ERROR_NO_XFER 0x00000080U
38#define HAL_DMA_ERROR_NOT_SUPPORTED 0x00000100U
39
40#define DMA_CHANNEL_0 0x00000000U
41#define DMA_CHANNEL_1 0x02000000U
42#define DMA_CHANNEL_2 0x04000000U
43#define DMA_CHANNEL_3 0x06000000U
44#define DMA_CHANNEL_4 0x08000000U
45#define DMA_CHANNEL_5 0x0A000000U
46#define DMA_CHANNEL_6 0x0C000000U
47#define DMA_CHANNEL_7 0x0E000000U
48#if defined(DMA_SxCR_CHSEL_3)
49# define DMA_CHANNEL_8 0x10000000U
50# define DMA_CHANNEL_9 0x12000000U
51# define DMA_CHANNEL_10 0x14000000U
52# define DMA_CHANNEL_11 0x16000000U
53# define DMA_CHANNEL_12 0x18000000U
54# define DMA_CHANNEL_13 0x1A000000U
55# define DMA_CHANNEL_14 0x1C000000U
56# define DMA_CHANNEL_15 0x1E000000U
57#endif
58
59/*============================ MACROFIED FUNCTIONS ===========================*/
60/*============================ TYPES =========================================*/
61
63
64typedef struct {
78
79typedef enum {
87
88typedef enum {
92
93typedef enum {
102
103typedef struct __DMA_HandleTypeDef {
108 void *Parent;
118
120
121/*============================ GLOBAL VARIABLES ==============================*/
122/*============================ PROTOTYPES ====================================*/
123
126
128 uint32_t DstAddress, uint32_t DataLength);
130 uint32_t DstAddress, uint32_t DataLength);
135 uint32_t Timeout);
140 void (*pCallback)(DMA_HandleTypeDef *_hdma));
143
146
147#ifdef __cplusplus
148}
149#endif
150
151#endif
unsigned uint32_t
Definition stdint.h:9
HAL_StatusTypeDef
Definition sthal_def.h:65
HAL_LockTypeDef
Definition sthal_def.h:72
HAL_StatusTypeDef HAL_DMA_Abort(DMA_HandleTypeDef *hdma)
Definition sthal_dma.c:75
HAL_StatusTypeDef HAL_DMA_Init(DMA_HandleTypeDef *hdma)
Definition sthal_dma.c:36
struct __DMA_HandleTypeDef DMA_HandleTypeDef
vsf_dma_t DMA_Stream_TypeDef
Definition sthal_dma.h:62
HAL_StatusTypeDef HAL_DMA_Abort_IT(DMA_HandleTypeDef *hdma)
Definition sthal_dma.c:80
HAL_StatusTypeDef HAL_DMA_DeInit(DMA_HandleTypeDef *hdma)
Definition sthal_dma.c:48
HAL_StatusTypeDef HAL_DMA_Start_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength)
Definition sthal_dma.c:68
HAL_StatusTypeDef HAL_DMA_UnRegisterCallback(DMA_HandleTypeDef *hdma, HAL_DMA_CallbackIDTypeDef CallbackID)
Definition sthal_dma.c:104
void HAL_DMA_IRQHandler(DMA_HandleTypeDef *hdma)
Definition sthal_dma.c:93
HAL_StatusTypeDef HAL_DMA_Start(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength)
Definition sthal_dma.c:61
HAL_StatusTypeDef HAL_DMA_PollForTransfer(DMA_HandleTypeDef *hdma, HAL_DMA_LevelCompleteTypeDef CompleteLevel, uint32_t Timeout)
Definition sthal_dma.c:85
HAL_DMA_StateTypeDef
Definition sthal_dma.h:79
@ HAL_DMA_STATE_RESET
Definition sthal_dma.h:80
@ HAL_DMA_STATE_ERROR
Definition sthal_dma.h:84
@ HAL_DMA_STATE_TIMEOUT
Definition sthal_dma.h:83
@ HAL_DMA_STATE_READY
Definition sthal_dma.h:81
@ HAL_DMA_STATE_ABORT
Definition sthal_dma.h:85
@ HAL_DMA_STATE_BUSY
Definition sthal_dma.h:82
HAL_StatusTypeDef HAL_DMA_RegisterCallback(DMA_HandleTypeDef *hdma, HAL_DMA_CallbackIDTypeDef CallbackID, void(*pCallback)(DMA_HandleTypeDef *_hdma))
Definition sthal_dma.c:95
uint32_t HAL_DMA_GetError(DMA_HandleTypeDef *hdma)
Definition sthal_dma.c:154
HAL_DMA_LevelCompleteTypeDef
Definition sthal_dma.h:88
@ HAL_DMA_FULL_TRANSFER
Definition sthal_dma.h:89
@ HAL_DMA_HALF_TRANSFER
Definition sthal_dma.h:90
HAL_DMA_StateTypeDef HAL_DMA_GetState(DMA_HandleTypeDef *hdma)
Definition sthal_dma.c:149
HAL_StatusTypeDef HAL_DMA_CleanCallbacks(DMA_HandleTypeDef *hdma)
HAL_DMA_CallbackIDTypeDef
Definition sthal_dma.h:93
@ HAL_DMA_XFER_M1CPLT_CB_ID
Definition sthal_dma.h:96
@ HAL_DMA_XFER_ABORT_CB_ID
Definition sthal_dma.h:99
@ HAL_DMA_XFER_ERROR_CB_ID
Definition sthal_dma.h:98
@ HAL_DMA_XFER_HALFCPLT_CB_ID
Definition sthal_dma.h:95
@ HAL_DMA_XFER_CPLT_CB_ID
Definition sthal_dma.h:94
@ HAL_DMA_XFER_M1HALFCPLT_CB_ID
Definition sthal_dma.h:97
@ HAL_DMA_XFER_ALL_CB_ID
Definition sthal_dma.h:100
Definition sthal_dma.h:103
HAL_LockTypeDef Lock
Definition sthal_dma.h:106
void(* XferAbortCallback)(struct __DMA_HandleTypeDef *hdma)
Definition sthal_dma.h:114
DMA_InitTypeDef Init
Definition sthal_dma.h:105
uint32_t StreamIndex
Definition sthal_dma.h:117
void(* XferCpltCallback)(struct __DMA_HandleTypeDef *hdma)
Definition sthal_dma.h:109
volatile HAL_DMA_StateTypeDef State
Definition sthal_dma.h:107
void(* XferErrorCallback)(struct __DMA_HandleTypeDef *hdma)
Definition sthal_dma.h:113
void(* XferHalfCpltCallback)(struct __DMA_HandleTypeDef *hdma)
Definition sthal_dma.h:110
uint32_t StreamBaseAddress
Definition sthal_dma.h:116
DMA_Stream_TypeDef * Instance
Definition sthal_dma.h:104
void(* XferM1HalfCpltCallback)(struct __DMA_HandleTypeDef *hdma)
Definition sthal_dma.h:112
void(* XferM1CpltCallback)(struct __DMA_HandleTypeDef *hdma)
Definition sthal_dma.h:111
volatile uint32_t ErrorCode
Definition sthal_dma.h:115
void * Parent
Definition sthal_dma.h:108
Definition sthal_dma.h:64
uint32_t Direction
Definition sthal_dma.h:66
uint32_t PeriphDataAlignment
Definition sthal_dma.h:69
uint32_t FIFOThreshold
Definition sthal_dma.h:74
uint32_t PeriphBurst
Definition sthal_dma.h:76
uint32_t PeriphInc
Definition sthal_dma.h:67
uint32_t MemInc
Definition sthal_dma.h:68
uint32_t MemDataAlignment
Definition sthal_dma.h:70
uint32_t FIFOMode
Definition sthal_dma.h:73
uint32_t MemBurst
Definition sthal_dma.h:75
uint32_t Mode
Definition sthal_dma.h:71
uint32_t Priority
Definition sthal_dma.h:72
uint32_t Channel
Definition sthal_dma.h:65
Definition vsf_template_dma.h:300