mbed library sources

Dependents:   bare

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Wed Feb 26 09:45:12 2014 +0000
Revision:
106:ced8cbb51063
Parent:
80:66393a7b209d
Synchronized with git revision 4222735eff5868389433f0e9271976b39c8115cd

Full URL: https://github.com/mbedmicro/mbed/commit/4222735eff5868389433f0e9271976b39c8115cd/

[NUCLEO_xxx] Update STM32CubeF4 driver V1.0.0 + update license

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 76:aeb1df146756 1 /**
mbed_official 76:aeb1df146756 2 ******************************************************************************
mbed_official 76:aeb1df146756 3 * @file stm32l1xx_syscfg.h
mbed_official 76:aeb1df146756 4 * @author MCD Application Team
mbed_official 80:66393a7b209d 5 * @version V1.3.0
mbed_official 80:66393a7b209d 6 * @date 31-January-2014
mbed_official 76:aeb1df146756 7 * @brief This file contains all the functions prototypes for the SYSCFG
mbed_official 76:aeb1df146756 8 * firmware library.
mbed_official 76:aeb1df146756 9 ******************************************************************************
mbed_official 76:aeb1df146756 10 * @attention
mbed_official 76:aeb1df146756 11 *
mbed_official 106:ced8cbb51063 12 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
mbed_official 76:aeb1df146756 13 *
mbed_official 106:ced8cbb51063 14 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 106:ced8cbb51063 15 * are permitted provided that the following conditions are met:
mbed_official 106:ced8cbb51063 16 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 106:ced8cbb51063 17 * this list of conditions and the following disclaimer.
mbed_official 106:ced8cbb51063 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 106:ced8cbb51063 19 * this list of conditions and the following disclaimer in the documentation
mbed_official 106:ced8cbb51063 20 * and/or other materials provided with the distribution.
mbed_official 106:ced8cbb51063 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 106:ced8cbb51063 22 * may be used to endorse or promote products derived from this software
mbed_official 106:ced8cbb51063 23 * without specific prior written permission.
mbed_official 76:aeb1df146756 24 *
mbed_official 106:ced8cbb51063 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 106:ced8cbb51063 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 106:ced8cbb51063 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 106:ced8cbb51063 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 106:ced8cbb51063 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 106:ced8cbb51063 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 106:ced8cbb51063 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 106:ced8cbb51063 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 106:ced8cbb51063 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 106:ced8cbb51063 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 76:aeb1df146756 35 *
mbed_official 76:aeb1df146756 36 ******************************************************************************
mbed_official 76:aeb1df146756 37 */
mbed_official 76:aeb1df146756 38
mbed_official 76:aeb1df146756 39 /*!< Define to prevent recursive inclusion -------------------------------------*/
mbed_official 76:aeb1df146756 40 #ifndef __STM32L1xx_SYSCFG_H
mbed_official 76:aeb1df146756 41 #define __STM32L1xx_SYSCFG_H
mbed_official 76:aeb1df146756 42
mbed_official 76:aeb1df146756 43 #ifdef __cplusplus
mbed_official 76:aeb1df146756 44 extern "C" {
mbed_official 76:aeb1df146756 45 #endif
mbed_official 76:aeb1df146756 46
mbed_official 76:aeb1df146756 47 /*!< Includes ------------------------------------------------------------------*/
mbed_official 76:aeb1df146756 48 #include "stm32l1xx.h"
mbed_official 76:aeb1df146756 49
mbed_official 76:aeb1df146756 50 /** @addtogroup STM32L1xx_StdPeriph_Driver
mbed_official 76:aeb1df146756 51 * @{
mbed_official 76:aeb1df146756 52 */
mbed_official 76:aeb1df146756 53
mbed_official 76:aeb1df146756 54 /** @addtogroup SYSCFG
mbed_official 76:aeb1df146756 55 * @{
mbed_official 76:aeb1df146756 56 */
mbed_official 76:aeb1df146756 57
mbed_official 76:aeb1df146756 58 /* Exported types ------------------------------------------------------------*/
mbed_official 76:aeb1df146756 59 /* Exported constants --------------------------------------------------------*/
mbed_official 76:aeb1df146756 60
mbed_official 76:aeb1df146756 61 /** @defgroup SYSCFG_Exported_Constants
mbed_official 76:aeb1df146756 62 * @{
mbed_official 76:aeb1df146756 63 */
mbed_official 76:aeb1df146756 64
mbed_official 76:aeb1df146756 65 /** @defgroup EXTI_Port_Sources
mbed_official 76:aeb1df146756 66 * @{
mbed_official 76:aeb1df146756 67 */
mbed_official 76:aeb1df146756 68 #define EXTI_PortSourceGPIOA ((uint8_t)0x00)
mbed_official 76:aeb1df146756 69 #define EXTI_PortSourceGPIOB ((uint8_t)0x01)
mbed_official 76:aeb1df146756 70 #define EXTI_PortSourceGPIOC ((uint8_t)0x02)
mbed_official 76:aeb1df146756 71 #define EXTI_PortSourceGPIOD ((uint8_t)0x03)
mbed_official 76:aeb1df146756 72 #define EXTI_PortSourceGPIOE ((uint8_t)0x04)
mbed_official 76:aeb1df146756 73 #define EXTI_PortSourceGPIOH ((uint8_t)0x05)
mbed_official 76:aeb1df146756 74 #define EXTI_PortSourceGPIOF ((uint8_t)0x06)
mbed_official 76:aeb1df146756 75 #define EXTI_PortSourceGPIOG ((uint8_t)0x07)
mbed_official 76:aeb1df146756 76
mbed_official 76:aeb1df146756 77 #define IS_EXTI_PORT_SOURCE(PORTSOURCE) (((PORTSOURCE) == EXTI_PortSourceGPIOA) || \
mbed_official 76:aeb1df146756 78 ((PORTSOURCE) == EXTI_PortSourceGPIOB) || \
mbed_official 76:aeb1df146756 79 ((PORTSOURCE) == EXTI_PortSourceGPIOC) || \
mbed_official 76:aeb1df146756 80 ((PORTSOURCE) == EXTI_PortSourceGPIOD) || \
mbed_official 76:aeb1df146756 81 ((PORTSOURCE) == EXTI_PortSourceGPIOE) || \
mbed_official 76:aeb1df146756 82 ((PORTSOURCE) == EXTI_PortSourceGPIOF) || \
mbed_official 76:aeb1df146756 83 ((PORTSOURCE) == EXTI_PortSourceGPIOG) || \
mbed_official 76:aeb1df146756 84 ((PORTSOURCE) == EXTI_PortSourceGPIOH))
mbed_official 76:aeb1df146756 85 /**
mbed_official 76:aeb1df146756 86 * @}
mbed_official 76:aeb1df146756 87 */
mbed_official 76:aeb1df146756 88
mbed_official 76:aeb1df146756 89 /** @defgroup EXTI_Pin_sources
mbed_official 76:aeb1df146756 90 * @{
mbed_official 76:aeb1df146756 91 */
mbed_official 76:aeb1df146756 92 #define EXTI_PinSource0 ((uint8_t)0x00)
mbed_official 76:aeb1df146756 93 #define EXTI_PinSource1 ((uint8_t)0x01)
mbed_official 76:aeb1df146756 94 #define EXTI_PinSource2 ((uint8_t)0x02)
mbed_official 76:aeb1df146756 95 #define EXTI_PinSource3 ((uint8_t)0x03)
mbed_official 76:aeb1df146756 96 #define EXTI_PinSource4 ((uint8_t)0x04)
mbed_official 76:aeb1df146756 97 #define EXTI_PinSource5 ((uint8_t)0x05)
mbed_official 76:aeb1df146756 98 #define EXTI_PinSource6 ((uint8_t)0x06)
mbed_official 76:aeb1df146756 99 #define EXTI_PinSource7 ((uint8_t)0x07)
mbed_official 76:aeb1df146756 100 #define EXTI_PinSource8 ((uint8_t)0x08)
mbed_official 76:aeb1df146756 101 #define EXTI_PinSource9 ((uint8_t)0x09)
mbed_official 76:aeb1df146756 102 #define EXTI_PinSource10 ((uint8_t)0x0A)
mbed_official 76:aeb1df146756 103 #define EXTI_PinSource11 ((uint8_t)0x0B)
mbed_official 76:aeb1df146756 104 #define EXTI_PinSource12 ((uint8_t)0x0C)
mbed_official 76:aeb1df146756 105 #define EXTI_PinSource13 ((uint8_t)0x0D)
mbed_official 76:aeb1df146756 106 #define EXTI_PinSource14 ((uint8_t)0x0E)
mbed_official 76:aeb1df146756 107 #define EXTI_PinSource15 ((uint8_t)0x0F)
mbed_official 76:aeb1df146756 108 #define IS_EXTI_PIN_SOURCE(PINSOURCE) (((PINSOURCE) == EXTI_PinSource0) || \
mbed_official 76:aeb1df146756 109 ((PINSOURCE) == EXTI_PinSource1) || \
mbed_official 76:aeb1df146756 110 ((PINSOURCE) == EXTI_PinSource2) || \
mbed_official 76:aeb1df146756 111 ((PINSOURCE) == EXTI_PinSource3) || \
mbed_official 76:aeb1df146756 112 ((PINSOURCE) == EXTI_PinSource4) || \
mbed_official 76:aeb1df146756 113 ((PINSOURCE) == EXTI_PinSource5) || \
mbed_official 76:aeb1df146756 114 ((PINSOURCE) == EXTI_PinSource6) || \
mbed_official 76:aeb1df146756 115 ((PINSOURCE) == EXTI_PinSource7) || \
mbed_official 76:aeb1df146756 116 ((PINSOURCE) == EXTI_PinSource8) || \
mbed_official 76:aeb1df146756 117 ((PINSOURCE) == EXTI_PinSource9) || \
mbed_official 76:aeb1df146756 118 ((PINSOURCE) == EXTI_PinSource10) || \
mbed_official 76:aeb1df146756 119 ((PINSOURCE) == EXTI_PinSource11) || \
mbed_official 76:aeb1df146756 120 ((PINSOURCE) == EXTI_PinSource12) || \
mbed_official 76:aeb1df146756 121 ((PINSOURCE) == EXTI_PinSource13) || \
mbed_official 76:aeb1df146756 122 ((PINSOURCE) == EXTI_PinSource14) || \
mbed_official 76:aeb1df146756 123 ((PINSOURCE) == EXTI_PinSource15))
mbed_official 76:aeb1df146756 124 /**
mbed_official 76:aeb1df146756 125 * @}
mbed_official 76:aeb1df146756 126 */
mbed_official 76:aeb1df146756 127
mbed_official 76:aeb1df146756 128 /** @defgroup SYSCFG_Memory_Remap_Config
mbed_official 76:aeb1df146756 129 * @{
mbed_official 76:aeb1df146756 130 */
mbed_official 76:aeb1df146756 131 #define SYSCFG_MemoryRemap_Flash ((uint8_t)0x00)
mbed_official 76:aeb1df146756 132 #define SYSCFG_MemoryRemap_SystemFlash ((uint8_t)0x01)
mbed_official 76:aeb1df146756 133 #define SYSCFG_MemoryRemap_FSMC ((uint8_t)0x02)
mbed_official 76:aeb1df146756 134 #define SYSCFG_MemoryRemap_SRAM ((uint8_t)0x03)
mbed_official 76:aeb1df146756 135
mbed_official 76:aeb1df146756 136 #define IS_SYSCFG_MEMORY_REMAP_CONFING(REMAP) (((REMAP) == SYSCFG_MemoryRemap_Flash) || \
mbed_official 76:aeb1df146756 137 ((REMAP) == SYSCFG_MemoryRemap_SystemFlash) || \
mbed_official 76:aeb1df146756 138 ((REMAP) == SYSCFG_MemoryRemap_FSMC) || \
mbed_official 76:aeb1df146756 139 ((REMAP) == SYSCFG_MemoryRemap_SRAM))
mbed_official 76:aeb1df146756 140
mbed_official 76:aeb1df146756 141 /**
mbed_official 76:aeb1df146756 142 * @}
mbed_official 76:aeb1df146756 143 */
mbed_official 76:aeb1df146756 144
mbed_official 76:aeb1df146756 145 /** @defgroup RI_Resistor
mbed_official 76:aeb1df146756 146 * @{
mbed_official 76:aeb1df146756 147 */
mbed_official 76:aeb1df146756 148
mbed_official 76:aeb1df146756 149 #define RI_Resistor_10KPU COMP_CSR_10KPU
mbed_official 76:aeb1df146756 150 #define RI_Resistor_400KPU COMP_CSR_400KPU
mbed_official 76:aeb1df146756 151 #define RI_Resistor_10KPD COMP_CSR_10KPD
mbed_official 76:aeb1df146756 152 #define RI_Resistor_400KPD COMP_CSR_400KPD
mbed_official 76:aeb1df146756 153
mbed_official 76:aeb1df146756 154 #define IS_RI_RESISTOR(RESISTOR) (((RESISTOR) == COMP_CSR_10KPU) || \
mbed_official 76:aeb1df146756 155 ((RESISTOR) == COMP_CSR_400KPU) || \
mbed_official 76:aeb1df146756 156 ((RESISTOR) == COMP_CSR_10KPD) || \
mbed_official 76:aeb1df146756 157 ((RESISTOR) == COMP_CSR_400KPD))
mbed_official 76:aeb1df146756 158
mbed_official 76:aeb1df146756 159 /**
mbed_official 76:aeb1df146756 160 * @}
mbed_official 76:aeb1df146756 161 */
mbed_official 76:aeb1df146756 162
mbed_official 76:aeb1df146756 163 /** @defgroup RI_Channel
mbed_official 76:aeb1df146756 164 * @{
mbed_official 76:aeb1df146756 165 */
mbed_official 76:aeb1df146756 166
mbed_official 76:aeb1df146756 167 #define RI_Channel_3 ((uint32_t)0x04000000)
mbed_official 76:aeb1df146756 168 #define RI_Channel_8 ((uint32_t)0x08000000)
mbed_official 76:aeb1df146756 169 #define RI_Channel_13 ((uint32_t)0x10000000)
mbed_official 76:aeb1df146756 170
mbed_official 76:aeb1df146756 171 #define IS_RI_CHANNEL(CHANNEL) (((CHANNEL) == RI_Channel_3) || \
mbed_official 76:aeb1df146756 172 ((CHANNEL) == RI_Channel_8) || \
mbed_official 76:aeb1df146756 173 ((CHANNEL) == RI_Channel_13))
mbed_official 76:aeb1df146756 174
mbed_official 76:aeb1df146756 175 /**
mbed_official 76:aeb1df146756 176 * @}
mbed_official 76:aeb1df146756 177 */
mbed_official 76:aeb1df146756 178
mbed_official 76:aeb1df146756 179 /** @defgroup RI_ChannelSpeed
mbed_official 76:aeb1df146756 180 * @{
mbed_official 76:aeb1df146756 181 */
mbed_official 76:aeb1df146756 182
mbed_official 76:aeb1df146756 183 #define RI_ChannelSpeed_Fast ((uint32_t)0x00000000)
mbed_official 76:aeb1df146756 184 #define RI_ChannelSpeed_Slow ((uint32_t)0x00000001)
mbed_official 76:aeb1df146756 185
mbed_official 76:aeb1df146756 186 #define IS_RI_CHANNELSPEED(SPEED) (((SPEED) == RI_ChannelSpeed_Fast) || \
mbed_official 76:aeb1df146756 187 ((SPEED) == RI_ChannelSpeed_Slow))
mbed_official 76:aeb1df146756 188
mbed_official 76:aeb1df146756 189 /**
mbed_official 76:aeb1df146756 190 * @}
mbed_official 76:aeb1df146756 191 */
mbed_official 76:aeb1df146756 192
mbed_official 76:aeb1df146756 193 /** @defgroup RI_InputCapture
mbed_official 76:aeb1df146756 194 * @{
mbed_official 76:aeb1df146756 195 */
mbed_official 76:aeb1df146756 196
mbed_official 76:aeb1df146756 197 #define RI_InputCapture_IC1 RI_ICR_IC1 /*!< Input Capture 1 */
mbed_official 76:aeb1df146756 198 #define RI_InputCapture_IC2 RI_ICR_IC2 /*!< Input Capture 2 */
mbed_official 76:aeb1df146756 199 #define RI_InputCapture_IC3 RI_ICR_IC3 /*!< Input Capture 3 */
mbed_official 76:aeb1df146756 200 #define RI_InputCapture_IC4 RI_ICR_IC4 /*!< Input Capture 4 */
mbed_official 76:aeb1df146756 201
mbed_official 76:aeb1df146756 202 #define IS_RI_INPUTCAPTURE(INPUTCAPTURE) ((((INPUTCAPTURE) & (uint32_t)0xFFC2FFFF) == 0x00) && ((INPUTCAPTURE) != (uint32_t)0x00))
mbed_official 76:aeb1df146756 203 /**
mbed_official 76:aeb1df146756 204 * @}
mbed_official 76:aeb1df146756 205 */
mbed_official 76:aeb1df146756 206
mbed_official 76:aeb1df146756 207 /** @defgroup TIM_Select
mbed_official 76:aeb1df146756 208 * @{
mbed_official 76:aeb1df146756 209 */
mbed_official 76:aeb1df146756 210
mbed_official 76:aeb1df146756 211 #define TIM_Select_None ((uint32_t)0x00000000) /*!< None selected */
mbed_official 76:aeb1df146756 212 #define TIM_Select_TIM2 ((uint32_t)0x00010000) /*!< Timer 2 selected */
mbed_official 76:aeb1df146756 213 #define TIM_Select_TIM3 ((uint32_t)0x00020000) /*!< Timer 3 selected */
mbed_official 76:aeb1df146756 214 #define TIM_Select_TIM4 ((uint32_t)0x00030000) /*!< Timer 4 selected */
mbed_official 76:aeb1df146756 215
mbed_official 76:aeb1df146756 216 #define IS_RI_TIM(TIM) (((TIM) == TIM_Select_None) || \
mbed_official 76:aeb1df146756 217 ((TIM) == TIM_Select_TIM2) || \
mbed_official 76:aeb1df146756 218 ((TIM) == TIM_Select_TIM3) || \
mbed_official 76:aeb1df146756 219 ((TIM) == TIM_Select_TIM4))
mbed_official 76:aeb1df146756 220
mbed_official 76:aeb1df146756 221 /**
mbed_official 76:aeb1df146756 222 * @}
mbed_official 76:aeb1df146756 223 */
mbed_official 76:aeb1df146756 224
mbed_official 76:aeb1df146756 225 /** @defgroup RI_InputCaptureRouting
mbed_official 76:aeb1df146756 226 * @{
mbed_official 76:aeb1df146756 227 */
mbed_official 76:aeb1df146756 228 /* TIMx_IC1 TIMx_IC2 TIMx_IC3 TIMx_IC4 */
mbed_official 76:aeb1df146756 229 #define RI_InputCaptureRouting_0 ((uint32_t)0x00000000) /* PA0 PA1 PA2 PA3 */
mbed_official 76:aeb1df146756 230 #define RI_InputCaptureRouting_1 ((uint32_t)0x00000001) /* PA4 PA5 PA6 PA7 */
mbed_official 76:aeb1df146756 231 #define RI_InputCaptureRouting_2 ((uint32_t)0x00000002) /* PA8 PA9 PA10 PA11 */
mbed_official 76:aeb1df146756 232 #define RI_InputCaptureRouting_3 ((uint32_t)0x00000003) /* PA12 PA13 PA14 PA15 */
mbed_official 76:aeb1df146756 233 #define RI_InputCaptureRouting_4 ((uint32_t)0x00000004) /* PC0 PC1 PC2 PC3 */
mbed_official 76:aeb1df146756 234 #define RI_InputCaptureRouting_5 ((uint32_t)0x00000005) /* PC4 PC5 PC6 PC7 */
mbed_official 76:aeb1df146756 235 #define RI_InputCaptureRouting_6 ((uint32_t)0x00000006) /* PC8 PC9 PC10 PC11 */
mbed_official 76:aeb1df146756 236 #define RI_InputCaptureRouting_7 ((uint32_t)0x00000007) /* PC12 PC13 PC14 PC15 */
mbed_official 76:aeb1df146756 237 #define RI_InputCaptureRouting_8 ((uint32_t)0x00000008) /* PD0 PD1 PD2 PD3 */
mbed_official 76:aeb1df146756 238 #define RI_InputCaptureRouting_9 ((uint32_t)0x00000009) /* PD4 PD5 PD6 PD7 */
mbed_official 76:aeb1df146756 239 #define RI_InputCaptureRouting_10 ((uint32_t)0x0000000A) /* PD8 PD9 PD10 PD11 */
mbed_official 76:aeb1df146756 240 #define RI_InputCaptureRouting_11 ((uint32_t)0x0000000B) /* PD12 PD13 PD14 PD15 */
mbed_official 76:aeb1df146756 241 #define RI_InputCaptureRouting_12 ((uint32_t)0x0000000C) /* PE0 PE1 PE2 PE3 */
mbed_official 76:aeb1df146756 242 #define RI_InputCaptureRouting_13 ((uint32_t)0x0000000D) /* PE4 PE5 PE6 PE7 */
mbed_official 76:aeb1df146756 243 #define RI_InputCaptureRouting_14 ((uint32_t)0x0000000E) /* PE8 PE9 PE10 PE11 */
mbed_official 76:aeb1df146756 244 #define RI_InputCaptureRouting_15 ((uint32_t)0x0000000F) /* PE12 PE13 PE14 PE15 */
mbed_official 76:aeb1df146756 245
mbed_official 76:aeb1df146756 246 #define IS_RI_INPUTCAPTURE_ROUTING(ROUTING) (((ROUTING) == RI_InputCaptureRouting_0) || \
mbed_official 76:aeb1df146756 247 ((ROUTING) == RI_InputCaptureRouting_1) || \
mbed_official 76:aeb1df146756 248 ((ROUTING) == RI_InputCaptureRouting_2) || \
mbed_official 76:aeb1df146756 249 ((ROUTING) == RI_InputCaptureRouting_3) || \
mbed_official 76:aeb1df146756 250 ((ROUTING) == RI_InputCaptureRouting_4) || \
mbed_official 76:aeb1df146756 251 ((ROUTING) == RI_InputCaptureRouting_5) || \
mbed_official 76:aeb1df146756 252 ((ROUTING) == RI_InputCaptureRouting_6) || \
mbed_official 76:aeb1df146756 253 ((ROUTING) == RI_InputCaptureRouting_7) || \
mbed_official 76:aeb1df146756 254 ((ROUTING) == RI_InputCaptureRouting_8) || \
mbed_official 76:aeb1df146756 255 ((ROUTING) == RI_InputCaptureRouting_9) || \
mbed_official 76:aeb1df146756 256 ((ROUTING) == RI_InputCaptureRouting_10) || \
mbed_official 76:aeb1df146756 257 ((ROUTING) == RI_InputCaptureRouting_11) || \
mbed_official 76:aeb1df146756 258 ((ROUTING) == RI_InputCaptureRouting_12) || \
mbed_official 76:aeb1df146756 259 ((ROUTING) == RI_InputCaptureRouting_13) || \
mbed_official 76:aeb1df146756 260 ((ROUTING) == RI_InputCaptureRouting_14) || \
mbed_official 76:aeb1df146756 261 ((ROUTING) == RI_InputCaptureRouting_15))
mbed_official 76:aeb1df146756 262
mbed_official 76:aeb1df146756 263 /**
mbed_official 76:aeb1df146756 264 * @}
mbed_official 76:aeb1df146756 265 */
mbed_official 76:aeb1df146756 266
mbed_official 76:aeb1df146756 267 /** @defgroup RI_IOSwitch
mbed_official 76:aeb1df146756 268 * @{
mbed_official 76:aeb1df146756 269 */
mbed_official 76:aeb1df146756 270
mbed_official 76:aeb1df146756 271 /* ASCR1 I/O switch: bit 31 is set to '1' to indicate that the mask is in ASCR1 register */
mbed_official 76:aeb1df146756 272 #define RI_IOSwitch_CH0 ((uint32_t)0x80000001)
mbed_official 76:aeb1df146756 273 #define RI_IOSwitch_CH1 ((uint32_t)0x80000002)
mbed_official 76:aeb1df146756 274 #define RI_IOSwitch_CH2 ((uint32_t)0x80000004)
mbed_official 76:aeb1df146756 275 #define RI_IOSwitch_CH3 ((uint32_t)0x80000008)
mbed_official 76:aeb1df146756 276 #define RI_IOSwitch_CH4 ((uint32_t)0x80000010)
mbed_official 76:aeb1df146756 277 #define RI_IOSwitch_CH5 ((uint32_t)0x80000020)
mbed_official 76:aeb1df146756 278 #define RI_IOSwitch_CH6 ((uint32_t)0x80000040)
mbed_official 76:aeb1df146756 279 #define RI_IOSwitch_CH7 ((uint32_t)0x80000080)
mbed_official 76:aeb1df146756 280 #define RI_IOSwitch_CH8 ((uint32_t)0x80000100)
mbed_official 76:aeb1df146756 281 #define RI_IOSwitch_CH9 ((uint32_t)0x80000200)
mbed_official 76:aeb1df146756 282 #define RI_IOSwitch_CH10 ((uint32_t)0x80000400)
mbed_official 76:aeb1df146756 283 #define RI_IOSwitch_CH11 ((uint32_t)0x80000800)
mbed_official 76:aeb1df146756 284 #define RI_IOSwitch_CH12 ((uint32_t)0x80001000)
mbed_official 76:aeb1df146756 285 #define RI_IOSwitch_CH13 ((uint32_t)0x80002000)
mbed_official 76:aeb1df146756 286 #define RI_IOSwitch_CH14 ((uint32_t)0x80004000)
mbed_official 76:aeb1df146756 287 #define RI_IOSwitch_CH15 ((uint32_t)0x80008000)
mbed_official 76:aeb1df146756 288 #define RI_IOSwitch_CH31 ((uint32_t)0x80010000)
mbed_official 76:aeb1df146756 289 #define RI_IOSwitch_CH18 ((uint32_t)0x80040000)
mbed_official 76:aeb1df146756 290 #define RI_IOSwitch_CH19 ((uint32_t)0x80080000)
mbed_official 76:aeb1df146756 291 #define RI_IOSwitch_CH20 ((uint32_t)0x80100000)
mbed_official 76:aeb1df146756 292 #define RI_IOSwitch_CH21 ((uint32_t)0x80200000)
mbed_official 76:aeb1df146756 293 #define RI_IOSwitch_CH22 ((uint32_t)0x80400000)
mbed_official 76:aeb1df146756 294 #define RI_IOSwitch_CH23 ((uint32_t)0x80800000)
mbed_official 76:aeb1df146756 295 #define RI_IOSwitch_CH24 ((uint32_t)0x81000000)
mbed_official 76:aeb1df146756 296 #define RI_IOSwitch_CH25 ((uint32_t)0x82000000)
mbed_official 76:aeb1df146756 297 #define RI_IOSwitch_VCOMP ((uint32_t)0x84000000) /* VCOMP is an internal switch used to connect
mbed_official 76:aeb1df146756 298 selected channel to COMP1 non inverting input */
mbed_official 76:aeb1df146756 299 #define RI_IOSwitch_CH27 ((uint32_t)0x88000000)
mbed_official 76:aeb1df146756 300 #define RI_IOSwitch_CH28 ((uint32_t)0x90000000)
mbed_official 76:aeb1df146756 301 #define RI_IOSwitch_CH29 ((uint32_t)0xA0000000)
mbed_official 76:aeb1df146756 302 #define RI_IOSwitch_CH30 ((uint32_t)0xC0000000)
mbed_official 76:aeb1df146756 303
mbed_official 76:aeb1df146756 304 /* ASCR2 IO switch: bit 31 is set to '0' to indicate that the mask is in ASCR2 register */
mbed_official 76:aeb1df146756 305 #define RI_IOSwitch_GR10_1 ((uint32_t)0x00000001)
mbed_official 76:aeb1df146756 306 #define RI_IOSwitch_GR10_2 ((uint32_t)0x00000002)
mbed_official 76:aeb1df146756 307 #define RI_IOSwitch_GR10_3 ((uint32_t)0x00000004)
mbed_official 76:aeb1df146756 308 #define RI_IOSwitch_GR10_4 ((uint32_t)0x00000008)
mbed_official 76:aeb1df146756 309 #define RI_IOSwitch_GR6_1 ((uint32_t)0x00000010)
mbed_official 76:aeb1df146756 310 #define RI_IOSwitch_GR6_2 ((uint32_t)0x00000020)
mbed_official 76:aeb1df146756 311 #define RI_IOSwitch_GR5_1 ((uint32_t)0x00000040)
mbed_official 76:aeb1df146756 312 #define RI_IOSwitch_GR5_2 ((uint32_t)0x00000080)
mbed_official 76:aeb1df146756 313 #define RI_IOSwitch_GR5_3 ((uint32_t)0x00000100)
mbed_official 76:aeb1df146756 314 #define RI_IOSwitch_GR4_1 ((uint32_t)0x00000200)
mbed_official 76:aeb1df146756 315 #define RI_IOSwitch_GR4_2 ((uint32_t)0x00000400)
mbed_official 76:aeb1df146756 316 #define RI_IOSwitch_GR4_3 ((uint32_t)0x00000800)
mbed_official 76:aeb1df146756 317 #define RI_IOSwitch_GR4_4 ((uint32_t)0x00008000)
mbed_official 76:aeb1df146756 318 #define RI_IOSwitch_CH0b ((uint32_t)0x00010000)
mbed_official 76:aeb1df146756 319 #define RI_IOSwitch_CH1b ((uint32_t)0x00020000)
mbed_official 76:aeb1df146756 320 #define RI_IOSwitch_CH2b ((uint32_t)0x00040000)
mbed_official 76:aeb1df146756 321 #define RI_IOSwitch_CH3b ((uint32_t)0x00080000)
mbed_official 76:aeb1df146756 322 #define RI_IOSwitch_CH6b ((uint32_t)0x00100000)
mbed_official 76:aeb1df146756 323 #define RI_IOSwitch_CH7b ((uint32_t)0x00200000)
mbed_official 76:aeb1df146756 324 #define RI_IOSwitch_CH8b ((uint32_t)0x00400000)
mbed_official 76:aeb1df146756 325 #define RI_IOSwitch_CH9b ((uint32_t)0x00800000)
mbed_official 76:aeb1df146756 326 #define RI_IOSwitch_CH10b ((uint32_t)0x01000000)
mbed_official 76:aeb1df146756 327 #define RI_IOSwitch_CH11b ((uint32_t)0x02000000)
mbed_official 76:aeb1df146756 328 #define RI_IOSwitch_CH12b ((uint32_t)0x04000000)
mbed_official 76:aeb1df146756 329 #define RI_IOSwitch_GR6_3 ((uint32_t)0x08000000)
mbed_official 76:aeb1df146756 330 #define RI_IOSwitch_GR6_4 ((uint32_t)0x10000000)
mbed_official 76:aeb1df146756 331 #define RI_IOSwitch_GR5_4 ((uint32_t)0x20000000)
mbed_official 76:aeb1df146756 332
mbed_official 76:aeb1df146756 333
mbed_official 76:aeb1df146756 334 #define IS_RI_IOSWITCH(IOSWITCH) (((IOSWITCH) == RI_IOSwitch_CH0) || \
mbed_official 76:aeb1df146756 335 ((IOSWITCH) == RI_IOSwitch_CH1) || \
mbed_official 76:aeb1df146756 336 ((IOSWITCH) == RI_IOSwitch_CH2) || \
mbed_official 76:aeb1df146756 337 ((IOSWITCH) == RI_IOSwitch_CH3) || \
mbed_official 76:aeb1df146756 338 ((IOSWITCH) == RI_IOSwitch_CH4) || \
mbed_official 76:aeb1df146756 339 ((IOSWITCH) == RI_IOSwitch_CH5) || \
mbed_official 76:aeb1df146756 340 ((IOSWITCH) == RI_IOSwitch_CH6) || \
mbed_official 76:aeb1df146756 341 ((IOSWITCH) == RI_IOSwitch_CH7) || \
mbed_official 76:aeb1df146756 342 ((IOSWITCH) == RI_IOSwitch_CH8) || \
mbed_official 76:aeb1df146756 343 ((IOSWITCH) == RI_IOSwitch_CH9) || \
mbed_official 76:aeb1df146756 344 ((IOSWITCH) == RI_IOSwitch_CH10) || \
mbed_official 76:aeb1df146756 345 ((IOSWITCH) == RI_IOSwitch_CH11) || \
mbed_official 76:aeb1df146756 346 ((IOSWITCH) == RI_IOSwitch_CH12) || \
mbed_official 76:aeb1df146756 347 ((IOSWITCH) == RI_IOSwitch_CH13) || \
mbed_official 76:aeb1df146756 348 ((IOSWITCH) == RI_IOSwitch_CH14) || \
mbed_official 76:aeb1df146756 349 ((IOSWITCH) == RI_IOSwitch_CH15) || \
mbed_official 76:aeb1df146756 350 ((IOSWITCH) == RI_IOSwitch_CH18) || \
mbed_official 76:aeb1df146756 351 ((IOSWITCH) == RI_IOSwitch_CH19) || \
mbed_official 76:aeb1df146756 352 ((IOSWITCH) == RI_IOSwitch_CH20) || \
mbed_official 76:aeb1df146756 353 ((IOSWITCH) == RI_IOSwitch_CH21) || \
mbed_official 76:aeb1df146756 354 ((IOSWITCH) == RI_IOSwitch_CH22) || \
mbed_official 76:aeb1df146756 355 ((IOSWITCH) == RI_IOSwitch_CH23) || \
mbed_official 76:aeb1df146756 356 ((IOSWITCH) == RI_IOSwitch_CH24) || \
mbed_official 76:aeb1df146756 357 ((IOSWITCH) == RI_IOSwitch_CH25) || \
mbed_official 76:aeb1df146756 358 ((IOSWITCH) == RI_IOSwitch_VCOMP) || \
mbed_official 76:aeb1df146756 359 ((IOSWITCH) == RI_IOSwitch_CH27) || \
mbed_official 76:aeb1df146756 360 ((IOSWITCH) == RI_IOSwitch_CH28) || \
mbed_official 76:aeb1df146756 361 ((IOSWITCH) == RI_IOSwitch_CH29) || \
mbed_official 76:aeb1df146756 362 ((IOSWITCH) == RI_IOSwitch_CH30) || \
mbed_official 76:aeb1df146756 363 ((IOSWITCH) == RI_IOSwitch_CH31) || \
mbed_official 76:aeb1df146756 364 ((IOSWITCH) == RI_IOSwitch_GR10_1) || \
mbed_official 76:aeb1df146756 365 ((IOSWITCH) == RI_IOSwitch_GR10_2) || \
mbed_official 76:aeb1df146756 366 ((IOSWITCH) == RI_IOSwitch_GR10_3) || \
mbed_official 76:aeb1df146756 367 ((IOSWITCH) == RI_IOSwitch_GR10_4) || \
mbed_official 76:aeb1df146756 368 ((IOSWITCH) == RI_IOSwitch_GR6_1) || \
mbed_official 76:aeb1df146756 369 ((IOSWITCH) == RI_IOSwitch_GR6_2) || \
mbed_official 76:aeb1df146756 370 ((IOSWITCH) == RI_IOSwitch_GR6_3) || \
mbed_official 76:aeb1df146756 371 ((IOSWITCH) == RI_IOSwitch_GR6_4) || \
mbed_official 76:aeb1df146756 372 ((IOSWITCH) == RI_IOSwitch_GR5_1) || \
mbed_official 76:aeb1df146756 373 ((IOSWITCH) == RI_IOSwitch_GR5_2) || \
mbed_official 76:aeb1df146756 374 ((IOSWITCH) == RI_IOSwitch_GR5_3) || \
mbed_official 76:aeb1df146756 375 ((IOSWITCH) == RI_IOSwitch_GR5_4) || \
mbed_official 76:aeb1df146756 376 ((IOSWITCH) == RI_IOSwitch_GR4_1) || \
mbed_official 76:aeb1df146756 377 ((IOSWITCH) == RI_IOSwitch_GR4_2) || \
mbed_official 76:aeb1df146756 378 ((IOSWITCH) == RI_IOSwitch_GR4_3) || \
mbed_official 76:aeb1df146756 379 ((IOSWITCH) == RI_IOSwitch_GR4_4) || \
mbed_official 76:aeb1df146756 380 ((IOSWITCH) == RI_IOSwitch_CH0b) || \
mbed_official 76:aeb1df146756 381 ((IOSWITCH) == RI_IOSwitch_CH1b) || \
mbed_official 76:aeb1df146756 382 ((IOSWITCH) == RI_IOSwitch_CH2b) || \
mbed_official 76:aeb1df146756 383 ((IOSWITCH) == RI_IOSwitch_CH3b) || \
mbed_official 76:aeb1df146756 384 ((IOSWITCH) == RI_IOSwitch_CH6b) || \
mbed_official 76:aeb1df146756 385 ((IOSWITCH) == RI_IOSwitch_CH7b) || \
mbed_official 76:aeb1df146756 386 ((IOSWITCH) == RI_IOSwitch_CH8b) || \
mbed_official 76:aeb1df146756 387 ((IOSWITCH) == RI_IOSwitch_CH9b) || \
mbed_official 76:aeb1df146756 388 ((IOSWITCH) == RI_IOSwitch_CH10b) || \
mbed_official 76:aeb1df146756 389 ((IOSWITCH) == RI_IOSwitch_CH11b) || \
mbed_official 76:aeb1df146756 390 ((IOSWITCH) == RI_IOSwitch_CH12b))
mbed_official 76:aeb1df146756 391
mbed_official 76:aeb1df146756 392 /**
mbed_official 76:aeb1df146756 393 * @}
mbed_official 76:aeb1df146756 394 */
mbed_official 76:aeb1df146756 395
mbed_official 76:aeb1df146756 396 /** @defgroup RI_Port
mbed_official 76:aeb1df146756 397 * @{
mbed_official 76:aeb1df146756 398 */
mbed_official 76:aeb1df146756 399
mbed_official 76:aeb1df146756 400 #define RI_PortA ((uint8_t)0x01) /*!< GPIOA selected */
mbed_official 76:aeb1df146756 401 #define RI_PortB ((uint8_t)0x02) /*!< GPIOB selected */
mbed_official 76:aeb1df146756 402 #define RI_PortC ((uint8_t)0x03) /*!< GPIOC selected */
mbed_official 76:aeb1df146756 403 #define RI_PortD ((uint8_t)0x04) /*!< GPIOD selected */
mbed_official 76:aeb1df146756 404 #define RI_PortE ((uint8_t)0x05) /*!< GPIOE selected */
mbed_official 76:aeb1df146756 405 #define RI_PortF ((uint8_t)0x06) /*!< GPIOF selected */
mbed_official 76:aeb1df146756 406 #define RI_PortG ((uint8_t)0x07) /*!< GPIOG selected */
mbed_official 76:aeb1df146756 407
mbed_official 76:aeb1df146756 408 #define IS_RI_PORT(PORT) (((PORT) == RI_PortA) || \
mbed_official 76:aeb1df146756 409 ((PORT) == RI_PortB) || \
mbed_official 76:aeb1df146756 410 ((PORT) == RI_PortC) || \
mbed_official 76:aeb1df146756 411 ((PORT) == RI_PortD) || \
mbed_official 76:aeb1df146756 412 ((PORT) == RI_PortE) || \
mbed_official 76:aeb1df146756 413 ((PORT) == RI_PortF) || \
mbed_official 76:aeb1df146756 414 ((PORT) == RI_PortG))
mbed_official 76:aeb1df146756 415 /**
mbed_official 76:aeb1df146756 416 * @}
mbed_official 76:aeb1df146756 417 */
mbed_official 76:aeb1df146756 418
mbed_official 76:aeb1df146756 419 /** @defgroup RI_Pin define
mbed_official 76:aeb1df146756 420 * @{
mbed_official 76:aeb1df146756 421 */
mbed_official 76:aeb1df146756 422 #define RI_Pin_0 ((uint16_t)0x0001) /*!< Pin 0 selected */
mbed_official 76:aeb1df146756 423 #define RI_Pin_1 ((uint16_t)0x0002) /*!< Pin 1 selected */
mbed_official 76:aeb1df146756 424 #define RI_Pin_2 ((uint16_t)0x0004) /*!< Pin 2 selected */
mbed_official 76:aeb1df146756 425 #define RI_Pin_3 ((uint16_t)0x0008) /*!< Pin 3 selected */
mbed_official 76:aeb1df146756 426 #define RI_Pin_4 ((uint16_t)0x0010) /*!< Pin 4 selected */
mbed_official 76:aeb1df146756 427 #define RI_Pin_5 ((uint16_t)0x0020) /*!< Pin 5 selected */
mbed_official 76:aeb1df146756 428 #define RI_Pin_6 ((uint16_t)0x0040) /*!< Pin 6 selected */
mbed_official 76:aeb1df146756 429 #define RI_Pin_7 ((uint16_t)0x0080) /*!< Pin 7 selected */
mbed_official 76:aeb1df146756 430 #define RI_Pin_8 ((uint16_t)0x0100) /*!< Pin 8 selected */
mbed_official 76:aeb1df146756 431 #define RI_Pin_9 ((uint16_t)0x0200) /*!< Pin 9 selected */
mbed_official 76:aeb1df146756 432 #define RI_Pin_10 ((uint16_t)0x0400) /*!< Pin 10 selected */
mbed_official 76:aeb1df146756 433 #define RI_Pin_11 ((uint16_t)0x0800) /*!< Pin 11 selected */
mbed_official 76:aeb1df146756 434 #define RI_Pin_12 ((uint16_t)0x1000) /*!< Pin 12 selected */
mbed_official 76:aeb1df146756 435 #define RI_Pin_13 ((uint16_t)0x2000) /*!< Pin 13 selected */
mbed_official 76:aeb1df146756 436 #define RI_Pin_14 ((uint16_t)0x4000) /*!< Pin 14 selected */
mbed_official 76:aeb1df146756 437 #define RI_Pin_15 ((uint16_t)0x8000) /*!< Pin 15 selected */
mbed_official 76:aeb1df146756 438 #define RI_Pin_All ((uint16_t)0xFFFF) /*!< All pins selected */
mbed_official 76:aeb1df146756 439
mbed_official 76:aeb1df146756 440 #define IS_RI_PIN(PIN) ((PIN) != (uint16_t)0x00)
mbed_official 76:aeb1df146756 441
mbed_official 76:aeb1df146756 442 /**
mbed_official 76:aeb1df146756 443 * @}
mbed_official 76:aeb1df146756 444 */
mbed_official 76:aeb1df146756 445
mbed_official 76:aeb1df146756 446 /**
mbed_official 76:aeb1df146756 447 * @}
mbed_official 76:aeb1df146756 448 */
mbed_official 76:aeb1df146756 449
mbed_official 76:aeb1df146756 450 /* Exported macro ------------------------------------------------------------*/
mbed_official 76:aeb1df146756 451 /* Exported functions ------------------------------------------------------- */
mbed_official 76:aeb1df146756 452
mbed_official 76:aeb1df146756 453 /* Function used to set the SYSCFG and RI configuration to the default reset state **/
mbed_official 76:aeb1df146756 454 void SYSCFG_DeInit(void);
mbed_official 76:aeb1df146756 455 void SYSCFG_RIDeInit(void);
mbed_official 76:aeb1df146756 456
mbed_official 76:aeb1df146756 457 /* SYSCFG Initialization and Configuration functions **************************/
mbed_official 76:aeb1df146756 458 void SYSCFG_MemoryRemapConfig(uint8_t SYSCFG_MemoryRemap);
mbed_official 76:aeb1df146756 459 uint32_t SYSCFG_GetBootMode(void);
mbed_official 76:aeb1df146756 460 void SYSCFG_USBPuCmd(FunctionalState NewState);
mbed_official 76:aeb1df146756 461 void SYSCFG_EXTILineConfig(uint8_t EXTI_PortSourceGPIOx, uint8_t EXTI_PinSourcex);
mbed_official 76:aeb1df146756 462
mbed_official 76:aeb1df146756 463 /* RI Initialization and Configuration functions ******************************/
mbed_official 76:aeb1df146756 464 void SYSCFG_RITIMSelect(uint32_t TIM_Select);
mbed_official 76:aeb1df146756 465 void SYSCFG_RITIMInputCaptureConfig(uint32_t RI_InputCapture, uint32_t RI_InputCaptureRouting);
mbed_official 76:aeb1df146756 466 void SYSCFG_RIResistorConfig(uint32_t RI_Resistor, FunctionalState NewState);
mbed_official 76:aeb1df146756 467 void SYSCFG_RIChannelSpeedConfig(uint32_t RI_Channel, uint32_t RI_ChannelSpeed);
mbed_official 76:aeb1df146756 468 void SYSCFG_RISwitchControlModeCmd(FunctionalState NewState);
mbed_official 76:aeb1df146756 469 void SYSCFG_RIIOSwitchConfig(uint32_t RI_IOSwitch, FunctionalState NewState);
mbed_official 76:aeb1df146756 470 void SYSCFG_RIHysteresisConfig(uint8_t RI_Port, uint16_t RI_Pin, FunctionalState NewState);
mbed_official 76:aeb1df146756 471
mbed_official 76:aeb1df146756 472 #ifdef __cplusplus
mbed_official 76:aeb1df146756 473 }
mbed_official 76:aeb1df146756 474 #endif
mbed_official 76:aeb1df146756 475
mbed_official 76:aeb1df146756 476 #endif /*__STM32L1xx_SYSCFG_H */
mbed_official 76:aeb1df146756 477
mbed_official 76:aeb1df146756 478 /**
mbed_official 76:aeb1df146756 479 * @}
mbed_official 76:aeb1df146756 480 */
mbed_official 76:aeb1df146756 481
mbed_official 76:aeb1df146756 482 /**
mbed_official 76:aeb1df146756 483 * @}
mbed_official 76:aeb1df146756 484 */
mbed_official 76:aeb1df146756 485
mbed_official 76:aeb1df146756 486 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/