Rev 49 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 49 | Rev 50 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /** |
1 | /** |
2 | ****************************************************************************** |
2 | ****************************************************************************** |
3 | * @file stm32l1xx_hal.h |
3 | * @file stm32l1xx_hal.h |
4 | * @author MCD Application Team |
4 | * @author MCD Application Team |
5 | * @version V1.2.0 |
- | |
6 | * @date 01-July-2016 |
- | |
7 | * @brief This file contains all the functions prototypes for the HAL |
5 | * @brief This file contains all the functions prototypes for the HAL |
8 | * module driver. |
6 | * module driver. |
9 | ****************************************************************************** |
7 | ****************************************************************************** |
10 | * @attention |
8 | * @attention |
11 | * |
9 | * |
12 | * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
10 | * <h2><center>© Copyright (c) 2017 STMicroelectronics. |
- | 11 | * All rights reserved.</center></h2> |
|
13 | * |
12 | * |
14 | * Redistribution and use in source and binary forms, with or without modification, |
13 | * This software component is licensed by ST under BSD 3-Clause license, |
15 | * are permitted provided that the following conditions are met: |
14 | * the "License"; You may not use this file except in compliance with the |
16 | * 1. Redistributions of source code must retain the above copyright notice, |
- | |
17 | * this list of conditions and the following disclaimer. |
- | |
18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
- | |
19 | * this list of conditions and the following disclaimer in the documentation |
- | |
20 | * and/or other materials provided with the distribution. |
15 | * License. You may obtain a copy of the License at: |
21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
- | |
22 | * may be used to endorse or promote products derived from this software |
16 | * opensource.org/licenses/BSD-3-Clause |
23 | * without specific prior written permission. |
- | |
24 | * |
- | |
25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
- | |
26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
- | |
27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
- | |
28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
- | |
29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
- | |
30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
- | |
31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
- | |
32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
- | |
33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
- | |
34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
- | |
35 | * |
17 | * |
36 | ****************************************************************************** |
18 | ****************************************************************************** |
37 | */ |
19 | */ |
38 | 20 | ||
39 | /* Define to prevent recursive inclusion -------------------------------------*/ |
21 | /* Define to prevent recursive inclusion -------------------------------------*/ |
40 | #ifndef __STM32L1xx_HAL_H |
22 | #ifndef __STM32L1xx_HAL_H |
41 | #define __STM32L1xx_HAL_H |
23 | #define __STM32L1xx_HAL_H |
42 | 24 | ||
Line 51... | Line 33... | ||
51 | * @{ |
33 | * @{ |
52 | */ |
34 | */ |
53 | 35 | ||
54 | /** @addtogroup HAL |
36 | /** @addtogroup HAL |
55 | * @{ |
37 | * @{ |
56 | */ |
38 | */ |
57 | 39 | ||
58 | /* Exported types ------------------------------------------------------------*/ |
40 | /* Exported types ------------------------------------------------------------*/ |
59 | /* Exported constants --------------------------------------------------------*/ |
41 | /* Exported constants --------------------------------------------------------*/ |
- | 42 | ||
60 | /** @defgroup HAL_Exported_Constants HAL Exported Constants |
43 | /** @defgroup HAL_Exported_Constants HAL Exported Constants |
61 | * @{ |
44 | * @{ |
62 | */ |
45 | */ |
- | 46 | ||
- | 47 | /** @defgroup HAL_TICK_FREQ Tick Frequency |
|
- | 48 | * @{ |
|
- | 49 | */ |
|
- | 50 | #define HAL_TICK_FREQ_10HZ 100U |
|
- | 51 | #define HAL_TICK_FREQ_100HZ 10U |
|
- | 52 | #define HAL_TICK_FREQ_1KHZ 1U |
|
- | 53 | #define HAL_TICK_FREQ_DEFAULT HAL_TICK_FREQ_1KHZ |
|
- | 54 | ||
- | 55 | #define IS_TICKFREQ(__FREQ__) (((__FREQ__) == HAL_TICK_FREQ_10HZ) || \ |
|
- | 56 | ((__FREQ__) == HAL_TICK_FREQ_100HZ) || \ |
|
- | 57 | ((__FREQ__) == HAL_TICK_FREQ_1KHZ)) |
|
- | 58 | ||
- | 59 | /** |
|
- | 60 | * @} |
|
- | 61 | */ |
|
- | 62 | ||
- | 63 | /** |
|
- | 64 | * @} |
|
- | 65 | */ |
|
- | 66 | ||
- | 67 | /** @defgroup SYSCFG_Exported_Constants SYSCFG Exported Constants |
|
- | 68 | * @{ |
|
- | 69 | */ |
|
63 | 70 | ||
64 | /** @defgroup SYSCFG_Constants SYSCFG: SYStem ConFiG |
71 | /** @defgroup SYSCFG_Constants SYSCFG: SYStem ConFiG |
65 | * @{ |
72 | * @{ |
66 | */ |
73 | */ |
67 | 74 | ||
68 | /** @defgroup SYSCFG_BootMode Boot Mode |
75 | /** @defgroup SYSCFG_BootMode Boot Mode |
69 | * @{ |
76 | * @{ |
70 | */ |
77 | */ |
71 | 78 | ||
Line 76... | Line 83... | ||
76 | #endif /* FSMC_R_BASE */ |
83 | #endif /* FSMC_R_BASE */ |
77 | #define SYSCFG_BOOT_SRAM ((uint32_t)SYSCFG_MEMRMP_BOOT_MODE) |
84 | #define SYSCFG_BOOT_SRAM ((uint32_t)SYSCFG_MEMRMP_BOOT_MODE) |
78 | 85 | ||
79 | /** |
86 | /** |
80 | * @} |
87 | * @} |
81 | */ |
88 | */ |
82 | 89 | ||
83 | /** |
90 | /** |
84 | * @} |
91 | * @} |
85 | */ |
92 | */ |
86 | 93 | ||
87 | /** @defgroup RI_Constants RI: Routing Interface |
94 | /** @defgroup RI_Constants RI: Routing Interface |
88 | * @{ |
95 | * @{ |
89 | */ |
96 | */ |
90 | 97 | ||
91 | /** @defgroup RI_InputCapture Input Capture |
98 | /** @defgroup RI_InputCapture Input Capture |
92 | * @{ |
99 | * @{ |
93 | */ |
100 | */ |
94 | 101 | ||
95 | #define RI_INPUTCAPTURE_IC1 RI_ICR_IC1 /*!< Input Capture 1 */ |
102 | #define RI_INPUTCAPTURE_IC1 RI_ICR_IC1 /*!< Input Capture 1 */ |
96 | #define RI_INPUTCAPTURE_IC2 RI_ICR_IC2 /*!< Input Capture 2 */ |
103 | #define RI_INPUTCAPTURE_IC2 RI_ICR_IC2 /*!< Input Capture 2 */ |
97 | #define RI_INPUTCAPTURE_IC3 RI_ICR_IC3 /*!< Input Capture 3 */ |
104 | #define RI_INPUTCAPTURE_IC3 RI_ICR_IC3 /*!< Input Capture 3 */ |
98 | #define RI_INPUTCAPTURE_IC4 RI_ICR_IC4 /*!< Input Capture 4 */ |
105 | #define RI_INPUTCAPTURE_IC4 RI_ICR_IC4 /*!< Input Capture 4 */ |
99 | 106 | ||
100 | /** |
107 | /** |
101 | * @} |
108 | * @} |
102 | */ |
109 | */ |
103 | 110 | ||
104 | /** @defgroup TIM_Select TIM Select |
111 | /** @defgroup TIM_Select TIM Select |
105 | * @{ |
112 | * @{ |
106 | */ |
113 | */ |
107 | 114 | ||
108 | #define TIM_SELECT_NONE (0x00000000U) /*!< None selected */ |
115 | #define TIM_SELECT_NONE (0x00000000U) /*!< None selected */ |
109 | #define TIM_SELECT_TIM2 ((uint32_t)RI_ICR_TIM_0) /*!< Timer 2 selected */ |
116 | #define TIM_SELECT_TIM2 ((uint32_t)RI_ICR_TIM_0) /*!< Timer 2 selected */ |
110 | #define TIM_SELECT_TIM3 ((uint32_t)RI_ICR_TIM_1) /*!< Timer 3 selected */ |
117 | #define TIM_SELECT_TIM3 ((uint32_t)RI_ICR_TIM_1) /*!< Timer 3 selected */ |
111 | #define TIM_SELECT_TIM4 ((uint32_t)RI_ICR_TIM) /*!< Timer 4 selected */ |
118 | #define TIM_SELECT_TIM4 ((uint32_t)RI_ICR_TIM) /*!< Timer 4 selected */ |
112 | 119 | ||
Line 115... | Line 122... | ||
115 | ((__TIM__) == TIM_SELECT_TIM3) || \ |
122 | ((__TIM__) == TIM_SELECT_TIM3) || \ |
116 | ((__TIM__) == TIM_SELECT_TIM4)) |
123 | ((__TIM__) == TIM_SELECT_TIM4)) |
117 | 124 | ||
118 | /** |
125 | /** |
119 | * @} |
126 | * @} |
120 | */ |
127 | */ |
121 | 128 | ||
122 | /** @defgroup RI_InputCaptureRouting Input Capture Routing |
129 | /** @defgroup RI_InputCaptureRouting Input Capture Routing |
123 | * @{ |
130 | * @{ |
124 | */ |
131 | */ |
125 | /* TIMx_IC1 TIMx_IC2 TIMx_IC3 TIMx_IC4 */ |
132 | /* TIMx_IC1 TIMx_IC2 TIMx_IC3 TIMx_IC4 */ |
126 | #define RI_INPUTCAPTUREROUTING_0 (0x00000000U) /* PA0 PA1 PA2 PA3 */ |
133 | #define RI_INPUTCAPTUREROUTING_0 (0x00000000U) /* PA0 PA1 PA2 PA3 */ |
127 | #define RI_INPUTCAPTUREROUTING_1 (0x00000001U) /* PA4 PA5 PA6 PA7 */ |
134 | #define RI_INPUTCAPTUREROUTING_1 (0x00000001U) /* PA4 PA5 PA6 PA7 */ |
128 | #define RI_INPUTCAPTUREROUTING_2 (0x00000002U) /* PA8 PA9 PA10 PA11 */ |
135 | #define RI_INPUTCAPTUREROUTING_2 (0x00000002U) /* PA8 PA9 PA10 PA11 */ |
129 | #define RI_INPUTCAPTUREROUTING_3 (0x00000003U) /* PA12 PA13 PA14 PA15 */ |
136 | #define RI_INPUTCAPTUREROUTING_3 (0x00000003U) /* PA12 PA13 PA14 PA15 */ |
130 | #define RI_INPUTCAPTUREROUTING_4 (0x00000004U) /* PC0 PC1 PC2 PC3 */ |
137 | #define RI_INPUTCAPTUREROUTING_4 (0x00000004U) /* PC0 PC1 PC2 PC3 */ |
Line 157... | Line 164... | ||
157 | ((__ROUTING__) == RI_INPUTCAPTUREROUTING_14) || \ |
164 | ((__ROUTING__) == RI_INPUTCAPTUREROUTING_14) || \ |
158 | ((__ROUTING__) == RI_INPUTCAPTUREROUTING_15)) |
165 | ((__ROUTING__) == RI_INPUTCAPTUREROUTING_15)) |
159 | 166 | ||
160 | /** |
167 | /** |
161 | * @} |
168 | * @} |
162 | */ |
169 | */ |
163 | 170 | ||
164 | /** @defgroup RI_IOSwitch IO Switch |
171 | /** @defgroup RI_IOSwitch IO Switch |
165 | * @{ |
172 | * @{ |
166 | */ |
173 | */ |
167 | #define RI_ASCR1_REGISTER (0x80000000U) |
174 | #define RI_ASCR1_REGISTER (0x80000000U) |
168 | /* ASCR1 I/O switch: bit 31 is set to '1' to indicate that the mask is in ASCR1 register */ |
175 | /* ASCR1 I/O switch: bit 31 is set to '1' to indicate that the mask is in ASCR1 register */ |
169 | #define RI_IOSWITCH_CH0 ((uint32_t)RI_ASCR1_REGISTER | RI_ASCR1_CH_0) |
176 | #define RI_IOSWITCH_CH0 ((uint32_t)RI_ASCR1_REGISTER | RI_ASCR1_CH_0) |
170 | #define RI_IOSWITCH_CH1 ((uint32_t)RI_ASCR1_REGISTER | RI_ASCR1_CH_1) |
177 | #define RI_IOSWITCH_CH1 ((uint32_t)RI_ASCR1_REGISTER | RI_ASCR1_CH_1) |
171 | #define RI_IOSWITCH_CH2 ((uint32_t)RI_ASCR1_REGISTER | RI_ASCR1_CH_2) |
178 | #define RI_IOSWITCH_CH2 ((uint32_t)RI_ASCR1_REGISTER | RI_ASCR1_CH_2) |
Line 197... | Line 204... | ||
197 | #define RI_IOSWITCH_CH29 ((uint32_t)RI_ASCR1_REGISTER | RI_ASCR1_CH_29) |
204 | #define RI_IOSWITCH_CH29 ((uint32_t)RI_ASCR1_REGISTER | RI_ASCR1_CH_29) |
198 | #define RI_IOSWITCH_CH30 ((uint32_t)RI_ASCR1_REGISTER | RI_ASCR1_CH_30) |
205 | #define RI_IOSWITCH_CH30 ((uint32_t)RI_ASCR1_REGISTER | RI_ASCR1_CH_30) |
199 | #define RI_IOSWITCH_CH31 ((uint32_t)RI_ASCR1_REGISTER | RI_ASCR1_CH_31) |
206 | #define RI_IOSWITCH_CH31 ((uint32_t)RI_ASCR1_REGISTER | RI_ASCR1_CH_31) |
200 | #endif /* RI_ASCR2_CH1b */ |
207 | #endif /* RI_ASCR2_CH1b */ |
201 | 208 | ||
202 | /* ASCR2 IO switch: bit 31 is set to '0' to indicate that the mask is in ASCR2 register */ |
209 | /* ASCR2 IO switch: bit 31 is set to '0' to indicate that the mask is in ASCR2 register */ |
203 | #define RI_IOSWITCH_GR10_1 ((uint32_t)RI_ASCR2_GR10_1) |
210 | #define RI_IOSWITCH_GR10_1 ((uint32_t)RI_ASCR2_GR10_1) |
204 | #define RI_IOSWITCH_GR10_2 ((uint32_t)RI_ASCR2_GR10_2) |
211 | #define RI_IOSWITCH_GR10_2 ((uint32_t)RI_ASCR2_GR10_2) |
205 | #define RI_IOSWITCH_GR10_3 ((uint32_t)RI_ASCR2_GR10_3) |
212 | #define RI_IOSWITCH_GR10_3 ((uint32_t)RI_ASCR2_GR10_3) |
206 | #define RI_IOSWITCH_GR10_4 ((uint32_t)RI_ASCR2_GR10_4) |
213 | #define RI_IOSWITCH_GR10_4 ((uint32_t)RI_ASCR2_GR10_4) |
207 | #define RI_IOSWITCH_GR6_1 ((uint32_t)RI_ASCR2_GR6_1) |
214 | #define RI_IOSWITCH_GR6_1 ((uint32_t)RI_ASCR2_GR6_1) |
Line 338... | Line 345... | ||
338 | 345 | ||
339 | #define IS_RI_PIN(__PIN__) ((__PIN__) != (uint16_t)0x00) |
346 | #define IS_RI_PIN(__PIN__) ((__PIN__) != (uint16_t)0x00) |
340 | 347 | ||
341 | /** |
348 | /** |
342 | * @} |
349 | * @} |
343 | */ |
350 | */ |
344 | 351 | ||
345 | /** |
352 | /** |
346 | * @} |
353 | * @} |
347 | */ |
354 | */ |
348 | 355 | ||
349 | /** |
356 | /** |
350 | * @} |
357 | * @} |
351 | */ |
358 | */ |
352 | 359 | ||
353 | /* Exported macro ------------------------------------------------------------*/ |
360 | /* Exported macros -----------------------------------------------------------*/ |
354 | 361 | ||
355 | /** @defgroup HAL_Exported_Macros HAL Exported Macros |
362 | /** @defgroup HAL_Exported_Macros HAL Exported Macros |
356 | * @{ |
363 | * @{ |
357 | */ |
364 | */ |
358 | 365 | ||
359 | /** @defgroup DBGMCU_Macros DBGMCU: Debug MCU |
366 | /** @defgroup DBGMCU_Macros DBGMCU: Debug MCU |
360 | * @{ |
367 | * @{ |
361 | */ |
368 | */ |
362 | 369 | ||
363 | /** @defgroup DBGMCU_Freeze_Unfreeze Freeze Unfreeze Peripherals in Debug mode |
370 | /** @defgroup DBGMCU_Freeze_Unfreeze Freeze Unfreeze Peripherals in Debug mode |
364 | * @brief Freeze/Unfreeze Peripherals in Debug mode |
371 | * @brief Freeze/Unfreeze Peripherals in Debug mode |
365 | * @{ |
372 | * @{ |
366 | */ |
373 | */ |
367 | 374 | ||
368 | /** |
375 | /** |
369 | * @brief TIM2 Peripherals Debug mode |
376 | * @brief TIM2 Peripherals Debug mode |
370 | */ |
377 | */ |
371 | #if defined (DBGMCU_APB1_FZ_DBG_TIM2_STOP) |
378 | #if defined (DBGMCU_APB1_FZ_DBG_TIM2_STOP) |
372 | #define __HAL_DBGMCU_FREEZE_TIM2() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM2_STOP) |
379 | #define __HAL_DBGMCU_FREEZE_TIM2() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM2_STOP) |
373 | #define __HAL_DBGMCU_UNFREEZE_TIM2() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM2_STOP) |
380 | #define __HAL_DBGMCU_UNFREEZE_TIM2() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM2_STOP) |
374 | #endif |
381 | #endif |
375 | 382 | ||
376 | /** |
383 | /** |
377 | * @brief TIM3 Peripherals Debug mode |
384 | * @brief TIM3 Peripherals Debug mode |
378 | */ |
385 | */ |
379 | #if defined (DBGMCU_APB1_FZ_DBG_TIM3_STOP) |
386 | #if defined (DBGMCU_APB1_FZ_DBG_TIM3_STOP) |
380 | #define __HAL_DBGMCU_FREEZE_TIM3() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM3_STOP) |
387 | #define __HAL_DBGMCU_FREEZE_TIM3() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM3_STOP) |
381 | #define __HAL_DBGMCU_UNFREEZE_TIM3() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM3_STOP) |
388 | #define __HAL_DBGMCU_UNFREEZE_TIM3() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM3_STOP) |
382 | #endif |
389 | #endif |
383 | 390 | ||
384 | /** |
391 | /** |
385 | * @brief TIM4 Peripherals Debug mode |
392 | * @brief TIM4 Peripherals Debug mode |
386 | */ |
393 | */ |
387 | #if defined (DBGMCU_APB1_FZ_DBG_TIM4_STOP) |
394 | #if defined (DBGMCU_APB1_FZ_DBG_TIM4_STOP) |
388 | #define __HAL_DBGMCU_FREEZE_TIM4() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM4_STOP) |
395 | #define __HAL_DBGMCU_FREEZE_TIM4() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM4_STOP) |
389 | #define __HAL_DBGMCU_UNFREEZE_TIM4() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM4_STOP) |
396 | #define __HAL_DBGMCU_UNFREEZE_TIM4() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM4_STOP) |
390 | #endif |
397 | #endif |
391 | 398 | ||
392 | /** |
399 | /** |
393 | * @brief TIM5 Peripherals Debug mode |
400 | * @brief TIM5 Peripherals Debug mode |
394 | */ |
401 | */ |
395 | #if defined (DBGMCU_APB1_FZ_DBG_TIM5_STOP) |
402 | #if defined (DBGMCU_APB1_FZ_DBG_TIM5_STOP) |
396 | #define __HAL_DBGMCU_FREEZE_TIM5() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM5_STOP) |
403 | #define __HAL_DBGMCU_FREEZE_TIM5() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM5_STOP) |
397 | #define __HAL_DBGMCU_UNFREEZE_TIM5() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM5_STOP) |
404 | #define __HAL_DBGMCU_UNFREEZE_TIM5() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM5_STOP) |
398 | #endif |
405 | #endif |
399 | 406 | ||
400 | /** |
407 | /** |
401 | * @brief TIM6 Peripherals Debug mode |
408 | * @brief TIM6 Peripherals Debug mode |
402 | */ |
409 | */ |
403 | #if defined (DBGMCU_APB1_FZ_DBG_TIM6_STOP) |
410 | #if defined (DBGMCU_APB1_FZ_DBG_TIM6_STOP) |
404 | #define __HAL_DBGMCU_FREEZE_TIM6() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM6_STOP) |
411 | #define __HAL_DBGMCU_FREEZE_TIM6() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM6_STOP) |
405 | #define __HAL_DBGMCU_UNFREEZE_TIM6() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM6_STOP) |
412 | #define __HAL_DBGMCU_UNFREEZE_TIM6() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM6_STOP) |
406 | #endif |
413 | #endif |
407 | 414 | ||
408 | /** |
415 | /** |
409 | * @brief TIM7 Peripherals Debug mode |
416 | * @brief TIM7 Peripherals Debug mode |
410 | */ |
417 | */ |
411 | #if defined (DBGMCU_APB1_FZ_DBG_TIM7_STOP) |
418 | #if defined (DBGMCU_APB1_FZ_DBG_TIM7_STOP) |
412 | #define __HAL_DBGMCU_FREEZE_TIM7() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM7_STOP) |
419 | #define __HAL_DBGMCU_FREEZE_TIM7() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM7_STOP) |
413 | #define __HAL_DBGMCU_UNFREEZE_TIM7() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM7_STOP) |
420 | #define __HAL_DBGMCU_UNFREEZE_TIM7() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM7_STOP) |
414 | #endif |
421 | #endif |
415 | 422 | ||
416 | /** |
423 | /** |
417 | * @brief RTC Peripherals Debug mode |
424 | * @brief RTC Peripherals Debug mode |
418 | */ |
425 | */ |
419 | #if defined (DBGMCU_APB1_FZ_DBG_RTC_STOP) |
426 | #if defined (DBGMCU_APB1_FZ_DBG_RTC_STOP) |
420 | #define __HAL_DBGMCU_FREEZE_RTC() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_RTC_STOP) |
427 | #define __HAL_DBGMCU_FREEZE_RTC() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_RTC_STOP) |
421 | #define __HAL_DBGMCU_UNFREEZE_RTC() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_RTC_STOP) |
428 | #define __HAL_DBGMCU_UNFREEZE_RTC() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_RTC_STOP) |
422 | #endif |
429 | #endif |
423 | 430 | ||
424 | /** |
431 | /** |
425 | * @brief WWDG Peripherals Debug mode |
432 | * @brief WWDG Peripherals Debug mode |
426 | */ |
433 | */ |
427 | #if defined (DBGMCU_APB1_FZ_DBG_WWDG_STOP) |
434 | #if defined (DBGMCU_APB1_FZ_DBG_WWDG_STOP) |
428 | #define __HAL_DBGMCU_FREEZE_WWDG() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_WWDG_STOP) |
435 | #define __HAL_DBGMCU_FREEZE_WWDG() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_WWDG_STOP) |
429 | #define __HAL_DBGMCU_UNFREEZE_WWDG() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_WWDG_STOP) |
436 | #define __HAL_DBGMCU_UNFREEZE_WWDG() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_WWDG_STOP) |
430 | #endif |
437 | #endif |
431 | 438 | ||
432 | /** |
439 | /** |
433 | * @brief IWDG Peripherals Debug mode |
440 | * @brief IWDG Peripherals Debug mode |
434 | */ |
441 | */ |
435 | #if defined (DBGMCU_APB1_FZ_DBG_IWDG_STOP) |
442 | #if defined (DBGMCU_APB1_FZ_DBG_IWDG_STOP) |
436 | #define __HAL_DBGMCU_FREEZE_IWDG() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_IWDG_STOP) |
443 | #define __HAL_DBGMCU_FREEZE_IWDG() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_IWDG_STOP) |
437 | #define __HAL_DBGMCU_UNFREEZE_IWDG() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_IWDG_STOP) |
444 | #define __HAL_DBGMCU_UNFREEZE_IWDG() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_IWDG_STOP) |
438 | #endif |
445 | #endif |
439 | 446 | ||
440 | /** |
447 | /** |
441 | * @brief I2C1 Peripherals Debug mode |
448 | * @brief I2C1 Peripherals Debug mode |
442 | */ |
449 | */ |
443 | #if defined (DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT) |
450 | #if defined (DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT) |
444 | #define __HAL_DBGMCU_FREEZE_I2C1_TIMEOUT() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT) |
451 | #define __HAL_DBGMCU_FREEZE_I2C1_TIMEOUT() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT) |
445 | #define __HAL_DBGMCU_UNFREEZE_I2C1_TIMEOUT() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT) |
452 | #define __HAL_DBGMCU_UNFREEZE_I2C1_TIMEOUT() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT) |
446 | #endif |
453 | #endif |
447 | 454 | ||
448 | /** |
455 | /** |
449 | * @brief I2C2 Peripherals Debug mode |
456 | * @brief I2C2 Peripherals Debug mode |
450 | */ |
457 | */ |
451 | #if defined (DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT) |
458 | #if defined (DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT) |
452 | #define __HAL_DBGMCU_FREEZE_I2C2_TIMEOUT() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT) |
459 | #define __HAL_DBGMCU_FREEZE_I2C2_TIMEOUT() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT) |
453 | #define __HAL_DBGMCU_UNFREEZE_I2C2_TIMEOUT() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT) |
460 | #define __HAL_DBGMCU_UNFREEZE_I2C2_TIMEOUT() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT) |
454 | #endif |
461 | #endif |
455 | 462 | ||
456 | /** |
463 | /** |
457 | * @brief TIM9 Peripherals Debug mode |
464 | * @brief TIM9 Peripherals Debug mode |
458 | */ |
465 | */ |
459 | #if defined (DBGMCU_APB2_FZ_DBG_TIM9_STOP) |
466 | #if defined (DBGMCU_APB2_FZ_DBG_TIM9_STOP) |
460 | #define __HAL_DBGMCU_FREEZE_TIM9() SET_BIT(DBGMCU->APB2FZ, DBGMCU_APB2_FZ_DBG_TIM9_STOP) |
467 | #define __HAL_DBGMCU_FREEZE_TIM9() SET_BIT(DBGMCU->APB2FZ, DBGMCU_APB2_FZ_DBG_TIM9_STOP) |
461 | #define __HAL_DBGMCU_UNFREEZE_TIM9() CLEAR_BIT(DBGMCU->APB2FZ, DBGMCU_APB2_FZ_DBG_TIM9_STOP) |
468 | #define __HAL_DBGMCU_UNFREEZE_TIM9() CLEAR_BIT(DBGMCU->APB2FZ, DBGMCU_APB2_FZ_DBG_TIM9_STOP) |
462 | #endif |
469 | #endif |
463 | 470 | ||
464 | /** |
471 | /** |
465 | * @brief TIM10 Peripherals Debug mode |
472 | * @brief TIM10 Peripherals Debug mode |
466 | */ |
473 | */ |
467 | #if defined (DBGMCU_APB2_FZ_DBG_TIM10_STOP) |
474 | #if defined (DBGMCU_APB2_FZ_DBG_TIM10_STOP) |
468 | #define __HAL_DBGMCU_FREEZE_TIM10() SET_BIT(DBGMCU->APB2FZ, DBGMCU_APB2_FZ_DBG_TIM10_STOP) |
475 | #define __HAL_DBGMCU_FREEZE_TIM10() SET_BIT(DBGMCU->APB2FZ, DBGMCU_APB2_FZ_DBG_TIM10_STOP) |
469 | #define __HAL_DBGMCU_UNFREEZE_TIM10() CLEAR_BIT(DBGMCU->APB2FZ, DBGMCU_APB2_FZ_DBG_TIM10_STOP) |
476 | #define __HAL_DBGMCU_UNFREEZE_TIM10() CLEAR_BIT(DBGMCU->APB2FZ, DBGMCU_APB2_FZ_DBG_TIM10_STOP) |
470 | #endif |
477 | #endif |
471 | 478 | ||
472 | /** |
479 | /** |
473 | * @brief TIM11 Peripherals Debug mode |
480 | * @brief TIM11 Peripherals Debug mode |
474 | */ |
481 | */ |
475 | #if defined (DBGMCU_APB2_FZ_DBG_TIM11_STOP) |
482 | #if defined (DBGMCU_APB2_FZ_DBG_TIM11_STOP) |
476 | #define __HAL_DBGMCU_FREEZE_TIM11() SET_BIT(DBGMCU->APB2FZ, DBGMCU_APB2_FZ_DBG_TIM11_STOP) |
483 | #define __HAL_DBGMCU_FREEZE_TIM11() SET_BIT(DBGMCU->APB2FZ, DBGMCU_APB2_FZ_DBG_TIM11_STOP) |
477 | #define __HAL_DBGMCU_UNFREEZE_TIM11() CLEAR_BIT(DBGMCU->APB2FZ, DBGMCU_APB2_FZ_DBG_TIM11_STOP) |
484 | #define __HAL_DBGMCU_UNFREEZE_TIM11() CLEAR_BIT(DBGMCU->APB2FZ, DBGMCU_APB2_FZ_DBG_TIM11_STOP) |
478 | #endif |
485 | #endif |
Line 493... | Line 500... | ||
493 | /** @defgroup SYSCFG_VrefInt VREFINT configuration |
500 | /** @defgroup SYSCFG_VrefInt VREFINT configuration |
494 | * @{ |
501 | * @{ |
495 | */ |
502 | */ |
496 | 503 | ||
497 | /** |
504 | /** |
498 | * @brief Enables or disables the output of internal reference voltage |
505 | * @brief Enables or disables the output of internal reference voltage |
499 | * (VREFINT) on I/O pin. |
506 | * (VrefInt) on I/O pin. |
500 | * The VREFINT output can be routed to any I/O in group 3: |
507 | * @note The VrefInt output can be routed to any I/O in group 3: |
501 | * - For Cat.1 and Cat.2 devices: CH8 (PB0) or CH9 (PB1). |
508 | * - For Cat.1 and Cat.2 devices: CH8 (PB0) or CH9 (PB1). |
502 | * - For Cat.3 devices: CH8 (PB0), CH9 (PB1) or CH0b (PB2). |
509 | * - For Cat.3 devices: CH8 (PB0), CH9 (PB1) or CH0b (PB2). |
503 | * - For Cat.4 and Cat.5 devices: CH8 (PB0), CH9 (PB1), CH0b (PB2), |
510 | * - For Cat.4 and Cat.5 devices: CH8 (PB0), CH9 (PB1), CH0b (PB2), |
504 | * CH1b (PF11) or CH2b (PF12). |
511 | * CH1b (PF11) or CH2b (PF12). |
505 | * Note: Comparator peripheral clock must be preliminarility enabled, |
512 | * Note: Comparator peripheral clock must be preliminarily enabled, |
506 | * either in COMP user function "HAL_COMP_MspInit()" (should be |
513 | * either in COMP user function "HAL_COMP_MspInit()" (should be |
507 | * done if comparators are used) or by direct clock enable: |
514 | * done if comparators are used) or by direct clock enable: |
508 | * Refer to macro "__HAL_RCC_COMP_CLK_ENABLE()". |
515 | * Refer to macro "__HAL_RCC_COMP_CLK_ENABLE()". |
509 | * Note: In addition with this macro, Vrefint output buffer must be |
516 | * Note: In addition with this macro, VrefInt output buffer must be |
510 | * connected to the selected I/O pin. Refer to macro |
517 | * connected to the selected I/O pin. Refer to macro |
511 | * "__HAL_RI_IOSWITCH_CLOSE()". |
518 | * "__HAL_RI_IOSWITCH_CLOSE()". |
512 | * @note ENABLE: Internal reference voltage connected to I/O group 3 |
519 | * @note VrefInt output enable: Internal reference voltage connected to I/O group 3 |
513 | * @note DISABLE: Internal reference voltage disconnected from I/O group 3 |
520 | * VrefInt output disable: Internal reference voltage disconnected from I/O group 3 |
514 | * @retval None |
521 | * @retval None |
515 | */ |
522 | */ |
516 | #define __HAL_SYSCFG_VREFINT_OUT_ENABLE() SET_BIT(COMP->CSR, COMP_CSR_VREFOUTEN) |
523 | #define __HAL_SYSCFG_VREFINT_OUT_ENABLE() SET_BIT(COMP->CSR, COMP_CSR_VREFOUTEN) |
517 | #define __HAL_SYSCFG_VREFINT_OUT_DISABLE() CLEAR_BIT(COMP->CSR, COMP_CSR_VREFOUTEN) |
524 | #define __HAL_SYSCFG_VREFINT_OUT_DISABLE() CLEAR_BIT(COMP->CSR, COMP_CSR_VREFOUTEN) |
518 | 525 | ||
Line 544... | Line 551... | ||
544 | 551 | ||
545 | #endif /* FSMC_R_BASE */ |
552 | #endif /* FSMC_R_BASE */ |
546 | 553 | ||
547 | /** |
554 | /** |
548 | * @brief Returns the boot mode as configured by user. |
555 | * @brief Returns the boot mode as configured by user. |
549 | * @retval The boot mode as configured by user. The returned value can be one |
556 | * @retval The boot mode as configured by user. The returned value can be one |
550 | * of the following values: |
557 | * of the following values: |
551 | * @arg SYSCFG_BOOT_MAINFLASH |
558 | * @arg SYSCFG_BOOT_MAINFLASH |
552 | * @arg SYSCFG_BOOT_SYSTEMFLASH |
559 | * @arg SYSCFG_BOOT_SYSTEMFLASH |
553 | * @arg SYSCFG_BOOT_FSMC (available only for STM32L151xD, STM32L152xD & STM32L162xD) |
560 | * @arg SYSCFG_BOOT_FSMC (available only for STM32L151xD, STM32L152xD & STM32L162xD) |
554 | * @arg SYSCFG_BOOT_SRAM |
561 | * @arg SYSCFG_BOOT_SRAM |
Line 578... | Line 585... | ||
578 | * @} |
585 | * @} |
579 | */ |
586 | */ |
580 | 587 | ||
581 | /** @defgroup RI_Macris RI: Routing Interface |
588 | /** @defgroup RI_Macris RI: Routing Interface |
582 | * @{ |
589 | * @{ |
583 | */ |
590 | */ |
584 | 591 | ||
585 | /** @defgroup RI_InputCaputureConfig Input Capture configuration |
592 | /** @defgroup RI_InputCaputureConfig Input Capture configuration |
586 | * @{ |
593 | * @{ |
587 | */ |
594 | */ |
588 | 595 | ||
589 | /** |
596 | /** |
590 | * @brief Configures the routing interface to map Input Capture 1 of TIMx to a selected I/O pin. |
597 | * @brief Configures the routing interface to map Input Capture 1 of TIMx to a selected I/O pin. |
591 | * @param __TIMSELECT__: Timer select. |
598 | * @param __TIMSELECT__ Timer select. |
592 | * This parameter can be one of the following values: |
599 | * This parameter can be one of the following values: |
593 | * @arg TIM_SELECT_NONE: No timer selected and default Timer mapping is enabled. |
600 | * @arg TIM_SELECT_NONE: No timer selected and default Timer mapping is enabled. |
594 | * @arg TIM_SELECT_TIM2: Timer 2 Input Captures to be routed. |
601 | * @arg TIM_SELECT_TIM2: Timer 2 Input Captures to be routed. |
595 | * @arg TIM_SELECT_TIM3: Timer 3 Input Captures to be routed. |
602 | * @arg TIM_SELECT_TIM3: Timer 3 Input Captures to be routed. |
596 | * @arg TIM_SELECT_TIM4: Timer 4 Input Captures to be routed. |
603 | * @arg TIM_SELECT_TIM4: Timer 4 Input Captures to be routed. |
597 | * @param __INPUT__: selects which pin to be routed to Input Capture. |
604 | * @param __INPUT__ selects which pin to be routed to Input Capture. |
598 | * This parameter must be a value of @ref RI_InputCaptureRouting |
605 | * This parameter must be a value of @ref RI_InputCaptureRouting |
599 | * e.g. |
606 | * e.g. |
600 | * __HAL_RI_REMAP_INPUTCAPTURE1(TIM_SELECT_TIM2, RI_INPUTCAPTUREROUTING_1) |
607 | * __HAL_RI_REMAP_INPUTCAPTURE1(TIM_SELECT_TIM2, RI_INPUTCAPTUREROUTING_1) |
601 | * allows routing of Input capture IC1 of TIM2 to PA4. |
608 | * allows routing of Input capture IC1 of TIM2 to PA4. |
602 | * For details about correspondence between RI_INPUTCAPTUREROUTING_x |
609 | * For details about correspondence between RI_INPUTCAPTUREROUTING_x |
603 | * and I/O pins refer to the parameters' description in the header file |
610 | * and I/O pins refer to the parameters' description in the header file |
604 | * or refer to the product reference manual. |
611 | * or refer to the product reference manual. |
605 | * @note Input capture selection bits are not reset by this function. |
612 | * @note Input capture selection bits are not reset by this function. |
606 | * To reset input capture selection bits, use SYSCFG_RIDeInit() function. |
613 | * To reset input capture selection bits, use SYSCFG_RIDeInit() function. |
607 | * @note The I/O should be configured in alternate function mode (AF14) using |
614 | * @note The I/O should be configured in alternate function mode (AF14) using |
Line 616... | Line 623... | ||
616 | MODIFY_REG(RI->ICR, RI_ICR_IC1OS, (__INPUT__) << POSITION_VAL(RI_ICR_IC1OS)); \ |
623 | MODIFY_REG(RI->ICR, RI_ICR_IC1OS, (__INPUT__) << POSITION_VAL(RI_ICR_IC1OS)); \ |
617 | }while(0) |
624 | }while(0) |
618 | 625 | ||
619 | /** |
626 | /** |
620 | * @brief Configures the routing interface to map Input Capture 2 of TIMx to a selected I/O pin. |
627 | * @brief Configures the routing interface to map Input Capture 2 of TIMx to a selected I/O pin. |
621 | * @param __TIMSELECT__: Timer select. |
628 | * @param __TIMSELECT__ Timer select. |
622 | * This parameter can be one of the following values: |
629 | * This parameter can be one of the following values: |
623 | * @arg TIM_SELECT_NONE: No timer selected and default Timer mapping is enabled. |
630 | * @arg TIM_SELECT_NONE: No timer selected and default Timer mapping is enabled. |
624 | * @arg TIM_SELECT_TIM2: Timer 2 Input Captures to be routed. |
631 | * @arg TIM_SELECT_TIM2: Timer 2 Input Captures to be routed. |
625 | * @arg TIM_SELECT_TIM3: Timer 3 Input Captures to be routed. |
632 | * @arg TIM_SELECT_TIM3: Timer 3 Input Captures to be routed. |
626 | * @arg TIM_SELECT_TIM4: Timer 4 Input Captures to be routed. |
633 | * @arg TIM_SELECT_TIM4: Timer 4 Input Captures to be routed. |
627 | * @param __INPUT__: selects which pin to be routed to Input Capture. |
634 | * @param __INPUT__ selects which pin to be routed to Input Capture. |
628 | * This parameter must be a value of @ref RI_InputCaptureRouting |
635 | * This parameter must be a value of @ref RI_InputCaptureRouting |
629 | * @retval None. |
636 | * @retval None. |
630 | */ |
637 | */ |
631 | #define __HAL_RI_REMAP_INPUTCAPTURE2(__TIMSELECT__, __INPUT__) \ |
638 | #define __HAL_RI_REMAP_INPUTCAPTURE2(__TIMSELECT__, __INPUT__) \ |
632 | do {assert_param(IS_RI_TIM(__TIMSELECT__)); \ |
639 | do {assert_param(IS_RI_TIM(__TIMSELECT__)); \ |
Line 636... | Line 643... | ||
636 | MODIFY_REG(RI->ICR, RI_ICR_IC2OS, (__INPUT__) << POSITION_VAL(RI_ICR_IC2OS)); \ |
643 | MODIFY_REG(RI->ICR, RI_ICR_IC2OS, (__INPUT__) << POSITION_VAL(RI_ICR_IC2OS)); \ |
637 | }while(0) |
644 | }while(0) |
638 | 645 | ||
639 | /** |
646 | /** |
640 | * @brief Configures the routing interface to map Input Capture 3 of TIMx to a selected I/O pin. |
647 | * @brief Configures the routing interface to map Input Capture 3 of TIMx to a selected I/O pin. |
641 | * @param __TIMSELECT__: Timer select. |
648 | * @param __TIMSELECT__ Timer select. |
642 | * This parameter can be one of the following values: |
649 | * This parameter can be one of the following values: |
643 | * @arg TIM_SELECT_NONE: No timer selected and default Timer mapping is enabled. |
650 | * @arg TIM_SELECT_NONE: No timer selected and default Timer mapping is enabled. |
644 | * @arg TIM_SELECT_TIM2: Timer 2 Input Captures to be routed. |
651 | * @arg TIM_SELECT_TIM2: Timer 2 Input Captures to be routed. |
645 | * @arg TIM_SELECT_TIM3: Timer 3 Input Captures to be routed. |
652 | * @arg TIM_SELECT_TIM3: Timer 3 Input Captures to be routed. |
646 | * @arg TIM_SELECT_TIM4: Timer 4 Input Captures to be routed. |
653 | * @arg TIM_SELECT_TIM4: Timer 4 Input Captures to be routed. |
647 | * @param __INPUT__: selects which pin to be routed to Input Capture. |
654 | * @param __INPUT__ selects which pin to be routed to Input Capture. |
648 | * This parameter must be a value of @ref RI_InputCaptureRouting |
655 | * This parameter must be a value of @ref RI_InputCaptureRouting |
649 | * @retval None. |
656 | * @retval None. |
650 | */ |
657 | */ |
651 | #define __HAL_RI_REMAP_INPUTCAPTURE3(__TIMSELECT__, __INPUT__) \ |
658 | #define __HAL_RI_REMAP_INPUTCAPTURE3(__TIMSELECT__, __INPUT__) \ |
652 | do {assert_param(IS_RI_TIM(__TIMSELECT__)); \ |
659 | do {assert_param(IS_RI_TIM(__TIMSELECT__)); \ |
Line 656... | Line 663... | ||
656 | MODIFY_REG(RI->ICR, RI_ICR_IC3OS, (__INPUT__) << POSITION_VAL(RI_ICR_IC3OS)); \ |
663 | MODIFY_REG(RI->ICR, RI_ICR_IC3OS, (__INPUT__) << POSITION_VAL(RI_ICR_IC3OS)); \ |
657 | }while(0) |
664 | }while(0) |
658 | 665 | ||
659 | /** |
666 | /** |
660 | * @brief Configures the routing interface to map Input Capture 4 of TIMx to a selected I/O pin. |
667 | * @brief Configures the routing interface to map Input Capture 4 of TIMx to a selected I/O pin. |
661 | * @param __TIMSELECT__: Timer select. |
668 | * @param __TIMSELECT__ Timer select. |
662 | * This parameter can be one of the following values: |
669 | * This parameter can be one of the following values: |
663 | * @arg TIM_SELECT_NONE: No timer selected and default Timer mapping is enabled. |
670 | * @arg TIM_SELECT_NONE: No timer selected and default Timer mapping is enabled. |
664 | * @arg TIM_SELECT_TIM2: Timer 2 Input Captures to be routed. |
671 | * @arg TIM_SELECT_TIM2: Timer 2 Input Captures to be routed. |
665 | * @arg TIM_SELECT_TIM3: Timer 3 Input Captures to be routed. |
672 | * @arg TIM_SELECT_TIM3: Timer 3 Input Captures to be routed. |
666 | * @arg TIM_SELECT_TIM4: Timer 4 Input Captures to be routed. |
673 | * @arg TIM_SELECT_TIM4: Timer 4 Input Captures to be routed. |
667 | * @param __INPUT__: selects which pin to be routed to Input Capture. |
674 | * @param __INPUT__ selects which pin to be routed to Input Capture. |
668 | * This parameter must be a value of @ref RI_InputCaptureRouting |
675 | * This parameter must be a value of @ref RI_InputCaptureRouting |
669 | * @retval None. |
676 | * @retval None. |
670 | */ |
677 | */ |
671 | #define __HAL_RI_REMAP_INPUTCAPTURE4(__TIMSELECT__, __INPUT__) \ |
678 | #define __HAL_RI_REMAP_INPUTCAPTURE4(__TIMSELECT__, __INPUT__) \ |
672 | do {assert_param(IS_RI_TIM(__TIMSELECT__)); \ |
679 | do {assert_param(IS_RI_TIM(__TIMSELECT__)); \ |
Line 680... | Line 687... | ||
680 | * @} |
687 | * @} |
681 | */ |
688 | */ |
682 | 689 | ||
683 | /** @defgroup RI_SwitchControlConfig Switch Control configuration |
690 | /** @defgroup RI_SwitchControlConfig Switch Control configuration |
684 | * @{ |
691 | * @{ |
685 | */ |
692 | */ |
686 | 693 | ||
687 | /** |
694 | /** |
688 | * @brief Enable or disable the switch control mode. |
695 | * @brief Enable or disable the switch control mode. |
689 | * @note ENABLE: ADC analog switches closed if the corresponding |
696 | * @note ENABLE: ADC analog switches closed if the corresponding |
690 | * I/O switch is also closed. |
697 | * I/O switch is also closed. |
691 | * When using COMP1, switch control mode must be enabled. |
698 | * When using COMP1, switch control mode must be enabled. |
692 | * @note DISABLE: ADC analog switches open or controlled by the ADC interface. |
699 | * @note DISABLE: ADC analog switches open or controlled by the ADC interface. |
693 | * When using the ADC for acquisition, switch control mode |
700 | * When using the ADC for acquisition, switch control mode |
694 | * must be disabled. |
701 | * must be disabled. |
695 | * @note COMP1 comparator and ADC cannot be used at the same time since |
702 | * @note COMP1 comparator and ADC cannot be used at the same time since |
696 | * they share the ADC switch matrix. |
703 | * they share the ADC switch matrix. |
697 | * @retval None |
704 | * @retval None |
698 | */ |
705 | */ |
699 | #define __HAL_RI_SWITCHCONTROLMODE_ENABLE() SET_BIT(RI->ASCR1, RI_ASCR1_SCM) |
706 | #define __HAL_RI_SWITCHCONTROLMODE_ENABLE() SET_BIT(RI->ASCR1, RI_ASCR1_SCM) |
700 | 707 | ||
701 | #define __HAL_RI_SWITCHCONTROLMODE_DISABLE() CLEAR_BIT(RI->ASCR1, RI_ASCR1_SCM) |
708 | #define __HAL_RI_SWITCHCONTROLMODE_DISABLE() CLEAR_BIT(RI->ASCR1, RI_ASCR1_SCM) |
702 | 709 | ||
703 | /* |
710 | /* |
704 | * @brief Close or Open the routing interface Input Output switches. |
711 | * @brief Close or Open the routing interface Input Output switches. |
705 | * @param __IOSWITCH__: selects the I/O analog switch number. |
712 | * @param __IOSWITCH__ selects the I/O analog switch number. |
706 | * This parameter must be a value of @ref RI_IOSwitch |
713 | * This parameter must be a value of @ref RI_IOSwitch |
707 | * @retval None |
714 | * @retval None |
708 | */ |
715 | */ |
709 | #define __HAL_RI_IOSWITCH_CLOSE(__IOSWITCH__) do { assert_param(IS_RI_IOSWITCH(__IOSWITCH__)); \ |
716 | #define __HAL_RI_IOSWITCH_CLOSE(__IOSWITCH__) do { assert_param(IS_RI_IOSWITCH(__IOSWITCH__)); \ |
710 | if ((__IOSWITCH__) >> 31 != 0 ) \ |
717 | if ((__IOSWITCH__) >> 31 != 0 ) \ |
Line 729... | Line 736... | ||
729 | }while(0) |
736 | }while(0) |
730 | 737 | ||
731 | #if defined (COMP_CSR_SW1) |
738 | #if defined (COMP_CSR_SW1) |
732 | /** |
739 | /** |
733 | * @brief Close or open the internal switch COMP1_SW1. |
740 | * @brief Close or open the internal switch COMP1_SW1. |
734 | * This switch connects I/O pin PC3 (can be used as ADC channel 13) |
741 | * This switch connects I/O pin PC3 (can be used as ADC channel 13) |
735 | * and OPAMP3 ouput to ADC switch matrix (ADC channel VCOMP, channel |
742 | * and OPAMP3 ouput to ADC switch matrix (ADC channel VCOMP, channel |
736 | * 26) and COMP1 non-inverting input. |
743 | * 26) and COMP1 non-inverting input. |
737 | * Pin PC3 connection depends on another switch setting, refer to |
744 | * Pin PC3 connection depends on another switch setting, refer to |
738 | * macro "__HAL_ADC_CHANNEL_SPEED_FAST()". |
745 | * macro "__HAL_ADC_CHANNEL_SPEED_FAST()". |
739 | * @retval None. |
746 | * @retval None. |
Line 747... | Line 754... | ||
747 | * @} |
754 | * @} |
748 | */ |
755 | */ |
749 | 756 | ||
750 | /** @defgroup RI_HystConfig Hysteresis Activation and Deactivation |
757 | /** @defgroup RI_HystConfig Hysteresis Activation and Deactivation |
751 | * @{ |
758 | * @{ |
752 | */ |
759 | */ |
753 | 760 | ||
754 | /** |
761 | /** |
755 | * @brief Enable or disable Hysteresis of the input schmitt triger of Ports A |
762 | * @brief Enable or disable Hysteresis of the input schmitt triger of Ports A |
756 | * When the I/Os are programmed in input mode by standard I/O port |
763 | * When the I/Os are programmed in input mode by standard I/O port |
757 | * registers, the Schmitt trigger and the hysteresis are enabled by default. |
764 | * registers, the Schmitt trigger and the hysteresis are enabled by default. |
758 | * When hysteresis is disabled, it is possible to read the |
765 | * When hysteresis is disabled, it is possible to read the |
759 | * corresponding port with a trigger level of VDDIO/2. |
766 | * corresponding port with a trigger level of VDDIO/2. |
760 | * @param __IOPIN__ : Selects the pin(s) on which to enable or disable hysteresis. |
767 | * @param __IOPIN__ : Selects the pin(s) on which to enable or disable hysteresis. |
761 | * This parameter must be a value of @ref RI_Pin |
768 | * This parameter must be a value of @ref RI_Pin |
762 | * @retval None |
769 | * @retval None |
763 | */ |
770 | */ |
Line 769... | Line 776... | ||
769 | SET_BIT(RI->HYSCR1, (__IOPIN__)); \ |
776 | SET_BIT(RI->HYSCR1, (__IOPIN__)); \ |
770 | } while(0) |
777 | } while(0) |
771 | 778 | ||
772 | /** |
779 | /** |
773 | * @brief Enable or disable Hysteresis of the input schmitt triger of Ports B |
780 | * @brief Enable or disable Hysteresis of the input schmitt triger of Ports B |
774 | * When the I/Os are programmed in input mode by standard I/O port |
781 | * When the I/Os are programmed in input mode by standard I/O port |
775 | * registers, the Schmitt trigger and the hysteresis are enabled by default. |
782 | * registers, the Schmitt trigger and the hysteresis are enabled by default. |
776 | * When hysteresis is disabled, it is possible to read the |
783 | * When hysteresis is disabled, it is possible to read the |
777 | * corresponding port with a trigger level of VDDIO/2. |
784 | * corresponding port with a trigger level of VDDIO/2. |
778 | * @param __IOPIN__ : Selects the pin(s) on which to enable or disable hysteresis. |
785 | * @param __IOPIN__ : Selects the pin(s) on which to enable or disable hysteresis. |
779 | * This parameter must be a value of @ref RI_Pin |
786 | * This parameter must be a value of @ref RI_Pin |
780 | * @retval None |
787 | * @retval None |
781 | */ |
788 | */ |
Line 787... | Line 794... | ||
787 | SET_BIT(RI->HYSCR1, (__IOPIN__) << 16 ); \ |
794 | SET_BIT(RI->HYSCR1, (__IOPIN__) << 16 ); \ |
788 | } while(0) |
795 | } while(0) |
789 | 796 | ||
790 | /** |
797 | /** |
791 | * @brief Enable or disable Hysteresis of the input schmitt triger of Ports C |
798 | * @brief Enable or disable Hysteresis of the input schmitt triger of Ports C |
792 | * When the I/Os are programmed in input mode by standard I/O port |
799 | * When the I/Os are programmed in input mode by standard I/O port |
793 | * registers, the Schmitt trigger and the hysteresis are enabled by default. |
800 | * registers, the Schmitt trigger and the hysteresis are enabled by default. |
794 | * When hysteresis is disabled, it is possible to read the |
801 | * When hysteresis is disabled, it is possible to read the |
795 | * corresponding port with a trigger level of VDDIO/2. |
802 | * corresponding port with a trigger level of VDDIO/2. |
796 | * @param __IOPIN__ : Selects the pin(s) on which to enable or disable hysteresis. |
803 | * @param __IOPIN__ : Selects the pin(s) on which to enable or disable hysteresis. |
797 | * This parameter must be a value of @ref RI_Pin |
804 | * This parameter must be a value of @ref RI_Pin |
798 | * @retval None |
805 | * @retval None |
799 | */ |
806 | */ |
Line 805... | Line 812... | ||
805 | SET_BIT(RI->HYSCR2, (__IOPIN__)); \ |
812 | SET_BIT(RI->HYSCR2, (__IOPIN__)); \ |
806 | } while(0) |
813 | } while(0) |
807 | 814 | ||
808 | /** |
815 | /** |
809 | * @brief Enable or disable Hysteresis of the input schmitt triger of Ports D |
816 | * @brief Enable or disable Hysteresis of the input schmitt triger of Ports D |
810 | * When the I/Os are programmed in input mode by standard I/O port |
817 | * When the I/Os are programmed in input mode by standard I/O port |
811 | * registers, the Schmitt trigger and the hysteresis are enabled by default. |
818 | * registers, the Schmitt trigger and the hysteresis are enabled by default. |
812 | * When hysteresis is disabled, it is possible to read the |
819 | * When hysteresis is disabled, it is possible to read the |
813 | * corresponding port with a trigger level of VDDIO/2. |
820 | * corresponding port with a trigger level of VDDIO/2. |
814 | * @param __IOPIN__ : Selects the pin(s) on which to enable or disable hysteresis. |
821 | * @param __IOPIN__ : Selects the pin(s) on which to enable or disable hysteresis. |
815 | * This parameter must be a value of @ref RI_Pin |
822 | * This parameter must be a value of @ref RI_Pin |
816 | * @retval None |
823 | * @retval None |
817 | */ |
824 | */ |
Line 822... | Line 829... | ||
822 | #define __HAL_RI_HYSTERIS_PORTD_OFF(__IOPIN__) do {assert_param(IS_RI_PIN(__IOPIN__)); \ |
829 | #define __HAL_RI_HYSTERIS_PORTD_OFF(__IOPIN__) do {assert_param(IS_RI_PIN(__IOPIN__)); \ |
823 | SET_BIT(RI->HYSCR2, (__IOPIN__) << 16 ); \ |
830 | SET_BIT(RI->HYSCR2, (__IOPIN__) << 16 ); \ |
824 | } while(0) |
831 | } while(0) |
825 | 832 | ||
826 | #if defined (GPIOE_BASE) |
833 | #if defined (GPIOE_BASE) |
827 | 834 | ||
828 | /** |
835 | /** |
829 | * @brief Enable or disable Hysteresis of the input schmitt triger of Ports E |
836 | * @brief Enable or disable Hysteresis of the input schmitt triger of Ports E |
830 | * When the I/Os are programmed in input mode by standard I/O port |
837 | * When the I/Os are programmed in input mode by standard I/O port |
831 | * registers, the Schmitt trigger and the hysteresis are enabled by default. |
838 | * registers, the Schmitt trigger and the hysteresis are enabled by default. |
832 | * When hysteresis is disabled, it is possible to read the |
839 | * When hysteresis is disabled, it is possible to read the |
833 | * corresponding port with a trigger level of VDDIO/2. |
840 | * corresponding port with a trigger level of VDDIO/2. |
834 | * @param __IOPIN__ : Selects the pin(s) on which to enable or disable hysteresis. |
841 | * @param __IOPIN__ : Selects the pin(s) on which to enable or disable hysteresis. |
835 | * This parameter must be a value of @ref RI_Pin |
842 | * This parameter must be a value of @ref RI_Pin |
836 | * @retval None |
843 | * @retval None |
837 | */ |
844 | */ |
Line 847... | Line 854... | ||
847 | 854 | ||
848 | #if defined(GPIOF_BASE) || defined(GPIOG_BASE) |
855 | #if defined(GPIOF_BASE) || defined(GPIOG_BASE) |
849 | 856 | ||
850 | /** |
857 | /** |
851 | * @brief Enable or disable Hysteresis of the input schmitt triger of Ports F |
858 | * @brief Enable or disable Hysteresis of the input schmitt triger of Ports F |
852 | * When the I/Os are programmed in input mode by standard I/O port |
859 | * When the I/Os are programmed in input mode by standard I/O port |
853 | * registers, the Schmitt trigger and the hysteresis are enabled by default. |
860 | * registers, the Schmitt trigger and the hysteresis are enabled by default. |
854 | * When hysteresis is disabled, it is possible to read the |
861 | * When hysteresis is disabled, it is possible to read the |
855 | * corresponding port with a trigger level of VDDIO/2. |
862 | * corresponding port with a trigger level of VDDIO/2. |
856 | * @param __IOPIN__ : Selects the pin(s) on which to enable or disable hysteresis. |
863 | * @param __IOPIN__ : Selects the pin(s) on which to enable or disable hysteresis. |
857 | * This parameter must be a value of @ref RI_Pin |
864 | * This parameter must be a value of @ref RI_Pin |
858 | * @retval None |
865 | * @retval None |
859 | */ |
866 | */ |
Line 865... | Line 872... | ||
865 | SET_BIT(RI->HYSCR3, (__IOPIN__) << 16 ); \ |
872 | SET_BIT(RI->HYSCR3, (__IOPIN__) << 16 ); \ |
866 | } while(0) |
873 | } while(0) |
867 | 874 | ||
868 | /** |
875 | /** |
869 | * @brief Enable or disable Hysteresis of the input schmitt triger of Ports G |
876 | * @brief Enable or disable Hysteresis of the input schmitt triger of Ports G |
870 | * When the I/Os are programmed in input mode by standard I/O port |
877 | * When the I/Os are programmed in input mode by standard I/O port |
871 | * registers, the Schmitt trigger and the hysteresis are enabled by default. |
878 | * registers, the Schmitt trigger and the hysteresis are enabled by default. |
872 | * When hysteresis is disabled, it is possible to read the |
879 | * When hysteresis is disabled, it is possible to read the |
873 | * corresponding port with a trigger level of VDDIO/2. |
880 | * corresponding port with a trigger level of VDDIO/2. |
874 | * @param __IOPIN__ : Selects the pin(s) on which to enable or disable hysteresis. |
881 | * @param __IOPIN__ : Selects the pin(s) on which to enable or disable hysteresis. |
875 | * This parameter must be a value of @ref RI_Pin |
882 | * This parameter must be a value of @ref RI_Pin |
876 | * @retval None |
883 | * @retval None |
877 | */ |
884 | */ |
Line 895... | Line 902... | ||
895 | 902 | ||
896 | /** |
903 | /** |
897 | * @} |
904 | * @} |
898 | */ |
905 | */ |
899 | 906 | ||
900 | /* Exported functions --------------------------------------------------------*/ |
907 | /* Exported variables --------------------------------------------------------*/ |
- | 908 | /** @defgroup HAL_Exported_Variables HAL Exported Variables |
|
- | 909 | * @{ |
|
- | 910 | */ |
|
- | 911 | extern __IO uint32_t uwTick; |
|
- | 912 | extern uint32_t uwTickPrio; |
|
- | 913 | extern uint32_t uwTickFreq; |
|
- | 914 | /** |
|
- | 915 | * @} |
|
- | 916 | */ |
|
901 | 917 | ||
- | 918 | /* Exported functions --------------------------------------------------------*/ |
|
902 | /** @addtogroup HAL_Exported_Functions |
919 | /** @addtogroup HAL_Exported_Functions |
903 | * @{ |
920 | * @{ |
904 | */ |
921 | */ |
905 | 922 | ||
906 | /** @addtogroup HAL_Exported_Functions_Group1 |
923 | /** @addtogroup HAL_Exported_Functions_Group1 |
Line 910... | Line 927... | ||
910 | /* Initialization and de-initialization functions ******************************/ |
927 | /* Initialization and de-initialization functions ******************************/ |
911 | HAL_StatusTypeDef HAL_Init(void); |
928 | HAL_StatusTypeDef HAL_Init(void); |
912 | HAL_StatusTypeDef HAL_DeInit(void); |
929 | HAL_StatusTypeDef HAL_DeInit(void); |
913 | void HAL_MspInit(void); |
930 | void HAL_MspInit(void); |
914 | void HAL_MspDeInit(void); |
931 | void HAL_MspDeInit(void); |
915 | HAL_StatusTypeDef HAL_InitTick (uint32_t TickPriority); |
932 | HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority); |
916 | 933 | ||
917 | /** |
934 | /** |
918 | * @} |
935 | * @} |
919 | */ |
936 | */ |
920 | 937 | ||
921 | /** @addtogroup HAL_Exported_Functions_Group2 |
938 | /** @addtogroup HAL_Exported_Functions_Group2 |
922 | * @{ |
939 | * @{ |
923 | */ |
940 | */ |
924 | 941 | ||
925 | /* Peripheral Control functions ************************************************/ |
942 | /* Peripheral Control functions ************************************************/ |
926 | void HAL_IncTick(void); |
943 | void HAL_IncTick(void); |
927 | void HAL_Delay(__IO uint32_t Delay); |
944 | void HAL_Delay(uint32_t Delay); |
928 | uint32_t HAL_GetTick(void); |
945 | uint32_t HAL_GetTick(void); |
- | 946 | uint32_t HAL_GetTickPrio(void); |
|
- | 947 | HAL_StatusTypeDef HAL_SetTickFreq(uint32_t Freq); |
|
- | 948 | uint32_t HAL_GetTickFreq(void); |
|
929 | void HAL_SuspendTick(void); |
949 | void HAL_SuspendTick(void); |
930 | void HAL_ResumeTick(void); |
950 | void HAL_ResumeTick(void); |
931 | uint32_t HAL_GetHalVersion(void); |
951 | uint32_t HAL_GetHalVersion(void); |
932 | uint32_t HAL_GetREVID(void); |
952 | uint32_t HAL_GetREVID(void); |
933 | uint32_t HAL_GetDEVID(void); |
953 | uint32_t HAL_GetDEVID(void); |
- | 954 | uint32_t HAL_GetUIDw0(void); |
|
- | 955 | uint32_t HAL_GetUIDw1(void); |
|
- | 956 | uint32_t HAL_GetUIDw2(void); |
|
- | 957 | ||
- | 958 | /** |
|
- | 959 | * @} |
|
- | 960 | */ |
|
- | 961 | ||
- | 962 | /** @addtogroup HAL_Exported_Functions_Group3 |
|
- | 963 | * @{ |
|
- | 964 | */ |
|
- | 965 | ||
- | 966 | /* DBGMCU Peripheral Control functions *****************************************/ |
|
934 | void HAL_DBGMCU_EnableDBGSleepMode(void); |
967 | void HAL_DBGMCU_EnableDBGSleepMode(void); |
935 | void HAL_DBGMCU_DisableDBGSleepMode(void); |
968 | void HAL_DBGMCU_DisableDBGSleepMode(void); |
936 | void HAL_DBGMCU_EnableDBGStopMode(void); |
969 | void HAL_DBGMCU_EnableDBGStopMode(void); |
937 | void HAL_DBGMCU_DisableDBGStopMode(void); |
970 | void HAL_DBGMCU_DisableDBGStopMode(void); |
938 | void HAL_DBGMCU_EnableDBGStandbyMode(void); |
971 | void HAL_DBGMCU_EnableDBGStandbyMode(void); |
Line 944... | Line 977... | ||
944 | 977 | ||
945 | /** |
978 | /** |
946 | * @} |
979 | * @} |
947 | */ |
980 | */ |
948 | 981 | ||
949 | - | ||
950 | /** |
982 | /** |
951 | * @} |
983 | * @} |
952 | */ |
984 | */ |
953 | 985 | ||
954 | /** |
986 | /** |
955 | * @} |
987 | * @} |
956 | */ |
988 | */ |
957 | 989 | ||
958 | #ifdef __cplusplus |
990 | #ifdef __cplusplus |
959 | } |
991 | } |
960 | #endif |
992 | #endif |
961 | 993 | ||
962 | #endif /* __STM32L1xx_HAL_H */ |
994 | #endif /* __STM32L1xx_HAL_H */ |