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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [freertos-6.1.1/] [Demo/] [CORTEX_STM32L152_IAR/] [system_and_ST_code/] [STM32L1xx_StdPeriph_Driver/] [inc/] [stm32l1xx_syscfg.h] - Blame information for rev 582

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 582 jeremybenn
/**
2
  ******************************************************************************
3
  * @file    stm32l1xx_syscfg.h
4
  * @author  MCD Application Team
5
  * @version V1.0.0RC1
6
  * @date    07/02/2010
7
  * @brief   This file contains all the functions prototypes for the SYSCFG
8
  *          firmware library.
9
  ******************************************************************************
10
  * @copy
11
  *
12
  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
13
  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
14
  * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
15
  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
16
  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
17
  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
18
  *
19
  * <h2><center>&copy; COPYRIGHT 2010 STMicroelectronics</center></h2>
20
  */
21
 
22
/*!< Define to prevent recursive inclusion -------------------------------------*/
23
#ifndef __STM32L1xx_SYSCFG_H
24
#define __STM32L1xx_SYSCFG_H
25
 
26
#ifdef __cplusplus
27
 extern "C" {
28
#endif
29
 
30
/*!< Includes ------------------------------------------------------------------*/
31
#include "stm32l1xx.h"
32
 
33
/** @addtogroup STM32L1xx_StdPeriph_Driver
34
  * @{
35
  */
36
 
37
/** @addtogroup SYSCFG
38
  * @{
39
  */
40
 
41
/** @defgroup SYSCFG_Exported_Types
42
  * @{
43
  */
44
 
45
/** @defgroup EXTI_Port_Sources
46
  * @{
47
  */
48
#define EXTI_PortSourceGPIOA       ((uint8_t)0x00)
49
#define EXTI_PortSourceGPIOB       ((uint8_t)0x01)
50
#define EXTI_PortSourceGPIOC       ((uint8_t)0x02)
51
#define EXTI_PortSourceGPIOD       ((uint8_t)0x03)
52
#define EXTI_PortSourceGPIOE       ((uint8_t)0x04)
53
#define EXTI_PortSourceGPIOH       ((uint8_t)0x05)
54
 
55
#define IS_EXTI_PORT_SOURCE(PORTSOURCE) (((PORTSOURCE) == EXTI_PortSourceGPIOA) || \
56
                                         ((PORTSOURCE) == EXTI_PortSourceGPIOB) || \
57
                                         ((PORTSOURCE) == EXTI_PortSourceGPIOC) || \
58
                                         ((PORTSOURCE) == EXTI_PortSourceGPIOD) || \
59
                                         ((PORTSOURCE) == EXTI_PortSourceGPIOE) || \
60
                                         ((PORTSOURCE) == EXTI_PortSourceGPIOH))
61
/**
62
  * @}
63
  */
64
 
65
/** @defgroup EXTI_Pin_sources
66
  * @{
67
  */
68
#define EXTI_PinSource0            ((uint8_t)0x00)
69
#define EXTI_PinSource1            ((uint8_t)0x01)
70
#define EXTI_PinSource2            ((uint8_t)0x02)
71
#define EXTI_PinSource3            ((uint8_t)0x03)
72
#define EXTI_PinSource4            ((uint8_t)0x04)
73
#define EXTI_PinSource5            ((uint8_t)0x05)
74
#define EXTI_PinSource6            ((uint8_t)0x06)
75
#define EXTI_PinSource7            ((uint8_t)0x07)
76
#define EXTI_PinSource8            ((uint8_t)0x08)
77
#define EXTI_PinSource9            ((uint8_t)0x09)
78
#define EXTI_PinSource10           ((uint8_t)0x0A)
79
#define EXTI_PinSource11           ((uint8_t)0x0B)
80
#define EXTI_PinSource12           ((uint8_t)0x0C)
81
#define EXTI_PinSource13           ((uint8_t)0x0D)
82
#define EXTI_PinSource14           ((uint8_t)0x0E)
83
#define EXTI_PinSource15           ((uint8_t)0x0F)
84
#define IS_EXTI_PIN_SOURCE(PINSOURCE) (((PINSOURCE) == EXTI_PinSource0) || \
85
                                       ((PINSOURCE) == EXTI_PinSource1) || \
86
                                       ((PINSOURCE) == EXTI_PinSource2) || \
87
                                       ((PINSOURCE) == EXTI_PinSource3) || \
88
                                       ((PINSOURCE) == EXTI_PinSource4) || \
89
                                       ((PINSOURCE) == EXTI_PinSource5) || \
90
                                       ((PINSOURCE) == EXTI_PinSource6) || \
91
                                       ((PINSOURCE) == EXTI_PinSource7) || \
92
                                       ((PINSOURCE) == EXTI_PinSource8) || \
93
                                       ((PINSOURCE) == EXTI_PinSource9) || \
94
                                       ((PINSOURCE) == EXTI_PinSource10) || \
95
                                       ((PINSOURCE) == EXTI_PinSource11) || \
96
                                       ((PINSOURCE) == EXTI_PinSource12) || \
97
                                       ((PINSOURCE) == EXTI_PinSource13) || \
98
                                       ((PINSOURCE) == EXTI_PinSource14) || \
99
                                       ((PINSOURCE) == EXTI_PinSource15))
100
/**
101
  * @}
102
  */
103
 
104
/** @defgroup SYSCFG_Memory_Remap_Config
105
  * @{
106
  */
107
#define SYSCFG_MemoryRemap_Flash       ((uint8_t)0x00)
108
#define SYSCFG_MemoryRemap_SystemFlash ((uint8_t)0x01)
109
#define SYSCFG_MemoryRemap_SRAM        ((uint8_t)0x03)
110
 
111
#define IS_SYSCFG_MEMORY_REMAP_CONFING(REMAP) (((REMAP) == SYSCFG_MemoryRemap_Flash) || \
112
                                               ((REMAP) == SYSCFG_MemoryRemap_SystemFlash) || \
113
                                               ((REMAP) == SYSCFG_MemoryRemap_SRAM))
114
 
115
 
116
/** @defgroup RI_Resistor
117
  * @{
118
  */
119
 
120
#define RI_Resistor_10KPU          COMP_CSR_10KPU
121
#define RI_Resistor_400KPU         COMP_CSR_400KPU
122
#define RI_Resistor_10KPD          COMP_CSR_10KPD
123
#define RI_Resistor_400KPD         COMP_CSR_400KPD
124
 
125
#define IS_RI_RESISTOR(RESISTOR)  (((RESISTOR) == COMP_CSR_10KPU) || \
126
                                   ((RESISTOR) == COMP_CSR_400KPU) || \
127
                                   ((RESISTOR) == COMP_CSR_10KPD) || \
128
                                   ((RESISTOR) == COMP_CSR_400KPD))
129
 
130
/**
131
  * @}
132
  */
133
 
134
/** @defgroup RI_InputCapture
135
  * @{
136
  */
137
 
138
#define RI_InputCapture_IC1  RI_ICR_IC1    /*!< Input Capture 1 */
139
#define RI_InputCapture_IC2  RI_ICR_IC2    /*!< Input Capture 2 */
140
#define RI_InputCapture_IC3  RI_ICR_IC3    /*!< Input Capture 3 */
141
#define RI_InputCapture_IC4  RI_ICR_IC4    /*!< Input Capture 4 */
142
 
143
#define IS_RI_INPUTCAPTURE(INPUTCAPTURE) ((((INPUTCAPTURE) & (uint32_t)0xFFC2FFFF) == 0x00) && ((INPUTCAPTURE) != (uint32_t)0x00))
144
/**
145
  * @}
146
  */
147
 
148
/** @defgroup TIM_Select
149
  * @{
150
  */
151
 
152
#define TIM_Select_None  ((uint32_t)0x00000000)    /*!< None selected */
153
#define TIM_Select_TIM2  ((uint32_t)0x00010000)    /*!< Timer 2 selected */
154
#define TIM_Select_TIM3  ((uint32_t)0x00020000)    /*!< Timer 3 selected */
155
#define TIM_Select_TIM4  ((uint32_t)0x00030000)    /*!< Timer 4 selected */
156
 
157
#define IS_RI_TIM(TIM) (((TIM) == TIM_Select_None) || \
158
                        ((TIM) == TIM_Select_TIM2) || \
159
                        ((TIM) == TIM_Select_TIM3) || \
160
                        ((TIM) == TIM_Select_TIM4))
161
 
162
/**
163
  * @}
164
  */
165
 
166
/** @defgroup RI_InputCaptureRouting
167
  * @{
168
  */
169
                                                          /* TIMx_IC1 TIMx_IC2  TIMx_IC3  TIMx_IC4 */
170
#define RI_InputCaptureRouting_0   ((uint32_t)0x00000000) /* PA0       PA1      PA2       PA3      */
171
#define RI_InputCaptureRouting_1   ((uint32_t)0x00000001) /* PA4       PA5      PA6       PA7      */
172
#define RI_InputCaptureRouting_2   ((uint32_t)0x00000002) /* PA8       PA9      PA10      PA11     */
173
#define RI_InputCaptureRouting_3   ((uint32_t)0x00000003) /* PA12      PA13     PA14      PA15     */
174
#define RI_InputCaptureRouting_4   ((uint32_t)0x00000004) /* PC0       PC1      PC2       PC3      */
175
#define RI_InputCaptureRouting_5   ((uint32_t)0x00000005) /* PC4       PC5      PC6       PC7      */
176
#define RI_InputCaptureRouting_6   ((uint32_t)0x00000006) /* PC8       PC9      PC10      PC11     */
177
#define RI_InputCaptureRouting_7   ((uint32_t)0x00000007) /* PC12      PC13     PC14      PC15     */
178
#define RI_InputCaptureRouting_8   ((uint32_t)0x00000008) /* PD0       PD1      PD2       PD3      */
179
#define RI_InputCaptureRouting_9   ((uint32_t)0x00000009) /* PD4       PD5      PD6       PD7      */
180
#define RI_InputCaptureRouting_10  ((uint32_t)0x0000000A) /* PD8       PD9      PD10      PD11     */
181
#define RI_InputCaptureRouting_11  ((uint32_t)0x0000000B) /* PD12      PD13     PD14      PD15     */
182
#define RI_InputCaptureRouting_12  ((uint32_t)0x0000000C) /* PE0       PE1      PE2       PE3      */
183
#define RI_InputCaptureRouting_13  ((uint32_t)0x0000000D) /* PE4       PE5      PE6       PE7      */
184
#define RI_InputCaptureRouting_14  ((uint32_t)0x0000000E) /* PE8       PE9      PE10      PE11     */
185
#define RI_InputCaptureRouting_15  ((uint32_t)0x0000000F) /* PE12      PE13     PE14      PE15     */
186
 
187
#define IS_RI_INPUTCAPTURE_ROUTING(ROUTING) (((ROUTING) == RI_InputCaptureRouting_0) || \
188
                                             ((ROUTING) == RI_InputCaptureRouting_1) || \
189
                                             ((ROUTING) == RI_InputCaptureRouting_2) || \
190
                                             ((ROUTING) == RI_InputCaptureRouting_3) || \
191
                                             ((ROUTING) == RI_InputCaptureRouting_4) || \
192
                                             ((ROUTING) == RI_InputCaptureRouting_5) || \
193
                                             ((ROUTING) == RI_InputCaptureRouting_6) || \
194
                                             ((ROUTING) == RI_InputCaptureRouting_7) || \
195
                                             ((ROUTING) == RI_InputCaptureRouting_8) || \
196
                                             ((ROUTING) == RI_InputCaptureRouting_9) || \
197
                                             ((ROUTING) == RI_InputCaptureRouting_10) || \
198
                                             ((ROUTING) == RI_InputCaptureRouting_11) || \
199
                                             ((ROUTING) == RI_InputCaptureRouting_12) || \
200
                                             ((ROUTING) == RI_InputCaptureRouting_13) || \
201
                                             ((ROUTING) == RI_InputCaptureRouting_14) || \
202
                                             ((ROUTING) == RI_InputCaptureRouting_15))
203
 
204
/**
205
  * @}
206
  */
207
 
208
/** @defgroup RI_IOSwitch
209
  * @{
210
  */
211
 
212
/* ASCR1 I/O switch: bit 28 is set to '1' to indicate that the mask is in ASCR1 register */
213
#define RI_IOSwitch_CH0        ((uint32_t)0x10000001)
214
#define RI_IOSwitch_CH1        ((uint32_t)0x10000002)
215
#define RI_IOSwitch_CH2        ((uint32_t)0x10000004)
216
#define RI_IOSwitch_CH3        ((uint32_t)0x10000008)
217
#define RI_IOSwitch_CH4        ((uint32_t)0x10000010)
218
#define RI_IOSwitch_CH5        ((uint32_t)0x10000020)
219
#define RI_IOSwitch_CH6        ((uint32_t)0x10000040)
220
#define RI_IOSwitch_CH7        ((uint32_t)0x10000080)
221
#define RI_IOSwitch_CH8        ((uint32_t)0x10000100)
222
#define RI_IOSwitch_CH9        ((uint32_t)0x10000200)
223
#define RI_IOSwitch_CH10       ((uint32_t)0x10000400)
224
#define RI_IOSwitch_CH11       ((uint32_t)0x10000800)
225
#define RI_IOSwitch_CH12       ((uint32_t)0x10001000)
226
#define RI_IOSwitch_CH13       ((uint32_t)0x10002000)
227
#define RI_IOSwitch_CH14       ((uint32_t)0x10004000)
228
#define RI_IOSwitch_CH15       ((uint32_t)0x10008000)
229
#define RI_IOSwitch_CH18       ((uint32_t)0x10040000)
230
#define RI_IOSwitch_CH19       ((uint32_t)0x10080000)
231
#define RI_IOSwitch_CH20       ((uint32_t)0x10100000)
232
#define RI_IOSwitch_CH21       ((uint32_t)0x10200000)
233
#define RI_IOSwitch_CH22       ((uint32_t)0x10400000)
234
#define RI_IOSwitch_CH23       ((uint32_t)0x10800000)
235
#define RI_IOSwitch_CH24       ((uint32_t)0x11000000)
236
#define RI_IOSwitch_CH25       ((uint32_t)0x12000000)
237
#define RI_IOSwitch_VCOMP      ((uint32_t)0x14000000) /* VCOMP is an internal switch used to connect 
238
                                                         selected channel to COMP1 non inverting input */
239
 
240
/* ASCR2 IO switch: : bit 28 is set to '0' to indicate that the mask is in ASCR2 register */
241
#define RI_IOSwitch_GR10_1     ((uint32_t)0x00000001)
242
#define RI_IOSwitch_GR10_2     ((uint32_t)0x00000002)
243
#define RI_IOSwitch_GR10_3     ((uint32_t)0x00000004)
244
#define RI_IOSwitch_GR10_4     ((uint32_t)0x00000008)
245
#define RI_IOSwitch_GR6_1      ((uint32_t)0x00000010)
246
#define RI_IOSwitch_GR6_2      ((uint32_t)0x00000020)
247
#define RI_IOSwitch_GR5_1      ((uint32_t)0x00000040)
248
#define RI_IOSwitch_GR5_2      ((uint32_t)0x00000080)
249
#define RI_IOSwitch_GR5_3      ((uint32_t)0x00000100)
250
#define RI_IOSwitch_GR4_1      ((uint32_t)0x00000200)
251
#define RI_IOSwitch_GR4_2      ((uint32_t)0x00000400)
252
#define RI_IOSwitch_GR4_3      ((uint32_t)0x00000800)
253
 
254
#define IS_RI_IOSWITCH(IOSWITCH) (((IOSWITCH) == RI_IOSwitch_CH0) || \
255
                                  ((IOSWITCH) == RI_IOSwitch_CH1) || \
256
                                  ((IOSWITCH) == RI_IOSwitch_CH2) || \
257
                                  ((IOSWITCH) == RI_IOSwitch_CH3) || \
258
                                  ((IOSWITCH) == RI_IOSwitch_CH4) || \
259
                                  ((IOSWITCH) == RI_IOSwitch_CH5) || \
260
                                  ((IOSWITCH) == RI_IOSwitch_CH6) || \
261
                                  ((IOSWITCH) == RI_IOSwitch_CH7) || \
262
                                  ((IOSWITCH) == RI_IOSwitch_CH8) || \
263
                                  ((IOSWITCH) == RI_IOSwitch_CH9) || \
264
                                  ((IOSWITCH) == RI_IOSwitch_CH10) || \
265
                                  ((IOSWITCH) == RI_IOSwitch_CH11) || \
266
                                  ((IOSWITCH) == RI_IOSwitch_CH12) || \
267
                                  ((IOSWITCH) == RI_IOSwitch_CH13) || \
268
                                  ((IOSWITCH) == RI_IOSwitch_CH14) || \
269
                                  ((IOSWITCH) == RI_IOSwitch_CH15) || \
270
                                  ((IOSWITCH) == RI_IOSwitch_CH18) || \
271
                                  ((IOSWITCH) == RI_IOSwitch_CH19) || \
272
                                  ((IOSWITCH) == RI_IOSwitch_CH20) || \
273
                                  ((IOSWITCH) == RI_IOSwitch_CH21) || \
274
                                  ((IOSWITCH) == RI_IOSwitch_CH22) || \
275
                                  ((IOSWITCH) == RI_IOSwitch_CH23) || \
276
                                  ((IOSWITCH) == RI_IOSwitch_CH24) || \
277
                                  ((IOSWITCH) == RI_IOSwitch_CH25) || \
278
                                  ((IOSWITCH) == RI_IOSwitch_VCOMP) || \
279
                                  ((IOSWITCH) == RI_IOSwitch_GR10_1) || \
280
                                  ((IOSWITCH) == RI_IOSwitch_GR10_2) || \
281
                                  ((IOSWITCH) == RI_IOSwitch_GR10_3) || \
282
                                  ((IOSWITCH) == RI_IOSwitch_GR10_4) || \
283
                                  ((IOSWITCH) == RI_IOSwitch_GR6_1) || \
284
                                  ((IOSWITCH) == RI_IOSwitch_GR6_2) || \
285
                                  ((IOSWITCH) == RI_IOSwitch_GR5_1) || \
286
                                  ((IOSWITCH) == RI_IOSwitch_GR5_2) || \
287
                                  ((IOSWITCH) == RI_IOSwitch_GR5_3) || \
288
                                  ((IOSWITCH) == RI_IOSwitch_GR4_1) || \
289
                                  ((IOSWITCH) == RI_IOSwitch_GR4_2) || \
290
                                  ((IOSWITCH) == RI_IOSwitch_GR4_3))
291
 
292
/** @defgroup RI_Port
293
  * @{
294
  */
295
 
296
#define RI_PortA                 ((uint8_t)0x01)   /*!< GPIOA selected */
297
#define RI_PortB                 ((uint8_t)0x02)   /*!< GPIOB selected */
298
#define RI_PortC                 ((uint8_t)0x03)   /*!< GPIOC selected */
299
#define RI_PortD                 ((uint8_t)0x04)   /*!< GPIOD selected */
300
#define RI_PortE                 ((uint8_t)0x05)   /*!< GPIOE selected */
301
 
302
#define IS_RI_PORT(PORT) (((PORT) == RI_PortA) || \
303
                          ((PORT) == RI_PortB) || \
304
                          ((PORT) == RI_PortC) || \
305
                          ((PORT) == RI_PortD) || \
306
                          ((PORT) == RI_PortE))
307
/**
308
  * @}
309
  */
310
 
311
/** @defgroup RI_Pin define
312
  * @{
313
  */
314
#define RI_Pin_0                 ((uint16_t)0x0001)  /*!< Pin 0 selected */
315
#define RI_Pin_1                 ((uint16_t)0x0002)  /*!< Pin 1 selected */
316
#define RI_Pin_2                 ((uint16_t)0x0004)  /*!< Pin 2 selected */
317
#define RI_Pin_3                 ((uint16_t)0x0008)  /*!< Pin 3 selected */
318
#define RI_Pin_4                 ((uint16_t)0x0010)  /*!< Pin 4 selected */
319
#define RI_Pin_5                 ((uint16_t)0x0020)  /*!< Pin 5 selected */
320
#define RI_Pin_6                 ((uint16_t)0x0040)  /*!< Pin 6 selected */
321
#define RI_Pin_7                 ((uint16_t)0x0080)  /*!< Pin 7 selected */
322
#define RI_Pin_8                 ((uint16_t)0x0100)  /*!< Pin 8 selected */
323
#define RI_Pin_9                 ((uint16_t)0x0200)  /*!< Pin 9 selected */
324
#define RI_Pin_10                ((uint16_t)0x0400)  /*!< Pin 10 selected */
325
#define RI_Pin_11                ((uint16_t)0x0800)  /*!< Pin 11 selected */
326
#define RI_Pin_12                ((uint16_t)0x1000)  /*!< Pin 12 selected */
327
#define RI_Pin_13                ((uint16_t)0x2000)  /*!< Pin 13 selected */
328
#define RI_Pin_14                ((uint16_t)0x4000)  /*!< Pin 14 selected */
329
#define RI_Pin_15                ((uint16_t)0x8000)  /*!< Pin 15 selected */
330
#define RI_Pin_All               ((uint16_t)0xFFFF)  /*!< All pins selected */
331
 
332
#define IS_RI_PIN(PIN) ((PIN) != (uint16_t)0x00)
333
 
334
/**
335
  * @}
336
  */
337
 
338
/**
339
  * @}
340
  */
341
 
342
/** @defgroup SYSCFG_Exported_Macros
343
  * @{
344
  */
345
/**
346
  * @}
347
  */
348
 
349
/** @defgroup SYSCFG_Exported_Functions
350
  * @{
351
  */
352
void SYSCFG_DeInit(void);
353
void SYSCFG_MemoryRemapConfig(uint8_t SYSCFG_MemoryRemap);
354
void SYSCFG_USBPuCmd(FunctionalState NewState);
355
void SYSCFG_EXTILineConfig(uint8_t EXTI_PortSourceGPIOx, uint8_t EXTI_PinSourcex);
356
void SYSCFG_RIDeInit(void);
357
void SYSCFG_RITIMSelect(uint32_t TIM_Select);
358
void SYSCFG_RITIMInputCaptureConfig(uint32_t RI_InputCapture, uint32_t RI_InputCaptureRouting);
359
void SYSCFG_RIResistorConfig(uint32_t RI_Resistor, FunctionalState NewState);
360
void SYSCFG_RISwitchControlModeCmd(FunctionalState NewState);
361
void SYSCFG_RIIOSwitchConfig(uint32_t RI_IOSwitch, FunctionalState NewState);
362
void SYSCFG_RIHysteresisConfig(uint8_t RI_Port, uint16_t RI_Pin,
363
                               FunctionalState NewState);
364
#ifdef __cplusplus
365
}
366
#endif
367
 
368
#endif /*__STM32L1xx_SYSCFG_H */
369
/**
370
  * @}
371
  */
372
 
373
/**
374
  * @}
375
  */
376
 
377
/**
378
  * @}
379
  */
380
 
381
/******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/

powered by: WebSVN 2.1.0

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