OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [freertos-6.1.1/] [Demo/] [Common/] [drivers/] [ST/] [STM32F10xFWLib/] [inc/] [stm32f10x_dma.h] - Blame information for rev 867

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 608 jeremybenn
/******************** (C) COPYRIGHT 2007 STMicroelectronics ********************
2
* File Name          : stm32f10x_dma.h
3
* Author             : MCD Application Team
4
* Date First Issued  : 09/29/2006
5
* Description        : This file contains all the functions prototypes for the
6
*                      DMA firmware library.
7
********************************************************************************
8
* History:
9
* 04/02/2007: V0.2
10
* 02/05/2007: V0.1
11
* 09/29/2006: V0.01
12
********************************************************************************
13
* THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
14
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
15
* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
16
* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
17
* CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
18
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
19
*******************************************************************************/
20
 
21
/* Define to prevent recursive inclusion -------------------------------------*/
22
#ifndef __STM32F10x_DMA_H
23
#define __STM32F10x_DMA_H
24
 
25
/* Includes ------------------------------------------------------------------*/
26
#include "stm32f10x_map.h"
27
 
28
/* Exported types ------------------------------------------------------------*/
29
/* DMA Init structure definition */
30
typedef struct
31
{
32
  u32 DMA_PeripheralBaseAddr;
33
  u32 DMA_MemoryBaseAddr;
34
  u32 DMA_DIR;
35
  u32 DMA_BufferSize;
36
  u32 DMA_PeripheralInc;
37
  u32 DMA_MemoryInc;
38
  u32 DMA_PeripheralDataSize;
39
  u32 DMA_MemoryDataSize;
40
  u32 DMA_Mode;
41
  u32 DMA_Priority;
42
  u32 DMA_M2M;
43
}DMA_InitTypeDef;
44
 
45
/* Exported constants --------------------------------------------------------*/
46
/* DMA data transfer direction -----------------------------------------------*/
47
#define DMA_DIR_PeripheralDST              ((u32)0x00000010)
48
#define DMA_DIR_PeripheralSRC              ((u32)0x00000000)
49
 
50
#define IS_DMA_DIR(DIR) ((DIR == DMA_DIR_PeripheralDST) || \
51
                         (DIR == DMA_DIR_PeripheralSRC))
52
 
53
/* DMA peripheral incremented mode -------------------------------------------*/
54
#define DMA_PeripheralInc_Enable           ((u32)0x00000040)
55
#define DMA_PeripheralInc_Disable          ((u32)0x00000000)
56
 
57
#define IS_DMA_PERIPHERAL_INC_STATE(STATE) ((STATE == DMA_PeripheralInc_Enable) || \
58
                                            (STATE == DMA_PeripheralInc_Disable))
59
 
60
/* DMA memory incremented mode -----------------------------------------------*/
61
#define DMA_MemoryInc_Enable               ((u32)0x00000080)
62
#define DMA_MemoryInc_Disable              ((u32)0x00000000)
63
 
64
#define IS_DMA_MEMORY_INC_STATE(STATE) ((STATE == DMA_MemoryInc_Enable) || \
65
                                        (STATE == DMA_MemoryInc_Disable))
66
 
67
/* DMA peripheral data size --------------------------------------------------*/
68
#define DMA_PeripheralDataSize_Byte        ((u32)0x00000000)
69
#define DMA_PeripheralDataSize_HalfWord    ((u32)0x00000100)
70
#define DMA_PeripheralDataSize_Word        ((u32)0x00000200)
71
 
72
#define IS_DMA_PERIPHERAL_DATA_SIZE(SIZE) ((SIZE == DMA_PeripheralDataSize_Byte) || \
73
                                           (SIZE == DMA_PeripheralDataSize_HalfWord) || \
74
                                           (SIZE == DMA_PeripheralDataSize_Word))
75
 
76
/* DMA memory data size ------------------------------------------------------*/
77
#define DMA_MemoryDataSize_Byte            ((u32)0x00000000)
78
#define DMA_MemoryDataSize_HalfWord        ((u32)0x00000400)
79
#define DMA_MemoryDataSize_Word            ((u32)0x00000800)
80
 
81
#define IS_DMA_MEMORY_DATA_SIZE(SIZE) ((SIZE == DMA_MemoryDataSize_Byte) || \
82
                                       (SIZE == DMA_MemoryDataSize_HalfWord) || \
83
                                       (SIZE == DMA_MemoryDataSize_Word))
84
 
85
/* DMA circular/normal mode --------------------------------------------------*/
86
#define DMA_Mode_Circular                  ((u32)0x00000020)
87
#define DMA_Mode_Normal                    ((u32)0x00000000)
88
 
89
#define IS_DMA_MODE(MODE) ((MODE == DMA_Mode_Circular) || (MODE == DMA_Mode_Normal))
90
 
91
/* DMA priority level --------------------------------------------------------*/
92
#define DMA_Priority_VeryHigh              ((u32)0x00003000)
93
#define DMA_Priority_High                  ((u32)0x00002000)
94
#define DMA_Priority_Medium                ((u32)0x00001000)
95
#define DMA_Priority_Low                   ((u32)0x00000000)
96
 
97
#define IS_DMA_PRIORITY(PRIORITY) ((PRIORITY == DMA_Priority_VeryHigh) || \
98
                                   (PRIORITY == DMA_Priority_High) || \
99
                                   (PRIORITY == DMA_Priority_Medium) || \
100
                                   (PRIORITY == DMA_Priority_Low))
101
 
102
/* DMA memory to memory ------------------------------------------------------*/
103
#define DMA_M2M_Enable                     ((u32)0x00004000)
104
#define DMA_M2M_Disable                    ((u32)0x00000000)
105
 
106
#define IS_DMA_M2M_STATE(STATE) ((STATE == DMA_M2M_Enable) || (STATE == DMA_M2M_Disable))
107
 
108
/* DMA interrupts definition -------------------------------------------------*/
109
#define DMA_IT_TC                          ((u32)0x00000002)
110
#define DMA_IT_HT                          ((u32)0x00000004)
111
#define DMA_IT_TE                          ((u32)0x00000008)
112
 
113
#define IS_DMA_CONFIG_IT(IT) (((IT & 0xFFFFFFF1) == 0x00) && (IT != 0x00))
114
 
115
#define DMA_IT_GL1                         ((u32)0x00000001)
116
#define DMA_IT_TC1                         ((u32)0x00000002)
117
#define DMA_IT_HT1                         ((u32)0x00000004)
118
#define DMA_IT_TE1                         ((u32)0x00000008)
119
#define DMA_IT_GL2                         ((u32)0x00000010)
120
#define DMA_IT_TC2                         ((u32)0x00000020)
121
#define DMA_IT_HT2                         ((u32)0x00000040)
122
#define DMA_IT_TE2                         ((u32)0x00000080)
123
#define DMA_IT_GL3                         ((u32)0x00000100)
124
#define DMA_IT_TC3                         ((u32)0x00000200)
125
#define DMA_IT_HT3                         ((u32)0x00000400)
126
#define DMA_IT_TE3                         ((u32)0x00000800)
127
#define DMA_IT_GL4                         ((u32)0x00001000)
128
#define DMA_IT_TC4                         ((u32)0x00002000)
129
#define DMA_IT_HT4                         ((u32)0x00004000)
130
#define DMA_IT_TE4                         ((u32)0x00008000)
131
#define DMA_IT_GL5                         ((u32)0x00010000)
132
#define DMA_IT_TC5                         ((u32)0x00020000)
133
#define DMA_IT_HT5                         ((u32)0x00040000)
134
#define DMA_IT_TE5                         ((u32)0x00080000)
135
#define DMA_IT_GL6                         ((u32)0x00100000)
136
#define DMA_IT_TC6                         ((u32)0x00200000)
137
#define DMA_IT_HT6                         ((u32)0x00400000)
138
#define DMA_IT_TE6                         ((u32)0x00800000)
139
#define DMA_IT_GL7                         ((u32)0x01000000)
140
#define DMA_IT_TC7                         ((u32)0x02000000)
141
#define DMA_IT_HT7                         ((u32)0x04000000)
142
#define DMA_IT_TE7                         ((u32)0x08000000)
143
 
144
#define IS_DMA_CLEAR_IT(IT) (((IT & 0xF0000000) == 0x00) && (IT != 0x00))
145
#define IS_DMA_GET_IT(IT) ((IT == DMA_IT_GL1) || (IT == DMA_IT_TC1) || \
146
                           (IT == DMA_IT_HT1) || (IT == DMA_IT_TE1) || \
147
                           (IT == DMA_IT_GL2) || (IT == DMA_IT_TC2) || \
148
                           (IT == DMA_IT_HT2) || (IT == DMA_IT_TE2) || \
149
                           (IT == DMA_IT_GL3) || (IT == DMA_IT_TC3) || \
150
                           (IT == DMA_IT_HT3) || (IT == DMA_IT_TE3) || \
151
                           (IT == DMA_IT_GL4) || (IT == DMA_IT_TC4) || \
152
                           (IT == DMA_IT_HT4) || (IT == DMA_IT_TE4) || \
153
                           (IT == DMA_IT_GL5) || (IT == DMA_IT_TC5) || \
154
                           (IT == DMA_IT_HT5) || (IT == DMA_IT_TE5) || \
155
                           (IT == DMA_IT_GL6) || (IT == DMA_IT_TC6) || \
156
                           (IT == DMA_IT_HT6) || (IT == DMA_IT_TE6) || \
157
                           (IT == DMA_IT_GL7) || (IT == DMA_IT_TC7) || \
158
                           (IT == DMA_IT_HT7) || (IT == DMA_IT_TE7))
159
 
160
/* DMA flags definition ------------------------------------------------------*/
161
#define DMA_FLAG_GL1                       ((u32)0x00000001)
162
#define DMA_FLAG_TC1                       ((u32)0x00000002)
163
#define DMA_FLAG_HT1                       ((u32)0x00000004)
164
#define DMA_FLAG_TE1                       ((u32)0x00000008)
165
#define DMA_FLAG_GL2                       ((u32)0x00000010)
166
#define DMA_FLAG_TC2                       ((u32)0x00000020)
167
#define DMA_FLAG_HT2                       ((u32)0x00000040)
168
#define DMA_FLAG_TE2                       ((u32)0x00000080)
169
#define DMA_FLAG_GL3                       ((u32)0x00000100)
170
#define DMA_FLAG_TC3                       ((u32)0x00000200)
171
#define DMA_FLAG_HT3                       ((u32)0x00000400)
172
#define DMA_FLAG_TE3                       ((u32)0x00000800)
173
#define DMA_FLAG_GL4                       ((u32)0x00001000)
174
#define DMA_FLAG_TC4                       ((u32)0x00002000)
175
#define DMA_FLAG_HT4                       ((u32)0x00004000)
176
#define DMA_FLAG_TE4                       ((u32)0x00008000)
177
#define DMA_FLAG_GL5                       ((u32)0x00010000)
178
#define DMA_FLAG_TC5                       ((u32)0x00020000)
179
#define DMA_FLAG_HT5                       ((u32)0x00040000)
180
#define DMA_FLAG_TE5                       ((u32)0x00080000)
181
#define DMA_FLAG_GL6                       ((u32)0x00100000)
182
#define DMA_FLAG_TC6                       ((u32)0x00200000)
183
#define DMA_FLAG_HT6                       ((u32)0x00400000)
184
#define DMA_FLAG_TE6                       ((u32)0x00800000)
185
#define DMA_FLAG_GL7                       ((u32)0x01000000)
186
#define DMA_FLAG_TC7                       ((u32)0x02000000)
187
#define DMA_FLAG_HT7                       ((u32)0x04000000)
188
#define DMA_FLAG_TE7                       ((u32)0x08000000)
189
 
190
#define IS_DMA_CLEAR_FLAG(FLAG) (((FLAG & 0xF0000000) == 0x00) && (FLAG != 0x00))
191
#define IS_DMA_GET_FLAG(FLAG) ((FLAG == DMA_FLAG_GL1) || (FLAG == DMA_FLAG_TC1) || \
192
                               (FLAG == DMA_FLAG_HT1) || (FLAG == DMA_FLAG_TE1) || \
193
                               (FLAG == DMA_FLAG_GL2) || (FLAG == DMA_FLAG_TC2) || \
194
                               (FLAG == DMA_FLAG_HT2) || (FLAG == DMA_FLAG_TE2) || \
195
                               (FLAG == DMA_FLAG_GL3) || (FLAG == DMA_FLAG_TC3) || \
196
                               (FLAG == DMA_FLAG_HT3) || (FLAG == DMA_FLAG_TE3) || \
197
                               (FLAG == DMA_FLAG_GL4) || (FLAG == DMA_FLAG_TC4) || \
198
                               (FLAG == DMA_FLAG_HT4) || (FLAG == DMA_FLAG_TE4) || \
199
                               (FLAG == DMA_FLAG_GL5) || (FLAG == DMA_FLAG_TC5) || \
200
                               (FLAG == DMA_FLAG_HT5) || (FLAG == DMA_FLAG_TE5) || \
201
                               (FLAG == DMA_FLAG_GL6) || (FLAG == DMA_FLAG_TC6) || \
202
                               (FLAG == DMA_FLAG_HT6) || (FLAG == DMA_FLAG_TE6) || \
203
                               (FLAG == DMA_FLAG_GL7) || (FLAG == DMA_FLAG_TC7) || \
204
                               (FLAG == DMA_FLAG_HT7) || (FLAG == DMA_FLAG_TE7))
205
 
206
/* DMA Buffer Size -----------------------------------------------------------*/
207
#define IS_DMA_BUFFER_SIZE(SIZE) ((SIZE >= 0x1) && (SIZE < 0x10000))
208
 
209
/* Exported macro ------------------------------------------------------------*/
210
/* Exported functions ------------------------------------------------------- */
211
void DMA_DeInit(DMA_Channel_TypeDef* DMA_Channelx);
212
void DMA_Init(DMA_Channel_TypeDef*  DMA_Channelx, DMA_InitTypeDef* DMA_InitStruct);
213
void DMA_StructInit(DMA_InitTypeDef* DMA_InitStruct);
214
void DMA_Cmd(DMA_Channel_TypeDef*  DMA_Channelx, FunctionalState NewState);
215
void DMA_ITConfig(DMA_Channel_TypeDef*  DMA_Channelx, u32 DMA_IT, FunctionalState NewState);
216
u16 DMA_GetCurrDataCounter(DMA_Channel_TypeDef*  DMA_Channelx);
217
FlagStatus DMA_GetFlagStatus(u32 DMA_FLAG);
218
void DMA_ClearFlag(u32 DMA_FLAG);
219
ITStatus DMA_GetITStatus(u32 DMA_IT);
220
void DMA_ClearITPendingBit(u32 DMA_IT);
221
 
222
#endif /*__STM32F10x_DMA_H */
223
 
224
/******************* (C) COPYRIGHT 2007 STMicroelectronics *****END OF FILE****/

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.