mbed library with additional peripherals for ST F401 board

Fork of mbed-src by mbed official

This mbed LIB has additional peripherals for ST F401 board

  • UART2 : PA_3 rx, PA_2 tx
  • UART3 : PC_7 rx, PC_6 tx
  • I2C2 : PB_3 SDA, PB_10 SCL
  • I2C3 : PB_4 SDA, PA_8 SCL
Committer:
mbed_official
Date:
Mon Jan 27 14:30:07 2014 +0000
Revision:
76:aeb1df146756
Child:
80:66393a7b209d
Synchronized with git revision a31ec9c5f7bcb5c8a1b2eced103f6a1dfa921abd

Full URL: https://github.com/mbedmicro/mbed/commit/a31ec9c5f7bcb5c8a1b2eced103f6a1dfa921abd/

Add NUCLEO_L152RE

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