mbed library sources

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Tue Jan 06 16:15:36 2015 +0000
Revision:
441:d2c15dda23c1
Parent:
392:2b59412bb664
Synchronized with git revision 245a60b29caabb42eabdd19658eeac7c3f68313b

Full URL: https://github.com/mbedmicro/mbed/commit/245a60b29caabb42eabdd19658eeac7c3f68313b/

NUCLEO_F072RB/F091RC - adding target to rtos lib and exporter for coide and gcc_arm

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 392:2b59412bb664 1 /**
mbed_official 392:2b59412bb664 2 ******************************************************************************
mbed_official 392:2b59412bb664 3 * @file stm32f030x8.h
mbed_official 392:2b59412bb664 4 * @author MCD Application Team
mbed_official 441:d2c15dda23c1 5 * @version V2.2.0
mbed_official 441:d2c15dda23c1 6 * @date 05-December-2014
mbed_official 392:2b59412bb664 7 * @brief CMSIS STM32F030x8 devices Peripheral Access Layer Header File.
mbed_official 392:2b59412bb664 8 *
mbed_official 392:2b59412bb664 9 * This file contains:
mbed_official 392:2b59412bb664 10 * - Data structures and the address mapping for all peripherals
mbed_official 392:2b59412bb664 11 * - Peripheral's registers declarations and bits definition
mbed_official 392:2b59412bb664 12 * - Macros to access peripheral’s registers hardware
mbed_official 392:2b59412bb664 13 *
mbed_official 392:2b59412bb664 14 ******************************************************************************
mbed_official 392:2b59412bb664 15 * @attention
mbed_official 392:2b59412bb664 16 *
mbed_official 392:2b59412bb664 17 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
mbed_official 392:2b59412bb664 18 *
mbed_official 392:2b59412bb664 19 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 392:2b59412bb664 20 * are permitted provided that the following conditions are met:
mbed_official 392:2b59412bb664 21 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 392:2b59412bb664 22 * this list of conditions and the following disclaimer.
mbed_official 392:2b59412bb664 23 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 392:2b59412bb664 24 * this list of conditions and the following disclaimer in the documentation
mbed_official 392:2b59412bb664 25 * and/or other materials provided with the distribution.
mbed_official 392:2b59412bb664 26 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 392:2b59412bb664 27 * may be used to endorse or promote products derived from this software
mbed_official 392:2b59412bb664 28 * without specific prior written permission.
mbed_official 392:2b59412bb664 29 *
mbed_official 392:2b59412bb664 30 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 392:2b59412bb664 31 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 392:2b59412bb664 32 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 392:2b59412bb664 33 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 392:2b59412bb664 34 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 392:2b59412bb664 35 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 392:2b59412bb664 36 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 392:2b59412bb664 37 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 392:2b59412bb664 38 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 392:2b59412bb664 39 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 392:2b59412bb664 40 *
mbed_official 392:2b59412bb664 41 ******************************************************************************
mbed_official 392:2b59412bb664 42 */
mbed_official 392:2b59412bb664 43
mbed_official 392:2b59412bb664 44 /** @addtogroup CMSIS_Device
mbed_official 392:2b59412bb664 45 * @{
mbed_official 392:2b59412bb664 46 */
mbed_official 392:2b59412bb664 47
mbed_official 392:2b59412bb664 48 /** @addtogroup stm32f030x8
mbed_official 392:2b59412bb664 49 * @{
mbed_official 392:2b59412bb664 50 */
mbed_official 392:2b59412bb664 51
mbed_official 392:2b59412bb664 52 #ifndef __STM32F030x8_H
mbed_official 392:2b59412bb664 53 #define __STM32F030x8_H
mbed_official 392:2b59412bb664 54
mbed_official 392:2b59412bb664 55 #ifdef __cplusplus
mbed_official 392:2b59412bb664 56 extern "C" {
mbed_official 392:2b59412bb664 57 #endif /* __cplusplus */
mbed_official 392:2b59412bb664 58
mbed_official 392:2b59412bb664 59 /** @addtogroup Configuration_section_for_CMSIS
mbed_official 392:2b59412bb664 60 * @{
mbed_official 392:2b59412bb664 61 */
mbed_official 392:2b59412bb664 62
mbed_official 392:2b59412bb664 63 /**
mbed_official 392:2b59412bb664 64 * @brief Configuration of the Cortex-M0 Processor and Core Peripherals
mbed_official 392:2b59412bb664 65 */
mbed_official 392:2b59412bb664 66 #define __CM0_REV 0 /*!< Core Revision r0p0 */
mbed_official 392:2b59412bb664 67 #define __MPU_PRESENT 0 /*!< STM32F0xx do not provide MPU */
mbed_official 392:2b59412bb664 68 #define __NVIC_PRIO_BITS 2 /*!< STM32F0xx uses 2 Bits for the Priority Levels */
mbed_official 392:2b59412bb664 69 #define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
mbed_official 392:2b59412bb664 70
mbed_official 392:2b59412bb664 71 /**
mbed_official 392:2b59412bb664 72 * @}
mbed_official 392:2b59412bb664 73 */
mbed_official 392:2b59412bb664 74
mbed_official 392:2b59412bb664 75 /** @addtogroup Peripheral_interrupt_number_definition
mbed_official 392:2b59412bb664 76 * @{
mbed_official 392:2b59412bb664 77 */
mbed_official 392:2b59412bb664 78
mbed_official 392:2b59412bb664 79 /**
mbed_official 392:2b59412bb664 80 * @brief STM32F030x8 device Interrupt Number Definition
mbed_official 392:2b59412bb664 81 */
mbed_official 392:2b59412bb664 82 typedef enum
mbed_official 392:2b59412bb664 83 {
mbed_official 392:2b59412bb664 84 /****** Cortex-M0 Processor Exceptions Numbers **************************************************************/
mbed_official 392:2b59412bb664 85 NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */
mbed_official 392:2b59412bb664 86 HardFault_IRQn = -13, /*!< 3 Cortex-M0 Hard Fault Interrupt */
mbed_official 392:2b59412bb664 87 SVC_IRQn = -5, /*!< 11 Cortex-M0 SV Call Interrupt */
mbed_official 392:2b59412bb664 88 PendSV_IRQn = -2, /*!< 14 Cortex-M0 Pend SV Interrupt */
mbed_official 392:2b59412bb664 89 SysTick_IRQn = -1, /*!< 15 Cortex-M0 System Tick Interrupt */
mbed_official 392:2b59412bb664 90
mbed_official 392:2b59412bb664 91 /****** STM32F030x8 specific Interrupt Numbers **************************************************************/
mbed_official 392:2b59412bb664 92 WWDG_IRQn = 0, /*!< Window WatchDog Interrupt */
mbed_official 392:2b59412bb664 93 RTC_IRQn = 2, /*!< RTC Interrupt through EXTI Lines 17, 19 and 20 */
mbed_official 392:2b59412bb664 94 FLASH_IRQn = 3, /*!< FLASH global Interrupt */
mbed_official 392:2b59412bb664 95 RCC_IRQn = 4, /*!< RCC global Interrupt */
mbed_official 392:2b59412bb664 96 EXTI0_1_IRQn = 5, /*!< EXTI Line 0 and 1 Interrupts */
mbed_official 392:2b59412bb664 97 EXTI2_3_IRQn = 6, /*!< EXTI Line 2 and 3 Interrupts */
mbed_official 392:2b59412bb664 98 EXTI4_15_IRQn = 7, /*!< EXTI Line 4 to 15 Interrupts */
mbed_official 392:2b59412bb664 99 DMA1_Channel1_IRQn = 9, /*!< DMA1 Channel 1 Interrupt */
mbed_official 392:2b59412bb664 100 DMA1_Channel2_3_IRQn = 10, /*!< DMA1 Channel 2 and Channel 3 Interrupts */
mbed_official 392:2b59412bb664 101 DMA1_Channel4_5_IRQn = 11, /*!< DMA1 Channel 4 and Channel 5 Interrupts */
mbed_official 392:2b59412bb664 102 ADC1_IRQn = 12, /*!< ADC1 global Interrupt */
mbed_official 392:2b59412bb664 103 TIM1_BRK_UP_TRG_COM_IRQn = 13, /*!< TIM1 Break, Update, Trigger and Commutation Interrupts */
mbed_official 392:2b59412bb664 104 TIM1_CC_IRQn = 14, /*!< TIM1 Capture Compare Interrupt */
mbed_official 392:2b59412bb664 105 TIM3_IRQn = 16, /*!< TIM3 global Interrupt */
mbed_official 392:2b59412bb664 106 TIM6_IRQn = 17, /*!< TIM6 global Interrupt */
mbed_official 392:2b59412bb664 107 TIM14_IRQn = 19, /*!< TIM14 global Interrupt */
mbed_official 392:2b59412bb664 108 TIM15_IRQn = 20, /*!< TIM15 global Interrupt */
mbed_official 392:2b59412bb664 109 TIM16_IRQn = 21, /*!< TIM16 global Interrupt */
mbed_official 392:2b59412bb664 110 TIM17_IRQn = 22, /*!< TIM17 global Interrupt */
mbed_official 392:2b59412bb664 111 I2C1_IRQn = 23, /*!< I2C1 Event Interrupt */
mbed_official 392:2b59412bb664 112 I2C2_IRQn = 24, /*!< I2C2 Event Interrupt */
mbed_official 392:2b59412bb664 113 SPI1_IRQn = 25, /*!< SPI1 global Interrupt */
mbed_official 392:2b59412bb664 114 SPI2_IRQn = 26, /*!< SPI2 global Interrupt */
mbed_official 392:2b59412bb664 115 USART1_IRQn = 27, /*!< USART1 global Interrupt */
mbed_official 392:2b59412bb664 116 USART2_IRQn = 28 /*!< USART2 global Interrupt */
mbed_official 392:2b59412bb664 117 } IRQn_Type;
mbed_official 392:2b59412bb664 118
mbed_official 392:2b59412bb664 119 /**
mbed_official 392:2b59412bb664 120 * @}
mbed_official 392:2b59412bb664 121 */
mbed_official 392:2b59412bb664 122
mbed_official 392:2b59412bb664 123 #include "core_cm0.h" /* Cortex-M0 processor and core peripherals */
mbed_official 392:2b59412bb664 124 #include "system_stm32f0xx.h" /* STM32F0xx System Header */
mbed_official 392:2b59412bb664 125 #include <stdint.h>
mbed_official 392:2b59412bb664 126
mbed_official 392:2b59412bb664 127 /** @addtogroup Peripheral_registers_structures
mbed_official 392:2b59412bb664 128 * @{
mbed_official 392:2b59412bb664 129 */
mbed_official 392:2b59412bb664 130
mbed_official 392:2b59412bb664 131 /**
mbed_official 392:2b59412bb664 132 * @brief Analog to Digital Converter
mbed_official 392:2b59412bb664 133 */
mbed_official 392:2b59412bb664 134
mbed_official 392:2b59412bb664 135 typedef struct
mbed_official 392:2b59412bb664 136 {
mbed_official 392:2b59412bb664 137 __IO uint32_t ISR; /*!< ADC Interrupt and Status register, Address offset:0x00 */
mbed_official 392:2b59412bb664 138 __IO uint32_t IER; /*!< ADC Interrupt Enable register, Address offset:0x04 */
mbed_official 392:2b59412bb664 139 __IO uint32_t CR; /*!< ADC Control register, Address offset:0x08 */
mbed_official 392:2b59412bb664 140 __IO uint32_t CFGR1; /*!< ADC Configuration register 1, Address offset:0x0C */
mbed_official 392:2b59412bb664 141 __IO uint32_t CFGR2; /*!< ADC Configuration register 2, Address offset:0x10 */
mbed_official 392:2b59412bb664 142 __IO uint32_t SMPR; /*!< ADC Sampling time register, Address offset:0x14 */
mbed_official 392:2b59412bb664 143 uint32_t RESERVED1; /*!< Reserved, 0x18 */
mbed_official 392:2b59412bb664 144 uint32_t RESERVED2; /*!< Reserved, 0x1C */
mbed_official 392:2b59412bb664 145 __IO uint32_t TR; /*!< ADC watchdog threshold register, Address offset:0x20 */
mbed_official 392:2b59412bb664 146 uint32_t RESERVED3; /*!< Reserved, 0x24 */
mbed_official 392:2b59412bb664 147 __IO uint32_t CHSELR; /*!< ADC channel selection register, Address offset:0x28 */
mbed_official 392:2b59412bb664 148 uint32_t RESERVED4[5]; /*!< Reserved, 0x2C */
mbed_official 392:2b59412bb664 149 __IO uint32_t DR; /*!< ADC data register, Address offset:0x40 */
mbed_official 392:2b59412bb664 150 }ADC_TypeDef;
mbed_official 392:2b59412bb664 151
mbed_official 392:2b59412bb664 152 typedef struct
mbed_official 392:2b59412bb664 153 {
mbed_official 392:2b59412bb664 154 __IO uint32_t CCR;
mbed_official 392:2b59412bb664 155 }ADC_Common_TypeDef;
mbed_official 392:2b59412bb664 156
mbed_official 392:2b59412bb664 157 /**
mbed_official 392:2b59412bb664 158 * @brief CRC calculation unit
mbed_official 392:2b59412bb664 159 */
mbed_official 392:2b59412bb664 160
mbed_official 392:2b59412bb664 161 typedef struct
mbed_official 392:2b59412bb664 162 {
mbed_official 392:2b59412bb664 163 __IO uint32_t DR; /*!< CRC Data register, Address offset: 0x00 */
mbed_official 392:2b59412bb664 164 __IO uint8_t IDR; /*!< CRC Independent data register, Address offset: 0x04 */
mbed_official 392:2b59412bb664 165 uint8_t RESERVED0; /*!< Reserved, 0x05 */
mbed_official 392:2b59412bb664 166 uint16_t RESERVED1; /*!< Reserved, 0x06 */
mbed_official 392:2b59412bb664 167 __IO uint32_t CR; /*!< CRC Control register, Address offset: 0x08 */
mbed_official 392:2b59412bb664 168 uint32_t RESERVED2; /*!< Reserved, 0x0C */
mbed_official 392:2b59412bb664 169 __IO uint32_t INIT; /*!< Initial CRC value register, Address offset: 0x10 */
mbed_official 392:2b59412bb664 170 __IO uint32_t POL; /*!< CRC polynomial register, Address offset: 0x14 */
mbed_official 392:2b59412bb664 171 }CRC_TypeDef;
mbed_official 392:2b59412bb664 172
mbed_official 392:2b59412bb664 173 /**
mbed_official 392:2b59412bb664 174 * @brief Debug MCU
mbed_official 392:2b59412bb664 175 */
mbed_official 392:2b59412bb664 176
mbed_official 392:2b59412bb664 177 typedef struct
mbed_official 392:2b59412bb664 178 {
mbed_official 392:2b59412bb664 179 __IO uint32_t IDCODE; /*!< MCU device ID code, Address offset: 0x00 */
mbed_official 392:2b59412bb664 180 __IO uint32_t CR; /*!< Debug MCU configuration register, Address offset: 0x04 */
mbed_official 392:2b59412bb664 181 __IO uint32_t APB1FZ; /*!< Debug MCU APB1 freeze register, Address offset: 0x08 */
mbed_official 392:2b59412bb664 182 __IO uint32_t APB2FZ; /*!< Debug MCU APB2 freeze register, Address offset: 0x0C */
mbed_official 392:2b59412bb664 183 }DBGMCU_TypeDef;
mbed_official 392:2b59412bb664 184
mbed_official 392:2b59412bb664 185 /**
mbed_official 392:2b59412bb664 186 * @brief DMA Controller
mbed_official 392:2b59412bb664 187 */
mbed_official 392:2b59412bb664 188
mbed_official 392:2b59412bb664 189 typedef struct
mbed_official 392:2b59412bb664 190 {
mbed_official 392:2b59412bb664 191 __IO uint32_t CCR; /*!< DMA channel x configuration register */
mbed_official 392:2b59412bb664 192 __IO uint32_t CNDTR; /*!< DMA channel x number of data register */
mbed_official 392:2b59412bb664 193 __IO uint32_t CPAR; /*!< DMA channel x peripheral address register */
mbed_official 392:2b59412bb664 194 __IO uint32_t CMAR; /*!< DMA channel x memory address register */
mbed_official 392:2b59412bb664 195 }DMA_Channel_TypeDef;
mbed_official 392:2b59412bb664 196
mbed_official 392:2b59412bb664 197 typedef struct
mbed_official 392:2b59412bb664 198 {
mbed_official 392:2b59412bb664 199 __IO uint32_t ISR; /*!< DMA interrupt status register, Address offset: 0x00 */
mbed_official 392:2b59412bb664 200 __IO uint32_t IFCR; /*!< DMA interrupt flag clear register, Address offset: 0x04 */
mbed_official 392:2b59412bb664 201 }DMA_TypeDef;
mbed_official 392:2b59412bb664 202
mbed_official 392:2b59412bb664 203 /**
mbed_official 392:2b59412bb664 204 * @brief External Interrupt/Event Controller
mbed_official 392:2b59412bb664 205 */
mbed_official 392:2b59412bb664 206
mbed_official 392:2b59412bb664 207 typedef struct
mbed_official 392:2b59412bb664 208 {
mbed_official 392:2b59412bb664 209 __IO uint32_t IMR; /*!<EXTI Interrupt mask register, Address offset: 0x00 */
mbed_official 392:2b59412bb664 210 __IO uint32_t EMR; /*!<EXTI Event mask register, Address offset: 0x04 */
mbed_official 392:2b59412bb664 211 __IO uint32_t RTSR; /*!<EXTI Rising trigger selection register , Address offset: 0x08 */
mbed_official 392:2b59412bb664 212 __IO uint32_t FTSR; /*!<EXTI Falling trigger selection register, Address offset: 0x0C */
mbed_official 392:2b59412bb664 213 __IO uint32_t SWIER; /*!<EXTI Software interrupt event register, Address offset: 0x10 */
mbed_official 392:2b59412bb664 214 __IO uint32_t PR; /*!<EXTI Pending register, Address offset: 0x14 */
mbed_official 392:2b59412bb664 215 }EXTI_TypeDef;
mbed_official 392:2b59412bb664 216
mbed_official 392:2b59412bb664 217 /**
mbed_official 392:2b59412bb664 218 * @brief FLASH Registers
mbed_official 392:2b59412bb664 219 */
mbed_official 392:2b59412bb664 220 typedef struct
mbed_official 392:2b59412bb664 221 {
mbed_official 392:2b59412bb664 222 __IO uint32_t ACR; /*!<FLASH access control register, Address offset: 0x00 */
mbed_official 392:2b59412bb664 223 __IO uint32_t KEYR; /*!<FLASH key register, Address offset: 0x04 */
mbed_official 392:2b59412bb664 224 __IO uint32_t OPTKEYR; /*!<FLASH OPT key register, Address offset: 0x08 */
mbed_official 392:2b59412bb664 225 __IO uint32_t SR; /*!<FLASH status register, Address offset: 0x0C */
mbed_official 392:2b59412bb664 226 __IO uint32_t CR; /*!<FLASH control register, Address offset: 0x10 */
mbed_official 392:2b59412bb664 227 __IO uint32_t AR; /*!<FLASH address register, Address offset: 0x14 */
mbed_official 392:2b59412bb664 228 __IO uint32_t RESERVED; /*!< Reserved, 0x18 */
mbed_official 392:2b59412bb664 229 __IO uint32_t OBR; /*!<FLASH option bytes register, Address offset: 0x1C */
mbed_official 392:2b59412bb664 230 __IO uint32_t WRPR; /*!<FLASH option bytes register, Address offset: 0x20 */
mbed_official 392:2b59412bb664 231 }FLASH_TypeDef;
mbed_official 392:2b59412bb664 232
mbed_official 392:2b59412bb664 233
mbed_official 392:2b59412bb664 234 /**
mbed_official 392:2b59412bb664 235 * @brief Option Bytes Registers
mbed_official 392:2b59412bb664 236 */
mbed_official 392:2b59412bb664 237 typedef struct
mbed_official 392:2b59412bb664 238 {
mbed_official 392:2b59412bb664 239 __IO uint16_t RDP; /*!< FLASH option byte Read protection, Address offset: 0x00 */
mbed_official 392:2b59412bb664 240 __IO uint16_t USER; /*!< FLASH option byte user options, Address offset: 0x02 */
mbed_official 392:2b59412bb664 241 __IO uint16_t DATA0; /*!< User data byte 0 (stored in FLASH_OBR[23:16]), Address offset: 0x04 */
mbed_official 392:2b59412bb664 242 __IO uint16_t DATA1; /*!< User data byte 1 (stored in FLASH_OBR[31:24]), Address offset: 0x06 */
mbed_official 392:2b59412bb664 243 __IO uint16_t WRP0; /*!< FLASH option byte write protection 0, Address offset: 0x08 */
mbed_official 392:2b59412bb664 244 __IO uint16_t WRP1; /*!< FLASH option byte write protection 1, Address offset: 0x0A */
mbed_official 392:2b59412bb664 245 __IO uint16_t WRP2; /*!< FLASH option byte write protection 2, Address offset: 0x0C */
mbed_official 392:2b59412bb664 246 __IO uint16_t WRP3; /*!< FLASH option byte write protection 3, Address offset: 0x0E */
mbed_official 392:2b59412bb664 247 }OB_TypeDef;
mbed_official 392:2b59412bb664 248
mbed_official 392:2b59412bb664 249 /**
mbed_official 392:2b59412bb664 250 * @brief General Purpose I/O
mbed_official 392:2b59412bb664 251 */
mbed_official 392:2b59412bb664 252
mbed_official 392:2b59412bb664 253 typedef struct
mbed_official 392:2b59412bb664 254 {
mbed_official 392:2b59412bb664 255 __IO uint32_t MODER; /*!< GPIO port mode register, Address offset: 0x00 */
mbed_official 392:2b59412bb664 256 __IO uint32_t OTYPER; /*!< GPIO port output type register, Address offset: 0x04 */
mbed_official 392:2b59412bb664 257 __IO uint32_t OSPEEDR; /*!< GPIO port output speed register, Address offset: 0x08 */
mbed_official 392:2b59412bb664 258 __IO uint32_t PUPDR; /*!< GPIO port pull-up/pull-down register, Address offset: 0x0C */
mbed_official 392:2b59412bb664 259 __IO uint32_t IDR; /*!< GPIO port input data register, Address offset: 0x10 */
mbed_official 392:2b59412bb664 260 __IO uint32_t ODR; /*!< GPIO port output data register, Address offset: 0x14 */
mbed_official 392:2b59412bb664 261 __IO uint32_t BSRR; /*!< GPIO port bit set/reset register, Address offset: 0x1A */
mbed_official 392:2b59412bb664 262 __IO uint32_t LCKR; /*!< GPIO port configuration lock register, Address offset: 0x1C */
mbed_official 392:2b59412bb664 263 __IO uint32_t AFR[2]; /*!< GPIO alternate function low register, Address offset: 0x20-0x24 */
mbed_official 392:2b59412bb664 264 __IO uint32_t BRR; /*!< GPIO bit reset register, Address offset: 0x28 */
mbed_official 392:2b59412bb664 265 }GPIO_TypeDef;
mbed_official 392:2b59412bb664 266
mbed_official 392:2b59412bb664 267 /**
mbed_official 392:2b59412bb664 268 * @brief SysTem Configuration
mbed_official 392:2b59412bb664 269 */
mbed_official 392:2b59412bb664 270
mbed_official 392:2b59412bb664 271 typedef struct
mbed_official 392:2b59412bb664 272 {
mbed_official 392:2b59412bb664 273 __IO uint32_t CFGR1; /*!< SYSCFG configuration register 1, Address offset: 0x00 */
mbed_official 392:2b59412bb664 274 uint32_t RESERVED; /*!< Reserved, 0x04 */
mbed_official 392:2b59412bb664 275 __IO uint32_t EXTICR[4]; /*!< SYSCFG external interrupt configuration register, Address offset: 0x14-0x08 */
mbed_official 392:2b59412bb664 276 __IO uint32_t CFGR2; /*!< SYSCFG configuration register 2, Address offset: 0x18 */
mbed_official 392:2b59412bb664 277 }SYSCFG_TypeDef;
mbed_official 392:2b59412bb664 278
mbed_official 392:2b59412bb664 279 /**
mbed_official 392:2b59412bb664 280 * @brief Inter-integrated Circuit Interface
mbed_official 392:2b59412bb664 281 */
mbed_official 392:2b59412bb664 282
mbed_official 392:2b59412bb664 283 typedef struct
mbed_official 392:2b59412bb664 284 {
mbed_official 392:2b59412bb664 285 __IO uint32_t CR1; /*!< I2C Control register 1, Address offset: 0x00 */
mbed_official 392:2b59412bb664 286 __IO uint32_t CR2; /*!< I2C Control register 2, Address offset: 0x04 */
mbed_official 392:2b59412bb664 287 __IO uint32_t OAR1; /*!< I2C Own address 1 register, Address offset: 0x08 */
mbed_official 392:2b59412bb664 288 __IO uint32_t OAR2; /*!< I2C Own address 2 register, Address offset: 0x0C */
mbed_official 392:2b59412bb664 289 __IO uint32_t TIMINGR; /*!< I2C Timing register, Address offset: 0x10 */
mbed_official 392:2b59412bb664 290 __IO uint32_t TIMEOUTR; /*!< I2C Timeout register, Address offset: 0x14 */
mbed_official 392:2b59412bb664 291 __IO uint32_t ISR; /*!< I2C Interrupt and status register, Address offset: 0x18 */
mbed_official 392:2b59412bb664 292 __IO uint32_t ICR; /*!< I2C Interrupt clear register, Address offset: 0x1C */
mbed_official 392:2b59412bb664 293 __IO uint32_t PECR; /*!< I2C PEC register, Address offset: 0x20 */
mbed_official 392:2b59412bb664 294 __IO uint32_t RXDR; /*!< I2C Receive data register, Address offset: 0x24 */
mbed_official 392:2b59412bb664 295 __IO uint32_t TXDR; /*!< I2C Transmit data register, Address offset: 0x28 */
mbed_official 392:2b59412bb664 296 }I2C_TypeDef;
mbed_official 392:2b59412bb664 297
mbed_official 392:2b59412bb664 298 /**
mbed_official 392:2b59412bb664 299 * @brief Independent WATCHDOG
mbed_official 392:2b59412bb664 300 */
mbed_official 392:2b59412bb664 301
mbed_official 392:2b59412bb664 302 typedef struct
mbed_official 392:2b59412bb664 303 {
mbed_official 392:2b59412bb664 304 __IO uint32_t KR; /*!< IWDG Key register, Address offset: 0x00 */
mbed_official 392:2b59412bb664 305 __IO uint32_t PR; /*!< IWDG Prescaler register, Address offset: 0x04 */
mbed_official 392:2b59412bb664 306 __IO uint32_t RLR; /*!< IWDG Reload register, Address offset: 0x08 */
mbed_official 392:2b59412bb664 307 __IO uint32_t SR; /*!< IWDG Status register, Address offset: 0x0C */
mbed_official 392:2b59412bb664 308 __IO uint32_t WINR; /*!< IWDG Window register, Address offset: 0x10 */
mbed_official 392:2b59412bb664 309 }IWDG_TypeDef;
mbed_official 392:2b59412bb664 310
mbed_official 392:2b59412bb664 311 /**
mbed_official 392:2b59412bb664 312 * @brief Power Control
mbed_official 392:2b59412bb664 313 */
mbed_official 392:2b59412bb664 314
mbed_official 392:2b59412bb664 315 typedef struct
mbed_official 392:2b59412bb664 316 {
mbed_official 392:2b59412bb664 317 __IO uint32_t CR; /*!< PWR power control register, Address offset: 0x00 */
mbed_official 392:2b59412bb664 318 __IO uint32_t CSR; /*!< PWR power control/status register, Address offset: 0x04 */
mbed_official 392:2b59412bb664 319 }PWR_TypeDef;
mbed_official 392:2b59412bb664 320
mbed_official 392:2b59412bb664 321 /**
mbed_official 392:2b59412bb664 322 * @brief Reset and Clock Control
mbed_official 392:2b59412bb664 323 */
mbed_official 392:2b59412bb664 324 typedef struct
mbed_official 392:2b59412bb664 325 {
mbed_official 392:2b59412bb664 326 __IO uint32_t CR; /*!< RCC clock control register, Address offset: 0x00 */
mbed_official 392:2b59412bb664 327 __IO uint32_t CFGR; /*!< RCC clock configuration register, Address offset: 0x04 */
mbed_official 392:2b59412bb664 328 __IO uint32_t CIR; /*!< RCC clock interrupt register, Address offset: 0x08 */
mbed_official 392:2b59412bb664 329 __IO uint32_t APB2RSTR; /*!< RCC APB2 peripheral reset register, Address offset: 0x0C */
mbed_official 392:2b59412bb664 330 __IO uint32_t APB1RSTR; /*!< RCC APB1 peripheral reset register, Address offset: 0x10 */
mbed_official 392:2b59412bb664 331 __IO uint32_t AHBENR; /*!< RCC AHB peripheral clock register, Address offset: 0x14 */
mbed_official 392:2b59412bb664 332 __IO uint32_t APB2ENR; /*!< RCC APB2 peripheral clock enable register, Address offset: 0x18 */
mbed_official 392:2b59412bb664 333 __IO uint32_t APB1ENR; /*!< RCC APB1 peripheral clock enable register, Address offset: 0x1C */
mbed_official 392:2b59412bb664 334 __IO uint32_t BDCR; /*!< RCC Backup domain control register, Address offset: 0x20 */
mbed_official 392:2b59412bb664 335 __IO uint32_t CSR; /*!< RCC clock control & status register, Address offset: 0x24 */
mbed_official 392:2b59412bb664 336 __IO uint32_t AHBRSTR; /*!< RCC AHB peripheral reset register, Address offset: 0x28 */
mbed_official 392:2b59412bb664 337 __IO uint32_t CFGR2; /*!< RCC clock configuration register 2, Address offset: 0x2C */
mbed_official 392:2b59412bb664 338 __IO uint32_t CFGR3; /*!< RCC clock configuration register 3, Address offset: 0x30 */
mbed_official 392:2b59412bb664 339 __IO uint32_t CR2; /*!< RCC clock control register 2, Address offset: 0x34 */
mbed_official 392:2b59412bb664 340 }RCC_TypeDef;
mbed_official 392:2b59412bb664 341
mbed_official 392:2b59412bb664 342 /**
mbed_official 392:2b59412bb664 343 * @brief Real-Time Clock
mbed_official 392:2b59412bb664 344 */
mbed_official 392:2b59412bb664 345
mbed_official 392:2b59412bb664 346 typedef struct
mbed_official 392:2b59412bb664 347 {
mbed_official 392:2b59412bb664 348 __IO uint32_t TR; /*!< RTC time register, Address offset: 0x00 */
mbed_official 392:2b59412bb664 349 __IO uint32_t DR; /*!< RTC date register, Address offset: 0x04 */
mbed_official 392:2b59412bb664 350 __IO uint32_t CR; /*!< RTC control register, Address offset: 0x08 */
mbed_official 392:2b59412bb664 351 __IO uint32_t ISR; /*!< RTC initialization and status register, Address offset: 0x0C */
mbed_official 392:2b59412bb664 352 __IO uint32_t PRER; /*!< RTC prescaler register, Address offset: 0x10 */
mbed_official 392:2b59412bb664 353 uint32_t RESERVED1; /*!< Reserved, Address offset: 0x14 */
mbed_official 392:2b59412bb664 354 uint32_t RESERVED2; /*!< Reserved, Address offset: 0x18 */
mbed_official 392:2b59412bb664 355 __IO uint32_t ALRMAR; /*!< RTC alarm A register, Address offset: 0x1C */
mbed_official 392:2b59412bb664 356 uint32_t RESERVED3; /*!< Reserved, Address offset: 0x20 */
mbed_official 392:2b59412bb664 357 __IO uint32_t WPR; /*!< RTC write protection register, Address offset: 0x24 */
mbed_official 392:2b59412bb664 358 __IO uint32_t SSR; /*!< RTC sub second register, Address offset: 0x28 */
mbed_official 392:2b59412bb664 359 __IO uint32_t SHIFTR; /*!< RTC shift control register, Address offset: 0x2C */
mbed_official 392:2b59412bb664 360 __IO uint32_t TSTR; /*!< RTC time stamp time register, Address offset: 0x30 */
mbed_official 392:2b59412bb664 361 __IO uint32_t TSDR; /*!< RTC time stamp date register, Address offset: 0x34 */
mbed_official 392:2b59412bb664 362 __IO uint32_t TSSSR; /*!< RTC time-stamp sub second register, Address offset: 0x38 */
mbed_official 392:2b59412bb664 363 __IO uint32_t CALR; /*!< RTC calibration register, Address offset: 0x3C */
mbed_official 392:2b59412bb664 364 __IO uint32_t TAFCR; /*!< RTC tamper and alternate function configuration register, Address offset: 0x40 */
mbed_official 392:2b59412bb664 365 __IO uint32_t ALRMASSR; /*!< RTC alarm A sub second register, Address offset: 0x44 */
mbed_official 392:2b59412bb664 366 }RTC_TypeDef;
mbed_official 392:2b59412bb664 367
mbed_official 392:2b59412bb664 368 /**
mbed_official 392:2b59412bb664 369 * @brief Serial Peripheral Interface
mbed_official 392:2b59412bb664 370 */
mbed_official 392:2b59412bb664 371
mbed_official 392:2b59412bb664 372 typedef struct
mbed_official 392:2b59412bb664 373 {
mbed_official 441:d2c15dda23c1 374 __IO uint32_t CR1; /*!< SPI Control register 1 (not used in I2S mode), Address offset: 0x00 */
mbed_official 441:d2c15dda23c1 375 __IO uint32_t CR2; /*!< SPI Control register 2, Address offset: 0x04 */
mbed_official 441:d2c15dda23c1 376 __IO uint32_t SR; /*!< SPI Status register, Address offset: 0x08 */
mbed_official 441:d2c15dda23c1 377 __IO uint32_t DR; /*!< SPI data register, Address offset: 0x0C */
mbed_official 441:d2c15dda23c1 378 __IO uint32_t CRCPR; /*!< SPI CRC polynomial register (not used in I2S mode), Address offset: 0x10 */
mbed_official 441:d2c15dda23c1 379 __IO uint32_t RXCRCR; /*!< SPI Rx CRC register (not used in I2S mode), Address offset: 0x14 */
mbed_official 441:d2c15dda23c1 380 __IO uint32_t TXCRCR; /*!< SPI Tx CRC register (not used in I2S mode), Address offset: 0x18 */
mbed_official 441:d2c15dda23c1 381 __IO uint32_t I2SCFGR; /*!< SPI_I2S configuration register, Address offset: 0x1C */
mbed_official 441:d2c15dda23c1 382 __IO uint32_t I2SPR; /*!< SPI_I2S prescaler register, Address offset: 0x20 */
mbed_official 392:2b59412bb664 383 }SPI_TypeDef;
mbed_official 392:2b59412bb664 384
mbed_official 392:2b59412bb664 385 /**
mbed_official 392:2b59412bb664 386 * @brief TIM
mbed_official 392:2b59412bb664 387 */
mbed_official 392:2b59412bb664 388 typedef struct
mbed_official 392:2b59412bb664 389 {
mbed_official 392:2b59412bb664 390 __IO uint32_t CR1; /*!< TIM control register 1, Address offset: 0x00 */
mbed_official 392:2b59412bb664 391 __IO uint32_t CR2; /*!< TIM control register 2, Address offset: 0x04 */
mbed_official 392:2b59412bb664 392 __IO uint32_t SMCR; /*!< TIM slave Mode Control register, Address offset: 0x08 */
mbed_official 392:2b59412bb664 393 __IO uint32_t DIER; /*!< TIM DMA/interrupt enable register, Address offset: 0x0C */
mbed_official 392:2b59412bb664 394 __IO uint32_t SR; /*!< TIM status register, Address offset: 0x10 */
mbed_official 392:2b59412bb664 395 __IO uint32_t EGR; /*!< TIM event generation register, Address offset: 0x14 */
mbed_official 392:2b59412bb664 396 __IO uint32_t CCMR1; /*!< TIM capture/compare mode register 1, Address offset: 0x18 */
mbed_official 392:2b59412bb664 397 __IO uint32_t CCMR2; /*!< TIM capture/compare mode register 2, Address offset: 0x1C */
mbed_official 392:2b59412bb664 398 __IO uint32_t CCER; /*!< TIM capture/compare enable register, Address offset: 0x20 */
mbed_official 392:2b59412bb664 399 __IO uint32_t CNT; /*!< TIM counter register, Address offset: 0x24 */
mbed_official 392:2b59412bb664 400 __IO uint32_t PSC; /*!< TIM prescaler register, Address offset: 0x28 */
mbed_official 392:2b59412bb664 401 __IO uint32_t ARR; /*!< TIM auto-reload register, Address offset: 0x2C */
mbed_official 392:2b59412bb664 402 __IO uint32_t RCR; /*!< TIM repetition counter register, Address offset: 0x30 */
mbed_official 392:2b59412bb664 403 __IO uint32_t CCR1; /*!< TIM capture/compare register 1, Address offset: 0x34 */
mbed_official 392:2b59412bb664 404 __IO uint32_t CCR2; /*!< TIM capture/compare register 2, Address offset: 0x38 */
mbed_official 392:2b59412bb664 405 __IO uint32_t CCR3; /*!< TIM capture/compare register 3, Address offset: 0x3C */
mbed_official 392:2b59412bb664 406 __IO uint32_t CCR4; /*!< TIM capture/compare register 4, Address offset: 0x40 */
mbed_official 392:2b59412bb664 407 __IO uint32_t BDTR; /*!< TIM break and dead-time register, Address offset: 0x44 */
mbed_official 392:2b59412bb664 408 __IO uint32_t DCR; /*!< TIM DMA control register, Address offset: 0x48 */
mbed_official 392:2b59412bb664 409 __IO uint32_t DMAR; /*!< TIM DMA address for full transfer register, Address offset: 0x4C */
mbed_official 392:2b59412bb664 410 __IO uint32_t OR; /*!< TIM option register, Address offset: 0x50 */
mbed_official 392:2b59412bb664 411 }TIM_TypeDef;
mbed_official 392:2b59412bb664 412
mbed_official 392:2b59412bb664 413
mbed_official 392:2b59412bb664 414 /**
mbed_official 392:2b59412bb664 415 * @brief Universal Synchronous Asynchronous Receiver Transmitter
mbed_official 392:2b59412bb664 416 */
mbed_official 392:2b59412bb664 417
mbed_official 392:2b59412bb664 418 typedef struct
mbed_official 392:2b59412bb664 419 {
mbed_official 392:2b59412bb664 420 __IO uint32_t CR1; /*!< USART Control register 1, Address offset: 0x00 */
mbed_official 392:2b59412bb664 421 __IO uint32_t CR2; /*!< USART Control register 2, Address offset: 0x04 */
mbed_official 392:2b59412bb664 422 __IO uint32_t CR3; /*!< USART Control register 3, Address offset: 0x08 */
mbed_official 392:2b59412bb664 423 __IO uint32_t BRR; /*!< USART Baud rate register, Address offset: 0x0C */
mbed_official 392:2b59412bb664 424 __IO uint32_t GTPR; /*!< USART Guard time and prescaler register, Address offset: 0x10 */
mbed_official 392:2b59412bb664 425 __IO uint32_t RTOR; /*!< USART Receiver Time Out register, Address offset: 0x14 */
mbed_official 392:2b59412bb664 426 __IO uint32_t RQR; /*!< USART Request register, Address offset: 0x18 */
mbed_official 392:2b59412bb664 427 __IO uint32_t ISR; /*!< USART Interrupt and status register, Address offset: 0x1C */
mbed_official 392:2b59412bb664 428 __IO uint32_t ICR; /*!< USART Interrupt flag Clear register, Address offset: 0x20 */
mbed_official 392:2b59412bb664 429 __IO uint16_t RDR; /*!< USART Receive Data register, Address offset: 0x24 */
mbed_official 392:2b59412bb664 430 uint16_t RESERVED1; /*!< Reserved, 0x26 */
mbed_official 392:2b59412bb664 431 __IO uint16_t TDR; /*!< USART Transmit Data register, Address offset: 0x28 */
mbed_official 392:2b59412bb664 432 uint16_t RESERVED2; /*!< Reserved, 0x2A */
mbed_official 392:2b59412bb664 433 }USART_TypeDef;
mbed_official 392:2b59412bb664 434
mbed_official 392:2b59412bb664 435 /**
mbed_official 392:2b59412bb664 436 * @brief Window WATCHDOG
mbed_official 392:2b59412bb664 437 */
mbed_official 392:2b59412bb664 438 typedef struct
mbed_official 392:2b59412bb664 439 {
mbed_official 392:2b59412bb664 440 __IO uint32_t CR; /*!< WWDG Control register, Address offset: 0x00 */
mbed_official 392:2b59412bb664 441 __IO uint32_t CFR; /*!< WWDG Configuration register, Address offset: 0x04 */
mbed_official 392:2b59412bb664 442 __IO uint32_t SR; /*!< WWDG Status register, Address offset: 0x08 */
mbed_official 392:2b59412bb664 443 }WWDG_TypeDef;
mbed_official 392:2b59412bb664 444
mbed_official 392:2b59412bb664 445 /**
mbed_official 392:2b59412bb664 446 * @}
mbed_official 392:2b59412bb664 447 */
mbed_official 392:2b59412bb664 448
mbed_official 392:2b59412bb664 449 /** @addtogroup Peripheral_memory_map
mbed_official 392:2b59412bb664 450 * @{
mbed_official 392:2b59412bb664 451 */
mbed_official 392:2b59412bb664 452
mbed_official 392:2b59412bb664 453 #define FLASH_BASE ((uint32_t)0x08000000) /*!< FLASH base address in the alias region */
mbed_official 392:2b59412bb664 454 #define SRAM_BASE ((uint32_t)0x20000000) /*!< SRAM base address in the alias region */
mbed_official 392:2b59412bb664 455 #define PERIPH_BASE ((uint32_t)0x40000000) /*!< Peripheral base address in the alias region */
mbed_official 392:2b59412bb664 456
mbed_official 392:2b59412bb664 457 /*!< Peripheral memory map */
mbed_official 392:2b59412bb664 458 #define APBPERIPH_BASE PERIPH_BASE
mbed_official 392:2b59412bb664 459 #define AHBPERIPH_BASE (PERIPH_BASE + 0x00020000)
mbed_official 392:2b59412bb664 460 #define AHB2PERIPH_BASE (PERIPH_BASE + 0x08000000)
mbed_official 392:2b59412bb664 461
mbed_official 392:2b59412bb664 462 #define TIM3_BASE (APBPERIPH_BASE + 0x00000400)
mbed_official 392:2b59412bb664 463 #define TIM6_BASE (APBPERIPH_BASE + 0x00001000)
mbed_official 392:2b59412bb664 464 #define TIM14_BASE (APBPERIPH_BASE + 0x00002000)
mbed_official 392:2b59412bb664 465 #define RTC_BASE (APBPERIPH_BASE + 0x00002800)
mbed_official 392:2b59412bb664 466 #define WWDG_BASE (APBPERIPH_BASE + 0x00002C00)
mbed_official 392:2b59412bb664 467 #define IWDG_BASE (APBPERIPH_BASE + 0x00003000)
mbed_official 392:2b59412bb664 468 #define SPI2_BASE (APBPERIPH_BASE + 0x00003800)
mbed_official 392:2b59412bb664 469 #define USART2_BASE (APBPERIPH_BASE + 0x00004400)
mbed_official 392:2b59412bb664 470 #define I2C1_BASE (APBPERIPH_BASE + 0x00005400)
mbed_official 392:2b59412bb664 471 #define I2C2_BASE (APBPERIPH_BASE + 0x00005800)
mbed_official 392:2b59412bb664 472 #define PWR_BASE (APBPERIPH_BASE + 0x00007000)
mbed_official 392:2b59412bb664 473 #define SYSCFG_BASE (APBPERIPH_BASE + 0x00010000)
mbed_official 392:2b59412bb664 474 #define EXTI_BASE (APBPERIPH_BASE + 0x00010400)
mbed_official 392:2b59412bb664 475 #define ADC1_BASE (APBPERIPH_BASE + 0x00012400)
mbed_official 392:2b59412bb664 476 #define ADC_BASE (APBPERIPH_BASE + 0x00012708)
mbed_official 392:2b59412bb664 477 #define TIM1_BASE (APBPERIPH_BASE + 0x00012C00)
mbed_official 392:2b59412bb664 478 #define SPI1_BASE (APBPERIPH_BASE + 0x00013000)
mbed_official 392:2b59412bb664 479 #define USART1_BASE (APBPERIPH_BASE + 0x00013800)
mbed_official 392:2b59412bb664 480 #define TIM15_BASE (APBPERIPH_BASE + 0x00014000)
mbed_official 392:2b59412bb664 481 #define TIM16_BASE (APBPERIPH_BASE + 0x00014400)
mbed_official 392:2b59412bb664 482 #define TIM17_BASE (APBPERIPH_BASE + 0x00014800)
mbed_official 392:2b59412bb664 483 #define DBGMCU_BASE (APBPERIPH_BASE + 0x00015800)
mbed_official 392:2b59412bb664 484
mbed_official 392:2b59412bb664 485 #define DMA1_BASE (AHBPERIPH_BASE + 0x00000000)
mbed_official 392:2b59412bb664 486 #define DMA1_Channel1_BASE (DMA1_BASE + 0x00000008)
mbed_official 392:2b59412bb664 487 #define DMA1_Channel2_BASE (DMA1_BASE + 0x0000001C)
mbed_official 392:2b59412bb664 488 #define DMA1_Channel3_BASE (DMA1_BASE + 0x00000030)
mbed_official 392:2b59412bb664 489 #define DMA1_Channel4_BASE (DMA1_BASE + 0x00000044)
mbed_official 392:2b59412bb664 490 #define DMA1_Channel5_BASE (DMA1_BASE + 0x00000058)
mbed_official 392:2b59412bb664 491
mbed_official 392:2b59412bb664 492 #define RCC_BASE (AHBPERIPH_BASE + 0x00001000)
mbed_official 392:2b59412bb664 493 #define FLASH_R_BASE (AHBPERIPH_BASE + 0x00002000) /*!< FLASH registers base address */
mbed_official 392:2b59412bb664 494 #define OB_BASE ((uint32_t)0x1FFFF800) /*!< FLASH Option Bytes base address */
mbed_official 392:2b59412bb664 495 #define CRC_BASE (AHBPERIPH_BASE + 0x00003000)
mbed_official 392:2b59412bb664 496
mbed_official 392:2b59412bb664 497 #define GPIOA_BASE (AHB2PERIPH_BASE + 0x00000000)
mbed_official 392:2b59412bb664 498 #define GPIOB_BASE (AHB2PERIPH_BASE + 0x00000400)
mbed_official 392:2b59412bb664 499 #define GPIOC_BASE (AHB2PERIPH_BASE + 0x00000800)
mbed_official 392:2b59412bb664 500 #define GPIOD_BASE (AHB2PERIPH_BASE + 0x00000C00)
mbed_official 392:2b59412bb664 501 #define GPIOF_BASE (AHB2PERIPH_BASE + 0x00001400)
mbed_official 392:2b59412bb664 502
mbed_official 392:2b59412bb664 503 /**
mbed_official 392:2b59412bb664 504 * @}
mbed_official 392:2b59412bb664 505 */
mbed_official 392:2b59412bb664 506
mbed_official 392:2b59412bb664 507 /** @addtogroup Peripheral_declaration
mbed_official 392:2b59412bb664 508 * @{
mbed_official 392:2b59412bb664 509 */
mbed_official 392:2b59412bb664 510
mbed_official 392:2b59412bb664 511 #define TIM3 ((TIM_TypeDef *) TIM3_BASE)
mbed_official 392:2b59412bb664 512 #define TIM6 ((TIM_TypeDef *) TIM6_BASE)
mbed_official 392:2b59412bb664 513 #define TIM14 ((TIM_TypeDef *) TIM14_BASE)
mbed_official 392:2b59412bb664 514 #define RTC ((RTC_TypeDef *) RTC_BASE)
mbed_official 392:2b59412bb664 515 #define WWDG ((WWDG_TypeDef *) WWDG_BASE)
mbed_official 392:2b59412bb664 516 #define IWDG ((IWDG_TypeDef *) IWDG_BASE)
mbed_official 392:2b59412bb664 517 #define SPI2 ((SPI_TypeDef *) SPI2_BASE)
mbed_official 392:2b59412bb664 518 #define USART2 ((USART_TypeDef *) USART2_BASE)
mbed_official 392:2b59412bb664 519 #define I2C1 ((I2C_TypeDef *) I2C1_BASE)
mbed_official 392:2b59412bb664 520 #define I2C2 ((I2C_TypeDef *) I2C2_BASE)
mbed_official 392:2b59412bb664 521 #define PWR ((PWR_TypeDef *) PWR_BASE)
mbed_official 392:2b59412bb664 522 #define SYSCFG ((SYSCFG_TypeDef *) SYSCFG_BASE)
mbed_official 392:2b59412bb664 523 #define EXTI ((EXTI_TypeDef *) EXTI_BASE)
mbed_official 392:2b59412bb664 524 #define ADC1 ((ADC_TypeDef *) ADC1_BASE)
mbed_official 392:2b59412bb664 525 #define ADC ((ADC_Common_TypeDef *) ADC_BASE)
mbed_official 392:2b59412bb664 526 #define TIM1 ((TIM_TypeDef *) TIM1_BASE)
mbed_official 392:2b59412bb664 527 #define SPI1 ((SPI_TypeDef *) SPI1_BASE)
mbed_official 392:2b59412bb664 528 #define USART1 ((USART_TypeDef *) USART1_BASE)
mbed_official 392:2b59412bb664 529 #define TIM15 ((TIM_TypeDef *) TIM15_BASE)
mbed_official 392:2b59412bb664 530 #define TIM16 ((TIM_TypeDef *) TIM16_BASE)
mbed_official 392:2b59412bb664 531 #define TIM17 ((TIM_TypeDef *) TIM17_BASE)
mbed_official 392:2b59412bb664 532 #define DBGMCU ((DBGMCU_TypeDef *) DBGMCU_BASE)
mbed_official 392:2b59412bb664 533 #define DMA1 ((DMA_TypeDef *) DMA1_BASE)
mbed_official 392:2b59412bb664 534 #define DMA1_Channel1 ((DMA_Channel_TypeDef *) DMA1_Channel1_BASE)
mbed_official 392:2b59412bb664 535 #define DMA1_Channel2 ((DMA_Channel_TypeDef *) DMA1_Channel2_BASE)
mbed_official 392:2b59412bb664 536 #define DMA1_Channel3 ((DMA_Channel_TypeDef *) DMA1_Channel3_BASE)
mbed_official 392:2b59412bb664 537 #define DMA1_Channel4 ((DMA_Channel_TypeDef *) DMA1_Channel4_BASE)
mbed_official 392:2b59412bb664 538 #define DMA1_Channel5 ((DMA_Channel_TypeDef *) DMA1_Channel5_BASE)
mbed_official 392:2b59412bb664 539 #define FLASH ((FLASH_TypeDef *) FLASH_R_BASE)
mbed_official 392:2b59412bb664 540 #define OB ((OB_TypeDef *) OB_BASE)
mbed_official 392:2b59412bb664 541 #define RCC ((RCC_TypeDef *) RCC_BASE)
mbed_official 392:2b59412bb664 542 #define CRC ((CRC_TypeDef *) CRC_BASE)
mbed_official 392:2b59412bb664 543 #define GPIOA ((GPIO_TypeDef *) GPIOA_BASE)
mbed_official 392:2b59412bb664 544 #define GPIOB ((GPIO_TypeDef *) GPIOB_BASE)
mbed_official 392:2b59412bb664 545 #define GPIOC ((GPIO_TypeDef *) GPIOC_BASE)
mbed_official 392:2b59412bb664 546 #define GPIOD ((GPIO_TypeDef *) GPIOD_BASE)
mbed_official 392:2b59412bb664 547 #define GPIOF ((GPIO_TypeDef *) GPIOF_BASE)
mbed_official 392:2b59412bb664 548
mbed_official 392:2b59412bb664 549 /**
mbed_official 392:2b59412bb664 550 * @}
mbed_official 392:2b59412bb664 551 */
mbed_official 392:2b59412bb664 552
mbed_official 392:2b59412bb664 553 /** @addtogroup Exported_constants
mbed_official 392:2b59412bb664 554 * @{
mbed_official 392:2b59412bb664 555 */
mbed_official 392:2b59412bb664 556
mbed_official 392:2b59412bb664 557 /** @addtogroup Peripheral_Registers_Bits_Definition
mbed_official 392:2b59412bb664 558 * @{
mbed_official 392:2b59412bb664 559 */
mbed_official 392:2b59412bb664 560
mbed_official 392:2b59412bb664 561 /******************************************************************************/
mbed_official 392:2b59412bb664 562 /* Peripheral Registers Bits Definition */
mbed_official 392:2b59412bb664 563 /******************************************************************************/
mbed_official 392:2b59412bb664 564 /******************************************************************************/
mbed_official 392:2b59412bb664 565 /* */
mbed_official 392:2b59412bb664 566 /* Analog to Digital Converter (ADC) */
mbed_official 392:2b59412bb664 567 /* */
mbed_official 392:2b59412bb664 568 /******************************************************************************/
mbed_official 392:2b59412bb664 569 /******************** Bits definition for ADC_ISR register ******************/
mbed_official 392:2b59412bb664 570 #define ADC_ISR_AWD ((uint32_t)0x00000080) /*!< Analog watchdog flag */
mbed_official 392:2b59412bb664 571 #define ADC_ISR_OVR ((uint32_t)0x00000010) /*!< Overrun flag */
mbed_official 392:2b59412bb664 572 #define ADC_ISR_EOSEQ ((uint32_t)0x00000008) /*!< End of Sequence flag */
mbed_official 392:2b59412bb664 573 #define ADC_ISR_EOC ((uint32_t)0x00000004) /*!< End of Conversion */
mbed_official 392:2b59412bb664 574 #define ADC_ISR_EOSMP ((uint32_t)0x00000002) /*!< End of sampling flag */
mbed_official 392:2b59412bb664 575 #define ADC_ISR_ADRDY ((uint32_t)0x00000001) /*!< ADC Ready */
mbed_official 392:2b59412bb664 576
mbed_official 392:2b59412bb664 577 /* Old EOSEQ bit definition, maintained for legacy purpose */
mbed_official 392:2b59412bb664 578 #define ADC_ISR_EOS ADC_ISR_EOSEQ
mbed_official 392:2b59412bb664 579
mbed_official 392:2b59412bb664 580 /******************** Bits definition for ADC_IER register ******************/
mbed_official 392:2b59412bb664 581 #define ADC_IER_AWDIE ((uint32_t)0x00000080) /*!< Analog Watchdog interrupt enable */
mbed_official 392:2b59412bb664 582 #define ADC_IER_OVRIE ((uint32_t)0x00000010) /*!< Overrun interrupt enable */
mbed_official 392:2b59412bb664 583 #define ADC_IER_EOSEQIE ((uint32_t)0x00000008) /*!< End of Sequence of conversion interrupt enable */
mbed_official 392:2b59412bb664 584 #define ADC_IER_EOCIE ((uint32_t)0x00000004) /*!< End of Conversion interrupt enable */
mbed_official 392:2b59412bb664 585 #define ADC_IER_EOSMPIE ((uint32_t)0x00000002) /*!< End of sampling interrupt enable */
mbed_official 392:2b59412bb664 586 #define ADC_IER_ADRDYIE ((uint32_t)0x00000001) /*!< ADC Ready interrupt enable */
mbed_official 392:2b59412bb664 587
mbed_official 392:2b59412bb664 588 /* Old EOSEQIE bit definition, maintained for legacy purpose */
mbed_official 392:2b59412bb664 589 #define ADC_IER_EOSIE ADC_IER_EOSEQIE
mbed_official 392:2b59412bb664 590
mbed_official 392:2b59412bb664 591 /******************** Bits definition for ADC_CR register *******************/
mbed_official 392:2b59412bb664 592 #define ADC_CR_ADCAL ((uint32_t)0x80000000) /*!< ADC calibration */
mbed_official 392:2b59412bb664 593 #define ADC_CR_ADSTP ((uint32_t)0x00000010) /*!< ADC stop of conversion command */
mbed_official 392:2b59412bb664 594 #define ADC_CR_ADSTART ((uint32_t)0x00000004) /*!< ADC start of conversion */
mbed_official 392:2b59412bb664 595 #define ADC_CR_ADDIS ((uint32_t)0x00000002) /*!< ADC disable command */
mbed_official 392:2b59412bb664 596 #define ADC_CR_ADEN ((uint32_t)0x00000001) /*!< ADC enable control */
mbed_official 392:2b59412bb664 597
mbed_official 392:2b59412bb664 598 /******************* Bits definition for ADC_CFGR1 register *****************/
mbed_official 392:2b59412bb664 599 #define ADC_CFGR1_AWDCH ((uint32_t)0x7C000000) /*!< AWDCH[4:0] bits (Analog watchdog channel select bits) */
mbed_official 392:2b59412bb664 600 #define ADC_CFGR1_AWDCH_0 ((uint32_t)0x04000000) /*!< Bit 0 */
mbed_official 392:2b59412bb664 601 #define ADC_CFGR1_AWDCH_1 ((uint32_t)0x08000000) /*!< Bit 1 */
mbed_official 392:2b59412bb664 602 #define ADC_CFGR1_AWDCH_2 ((uint32_t)0x10000000) /*!< Bit 2 */
mbed_official 392:2b59412bb664 603 #define ADC_CFGR1_AWDCH_3 ((uint32_t)0x20000000) /*!< Bit 3 */
mbed_official 392:2b59412bb664 604 #define ADC_CFGR1_AWDCH_4 ((uint32_t)0x40000000) /*!< Bit 4 */
mbed_official 392:2b59412bb664 605 #define ADC_CFGR1_AWDEN ((uint32_t)0x00800000) /*!< Analog watchdog enable on regular channels */
mbed_official 392:2b59412bb664 606 #define ADC_CFGR1_AWDSGL ((uint32_t)0x00400000) /*!< Enable the watchdog on a single channel or on all channels */
mbed_official 392:2b59412bb664 607 #define ADC_CFGR1_DISCEN ((uint32_t)0x00010000) /*!< Discontinuous mode on regular channels */
mbed_official 392:2b59412bb664 608 #define ADC_CFGR1_AUTOFF ((uint32_t)0x00008000) /*!< ADC auto power off */
mbed_official 392:2b59412bb664 609 #define ADC_CFGR1_WAIT ((uint32_t)0x00004000) /*!< ADC wait conversion mode */
mbed_official 392:2b59412bb664 610 #define ADC_CFGR1_CONT ((uint32_t)0x00002000) /*!< Continuous Conversion */
mbed_official 392:2b59412bb664 611 #define ADC_CFGR1_OVRMOD ((uint32_t)0x00001000) /*!< Overrun mode */
mbed_official 392:2b59412bb664 612 #define ADC_CFGR1_EXTEN ((uint32_t)0x00000C00) /*!< EXTEN[1:0] bits (External Trigger Conversion mode for regular channels) */
mbed_official 392:2b59412bb664 613 #define ADC_CFGR1_EXTEN_0 ((uint32_t)0x00000400) /*!< Bit 0 */
mbed_official 392:2b59412bb664 614 #define ADC_CFGR1_EXTEN_1 ((uint32_t)0x00000800) /*!< Bit 1 */
mbed_official 392:2b59412bb664 615 #define ADC_CFGR1_EXTSEL ((uint32_t)0x000001C0) /*!< EXTSEL[2:0] bits (External Event Select for regular group) */
mbed_official 392:2b59412bb664 616 #define ADC_CFGR1_EXTSEL_0 ((uint32_t)0x00000040) /*!< Bit 0 */
mbed_official 392:2b59412bb664 617 #define ADC_CFGR1_EXTSEL_1 ((uint32_t)0x00000080) /*!< Bit 1 */
mbed_official 392:2b59412bb664 618 #define ADC_CFGR1_EXTSEL_2 ((uint32_t)0x00000100) /*!< Bit 2 */
mbed_official 392:2b59412bb664 619 #define ADC_CFGR1_ALIGN ((uint32_t)0x00000020) /*!< Data Alignment */
mbed_official 392:2b59412bb664 620 #define ADC_CFGR1_RES ((uint32_t)0x00000018) /*!< RES[1:0] bits (Resolution) */
mbed_official 392:2b59412bb664 621 #define ADC_CFGR1_RES_0 ((uint32_t)0x00000008) /*!< Bit 0 */
mbed_official 392:2b59412bb664 622 #define ADC_CFGR1_RES_1 ((uint32_t)0x00000010) /*!< Bit 1 */
mbed_official 392:2b59412bb664 623 #define ADC_CFGR1_SCANDIR ((uint32_t)0x00000004) /*!< Sequence scan direction */
mbed_official 392:2b59412bb664 624 #define ADC_CFGR1_DMACFG ((uint32_t)0x00000002) /*!< Direct memory access configuration */
mbed_official 392:2b59412bb664 625 #define ADC_CFGR1_DMAEN ((uint32_t)0x00000001) /*!< Direct memory access enable */
mbed_official 392:2b59412bb664 626
mbed_official 392:2b59412bb664 627 /* Old WAIT bit definition, maintained for legacy purpose */
mbed_official 392:2b59412bb664 628 #define ADC_CFGR1_AUTDLY ADC_CFGR1_WAIT
mbed_official 392:2b59412bb664 629
mbed_official 392:2b59412bb664 630 /******************* Bits definition for ADC_CFGR2 register *****************/
mbed_official 392:2b59412bb664 631 #define ADC_CFGR2_CKMODE ((uint32_t)0xC0000000) /*!< ADC clock mode */
mbed_official 392:2b59412bb664 632 #define ADC_CFGR2_CKMODE_1 ((uint32_t)0x80000000) /*!< ADC clocked by PCLK div4 */
mbed_official 392:2b59412bb664 633 #define ADC_CFGR2_CKMODE_0 ((uint32_t)0x40000000) /*!< ADC clocked by PCLK div2 */
mbed_official 392:2b59412bb664 634
mbed_official 392:2b59412bb664 635 /* Old bit definition, maintained for legacy purpose */
mbed_official 392:2b59412bb664 636 #define ADC_CFGR2_JITOFFDIV4 ADC_CFGR2_CKMODE_1 /*!< ADC clocked by PCLK div4 */
mbed_official 392:2b59412bb664 637 #define ADC_CFGR2_JITOFFDIV2 ADC_CFGR2_CKMODE_0 /*!< ADC clocked by PCLK div2 */
mbed_official 392:2b59412bb664 638
mbed_official 392:2b59412bb664 639 /****************** Bit definition for ADC_SMPR register ********************/
mbed_official 392:2b59412bb664 640 #define ADC_SMPR_SMP ((uint32_t)0x00000007) /*!< SMP[2:0] bits (Sampling time selection) */
mbed_official 392:2b59412bb664 641 #define ADC_SMPR_SMP_0 ((uint32_t)0x00000001) /*!< Bit 0 */
mbed_official 392:2b59412bb664 642 #define ADC_SMPR_SMP_1 ((uint32_t)0x00000002) /*!< Bit 1 */
mbed_official 392:2b59412bb664 643 #define ADC_SMPR_SMP_2 ((uint32_t)0x00000004) /*!< Bit 2 */
mbed_official 392:2b59412bb664 644
mbed_official 392:2b59412bb664 645 /* Old bit definition, maintained for legacy purpose */
mbed_official 392:2b59412bb664 646 #define ADC_SMPR1_SMPR ADC_SMPR_SMP /*!< SMP[2:0] bits (Sampling time selection) */
mbed_official 392:2b59412bb664 647 #define ADC_SMPR1_SMPR_0 ADC_SMPR_SMP_0 /*!< Bit 0 */
mbed_official 392:2b59412bb664 648 #define ADC_SMPR1_SMPR_1 ADC_SMPR_SMP_1 /*!< Bit 1 */
mbed_official 392:2b59412bb664 649 #define ADC_SMPR1_SMPR_2 ADC_SMPR_SMP_2 /*!< Bit 2 */
mbed_official 392:2b59412bb664 650
mbed_official 392:2b59412bb664 651 /******************* Bit definition for ADC_TR register ********************/
mbed_official 392:2b59412bb664 652 #define ADC_TR_HT ((uint32_t)0x0FFF0000) /*!< Analog watchdog high threshold */
mbed_official 392:2b59412bb664 653 #define ADC_TR_LT ((uint32_t)0x00000FFF) /*!< Analog watchdog low threshold */
mbed_official 392:2b59412bb664 654
mbed_official 392:2b59412bb664 655 /* Old bit definition, maintained for legacy purpose */
mbed_official 392:2b59412bb664 656 #define ADC_HTR_HT ADC_TR_HT /*!< Analog watchdog high threshold */
mbed_official 392:2b59412bb664 657 #define ADC_LTR_LT ADC_TR_LT /*!< Analog watchdog low threshold */
mbed_official 392:2b59412bb664 658
mbed_official 392:2b59412bb664 659 /****************** Bit definition for ADC_CHSELR register ******************/
mbed_official 392:2b59412bb664 660 #define ADC_CHSELR_CHSEL18 ((uint32_t)0x00040000) /*!< Channel 18 selection */
mbed_official 392:2b59412bb664 661 #define ADC_CHSELR_CHSEL17 ((uint32_t)0x00020000) /*!< Channel 17 selection */
mbed_official 392:2b59412bb664 662 #define ADC_CHSELR_CHSEL16 ((uint32_t)0x00010000) /*!< Channel 16 selection */
mbed_official 392:2b59412bb664 663 #define ADC_CHSELR_CHSEL15 ((uint32_t)0x00008000) /*!< Channel 15 selection */
mbed_official 392:2b59412bb664 664 #define ADC_CHSELR_CHSEL14 ((uint32_t)0x00004000) /*!< Channel 14 selection */
mbed_official 392:2b59412bb664 665 #define ADC_CHSELR_CHSEL13 ((uint32_t)0x00002000) /*!< Channel 13 selection */
mbed_official 392:2b59412bb664 666 #define ADC_CHSELR_CHSEL12 ((uint32_t)0x00001000) /*!< Channel 12 selection */
mbed_official 392:2b59412bb664 667 #define ADC_CHSELR_CHSEL11 ((uint32_t)0x00000800) /*!< Channel 11 selection */
mbed_official 392:2b59412bb664 668 #define ADC_CHSELR_CHSEL10 ((uint32_t)0x00000400) /*!< Channel 10 selection */
mbed_official 392:2b59412bb664 669 #define ADC_CHSELR_CHSEL9 ((uint32_t)0x00000200) /*!< Channel 9 selection */
mbed_official 392:2b59412bb664 670 #define ADC_CHSELR_CHSEL8 ((uint32_t)0x00000100) /*!< Channel 8 selection */
mbed_official 392:2b59412bb664 671 #define ADC_CHSELR_CHSEL7 ((uint32_t)0x00000080) /*!< Channel 7 selection */
mbed_official 392:2b59412bb664 672 #define ADC_CHSELR_CHSEL6 ((uint32_t)0x00000040) /*!< Channel 6 selection */
mbed_official 392:2b59412bb664 673 #define ADC_CHSELR_CHSEL5 ((uint32_t)0x00000020) /*!< Channel 5 selection */
mbed_official 392:2b59412bb664 674 #define ADC_CHSELR_CHSEL4 ((uint32_t)0x00000010) /*!< Channel 4 selection */
mbed_official 392:2b59412bb664 675 #define ADC_CHSELR_CHSEL3 ((uint32_t)0x00000008) /*!< Channel 3 selection */
mbed_official 392:2b59412bb664 676 #define ADC_CHSELR_CHSEL2 ((uint32_t)0x00000004) /*!< Channel 2 selection */
mbed_official 392:2b59412bb664 677 #define ADC_CHSELR_CHSEL1 ((uint32_t)0x00000002) /*!< Channel 1 selection */
mbed_official 392:2b59412bb664 678 #define ADC_CHSELR_CHSEL0 ((uint32_t)0x00000001) /*!< Channel 0 selection */
mbed_official 392:2b59412bb664 679
mbed_official 392:2b59412bb664 680 /******************** Bit definition for ADC_DR register ********************/
mbed_official 392:2b59412bb664 681 #define ADC_DR_DATA ((uint32_t)0x0000FFFF) /*!< Regular data */
mbed_official 392:2b59412bb664 682
mbed_official 392:2b59412bb664 683 /******************* Bit definition for ADC_CCR register ********************/
mbed_official 392:2b59412bb664 684 #define ADC_CCR_VBATEN ((uint32_t)0x01000000) /*!< Voltage battery enable */
mbed_official 392:2b59412bb664 685 #define ADC_CCR_TSEN ((uint32_t)0x00800000) /*!< Tempurature sensore enable */
mbed_official 392:2b59412bb664 686 #define ADC_CCR_VREFEN ((uint32_t)0x00400000) /*!< Vrefint enable */
mbed_official 392:2b59412bb664 687
mbed_official 392:2b59412bb664 688 /******************************************************************************/
mbed_official 392:2b59412bb664 689 /* */
mbed_official 392:2b59412bb664 690 /* CRC calculation unit (CRC) */
mbed_official 392:2b59412bb664 691 /* */
mbed_official 392:2b59412bb664 692 /******************************************************************************/
mbed_official 392:2b59412bb664 693 /******************* Bit definition for CRC_DR register *********************/
mbed_official 392:2b59412bb664 694 #define CRC_DR_DR ((uint32_t)0xFFFFFFFF) /*!< Data register bits */
mbed_official 392:2b59412bb664 695
mbed_official 392:2b59412bb664 696 /******************* Bit definition for CRC_IDR register ********************/
mbed_official 392:2b59412bb664 697 #define CRC_IDR_IDR ((uint8_t)0xFF) /*!< General-purpose 8-bit data register bits */
mbed_official 392:2b59412bb664 698
mbed_official 392:2b59412bb664 699 /******************** Bit definition for CRC_CR register ********************/
mbed_official 392:2b59412bb664 700 #define CRC_CR_RESET ((uint32_t)0x00000001) /*!< RESET the CRC computation unit bit */
mbed_official 392:2b59412bb664 701 #define CRC_CR_REV_IN ((uint32_t)0x00000060) /*!< REV_IN Reverse Input Data bits */
mbed_official 392:2b59412bb664 702 #define CRC_CR_REV_IN_0 ((uint32_t)0x00000020) /*!< REV_IN Bit 0 */
mbed_official 392:2b59412bb664 703 #define CRC_CR_REV_IN_1 ((uint32_t)0x00000040) /*!< REV_IN Bit 1 */
mbed_official 392:2b59412bb664 704 #define CRC_CR_REV_OUT ((uint32_t)0x00000080) /*!< REV_OUT Reverse Output Data bits */
mbed_official 392:2b59412bb664 705
mbed_official 392:2b59412bb664 706 /******************* Bit definition for CRC_INIT register *******************/
mbed_official 392:2b59412bb664 707 #define CRC_INIT_INIT ((uint32_t)0xFFFFFFFF) /*!< Initial CRC value bits */
mbed_official 392:2b59412bb664 708
mbed_official 392:2b59412bb664 709 /******************************************************************************/
mbed_official 392:2b59412bb664 710 /* */
mbed_official 392:2b59412bb664 711 /* Debug MCU (DBGMCU) */
mbed_official 392:2b59412bb664 712 /* */
mbed_official 392:2b59412bb664 713 /******************************************************************************/
mbed_official 392:2b59412bb664 714
mbed_official 392:2b59412bb664 715 /**************** Bit definition for DBGMCU_IDCODE register *****************/
mbed_official 392:2b59412bb664 716 #define DBGMCU_IDCODE_DEV_ID ((uint32_t)0x00000FFF) /*!< Device Identifier */
mbed_official 392:2b59412bb664 717
mbed_official 392:2b59412bb664 718 #define DBGMCU_IDCODE_REV_ID ((uint32_t)0xFFFF0000) /*!< REV_ID[15:0] bits (Revision Identifier) */
mbed_official 392:2b59412bb664 719 #define DBGMCU_IDCODE_REV_ID_0 ((uint32_t)0x00010000) /*!< Bit 0 */
mbed_official 392:2b59412bb664 720 #define DBGMCU_IDCODE_REV_ID_1 ((uint32_t)0x00020000) /*!< Bit 1 */
mbed_official 392:2b59412bb664 721 #define DBGMCU_IDCODE_REV_ID_2 ((uint32_t)0x00040000) /*!< Bit 2 */
mbed_official 392:2b59412bb664 722 #define DBGMCU_IDCODE_REV_ID_3 ((uint32_t)0x00080000) /*!< Bit 3 */
mbed_official 392:2b59412bb664 723 #define DBGMCU_IDCODE_REV_ID_4 ((uint32_t)0x00100000) /*!< Bit 4 */
mbed_official 392:2b59412bb664 724 #define DBGMCU_IDCODE_REV_ID_5 ((uint32_t)0x00200000) /*!< Bit 5 */
mbed_official 392:2b59412bb664 725 #define DBGMCU_IDCODE_REV_ID_6 ((uint32_t)0x00400000) /*!< Bit 6 */
mbed_official 392:2b59412bb664 726 #define DBGMCU_IDCODE_REV_ID_7 ((uint32_t)0x00800000) /*!< Bit 7 */
mbed_official 392:2b59412bb664 727 #define DBGMCU_IDCODE_REV_ID_8 ((uint32_t)0x01000000) /*!< Bit 8 */
mbed_official 392:2b59412bb664 728 #define DBGMCU_IDCODE_REV_ID_9 ((uint32_t)0x02000000) /*!< Bit 9 */
mbed_official 392:2b59412bb664 729 #define DBGMCU_IDCODE_REV_ID_10 ((uint32_t)0x04000000) /*!< Bit 10 */
mbed_official 392:2b59412bb664 730 #define DBGMCU_IDCODE_REV_ID_11 ((uint32_t)0x08000000) /*!< Bit 11 */
mbed_official 392:2b59412bb664 731 #define DBGMCU_IDCODE_REV_ID_12 ((uint32_t)0x10000000) /*!< Bit 12 */
mbed_official 392:2b59412bb664 732 #define DBGMCU_IDCODE_REV_ID_13 ((uint32_t)0x20000000) /*!< Bit 13 */
mbed_official 392:2b59412bb664 733 #define DBGMCU_IDCODE_REV_ID_14 ((uint32_t)0x40000000) /*!< Bit 14 */
mbed_official 392:2b59412bb664 734 #define DBGMCU_IDCODE_REV_ID_15 ((uint32_t)0x80000000) /*!< Bit 15 */
mbed_official 392:2b59412bb664 735
mbed_official 392:2b59412bb664 736 /****************** Bit definition for DBGMCU_CR register *******************/
mbed_official 392:2b59412bb664 737 #define DBGMCU_CR_DBG_STOP ((uint32_t)0x00000002) /*!< Debug Stop Mode */
mbed_official 392:2b59412bb664 738 #define DBGMCU_CR_DBG_STANDBY ((uint32_t)0x00000004) /*!< Debug Standby mode */
mbed_official 392:2b59412bb664 739
mbed_official 392:2b59412bb664 740 /****************** Bit definition for DBGMCU_APB1_FZ register **************/
mbed_official 392:2b59412bb664 741 #define DBGMCU_APB1_FZ_DBG_TIM3_STOP ((uint32_t)0x00000002) /*!< TIM3 counter stopped when core is halted */
mbed_official 392:2b59412bb664 742 #define DBGMCU_APB1_FZ_DBG_TIM6_STOP ((uint32_t)0x00000010) /*!< TIM6 counter stopped when core is halted */
mbed_official 392:2b59412bb664 743 #define DBGMCU_APB1_FZ_DBG_TIM14_STOP ((uint32_t)0x00000100) /*!< TIM14 counter stopped when core is halted */
mbed_official 392:2b59412bb664 744 #define DBGMCU_APB1_FZ_DBG_RTC_STOP ((uint32_t)0x00000400) /*!< RTC Calendar frozen when core is halted */
mbed_official 392:2b59412bb664 745 #define DBGMCU_APB1_FZ_DBG_WWDG_STOP ((uint32_t)0x00000800) /*!< Debug Window Watchdog stopped when Core is halted */
mbed_official 392:2b59412bb664 746 #define DBGMCU_APB1_FZ_DBG_IWDG_STOP ((uint32_t)0x00001000) /*!< Debug Independent Watchdog stopped when Core is halted */
mbed_official 392:2b59412bb664 747 #define DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT ((uint32_t)0x00200000) /*!< I2C1 SMBUS timeout mode stopped when Core is halted */
mbed_official 392:2b59412bb664 748
mbed_official 392:2b59412bb664 749 /****************** Bit definition for DBGMCU_APB2_FZ register **************/
mbed_official 392:2b59412bb664 750 #define DBGMCU_APB2_FZ_DBG_TIM1_STOP ((uint32_t)0x00000800) /*!< TIM1 counter stopped when core is halted */
mbed_official 392:2b59412bb664 751 #define DBGMCU_APB2_FZ_DBG_TIM15_STOP ((uint32_t)0x00010000) /*!< TIM15 counter stopped when core is halted */
mbed_official 392:2b59412bb664 752 #define DBGMCU_APB2_FZ_DBG_TIM16_STOP ((uint32_t)0x00020000) /*!< TIM16 counter stopped when core is halted */
mbed_official 392:2b59412bb664 753 #define DBGMCU_APB2_FZ_DBG_TIM17_STOP ((uint32_t)0x00040000) /*!< TIM17 counter stopped when core is halted */
mbed_official 392:2b59412bb664 754
mbed_official 392:2b59412bb664 755 /******************************************************************************/
mbed_official 392:2b59412bb664 756 /* */
mbed_official 392:2b59412bb664 757 /* DMA Controller (DMA) */
mbed_official 392:2b59412bb664 758 /* */
mbed_official 392:2b59412bb664 759 /******************************************************************************/
mbed_official 392:2b59412bb664 760 /******************* Bit definition for DMA_ISR register ********************/
mbed_official 392:2b59412bb664 761 #define DMA_ISR_GIF1 ((uint32_t)0x00000001) /*!< Channel 1 Global interrupt flag */
mbed_official 392:2b59412bb664 762 #define DMA_ISR_TCIF1 ((uint32_t)0x00000002) /*!< Channel 1 Transfer Complete flag */
mbed_official 392:2b59412bb664 763 #define DMA_ISR_HTIF1 ((uint32_t)0x00000004) /*!< Channel 1 Half Transfer flag */
mbed_official 392:2b59412bb664 764 #define DMA_ISR_TEIF1 ((uint32_t)0x00000008) /*!< Channel 1 Transfer Error flag */
mbed_official 392:2b59412bb664 765 #define DMA_ISR_GIF2 ((uint32_t)0x00000010) /*!< Channel 2 Global interrupt flag */
mbed_official 392:2b59412bb664 766 #define DMA_ISR_TCIF2 ((uint32_t)0x00000020) /*!< Channel 2 Transfer Complete flag */
mbed_official 392:2b59412bb664 767 #define DMA_ISR_HTIF2 ((uint32_t)0x00000040) /*!< Channel 2 Half Transfer flag */
mbed_official 392:2b59412bb664 768 #define DMA_ISR_TEIF2 ((uint32_t)0x00000080) /*!< Channel 2 Transfer Error flag */
mbed_official 392:2b59412bb664 769 #define DMA_ISR_GIF3 ((uint32_t)0x00000100) /*!< Channel 3 Global interrupt flag */
mbed_official 392:2b59412bb664 770 #define DMA_ISR_TCIF3 ((uint32_t)0x00000200) /*!< Channel 3 Transfer Complete flag */
mbed_official 392:2b59412bb664 771 #define DMA_ISR_HTIF3 ((uint32_t)0x00000400) /*!< Channel 3 Half Transfer flag */
mbed_official 392:2b59412bb664 772 #define DMA_ISR_TEIF3 ((uint32_t)0x00000800) /*!< Channel 3 Transfer Error flag */
mbed_official 392:2b59412bb664 773 #define DMA_ISR_GIF4 ((uint32_t)0x00001000) /*!< Channel 4 Global interrupt flag */
mbed_official 392:2b59412bb664 774 #define DMA_ISR_TCIF4 ((uint32_t)0x00002000) /*!< Channel 4 Transfer Complete flag */
mbed_official 392:2b59412bb664 775 #define DMA_ISR_HTIF4 ((uint32_t)0x00004000) /*!< Channel 4 Half Transfer flag */
mbed_official 392:2b59412bb664 776 #define DMA_ISR_TEIF4 ((uint32_t)0x00008000) /*!< Channel 4 Transfer Error flag */
mbed_official 392:2b59412bb664 777 #define DMA_ISR_GIF5 ((uint32_t)0x00010000) /*!< Channel 5 Global interrupt flag */
mbed_official 392:2b59412bb664 778 #define DMA_ISR_TCIF5 ((uint32_t)0x00020000) /*!< Channel 5 Transfer Complete flag */
mbed_official 392:2b59412bb664 779 #define DMA_ISR_HTIF5 ((uint32_t)0x00040000) /*!< Channel 5 Half Transfer flag */
mbed_official 392:2b59412bb664 780 #define DMA_ISR_TEIF5 ((uint32_t)0x00080000) /*!< Channel 5 Transfer Error flag */
mbed_official 392:2b59412bb664 781
mbed_official 392:2b59412bb664 782 /******************* Bit definition for DMA_IFCR register *******************/
mbed_official 392:2b59412bb664 783 #define DMA_IFCR_CGIF1 ((uint32_t)0x00000001) /*!< Channel 1 Global interrupt clear */
mbed_official 392:2b59412bb664 784 #define DMA_IFCR_CTCIF1 ((uint32_t)0x00000002) /*!< Channel 1 Transfer Complete clear */
mbed_official 392:2b59412bb664 785 #define DMA_IFCR_CHTIF1 ((uint32_t)0x00000004) /*!< Channel 1 Half Transfer clear */
mbed_official 392:2b59412bb664 786 #define DMA_IFCR_CTEIF1 ((uint32_t)0x00000008) /*!< Channel 1 Transfer Error clear */
mbed_official 392:2b59412bb664 787 #define DMA_IFCR_CGIF2 ((uint32_t)0x00000010) /*!< Channel 2 Global interrupt clear */
mbed_official 392:2b59412bb664 788 #define DMA_IFCR_CTCIF2 ((uint32_t)0x00000020) /*!< Channel 2 Transfer Complete clear */
mbed_official 392:2b59412bb664 789 #define DMA_IFCR_CHTIF2 ((uint32_t)0x00000040) /*!< Channel 2 Half Transfer clear */
mbed_official 392:2b59412bb664 790 #define DMA_IFCR_CTEIF2 ((uint32_t)0x00000080) /*!< Channel 2 Transfer Error clear */
mbed_official 392:2b59412bb664 791 #define DMA_IFCR_CGIF3 ((uint32_t)0x00000100) /*!< Channel 3 Global interrupt clear */
mbed_official 392:2b59412bb664 792 #define DMA_IFCR_CTCIF3 ((uint32_t)0x00000200) /*!< Channel 3 Transfer Complete clear */
mbed_official 392:2b59412bb664 793 #define DMA_IFCR_CHTIF3 ((uint32_t)0x00000400) /*!< Channel 3 Half Transfer clear */
mbed_official 392:2b59412bb664 794 #define DMA_IFCR_CTEIF3 ((uint32_t)0x00000800) /*!< Channel 3 Transfer Error clear */
mbed_official 392:2b59412bb664 795 #define DMA_IFCR_CGIF4 ((uint32_t)0x00001000) /*!< Channel 4 Global interrupt clear */
mbed_official 392:2b59412bb664 796 #define DMA_IFCR_CTCIF4 ((uint32_t)0x00002000) /*!< Channel 4 Transfer Complete clear */
mbed_official 392:2b59412bb664 797 #define DMA_IFCR_CHTIF4 ((uint32_t)0x00004000) /*!< Channel 4 Half Transfer clear */
mbed_official 392:2b59412bb664 798 #define DMA_IFCR_CTEIF4 ((uint32_t)0x00008000) /*!< Channel 4 Transfer Error clear */
mbed_official 392:2b59412bb664 799 #define DMA_IFCR_CGIF5 ((uint32_t)0x00010000) /*!< Channel 5 Global interrupt clear */
mbed_official 392:2b59412bb664 800 #define DMA_IFCR_CTCIF5 ((uint32_t)0x00020000) /*!< Channel 5 Transfer Complete clear */
mbed_official 392:2b59412bb664 801 #define DMA_IFCR_CHTIF5 ((uint32_t)0x00040000) /*!< Channel 5 Half Transfer clear */
mbed_official 392:2b59412bb664 802 #define DMA_IFCR_CTEIF5 ((uint32_t)0x00080000) /*!< Channel 5 Transfer Error clear */
mbed_official 392:2b59412bb664 803
mbed_official 392:2b59412bb664 804 /******************* Bit definition for DMA_CCR register ********************/
mbed_official 392:2b59412bb664 805 #define DMA_CCR_EN ((uint32_t)0x00000001) /*!< Channel enable */
mbed_official 392:2b59412bb664 806 #define DMA_CCR_TCIE ((uint32_t)0x00000002) /*!< Transfer complete interrupt enable */
mbed_official 392:2b59412bb664 807 #define DMA_CCR_HTIE ((uint32_t)0x00000004) /*!< Half Transfer interrupt enable */
mbed_official 392:2b59412bb664 808 #define DMA_CCR_TEIE ((uint32_t)0x00000008) /*!< Transfer error interrupt enable */
mbed_official 392:2b59412bb664 809 #define DMA_CCR_DIR ((uint32_t)0x00000010) /*!< Data transfer direction */
mbed_official 392:2b59412bb664 810 #define DMA_CCR_CIRC ((uint32_t)0x00000020) /*!< Circular mode */
mbed_official 392:2b59412bb664 811 #define DMA_CCR_PINC ((uint32_t)0x00000040) /*!< Peripheral increment mode */
mbed_official 392:2b59412bb664 812 #define DMA_CCR_MINC ((uint32_t)0x00000080) /*!< Memory increment mode */
mbed_official 392:2b59412bb664 813
mbed_official 392:2b59412bb664 814 #define DMA_CCR_PSIZE ((uint32_t)0x00000300) /*!< PSIZE[1:0] bits (Peripheral size) */
mbed_official 392:2b59412bb664 815 #define DMA_CCR_PSIZE_0 ((uint32_t)0x00000100) /*!< Bit 0 */
mbed_official 392:2b59412bb664 816 #define DMA_CCR_PSIZE_1 ((uint32_t)0x00000200) /*!< Bit 1 */
mbed_official 392:2b59412bb664 817
mbed_official 392:2b59412bb664 818 #define DMA_CCR_MSIZE ((uint32_t)0x00000C00) /*!< MSIZE[1:0] bits (Memory size) */
mbed_official 392:2b59412bb664 819 #define DMA_CCR_MSIZE_0 ((uint32_t)0x00000400) /*!< Bit 0 */
mbed_official 392:2b59412bb664 820 #define DMA_CCR_MSIZE_1 ((uint32_t)0x00000800) /*!< Bit 1 */
mbed_official 392:2b59412bb664 821
mbed_official 392:2b59412bb664 822 #define DMA_CCR_PL ((uint32_t)0x00003000) /*!< PL[1:0] bits(Channel Priority level)*/
mbed_official 392:2b59412bb664 823 #define DMA_CCR_PL_0 ((uint32_t)0x00001000) /*!< Bit 0 */
mbed_official 392:2b59412bb664 824 #define DMA_CCR_PL_1 ((uint32_t)0x00002000) /*!< Bit 1 */
mbed_official 392:2b59412bb664 825
mbed_official 392:2b59412bb664 826 #define DMA_CCR_MEM2MEM ((uint32_t)0x00004000) /*!< Memory to memory mode */
mbed_official 392:2b59412bb664 827
mbed_official 392:2b59412bb664 828 /****************** Bit definition for DMA_CNDTR register *******************/
mbed_official 392:2b59412bb664 829 #define DMA_CNDTR_NDT ((uint32_t)0x0000FFFF) /*!< Number of data to Transfer */
mbed_official 392:2b59412bb664 830
mbed_official 392:2b59412bb664 831 /****************** Bit definition for DMA_CPAR register ********************/
mbed_official 392:2b59412bb664 832 #define DMA_CPAR_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
mbed_official 392:2b59412bb664 833
mbed_official 392:2b59412bb664 834 /****************** Bit definition for DMA_CMAR register ********************/
mbed_official 392:2b59412bb664 835 #define DMA_CMAR_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
mbed_official 392:2b59412bb664 836
mbed_official 392:2b59412bb664 837 /******************************************************************************/
mbed_official 392:2b59412bb664 838 /* */
mbed_official 392:2b59412bb664 839 /* External Interrupt/Event Controller (EXTI) */
mbed_official 392:2b59412bb664 840 /* */
mbed_official 392:2b59412bb664 841 /******************************************************************************/
mbed_official 392:2b59412bb664 842 /******************* Bit definition for EXTI_IMR register *******************/
mbed_official 392:2b59412bb664 843 #define EXTI_IMR_MR0 ((uint32_t)0x00000001) /*!< Interrupt Mask on line 0 */
mbed_official 392:2b59412bb664 844 #define EXTI_IMR_MR1 ((uint32_t)0x00000002) /*!< Interrupt Mask on line 1 */
mbed_official 392:2b59412bb664 845 #define EXTI_IMR_MR2 ((uint32_t)0x00000004) /*!< Interrupt Mask on line 2 */
mbed_official 392:2b59412bb664 846 #define EXTI_IMR_MR3 ((uint32_t)0x00000008) /*!< Interrupt Mask on line 3 */
mbed_official 392:2b59412bb664 847 #define EXTI_IMR_MR4 ((uint32_t)0x00000010) /*!< Interrupt Mask on line 4 */
mbed_official 392:2b59412bb664 848 #define EXTI_IMR_MR5 ((uint32_t)0x00000020) /*!< Interrupt Mask on line 5 */
mbed_official 392:2b59412bb664 849 #define EXTI_IMR_MR6 ((uint32_t)0x00000040) /*!< Interrupt Mask on line 6 */
mbed_official 392:2b59412bb664 850 #define EXTI_IMR_MR7 ((uint32_t)0x00000080) /*!< Interrupt Mask on line 7 */
mbed_official 392:2b59412bb664 851 #define EXTI_IMR_MR8 ((uint32_t)0x00000100) /*!< Interrupt Mask on line 8 */
mbed_official 392:2b59412bb664 852 #define EXTI_IMR_MR9 ((uint32_t)0x00000200) /*!< Interrupt Mask on line 9 */
mbed_official 392:2b59412bb664 853 #define EXTI_IMR_MR10 ((uint32_t)0x00000400) /*!< Interrupt Mask on line 10 */
mbed_official 392:2b59412bb664 854 #define EXTI_IMR_MR11 ((uint32_t)0x00000800) /*!< Interrupt Mask on line 11 */
mbed_official 392:2b59412bb664 855 #define EXTI_IMR_MR12 ((uint32_t)0x00001000) /*!< Interrupt Mask on line 12 */
mbed_official 392:2b59412bb664 856 #define EXTI_IMR_MR13 ((uint32_t)0x00002000) /*!< Interrupt Mask on line 13 */
mbed_official 392:2b59412bb664 857 #define EXTI_IMR_MR14 ((uint32_t)0x00004000) /*!< Interrupt Mask on line 14 */
mbed_official 392:2b59412bb664 858 #define EXTI_IMR_MR15 ((uint32_t)0x00008000) /*!< Interrupt Mask on line 15 */
mbed_official 392:2b59412bb664 859 #define EXTI_IMR_MR16 ((uint32_t)0x00010000) /*!< Interrupt Mask on line 16 */
mbed_official 392:2b59412bb664 860 #define EXTI_IMR_MR17 ((uint32_t)0x00020000) /*!< Interrupt Mask on line 17 */
mbed_official 392:2b59412bb664 861 #define EXTI_IMR_MR19 ((uint32_t)0x00080000) /*!< Interrupt Mask on line 19 */
mbed_official 392:2b59412bb664 862 #define EXTI_IMR_MR21 ((uint32_t)0x00200000) /*!< Interrupt Mask on line 21 */
mbed_official 392:2b59412bb664 863 #define EXTI_IMR_MR22 ((uint32_t)0x00400000) /*!< Interrupt Mask on line 22 */
mbed_official 392:2b59412bb664 864 #define EXTI_IMR_MR23 ((uint32_t)0x00800000) /*!< Interrupt Mask on line 23 */
mbed_official 392:2b59412bb664 865 #define EXTI_IMR_MR25 ((uint32_t)0x02000000) /*!< Interrupt Mask on line 25 */
mbed_official 392:2b59412bb664 866 #define EXTI_IMR_MR27 ((uint32_t)0x08000000) /*!< Interrupt Mask on line 27 */
mbed_official 392:2b59412bb664 867
mbed_official 392:2b59412bb664 868 /****************** Bit definition for EXTI_EMR register ********************/
mbed_official 392:2b59412bb664 869 #define EXTI_EMR_MR0 ((uint32_t)0x00000001) /*!< Event Mask on line 0 */
mbed_official 392:2b59412bb664 870 #define EXTI_EMR_MR1 ((uint32_t)0x00000002) /*!< Event Mask on line 1 */
mbed_official 392:2b59412bb664 871 #define EXTI_EMR_MR2 ((uint32_t)0x00000004) /*!< Event Mask on line 2 */
mbed_official 392:2b59412bb664 872 #define EXTI_EMR_MR3 ((uint32_t)0x00000008) /*!< Event Mask on line 3 */
mbed_official 392:2b59412bb664 873 #define EXTI_EMR_MR4 ((uint32_t)0x00000010) /*!< Event Mask on line 4 */
mbed_official 392:2b59412bb664 874 #define EXTI_EMR_MR5 ((uint32_t)0x00000020) /*!< Event Mask on line 5 */
mbed_official 392:2b59412bb664 875 #define EXTI_EMR_MR6 ((uint32_t)0x00000040) /*!< Event Mask on line 6 */
mbed_official 392:2b59412bb664 876 #define EXTI_EMR_MR7 ((uint32_t)0x00000080) /*!< Event Mask on line 7 */
mbed_official 392:2b59412bb664 877 #define EXTI_EMR_MR8 ((uint32_t)0x00000100) /*!< Event Mask on line 8 */
mbed_official 392:2b59412bb664 878 #define EXTI_EMR_MR9 ((uint32_t)0x00000200) /*!< Event Mask on line 9 */
mbed_official 392:2b59412bb664 879 #define EXTI_EMR_MR10 ((uint32_t)0x00000400) /*!< Event Mask on line 10 */
mbed_official 392:2b59412bb664 880 #define EXTI_EMR_MR11 ((uint32_t)0x00000800) /*!< Event Mask on line 11 */
mbed_official 392:2b59412bb664 881 #define EXTI_EMR_MR12 ((uint32_t)0x00001000) /*!< Event Mask on line 12 */
mbed_official 392:2b59412bb664 882 #define EXTI_EMR_MR13 ((uint32_t)0x00002000) /*!< Event Mask on line 13 */
mbed_official 392:2b59412bb664 883 #define EXTI_EMR_MR14 ((uint32_t)0x00004000) /*!< Event Mask on line 14 */
mbed_official 392:2b59412bb664 884 #define EXTI_EMR_MR15 ((uint32_t)0x00008000) /*!< Event Mask on line 15 */
mbed_official 392:2b59412bb664 885 #define EXTI_EMR_MR16 ((uint32_t)0x00010000) /*!< Event Mask on line 16 */
mbed_official 392:2b59412bb664 886 #define EXTI_EMR_MR17 ((uint32_t)0x00020000) /*!< Event Mask on line 17 */
mbed_official 392:2b59412bb664 887 #define EXTI_EMR_MR19 ((uint32_t)0x00080000) /*!< Event Mask on line 19 */
mbed_official 392:2b59412bb664 888 #define EXTI_EMR_MR21 ((uint32_t)0x00200000) /*!< Event Mask on line 21 */
mbed_official 392:2b59412bb664 889 #define EXTI_EMR_MR22 ((uint32_t)0x00400000) /*!< Event Mask on line 22 */
mbed_official 392:2b59412bb664 890 #define EXTI_EMR_MR23 ((uint32_t)0x00800000) /*!< Event Mask on line 23 */
mbed_official 392:2b59412bb664 891 #define EXTI_EMR_MR25 ((uint32_t)0x02000000) /*!< Event Mask on line 25 */
mbed_official 392:2b59412bb664 892 #define EXTI_EMR_MR27 ((uint32_t)0x08000000) /*!< Event Mask on line 27 */
mbed_official 392:2b59412bb664 893
mbed_official 392:2b59412bb664 894 /******************* Bit definition for EXTI_RTSR register ******************/
mbed_official 392:2b59412bb664 895 #define EXTI_RTSR_TR0 ((uint32_t)0x00000001) /*!< Rising trigger event configuration bit of line 0 */
mbed_official 392:2b59412bb664 896 #define EXTI_RTSR_TR1 ((uint32_t)0x00000002) /*!< Rising trigger event configuration bit of line 1 */
mbed_official 392:2b59412bb664 897 #define EXTI_RTSR_TR2 ((uint32_t)0x00000004) /*!< Rising trigger event configuration bit of line 2 */
mbed_official 392:2b59412bb664 898 #define EXTI_RTSR_TR3 ((uint32_t)0x00000008) /*!< Rising trigger event configuration bit of line 3 */
mbed_official 392:2b59412bb664 899 #define EXTI_RTSR_TR4 ((uint32_t)0x00000010) /*!< Rising trigger event configuration bit of line 4 */
mbed_official 392:2b59412bb664 900 #define EXTI_RTSR_TR5 ((uint32_t)0x00000020) /*!< Rising trigger event configuration bit of line 5 */
mbed_official 392:2b59412bb664 901 #define EXTI_RTSR_TR6 ((uint32_t)0x00000040) /*!< Rising trigger event configuration bit of line 6 */
mbed_official 392:2b59412bb664 902 #define EXTI_RTSR_TR7 ((uint32_t)0x00000080) /*!< Rising trigger event configuration bit of line 7 */
mbed_official 392:2b59412bb664 903 #define EXTI_RTSR_TR8 ((uint32_t)0x00000100) /*!< Rising trigger event configuration bit of line 8 */
mbed_official 392:2b59412bb664 904 #define EXTI_RTSR_TR9 ((uint32_t)0x00000200) /*!< Rising trigger event configuration bit of line 9 */
mbed_official 392:2b59412bb664 905 #define EXTI_RTSR_TR10 ((uint32_t)0x00000400) /*!< Rising trigger event configuration bit of line 10 */
mbed_official 392:2b59412bb664 906 #define EXTI_RTSR_TR11 ((uint32_t)0x00000800) /*!< Rising trigger event configuration bit of line 11 */
mbed_official 392:2b59412bb664 907 #define EXTI_RTSR_TR12 ((uint32_t)0x00001000) /*!< Rising trigger event configuration bit of line 12 */
mbed_official 392:2b59412bb664 908 #define EXTI_RTSR_TR13 ((uint32_t)0x00002000) /*!< Rising trigger event configuration bit of line 13 */
mbed_official 392:2b59412bb664 909 #define EXTI_RTSR_TR14 ((uint32_t)0x00004000) /*!< Rising trigger event configuration bit of line 14 */
mbed_official 392:2b59412bb664 910 #define EXTI_RTSR_TR15 ((uint32_t)0x00008000) /*!< Rising trigger event configuration bit of line 15 */
mbed_official 392:2b59412bb664 911 #define EXTI_RTSR_TR16 ((uint32_t)0x00010000) /*!< Rising trigger event configuration bit of line 16 */
mbed_official 392:2b59412bb664 912 #define EXTI_RTSR_TR17 ((uint32_t)0x00020000) /*!< Rising trigger event configuration bit of line 17 */
mbed_official 392:2b59412bb664 913 #define EXTI_RTSR_TR19 ((uint32_t)0x00080000) /*!< Rising trigger event configuration bit of line 19 */
mbed_official 392:2b59412bb664 914
mbed_official 392:2b59412bb664 915 /******************* Bit definition for EXTI_FTSR register *******************/
mbed_official 392:2b59412bb664 916 #define EXTI_FTSR_TR0 ((uint32_t)0x00000001) /*!< Falling trigger event configuration bit of line 0 */
mbed_official 392:2b59412bb664 917 #define EXTI_FTSR_TR1 ((uint32_t)0x00000002) /*!< Falling trigger event configuration bit of line 1 */
mbed_official 392:2b59412bb664 918 #define EXTI_FTSR_TR2 ((uint32_t)0x00000004) /*!< Falling trigger event configuration bit of line 2 */
mbed_official 392:2b59412bb664 919 #define EXTI_FTSR_TR3 ((uint32_t)0x00000008) /*!< Falling trigger event configuration bit of line 3 */
mbed_official 392:2b59412bb664 920 #define EXTI_FTSR_TR4 ((uint32_t)0x00000010) /*!< Falling trigger event configuration bit of line 4 */
mbed_official 392:2b59412bb664 921 #define EXTI_FTSR_TR5 ((uint32_t)0x00000020) /*!< Falling trigger event configuration bit of line 5 */
mbed_official 392:2b59412bb664 922 #define EXTI_FTSR_TR6 ((uint32_t)0x00000040) /*!< Falling trigger event configuration bit of line 6 */
mbed_official 392:2b59412bb664 923 #define EXTI_FTSR_TR7 ((uint32_t)0x00000080) /*!< Falling trigger event configuration bit of line 7 */
mbed_official 392:2b59412bb664 924 #define EXTI_FTSR_TR8 ((uint32_t)0x00000100) /*!< Falling trigger event configuration bit of line 8 */
mbed_official 392:2b59412bb664 925 #define EXTI_FTSR_TR9 ((uint32_t)0x00000200) /*!< Falling trigger event configuration bit of line 9 */
mbed_official 392:2b59412bb664 926 #define EXTI_FTSR_TR10 ((uint32_t)0x00000400) /*!< Falling trigger event configuration bit of line 10 */
mbed_official 392:2b59412bb664 927 #define EXTI_FTSR_TR11 ((uint32_t)0x00000800) /*!< Falling trigger event configuration bit of line 11 */
mbed_official 392:2b59412bb664 928 #define EXTI_FTSR_TR12 ((uint32_t)0x00001000) /*!< Falling trigger event configuration bit of line 12 */
mbed_official 392:2b59412bb664 929 #define EXTI_FTSR_TR13 ((uint32_t)0x00002000) /*!< Falling trigger event configuration bit of line 13 */
mbed_official 392:2b59412bb664 930 #define EXTI_FTSR_TR14 ((uint32_t)0x00004000) /*!< Falling trigger event configuration bit of line 14 */
mbed_official 392:2b59412bb664 931 #define EXTI_FTSR_TR15 ((uint32_t)0x00008000) /*!< Falling trigger event configuration bit of line 15 */
mbed_official 392:2b59412bb664 932 #define EXTI_FTSR_TR16 ((uint32_t)0x00010000) /*!< Falling trigger event configuration bit of line 16 */
mbed_official 392:2b59412bb664 933 #define EXTI_FTSR_TR17 ((uint32_t)0x00020000) /*!< Falling trigger event configuration bit of line 17 */
mbed_official 392:2b59412bb664 934 #define EXTI_FTSR_TR19 ((uint32_t)0x00080000) /*!< Falling trigger event configuration bit of line 19 */
mbed_official 392:2b59412bb664 935
mbed_official 392:2b59412bb664 936 /******************* Bit definition for EXTI_SWIER register *******************/
mbed_official 392:2b59412bb664 937 #define EXTI_SWIER_SWIER0 ((uint32_t)0x00000001) /*!< Software Interrupt on line 0 */
mbed_official 392:2b59412bb664 938 #define EXTI_SWIER_SWIER1 ((uint32_t)0x00000002) /*!< Software Interrupt on line 1 */
mbed_official 392:2b59412bb664 939 #define EXTI_SWIER_SWIER2 ((uint32_t)0x00000004) /*!< Software Interrupt on line 2 */
mbed_official 392:2b59412bb664 940 #define EXTI_SWIER_SWIER3 ((uint32_t)0x00000008) /*!< Software Interrupt on line 3 */
mbed_official 392:2b59412bb664 941 #define EXTI_SWIER_SWIER4 ((uint32_t)0x00000010) /*!< Software Interrupt on line 4 */
mbed_official 392:2b59412bb664 942 #define EXTI_SWIER_SWIER5 ((uint32_t)0x00000020) /*!< Software Interrupt on line 5 */
mbed_official 392:2b59412bb664 943 #define EXTI_SWIER_SWIER6 ((uint32_t)0x00000040) /*!< Software Interrupt on line 6 */
mbed_official 392:2b59412bb664 944 #define EXTI_SWIER_SWIER7 ((uint32_t)0x00000080) /*!< Software Interrupt on line 7 */
mbed_official 392:2b59412bb664 945 #define EXTI_SWIER_SWIER8 ((uint32_t)0x00000100) /*!< Software Interrupt on line 8 */
mbed_official 392:2b59412bb664 946 #define EXTI_SWIER_SWIER9 ((uint32_t)0x00000200) /*!< Software Interrupt on line 9 */
mbed_official 392:2b59412bb664 947 #define EXTI_SWIER_SWIER10 ((uint32_t)0x00000400) /*!< Software Interrupt on line 10 */
mbed_official 392:2b59412bb664 948 #define EXTI_SWIER_SWIER11 ((uint32_t)0x00000800) /*!< Software Interrupt on line 11 */
mbed_official 392:2b59412bb664 949 #define EXTI_SWIER_SWIER12 ((uint32_t)0x00001000) /*!< Software Interrupt on line 12 */
mbed_official 392:2b59412bb664 950 #define EXTI_SWIER_SWIER13 ((uint32_t)0x00002000) /*!< Software Interrupt on line 13 */
mbed_official 392:2b59412bb664 951 #define EXTI_SWIER_SWIER14 ((uint32_t)0x00004000) /*!< Software Interrupt on line 14 */
mbed_official 392:2b59412bb664 952 #define EXTI_SWIER_SWIER15 ((uint32_t)0x00008000) /*!< Software Interrupt on line 15 */
mbed_official 392:2b59412bb664 953 #define EXTI_SWIER_SWIER16 ((uint32_t)0x00010000) /*!< Software Interrupt on line 16 */
mbed_official 392:2b59412bb664 954 #define EXTI_SWIER_SWIER17 ((uint32_t)0x00020000) /*!< Software Interrupt on line 17 */
mbed_official 392:2b59412bb664 955 #define EXTI_SWIER_SWIER19 ((uint32_t)0x00080000) /*!< Software Interrupt on line 19 */
mbed_official 392:2b59412bb664 956
mbed_official 392:2b59412bb664 957 /****************** Bit definition for EXTI_PR register *********************/
mbed_official 392:2b59412bb664 958 #define EXTI_PR_PR0 ((uint32_t)0x00000001) /*!< Pending bit 0 */
mbed_official 392:2b59412bb664 959 #define EXTI_PR_PR1 ((uint32_t)0x00000002) /*!< Pending bit 1 */
mbed_official 392:2b59412bb664 960 #define EXTI_PR_PR2 ((uint32_t)0x00000004) /*!< Pending bit 2 */
mbed_official 392:2b59412bb664 961 #define EXTI_PR_PR3 ((uint32_t)0x00000008) /*!< Pending bit 3 */
mbed_official 392:2b59412bb664 962 #define EXTI_PR_PR4 ((uint32_t)0x00000010) /*!< Pending bit 4 */
mbed_official 392:2b59412bb664 963 #define EXTI_PR_PR5 ((uint32_t)0x00000020) /*!< Pending bit 5 */
mbed_official 392:2b59412bb664 964 #define EXTI_PR_PR6 ((uint32_t)0x00000040) /*!< Pending bit 6 */
mbed_official 392:2b59412bb664 965 #define EXTI_PR_PR7 ((uint32_t)0x00000080) /*!< Pending bit 7 */
mbed_official 392:2b59412bb664 966 #define EXTI_PR_PR8 ((uint32_t)0x00000100) /*!< Pending bit 8 */
mbed_official 392:2b59412bb664 967 #define EXTI_PR_PR9 ((uint32_t)0x00000200) /*!< Pending bit 9 */
mbed_official 392:2b59412bb664 968 #define EXTI_PR_PR10 ((uint32_t)0x00000400) /*!< Pending bit 10 */
mbed_official 392:2b59412bb664 969 #define EXTI_PR_PR11 ((uint32_t)0x00000800) /*!< Pending bit 11 */
mbed_official 392:2b59412bb664 970 #define EXTI_PR_PR12 ((uint32_t)0x00001000) /*!< Pending bit 12 */
mbed_official 392:2b59412bb664 971 #define EXTI_PR_PR13 ((uint32_t)0x00002000) /*!< Pending bit 13 */
mbed_official 392:2b59412bb664 972 #define EXTI_PR_PR14 ((uint32_t)0x00004000) /*!< Pending bit 14 */
mbed_official 392:2b59412bb664 973 #define EXTI_PR_PR15 ((uint32_t)0x00008000) /*!< Pending bit 15 */
mbed_official 392:2b59412bb664 974 #define EXTI_PR_PR16 ((uint32_t)0x00010000) /*!< Pending bit 16 */
mbed_official 392:2b59412bb664 975 #define EXTI_PR_PR17 ((uint32_t)0x00020000) /*!< Pending bit 17 */
mbed_official 392:2b59412bb664 976 #define EXTI_PR_PR19 ((uint32_t)0x00080000) /*!< Pending bit 19 */
mbed_official 392:2b59412bb664 977
mbed_official 392:2b59412bb664 978 /******************************************************************************/
mbed_official 392:2b59412bb664 979 /* */
mbed_official 392:2b59412bb664 980 /* FLASH and Option Bytes Registers */
mbed_official 392:2b59412bb664 981 /* */
mbed_official 392:2b59412bb664 982 /******************************************************************************/
mbed_official 392:2b59412bb664 983
mbed_official 392:2b59412bb664 984 /******************* Bit definition for FLASH_ACR register ******************/
mbed_official 392:2b59412bb664 985 #define FLASH_ACR_LATENCY ((uint32_t)0x00000001) /*!< LATENCY bit (Latency) */
mbed_official 392:2b59412bb664 986
mbed_official 392:2b59412bb664 987 #define FLASH_ACR_PRFTBE ((uint32_t)0x00000010) /*!< Prefetch Buffer Enable */
mbed_official 392:2b59412bb664 988 #define FLASH_ACR_PRFTBS ((uint32_t)0x00000020) /*!< Prefetch Buffer Status */
mbed_official 392:2b59412bb664 989
mbed_official 392:2b59412bb664 990 /****************** Bit definition for FLASH_KEYR register ******************/
mbed_official 392:2b59412bb664 991 #define FLASH_KEYR_FKEYR ((uint32_t)0xFFFFFFFF) /*!< FPEC Key */
mbed_official 392:2b59412bb664 992
mbed_official 392:2b59412bb664 993 /***************** Bit definition for FLASH_OPTKEYR register ****************/
mbed_official 392:2b59412bb664 994 #define FLASH_OPTKEYR_OPTKEYR ((uint32_t)0xFFFFFFFF) /*!< Option Byte Key */
mbed_official 392:2b59412bb664 995
mbed_official 392:2b59412bb664 996 /****************** FLASH Keys **********************************************/
mbed_official 392:2b59412bb664 997 #define FLASH_FKEY1 ((uint32_t)0x45670123) /*!< Flash program erase key1 */
mbed_official 392:2b59412bb664 998 #define FLASH_FKEY2 ((uint32_t)0xCDEF89AB) /*!< Flash program erase key2: used with FLASH_PEKEY1
mbed_official 392:2b59412bb664 999 to unlock the write access to the FPEC. */
mbed_official 392:2b59412bb664 1000
mbed_official 392:2b59412bb664 1001 #define FLASH_OPTKEY1 ((uint32_t)0x45670123) /*!< Flash option key1 */
mbed_official 392:2b59412bb664 1002 #define FLASH_OPTKEY2 ((uint32_t)0xCDEF89AB) /*!< Flash option key2: used with FLASH_OPTKEY1 to
mbed_official 392:2b59412bb664 1003 unlock the write access to the option byte block */
mbed_official 392:2b59412bb664 1004
mbed_official 392:2b59412bb664 1005 /****************** Bit definition for FLASH_SR register *******************/
mbed_official 392:2b59412bb664 1006 #define FLASH_SR_BSY ((uint32_t)0x00000001) /*!< Busy */
mbed_official 392:2b59412bb664 1007 #define FLASH_SR_PGERR ((uint32_t)0x00000004) /*!< Programming Error */
mbed_official 392:2b59412bb664 1008 #define FLASH_SR_WRPRTERR ((uint32_t)0x00000010) /*!< Write Protection Error */
mbed_official 392:2b59412bb664 1009 #define FLASH_SR_EOP ((uint32_t)0x00000020) /*!< End of operation */
mbed_official 392:2b59412bb664 1010 #define FLASH_SR_WRPERR FLASH_SR_WRPRTERR /*!< Legacy of Write Protection Error */
mbed_official 392:2b59412bb664 1011
mbed_official 392:2b59412bb664 1012 /******************* Bit definition for FLASH_CR register *******************/
mbed_official 392:2b59412bb664 1013 #define FLASH_CR_PG ((uint32_t)0x00000001) /*!< Programming */
mbed_official 392:2b59412bb664 1014 #define FLASH_CR_PER ((uint32_t)0x00000002) /*!< Page Erase */
mbed_official 392:2b59412bb664 1015 #define FLASH_CR_MER ((uint32_t)0x00000004) /*!< Mass Erase */
mbed_official 392:2b59412bb664 1016 #define FLASH_CR_OPTPG ((uint32_t)0x00000010) /*!< Option Byte Programming */
mbed_official 392:2b59412bb664 1017 #define FLASH_CR_OPTER ((uint32_t)0x00000020) /*!< Option Byte Erase */
mbed_official 392:2b59412bb664 1018 #define FLASH_CR_STRT ((uint32_t)0x00000040) /*!< Start */
mbed_official 392:2b59412bb664 1019 #define FLASH_CR_LOCK ((uint32_t)0x00000080) /*!< Lock */
mbed_official 392:2b59412bb664 1020 #define FLASH_CR_OPTWRE ((uint32_t)0x00000200) /*!< Option Bytes Write Enable */
mbed_official 392:2b59412bb664 1021 #define FLASH_CR_ERRIE ((uint32_t)0x00000400) /*!< Error Interrupt Enable */
mbed_official 392:2b59412bb664 1022 #define FLASH_CR_EOPIE ((uint32_t)0x00001000) /*!< End of operation interrupt enable */
mbed_official 392:2b59412bb664 1023 #define FLASH_CR_OBL_LAUNCH ((uint32_t)0x00002000) /*!< Option Bytes Loader Launch */
mbed_official 392:2b59412bb664 1024
mbed_official 392:2b59412bb664 1025 /******************* Bit definition for FLASH_AR register *******************/
mbed_official 392:2b59412bb664 1026 #define FLASH_AR_FAR ((uint32_t)0xFFFFFFFF) /*!< Flash Address */
mbed_official 392:2b59412bb664 1027
mbed_official 392:2b59412bb664 1028 /****************** Bit definition for FLASH_OBR register *******************/
mbed_official 392:2b59412bb664 1029 #define FLASH_OBR_OPTERR ((uint32_t)0x00000001) /*!< Option Byte Error */
mbed_official 392:2b59412bb664 1030 #define FLASH_OBR_RDPRT1 ((uint32_t)0x00000002) /*!< Read protection Level 1 */
mbed_official 392:2b59412bb664 1031 #define FLASH_OBR_RDPRT2 ((uint32_t)0x00000004) /*!< Read protection Level 2 */
mbed_official 392:2b59412bb664 1032
mbed_official 392:2b59412bb664 1033 #define FLASH_OBR_USER ((uint32_t)0x00003700) /*!< User Option Bytes */
mbed_official 392:2b59412bb664 1034 #define FLASH_OBR_IWDG_SW ((uint32_t)0x00000100) /*!< IWDG SW */
mbed_official 392:2b59412bb664 1035 #define FLASH_OBR_nRST_STOP ((uint32_t)0x00000200) /*!< nRST_STOP */
mbed_official 392:2b59412bb664 1036 #define FLASH_OBR_nRST_STDBY ((uint32_t)0x00000400) /*!< nRST_STDBY */
mbed_official 392:2b59412bb664 1037 #define FLASH_OBR_nBOOT1 ((uint32_t)0x00001000) /*!< nBOOT1 */
mbed_official 392:2b59412bb664 1038 #define FLASH_OBR_VDDA_MONITOR ((uint32_t)0x00002000) /*!< VDDA power supply supervisor */
mbed_official 392:2b59412bb664 1039
mbed_official 392:2b59412bb664 1040 /* Old BOOT1 bit definition, maintained for legacy purpose */
mbed_official 392:2b59412bb664 1041 #define FLASH_OBR_BOOT1 FLASH_OBR_nBOOT1
mbed_official 392:2b59412bb664 1042
mbed_official 392:2b59412bb664 1043 /* Old OBR_VDDA bit definition, maintained for legacy purpose */
mbed_official 392:2b59412bb664 1044 #define FLASH_OBR_VDDA_ANALOG FLASH_OBR_VDDA_MONITOR
mbed_official 392:2b59412bb664 1045
mbed_official 392:2b59412bb664 1046 /****************** Bit definition for FLASH_WRPR register ******************/
mbed_official 392:2b59412bb664 1047 #define FLASH_WRPR_WRP ((uint32_t)0x0000FFFF) /*!< Write Protect */
mbed_official 392:2b59412bb664 1048
mbed_official 392:2b59412bb664 1049 /*----------------------------------------------------------------------------*/
mbed_official 392:2b59412bb664 1050
mbed_official 392:2b59412bb664 1051 /****************** Bit definition for OB_RDP register **********************/
mbed_official 392:2b59412bb664 1052 #define OB_RDP_RDP ((uint32_t)0x000000FF) /*!< Read protection option byte */
mbed_official 392:2b59412bb664 1053 #define OB_RDP_nRDP ((uint32_t)0x0000FF00) /*!< Read protection complemented option byte */
mbed_official 392:2b59412bb664 1054
mbed_official 392:2b59412bb664 1055 /****************** Bit definition for OB_USER register *********************/
mbed_official 392:2b59412bb664 1056 #define OB_USER_USER ((uint32_t)0x00FF0000) /*!< User option byte */
mbed_official 392:2b59412bb664 1057 #define OB_USER_nUSER ((uint32_t)0xFF000000) /*!< User complemented option byte */
mbed_official 392:2b59412bb664 1058
mbed_official 392:2b59412bb664 1059 /****************** Bit definition for OB_WRP0 register *********************/
mbed_official 392:2b59412bb664 1060 #define OB_WRP0_WRP0 ((uint32_t)0x000000FF) /*!< Flash memory write protection option bytes */
mbed_official 392:2b59412bb664 1061 #define OB_WRP0_nWRP0 ((uint32_t)0x0000FF00) /*!< Flash memory write protection complemented option bytes */
mbed_official 392:2b59412bb664 1062
mbed_official 392:2b59412bb664 1063 /****************** Bit definition for OB_WRP1 register *********************/
mbed_official 392:2b59412bb664 1064 #define OB_WRP1_WRP1 ((uint32_t)0x00FF0000) /*!< Flash memory write protection option bytes */
mbed_official 392:2b59412bb664 1065 #define OB_WRP1_nWRP1 ((uint32_t)0xFF000000) /*!< Flash memory write protection complemented option bytes */
mbed_official 392:2b59412bb664 1066
mbed_official 392:2b59412bb664 1067 /******************************************************************************/
mbed_official 392:2b59412bb664 1068 /* */
mbed_official 392:2b59412bb664 1069 /* General Purpose IOs (GPIO) */
mbed_official 392:2b59412bb664 1070 /* */
mbed_official 392:2b59412bb664 1071 /******************************************************************************/
mbed_official 392:2b59412bb664 1072 /******************* Bit definition for GPIO_MODER register *****************/
mbed_official 392:2b59412bb664 1073 #define GPIO_MODER_MODER0 ((uint32_t)0x00000003)
mbed_official 392:2b59412bb664 1074 #define GPIO_MODER_MODER0_0 ((uint32_t)0x00000001)
mbed_official 392:2b59412bb664 1075 #define GPIO_MODER_MODER0_1 ((uint32_t)0x00000002)
mbed_official 392:2b59412bb664 1076 #define GPIO_MODER_MODER1 ((uint32_t)0x0000000C)
mbed_official 392:2b59412bb664 1077 #define GPIO_MODER_MODER1_0 ((uint32_t)0x00000004)
mbed_official 392:2b59412bb664 1078 #define GPIO_MODER_MODER1_1 ((uint32_t)0x00000008)
mbed_official 392:2b59412bb664 1079 #define GPIO_MODER_MODER2 ((uint32_t)0x00000030)
mbed_official 392:2b59412bb664 1080 #define GPIO_MODER_MODER2_0 ((uint32_t)0x00000010)
mbed_official 392:2b59412bb664 1081 #define GPIO_MODER_MODER2_1 ((uint32_t)0x00000020)
mbed_official 392:2b59412bb664 1082 #define GPIO_MODER_MODER3 ((uint32_t)0x000000C0)
mbed_official 392:2b59412bb664 1083 #define GPIO_MODER_MODER3_0 ((uint32_t)0x00000040)
mbed_official 392:2b59412bb664 1084 #define GPIO_MODER_MODER3_1 ((uint32_t)0x00000080)
mbed_official 392:2b59412bb664 1085 #define GPIO_MODER_MODER4 ((uint32_t)0x00000300)
mbed_official 392:2b59412bb664 1086 #define GPIO_MODER_MODER4_0 ((uint32_t)0x00000100)
mbed_official 392:2b59412bb664 1087 #define GPIO_MODER_MODER4_1 ((uint32_t)0x00000200)
mbed_official 392:2b59412bb664 1088 #define GPIO_MODER_MODER5 ((uint32_t)0x00000C00)
mbed_official 392:2b59412bb664 1089 #define GPIO_MODER_MODER5_0 ((uint32_t)0x00000400)
mbed_official 392:2b59412bb664 1090 #define GPIO_MODER_MODER5_1 ((uint32_t)0x00000800)
mbed_official 392:2b59412bb664 1091 #define GPIO_MODER_MODER6 ((uint32_t)0x00003000)
mbed_official 392:2b59412bb664 1092 #define GPIO_MODER_MODER6_0 ((uint32_t)0x00001000)
mbed_official 392:2b59412bb664 1093 #define GPIO_MODER_MODER6_1 ((uint32_t)0x00002000)
mbed_official 392:2b59412bb664 1094 #define GPIO_MODER_MODER7 ((uint32_t)0x0000C000)
mbed_official 392:2b59412bb664 1095 #define GPIO_MODER_MODER7_0 ((uint32_t)0x00004000)
mbed_official 392:2b59412bb664 1096 #define GPIO_MODER_MODER7_1 ((uint32_t)0x00008000)
mbed_official 392:2b59412bb664 1097 #define GPIO_MODER_MODER8 ((uint32_t)0x00030000)
mbed_official 392:2b59412bb664 1098 #define GPIO_MODER_MODER8_0 ((uint32_t)0x00010000)
mbed_official 392:2b59412bb664 1099 #define GPIO_MODER_MODER8_1 ((uint32_t)0x00020000)
mbed_official 392:2b59412bb664 1100 #define GPIO_MODER_MODER9 ((uint32_t)0x000C0000)
mbed_official 392:2b59412bb664 1101 #define GPIO_MODER_MODER9_0 ((uint32_t)0x00040000)
mbed_official 392:2b59412bb664 1102 #define GPIO_MODER_MODER9_1 ((uint32_t)0x00080000)
mbed_official 392:2b59412bb664 1103 #define GPIO_MODER_MODER10 ((uint32_t)0x00300000)
mbed_official 392:2b59412bb664 1104 #define GPIO_MODER_MODER10_0 ((uint32_t)0x00100000)
mbed_official 392:2b59412bb664 1105 #define GPIO_MODER_MODER10_1 ((uint32_t)0x00200000)
mbed_official 392:2b59412bb664 1106 #define GPIO_MODER_MODER11 ((uint32_t)0x00C00000)
mbed_official 392:2b59412bb664 1107 #define GPIO_MODER_MODER11_0 ((uint32_t)0x00400000)
mbed_official 392:2b59412bb664 1108 #define GPIO_MODER_MODER11_1 ((uint32_t)0x00800000)
mbed_official 392:2b59412bb664 1109 #define GPIO_MODER_MODER12 ((uint32_t)0x03000000)
mbed_official 392:2b59412bb664 1110 #define GPIO_MODER_MODER12_0 ((uint32_t)0x01000000)
mbed_official 392:2b59412bb664 1111 #define GPIO_MODER_MODER12_1 ((uint32_t)0x02000000)
mbed_official 392:2b59412bb664 1112 #define GPIO_MODER_MODER13 ((uint32_t)0x0C000000)
mbed_official 392:2b59412bb664 1113 #define GPIO_MODER_MODER13_0 ((uint32_t)0x04000000)
mbed_official 392:2b59412bb664 1114 #define GPIO_MODER_MODER13_1 ((uint32_t)0x08000000)
mbed_official 392:2b59412bb664 1115 #define GPIO_MODER_MODER14 ((uint32_t)0x30000000)
mbed_official 392:2b59412bb664 1116 #define GPIO_MODER_MODER14_0 ((uint32_t)0x10000000)
mbed_official 392:2b59412bb664 1117 #define GPIO_MODER_MODER14_1 ((uint32_t)0x20000000)
mbed_official 392:2b59412bb664 1118 #define GPIO_MODER_MODER15 ((uint32_t)0xC0000000)
mbed_official 392:2b59412bb664 1119 #define GPIO_MODER_MODER15_0 ((uint32_t)0x40000000)
mbed_official 392:2b59412bb664 1120 #define GPIO_MODER_MODER15_1 ((uint32_t)0x80000000)
mbed_official 392:2b59412bb664 1121
mbed_official 392:2b59412bb664 1122 /****************** Bit definition for GPIO_OTYPER register *****************/
mbed_official 392:2b59412bb664 1123 #define GPIO_OTYPER_OT_0 ((uint32_t)0x00000001)
mbed_official 392:2b59412bb664 1124 #define GPIO_OTYPER_OT_1 ((uint32_t)0x00000002)
mbed_official 392:2b59412bb664 1125 #define GPIO_OTYPER_OT_2 ((uint32_t)0x00000004)
mbed_official 392:2b59412bb664 1126 #define GPIO_OTYPER_OT_3 ((uint32_t)0x00000008)
mbed_official 392:2b59412bb664 1127 #define GPIO_OTYPER_OT_4 ((uint32_t)0x00000010)
mbed_official 392:2b59412bb664 1128 #define GPIO_OTYPER_OT_5 ((uint32_t)0x00000020)
mbed_official 392:2b59412bb664 1129 #define GPIO_OTYPER_OT_6 ((uint32_t)0x00000040)
mbed_official 392:2b59412bb664 1130 #define GPIO_OTYPER_OT_7 ((uint32_t)0x00000080)
mbed_official 392:2b59412bb664 1131 #define GPIO_OTYPER_OT_8 ((uint32_t)0x00000100)
mbed_official 392:2b59412bb664 1132 #define GPIO_OTYPER_OT_9 ((uint32_t)0x00000200)
mbed_official 392:2b59412bb664 1133 #define GPIO_OTYPER_OT_10 ((uint32_t)0x00000400)
mbed_official 392:2b59412bb664 1134 #define GPIO_OTYPER_OT_11 ((uint32_t)0x00000800)
mbed_official 392:2b59412bb664 1135 #define GPIO_OTYPER_OT_12 ((uint32_t)0x00001000)
mbed_official 392:2b59412bb664 1136 #define GPIO_OTYPER_OT_13 ((uint32_t)0x00002000)
mbed_official 392:2b59412bb664 1137 #define GPIO_OTYPER_OT_14 ((uint32_t)0x00004000)
mbed_official 392:2b59412bb664 1138 #define GPIO_OTYPER_OT_15 ((uint32_t)0x00008000)
mbed_official 392:2b59412bb664 1139
mbed_official 392:2b59412bb664 1140 /**************** Bit definition for GPIO_OSPEEDR register ******************/
mbed_official 392:2b59412bb664 1141 #define GPIO_OSPEEDR_OSPEEDR0 ((uint32_t)0x00000003)
mbed_official 392:2b59412bb664 1142 #define GPIO_OSPEEDR_OSPEEDR0_0 ((uint32_t)0x00000001)
mbed_official 392:2b59412bb664 1143 #define GPIO_OSPEEDR_OSPEEDR0_1 ((uint32_t)0x00000002)
mbed_official 392:2b59412bb664 1144 #define GPIO_OSPEEDR_OSPEEDR1 ((uint32_t)0x0000000C)
mbed_official 392:2b59412bb664 1145 #define GPIO_OSPEEDR_OSPEEDR1_0 ((uint32_t)0x00000004)
mbed_official 392:2b59412bb664 1146 #define GPIO_OSPEEDR_OSPEEDR1_1 ((uint32_t)0x00000008)
mbed_official 392:2b59412bb664 1147 #define GPIO_OSPEEDR_OSPEEDR2 ((uint32_t)0x00000030)
mbed_official 392:2b59412bb664 1148 #define GPIO_OSPEEDR_OSPEEDR2_0 ((uint32_t)0x00000010)
mbed_official 392:2b59412bb664 1149 #define GPIO_OSPEEDR_OSPEEDR2_1 ((uint32_t)0x00000020)
mbed_official 392:2b59412bb664 1150 #define GPIO_OSPEEDR_OSPEEDR3 ((uint32_t)0x000000C0)
mbed_official 392:2b59412bb664 1151 #define GPIO_OSPEEDR_OSPEEDR3_0 ((uint32_t)0x00000040)
mbed_official 392:2b59412bb664 1152 #define GPIO_OSPEEDR_OSPEEDR3_1 ((uint32_t)0x00000080)
mbed_official 392:2b59412bb664 1153 #define GPIO_OSPEEDR_OSPEEDR4 ((uint32_t)0x00000300)
mbed_official 392:2b59412bb664 1154 #define GPIO_OSPEEDR_OSPEEDR4_0 ((uint32_t)0x00000100)
mbed_official 392:2b59412bb664 1155 #define GPIO_OSPEEDR_OSPEEDR4_1 ((uint32_t)0x00000200)
mbed_official 392:2b59412bb664 1156 #define GPIO_OSPEEDR_OSPEEDR5 ((uint32_t)0x00000C00)
mbed_official 392:2b59412bb664 1157 #define GPIO_OSPEEDR_OSPEEDR5_0 ((uint32_t)0x00000400)
mbed_official 392:2b59412bb664 1158 #define GPIO_OSPEEDR_OSPEEDR5_1 ((uint32_t)0x00000800)
mbed_official 392:2b59412bb664 1159 #define GPIO_OSPEEDR_OSPEEDR6 ((uint32_t)0x00003000)
mbed_official 392:2b59412bb664 1160 #define GPIO_OSPEEDR_OSPEEDR6_0 ((uint32_t)0x00001000)
mbed_official 392:2b59412bb664 1161 #define GPIO_OSPEEDR_OSPEEDR6_1 ((uint32_t)0x00002000)
mbed_official 392:2b59412bb664 1162 #define GPIO_OSPEEDR_OSPEEDR7 ((uint32_t)0x0000C000)
mbed_official 392:2b59412bb664 1163 #define GPIO_OSPEEDR_OSPEEDR7_0 ((uint32_t)0x00004000)
mbed_official 392:2b59412bb664 1164 #define GPIO_OSPEEDR_OSPEEDR7_1 ((uint32_t)0x00008000)
mbed_official 392:2b59412bb664 1165 #define GPIO_OSPEEDR_OSPEEDR8 ((uint32_t)0x00030000)
mbed_official 392:2b59412bb664 1166 #define GPIO_OSPEEDR_OSPEEDR8_0 ((uint32_t)0x00010000)
mbed_official 392:2b59412bb664 1167 #define GPIO_OSPEEDR_OSPEEDR8_1 ((uint32_t)0x00020000)
mbed_official 392:2b59412bb664 1168 #define GPIO_OSPEEDR_OSPEEDR9 ((uint32_t)0x000C0000)
mbed_official 392:2b59412bb664 1169 #define GPIO_OSPEEDR_OSPEEDR9_0 ((uint32_t)0x00040000)
mbed_official 392:2b59412bb664 1170 #define GPIO_OSPEEDR_OSPEEDR9_1 ((uint32_t)0x00080000)
mbed_official 392:2b59412bb664 1171 #define GPIO_OSPEEDR_OSPEEDR10 ((uint32_t)0x00300000)
mbed_official 392:2b59412bb664 1172 #define GPIO_OSPEEDR_OSPEEDR10_0 ((uint32_t)0x00100000)
mbed_official 392:2b59412bb664 1173 #define GPIO_OSPEEDR_OSPEEDR10_1 ((uint32_t)0x00200000)
mbed_official 392:2b59412bb664 1174 #define GPIO_OSPEEDR_OSPEEDR11 ((uint32_t)0x00C00000)
mbed_official 392:2b59412bb664 1175 #define GPIO_OSPEEDR_OSPEEDR11_0 ((uint32_t)0x00400000)
mbed_official 392:2b59412bb664 1176 #define GPIO_OSPEEDR_OSPEEDR11_1 ((uint32_t)0x00800000)
mbed_official 392:2b59412bb664 1177 #define GPIO_OSPEEDR_OSPEEDR12 ((uint32_t)0x03000000)
mbed_official 392:2b59412bb664 1178 #define GPIO_OSPEEDR_OSPEEDR12_0 ((uint32_t)0x01000000)
mbed_official 392:2b59412bb664 1179 #define GPIO_OSPEEDR_OSPEEDR12_1 ((uint32_t)0x02000000)
mbed_official 392:2b59412bb664 1180 #define GPIO_OSPEEDR_OSPEEDR13 ((uint32_t)0x0C000000)
mbed_official 392:2b59412bb664 1181 #define GPIO_OSPEEDR_OSPEEDR13_0 ((uint32_t)0x04000000)
mbed_official 392:2b59412bb664 1182 #define GPIO_OSPEEDR_OSPEEDR13_1 ((uint32_t)0x08000000)
mbed_official 392:2b59412bb664 1183 #define GPIO_OSPEEDR_OSPEEDR14 ((uint32_t)0x30000000)
mbed_official 392:2b59412bb664 1184 #define GPIO_OSPEEDR_OSPEEDR14_0 ((uint32_t)0x10000000)
mbed_official 392:2b59412bb664 1185 #define GPIO_OSPEEDR_OSPEEDR14_1 ((uint32_t)0x20000000)
mbed_official 392:2b59412bb664 1186 #define GPIO_OSPEEDR_OSPEEDR15 ((uint32_t)0xC0000000)
mbed_official 392:2b59412bb664 1187 #define GPIO_OSPEEDR_OSPEEDR15_0 ((uint32_t)0x40000000)
mbed_official 392:2b59412bb664 1188 #define GPIO_OSPEEDR_OSPEEDR15_1 ((uint32_t)0x80000000)
mbed_official 392:2b59412bb664 1189
mbed_official 392:2b59412bb664 1190 /* Old Bit definition for GPIO_OSPEEDR register maintained for legacy purpose */
mbed_official 392:2b59412bb664 1191 #define GPIO_OSPEEDER_OSPEEDR0 GPIO_OSPEEDR_OSPEEDR0
mbed_official 392:2b59412bb664 1192 #define GPIO_OSPEEDER_OSPEEDR0_0 GPIO_OSPEEDR_OSPEEDR0_0
mbed_official 392:2b59412bb664 1193 #define GPIO_OSPEEDER_OSPEEDR0_1 GPIO_OSPEEDR_OSPEEDR0_1
mbed_official 392:2b59412bb664 1194 #define GPIO_OSPEEDER_OSPEEDR1 GPIO_OSPEEDR_OSPEEDR1
mbed_official 392:2b59412bb664 1195 #define GPIO_OSPEEDER_OSPEEDR1_0 GPIO_OSPEEDR_OSPEEDR1_0
mbed_official 392:2b59412bb664 1196 #define GPIO_OSPEEDER_OSPEEDR1_1 GPIO_OSPEEDR_OSPEEDR1_1
mbed_official 392:2b59412bb664 1197 #define GPIO_OSPEEDER_OSPEEDR2 GPIO_OSPEEDR_OSPEEDR2
mbed_official 392:2b59412bb664 1198 #define GPIO_OSPEEDER_OSPEEDR2_0 GPIO_OSPEEDR_OSPEEDR2_0
mbed_official 392:2b59412bb664 1199 #define GPIO_OSPEEDER_OSPEEDR2_1 GPIO_OSPEEDR_OSPEEDR2_1
mbed_official 392:2b59412bb664 1200 #define GPIO_OSPEEDER_OSPEEDR3 GPIO_OSPEEDR_OSPEEDR3
mbed_official 392:2b59412bb664 1201 #define GPIO_OSPEEDER_OSPEEDR3_0 GPIO_OSPEEDR_OSPEEDR3_0
mbed_official 392:2b59412bb664 1202 #define GPIO_OSPEEDER_OSPEEDR3_1 GPIO_OSPEEDR_OSPEEDR3_1
mbed_official 392:2b59412bb664 1203 #define GPIO_OSPEEDER_OSPEEDR4 GPIO_OSPEEDR_OSPEEDR4
mbed_official 392:2b59412bb664 1204 #define GPIO_OSPEEDER_OSPEEDR4_0 GPIO_OSPEEDR_OSPEEDR4_0
mbed_official 392:2b59412bb664 1205 #define GPIO_OSPEEDER_OSPEEDR4_1 GPIO_OSPEEDR_OSPEEDR4_1
mbed_official 392:2b59412bb664 1206 #define GPIO_OSPEEDER_OSPEEDR5 GPIO_OSPEEDR_OSPEEDR5
mbed_official 392:2b59412bb664 1207 #define GPIO_OSPEEDER_OSPEEDR5_0 GPIO_OSPEEDR_OSPEEDR5_0
mbed_official 392:2b59412bb664 1208 #define GPIO_OSPEEDER_OSPEEDR5_1 GPIO_OSPEEDR_OSPEEDR5_1
mbed_official 392:2b59412bb664 1209 #define GPIO_OSPEEDER_OSPEEDR6 GPIO_OSPEEDR_OSPEEDR6
mbed_official 392:2b59412bb664 1210 #define GPIO_OSPEEDER_OSPEEDR6_0 GPIO_OSPEEDR_OSPEEDR6_0
mbed_official 392:2b59412bb664 1211 #define GPIO_OSPEEDER_OSPEEDR6_1 GPIO_OSPEEDR_OSPEEDR6_1
mbed_official 392:2b59412bb664 1212 #define GPIO_OSPEEDER_OSPEEDR7 GPIO_OSPEEDR_OSPEEDR7
mbed_official 392:2b59412bb664 1213 #define GPIO_OSPEEDER_OSPEEDR7_0 GPIO_OSPEEDR_OSPEEDR7_0
mbed_official 392:2b59412bb664 1214 #define GPIO_OSPEEDER_OSPEEDR7_1 GPIO_OSPEEDR_OSPEEDR7_1
mbed_official 392:2b59412bb664 1215 #define GPIO_OSPEEDER_OSPEEDR8 GPIO_OSPEEDR_OSPEEDR8
mbed_official 392:2b59412bb664 1216 #define GPIO_OSPEEDER_OSPEEDR8_0 GPIO_OSPEEDR_OSPEEDR8_0
mbed_official 392:2b59412bb664 1217 #define GPIO_OSPEEDER_OSPEEDR8_1 GPIO_OSPEEDR_OSPEEDR8_1
mbed_official 392:2b59412bb664 1218 #define GPIO_OSPEEDER_OSPEEDR9 GPIO_OSPEEDR_OSPEEDR9
mbed_official 392:2b59412bb664 1219 #define GPIO_OSPEEDER_OSPEEDR9_0 GPIO_OSPEEDR_OSPEEDR9_0
mbed_official 392:2b59412bb664 1220 #define GPIO_OSPEEDER_OSPEEDR9_1 GPIO_OSPEEDR_OSPEEDR9_1
mbed_official 392:2b59412bb664 1221 #define GPIO_OSPEEDER_OSPEEDR10 GPIO_OSPEEDR_OSPEEDR10
mbed_official 392:2b59412bb664 1222 #define GPIO_OSPEEDER_OSPEEDR10_0 GPIO_OSPEEDR_OSPEEDR10_0
mbed_official 392:2b59412bb664 1223 #define GPIO_OSPEEDER_OSPEEDR10_1 GPIO_OSPEEDR_OSPEEDR10_1
mbed_official 392:2b59412bb664 1224 #define GPIO_OSPEEDER_OSPEEDR11 GPIO_OSPEEDR_OSPEEDR11
mbed_official 392:2b59412bb664 1225 #define GPIO_OSPEEDER_OSPEEDR11_0 GPIO_OSPEEDR_OSPEEDR11_0
mbed_official 392:2b59412bb664 1226 #define GPIO_OSPEEDER_OSPEEDR11_1 GPIO_OSPEEDR_OSPEEDR11_1
mbed_official 392:2b59412bb664 1227 #define GPIO_OSPEEDER_OSPEEDR12 GPIO_OSPEEDR_OSPEEDR12
mbed_official 392:2b59412bb664 1228 #define GPIO_OSPEEDER_OSPEEDR12_0 GPIO_OSPEEDR_OSPEEDR12_0
mbed_official 392:2b59412bb664 1229 #define GPIO_OSPEEDER_OSPEEDR12_1 GPIO_OSPEEDR_OSPEEDR12_1
mbed_official 392:2b59412bb664 1230 #define GPIO_OSPEEDER_OSPEEDR13 GPIO_OSPEEDR_OSPEEDR13
mbed_official 392:2b59412bb664 1231 #define GPIO_OSPEEDER_OSPEEDR13_0 GPIO_OSPEEDR_OSPEEDR13_0
mbed_official 392:2b59412bb664 1232 #define GPIO_OSPEEDER_OSPEEDR13_1 GPIO_OSPEEDR_OSPEEDR13_1
mbed_official 392:2b59412bb664 1233 #define GPIO_OSPEEDER_OSPEEDR14 GPIO_OSPEEDR_OSPEEDR14
mbed_official 392:2b59412bb664 1234 #define GPIO_OSPEEDER_OSPEEDR14_0 GPIO_OSPEEDR_OSPEEDR14_0
mbed_official 392:2b59412bb664 1235 #define GPIO_OSPEEDER_OSPEEDR14_1 GPIO_OSPEEDR_OSPEEDR14_1
mbed_official 392:2b59412bb664 1236 #define GPIO_OSPEEDER_OSPEEDR15 GPIO_OSPEEDR_OSPEEDR15
mbed_official 392:2b59412bb664 1237 #define GPIO_OSPEEDER_OSPEEDR15_0 GPIO_OSPEEDR_OSPEEDR15_0
mbed_official 392:2b59412bb664 1238 #define GPIO_OSPEEDER_OSPEEDR15_1 GPIO_OSPEEDR_OSPEEDR15_1
mbed_official 392:2b59412bb664 1239
mbed_official 392:2b59412bb664 1240 /******************* Bit definition for GPIO_PUPDR register ******************/
mbed_official 392:2b59412bb664 1241 #define GPIO_PUPDR_PUPDR0 ((uint32_t)0x00000003)
mbed_official 392:2b59412bb664 1242 #define GPIO_PUPDR_PUPDR0_0 ((uint32_t)0x00000001)
mbed_official 392:2b59412bb664 1243 #define GPIO_PUPDR_PUPDR0_1 ((uint32_t)0x00000002)
mbed_official 392:2b59412bb664 1244 #define GPIO_PUPDR_PUPDR1 ((uint32_t)0x0000000C)
mbed_official 392:2b59412bb664 1245 #define GPIO_PUPDR_PUPDR1_0 ((uint32_t)0x00000004)
mbed_official 392:2b59412bb664 1246 #define GPIO_PUPDR_PUPDR1_1 ((uint32_t)0x00000008)
mbed_official 392:2b59412bb664 1247 #define GPIO_PUPDR_PUPDR2 ((uint32_t)0x00000030)
mbed_official 392:2b59412bb664 1248 #define GPIO_PUPDR_PUPDR2_0 ((uint32_t)0x00000010)
mbed_official 392:2b59412bb664 1249 #define GPIO_PUPDR_PUPDR2_1 ((uint32_t)0x00000020)
mbed_official 392:2b59412bb664 1250 #define GPIO_PUPDR_PUPDR3 ((uint32_t)0x000000C0)
mbed_official 392:2b59412bb664 1251 #define GPIO_PUPDR_PUPDR3_0 ((uint32_t)0x00000040)
mbed_official 392:2b59412bb664 1252 #define GPIO_PUPDR_PUPDR3_1 ((uint32_t)0x00000080)
mbed_official 392:2b59412bb664 1253 #define GPIO_PUPDR_PUPDR4 ((uint32_t)0x00000300)
mbed_official 392:2b59412bb664 1254 #define GPIO_PUPDR_PUPDR4_0 ((uint32_t)0x00000100)
mbed_official 392:2b59412bb664 1255 #define GPIO_PUPDR_PUPDR4_1 ((uint32_t)0x00000200)
mbed_official 392:2b59412bb664 1256 #define GPIO_PUPDR_PUPDR5 ((uint32_t)0x00000C00)
mbed_official 392:2b59412bb664 1257 #define GPIO_PUPDR_PUPDR5_0 ((uint32_t)0x00000400)
mbed_official 392:2b59412bb664 1258 #define GPIO_PUPDR_PUPDR5_1 ((uint32_t)0x00000800)
mbed_official 392:2b59412bb664 1259 #define GPIO_PUPDR_PUPDR6 ((uint32_t)0x00003000)
mbed_official 392:2b59412bb664 1260 #define GPIO_PUPDR_PUPDR6_0 ((uint32_t)0x00001000)
mbed_official 392:2b59412bb664 1261 #define GPIO_PUPDR_PUPDR6_1 ((uint32_t)0x00002000)
mbed_official 392:2b59412bb664 1262 #define GPIO_PUPDR_PUPDR7 ((uint32_t)0x0000C000)
mbed_official 392:2b59412bb664 1263 #define GPIO_PUPDR_PUPDR7_0 ((uint32_t)0x00004000)
mbed_official 392:2b59412bb664 1264 #define GPIO_PUPDR_PUPDR7_1 ((uint32_t)0x00008000)
mbed_official 392:2b59412bb664 1265 #define GPIO_PUPDR_PUPDR8 ((uint32_t)0x00030000)
mbed_official 392:2b59412bb664 1266 #define GPIO_PUPDR_PUPDR8_0 ((uint32_t)0x00010000)
mbed_official 392:2b59412bb664 1267 #define GPIO_PUPDR_PUPDR8_1 ((uint32_t)0x00020000)
mbed_official 392:2b59412bb664 1268 #define GPIO_PUPDR_PUPDR9 ((uint32_t)0x000C0000)
mbed_official 392:2b59412bb664 1269 #define GPIO_PUPDR_PUPDR9_0 ((uint32_t)0x00040000)
mbed_official 392:2b59412bb664 1270 #define GPIO_PUPDR_PUPDR9_1 ((uint32_t)0x00080000)
mbed_official 392:2b59412bb664 1271 #define GPIO_PUPDR_PUPDR10 ((uint32_t)0x00300000)
mbed_official 392:2b59412bb664 1272 #define GPIO_PUPDR_PUPDR10_0 ((uint32_t)0x00100000)
mbed_official 392:2b59412bb664 1273 #define GPIO_PUPDR_PUPDR10_1 ((uint32_t)0x00200000)
mbed_official 392:2b59412bb664 1274 #define GPIO_PUPDR_PUPDR11 ((uint32_t)0x00C00000)
mbed_official 392:2b59412bb664 1275 #define GPIO_PUPDR_PUPDR11_0 ((uint32_t)0x00400000)
mbed_official 392:2b59412bb664 1276 #define GPIO_PUPDR_PUPDR11_1 ((uint32_t)0x00800000)
mbed_official 392:2b59412bb664 1277 #define GPIO_PUPDR_PUPDR12 ((uint32_t)0x03000000)
mbed_official 392:2b59412bb664 1278 #define GPIO_PUPDR_PUPDR12_0 ((uint32_t)0x01000000)
mbed_official 392:2b59412bb664 1279 #define GPIO_PUPDR_PUPDR12_1 ((uint32_t)0x02000000)
mbed_official 392:2b59412bb664 1280 #define GPIO_PUPDR_PUPDR13 ((uint32_t)0x0C000000)
mbed_official 392:2b59412bb664 1281 #define GPIO_PUPDR_PUPDR13_0 ((uint32_t)0x04000000)
mbed_official 392:2b59412bb664 1282 #define GPIO_PUPDR_PUPDR13_1 ((uint32_t)0x08000000)
mbed_official 392:2b59412bb664 1283 #define GPIO_PUPDR_PUPDR14 ((uint32_t)0x30000000)
mbed_official 392:2b59412bb664 1284 #define GPIO_PUPDR_PUPDR14_0 ((uint32_t)0x10000000)
mbed_official 392:2b59412bb664 1285 #define GPIO_PUPDR_PUPDR14_1 ((uint32_t)0x20000000)
mbed_official 392:2b59412bb664 1286 #define GPIO_PUPDR_PUPDR15 ((uint32_t)0xC0000000)
mbed_official 392:2b59412bb664 1287 #define GPIO_PUPDR_PUPDR15_0 ((uint32_t)0x40000000)
mbed_official 392:2b59412bb664 1288 #define GPIO_PUPDR_PUPDR15_1 ((uint32_t)0x80000000)
mbed_official 392:2b59412bb664 1289
mbed_official 392:2b59412bb664 1290 /******************* Bit definition for GPIO_IDR register *******************/
mbed_official 392:2b59412bb664 1291 #define GPIO_IDR_0 ((uint32_t)0x00000001)
mbed_official 392:2b59412bb664 1292 #define GPIO_IDR_1 ((uint32_t)0x00000002)
mbed_official 392:2b59412bb664 1293 #define GPIO_IDR_2 ((uint32_t)0x00000004)
mbed_official 392:2b59412bb664 1294 #define GPIO_IDR_3 ((uint32_t)0x00000008)
mbed_official 392:2b59412bb664 1295 #define GPIO_IDR_4 ((uint32_t)0x00000010)
mbed_official 392:2b59412bb664 1296 #define GPIO_IDR_5 ((uint32_t)0x00000020)
mbed_official 392:2b59412bb664 1297 #define GPIO_IDR_6 ((uint32_t)0x00000040)
mbed_official 392:2b59412bb664 1298 #define GPIO_IDR_7 ((uint32_t)0x00000080)
mbed_official 392:2b59412bb664 1299 #define GPIO_IDR_8 ((uint32_t)0x00000100)
mbed_official 392:2b59412bb664 1300 #define GPIO_IDR_9 ((uint32_t)0x00000200)
mbed_official 392:2b59412bb664 1301 #define GPIO_IDR_10 ((uint32_t)0x00000400)
mbed_official 392:2b59412bb664 1302 #define GPIO_IDR_11 ((uint32_t)0x00000800)
mbed_official 392:2b59412bb664 1303 #define GPIO_IDR_12 ((uint32_t)0x00001000)
mbed_official 392:2b59412bb664 1304 #define GPIO_IDR_13 ((uint32_t)0x00002000)
mbed_official 392:2b59412bb664 1305 #define GPIO_IDR_14 ((uint32_t)0x00004000)
mbed_official 392:2b59412bb664 1306 #define GPIO_IDR_15 ((uint32_t)0x00008000)
mbed_official 392:2b59412bb664 1307
mbed_official 392:2b59412bb664 1308 /****************** Bit definition for GPIO_ODR register ********************/
mbed_official 392:2b59412bb664 1309 #define GPIO_ODR_0 ((uint32_t)0x00000001)
mbed_official 392:2b59412bb664 1310 #define GPIO_ODR_1 ((uint32_t)0x00000002)
mbed_official 392:2b59412bb664 1311 #define GPIO_ODR_2 ((uint32_t)0x00000004)
mbed_official 392:2b59412bb664 1312 #define GPIO_ODR_3 ((uint32_t)0x00000008)
mbed_official 392:2b59412bb664 1313 #define GPIO_ODR_4 ((uint32_t)0x00000010)
mbed_official 392:2b59412bb664 1314 #define GPIO_ODR_5 ((uint32_t)0x00000020)
mbed_official 392:2b59412bb664 1315 #define GPIO_ODR_6 ((uint32_t)0x00000040)
mbed_official 392:2b59412bb664 1316 #define GPIO_ODR_7 ((uint32_t)0x00000080)
mbed_official 392:2b59412bb664 1317 #define GPIO_ODR_8 ((uint32_t)0x00000100)
mbed_official 392:2b59412bb664 1318 #define GPIO_ODR_9 ((uint32_t)0x00000200)
mbed_official 392:2b59412bb664 1319 #define GPIO_ODR_10 ((uint32_t)0x00000400)
mbed_official 392:2b59412bb664 1320 #define GPIO_ODR_11 ((uint32_t)0x00000800)
mbed_official 392:2b59412bb664 1321 #define GPIO_ODR_12 ((uint32_t)0x00001000)
mbed_official 392:2b59412bb664 1322 #define GPIO_ODR_13 ((uint32_t)0x00002000)
mbed_official 392:2b59412bb664 1323 #define GPIO_ODR_14 ((uint32_t)0x00004000)
mbed_official 392:2b59412bb664 1324 #define GPIO_ODR_15 ((uint32_t)0x00008000)
mbed_official 392:2b59412bb664 1325
mbed_official 392:2b59412bb664 1326 /****************** Bit definition for GPIO_BSRR register ********************/
mbed_official 392:2b59412bb664 1327 #define GPIO_BSRR_BS_0 ((uint32_t)0x00000001)
mbed_official 392:2b59412bb664 1328 #define GPIO_BSRR_BS_1 ((uint32_t)0x00000002)
mbed_official 392:2b59412bb664 1329 #define GPIO_BSRR_BS_2 ((uint32_t)0x00000004)
mbed_official 392:2b59412bb664 1330 #define GPIO_BSRR_BS_3 ((uint32_t)0x00000008)
mbed_official 392:2b59412bb664 1331 #define GPIO_BSRR_BS_4 ((uint32_t)0x00000010)
mbed_official 392:2b59412bb664 1332 #define GPIO_BSRR_BS_5 ((uint32_t)0x00000020)
mbed_official 392:2b59412bb664 1333 #define GPIO_BSRR_BS_6 ((uint32_t)0x00000040)
mbed_official 392:2b59412bb664 1334 #define GPIO_BSRR_BS_7 ((uint32_t)0x00000080)
mbed_official 392:2b59412bb664 1335 #define GPIO_BSRR_BS_8 ((uint32_t)0x00000100)
mbed_official 392:2b59412bb664 1336 #define GPIO_BSRR_BS_9 ((uint32_t)0x00000200)
mbed_official 392:2b59412bb664 1337 #define GPIO_BSRR_BS_10 ((uint32_t)0x00000400)
mbed_official 392:2b59412bb664 1338 #define GPIO_BSRR_BS_11 ((uint32_t)0x00000800)
mbed_official 392:2b59412bb664 1339 #define GPIO_BSRR_BS_12 ((uint32_t)0x00001000)
mbed_official 392:2b59412bb664 1340 #define GPIO_BSRR_BS_13 ((uint32_t)0x00002000)
mbed_official 392:2b59412bb664 1341 #define GPIO_BSRR_BS_14 ((uint32_t)0x00004000)
mbed_official 392:2b59412bb664 1342 #define GPIO_BSRR_BS_15 ((uint32_t)0x00008000)
mbed_official 392:2b59412bb664 1343 #define GPIO_BSRR_BR_0 ((uint32_t)0x00010000)
mbed_official 392:2b59412bb664 1344 #define GPIO_BSRR_BR_1 ((uint32_t)0x00020000)
mbed_official 392:2b59412bb664 1345 #define GPIO_BSRR_BR_2 ((uint32_t)0x00040000)
mbed_official 392:2b59412bb664 1346 #define GPIO_BSRR_BR_3 ((uint32_t)0x00080000)
mbed_official 392:2b59412bb664 1347 #define GPIO_BSRR_BR_4 ((uint32_t)0x00100000)
mbed_official 392:2b59412bb664 1348 #define GPIO_BSRR_BR_5 ((uint32_t)0x00200000)
mbed_official 392:2b59412bb664 1349 #define GPIO_BSRR_BR_6 ((uint32_t)0x00400000)
mbed_official 392:2b59412bb664 1350 #define GPIO_BSRR_BR_7 ((uint32_t)0x00800000)
mbed_official 392:2b59412bb664 1351 #define GPIO_BSRR_BR_8 ((uint32_t)0x01000000)
mbed_official 392:2b59412bb664 1352 #define GPIO_BSRR_BR_9 ((uint32_t)0x02000000)
mbed_official 392:2b59412bb664 1353 #define GPIO_BSRR_BR_10 ((uint32_t)0x04000000)
mbed_official 392:2b59412bb664 1354 #define GPIO_BSRR_BR_11 ((uint32_t)0x08000000)
mbed_official 392:2b59412bb664 1355 #define GPIO_BSRR_BR_12 ((uint32_t)0x10000000)
mbed_official 392:2b59412bb664 1356 #define GPIO_BSRR_BR_13 ((uint32_t)0x20000000)
mbed_official 392:2b59412bb664 1357 #define GPIO_BSRR_BR_14 ((uint32_t)0x40000000)
mbed_official 392:2b59412bb664 1358 #define GPIO_BSRR_BR_15 ((uint32_t)0x80000000)
mbed_official 392:2b59412bb664 1359
mbed_official 392:2b59412bb664 1360 /****************** Bit definition for GPIO_LCKR register ********************/
mbed_official 392:2b59412bb664 1361 #define GPIO_LCKR_LCK0 ((uint32_t)0x00000001)
mbed_official 392:2b59412bb664 1362 #define GPIO_LCKR_LCK1 ((uint32_t)0x00000002)
mbed_official 392:2b59412bb664 1363 #define GPIO_LCKR_LCK2 ((uint32_t)0x00000004)
mbed_official 392:2b59412bb664 1364 #define GPIO_LCKR_LCK3 ((uint32_t)0x00000008)
mbed_official 392:2b59412bb664 1365 #define GPIO_LCKR_LCK4 ((uint32_t)0x00000010)
mbed_official 392:2b59412bb664 1366 #define GPIO_LCKR_LCK5 ((uint32_t)0x00000020)
mbed_official 392:2b59412bb664 1367 #define GPIO_LCKR_LCK6 ((uint32_t)0x00000040)
mbed_official 392:2b59412bb664 1368 #define GPIO_LCKR_LCK7 ((uint32_t)0x00000080)
mbed_official 392:2b59412bb664 1369 #define GPIO_LCKR_LCK8 ((uint32_t)0x00000100)
mbed_official 392:2b59412bb664 1370 #define GPIO_LCKR_LCK9 ((uint32_t)0x00000200)
mbed_official 392:2b59412bb664 1371 #define GPIO_LCKR_LCK10 ((uint32_t)0x00000400)
mbed_official 392:2b59412bb664 1372 #define GPIO_LCKR_LCK11 ((uint32_t)0x00000800)
mbed_official 392:2b59412bb664 1373 #define GPIO_LCKR_LCK12 ((uint32_t)0x00001000)
mbed_official 392:2b59412bb664 1374 #define GPIO_LCKR_LCK13 ((uint32_t)0x00002000)
mbed_official 392:2b59412bb664 1375 #define GPIO_LCKR_LCK14 ((uint32_t)0x00004000)
mbed_official 392:2b59412bb664 1376 #define GPIO_LCKR_LCK15 ((uint32_t)0x00008000)
mbed_official 392:2b59412bb664 1377 #define GPIO_LCKR_LCKK ((uint32_t)0x00010000)
mbed_official 392:2b59412bb664 1378
mbed_official 392:2b59412bb664 1379 /****************** Bit definition for GPIO_AFRL register ********************/
mbed_official 392:2b59412bb664 1380 #define GPIO_AFRL_AFRL0 ((uint32_t)0x0000000F)
mbed_official 392:2b59412bb664 1381 #define GPIO_AFRL_AFRL1 ((uint32_t)0x000000F0)
mbed_official 392:2b59412bb664 1382 #define GPIO_AFRL_AFRL2 ((uint32_t)0x00000F00)
mbed_official 392:2b59412bb664 1383 #define GPIO_AFRL_AFRL3 ((uint32_t)0x0000F000)
mbed_official 392:2b59412bb664 1384 #define GPIO_AFRL_AFRL4 ((uint32_t)0x000F0000)
mbed_official 392:2b59412bb664 1385 #define GPIO_AFRL_AFRL5 ((uint32_t)0x00F00000)
mbed_official 392:2b59412bb664 1386 #define GPIO_AFRL_AFRL6 ((uint32_t)0x0F000000)
mbed_official 392:2b59412bb664 1387 #define GPIO_AFRL_AFRL7 ((uint32_t)0xF0000000)
mbed_official 392:2b59412bb664 1388
mbed_official 392:2b59412bb664 1389 /****************** Bit definition for GPIO_AFRH register ********************/
mbed_official 392:2b59412bb664 1390 #define GPIO_AFRH_AFRH0 ((uint32_t)0x0000000F)
mbed_official 392:2b59412bb664 1391 #define GPIO_AFRH_AFRH1 ((uint32_t)0x000000F0)
mbed_official 392:2b59412bb664 1392 #define GPIO_AFRH_AFRH2 ((uint32_t)0x00000F00)
mbed_official 392:2b59412bb664 1393 #define GPIO_AFRH_AFRH3 ((uint32_t)0x0000F000)
mbed_official 392:2b59412bb664 1394 #define GPIO_AFRH_AFRH4 ((uint32_t)0x000F0000)
mbed_official 392:2b59412bb664 1395 #define GPIO_AFRH_AFRH5 ((uint32_t)0x00F00000)
mbed_official 392:2b59412bb664 1396 #define GPIO_AFRH_AFRH6 ((uint32_t)0x0F000000)
mbed_official 392:2b59412bb664 1397 #define GPIO_AFRH_AFRH7 ((uint32_t)0xF0000000)
mbed_official 392:2b59412bb664 1398
mbed_official 392:2b59412bb664 1399 /****************** Bit definition for GPIO_BRR register *********************/
mbed_official 392:2b59412bb664 1400 #define GPIO_BRR_BR_0 ((uint32_t)0x00000001)
mbed_official 392:2b59412bb664 1401 #define GPIO_BRR_BR_1 ((uint32_t)0x00000002)
mbed_official 392:2b59412bb664 1402 #define GPIO_BRR_BR_2 ((uint32_t)0x00000004)
mbed_official 392:2b59412bb664 1403 #define GPIO_BRR_BR_3 ((uint32_t)0x00000008)
mbed_official 392:2b59412bb664 1404 #define GPIO_BRR_BR_4 ((uint32_t)0x00000010)
mbed_official 392:2b59412bb664 1405 #define GPIO_BRR_BR_5 ((uint32_t)0x00000020)
mbed_official 392:2b59412bb664 1406 #define GPIO_BRR_BR_6 ((uint32_t)0x00000040)
mbed_official 392:2b59412bb664 1407 #define GPIO_BRR_BR_7 ((uint32_t)0x00000080)
mbed_official 392:2b59412bb664 1408 #define GPIO_BRR_BR_8 ((uint32_t)0x00000100)
mbed_official 392:2b59412bb664 1409 #define GPIO_BRR_BR_9 ((uint32_t)0x00000200)
mbed_official 392:2b59412bb664 1410 #define GPIO_BRR_BR_10 ((uint32_t)0x00000400)
mbed_official 392:2b59412bb664 1411 #define GPIO_BRR_BR_11 ((uint32_t)0x00000800)
mbed_official 392:2b59412bb664 1412 #define GPIO_BRR_BR_12 ((uint32_t)0x00001000)
mbed_official 392:2b59412bb664 1413 #define GPIO_BRR_BR_13 ((uint32_t)0x00002000)
mbed_official 392:2b59412bb664 1414 #define GPIO_BRR_BR_14 ((uint32_t)0x00004000)
mbed_official 392:2b59412bb664 1415 #define GPIO_BRR_BR_15 ((uint32_t)0x00008000)
mbed_official 392:2b59412bb664 1416
mbed_official 392:2b59412bb664 1417 /******************************************************************************/
mbed_official 392:2b59412bb664 1418 /* */
mbed_official 392:2b59412bb664 1419 /* Inter-integrated Circuit Interface (I2C) */
mbed_official 392:2b59412bb664 1420 /* */
mbed_official 392:2b59412bb664 1421 /******************************************************************************/
mbed_official 392:2b59412bb664 1422
mbed_official 392:2b59412bb664 1423 /******************* Bit definition for I2C_CR1 register *******************/
mbed_official 392:2b59412bb664 1424 #define I2C_CR1_PE ((uint32_t)0x00000001) /*!< Peripheral enable */
mbed_official 392:2b59412bb664 1425 #define I2C_CR1_TXIE ((uint32_t)0x00000002) /*!< TX interrupt enable */
mbed_official 392:2b59412bb664 1426 #define I2C_CR1_RXIE ((uint32_t)0x00000004) /*!< RX interrupt enable */
mbed_official 392:2b59412bb664 1427 #define I2C_CR1_ADDRIE ((uint32_t)0x00000008) /*!< Address match interrupt enable */
mbed_official 392:2b59412bb664 1428 #define I2C_CR1_NACKIE ((uint32_t)0x00000010) /*!< NACK received interrupt enable */
mbed_official 392:2b59412bb664 1429 #define I2C_CR1_STOPIE ((uint32_t)0x00000020) /*!< STOP detection interrupt enable */
mbed_official 392:2b59412bb664 1430 #define I2C_CR1_TCIE ((uint32_t)0x00000040) /*!< Transfer complete interrupt enable */
mbed_official 392:2b59412bb664 1431 #define I2C_CR1_ERRIE ((uint32_t)0x00000080) /*!< Errors interrupt enable */
mbed_official 392:2b59412bb664 1432 #define I2C_CR1_DFN ((uint32_t)0x00000F00) /*!< Digital noise filter */
mbed_official 392:2b59412bb664 1433 #define I2C_CR1_ANFOFF ((uint32_t)0x00001000) /*!< Analog noise filter OFF */
mbed_official 392:2b59412bb664 1434 #define I2C_CR1_SWRST ((uint32_t)0x00002000) /*!< Software reset */
mbed_official 392:2b59412bb664 1435 #define I2C_CR1_TXDMAEN ((uint32_t)0x00004000) /*!< DMA transmission requests enable */
mbed_official 392:2b59412bb664 1436 #define I2C_CR1_RXDMAEN ((uint32_t)0x00008000) /*!< DMA reception requests enable */
mbed_official 392:2b59412bb664 1437 #define I2C_CR1_SBC ((uint32_t)0x00010000) /*!< Slave byte control */
mbed_official 392:2b59412bb664 1438 #define I2C_CR1_NOSTRETCH ((uint32_t)0x00020000) /*!< Clock stretching disable */
mbed_official 392:2b59412bb664 1439 #define I2C_CR1_WUPEN ((uint32_t)0x00040000) /*!< Wakeup from STOP enable */
mbed_official 392:2b59412bb664 1440 #define I2C_CR1_GCEN ((uint32_t)0x00080000) /*!< General call enable */
mbed_official 392:2b59412bb664 1441 #define I2C_CR1_SMBHEN ((uint32_t)0x00100000) /*!< SMBus host address enable */
mbed_official 392:2b59412bb664 1442 #define I2C_CR1_SMBDEN ((uint32_t)0x00200000) /*!< SMBus device default address enable */
mbed_official 392:2b59412bb664 1443 #define I2C_CR1_ALERTEN ((uint32_t)0x00400000) /*!< SMBus alert enable */
mbed_official 392:2b59412bb664 1444 #define I2C_CR1_PECEN ((uint32_t)0x00800000) /*!< PEC enable */
mbed_official 392:2b59412bb664 1445
mbed_official 392:2b59412bb664 1446 /****************** Bit definition for I2C_CR2 register ********************/
mbed_official 392:2b59412bb664 1447 #define I2C_CR2_SADD ((uint32_t)0x000003FF) /*!< Slave address (master mode) */
mbed_official 392:2b59412bb664 1448 #define I2C_CR2_RD_WRN ((uint32_t)0x00000400) /*!< Transfer direction (master mode) */
mbed_official 392:2b59412bb664 1449 #define I2C_CR2_ADD10 ((uint32_t)0x00000800) /*!< 10-bit addressing mode (master mode) */
mbed_official 392:2b59412bb664 1450 #define I2C_CR2_HEAD10R ((uint32_t)0x00001000) /*!< 10-bit address header only read direction (master mode) */
mbed_official 392:2b59412bb664 1451 #define I2C_CR2_START ((uint32_t)0x00002000) /*!< START generation */
mbed_official 392:2b59412bb664 1452 #define I2C_CR2_STOP ((uint32_t)0x00004000) /*!< STOP generation (master mode) */
mbed_official 392:2b59412bb664 1453 #define I2C_CR2_NACK ((uint32_t)0x00008000) /*!< NACK generation (slave mode) */
mbed_official 392:2b59412bb664 1454 #define I2C_CR2_NBYTES ((uint32_t)0x00FF0000) /*!< Number of bytes */
mbed_official 392:2b59412bb664 1455 #define I2C_CR2_RELOAD ((uint32_t)0x01000000) /*!< NBYTES reload mode */
mbed_official 392:2b59412bb664 1456 #define I2C_CR2_AUTOEND ((uint32_t)0x02000000) /*!< Automatic end mode (master mode) */
mbed_official 392:2b59412bb664 1457 #define I2C_CR2_PECBYTE ((uint32_t)0x04000000) /*!< Packet error checking byte */
mbed_official 392:2b59412bb664 1458
mbed_official 392:2b59412bb664 1459 /******************* Bit definition for I2C_OAR1 register ******************/
mbed_official 392:2b59412bb664 1460 #define I2C_OAR1_OA1 ((uint32_t)0x000003FF) /*!< Interface own address 1 */
mbed_official 392:2b59412bb664 1461 #define I2C_OAR1_OA1MODE ((uint32_t)0x00000400) /*!< Own address 1 10-bit mode */
mbed_official 392:2b59412bb664 1462 #define I2C_OAR1_OA1EN ((uint32_t)0x00008000) /*!< Own address 1 enable */
mbed_official 392:2b59412bb664 1463
mbed_official 392:2b59412bb664 1464 /******************* Bit definition for I2C_OAR2 register ******************/
mbed_official 392:2b59412bb664 1465 #define I2C_OAR2_OA2 ((uint32_t)0x000000FE) /*!< Interface own address 2 */
mbed_official 392:2b59412bb664 1466 #define I2C_OAR2_OA2MSK ((uint32_t)0x00000700) /*!< Own address 2 masks */
mbed_official 392:2b59412bb664 1467 #define I2C_OAR2_OA2EN ((uint32_t)0x00008000) /*!< Own address 2 enable */
mbed_official 392:2b59412bb664 1468
mbed_official 392:2b59412bb664 1469 /******************* Bit definition for I2C_TIMINGR register ****************/
mbed_official 392:2b59412bb664 1470 #define I2C_TIMINGR_SCLL ((uint32_t)0x000000FF) /*!< SCL low period (master mode) */
mbed_official 392:2b59412bb664 1471 #define I2C_TIMINGR_SCLH ((uint32_t)0x0000FF00) /*!< SCL high period (master mode) */
mbed_official 392:2b59412bb664 1472 #define I2C_TIMINGR_SDADEL ((uint32_t)0x000F0000) /*!< Data hold time */
mbed_official 392:2b59412bb664 1473 #define I2C_TIMINGR_SCLDEL ((uint32_t)0x00F00000) /*!< Data setup time */
mbed_official 392:2b59412bb664 1474 #define I2C_TIMINGR_PRESC ((uint32_t)0xF0000000) /*!< Timings prescaler */
mbed_official 392:2b59412bb664 1475
mbed_official 392:2b59412bb664 1476 /******************* Bit definition for I2C_TIMEOUTR register ****************/
mbed_official 392:2b59412bb664 1477 #define I2C_TIMEOUTR_TIMEOUTA ((uint32_t)0x00000FFF) /*!< Bus timeout A */
mbed_official 392:2b59412bb664 1478 #define I2C_TIMEOUTR_TIDLE ((uint32_t)0x00001000) /*!< Idle clock timeout detection */
mbed_official 392:2b59412bb664 1479 #define I2C_TIMEOUTR_TIMOUTEN ((uint32_t)0x00008000) /*!< Clock timeout enable */
mbed_official 392:2b59412bb664 1480 #define I2C_TIMEOUTR_TIMEOUTB ((uint32_t)0x0FFF0000) /*!< Bus timeout B*/
mbed_official 392:2b59412bb664 1481 #define I2C_TIMEOUTR_TEXTEN ((uint32_t)0x80000000) /*!< Extended clock timeout enable */
mbed_official 392:2b59412bb664 1482
mbed_official 392:2b59412bb664 1483 /****************** Bit definition for I2C_ISR register ********************/
mbed_official 392:2b59412bb664 1484 #define I2C_ISR_TXE ((uint32_t)0x00000001) /*!< Transmit data register empty */
mbed_official 392:2b59412bb664 1485 #define I2C_ISR_TXIS ((uint32_t)0x00000002) /*!< Transmit interrupt status */
mbed_official 392:2b59412bb664 1486 #define I2C_ISR_RXNE ((uint32_t)0x00000004) /*!< Receive data register not empty */
mbed_official 392:2b59412bb664 1487 #define I2C_ISR_ADDR ((uint32_t)0x00000008) /*!< Address matched (slave mode)*/
mbed_official 392:2b59412bb664 1488 #define I2C_ISR_NACKF ((uint32_t)0x00000010) /*!< NACK received flag */
mbed_official 392:2b59412bb664 1489 #define I2C_ISR_STOPF ((uint32_t)0x00000020) /*!< STOP detection flag */
mbed_official 392:2b59412bb664 1490 #define I2C_ISR_TC ((uint32_t)0x00000040) /*!< Transfer complete (master mode) */
mbed_official 392:2b59412bb664 1491 #define I2C_ISR_TCR ((uint32_t)0x00000080) /*!< Transfer complete reload */
mbed_official 392:2b59412bb664 1492 #define I2C_ISR_BERR ((uint32_t)0x00000100) /*!< Bus error */
mbed_official 392:2b59412bb664 1493 #define I2C_ISR_ARLO ((uint32_t)0x00000200) /*!< Arbitration lost */
mbed_official 392:2b59412bb664 1494 #define I2C_ISR_OVR ((uint32_t)0x00000400) /*!< Overrun/Underrun */
mbed_official 392:2b59412bb664 1495 #define I2C_ISR_PECERR ((uint32_t)0x00000800) /*!< PEC error in reception */
mbed_official 392:2b59412bb664 1496 #define I2C_ISR_TIMEOUT ((uint32_t)0x00001000) /*!< Timeout or Tlow detection flag */
mbed_official 392:2b59412bb664 1497 #define I2C_ISR_ALERT ((uint32_t)0x00002000) /*!< SMBus alert */
mbed_official 392:2b59412bb664 1498 #define I2C_ISR_BUSY ((uint32_t)0x00008000) /*!< Bus busy */
mbed_official 392:2b59412bb664 1499 #define I2C_ISR_DIR ((uint32_t)0x00010000) /*!< Transfer direction (slave mode) */
mbed_official 392:2b59412bb664 1500 #define I2C_ISR_ADDCODE ((uint32_t)0x00FE0000) /*!< Address match code (slave mode) */
mbed_official 392:2b59412bb664 1501
mbed_official 392:2b59412bb664 1502 /****************** Bit definition for I2C_ICR register ********************/
mbed_official 392:2b59412bb664 1503 #define I2C_ICR_ADDRCF ((uint32_t)0x00000008) /*!< Address matched clear flag */
mbed_official 392:2b59412bb664 1504 #define I2C_ICR_NACKCF ((uint32_t)0x00000010) /*!< NACK clear flag */
mbed_official 392:2b59412bb664 1505 #define I2C_ICR_STOPCF ((uint32_t)0x00000020) /*!< STOP detection clear flag */
mbed_official 392:2b59412bb664 1506 #define I2C_ICR_BERRCF ((uint32_t)0x00000100) /*!< Bus error clear flag */
mbed_official 392:2b59412bb664 1507 #define I2C_ICR_ARLOCF ((uint32_t)0x00000200) /*!< Arbitration lost clear flag */
mbed_official 392:2b59412bb664 1508 #define I2C_ICR_OVRCF ((uint32_t)0x00000400) /*!< Overrun/Underrun clear flag */
mbed_official 392:2b59412bb664 1509 #define I2C_ICR_PECCF ((uint32_t)0x00000800) /*!< PAC error clear flag */
mbed_official 392:2b59412bb664 1510 #define I2C_ICR_TIMOUTCF ((uint32_t)0x00001000) /*!< Timeout clear flag */
mbed_official 392:2b59412bb664 1511 #define I2C_ICR_ALERTCF ((uint32_t)0x00002000) /*!< Alert clear flag */
mbed_official 392:2b59412bb664 1512
mbed_official 392:2b59412bb664 1513 /****************** Bit definition for I2C_PECR register *******************/
mbed_official 392:2b59412bb664 1514 #define I2C_PECR_PEC ((uint32_t)0x000000FF) /*!< PEC register */
mbed_official 392:2b59412bb664 1515
mbed_official 392:2b59412bb664 1516 /****************** Bit definition for I2C_RXDR register *********************/
mbed_official 392:2b59412bb664 1517 #define I2C_RXDR_RXDATA ((uint32_t)0x000000FF) /*!< 8-bit receive data */
mbed_official 392:2b59412bb664 1518
mbed_official 392:2b59412bb664 1519 /****************** Bit definition for I2C_TXDR register *******************/
mbed_official 392:2b59412bb664 1520 #define I2C_TXDR_TXDATA ((uint32_t)0x000000FF) /*!< 8-bit transmit data */
mbed_official 392:2b59412bb664 1521
mbed_official 392:2b59412bb664 1522 /*****************************************************************************/
mbed_official 392:2b59412bb664 1523 /* */
mbed_official 392:2b59412bb664 1524 /* Independent WATCHDOG (IWDG) */
mbed_official 392:2b59412bb664 1525 /* */
mbed_official 392:2b59412bb664 1526 /*****************************************************************************/
mbed_official 392:2b59412bb664 1527 /******************* Bit definition for IWDG_KR register *******************/
mbed_official 392:2b59412bb664 1528 #define IWDG_KR_KEY ((uint32_t)0xFFFF) /*!< Key value (write only, read 0000h) */
mbed_official 392:2b59412bb664 1529
mbed_official 392:2b59412bb664 1530 /******************* Bit definition for IWDG_PR register *******************/
mbed_official 392:2b59412bb664 1531 #define IWDG_PR_PR ((uint32_t)0x07) /*!< PR[2:0] (Prescaler divider) */
mbed_official 392:2b59412bb664 1532 #define IWDG_PR_PR_0 ((uint32_t)0x01) /*!< Bit 0 */
mbed_official 392:2b59412bb664 1533 #define IWDG_PR_PR_1 ((uint32_t)0x02) /*!< Bit 1 */
mbed_official 392:2b59412bb664 1534 #define IWDG_PR_PR_2 ((uint32_t)0x04) /*!< Bit 2 */
mbed_official 392:2b59412bb664 1535
mbed_official 392:2b59412bb664 1536 /******************* Bit definition for IWDG_RLR register ******************/
mbed_official 392:2b59412bb664 1537 #define IWDG_RLR_RL ((uint32_t)0x0FFF) /*!< Watchdog counter reload value */
mbed_official 392:2b59412bb664 1538
mbed_official 392:2b59412bb664 1539 /******************* Bit definition for IWDG_SR register *******************/
mbed_official 392:2b59412bb664 1540 #define IWDG_SR_PVU ((uint32_t)0x01) /*!< Watchdog prescaler value update */
mbed_official 392:2b59412bb664 1541 #define IWDG_SR_RVU ((uint32_t)0x02) /*!< Watchdog counter reload value update */
mbed_official 392:2b59412bb664 1542 #define IWDG_SR_WVU ((uint32_t)0x04) /*!< Watchdog counter window value update */
mbed_official 392:2b59412bb664 1543
mbed_official 392:2b59412bb664 1544 /******************* Bit definition for IWDG_KR register *******************/
mbed_official 392:2b59412bb664 1545 #define IWDG_WINR_WIN ((uint32_t)0x0FFF) /*!< Watchdog counter window value */
mbed_official 392:2b59412bb664 1546
mbed_official 392:2b59412bb664 1547 /*****************************************************************************/
mbed_official 392:2b59412bb664 1548 /* */
mbed_official 392:2b59412bb664 1549 /* Power Control (PWR) */
mbed_official 392:2b59412bb664 1550 /* */
mbed_official 392:2b59412bb664 1551 /*****************************************************************************/
mbed_official 392:2b59412bb664 1552
mbed_official 392:2b59412bb664 1553 /******************** Bit definition for PWR_CR register *******************/
mbed_official 392:2b59412bb664 1554 #define PWR_CR_LPDS ((uint32_t)0x00000001) /*!< Low-power Deepsleep */
mbed_official 392:2b59412bb664 1555 #define PWR_CR_PDDS ((uint32_t)0x00000002) /*!< Power Down Deepsleep */
mbed_official 392:2b59412bb664 1556 #define PWR_CR_CWUF ((uint32_t)0x00000004) /*!< Clear Wakeup Flag */
mbed_official 392:2b59412bb664 1557 #define PWR_CR_CSBF ((uint32_t)0x00000008) /*!< Clear Standby Flag */
mbed_official 392:2b59412bb664 1558 #define PWR_CR_DBP ((uint32_t)0x00000100) /*!< Disable Backup Domain write protection */
mbed_official 392:2b59412bb664 1559
mbed_official 392:2b59412bb664 1560 /******************* Bit definition for PWR_CSR register *******************/
mbed_official 392:2b59412bb664 1561 #define PWR_CSR_WUF ((uint32_t)0x00000001) /*!< Wakeup Flag */
mbed_official 392:2b59412bb664 1562 #define PWR_CSR_SBF ((uint32_t)0x00000002) /*!< Standby Flag */
mbed_official 392:2b59412bb664 1563 #define PWR_CSR_EWUP1 ((uint32_t)0x00000100) /*!< Enable WKUP pin 1 */
mbed_official 392:2b59412bb664 1564 #define PWR_CSR_EWUP2 ((uint32_t)0x00000200) /*!< Enable WKUP pin 2 */
mbed_official 392:2b59412bb664 1565
mbed_official 392:2b59412bb664 1566 /*****************************************************************************/
mbed_official 392:2b59412bb664 1567 /* */
mbed_official 392:2b59412bb664 1568 /* Reset and Clock Control */
mbed_official 392:2b59412bb664 1569 /* */
mbed_official 392:2b59412bb664 1570 /*****************************************************************************/
mbed_official 392:2b59412bb664 1571
mbed_official 392:2b59412bb664 1572 /******************** Bit definition for RCC_CR register *******************/
mbed_official 392:2b59412bb664 1573 #define RCC_CR_HSION ((uint32_t)0x00000001) /*!< Internal High Speed clock enable */
mbed_official 392:2b59412bb664 1574 #define RCC_CR_HSIRDY ((uint32_t)0x00000002) /*!< Internal High Speed clock ready flag */
mbed_official 392:2b59412bb664 1575
mbed_official 392:2b59412bb664 1576 #define RCC_CR_HSITRIM ((uint32_t)0x000000F8) /*!< Internal High Speed clock trimming */
mbed_official 392:2b59412bb664 1577 #define RCC_CR_HSITRIM_0 ((uint32_t)0x00000008) /*!<Bit 0 */
mbed_official 392:2b59412bb664 1578 #define RCC_CR_HSITRIM_1 ((uint32_t)0x00000010) /*!<Bit 1 */
mbed_official 392:2b59412bb664 1579 #define RCC_CR_HSITRIM_2 ((uint32_t)0x00000020) /*!<Bit 2 */
mbed_official 392:2b59412bb664 1580 #define RCC_CR_HSITRIM_3 ((uint32_t)0x00000040) /*!<Bit 3 */
mbed_official 392:2b59412bb664 1581 #define RCC_CR_HSITRIM_4 ((uint32_t)0x00000080) /*!<Bit 4 */
mbed_official 392:2b59412bb664 1582
mbed_official 392:2b59412bb664 1583 #define RCC_CR_HSICAL ((uint32_t)0x0000FF00) /*!< Internal High Speed clock Calibration */
mbed_official 392:2b59412bb664 1584 #define RCC_CR_HSICAL_0 ((uint32_t)0x00000100) /*!<Bit 0 */
mbed_official 392:2b59412bb664 1585 #define RCC_CR_HSICAL_1 ((uint32_t)0x00000200) /*!<Bit 1 */
mbed_official 392:2b59412bb664 1586 #define RCC_CR_HSICAL_2 ((uint32_t)0x00000400) /*!<Bit 2 */
mbed_official 392:2b59412bb664 1587 #define RCC_CR_HSICAL_3 ((uint32_t)0x00000800) /*!<Bit 3 */
mbed_official 392:2b59412bb664 1588 #define RCC_CR_HSICAL_4 ((uint32_t)0x00001000) /*!<Bit 4 */
mbed_official 392:2b59412bb664 1589 #define RCC_CR_HSICAL_5 ((uint32_t)0x00002000) /*!<Bit 5 */
mbed_official 392:2b59412bb664 1590 #define RCC_CR_HSICAL_6 ((uint32_t)0x00004000) /*!<Bit 6 */
mbed_official 392:2b59412bb664 1591 #define RCC_CR_HSICAL_7 ((uint32_t)0x00008000) /*!<Bit 7 */
mbed_official 392:2b59412bb664 1592
mbed_official 392:2b59412bb664 1593 #define RCC_CR_HSEON ((uint32_t)0x00010000) /*!< External High Speed clock enable */
mbed_official 392:2b59412bb664 1594 #define RCC_CR_HSERDY ((uint32_t)0x00020000) /*!< External High Speed clock ready flag */
mbed_official 392:2b59412bb664 1595 #define RCC_CR_HSEBYP ((uint32_t)0x00040000) /*!< External High Speed clock Bypass */
mbed_official 392:2b59412bb664 1596 #define RCC_CR_CSSON ((uint32_t)0x00080000) /*!< Clock Security System enable */
mbed_official 392:2b59412bb664 1597 #define RCC_CR_PLLON ((uint32_t)0x01000000) /*!< PLL enable */
mbed_official 392:2b59412bb664 1598 #define RCC_CR_PLLRDY ((uint32_t)0x02000000) /*!< PLL clock ready flag */
mbed_official 392:2b59412bb664 1599
mbed_official 392:2b59412bb664 1600 /******************** Bit definition for RCC_CFGR register *****************/
mbed_official 392:2b59412bb664 1601 /*!< SW configuration */
mbed_official 392:2b59412bb664 1602 #define RCC_CFGR_SW ((uint32_t)0x00000003) /*!< SW[1:0] bits (System clock Switch) */
mbed_official 392:2b59412bb664 1603 #define RCC_CFGR_SW_0 ((uint32_t)0x00000001) /*!< Bit 0 */
mbed_official 392:2b59412bb664 1604 #define RCC_CFGR_SW_1 ((uint32_t)0x00000002) /*!< Bit 1 */
mbed_official 392:2b59412bb664 1605
mbed_official 392:2b59412bb664 1606 #define RCC_CFGR_SW_HSI ((uint32_t)0x00000000) /*!< HSI selected as system clock */
mbed_official 392:2b59412bb664 1607 #define RCC_CFGR_SW_HSE ((uint32_t)0x00000001) /*!< HSE selected as system clock */
mbed_official 392:2b59412bb664 1608 #define RCC_CFGR_SW_PLL ((uint32_t)0x00000002) /*!< PLL selected as system clock */
mbed_official 392:2b59412bb664 1609
mbed_official 392:2b59412bb664 1610 /*!< SWS configuration */
mbed_official 392:2b59412bb664 1611 #define RCC_CFGR_SWS ((uint32_t)0x0000000C) /*!< SWS[1:0] bits (System Clock Switch Status) */
mbed_official 392:2b59412bb664 1612 #define RCC_CFGR_SWS_0 ((uint32_t)0x00000004) /*!< Bit 0 */
mbed_official 392:2b59412bb664 1613 #define RCC_CFGR_SWS_1 ((uint32_t)0x00000008) /*!< Bit 1 */
mbed_official 392:2b59412bb664 1614
mbed_official 392:2b59412bb664 1615 #define RCC_CFGR_SWS_HSI ((uint32_t)0x00000000) /*!< HSI oscillator used as system clock */
mbed_official 392:2b59412bb664 1616 #define RCC_CFGR_SWS_HSE ((uint32_t)0x00000004) /*!< HSE oscillator used as system clock */
mbed_official 392:2b59412bb664 1617 #define RCC_CFGR_SWS_PLL ((uint32_t)0x00000008) /*!< PLL used as system clock */
mbed_official 392:2b59412bb664 1618
mbed_official 392:2b59412bb664 1619 /*!< HPRE configuration */
mbed_official 392:2b59412bb664 1620 #define RCC_CFGR_HPRE ((uint32_t)0x000000F0) /*!< HPRE[3:0] bits (AHB prescaler) */
mbed_official 392:2b59412bb664 1621 #define RCC_CFGR_HPRE_0 ((uint32_t)0x00000010) /*!< Bit 0 */
mbed_official 392:2b59412bb664 1622 #define RCC_CFGR_HPRE_1 ((uint32_t)0x00000020) /*!< Bit 1 */
mbed_official 392:2b59412bb664 1623 #define RCC_CFGR_HPRE_2 ((uint32_t)0x00000040) /*!< Bit 2 */
mbed_official 392:2b59412bb664 1624 #define RCC_CFGR_HPRE_3 ((uint32_t)0x00000080) /*!< Bit 3 */
mbed_official 392:2b59412bb664 1625
mbed_official 392:2b59412bb664 1626 #define RCC_CFGR_HPRE_DIV1 ((uint32_t)0x00000000) /*!< SYSCLK not divided */
mbed_official 392:2b59412bb664 1627 #define RCC_CFGR_HPRE_DIV2 ((uint32_t)0x00000080) /*!< SYSCLK divided by 2 */
mbed_official 392:2b59412bb664 1628 #define RCC_CFGR_HPRE_DIV4 ((uint32_t)0x00000090) /*!< SYSCLK divided by 4 */
mbed_official 392:2b59412bb664 1629 #define RCC_CFGR_HPRE_DIV8 ((uint32_t)0x000000A0) /*!< SYSCLK divided by 8 */
mbed_official 392:2b59412bb664 1630 #define RCC_CFGR_HPRE_DIV16 ((uint32_t)0x000000B0) /*!< SYSCLK divided by 16 */
mbed_official 392:2b59412bb664 1631 #define RCC_CFGR_HPRE_DIV64 ((uint32_t)0x000000C0) /*!< SYSCLK divided by 64 */
mbed_official 392:2b59412bb664 1632 #define RCC_CFGR_HPRE_DIV128 ((uint32_t)0x000000D0) /*!< SYSCLK divided by 128 */
mbed_official 392:2b59412bb664 1633 #define RCC_CFGR_HPRE_DIV256 ((uint32_t)0x000000E0) /*!< SYSCLK divided by 256 */
mbed_official 392:2b59412bb664 1634 #define RCC_CFGR_HPRE_DIV512 ((uint32_t)0x000000F0) /*!< SYSCLK divided by 512 */
mbed_official 392:2b59412bb664 1635
mbed_official 392:2b59412bb664 1636 /*!< PPRE configuration */
mbed_official 392:2b59412bb664 1637 #define RCC_CFGR_PPRE ((uint32_t)0x00000700) /*!< PRE[2:0] bits (APB prescaler) */
mbed_official 392:2b59412bb664 1638 #define RCC_CFGR_PPRE_0 ((uint32_t)0x00000100) /*!< Bit 0 */
mbed_official 392:2b59412bb664 1639 #define RCC_CFGR_PPRE_1 ((uint32_t)0x00000200) /*!< Bit 1 */
mbed_official 392:2b59412bb664 1640 #define RCC_CFGR_PPRE_2 ((uint32_t)0x00000400) /*!< Bit 2 */
mbed_official 392:2b59412bb664 1641
mbed_official 392:2b59412bb664 1642 #define RCC_CFGR_PPRE_DIV1 ((uint32_t)0x00000000) /*!< HCLK not divided */
mbed_official 392:2b59412bb664 1643 #define RCC_CFGR_PPRE_DIV2 ((uint32_t)0x00000400) /*!< HCLK divided by 2 */
mbed_official 392:2b59412bb664 1644 #define RCC_CFGR_PPRE_DIV4 ((uint32_t)0x00000500) /*!< HCLK divided by 4 */
mbed_official 392:2b59412bb664 1645 #define RCC_CFGR_PPRE_DIV8 ((uint32_t)0x00000600) /*!< HCLK divided by 8 */
mbed_official 392:2b59412bb664 1646 #define RCC_CFGR_PPRE_DIV16 ((uint32_t)0x00000700) /*!< HCLK divided by 16 */
mbed_official 392:2b59412bb664 1647
mbed_official 392:2b59412bb664 1648 /*!< ADCPPRE configuration */
mbed_official 392:2b59412bb664 1649 #define RCC_CFGR_ADCPRE ((uint32_t)0x00004000) /*!< ADCPRE bit (ADC prescaler) */
mbed_official 392:2b59412bb664 1650
mbed_official 392:2b59412bb664 1651 #define RCC_CFGR_ADCPRE_DIV2 ((uint32_t)0x00000000) /*!< PCLK divided by 2 */
mbed_official 392:2b59412bb664 1652 #define RCC_CFGR_ADCPRE_DIV4 ((uint32_t)0x00004000) /*!< PCLK divided by 4 */
mbed_official 392:2b59412bb664 1653
mbed_official 392:2b59412bb664 1654 #define RCC_CFGR_PLLSRC ((uint32_t)0x00010000) /*!< PLL entry clock source */
mbed_official 392:2b59412bb664 1655 #define RCC_CFGR_PLLSRC_HSI_DIV2 ((uint32_t)0x00000000) /*!< HSI clock divided by 2 selected as PLL entry clock source */
mbed_official 392:2b59412bb664 1656 #define RCC_CFGR_PLLSRC_HSE_PREDIV ((uint32_t)0x00010000) /*!< HSE/PREDIV clock selected as PLL entry clock source */
mbed_official 392:2b59412bb664 1657
mbed_official 392:2b59412bb664 1658 #define RCC_CFGR_PLLXTPRE ((uint32_t)0x00020000) /*!< HSE divider for PLL entry */
mbed_official 392:2b59412bb664 1659 #define RCC_CFGR_PLLXTPRE_HSE_PREDIV_DIV1 ((uint32_t)0x00000000) /*!< HSE/PREDIV clock not divided for PLL entry */
mbed_official 392:2b59412bb664 1660 #define RCC_CFGR_PLLXTPRE_HSE_PREDIV_DIV2 ((uint32_t)0x00020000) /*!< HSE/PREDIV clock divided by 2 for PLL entry */
mbed_official 392:2b59412bb664 1661
mbed_official 392:2b59412bb664 1662 /*!< PLLMUL configuration */
mbed_official 392:2b59412bb664 1663 #define RCC_CFGR_PLLMUL ((uint32_t)0x003C0000) /*!< PLLMUL[3:0] bits (PLL multiplication factor) */
mbed_official 392:2b59412bb664 1664 #define RCC_CFGR_PLLMUL_0 ((uint32_t)0x00040000) /*!< Bit 0 */
mbed_official 392:2b59412bb664 1665 #define RCC_CFGR_PLLMUL_1 ((uint32_t)0x00080000) /*!< Bit 1 */
mbed_official 392:2b59412bb664 1666 #define RCC_CFGR_PLLMUL_2 ((uint32_t)0x00100000) /*!< Bit 2 */
mbed_official 392:2b59412bb664 1667 #define RCC_CFGR_PLLMUL_3 ((uint32_t)0x00200000) /*!< Bit 3 */
mbed_official 392:2b59412bb664 1668
mbed_official 392:2b59412bb664 1669 #define RCC_CFGR_PLLMUL2 ((uint32_t)0x00000000) /*!< PLL input clock*2 */
mbed_official 392:2b59412bb664 1670 #define RCC_CFGR_PLLMUL3 ((uint32_t)0x00040000) /*!< PLL input clock*3 */
mbed_official 392:2b59412bb664 1671 #define RCC_CFGR_PLLMUL4 ((uint32_t)0x00080000) /*!< PLL input clock*4 */
mbed_official 392:2b59412bb664 1672 #define RCC_CFGR_PLLMUL5 ((uint32_t)0x000C0000) /*!< PLL input clock*5 */
mbed_official 392:2b59412bb664 1673 #define RCC_CFGR_PLLMUL6 ((uint32_t)0x00100000) /*!< PLL input clock*6 */
mbed_official 392:2b59412bb664 1674 #define RCC_CFGR_PLLMUL7 ((uint32_t)0x00140000) /*!< PLL input clock*7 */
mbed_official 392:2b59412bb664 1675 #define RCC_CFGR_PLLMUL8 ((uint32_t)0x00180000) /*!< PLL input clock*8 */
mbed_official 392:2b59412bb664 1676 #define RCC_CFGR_PLLMUL9 ((uint32_t)0x001C0000) /*!< PLL input clock*9 */
mbed_official 392:2b59412bb664 1677 #define RCC_CFGR_PLLMUL10 ((uint32_t)0x00200000) /*!< PLL input clock10 */
mbed_official 392:2b59412bb664 1678 #define RCC_CFGR_PLLMUL11 ((uint32_t)0x00240000) /*!< PLL input clock*11 */
mbed_official 392:2b59412bb664 1679 #define RCC_CFGR_PLLMUL12 ((uint32_t)0x00280000) /*!< PLL input clock*12 */
mbed_official 392:2b59412bb664 1680 #define RCC_CFGR_PLLMUL13 ((uint32_t)0x002C0000) /*!< PLL input clock*13 */
mbed_official 392:2b59412bb664 1681 #define RCC_CFGR_PLLMUL14 ((uint32_t)0x00300000) /*!< PLL input clock*14 */
mbed_official 392:2b59412bb664 1682 #define RCC_CFGR_PLLMUL15 ((uint32_t)0x00340000) /*!< PLL input clock*15 */
mbed_official 392:2b59412bb664 1683 #define RCC_CFGR_PLLMUL16 ((uint32_t)0x00380000) /*!< PLL input clock*16 */
mbed_official 392:2b59412bb664 1684
mbed_official 392:2b59412bb664 1685 /*!< MCO configuration */
mbed_official 392:2b59412bb664 1686 #define RCC_CFGR_MCO ((uint32_t)0x0F000000) /*!< MCO[3:0] bits (Microcontroller Clock Output) */
mbed_official 392:2b59412bb664 1687 #define RCC_CFGR_MCO_0 ((uint32_t)0x01000000) /*!< Bit 0 */
mbed_official 392:2b59412bb664 1688 #define RCC_CFGR_MCO_1 ((uint32_t)0x02000000) /*!< Bit 1 */
mbed_official 392:2b59412bb664 1689 #define RCC_CFGR_MCO_2 ((uint32_t)0x04000000) /*!< Bit 2 */
mbed_official 392:2b59412bb664 1690 #define RCC_CFGR_MCO_3 ((uint32_t)0x08000000) /*!< Bit 3 */
mbed_official 392:2b59412bb664 1691
mbed_official 392:2b59412bb664 1692 #define RCC_CFGR_MCO_NOCLOCK ((uint32_t)0x00000000) /*!< No clock */
mbed_official 392:2b59412bb664 1693 #define RCC_CFGR_MCO_HSI14 ((uint32_t)0x01000000) /*!< HSI14 clock selected as MCO source */
mbed_official 392:2b59412bb664 1694 #define RCC_CFGR_MCO_LSI ((uint32_t)0x02000000) /*!< LSI clock selected as MCO source */
mbed_official 392:2b59412bb664 1695 #define RCC_CFGR_MCO_LSE ((uint32_t)0x03000000) /*!< LSE clock selected as MCO source */
mbed_official 392:2b59412bb664 1696 #define RCC_CFGR_MCO_SYSCLK ((uint32_t)0x04000000) /*!< System clock selected as MCO source */
mbed_official 392:2b59412bb664 1697 #define RCC_CFGR_MCO_HSI ((uint32_t)0x05000000) /*!< HSI clock selected as MCO source */
mbed_official 392:2b59412bb664 1698 #define RCC_CFGR_MCO_HSE ((uint32_t)0x06000000) /*!< HSE clock selected as MCO source */
mbed_official 392:2b59412bb664 1699 #define RCC_CFGR_MCO_PLL ((uint32_t)0x07000000) /*!< PLL clock divided by 2 selected as MCO source */
mbed_official 392:2b59412bb664 1700
mbed_official 392:2b59412bb664 1701 /*!<****************** Bit definition for RCC_CIR register *****************/
mbed_official 392:2b59412bb664 1702 #define RCC_CIR_LSIRDYF ((uint32_t)0x00000001) /*!< LSI Ready Interrupt flag */
mbed_official 392:2b59412bb664 1703 #define RCC_CIR_LSERDYF ((uint32_t)0x00000002) /*!< LSE Ready Interrupt flag */
mbed_official 392:2b59412bb664 1704 #define RCC_CIR_HSIRDYF ((uint32_t)0x00000004) /*!< HSI Ready Interrupt flag */
mbed_official 392:2b59412bb664 1705 #define RCC_CIR_HSERDYF ((uint32_t)0x00000008) /*!< HSE Ready Interrupt flag */
mbed_official 392:2b59412bb664 1706 #define RCC_CIR_PLLRDYF ((uint32_t)0x00000010) /*!< PLL Ready Interrupt flag */
mbed_official 392:2b59412bb664 1707 #define RCC_CIR_HSI14RDYF ((uint32_t)0x00000020) /*!< HSI14 Ready Interrupt flag */
mbed_official 392:2b59412bb664 1708 #define RCC_CIR_CSSF ((uint32_t)0x00000080) /*!< Clock Security System Interrupt flag */
mbed_official 392:2b59412bb664 1709 #define RCC_CIR_LSIRDYIE ((uint32_t)0x00000100) /*!< LSI Ready Interrupt Enable */
mbed_official 392:2b59412bb664 1710 #define RCC_CIR_LSERDYIE ((uint32_t)0x00000200) /*!< LSE Ready Interrupt Enable */
mbed_official 392:2b59412bb664 1711 #define RCC_CIR_HSIRDYIE ((uint32_t)0x00000400) /*!< HSI Ready Interrupt Enable */
mbed_official 392:2b59412bb664 1712 #define RCC_CIR_HSERDYIE ((uint32_t)0x00000800) /*!< HSE Ready Interrupt Enable */
mbed_official 392:2b59412bb664 1713 #define RCC_CIR_PLLRDYIE ((uint32_t)0x00001000) /*!< PLL Ready Interrupt Enable */
mbed_official 392:2b59412bb664 1714 #define RCC_CIR_HSI14RDYIE ((uint32_t)0x00002000) /*!< HSI14 Ready Interrupt Enable */
mbed_official 392:2b59412bb664 1715 #define RCC_CIR_LSIRDYC ((uint32_t)0x00010000) /*!< LSI Ready Interrupt Clear */
mbed_official 392:2b59412bb664 1716 #define RCC_CIR_LSERDYC ((uint32_t)0x00020000) /*!< LSE Ready Interrupt Clear */
mbed_official 392:2b59412bb664 1717 #define RCC_CIR_HSIRDYC ((uint32_t)0x00040000) /*!< HSI Ready Interrupt Clear */
mbed_official 392:2b59412bb664 1718 #define RCC_CIR_HSERDYC ((uint32_t)0x00080000) /*!< HSE Ready Interrupt Clear */
mbed_official 392:2b59412bb664 1719 #define RCC_CIR_PLLRDYC ((uint32_t)0x00100000) /*!< PLL Ready Interrupt Clear */
mbed_official 392:2b59412bb664 1720 #define RCC_CIR_HSI14RDYC ((uint32_t)0x00200000) /*!< HSI14 Ready Interrupt Clear */
mbed_official 392:2b59412bb664 1721 #define RCC_CIR_CSSC ((uint32_t)0x00800000) /*!< Clock Security System Interrupt Clear */
mbed_official 392:2b59412bb664 1722
mbed_official 392:2b59412bb664 1723 /***************** Bit definition for RCC_APB2RSTR register ****************/
mbed_official 392:2b59412bb664 1724 #define RCC_APB2RSTR_SYSCFGRST ((uint32_t)0x00000001) /*!< SYSCFG clock reset */
mbed_official 392:2b59412bb664 1725 #define RCC_APB2RSTR_ADCRST ((uint32_t)0x00000200) /*!< ADC clock reset */
mbed_official 392:2b59412bb664 1726 #define RCC_APB2RSTR_TIM1RST ((uint32_t)0x00000800) /*!< TIM1 clock reset */
mbed_official 392:2b59412bb664 1727 #define RCC_APB2RSTR_SPI1RST ((uint32_t)0x00001000) /*!< SPI1 clock reset */
mbed_official 392:2b59412bb664 1728 #define RCC_APB2RSTR_USART1RST ((uint32_t)0x00004000) /*!< USART1 clock reset */
mbed_official 392:2b59412bb664 1729 #define RCC_APB2RSTR_TIM15RST ((uint32_t)0x00010000) /*!< TIM15 clock reset */
mbed_official 392:2b59412bb664 1730 #define RCC_APB2RSTR_TIM16RST ((uint32_t)0x00020000) /*!< TIM16 clock reset */
mbed_official 392:2b59412bb664 1731 #define RCC_APB2RSTR_TIM17RST ((uint32_t)0x00040000) /*!< TIM17 clock reset */
mbed_official 392:2b59412bb664 1732 #define RCC_APB2RSTR_DBGMCURST ((uint32_t)0x00400000) /*!< DBGMCU clock reset */
mbed_official 392:2b59412bb664 1733
mbed_official 392:2b59412bb664 1734 /*!< Old ADC1 clock reset bit definition maintained for legacy purpose */
mbed_official 392:2b59412bb664 1735 #define RCC_APB2RSTR_ADC1RST RCC_APB2RSTR_ADCRST
mbed_official 392:2b59412bb664 1736
mbed_official 392:2b59412bb664 1737 /***************** Bit definition for RCC_APB1RSTR register ****************/
mbed_official 392:2b59412bb664 1738 #define RCC_APB1RSTR_TIM3RST ((uint32_t)0x00000002) /*!< Timer 3 clock reset */
mbed_official 392:2b59412bb664 1739 #define RCC_APB1RSTR_TIM6RST ((uint32_t)0x00000010) /*!< Timer 6 clock reset */
mbed_official 392:2b59412bb664 1740 #define RCC_APB1RSTR_TIM14RST ((uint32_t)0x00000100) /*!< Timer 14 clock reset */
mbed_official 392:2b59412bb664 1741 #define RCC_APB1RSTR_WWDGRST ((uint32_t)0x00000800) /*!< Window Watchdog clock reset */
mbed_official 392:2b59412bb664 1742 #define RCC_APB1RSTR_SPI2RST ((uint32_t)0x00004000) /*!< SPI2 clock reset */
mbed_official 392:2b59412bb664 1743 #define RCC_APB1RSTR_USART2RST ((uint32_t)0x00020000) /*!< USART 2 clock reset */
mbed_official 392:2b59412bb664 1744 #define RCC_APB1RSTR_I2C1RST ((uint32_t)0x00200000) /*!< I2C 1 clock reset */
mbed_official 392:2b59412bb664 1745 #define RCC_APB1RSTR_I2C2RST ((uint32_t)0x00400000) /*!< I2C 2 clock reset */
mbed_official 392:2b59412bb664 1746 #define RCC_APB1RSTR_PWRRST ((uint32_t)0x10000000) /*!< PWR clock reset */
mbed_official 392:2b59412bb664 1747
mbed_official 392:2b59412bb664 1748 /****************** Bit definition for RCC_AHBENR register *****************/
mbed_official 392:2b59412bb664 1749 #define RCC_AHBENR_DMAEN ((uint32_t)0x00000001) /*!< DMA1 clock enable */
mbed_official 392:2b59412bb664 1750 #define RCC_AHBENR_SRAMEN ((uint32_t)0x00000004) /*!< SRAM interface clock enable */
mbed_official 392:2b59412bb664 1751 #define RCC_AHBENR_FLITFEN ((uint32_t)0x00000010) /*!< FLITF clock enable */
mbed_official 392:2b59412bb664 1752 #define RCC_AHBENR_CRCEN ((uint32_t)0x00000040) /*!< CRC clock enable */
mbed_official 392:2b59412bb664 1753 #define RCC_AHBENR_GPIOAEN ((uint32_t)0x00020000) /*!< GPIOA clock enable */
mbed_official 392:2b59412bb664 1754 #define RCC_AHBENR_GPIOBEN ((uint32_t)0x00040000) /*!< GPIOB clock enable */
mbed_official 392:2b59412bb664 1755 #define RCC_AHBENR_GPIOCEN ((uint32_t)0x00080000) /*!< GPIOC clock enable */
mbed_official 392:2b59412bb664 1756 #define RCC_AHBENR_GPIODEN ((uint32_t)0x00100000) /*!< GPIOD clock enable */
mbed_official 392:2b59412bb664 1757 #define RCC_AHBENR_GPIOFEN ((uint32_t)0x00400000) /*!< GPIOF clock enable */
mbed_official 392:2b59412bb664 1758
mbed_official 392:2b59412bb664 1759 /* Old Bit definition maintained for legacy purpose */
mbed_official 392:2b59412bb664 1760 #define RCC_AHBENR_DMA1EN RCC_AHBENR_DMAEN /*!< DMA1 clock enable */
mbed_official 392:2b59412bb664 1761 #define RCC_AHBENR_TSEN RCC_AHBENR_TSCEN /*!< TS clock enable */
mbed_official 392:2b59412bb664 1762
mbed_official 392:2b59412bb664 1763 /***************** Bit definition for RCC_APB2ENR register *****************/
mbed_official 392:2b59412bb664 1764 #define RCC_APB2ENR_SYSCFGCOMPEN ((uint32_t)0x00000001) /*!< SYSCFG and comparator clock enable */
mbed_official 392:2b59412bb664 1765 #define RCC_APB2ENR_ADCEN ((uint32_t)0x00000200) /*!< ADC1 clock enable */
mbed_official 392:2b59412bb664 1766 #define RCC_APB2ENR_TIM1EN ((uint32_t)0x00000800) /*!< TIM1 clock enable */
mbed_official 392:2b59412bb664 1767 #define RCC_APB2ENR_SPI1EN ((uint32_t)0x00001000) /*!< SPI1 clock enable */
mbed_official 392:2b59412bb664 1768 #define RCC_APB2ENR_USART1EN ((uint32_t)0x00004000) /*!< USART1 clock enable */
mbed_official 392:2b59412bb664 1769 #define RCC_APB2ENR_TIM15EN ((uint32_t)0x00010000) /*!< TIM15 clock enable */
mbed_official 392:2b59412bb664 1770 #define RCC_APB2ENR_TIM16EN ((uint32_t)0x00020000) /*!< TIM16 clock enable */
mbed_official 392:2b59412bb664 1771 #define RCC_APB2ENR_TIM17EN ((uint32_t)0x00040000) /*!< TIM17 clock enable */
mbed_official 392:2b59412bb664 1772 #define RCC_APB2ENR_DBGMCUEN ((uint32_t)0x00400000) /*!< DBGMCU clock enable */
mbed_official 392:2b59412bb664 1773
mbed_official 392:2b59412bb664 1774 /* Old Bit definition maintained for legacy purpose */
mbed_official 392:2b59412bb664 1775 #define RCC_APB2ENR_SYSCFGEN RCC_APB2ENR_SYSCFGCOMPEN /*!< SYSCFG clock enable */
mbed_official 392:2b59412bb664 1776 #define RCC_APB2ENR_ADC1EN RCC_APB2ENR_ADCEN /*!< ADC1 clock enable */
mbed_official 392:2b59412bb664 1777
mbed_official 392:2b59412bb664 1778 /***************** Bit definition for RCC_APB1ENR register *****************/
mbed_official 392:2b59412bb664 1779 #define RCC_APB1ENR_TIM3EN ((uint32_t)0x00000002) /*!< Timer 3 clock enable */
mbed_official 392:2b59412bb664 1780 #define RCC_APB1ENR_TIM6EN ((uint32_t)0x00000010) /*!< Timer 6 clock enable */
mbed_official 392:2b59412bb664 1781 #define RCC_APB1ENR_TIM14EN ((uint32_t)0x00000100) /*!< Timer 14 clock enable */
mbed_official 392:2b59412bb664 1782 #define RCC_APB1ENR_WWDGEN ((uint32_t)0x00000800) /*!< Window Watchdog clock enable */
mbed_official 392:2b59412bb664 1783 #define RCC_APB1ENR_SPI2EN ((uint32_t)0x00004000) /*!< SPI2 clock enable */
mbed_official 392:2b59412bb664 1784 #define RCC_APB1ENR_USART2EN ((uint32_t)0x00020000) /*!< USART2 clock enable */
mbed_official 392:2b59412bb664 1785 #define RCC_APB1ENR_I2C1EN ((uint32_t)0x00200000) /*!< I2C1 clock enable */
mbed_official 392:2b59412bb664 1786 #define RCC_APB1ENR_I2C2EN ((uint32_t)0x00400000) /*!< I2C2 clock enable */
mbed_official 392:2b59412bb664 1787 #define RCC_APB1ENR_PWREN ((uint32_t)0x10000000) /*!< PWR clock enable */
mbed_official 392:2b59412bb664 1788
mbed_official 392:2b59412bb664 1789 /******************* Bit definition for RCC_BDCR register ******************/
mbed_official 392:2b59412bb664 1790 #define RCC_BDCR_LSEON ((uint32_t)0x00000001) /*!< External Low Speed oscillator enable */
mbed_official 392:2b59412bb664 1791 #define RCC_BDCR_LSERDY ((uint32_t)0x00000002) /*!< External Low Speed oscillator Ready */
mbed_official 392:2b59412bb664 1792 #define RCC_BDCR_LSEBYP ((uint32_t)0x00000004) /*!< External Low Speed oscillator Bypass */
mbed_official 392:2b59412bb664 1793
mbed_official 392:2b59412bb664 1794 #define RCC_BDCR_LSEDRV ((uint32_t)0x00000018) /*!< LSEDRV[1:0] bits (LSE Osc. drive capability) */
mbed_official 392:2b59412bb664 1795 #define RCC_BDCR_LSEDRV_0 ((uint32_t)0x00000008) /*!< Bit 0 */
mbed_official 392:2b59412bb664 1796 #define RCC_BDCR_LSEDRV_1 ((uint32_t)0x00000010) /*!< Bit 1 */
mbed_official 392:2b59412bb664 1797
mbed_official 392:2b59412bb664 1798 #define RCC_BDCR_RTCSEL ((uint32_t)0x00000300) /*!< RTCSEL[1:0] bits (RTC clock source selection) */
mbed_official 392:2b59412bb664 1799 #define RCC_BDCR_RTCSEL_0 ((uint32_t)0x00000100) /*!< Bit 0 */
mbed_official 392:2b59412bb664 1800 #define RCC_BDCR_RTCSEL_1 ((uint32_t)0x00000200) /*!< Bit 1 */
mbed_official 392:2b59412bb664 1801
mbed_official 392:2b59412bb664 1802 /*!< RTC configuration */
mbed_official 392:2b59412bb664 1803 #define RCC_BDCR_RTCSEL_NOCLOCK ((uint32_t)0x00000000) /*!< No clock */
mbed_official 392:2b59412bb664 1804 #define RCC_BDCR_RTCSEL_LSE ((uint32_t)0x00000100) /*!< LSE oscillator clock used as RTC clock */
mbed_official 392:2b59412bb664 1805 #define RCC_BDCR_RTCSEL_LSI ((uint32_t)0x00000200) /*!< LSI oscillator clock used as RTC clock */
mbed_official 392:2b59412bb664 1806 #define RCC_BDCR_RTCSEL_HSE ((uint32_t)0x00000300) /*!< HSE oscillator clock divided by 128 used as RTC clock */
mbed_official 392:2b59412bb664 1807
mbed_official 392:2b59412bb664 1808 #define RCC_BDCR_RTCEN ((uint32_t)0x00008000) /*!< RTC clock enable */
mbed_official 392:2b59412bb664 1809 #define RCC_BDCR_BDRST ((uint32_t)0x00010000) /*!< Backup domain software reset */
mbed_official 392:2b59412bb664 1810
mbed_official 392:2b59412bb664 1811 /******************* Bit definition for RCC_CSR register *******************/
mbed_official 392:2b59412bb664 1812 #define RCC_CSR_LSION ((uint32_t)0x00000001) /*!< Internal Low Speed oscillator enable */
mbed_official 392:2b59412bb664 1813 #define RCC_CSR_LSIRDY ((uint32_t)0x00000002) /*!< Internal Low Speed oscillator Ready */
mbed_official 392:2b59412bb664 1814 #define RCC_CSR_V18PWRRSTF ((uint32_t)0x00800000) /*!< V1.8 power domain reset flag */
mbed_official 392:2b59412bb664 1815 #define RCC_CSR_RMVF ((uint32_t)0x01000000) /*!< Remove reset flag */
mbed_official 392:2b59412bb664 1816 #define RCC_CSR_OBLRSTF ((uint32_t)0x02000000) /*!< OBL reset flag */
mbed_official 392:2b59412bb664 1817 #define RCC_CSR_PINRSTF ((uint32_t)0x04000000) /*!< PIN reset flag */
mbed_official 392:2b59412bb664 1818 #define RCC_CSR_PORRSTF ((uint32_t)0x08000000) /*!< POR/PDR reset flag */
mbed_official 392:2b59412bb664 1819 #define RCC_CSR_SFTRSTF ((uint32_t)0x10000000) /*!< Software Reset flag */
mbed_official 392:2b59412bb664 1820 #define RCC_CSR_IWDGRSTF ((uint32_t)0x20000000) /*!< Independent Watchdog reset flag */
mbed_official 392:2b59412bb664 1821 #define RCC_CSR_WWDGRSTF ((uint32_t)0x40000000) /*!< Window watchdog reset flag */
mbed_official 392:2b59412bb664 1822 #define RCC_CSR_LPWRRSTF ((uint32_t)0x80000000) /*!< Low-Power reset flag */
mbed_official 392:2b59412bb664 1823
mbed_official 392:2b59412bb664 1824 /* Old Bit definition maintained for legacy purpose */
mbed_official 392:2b59412bb664 1825 #define RCC_CSR_OBL RCC_CSR_OBLRSTF /*!< OBL reset flag */
mbed_official 392:2b59412bb664 1826
mbed_official 392:2b59412bb664 1827 /******************* Bit definition for RCC_AHBRSTR register ***************/
mbed_official 392:2b59412bb664 1828 #define RCC_AHBRSTR_GPIOARST ((uint32_t)0x00020000) /*!< GPIOA clock reset */
mbed_official 392:2b59412bb664 1829 #define RCC_AHBRSTR_GPIOBRST ((uint32_t)0x00040000) /*!< GPIOB clock reset */
mbed_official 392:2b59412bb664 1830 #define RCC_AHBRSTR_GPIOCRST ((uint32_t)0x00080000) /*!< GPIOC clock reset */
mbed_official 392:2b59412bb664 1831 #define RCC_AHBRSTR_GPIODRST ((uint32_t)0x00100000) /*!< GPIOD clock reset */
mbed_official 392:2b59412bb664 1832 #define RCC_AHBRSTR_GPIOFRST ((uint32_t)0x00400000) /*!< GPIOF clock reset */
mbed_official 392:2b59412bb664 1833
mbed_official 392:2b59412bb664 1834 /******************* Bit definition for RCC_CFGR2 register *****************/
mbed_official 392:2b59412bb664 1835 /*!< PREDIV configuration */
mbed_official 392:2b59412bb664 1836 #define RCC_CFGR2_PREDIV ((uint32_t)0x0000000F) /*!< PREDIV[3:0] bits */
mbed_official 392:2b59412bb664 1837 #define RCC_CFGR2_PREDIV_0 ((uint32_t)0x00000001) /*!< Bit 0 */
mbed_official 392:2b59412bb664 1838 #define RCC_CFGR2_PREDIV_1 ((uint32_t)0x00000002) /*!< Bit 1 */
mbed_official 392:2b59412bb664 1839 #define RCC_CFGR2_PREDIV_2 ((uint32_t)0x00000004) /*!< Bit 2 */
mbed_official 392:2b59412bb664 1840 #define RCC_CFGR2_PREDIV_3 ((uint32_t)0x00000008) /*!< Bit 3 */
mbed_official 392:2b59412bb664 1841
mbed_official 392:2b59412bb664 1842 #define RCC_CFGR2_PREDIV_DIV1 ((uint32_t)0x00000000) /*!< PREDIV input clock not divided */
mbed_official 392:2b59412bb664 1843 #define RCC_CFGR2_PREDIV_DIV2 ((uint32_t)0x00000001) /*!< PREDIV input clock divided by 2 */
mbed_official 392:2b59412bb664 1844 #define RCC_CFGR2_PREDIV_DIV3 ((uint32_t)0x00000002) /*!< PREDIV input clock divided by 3 */
mbed_official 392:2b59412bb664 1845 #define RCC_CFGR2_PREDIV_DIV4 ((uint32_t)0x00000003) /*!< PREDIV input clock divided by 4 */
mbed_official 392:2b59412bb664 1846 #define RCC_CFGR2_PREDIV_DIV5 ((uint32_t)0x00000004) /*!< PREDIV input clock divided by 5 */
mbed_official 392:2b59412bb664 1847 #define RCC_CFGR2_PREDIV_DIV6 ((uint32_t)0x00000005) /*!< PREDIV input clock divided by 6 */
mbed_official 392:2b59412bb664 1848 #define RCC_CFGR2_PREDIV_DIV7 ((uint32_t)0x00000006) /*!< PREDIV input clock divided by 7 */
mbed_official 392:2b59412bb664 1849 #define RCC_CFGR2_PREDIV_DIV8 ((uint32_t)0x00000007) /*!< PREDIV input clock divided by 8 */
mbed_official 392:2b59412bb664 1850 #define RCC_CFGR2_PREDIV_DIV9 ((uint32_t)0x00000008) /*!< PREDIV input clock divided by 9 */
mbed_official 392:2b59412bb664 1851 #define RCC_CFGR2_PREDIV_DIV10 ((uint32_t)0x00000009) /*!< PREDIV input clock divided by 10 */
mbed_official 392:2b59412bb664 1852 #define RCC_CFGR2_PREDIV_DIV11 ((uint32_t)0x0000000A) /*!< PREDIV input clock divided by 11 */
mbed_official 392:2b59412bb664 1853 #define RCC_CFGR2_PREDIV_DIV12 ((uint32_t)0x0000000B) /*!< PREDIV input clock divided by 12 */
mbed_official 392:2b59412bb664 1854 #define RCC_CFGR2_PREDIV_DIV13 ((uint32_t)0x0000000C) /*!< PREDIV input clock divided by 13 */
mbed_official 392:2b59412bb664 1855 #define RCC_CFGR2_PREDIV_DIV14 ((uint32_t)0x0000000D) /*!< PREDIV input clock divided by 14 */
mbed_official 392:2b59412bb664 1856 #define RCC_CFGR2_PREDIV_DIV15 ((uint32_t)0x0000000E) /*!< PREDIV input clock divided by 15 */
mbed_official 392:2b59412bb664 1857 #define RCC_CFGR2_PREDIV_DIV16 ((uint32_t)0x0000000F) /*!< PREDIV input clock divided by 16 */
mbed_official 392:2b59412bb664 1858
mbed_official 392:2b59412bb664 1859 /******************* Bit definition for RCC_CFGR3 register *****************/
mbed_official 392:2b59412bb664 1860 /*!< USART1 Clock source selection */
mbed_official 392:2b59412bb664 1861 #define RCC_CFGR3_USART1SW ((uint32_t)0x00000003) /*!< USART1SW[1:0] bits */
mbed_official 392:2b59412bb664 1862 #define RCC_CFGR3_USART1SW_0 ((uint32_t)0x00000001) /*!< Bit 0 */
mbed_official 392:2b59412bb664 1863 #define RCC_CFGR3_USART1SW_1 ((uint32_t)0x00000002) /*!< Bit 1 */
mbed_official 392:2b59412bb664 1864
mbed_official 392:2b59412bb664 1865 #define RCC_CFGR3_USART1SW_PCLK ((uint32_t)0x00000000) /*!< PCLK clock used as USART1 clock source */
mbed_official 392:2b59412bb664 1866 #define RCC_CFGR3_USART1SW_SYSCLK ((uint32_t)0x00000001) /*!< System clock selected as USART1 clock source */
mbed_official 392:2b59412bb664 1867 #define RCC_CFGR3_USART1SW_LSE ((uint32_t)0x00000002) /*!< LSE oscillator clock used as USART1 clock source */
mbed_official 392:2b59412bb664 1868 #define RCC_CFGR3_USART1SW_HSI ((uint32_t)0x00000003) /*!< HSI oscillator clock used as USART1 clock source */
mbed_official 392:2b59412bb664 1869
mbed_official 392:2b59412bb664 1870 /*!< I2C1 Clock source selection */
mbed_official 392:2b59412bb664 1871 #define RCC_CFGR3_I2C1SW ((uint32_t)0x00000010) /*!< I2C1SW bits */
mbed_official 392:2b59412bb664 1872
mbed_official 392:2b59412bb664 1873 #define RCC_CFGR3_I2C1SW_HSI ((uint32_t)0x00000000) /*!< HSI oscillator clock used as I2C1 clock source */
mbed_official 392:2b59412bb664 1874 #define RCC_CFGR3_I2C1SW_SYSCLK ((uint32_t)0x00000010) /*!< System clock selected as I2C1 clock source */
mbed_official 392:2b59412bb664 1875
mbed_official 392:2b59412bb664 1876 /*!< USART2 Clock source selection */
mbed_official 392:2b59412bb664 1877 #define RCC_CFGR3_USART2SW ((uint32_t)0x00030000) /*!< USART2SW[1:0] bits */
mbed_official 392:2b59412bb664 1878 #define RCC_CFGR3_USART2SW_0 ((uint32_t)0x00010000) /*!< Bit 0 */
mbed_official 392:2b59412bb664 1879 #define RCC_CFGR3_USART2SW_1 ((uint32_t)0x00020000) /*!< Bit 1 */
mbed_official 392:2b59412bb664 1880
mbed_official 392:2b59412bb664 1881 #define RCC_CFGR3_USART2SW_PCLK ((uint32_t)0x00000000) /*!< PCLK clock used as USART2 clock source */
mbed_official 392:2b59412bb664 1882 #define RCC_CFGR3_USART2SW_SYSCLK ((uint32_t)0x00010000) /*!< System clock selected as USART2 clock source */
mbed_official 392:2b59412bb664 1883 #define RCC_CFGR3_USART2SW_LSE ((uint32_t)0x00020000) /*!< LSE oscillator clock used as USART2 clock source */
mbed_official 392:2b59412bb664 1884 #define RCC_CFGR3_USART2SW_HSI ((uint32_t)0x00030000) /*!< HSI oscillator clock used as USART2 clock source */
mbed_official 392:2b59412bb664 1885
mbed_official 392:2b59412bb664 1886 /******************* Bit definition for RCC_CR2 register *******************/
mbed_official 392:2b59412bb664 1887 #define RCC_CR2_HSI14ON ((uint32_t)0x00000001) /*!< Internal High Speed 14MHz clock enable */
mbed_official 392:2b59412bb664 1888 #define RCC_CR2_HSI14RDY ((uint32_t)0x00000002) /*!< Internal High Speed 14MHz clock ready flag */
mbed_official 392:2b59412bb664 1889 #define RCC_CR2_HSI14DIS ((uint32_t)0x00000004) /*!< Internal High Speed 14MHz clock disable */
mbed_official 392:2b59412bb664 1890 #define RCC_CR2_HSI14TRIM ((uint32_t)0x000000F8) /*!< Internal High Speed 14MHz clock trimming */
mbed_official 392:2b59412bb664 1891 #define RCC_CR2_HSI14CAL ((uint32_t)0x0000FF00) /*!< Internal High Speed 14MHz clock Calibration */
mbed_official 392:2b59412bb664 1892
mbed_official 392:2b59412bb664 1893 /*****************************************************************************/
mbed_official 392:2b59412bb664 1894 /* */
mbed_official 392:2b59412bb664 1895 /* Real-Time Clock (RTC) */
mbed_official 392:2b59412bb664 1896 /* */
mbed_official 392:2b59412bb664 1897 /*****************************************************************************/
mbed_official 392:2b59412bb664 1898 /******************** Bits definition for RTC_TR register ******************/
mbed_official 392:2b59412bb664 1899 #define RTC_TR_PM ((uint32_t)0x00400000)
mbed_official 392:2b59412bb664 1900 #define RTC_TR_HT ((uint32_t)0x00300000)
mbed_official 392:2b59412bb664 1901 #define RTC_TR_HT_0 ((uint32_t)0x00100000)
mbed_official 392:2b59412bb664 1902 #define RTC_TR_HT_1 ((uint32_t)0x00200000)
mbed_official 392:2b59412bb664 1903 #define RTC_TR_HU ((uint32_t)0x000F0000)
mbed_official 392:2b59412bb664 1904 #define RTC_TR_HU_0 ((uint32_t)0x00010000)
mbed_official 392:2b59412bb664 1905 #define RTC_TR_HU_1 ((uint32_t)0x00020000)
mbed_official 392:2b59412bb664 1906 #define RTC_TR_HU_2 ((uint32_t)0x00040000)
mbed_official 392:2b59412bb664 1907 #define RTC_TR_HU_3 ((uint32_t)0x00080000)
mbed_official 392:2b59412bb664 1908 #define RTC_TR_MNT ((uint32_t)0x00007000)
mbed_official 392:2b59412bb664 1909 #define RTC_TR_MNT_0 ((uint32_t)0x00001000)
mbed_official 392:2b59412bb664 1910 #define RTC_TR_MNT_1 ((uint32_t)0x00002000)
mbed_official 392:2b59412bb664 1911 #define RTC_TR_MNT_2 ((uint32_t)0x00004000)
mbed_official 392:2b59412bb664 1912 #define RTC_TR_MNU ((uint32_t)0x00000F00)
mbed_official 392:2b59412bb664 1913 #define RTC_TR_MNU_0 ((uint32_t)0x00000100)
mbed_official 392:2b59412bb664 1914 #define RTC_TR_MNU_1 ((uint32_t)0x00000200)
mbed_official 392:2b59412bb664 1915 #define RTC_TR_MNU_2 ((uint32_t)0x00000400)
mbed_official 392:2b59412bb664 1916 #define RTC_TR_MNU_3 ((uint32_t)0x00000800)
mbed_official 392:2b59412bb664 1917 #define RTC_TR_ST ((uint32_t)0x00000070)
mbed_official 392:2b59412bb664 1918 #define RTC_TR_ST_0 ((uint32_t)0x00000010)
mbed_official 392:2b59412bb664 1919 #define RTC_TR_ST_1 ((uint32_t)0x00000020)
mbed_official 392:2b59412bb664 1920 #define RTC_TR_ST_2 ((uint32_t)0x00000040)
mbed_official 392:2b59412bb664 1921 #define RTC_TR_SU ((uint32_t)0x0000000F)
mbed_official 392:2b59412bb664 1922 #define RTC_TR_SU_0 ((uint32_t)0x00000001)
mbed_official 392:2b59412bb664 1923 #define RTC_TR_SU_1 ((uint32_t)0x00000002)
mbed_official 392:2b59412bb664 1924 #define RTC_TR_SU_2 ((uint32_t)0x00000004)
mbed_official 392:2b59412bb664 1925 #define RTC_TR_SU_3 ((uint32_t)0x00000008)
mbed_official 392:2b59412bb664 1926
mbed_official 392:2b59412bb664 1927 /******************** Bits definition for RTC_DR register ******************/
mbed_official 392:2b59412bb664 1928 #define RTC_DR_YT ((uint32_t)0x00F00000)
mbed_official 392:2b59412bb664 1929 #define RTC_DR_YT_0 ((uint32_t)0x00100000)
mbed_official 392:2b59412bb664 1930 #define RTC_DR_YT_1 ((uint32_t)0x00200000)
mbed_official 392:2b59412bb664 1931 #define RTC_DR_YT_2 ((uint32_t)0x00400000)
mbed_official 392:2b59412bb664 1932 #define RTC_DR_YT_3 ((uint32_t)0x00800000)
mbed_official 392:2b59412bb664 1933 #define RTC_DR_YU ((uint32_t)0x000F0000)
mbed_official 392:2b59412bb664 1934 #define RTC_DR_YU_0 ((uint32_t)0x00010000)
mbed_official 392:2b59412bb664 1935 #define RTC_DR_YU_1 ((uint32_t)0x00020000)
mbed_official 392:2b59412bb664 1936 #define RTC_DR_YU_2 ((uint32_t)0x00040000)
mbed_official 392:2b59412bb664 1937 #define RTC_DR_YU_3 ((uint32_t)0x00080000)
mbed_official 392:2b59412bb664 1938 #define RTC_DR_WDU ((uint32_t)0x0000E000)
mbed_official 392:2b59412bb664 1939 #define RTC_DR_WDU_0 ((uint32_t)0x00002000)
mbed_official 392:2b59412bb664 1940 #define RTC_DR_WDU_1 ((uint32_t)0x00004000)
mbed_official 392:2b59412bb664 1941 #define RTC_DR_WDU_2 ((uint32_t)0x00008000)
mbed_official 392:2b59412bb664 1942 #define RTC_DR_MT ((uint32_t)0x00001000)
mbed_official 392:2b59412bb664 1943 #define RTC_DR_MU ((uint32_t)0x00000F00)
mbed_official 392:2b59412bb664 1944 #define RTC_DR_MU_0 ((uint32_t)0x00000100)
mbed_official 392:2b59412bb664 1945 #define RTC_DR_MU_1 ((uint32_t)0x00000200)
mbed_official 392:2b59412bb664 1946 #define RTC_DR_MU_2 ((uint32_t)0x00000400)
mbed_official 392:2b59412bb664 1947 #define RTC_DR_MU_3 ((uint32_t)0x00000800)
mbed_official 392:2b59412bb664 1948 #define RTC_DR_DT ((uint32_t)0x00000030)
mbed_official 392:2b59412bb664 1949 #define RTC_DR_DT_0 ((uint32_t)0x00000010)
mbed_official 392:2b59412bb664 1950 #define RTC_DR_DT_1 ((uint32_t)0x00000020)
mbed_official 392:2b59412bb664 1951 #define RTC_DR_DU ((uint32_t)0x0000000F)
mbed_official 392:2b59412bb664 1952 #define RTC_DR_DU_0 ((uint32_t)0x00000001)
mbed_official 392:2b59412bb664 1953 #define RTC_DR_DU_1 ((uint32_t)0x00000002)
mbed_official 392:2b59412bb664 1954 #define RTC_DR_DU_2 ((uint32_t)0x00000004)
mbed_official 392:2b59412bb664 1955 #define RTC_DR_DU_3 ((uint32_t)0x00000008)
mbed_official 392:2b59412bb664 1956
mbed_official 392:2b59412bb664 1957 /******************** Bits definition for RTC_CR register ******************/
mbed_official 392:2b59412bb664 1958 #define RTC_CR_COE ((uint32_t)0x00800000)
mbed_official 392:2b59412bb664 1959 #define RTC_CR_OSEL ((uint32_t)0x00600000)
mbed_official 392:2b59412bb664 1960 #define RTC_CR_OSEL_0 ((uint32_t)0x00200000)
mbed_official 392:2b59412bb664 1961 #define RTC_CR_OSEL_1 ((uint32_t)0x00400000)
mbed_official 392:2b59412bb664 1962 #define RTC_CR_POL ((uint32_t)0x00100000)
mbed_official 392:2b59412bb664 1963 #define RTC_CR_COSEL ((uint32_t)0x00080000)
mbed_official 392:2b59412bb664 1964 #define RTC_CR_BCK ((uint32_t)0x00040000)
mbed_official 392:2b59412bb664 1965 #define RTC_CR_SUB1H ((uint32_t)0x00020000)
mbed_official 392:2b59412bb664 1966 #define RTC_CR_ADD1H ((uint32_t)0x00010000)
mbed_official 392:2b59412bb664 1967 #define RTC_CR_TSIE ((uint32_t)0x00008000)
mbed_official 392:2b59412bb664 1968 #define RTC_CR_ALRAIE ((uint32_t)0x00001000)
mbed_official 392:2b59412bb664 1969 #define RTC_CR_TSE ((uint32_t)0x00000800)
mbed_official 392:2b59412bb664 1970 #define RTC_CR_ALRAE ((uint32_t)0x00000100)
mbed_official 392:2b59412bb664 1971 #define RTC_CR_FMT ((uint32_t)0x00000040)
mbed_official 392:2b59412bb664 1972 #define RTC_CR_BYPSHAD ((uint32_t)0x00000020)
mbed_official 392:2b59412bb664 1973 #define RTC_CR_REFCKON ((uint32_t)0x00000010)
mbed_official 392:2b59412bb664 1974 #define RTC_CR_TSEDGE ((uint32_t)0x00000008)
mbed_official 392:2b59412bb664 1975
mbed_official 392:2b59412bb664 1976 /******************** Bits definition for RTC_ISR register *****************/
mbed_official 392:2b59412bb664 1977 #define RTC_ISR_RECALPF ((uint32_t)0x00010000)
mbed_official 392:2b59412bb664 1978 #define RTC_ISR_TAMP2F ((uint32_t)0x00004000)
mbed_official 392:2b59412bb664 1979 #define RTC_ISR_TAMP1F ((uint32_t)0x00002000)
mbed_official 392:2b59412bb664 1980 #define RTC_ISR_TSOVF ((uint32_t)0x00001000)
mbed_official 392:2b59412bb664 1981 #define RTC_ISR_TSF ((uint32_t)0x00000800)
mbed_official 392:2b59412bb664 1982 #define RTC_ISR_ALRAF ((uint32_t)0x00000100)
mbed_official 392:2b59412bb664 1983 #define RTC_ISR_INIT ((uint32_t)0x00000080)
mbed_official 392:2b59412bb664 1984 #define RTC_ISR_INITF ((uint32_t)0x00000040)
mbed_official 392:2b59412bb664 1985 #define RTC_ISR_RSF ((uint32_t)0x00000020)
mbed_official 392:2b59412bb664 1986 #define RTC_ISR_INITS ((uint32_t)0x00000010)
mbed_official 392:2b59412bb664 1987 #define RTC_ISR_SHPF ((uint32_t)0x00000008)
mbed_official 392:2b59412bb664 1988 #define RTC_ISR_ALRAWF ((uint32_t)0x00000001)
mbed_official 392:2b59412bb664 1989
mbed_official 392:2b59412bb664 1990 /******************** Bits definition for RTC_PRER register ****************/
mbed_official 392:2b59412bb664 1991 #define RTC_PRER_PREDIV_A ((uint32_t)0x007F0000)
mbed_official 392:2b59412bb664 1992 #define RTC_PRER_PREDIV_S ((uint32_t)0x00007FFF)
mbed_official 392:2b59412bb664 1993
mbed_official 392:2b59412bb664 1994 /******************** Bits definition for RTC_ALRMAR register **************/
mbed_official 392:2b59412bb664 1995 #define RTC_ALRMAR_MSK4 ((uint32_t)0x80000000)
mbed_official 392:2b59412bb664 1996 #define RTC_ALRMAR_WDSEL ((uint32_t)0x40000000)
mbed_official 392:2b59412bb664 1997 #define RTC_ALRMAR_DT ((uint32_t)0x30000000)
mbed_official 392:2b59412bb664 1998 #define RTC_ALRMAR_DT_0 ((uint32_t)0x10000000)
mbed_official 392:2b59412bb664 1999 #define RTC_ALRMAR_DT_1 ((uint32_t)0x20000000)
mbed_official 392:2b59412bb664 2000 #define RTC_ALRMAR_DU ((uint32_t)0x0F000000)
mbed_official 392:2b59412bb664 2001 #define RTC_ALRMAR_DU_0 ((uint32_t)0x01000000)
mbed_official 392:2b59412bb664 2002 #define RTC_ALRMAR_DU_1 ((uint32_t)0x02000000)
mbed_official 392:2b59412bb664 2003 #define RTC_ALRMAR_DU_2 ((uint32_t)0x04000000)
mbed_official 392:2b59412bb664 2004 #define RTC_ALRMAR_DU_3 ((uint32_t)0x08000000)
mbed_official 392:2b59412bb664 2005 #define RTC_ALRMAR_MSK3 ((uint32_t)0x00800000)
mbed_official 392:2b59412bb664 2006 #define RTC_ALRMAR_PM ((uint32_t)0x00400000)
mbed_official 392:2b59412bb664 2007 #define RTC_ALRMAR_HT ((uint32_t)0x00300000)
mbed_official 392:2b59412bb664 2008 #define RTC_ALRMAR_HT_0 ((uint32_t)0x00100000)
mbed_official 392:2b59412bb664 2009 #define RTC_ALRMAR_HT_1 ((uint32_t)0x00200000)
mbed_official 392:2b59412bb664 2010 #define RTC_ALRMAR_HU ((uint32_t)0x000F0000)
mbed_official 392:2b59412bb664 2011 #define RTC_ALRMAR_HU_0 ((uint32_t)0x00010000)
mbed_official 392:2b59412bb664 2012 #define RTC_ALRMAR_HU_1 ((uint32_t)0x00020000)
mbed_official 392:2b59412bb664 2013 #define RTC_ALRMAR_HU_2 ((uint32_t)0x00040000)
mbed_official 392:2b59412bb664 2014 #define RTC_ALRMAR_HU_3 ((uint32_t)0x00080000)
mbed_official 392:2b59412bb664 2015 #define RTC_ALRMAR_MSK2 ((uint32_t)0x00008000)
mbed_official 392:2b59412bb664 2016 #define RTC_ALRMAR_MNT ((uint32_t)0x00007000)
mbed_official 392:2b59412bb664 2017 #define RTC_ALRMAR_MNT_0 ((uint32_t)0x00001000)
mbed_official 392:2b59412bb664 2018 #define RTC_ALRMAR_MNT_1 ((uint32_t)0x00002000)
mbed_official 392:2b59412bb664 2019 #define RTC_ALRMAR_MNT_2 ((uint32_t)0x00004000)
mbed_official 392:2b59412bb664 2020 #define RTC_ALRMAR_MNU ((uint32_t)0x00000F00)
mbed_official 392:2b59412bb664 2021 #define RTC_ALRMAR_MNU_0 ((uint32_t)0x00000100)
mbed_official 392:2b59412bb664 2022 #define RTC_ALRMAR_MNU_1 ((uint32_t)0x00000200)
mbed_official 392:2b59412bb664 2023 #define RTC_ALRMAR_MNU_2 ((uint32_t)0x00000400)
mbed_official 392:2b59412bb664 2024 #define RTC_ALRMAR_MNU_3 ((uint32_t)0x00000800)
mbed_official 392:2b59412bb664 2025 #define RTC_ALRMAR_MSK1 ((uint32_t)0x00000080)
mbed_official 392:2b59412bb664 2026 #define RTC_ALRMAR_ST ((uint32_t)0x00000070)
mbed_official 392:2b59412bb664 2027 #define RTC_ALRMAR_ST_0 ((uint32_t)0x00000010)
mbed_official 392:2b59412bb664 2028 #define RTC_ALRMAR_ST_1 ((uint32_t)0x00000020)
mbed_official 392:2b59412bb664 2029 #define RTC_ALRMAR_ST_2 ((uint32_t)0x00000040)
mbed_official 392:2b59412bb664 2030 #define RTC_ALRMAR_SU ((uint32_t)0x0000000F)
mbed_official 392:2b59412bb664 2031 #define RTC_ALRMAR_SU_0 ((uint32_t)0x00000001)
mbed_official 392:2b59412bb664 2032 #define RTC_ALRMAR_SU_1 ((uint32_t)0x00000002)
mbed_official 392:2b59412bb664 2033 #define RTC_ALRMAR_SU_2 ((uint32_t)0x00000004)
mbed_official 392:2b59412bb664 2034 #define RTC_ALRMAR_SU_3 ((uint32_t)0x00000008)
mbed_official 392:2b59412bb664 2035
mbed_official 392:2b59412bb664 2036 /******************** Bits definition for RTC_WPR register *****************/
mbed_official 392:2b59412bb664 2037 #define RTC_WPR_KEY ((uint32_t)0x000000FF)
mbed_official 392:2b59412bb664 2038
mbed_official 392:2b59412bb664 2039 /******************** Bits definition for RTC_SSR register *****************/
mbed_official 392:2b59412bb664 2040 #define RTC_SSR_SS ((uint32_t)0x0000FFFF)
mbed_official 392:2b59412bb664 2041
mbed_official 392:2b59412bb664 2042 /******************** Bits definition for RTC_SHIFTR register **************/
mbed_official 392:2b59412bb664 2043 #define RTC_SHIFTR_SUBFS ((uint32_t)0x00007FFF)
mbed_official 392:2b59412bb664 2044 #define RTC_SHIFTR_ADD1S ((uint32_t)0x80000000)
mbed_official 392:2b59412bb664 2045
mbed_official 392:2b59412bb664 2046 /******************** Bits definition for RTC_TSTR register ****************/
mbed_official 392:2b59412bb664 2047 #define RTC_TSTR_PM ((uint32_t)0x00400000)
mbed_official 392:2b59412bb664 2048 #define RTC_TSTR_HT ((uint32_t)0x00300000)
mbed_official 392:2b59412bb664 2049 #define RTC_TSTR_HT_0 ((uint32_t)0x00100000)
mbed_official 392:2b59412bb664 2050 #define RTC_TSTR_HT_1 ((uint32_t)0x00200000)
mbed_official 392:2b59412bb664 2051 #define RTC_TSTR_HU ((uint32_t)0x000F0000)
mbed_official 392:2b59412bb664 2052 #define RTC_TSTR_HU_0 ((uint32_t)0x00010000)
mbed_official 392:2b59412bb664 2053 #define RTC_TSTR_HU_1 ((uint32_t)0x00020000)
mbed_official 392:2b59412bb664 2054 #define RTC_TSTR_HU_2 ((uint32_t)0x00040000)
mbed_official 392:2b59412bb664 2055 #define RTC_TSTR_HU_3 ((uint32_t)0x00080000)
mbed_official 392:2b59412bb664 2056 #define RTC_TSTR_MNT ((uint32_t)0x00007000)
mbed_official 392:2b59412bb664 2057 #define RTC_TSTR_MNT_0 ((uint32_t)0x00001000)
mbed_official 392:2b59412bb664 2058 #define RTC_TSTR_MNT_1 ((uint32_t)0x00002000)
mbed_official 392:2b59412bb664 2059 #define RTC_TSTR_MNT_2 ((uint32_t)0x00004000)
mbed_official 392:2b59412bb664 2060 #define RTC_TSTR_MNU ((uint32_t)0x00000F00)
mbed_official 392:2b59412bb664 2061 #define RTC_TSTR_MNU_0 ((uint32_t)0x00000100)
mbed_official 392:2b59412bb664 2062 #define RTC_TSTR_MNU_1 ((uint32_t)0x00000200)
mbed_official 392:2b59412bb664 2063 #define RTC_TSTR_MNU_2 ((uint32_t)0x00000400)
mbed_official 392:2b59412bb664 2064 #define RTC_TSTR_MNU_3 ((uint32_t)0x00000800)
mbed_official 392:2b59412bb664 2065 #define RTC_TSTR_ST ((uint32_t)0x00000070)
mbed_official 392:2b59412bb664 2066 #define RTC_TSTR_ST_0 ((uint32_t)0x00000010)
mbed_official 392:2b59412bb664 2067 #define RTC_TSTR_ST_1 ((uint32_t)0x00000020)
mbed_official 392:2b59412bb664 2068 #define RTC_TSTR_ST_2 ((uint32_t)0x00000040)
mbed_official 392:2b59412bb664 2069 #define RTC_TSTR_SU ((uint32_t)0x0000000F)
mbed_official 392:2b59412bb664 2070 #define RTC_TSTR_SU_0 ((uint32_t)0x00000001)
mbed_official 392:2b59412bb664 2071 #define RTC_TSTR_SU_1 ((uint32_t)0x00000002)
mbed_official 392:2b59412bb664 2072 #define RTC_TSTR_SU_2 ((uint32_t)0x00000004)
mbed_official 392:2b59412bb664 2073 #define RTC_TSTR_SU_3 ((uint32_t)0x00000008)
mbed_official 392:2b59412bb664 2074
mbed_official 392:2b59412bb664 2075 /******************** Bits definition for RTC_TSDR register ****************/
mbed_official 392:2b59412bb664 2076 #define RTC_TSDR_WDU ((uint32_t)0x0000E000)
mbed_official 392:2b59412bb664 2077 #define RTC_TSDR_WDU_0 ((uint32_t)0x00002000)
mbed_official 392:2b59412bb664 2078 #define RTC_TSDR_WDU_1 ((uint32_t)0x00004000)
mbed_official 392:2b59412bb664 2079 #define RTC_TSDR_WDU_2 ((uint32_t)0x00008000)
mbed_official 392:2b59412bb664 2080 #define RTC_TSDR_MT ((uint32_t)0x00001000)
mbed_official 392:2b59412bb664 2081 #define RTC_TSDR_MU ((uint32_t)0x00000F00)
mbed_official 392:2b59412bb664 2082 #define RTC_TSDR_MU_0 ((uint32_t)0x00000100)
mbed_official 392:2b59412bb664 2083 #define RTC_TSDR_MU_1 ((uint32_t)0x00000200)
mbed_official 392:2b59412bb664 2084 #define RTC_TSDR_MU_2 ((uint32_t)0x00000400)
mbed_official 392:2b59412bb664 2085 #define RTC_TSDR_MU_3 ((uint32_t)0x00000800)
mbed_official 392:2b59412bb664 2086 #define RTC_TSDR_DT ((uint32_t)0x00000030)
mbed_official 392:2b59412bb664 2087 #define RTC_TSDR_DT_0 ((uint32_t)0x00000010)
mbed_official 392:2b59412bb664 2088 #define RTC_TSDR_DT_1 ((uint32_t)0x00000020)
mbed_official 392:2b59412bb664 2089 #define RTC_TSDR_DU ((uint32_t)0x0000000F)
mbed_official 392:2b59412bb664 2090 #define RTC_TSDR_DU_0 ((uint32_t)0x00000001)
mbed_official 392:2b59412bb664 2091 #define RTC_TSDR_DU_1 ((uint32_t)0x00000002)
mbed_official 392:2b59412bb664 2092 #define RTC_TSDR_DU_2 ((uint32_t)0x00000004)
mbed_official 392:2b59412bb664 2093 #define RTC_TSDR_DU_3 ((uint32_t)0x00000008)
mbed_official 392:2b59412bb664 2094
mbed_official 392:2b59412bb664 2095 /******************** Bits definition for RTC_TSSSR register ***************/
mbed_official 392:2b59412bb664 2096 #define RTC_TSSSR_SS ((uint32_t)0x0000FFFF)
mbed_official 392:2b59412bb664 2097
mbed_official 392:2b59412bb664 2098 /******************** Bits definition for RTC_CALR register ****************/
mbed_official 392:2b59412bb664 2099 #define RTC_CALR_CALP ((uint32_t)0x00008000)
mbed_official 392:2b59412bb664 2100 #define RTC_CALR_CALW8 ((uint32_t)0x00004000)
mbed_official 392:2b59412bb664 2101 #define RTC_CALR_CALW16 ((uint32_t)0x00002000)
mbed_official 392:2b59412bb664 2102 #define RTC_CALR_CALM ((uint32_t)0x000001FF)
mbed_official 392:2b59412bb664 2103 #define RTC_CALR_CALM_0 ((uint32_t)0x00000001)
mbed_official 392:2b59412bb664 2104 #define RTC_CALR_CALM_1 ((uint32_t)0x00000002)
mbed_official 392:2b59412bb664 2105 #define RTC_CALR_CALM_2 ((uint32_t)0x00000004)
mbed_official 392:2b59412bb664 2106 #define RTC_CALR_CALM_3 ((uint32_t)0x00000008)
mbed_official 392:2b59412bb664 2107 #define RTC_CALR_CALM_4 ((uint32_t)0x00000010)
mbed_official 392:2b59412bb664 2108 #define RTC_CALR_CALM_5 ((uint32_t)0x00000020)
mbed_official 392:2b59412bb664 2109 #define RTC_CALR_CALM_6 ((uint32_t)0x00000040)
mbed_official 392:2b59412bb664 2110 #define RTC_CALR_CALM_7 ((uint32_t)0x00000080)
mbed_official 392:2b59412bb664 2111 #define RTC_CALR_CALM_8 ((uint32_t)0x00000100)
mbed_official 392:2b59412bb664 2112
mbed_official 392:2b59412bb664 2113 /******************** Bits definition for RTC_TAFCR register ***************/
mbed_official 392:2b59412bb664 2114 #define RTC_TAFCR_ALARMOUTTYPE ((uint32_t)0x00040000)
mbed_official 392:2b59412bb664 2115 #define RTC_TAFCR_TAMPPUDIS ((uint32_t)0x00008000)
mbed_official 392:2b59412bb664 2116 #define RTC_TAFCR_TAMPPRCH ((uint32_t)0x00006000)
mbed_official 392:2b59412bb664 2117 #define RTC_TAFCR_TAMPPRCH_0 ((uint32_t)0x00002000)
mbed_official 392:2b59412bb664 2118 #define RTC_TAFCR_TAMPPRCH_1 ((uint32_t)0x00004000)
mbed_official 392:2b59412bb664 2119 #define RTC_TAFCR_TAMPFLT ((uint32_t)0x00001800)
mbed_official 392:2b59412bb664 2120 #define RTC_TAFCR_TAMPFLT_0 ((uint32_t)0x00000800)
mbed_official 392:2b59412bb664 2121 #define RTC_TAFCR_TAMPFLT_1 ((uint32_t)0x00001000)
mbed_official 392:2b59412bb664 2122 #define RTC_TAFCR_TAMPFREQ ((uint32_t)0x00000700)
mbed_official 392:2b59412bb664 2123 #define RTC_TAFCR_TAMPFREQ_0 ((uint32_t)0x00000100)
mbed_official 392:2b59412bb664 2124 #define RTC_TAFCR_TAMPFREQ_1 ((uint32_t)0x00000200)
mbed_official 392:2b59412bb664 2125 #define RTC_TAFCR_TAMPFREQ_2 ((uint32_t)0x00000400)
mbed_official 392:2b59412bb664 2126 #define RTC_TAFCR_TAMPTS ((uint32_t)0x00000080)
mbed_official 392:2b59412bb664 2127 #define RTC_TAFCR_TAMP2TRG ((uint32_t)0x00000010)
mbed_official 392:2b59412bb664 2128 #define RTC_TAFCR_TAMP2E ((uint32_t)0x00000008)
mbed_official 392:2b59412bb664 2129 #define RTC_TAFCR_TAMPIE ((uint32_t)0x00000004)
mbed_official 392:2b59412bb664 2130 #define RTC_TAFCR_TAMP1TRG ((uint32_t)0x00000002)
mbed_official 392:2b59412bb664 2131 #define RTC_TAFCR_TAMP1E ((uint32_t)0x00000001)
mbed_official 392:2b59412bb664 2132
mbed_official 392:2b59412bb664 2133 /******************** Bits definition for RTC_ALRMASSR register ************/
mbed_official 392:2b59412bb664 2134 #define RTC_ALRMASSR_MASKSS ((uint32_t)0x0F000000)
mbed_official 392:2b59412bb664 2135 #define RTC_ALRMASSR_MASKSS_0 ((uint32_t)0x01000000)
mbed_official 392:2b59412bb664 2136 #define RTC_ALRMASSR_MASKSS_1 ((uint32_t)0x02000000)
mbed_official 392:2b59412bb664 2137 #define RTC_ALRMASSR_MASKSS_2 ((uint32_t)0x04000000)
mbed_official 392:2b59412bb664 2138 #define RTC_ALRMASSR_MASKSS_3 ((uint32_t)0x08000000)
mbed_official 392:2b59412bb664 2139 #define RTC_ALRMASSR_SS ((uint32_t)0x00007FFF)
mbed_official 392:2b59412bb664 2140
mbed_official 392:2b59412bb664 2141 /*****************************************************************************/
mbed_official 392:2b59412bb664 2142 /* */
mbed_official 392:2b59412bb664 2143 /* Serial Peripheral Interface (SPI) */
mbed_official 392:2b59412bb664 2144 /* */
mbed_official 392:2b59412bb664 2145 /*****************************************************************************/
mbed_official 392:2b59412bb664 2146 /******************* Bit definition for SPI_CR1 register *******************/
mbed_official 392:2b59412bb664 2147 #define SPI_CR1_CPHA ((uint32_t)0x00000001) /*!< Clock Phase */
mbed_official 392:2b59412bb664 2148 #define SPI_CR1_CPOL ((uint32_t)0x00000002) /*!< Clock Polarity */
mbed_official 392:2b59412bb664 2149 #define SPI_CR1_MSTR ((uint32_t)0x00000004) /*!< Master Selection */
mbed_official 392:2b59412bb664 2150 #define SPI_CR1_BR ((uint32_t)0x00000038) /*!< BR[2:0] bits (Baud Rate Control) */
mbed_official 392:2b59412bb664 2151 #define SPI_CR1_BR_0 ((uint32_t)0x00000008) /*!< Bit 0 */
mbed_official 392:2b59412bb664 2152 #define SPI_CR1_BR_1 ((uint32_t)0x00000010) /*!< Bit 1 */
mbed_official 392:2b59412bb664 2153 #define SPI_CR1_BR_2 ((uint32_t)0x00000020) /*!< Bit 2 */
mbed_official 392:2b59412bb664 2154 #define SPI_CR1_SPE ((uint32_t)0x00000040) /*!< SPI Enable */
mbed_official 392:2b59412bb664 2155 #define SPI_CR1_LSBFIRST ((uint32_t)0x00000080) /*!< Frame Format */
mbed_official 392:2b59412bb664 2156 #define SPI_CR1_SSI ((uint32_t)0x00000100) /*!< Internal slave select */
mbed_official 392:2b59412bb664 2157 #define SPI_CR1_SSM ((uint32_t)0x00000200) /*!< Software slave management */
mbed_official 392:2b59412bb664 2158 #define SPI_CR1_RXONLY ((uint32_t)0x00000400) /*!< Receive only */
mbed_official 392:2b59412bb664 2159 #define SPI_CR1_CRCL ((uint32_t)0x00000800) /*!< CRC Length */
mbed_official 392:2b59412bb664 2160 #define SPI_CR1_CRCNEXT ((uint32_t)0x00001000) /*!< Transmit CRC next */
mbed_official 392:2b59412bb664 2161 #define SPI_CR1_CRCEN ((uint32_t)0x00002000) /*!< Hardware CRC calculation enable */
mbed_official 392:2b59412bb664 2162 #define SPI_CR1_BIDIOE ((uint32_t)0x00004000) /*!< Output enable in bidirectional mode */
mbed_official 392:2b59412bb664 2163 #define SPI_CR1_BIDIMODE ((uint32_t)0x00008000) /*!< Bidirectional data mode enable */
mbed_official 392:2b59412bb664 2164
mbed_official 392:2b59412bb664 2165 /******************* Bit definition for SPI_CR2 register *******************/
mbed_official 392:2b59412bb664 2166 #define SPI_CR2_RXDMAEN ((uint32_t)0x00000001) /*!< Rx Buffer DMA Enable */
mbed_official 392:2b59412bb664 2167 #define SPI_CR2_TXDMAEN ((uint32_t)0x00000002) /*!< Tx Buffer DMA Enable */
mbed_official 392:2b59412bb664 2168 #define SPI_CR2_SSOE ((uint32_t)0x00000004) /*!< SS Output Enable */
mbed_official 392:2b59412bb664 2169 #define SPI_CR2_NSSP ((uint32_t)0x00000008) /*!< NSS pulse management Enable */
mbed_official 392:2b59412bb664 2170 #define SPI_CR2_FRF ((uint32_t)0x00000010) /*!< Frame Format Enable */
mbed_official 392:2b59412bb664 2171 #define SPI_CR2_ERRIE ((uint32_t)0x00000020) /*!< Error Interrupt Enable */
mbed_official 392:2b59412bb664 2172 #define SPI_CR2_RXNEIE ((uint32_t)0x00000040) /*!< RX buffer Not Empty Interrupt Enable */
mbed_official 392:2b59412bb664 2173 #define SPI_CR2_TXEIE ((uint32_t)0x00000080) /*!< Tx buffer Empty Interrupt Enable */
mbed_official 392:2b59412bb664 2174 #define SPI_CR2_DS ((uint32_t)0x00000F00) /*!< DS[3:0] Data Size */
mbed_official 392:2b59412bb664 2175 #define SPI_CR2_DS_0 ((uint32_t)0x00000100) /*!< Bit 0 */
mbed_official 392:2b59412bb664 2176 #define SPI_CR2_DS_1 ((uint32_t)0x00000200) /*!< Bit 1 */
mbed_official 392:2b59412bb664 2177 #define SPI_CR2_DS_2 ((uint32_t)0x00000400) /*!< Bit 2 */
mbed_official 392:2b59412bb664 2178 #define SPI_CR2_DS_3 ((uint32_t)0x00000800) /*!< Bit 3 */
mbed_official 392:2b59412bb664 2179 #define SPI_CR2_FRXTH ((uint32_t)0x00001000) /*!< FIFO reception Threshold */
mbed_official 392:2b59412bb664 2180 #define SPI_CR2_LDMARX ((uint32_t)0x00002000) /*!< Last DMA transfer for reception */
mbed_official 392:2b59412bb664 2181 #define SPI_CR2_LDMATX ((uint32_t)0x00004000) /*!< Last DMA transfer for transmission */
mbed_official 392:2b59412bb664 2182
mbed_official 392:2b59412bb664 2183 /******************** Bit definition for SPI_SR register *******************/
mbed_official 392:2b59412bb664 2184 #define SPI_SR_RXNE ((uint32_t)0x00000001) /*!< Receive buffer Not Empty */
mbed_official 392:2b59412bb664 2185 #define SPI_SR_TXE ((uint32_t)0x00000002) /*!< Transmit buffer Empty */
mbed_official 392:2b59412bb664 2186 #define SPI_SR_CHSIDE ((uint32_t)0x00000004) /*!< Channel side */
mbed_official 392:2b59412bb664 2187 #define SPI_SR_UDR ((uint32_t)0x00000008) /*!< Underrun flag */
mbed_official 392:2b59412bb664 2188 #define SPI_SR_CRCERR ((uint32_t)0x00000010) /*!< CRC Error flag */
mbed_official 392:2b59412bb664 2189 #define SPI_SR_MODF ((uint32_t)0x00000020) /*!< Mode fault */
mbed_official 392:2b59412bb664 2190 #define SPI_SR_OVR ((uint32_t)0x00000040) /*!< Overrun flag */
mbed_official 392:2b59412bb664 2191 #define SPI_SR_BSY ((uint32_t)0x00000080) /*!< Busy flag */
mbed_official 392:2b59412bb664 2192 #define SPI_SR_FRE ((uint32_t)0x00000100) /*!< TI frame format error */
mbed_official 392:2b59412bb664 2193 #define SPI_SR_FRLVL ((uint32_t)0x00000600) /*!< FIFO Reception Level */
mbed_official 392:2b59412bb664 2194 #define SPI_SR_FRLVL_0 ((uint32_t)0x00000200) /*!< Bit 0 */
mbed_official 392:2b59412bb664 2195 #define SPI_SR_FRLVL_1 ((uint32_t)0x00000400) /*!< Bit 1 */
mbed_official 392:2b59412bb664 2196 #define SPI_SR_FTLVL ((uint32_t)0x00001800) /*!< FIFO Transmission Level */
mbed_official 392:2b59412bb664 2197 #define SPI_SR_FTLVL_0 ((uint32_t)0x00000800) /*!< Bit 0 */
mbed_official 392:2b59412bb664 2198 #define SPI_SR_FTLVL_1 ((uint32_t)0x00001000) /*!< Bit 1 */
mbed_official 392:2b59412bb664 2199
mbed_official 392:2b59412bb664 2200 /******************** Bit definition for SPI_DR register *******************/
mbed_official 392:2b59412bb664 2201 #define SPI_DR_DR ((uint32_t)0xFFFFFFFF) /*!< Data Register */
mbed_official 392:2b59412bb664 2202
mbed_official 392:2b59412bb664 2203 /******************* Bit definition for SPI_CRCPR register *****************/
mbed_official 392:2b59412bb664 2204 #define SPI_CRCPR_CRCPOLY ((uint32_t)0xFFFFFFFF) /*!< CRC polynomial register */
mbed_official 392:2b59412bb664 2205
mbed_official 392:2b59412bb664 2206 /****************** Bit definition for SPI_RXCRCR register *****************/
mbed_official 392:2b59412bb664 2207 #define SPI_RXCRCR_RXCRC ((uint32_t)0xFFFFFFFF) /*!< Rx CRC Register */
mbed_official 392:2b59412bb664 2208
mbed_official 392:2b59412bb664 2209 /****************** Bit definition for SPI_TXCRCR register *****************/
mbed_official 392:2b59412bb664 2210 #define SPI_TXCRCR_TXCRC ((uint32_t)0xFFFFFFFF) /*!< Tx CRC Register */
mbed_official 392:2b59412bb664 2211
mbed_official 392:2b59412bb664 2212 /****************** Bit definition for SPI_I2SCFGR register ****************/
mbed_official 392:2b59412bb664 2213 #define SPI_I2SCFGR_CHLEN ((uint32_t)0x00000001) /*!<Channel length (number of bits per audio channel) */
mbed_official 392:2b59412bb664 2214 #define SPI_I2SCFGR_DATLEN ((uint32_t)0x00000006) /*!<DATLEN[1:0] bits (Data length to be transferred) */
mbed_official 392:2b59412bb664 2215 #define SPI_I2SCFGR_DATLEN_0 ((uint32_t)0x00000002) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2216 #define SPI_I2SCFGR_DATLEN_1 ((uint32_t)0x00000004) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2217 #define SPI_I2SCFGR_CKPOL ((uint32_t)0x00000008) /*!<steady state clock polarity */
mbed_official 392:2b59412bb664 2218 #define SPI_I2SCFGR_I2SSTD ((uint32_t)0x00000030) /*!<I2SSTD[1:0] bits (I2S standard selection) */
mbed_official 392:2b59412bb664 2219 #define SPI_I2SCFGR_I2SSTD_0 ((uint32_t)0x00000010) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2220 #define SPI_I2SCFGR_I2SSTD_1 ((uint32_t)0x00000020) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2221 #define SPI_I2SCFGR_PCMSYNC ((uint32_t)0x00000080) /*!<PCM frame synchronization */
mbed_official 392:2b59412bb664 2222 #define SPI_I2SCFGR_I2SCFG ((uint32_t)0x00000300) /*!<I2SCFG[1:0] bits (I2S configuration mode) */
mbed_official 392:2b59412bb664 2223 #define SPI_I2SCFGR_I2SCFG_0 ((uint32_t)0x00000100) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2224 #define SPI_I2SCFGR_I2SCFG_1 ((uint32_t)0x00000200) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2225 #define SPI_I2SCFGR_I2SE ((uint32_t)0x00000400) /*!<I2S Enable */
mbed_official 392:2b59412bb664 2226 #define SPI_I2SCFGR_I2SMOD ((uint32_t)0x00000800) /*!<I2S mode selection */
mbed_official 392:2b59412bb664 2227
mbed_official 392:2b59412bb664 2228 /****************** Bit definition for SPI_I2SPR register ******************/
mbed_official 392:2b59412bb664 2229 #define SPI_I2SPR_I2SDIV ((uint32_t)0x000000FF) /*!<I2S Linear prescaler */
mbed_official 392:2b59412bb664 2230 #define SPI_I2SPR_ODD ((uint32_t)0x00000100) /*!<Odd factor for the prescaler */
mbed_official 392:2b59412bb664 2231 #define SPI_I2SPR_MCKOE ((uint32_t)0x00000200) /*!<Master Clock Output Enable */
mbed_official 392:2b59412bb664 2232
mbed_official 392:2b59412bb664 2233 /*****************************************************************************/
mbed_official 392:2b59412bb664 2234 /* */
mbed_official 392:2b59412bb664 2235 /* System Configuration (SYSCFG) */
mbed_official 392:2b59412bb664 2236 /* */
mbed_official 392:2b59412bb664 2237 /*****************************************************************************/
mbed_official 392:2b59412bb664 2238 /***************** Bit definition for SYSCFG_CFGR1 register ****************/
mbed_official 392:2b59412bb664 2239 #define SYSCFG_CFGR1_MEM_MODE ((uint32_t)0x00000003) /*!< SYSCFG_Memory Remap Config */
mbed_official 392:2b59412bb664 2240 #define SYSCFG_CFGR1_MEM_MODE_0 ((uint32_t)0x00000001) /*!< SYSCFG_Memory Remap Config Bit 0 */
mbed_official 392:2b59412bb664 2241 #define SYSCFG_CFGR1_MEM_MODE_1 ((uint32_t)0x00000002) /*!< SYSCFG_Memory Remap Config Bit 1 */
mbed_official 392:2b59412bb664 2242
mbed_official 392:2b59412bb664 2243 #define SYSCFG_CFGR1_DMA_RMP ((uint32_t)0x00001F00) /*!< DMA remap mask */
mbed_official 392:2b59412bb664 2244 #define SYSCFG_CFGR1_ADC_DMA_RMP ((uint32_t)0x00000100) /*!< ADC DMA remap */
mbed_official 392:2b59412bb664 2245 #define SYSCFG_CFGR1_USART1TX_DMA_RMP ((uint32_t)0x00000200) /*!< USART1 TX DMA remap */
mbed_official 392:2b59412bb664 2246 #define SYSCFG_CFGR1_USART1RX_DMA_RMP ((uint32_t)0x00000400) /*!< USART1 RX DMA remap */
mbed_official 392:2b59412bb664 2247 #define SYSCFG_CFGR1_TIM16_DMA_RMP ((uint32_t)0x00000800) /*!< Timer 16 DMA remap */
mbed_official 392:2b59412bb664 2248 #define SYSCFG_CFGR1_TIM17_DMA_RMP ((uint32_t)0x00001000) /*!< Timer 17 DMA remap */
mbed_official 392:2b59412bb664 2249
mbed_official 392:2b59412bb664 2250 #define SYSCFG_CFGR1_I2C_FMP_PB6 ((uint32_t)0x00010000) /*!< I2C PB6 Fast mode plus */
mbed_official 392:2b59412bb664 2251 #define SYSCFG_CFGR1_I2C_FMP_PB7 ((uint32_t)0x00020000) /*!< I2C PB7 Fast mode plus */
mbed_official 392:2b59412bb664 2252 #define SYSCFG_CFGR1_I2C_FMP_PB8 ((uint32_t)0x00040000) /*!< I2C PB8 Fast mode plus */
mbed_official 392:2b59412bb664 2253 #define SYSCFG_CFGR1_I2C_FMP_PB9 ((uint32_t)0x00080000) /*!< I2C PB9 Fast mode plus */
mbed_official 392:2b59412bb664 2254
mbed_official 392:2b59412bb664 2255 /***************** Bit definition for SYSCFG_EXTICR1 register **************/
mbed_official 392:2b59412bb664 2256 #define SYSCFG_EXTICR1_EXTI0 ((uint16_t)0x000F) /*!< EXTI 0 configuration */
mbed_official 392:2b59412bb664 2257 #define SYSCFG_EXTICR1_EXTI1 ((uint16_t)0x00F0) /*!< EXTI 1 configuration */
mbed_official 392:2b59412bb664 2258 #define SYSCFG_EXTICR1_EXTI2 ((uint16_t)0x0F00) /*!< EXTI 2 configuration */
mbed_official 392:2b59412bb664 2259 #define SYSCFG_EXTICR1_EXTI3 ((uint16_t)0xF000) /*!< EXTI 3 configuration */
mbed_official 392:2b59412bb664 2260
mbed_official 392:2b59412bb664 2261 /**
mbed_official 392:2b59412bb664 2262 * @brief EXTI0 configuration
mbed_official 392:2b59412bb664 2263 */
mbed_official 392:2b59412bb664 2264 #define SYSCFG_EXTICR1_EXTI0_PA ((uint16_t)0x0000) /*!< PA[0] pin */
mbed_official 392:2b59412bb664 2265 #define SYSCFG_EXTICR1_EXTI0_PB ((uint16_t)0x0001) /*!< PB[0] pin */
mbed_official 392:2b59412bb664 2266 #define SYSCFG_EXTICR1_EXTI0_PC ((uint16_t)0x0002) /*!< PC[0] pin */
mbed_official 392:2b59412bb664 2267 #define SYSCFG_EXTICR1_EXTI0_PD ((uint16_t)0x0003) /*!< PD[0] pin */
mbed_official 392:2b59412bb664 2268 #define SYSCFG_EXTICR1_EXTI0_PF ((uint16_t)0x0005) /*!< PF[0] pin */
mbed_official 392:2b59412bb664 2269
mbed_official 392:2b59412bb664 2270 /**
mbed_official 392:2b59412bb664 2271 * @brief EXTI1 configuration
mbed_official 392:2b59412bb664 2272 */
mbed_official 392:2b59412bb664 2273 #define SYSCFG_EXTICR1_EXTI1_PA ((uint16_t)0x0000) /*!< PA[1] pin */
mbed_official 392:2b59412bb664 2274 #define SYSCFG_EXTICR1_EXTI1_PB ((uint16_t)0x0010) /*!< PB[1] pin */
mbed_official 392:2b59412bb664 2275 #define SYSCFG_EXTICR1_EXTI1_PC ((uint16_t)0x0020) /*!< PC[1] pin */
mbed_official 392:2b59412bb664 2276 #define SYSCFG_EXTICR1_EXTI1_PD ((uint16_t)0x0030) /*!< PD[1] pin */
mbed_official 392:2b59412bb664 2277 #define SYSCFG_EXTICR1_EXTI1_PF ((uint16_t)0x0050) /*!< PF[1] pin */
mbed_official 392:2b59412bb664 2278
mbed_official 392:2b59412bb664 2279 /**
mbed_official 392:2b59412bb664 2280 * @brief EXTI2 configuration
mbed_official 392:2b59412bb664 2281 */
mbed_official 392:2b59412bb664 2282 #define SYSCFG_EXTICR1_EXTI2_PA ((uint16_t)0x0000) /*!< PA[2] pin */
mbed_official 392:2b59412bb664 2283 #define SYSCFG_EXTICR1_EXTI2_PB ((uint16_t)0x0100) /*!< PB[2] pin */
mbed_official 392:2b59412bb664 2284 #define SYSCFG_EXTICR1_EXTI2_PC ((uint16_t)0x0200) /*!< PC[2] pin */
mbed_official 392:2b59412bb664 2285 #define SYSCFG_EXTICR1_EXTI2_PD ((uint16_t)0x0300) /*!< PD[2] pin */
mbed_official 392:2b59412bb664 2286 #define SYSCFG_EXTICR1_EXTI2_PF ((uint16_t)0x0500) /*!< PF[2] pin */
mbed_official 392:2b59412bb664 2287
mbed_official 392:2b59412bb664 2288 /**
mbed_official 392:2b59412bb664 2289 * @brief EXTI3 configuration
mbed_official 392:2b59412bb664 2290 */
mbed_official 392:2b59412bb664 2291 #define SYSCFG_EXTICR1_EXTI3_PA ((uint16_t)0x0000) /*!< PA[3] pin */
mbed_official 392:2b59412bb664 2292 #define SYSCFG_EXTICR1_EXTI3_PB ((uint16_t)0x1000) /*!< PB[3] pin */
mbed_official 392:2b59412bb664 2293 #define SYSCFG_EXTICR1_EXTI3_PC ((uint16_t)0x2000) /*!< PC[3] pin */
mbed_official 392:2b59412bb664 2294 #define SYSCFG_EXTICR1_EXTI3_PD ((uint16_t)0x3000) /*!< PD[3] pin */
mbed_official 392:2b59412bb664 2295 #define SYSCFG_EXTICR1_EXTI3_PF ((uint16_t)0x5000) /*!< PF[3] pin */
mbed_official 392:2b59412bb664 2296
mbed_official 392:2b59412bb664 2297 /***************** Bit definition for SYSCFG_EXTICR2 register **************/
mbed_official 392:2b59412bb664 2298 #define SYSCFG_EXTICR2_EXTI4 ((uint16_t)0x000F) /*!< EXTI 4 configuration */
mbed_official 392:2b59412bb664 2299 #define SYSCFG_EXTICR2_EXTI5 ((uint16_t)0x00F0) /*!< EXTI 5 configuration */
mbed_official 392:2b59412bb664 2300 #define SYSCFG_EXTICR2_EXTI6 ((uint16_t)0x0F00) /*!< EXTI 6 configuration */
mbed_official 392:2b59412bb664 2301 #define SYSCFG_EXTICR2_EXTI7 ((uint16_t)0xF000) /*!< EXTI 7 configuration */
mbed_official 392:2b59412bb664 2302
mbed_official 392:2b59412bb664 2303 /**
mbed_official 392:2b59412bb664 2304 * @brief EXTI4 configuration
mbed_official 392:2b59412bb664 2305 */
mbed_official 392:2b59412bb664 2306 #define SYSCFG_EXTICR2_EXTI4_PA ((uint16_t)0x0000) /*!< PA[4] pin */
mbed_official 392:2b59412bb664 2307 #define SYSCFG_EXTICR2_EXTI4_PB ((uint16_t)0x0001) /*!< PB[4] pin */
mbed_official 392:2b59412bb664 2308 #define SYSCFG_EXTICR2_EXTI4_PC ((uint16_t)0x0002) /*!< PC[4] pin */
mbed_official 392:2b59412bb664 2309 #define SYSCFG_EXTICR2_EXTI4_PD ((uint16_t)0x0003) /*!< PD[4] pin */
mbed_official 392:2b59412bb664 2310 #define SYSCFG_EXTICR2_EXTI4_PF ((uint16_t)0x0005) /*!< PF[4] pin */
mbed_official 392:2b59412bb664 2311
mbed_official 392:2b59412bb664 2312 /**
mbed_official 392:2b59412bb664 2313 * @brief EXTI5 configuration
mbed_official 392:2b59412bb664 2314 */
mbed_official 392:2b59412bb664 2315 #define SYSCFG_EXTICR2_EXTI5_PA ((uint16_t)0x0000) /*!< PA[5] pin */
mbed_official 392:2b59412bb664 2316 #define SYSCFG_EXTICR2_EXTI5_PB ((uint16_t)0x0010) /*!< PB[5] pin */
mbed_official 392:2b59412bb664 2317 #define SYSCFG_EXTICR2_EXTI5_PC ((uint16_t)0x0020) /*!< PC[5] pin */
mbed_official 392:2b59412bb664 2318 #define SYSCFG_EXTICR2_EXTI5_PD ((uint16_t)0x0030) /*!< PD[5] pin */
mbed_official 392:2b59412bb664 2319 #define SYSCFG_EXTICR2_EXTI5_PF ((uint16_t)0x0050) /*!< PF[5] pin */
mbed_official 392:2b59412bb664 2320
mbed_official 392:2b59412bb664 2321 /**
mbed_official 392:2b59412bb664 2322 * @brief EXTI6 configuration
mbed_official 392:2b59412bb664 2323 */
mbed_official 392:2b59412bb664 2324 #define SYSCFG_EXTICR2_EXTI6_PA ((uint16_t)0x0000) /*!< PA[6] pin */
mbed_official 392:2b59412bb664 2325 #define SYSCFG_EXTICR2_EXTI6_PB ((uint16_t)0x0100) /*!< PB[6] pin */
mbed_official 392:2b59412bb664 2326 #define SYSCFG_EXTICR2_EXTI6_PC ((uint16_t)0x0200) /*!< PC[6] pin */
mbed_official 392:2b59412bb664 2327 #define SYSCFG_EXTICR2_EXTI6_PD ((uint16_t)0x0300) /*!< PD[6] pin */
mbed_official 392:2b59412bb664 2328 #define SYSCFG_EXTICR2_EXTI6_PF ((uint16_t)0x0500) /*!< PF[6] pin */
mbed_official 392:2b59412bb664 2329
mbed_official 392:2b59412bb664 2330 /**
mbed_official 392:2b59412bb664 2331 * @brief EXTI7 configuration
mbed_official 392:2b59412bb664 2332 */
mbed_official 392:2b59412bb664 2333 #define SYSCFG_EXTICR2_EXTI7_PA ((uint16_t)0x0000) /*!< PA[7] pin */
mbed_official 392:2b59412bb664 2334 #define SYSCFG_EXTICR2_EXTI7_PB ((uint16_t)0x1000) /*!< PB[7] pin */
mbed_official 392:2b59412bb664 2335 #define SYSCFG_EXTICR2_EXTI7_PC ((uint16_t)0x2000) /*!< PC[7] pin */
mbed_official 392:2b59412bb664 2336 #define SYSCFG_EXTICR2_EXTI7_PD ((uint16_t)0x3000) /*!< PD[7] pin */
mbed_official 392:2b59412bb664 2337 #define SYSCFG_EXTICR2_EXTI7_PF ((uint16_t)0x5000) /*!< PF[7] pin */
mbed_official 392:2b59412bb664 2338
mbed_official 392:2b59412bb664 2339 /***************** Bit definition for SYSCFG_EXTICR3 register **************/
mbed_official 392:2b59412bb664 2340 #define SYSCFG_EXTICR3_EXTI8 ((uint16_t)0x000F) /*!< EXTI 8 configuration */
mbed_official 392:2b59412bb664 2341 #define SYSCFG_EXTICR3_EXTI9 ((uint16_t)0x00F0) /*!< EXTI 9 configuration */
mbed_official 392:2b59412bb664 2342 #define SYSCFG_EXTICR3_EXTI10 ((uint16_t)0x0F00) /*!< EXTI 10 configuration */
mbed_official 392:2b59412bb664 2343 #define SYSCFG_EXTICR3_EXTI11 ((uint16_t)0xF000) /*!< EXTI 11 configuration */
mbed_official 392:2b59412bb664 2344
mbed_official 392:2b59412bb664 2345 /**
mbed_official 392:2b59412bb664 2346 * @brief EXTI8 configuration
mbed_official 392:2b59412bb664 2347 */
mbed_official 392:2b59412bb664 2348 #define SYSCFG_EXTICR3_EXTI8_PA ((uint16_t)0x0000) /*!< PA[8] pin */
mbed_official 392:2b59412bb664 2349 #define SYSCFG_EXTICR3_EXTI8_PB ((uint16_t)0x0001) /*!< PB[8] pin */
mbed_official 392:2b59412bb664 2350 #define SYSCFG_EXTICR3_EXTI8_PC ((uint16_t)0x0002) /*!< PC[8] pin */
mbed_official 392:2b59412bb664 2351 #define SYSCFG_EXTICR3_EXTI8_PD ((uint16_t)0x0003) /*!< PD[8] pin */
mbed_official 392:2b59412bb664 2352 #define SYSCFG_EXTICR3_EXTI8_PF ((uint16_t)0x0005) /*!< PF[8] pin */
mbed_official 392:2b59412bb664 2353
mbed_official 392:2b59412bb664 2354 /**
mbed_official 392:2b59412bb664 2355 * @brief EXTI9 configuration
mbed_official 392:2b59412bb664 2356 */
mbed_official 392:2b59412bb664 2357 #define SYSCFG_EXTICR3_EXTI9_PA ((uint16_t)0x0000) /*!< PA[9] pin */
mbed_official 392:2b59412bb664 2358 #define SYSCFG_EXTICR3_EXTI9_PB ((uint16_t)0x0010) /*!< PB[9] pin */
mbed_official 392:2b59412bb664 2359 #define SYSCFG_EXTICR3_EXTI9_PC ((uint16_t)0x0020) /*!< PC[9] pin */
mbed_official 392:2b59412bb664 2360 #define SYSCFG_EXTICR3_EXTI9_PD ((uint16_t)0x0030) /*!< PD[9] pin */
mbed_official 392:2b59412bb664 2361 #define SYSCFG_EXTICR3_EXTI9_PF ((uint16_t)0x0050) /*!< PF[9] pin */
mbed_official 392:2b59412bb664 2362
mbed_official 392:2b59412bb664 2363 /**
mbed_official 392:2b59412bb664 2364 * @brief EXTI10 configuration
mbed_official 392:2b59412bb664 2365 */
mbed_official 392:2b59412bb664 2366 #define SYSCFG_EXTICR3_EXTI10_PA ((uint16_t)0x0000) /*!< PA[10] pin */
mbed_official 392:2b59412bb664 2367 #define SYSCFG_EXTICR3_EXTI10_PB ((uint16_t)0x0100) /*!< PB[10] pin */
mbed_official 392:2b59412bb664 2368 #define SYSCFG_EXTICR3_EXTI10_PC ((uint16_t)0x0200) /*!< PC[10] pin */
mbed_official 392:2b59412bb664 2369 #define SYSCFG_EXTICR3_EXTI10_PD ((uint16_t)0x0300) /*!< PD[10] pin */
mbed_official 392:2b59412bb664 2370 #define SYSCFG_EXTICR3_EXTI10_PF ((uint16_t)0x0500) /*!< PF[10] pin */
mbed_official 392:2b59412bb664 2371
mbed_official 392:2b59412bb664 2372 /**
mbed_official 392:2b59412bb664 2373 * @brief EXTI11 configuration
mbed_official 392:2b59412bb664 2374 */
mbed_official 392:2b59412bb664 2375 #define SYSCFG_EXTICR3_EXTI11_PA ((uint16_t)0x0000) /*!< PA[11] pin */
mbed_official 392:2b59412bb664 2376 #define SYSCFG_EXTICR3_EXTI11_PB ((uint16_t)0x1000) /*!< PB[11] pin */
mbed_official 392:2b59412bb664 2377 #define SYSCFG_EXTICR3_EXTI11_PC ((uint16_t)0x2000) /*!< PC[11] pin */
mbed_official 392:2b59412bb664 2378 #define SYSCFG_EXTICR3_EXTI11_PD ((uint16_t)0x3000) /*!< PD[11] pin */
mbed_official 392:2b59412bb664 2379 #define SYSCFG_EXTICR3_EXTI11_PF ((uint16_t)0x5000) /*!< PF[11] pin */
mbed_official 392:2b59412bb664 2380
mbed_official 392:2b59412bb664 2381 /***************** Bit definition for SYSCFG_EXTICR4 register **************/
mbed_official 392:2b59412bb664 2382 #define SYSCFG_EXTICR4_EXTI12 ((uint16_t)0x000F) /*!< EXTI 12 configuration */
mbed_official 392:2b59412bb664 2383 #define SYSCFG_EXTICR4_EXTI13 ((uint16_t)0x00F0) /*!< EXTI 13 configuration */
mbed_official 392:2b59412bb664 2384 #define SYSCFG_EXTICR4_EXTI14 ((uint16_t)0x0F00) /*!< EXTI 14 configuration */
mbed_official 392:2b59412bb664 2385 #define SYSCFG_EXTICR4_EXTI15 ((uint16_t)0xF000) /*!< EXTI 15 configuration */
mbed_official 392:2b59412bb664 2386
mbed_official 392:2b59412bb664 2387 /**
mbed_official 392:2b59412bb664 2388 * @brief EXTI12 configuration
mbed_official 392:2b59412bb664 2389 */
mbed_official 392:2b59412bb664 2390 #define SYSCFG_EXTICR4_EXTI12_PA ((uint16_t)0x0000) /*!< PA[12] pin */
mbed_official 392:2b59412bb664 2391 #define SYSCFG_EXTICR4_EXTI12_PB ((uint16_t)0x0001) /*!< PB[12] pin */
mbed_official 392:2b59412bb664 2392 #define SYSCFG_EXTICR4_EXTI12_PC ((uint16_t)0x0002) /*!< PC[12] pin */
mbed_official 392:2b59412bb664 2393 #define SYSCFG_EXTICR4_EXTI12_PD ((uint16_t)0x0003) /*!< PD[12] pin */
mbed_official 392:2b59412bb664 2394 #define SYSCFG_EXTICR4_EXTI12_PF ((uint16_t)0x0005) /*!< PF[12] pin */
mbed_official 392:2b59412bb664 2395
mbed_official 392:2b59412bb664 2396 /**
mbed_official 392:2b59412bb664 2397 * @brief EXTI13 configuration
mbed_official 392:2b59412bb664 2398 */
mbed_official 392:2b59412bb664 2399 #define SYSCFG_EXTICR4_EXTI13_PA ((uint16_t)0x0000) /*!< PA[13] pin */
mbed_official 392:2b59412bb664 2400 #define SYSCFG_EXTICR4_EXTI13_PB ((uint16_t)0x0010) /*!< PB[13] pin */
mbed_official 392:2b59412bb664 2401 #define SYSCFG_EXTICR4_EXTI13_PC ((uint16_t)0x0020) /*!< PC[13] pin */
mbed_official 392:2b59412bb664 2402 #define SYSCFG_EXTICR4_EXTI13_PD ((uint16_t)0x0030) /*!< PD[13] pin */
mbed_official 392:2b59412bb664 2403 #define SYSCFG_EXTICR4_EXTI13_PF ((uint16_t)0x0050) /*!< PF[13] pin */
mbed_official 392:2b59412bb664 2404
mbed_official 392:2b59412bb664 2405 /**
mbed_official 392:2b59412bb664 2406 * @brief EXTI14 configuration
mbed_official 392:2b59412bb664 2407 */
mbed_official 392:2b59412bb664 2408 #define SYSCFG_EXTICR4_EXTI14_PA ((uint16_t)0x0000) /*!< PA[14] pin */
mbed_official 392:2b59412bb664 2409 #define SYSCFG_EXTICR4_EXTI14_PB ((uint16_t)0x0100) /*!< PB[14] pin */
mbed_official 392:2b59412bb664 2410 #define SYSCFG_EXTICR4_EXTI14_PC ((uint16_t)0x0200) /*!< PC[14] pin */
mbed_official 392:2b59412bb664 2411 #define SYSCFG_EXTICR4_EXTI14_PD ((uint16_t)0x0300) /*!< PD[14] pin */
mbed_official 392:2b59412bb664 2412 #define SYSCFG_EXTICR4_EXTI14_PF ((uint16_t)0x0500) /*!< PF[14] pin */
mbed_official 392:2b59412bb664 2413
mbed_official 392:2b59412bb664 2414 /**
mbed_official 392:2b59412bb664 2415 * @brief EXTI15 configuration
mbed_official 392:2b59412bb664 2416 */
mbed_official 392:2b59412bb664 2417 #define SYSCFG_EXTICR4_EXTI15_PA ((uint16_t)0x0000) /*!< PA[15] pin */
mbed_official 392:2b59412bb664 2418 #define SYSCFG_EXTICR4_EXTI15_PB ((uint16_t)0x1000) /*!< PB[15] pin */
mbed_official 392:2b59412bb664 2419 #define SYSCFG_EXTICR4_EXTI15_PC ((uint16_t)0x2000) /*!< PC[15] pin */
mbed_official 392:2b59412bb664 2420 #define SYSCFG_EXTICR4_EXTI15_PD ((uint16_t)0x3000) /*!< PD[15] pin */
mbed_official 392:2b59412bb664 2421 #define SYSCFG_EXTICR4_EXTI15_PF ((uint16_t)0x5000) /*!< PF[15] pin */
mbed_official 392:2b59412bb664 2422
mbed_official 392:2b59412bb664 2423 /***************** Bit definition for SYSCFG_CFGR2 register ****************/
mbed_official 392:2b59412bb664 2424 #define SYSCFG_CFGR2_LOCKUP_LOCK ((uint32_t)0x00000001) /*!< Enables and locks the LOCKUP (Hardfault) output of CortexM0 with Break Input of TIMER1 */
mbed_official 392:2b59412bb664 2425 #define SYSCFG_CFGR2_SRAM_PARITY_LOCK ((uint32_t)0x00000002) /*!< Enables and locks the SRAM_PARITY error signal with Break Input of TIMER1 */
mbed_official 392:2b59412bb664 2426 #define SYSCFG_CFGR2_SRAM_PEF ((uint32_t)0x00000100) /*!< SRAM Parity error flag */
mbed_official 392:2b59412bb664 2427 #define SYSCFG_CFGR2_SRAM_PE SYSCFG_CFGR2_SRAM_PEF /*!< SRAM Parity error flag (define maintained for legacy purpose) */
mbed_official 392:2b59412bb664 2428
mbed_official 392:2b59412bb664 2429 /*****************************************************************************/
mbed_official 392:2b59412bb664 2430 /* */
mbed_official 392:2b59412bb664 2431 /* Timers (TIM) */
mbed_official 392:2b59412bb664 2432 /* */
mbed_official 392:2b59412bb664 2433 /*****************************************************************************/
mbed_official 392:2b59412bb664 2434 /******************* Bit definition for TIM_CR1 register *******************/
mbed_official 392:2b59412bb664 2435 #define TIM_CR1_CEN ((uint32_t)0x00000001) /*!<Counter enable */
mbed_official 392:2b59412bb664 2436 #define TIM_CR1_UDIS ((uint32_t)0x00000002) /*!<Update disable */
mbed_official 392:2b59412bb664 2437 #define TIM_CR1_URS ((uint32_t)0x00000004) /*!<Update request source */
mbed_official 392:2b59412bb664 2438 #define TIM_CR1_OPM ((uint32_t)0x00000008) /*!<One pulse mode */
mbed_official 392:2b59412bb664 2439 #define TIM_CR1_DIR ((uint32_t)0x00000010) /*!<Direction */
mbed_official 392:2b59412bb664 2440
mbed_official 392:2b59412bb664 2441 #define TIM_CR1_CMS ((uint32_t)0x00000060) /*!<CMS[1:0] bits (Center-aligned mode selection) */
mbed_official 392:2b59412bb664 2442 #define TIM_CR1_CMS_0 ((uint32_t)0x00000020) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2443 #define TIM_CR1_CMS_1 ((uint32_t)0x00000040) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2444
mbed_official 392:2b59412bb664 2445 #define TIM_CR1_ARPE ((uint32_t)0x00000080) /*!<Auto-reload preload enable */
mbed_official 392:2b59412bb664 2446
mbed_official 392:2b59412bb664 2447 #define TIM_CR1_CKD ((uint32_t)0x00000300) /*!<CKD[1:0] bits (clock division) */
mbed_official 392:2b59412bb664 2448 #define TIM_CR1_CKD_0 ((uint32_t)0x00000100) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2449 #define TIM_CR1_CKD_1 ((uint32_t)0x00000200) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2450
mbed_official 392:2b59412bb664 2451 /******************* Bit definition for TIM_CR2 register *******************/
mbed_official 392:2b59412bb664 2452 #define TIM_CR2_CCPC ((uint32_t)0x00000001) /*!<Capture/Compare Preloaded Control */
mbed_official 392:2b59412bb664 2453 #define TIM_CR2_CCUS ((uint32_t)0x00000004) /*!<Capture/Compare Control Update Selection */
mbed_official 392:2b59412bb664 2454 #define TIM_CR2_CCDS ((uint32_t)0x00000008) /*!<Capture/Compare DMA Selection */
mbed_official 392:2b59412bb664 2455
mbed_official 392:2b59412bb664 2456 #define TIM_CR2_MMS ((uint32_t)0x00000070) /*!<MMS[2:0] bits (Master Mode Selection) */
mbed_official 392:2b59412bb664 2457 #define TIM_CR2_MMS_0 ((uint32_t)0x00000010) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2458 #define TIM_CR2_MMS_1 ((uint32_t)0x00000020) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2459 #define TIM_CR2_MMS_2 ((uint32_t)0x00000040) /*!<Bit 2 */
mbed_official 392:2b59412bb664 2460
mbed_official 392:2b59412bb664 2461 #define TIM_CR2_TI1S ((uint32_t)0x00000080) /*!<TI1 Selection */
mbed_official 392:2b59412bb664 2462 #define TIM_CR2_OIS1 ((uint32_t)0x00000100) /*!<Output Idle state 1 (OC1 output) */
mbed_official 392:2b59412bb664 2463 #define TIM_CR2_OIS1N ((uint32_t)0x00000200) /*!<Output Idle state 1 (OC1N output) */
mbed_official 392:2b59412bb664 2464 #define TIM_CR2_OIS2 ((uint32_t)0x00000400) /*!<Output Idle state 2 (OC2 output) */
mbed_official 392:2b59412bb664 2465 #define TIM_CR2_OIS2N ((uint32_t)0x00000800) /*!<Output Idle state 2 (OC2N output) */
mbed_official 392:2b59412bb664 2466 #define TIM_CR2_OIS3 ((uint32_t)0x00001000) /*!<Output Idle state 3 (OC3 output) */
mbed_official 392:2b59412bb664 2467 #define TIM_CR2_OIS3N ((uint32_t)0x00002000) /*!<Output Idle state 3 (OC3N output) */
mbed_official 392:2b59412bb664 2468 #define TIM_CR2_OIS4 ((uint32_t)0x00004000) /*!<Output Idle state 4 (OC4 output) */
mbed_official 392:2b59412bb664 2469
mbed_official 392:2b59412bb664 2470 /******************* Bit definition for TIM_SMCR register ******************/
mbed_official 392:2b59412bb664 2471 #define TIM_SMCR_SMS ((uint32_t)0x00000007) /*!<SMS[2:0] bits (Slave mode selection) */
mbed_official 392:2b59412bb664 2472 #define TIM_SMCR_SMS_0 ((uint32_t)0x00000001) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2473 #define TIM_SMCR_SMS_1 ((uint32_t)0x00000002) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2474 #define TIM_SMCR_SMS_2 ((uint32_t)0x00000004) /*!<Bit 2 */
mbed_official 392:2b59412bb664 2475
mbed_official 392:2b59412bb664 2476 #define TIM_SMCR_OCCS ((uint32_t)0x00000008) /*!< OCREF clear selection */
mbed_official 392:2b59412bb664 2477
mbed_official 392:2b59412bb664 2478 #define TIM_SMCR_TS ((uint32_t)0x00000070) /*!<TS[2:0] bits (Trigger selection) */
mbed_official 392:2b59412bb664 2479 #define TIM_SMCR_TS_0 ((uint32_t)0x00000010) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2480 #define TIM_SMCR_TS_1 ((uint32_t)0x00000020) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2481 #define TIM_SMCR_TS_2 ((uint32_t)0x00000040) /*!<Bit 2 */
mbed_official 392:2b59412bb664 2482
mbed_official 392:2b59412bb664 2483 #define TIM_SMCR_MSM ((uint32_t)0x00000080) /*!<Master/slave mode */
mbed_official 392:2b59412bb664 2484
mbed_official 392:2b59412bb664 2485 #define TIM_SMCR_ETF ((uint32_t)0x00000F00) /*!<ETF[3:0] bits (External trigger filter) */
mbed_official 392:2b59412bb664 2486 #define TIM_SMCR_ETF_0 ((uint32_t)0x00000100) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2487 #define TIM_SMCR_ETF_1 ((uint32_t)0x00000200) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2488 #define TIM_SMCR_ETF_2 ((uint32_t)0x00000400) /*!<Bit 2 */
mbed_official 392:2b59412bb664 2489 #define TIM_SMCR_ETF_3 ((uint32_t)0x00000800) /*!<Bit 3 */
mbed_official 392:2b59412bb664 2490
mbed_official 392:2b59412bb664 2491 #define TIM_SMCR_ETPS ((uint32_t)0x00003000) /*!<ETPS[1:0] bits (External trigger prescaler) */
mbed_official 392:2b59412bb664 2492 #define TIM_SMCR_ETPS_0 ((uint32_t)0x00001000) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2493 #define TIM_SMCR_ETPS_1 ((uint32_t)0x00002000) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2494
mbed_official 392:2b59412bb664 2495 #define TIM_SMCR_ECE ((uint32_t)0x00004000) /*!<External clock enable */
mbed_official 392:2b59412bb664 2496 #define TIM_SMCR_ETP ((uint32_t)0x00008000) /*!<External trigger polarity */
mbed_official 392:2b59412bb664 2497
mbed_official 392:2b59412bb664 2498 /******************* Bit definition for TIM_DIER register ******************/
mbed_official 392:2b59412bb664 2499 #define TIM_DIER_UIE ((uint32_t)0x00000001) /*!<Update interrupt enable */
mbed_official 392:2b59412bb664 2500 #define TIM_DIER_CC1IE ((uint32_t)0x00000002) /*!<Capture/Compare 1 interrupt enable */
mbed_official 392:2b59412bb664 2501 #define TIM_DIER_CC2IE ((uint32_t)0x00000004) /*!<Capture/Compare 2 interrupt enable */
mbed_official 392:2b59412bb664 2502 #define TIM_DIER_CC3IE ((uint32_t)0x00000008) /*!<Capture/Compare 3 interrupt enable */
mbed_official 392:2b59412bb664 2503 #define TIM_DIER_CC4IE ((uint32_t)0x00000010) /*!<Capture/Compare 4 interrupt enable */
mbed_official 392:2b59412bb664 2504 #define TIM_DIER_COMIE ((uint32_t)0x00000020) /*!<COM interrupt enable */
mbed_official 392:2b59412bb664 2505 #define TIM_DIER_TIE ((uint32_t)0x00000040) /*!<Trigger interrupt enable */
mbed_official 392:2b59412bb664 2506 #define TIM_DIER_BIE ((uint32_t)0x00000080) /*!<Break interrupt enable */
mbed_official 392:2b59412bb664 2507 #define TIM_DIER_UDE ((uint32_t)0x00000100) /*!<Update DMA request enable */
mbed_official 392:2b59412bb664 2508 #define TIM_DIER_CC1DE ((uint32_t)0x00000200) /*!<Capture/Compare 1 DMA request enable */
mbed_official 392:2b59412bb664 2509 #define TIM_DIER_CC2DE ((uint32_t)0x00000400) /*!<Capture/Compare 2 DMA request enable */
mbed_official 392:2b59412bb664 2510 #define TIM_DIER_CC3DE ((uint32_t)0x00000800) /*!<Capture/Compare 3 DMA request enable */
mbed_official 392:2b59412bb664 2511 #define TIM_DIER_CC4DE ((uint32_t)0x00001000) /*!<Capture/Compare 4 DMA request enable */
mbed_official 392:2b59412bb664 2512 #define TIM_DIER_COMDE ((uint32_t)0x00002000) /*!<COM DMA request enable */
mbed_official 392:2b59412bb664 2513 #define TIM_DIER_TDE ((uint32_t)0x00004000) /*!<Trigger DMA request enable */
mbed_official 392:2b59412bb664 2514
mbed_official 392:2b59412bb664 2515 /******************** Bit definition for TIM_SR register *******************/
mbed_official 392:2b59412bb664 2516 #define TIM_SR_UIF ((uint32_t)0x00000001) /*!<Update interrupt Flag */
mbed_official 392:2b59412bb664 2517 #define TIM_SR_CC1IF ((uint32_t)0x00000002) /*!<Capture/Compare 1 interrupt Flag */
mbed_official 392:2b59412bb664 2518 #define TIM_SR_CC2IF ((uint32_t)0x00000004) /*!<Capture/Compare 2 interrupt Flag */
mbed_official 392:2b59412bb664 2519 #define TIM_SR_CC3IF ((uint32_t)0x00000008) /*!<Capture/Compare 3 interrupt Flag */
mbed_official 392:2b59412bb664 2520 #define TIM_SR_CC4IF ((uint32_t)0x00000010) /*!<Capture/Compare 4 interrupt Flag */
mbed_official 392:2b59412bb664 2521 #define TIM_SR_COMIF ((uint32_t)0x00000020) /*!<COM interrupt Flag */
mbed_official 392:2b59412bb664 2522 #define TIM_SR_TIF ((uint32_t)0x00000040) /*!<Trigger interrupt Flag */
mbed_official 392:2b59412bb664 2523 #define TIM_SR_BIF ((uint32_t)0x00000080) /*!<Break interrupt Flag */
mbed_official 392:2b59412bb664 2524 #define TIM_SR_CC1OF ((uint32_t)0x00000200) /*!<Capture/Compare 1 Overcapture Flag */
mbed_official 392:2b59412bb664 2525 #define TIM_SR_CC2OF ((uint32_t)0x00000400) /*!<Capture/Compare 2 Overcapture Flag */
mbed_official 392:2b59412bb664 2526 #define TIM_SR_CC3OF ((uint32_t)0x00000800) /*!<Capture/Compare 3 Overcapture Flag */
mbed_official 392:2b59412bb664 2527 #define TIM_SR_CC4OF ((uint32_t)0x00001000) /*!<Capture/Compare 4 Overcapture Flag */
mbed_official 392:2b59412bb664 2528
mbed_official 392:2b59412bb664 2529 /******************* Bit definition for TIM_EGR register *******************/
mbed_official 392:2b59412bb664 2530 #define TIM_EGR_UG ((uint32_t)0x00000001) /*!<Update Generation */
mbed_official 392:2b59412bb664 2531 #define TIM_EGR_CC1G ((uint32_t)0x00000002) /*!<Capture/Compare 1 Generation */
mbed_official 392:2b59412bb664 2532 #define TIM_EGR_CC2G ((uint32_t)0x00000004) /*!<Capture/Compare 2 Generation */
mbed_official 392:2b59412bb664 2533 #define TIM_EGR_CC3G ((uint32_t)0x00000008) /*!<Capture/Compare 3 Generation */
mbed_official 392:2b59412bb664 2534 #define TIM_EGR_CC4G ((uint32_t)0x00000010) /*!<Capture/Compare 4 Generation */
mbed_official 392:2b59412bb664 2535 #define TIM_EGR_COMG ((uint32_t)0x00000020) /*!<Capture/Compare Control Update Generation */
mbed_official 392:2b59412bb664 2536 #define TIM_EGR_TG ((uint32_t)0x00000040) /*!<Trigger Generation */
mbed_official 392:2b59412bb664 2537 #define TIM_EGR_BG ((uint32_t)0x00000080) /*!<Break Generation */
mbed_official 392:2b59412bb664 2538
mbed_official 392:2b59412bb664 2539 /****************** Bit definition for TIM_CCMR1 register ******************/
mbed_official 392:2b59412bb664 2540 #define TIM_CCMR1_CC1S ((uint32_t)0x00000003) /*!<CC1S[1:0] bits (Capture/Compare 1 Selection) */
mbed_official 392:2b59412bb664 2541 #define TIM_CCMR1_CC1S_0 ((uint32_t)0x00000001) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2542 #define TIM_CCMR1_CC1S_1 ((uint32_t)0x00000002) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2543
mbed_official 392:2b59412bb664 2544 #define TIM_CCMR1_OC1FE ((uint32_t)0x00000004) /*!<Output Compare 1 Fast enable */
mbed_official 392:2b59412bb664 2545 #define TIM_CCMR1_OC1PE ((uint32_t)0x00000008) /*!<Output Compare 1 Preload enable */
mbed_official 392:2b59412bb664 2546
mbed_official 392:2b59412bb664 2547 #define TIM_CCMR1_OC1M ((uint32_t)0x00000070) /*!<OC1M[2:0] bits (Output Compare 1 Mode) */
mbed_official 392:2b59412bb664 2548 #define TIM_CCMR1_OC1M_0 ((uint32_t)0x00000010) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2549 #define TIM_CCMR1_OC1M_1 ((uint32_t)0x00000020) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2550 #define TIM_CCMR1_OC1M_2 ((uint32_t)0x00000040) /*!<Bit 2 */
mbed_official 392:2b59412bb664 2551
mbed_official 392:2b59412bb664 2552 #define TIM_CCMR1_OC1CE ((uint32_t)0x00000080) /*!<Output Compare 1Clear Enable */
mbed_official 392:2b59412bb664 2553
mbed_official 392:2b59412bb664 2554 #define TIM_CCMR1_CC2S ((uint32_t)0x00000300) /*!<CC2S[1:0] bits (Capture/Compare 2 Selection) */
mbed_official 392:2b59412bb664 2555 #define TIM_CCMR1_CC2S_0 ((uint32_t)0x00000100) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2556 #define TIM_CCMR1_CC2S_1 ((uint32_t)0x00000200) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2557
mbed_official 392:2b59412bb664 2558 #define TIM_CCMR1_OC2FE ((uint32_t)0x00000400) /*!<Output Compare 2 Fast enable */
mbed_official 392:2b59412bb664 2559 #define TIM_CCMR1_OC2PE ((uint32_t)0x00000800) /*!<Output Compare 2 Preload enable */
mbed_official 392:2b59412bb664 2560
mbed_official 392:2b59412bb664 2561 #define TIM_CCMR1_OC2M ((uint32_t)0x00007000) /*!<OC2M[2:0] bits (Output Compare 2 Mode) */
mbed_official 392:2b59412bb664 2562 #define TIM_CCMR1_OC2M_0 ((uint32_t)0x00001000) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2563 #define TIM_CCMR1_OC2M_1 ((uint32_t)0x00002000) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2564 #define TIM_CCMR1_OC2M_2 ((uint32_t)0x00004000) /*!<Bit 2 */
mbed_official 392:2b59412bb664 2565
mbed_official 392:2b59412bb664 2566 #define TIM_CCMR1_OC2CE ((uint32_t)0x00008000) /*!<Output Compare 2 Clear Enable */
mbed_official 392:2b59412bb664 2567
mbed_official 392:2b59412bb664 2568 /*---------------------------------------------------------------------------*/
mbed_official 392:2b59412bb664 2569
mbed_official 392:2b59412bb664 2570 #define TIM_CCMR1_IC1PSC ((uint32_t)0x0000000C) /*!<IC1PSC[1:0] bits (Input Capture 1 Prescaler) */
mbed_official 392:2b59412bb664 2571 #define TIM_CCMR1_IC1PSC_0 ((uint32_t)0x00000004) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2572 #define TIM_CCMR1_IC1PSC_1 ((uint32_t)0x00000008) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2573
mbed_official 392:2b59412bb664 2574 #define TIM_CCMR1_IC1F ((uint32_t)0x000000F0) /*!<IC1F[3:0] bits (Input Capture 1 Filter) */
mbed_official 392:2b59412bb664 2575 #define TIM_CCMR1_IC1F_0 ((uint32_t)0x00000010) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2576 #define TIM_CCMR1_IC1F_1 ((uint32_t)0x00000020) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2577 #define TIM_CCMR1_IC1F_2 ((uint32_t)0x00000040) /*!<Bit 2 */
mbed_official 392:2b59412bb664 2578 #define TIM_CCMR1_IC1F_3 ((uint32_t)0x00000080) /*!<Bit 3 */
mbed_official 392:2b59412bb664 2579
mbed_official 392:2b59412bb664 2580 #define TIM_CCMR1_IC2PSC ((uint32_t)0x00000C00) /*!<IC2PSC[1:0] bits (Input Capture 2 Prescaler) */
mbed_official 392:2b59412bb664 2581 #define TIM_CCMR1_IC2PSC_0 ((uint32_t)0x00000400) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2582 #define TIM_CCMR1_IC2PSC_1 ((uint32_t)0x00000800) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2583
mbed_official 392:2b59412bb664 2584 #define TIM_CCMR1_IC2F ((uint32_t)0x0000F000) /*!<IC2F[3:0] bits (Input Capture 2 Filter) */
mbed_official 392:2b59412bb664 2585 #define TIM_CCMR1_IC2F_0 ((uint32_t)0x00001000) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2586 #define TIM_CCMR1_IC2F_1 ((uint32_t)0x00002000) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2587 #define TIM_CCMR1_IC2F_2 ((uint32_t)0x00004000) /*!<Bit 2 */
mbed_official 392:2b59412bb664 2588 #define TIM_CCMR1_IC2F_3 ((uint32_t)0x00008000) /*!<Bit 3 */
mbed_official 392:2b59412bb664 2589
mbed_official 392:2b59412bb664 2590 /****************** Bit definition for TIM_CCMR2 register ******************/
mbed_official 392:2b59412bb664 2591 #define TIM_CCMR2_CC3S ((uint32_t)0x00000003) /*!<CC3S[1:0] bits (Capture/Compare 3 Selection) */
mbed_official 392:2b59412bb664 2592 #define TIM_CCMR2_CC3S_0 ((uint32_t)0x00000001) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2593 #define TIM_CCMR2_CC3S_1 ((uint32_t)0x00000002) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2594
mbed_official 392:2b59412bb664 2595 #define TIM_CCMR2_OC3FE ((uint32_t)0x00000004) /*!<Output Compare 3 Fast enable */
mbed_official 392:2b59412bb664 2596 #define TIM_CCMR2_OC3PE ((uint32_t)0x00000008) /*!<Output Compare 3 Preload enable */
mbed_official 392:2b59412bb664 2597
mbed_official 392:2b59412bb664 2598 #define TIM_CCMR2_OC3M ((uint32_t)0x00000070) /*!<OC3M[2:0] bits (Output Compare 3 Mode) */
mbed_official 392:2b59412bb664 2599 #define TIM_CCMR2_OC3M_0 ((uint32_t)0x00000010) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2600 #define TIM_CCMR2_OC3M_1 ((uint32_t)0x00000020) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2601 #define TIM_CCMR2_OC3M_2 ((uint32_t)0x00000040) /*!<Bit 2 */
mbed_official 392:2b59412bb664 2602
mbed_official 392:2b59412bb664 2603 #define TIM_CCMR2_OC3CE ((uint32_t)0x00000080) /*!<Output Compare 3 Clear Enable */
mbed_official 392:2b59412bb664 2604
mbed_official 392:2b59412bb664 2605 #define TIM_CCMR2_CC4S ((uint32_t)0x00000300) /*!<CC4S[1:0] bits (Capture/Compare 4 Selection) */
mbed_official 392:2b59412bb664 2606 #define TIM_CCMR2_CC4S_0 ((uint32_t)0x00000100) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2607 #define TIM_CCMR2_CC4S_1 ((uint32_t)0x00000200) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2608
mbed_official 392:2b59412bb664 2609 #define TIM_CCMR2_OC4FE ((uint32_t)0x00000400) /*!<Output Compare 4 Fast enable */
mbed_official 392:2b59412bb664 2610 #define TIM_CCMR2_OC4PE ((uint32_t)0x00000800) /*!<Output Compare 4 Preload enable */
mbed_official 392:2b59412bb664 2611
mbed_official 392:2b59412bb664 2612 #define TIM_CCMR2_OC4M ((uint32_t)0x00007000) /*!<OC4M[2:0] bits (Output Compare 4 Mode) */
mbed_official 392:2b59412bb664 2613 #define TIM_CCMR2_OC4M_0 ((uint32_t)0x00001000) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2614 #define TIM_CCMR2_OC4M_1 ((uint32_t)0x00002000) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2615 #define TIM_CCMR2_OC4M_2 ((uint32_t)0x00004000) /*!<Bit 2 */
mbed_official 392:2b59412bb664 2616
mbed_official 392:2b59412bb664 2617 #define TIM_CCMR2_OC4CE ((uint32_t)0x00008000) /*!<Output Compare 4 Clear Enable */
mbed_official 392:2b59412bb664 2618
mbed_official 392:2b59412bb664 2619 /*---------------------------------------------------------------------------*/
mbed_official 392:2b59412bb664 2620
mbed_official 392:2b59412bb664 2621 #define TIM_CCMR2_IC3PSC ((uint32_t)0x0000000C) /*!<IC3PSC[1:0] bits (Input Capture 3 Prescaler) */
mbed_official 392:2b59412bb664 2622 #define TIM_CCMR2_IC3PSC_0 ((uint32_t)0x00000004) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2623 #define TIM_CCMR2_IC3PSC_1 ((uint32_t)0x00000008) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2624
mbed_official 392:2b59412bb664 2625 #define TIM_CCMR2_IC3F ((uint32_t)0x000000F0) /*!<IC3F[3:0] bits (Input Capture 3 Filter) */
mbed_official 392:2b59412bb664 2626 #define TIM_CCMR2_IC3F_0 ((uint32_t)0x00000010) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2627 #define TIM_CCMR2_IC3F_1 ((uint32_t)0x00000020) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2628 #define TIM_CCMR2_IC3F_2 ((uint32_t)0x00000040) /*!<Bit 2 */
mbed_official 392:2b59412bb664 2629 #define TIM_CCMR2_IC3F_3 ((uint32_t)0x00000080) /*!<Bit 3 */
mbed_official 392:2b59412bb664 2630
mbed_official 392:2b59412bb664 2631 #define TIM_CCMR2_IC4PSC ((uint32_t)0x00000C00) /*!<IC4PSC[1:0] bits (Input Capture 4 Prescaler) */
mbed_official 392:2b59412bb664 2632 #define TIM_CCMR2_IC4PSC_0 ((uint32_t)0x00000400) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2633 #define TIM_CCMR2_IC4PSC_1 ((uint32_t)0x00000800) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2634
mbed_official 392:2b59412bb664 2635 #define TIM_CCMR2_IC4F ((uint32_t)0x0000F000) /*!<IC4F[3:0] bits (Input Capture 4 Filter) */
mbed_official 392:2b59412bb664 2636 #define TIM_CCMR2_IC4F_0 ((uint32_t)0x00001000) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2637 #define TIM_CCMR2_IC4F_1 ((uint32_t)0x00002000) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2638 #define TIM_CCMR2_IC4F_2 ((uint32_t)0x00004000) /*!<Bit 2 */
mbed_official 392:2b59412bb664 2639 #define TIM_CCMR2_IC4F_3 ((uint32_t)0x00008000) /*!<Bit 3 */
mbed_official 392:2b59412bb664 2640
mbed_official 392:2b59412bb664 2641 /******************* Bit definition for TIM_CCER register ******************/
mbed_official 392:2b59412bb664 2642 #define TIM_CCER_CC1E ((uint32_t)0x00000001) /*!<Capture/Compare 1 output enable */
mbed_official 392:2b59412bb664 2643 #define TIM_CCER_CC1P ((uint32_t)0x00000002) /*!<Capture/Compare 1 output Polarity */
mbed_official 392:2b59412bb664 2644 #define TIM_CCER_CC1NE ((uint32_t)0x00000004) /*!<Capture/Compare 1 Complementary output enable */
mbed_official 392:2b59412bb664 2645 #define TIM_CCER_CC1NP ((uint32_t)0x00000008) /*!<Capture/Compare 1 Complementary output Polarity */
mbed_official 392:2b59412bb664 2646 #define TIM_CCER_CC2E ((uint32_t)0x00000010) /*!<Capture/Compare 2 output enable */
mbed_official 392:2b59412bb664 2647 #define TIM_CCER_CC2P ((uint32_t)0x00000020) /*!<Capture/Compare 2 output Polarity */
mbed_official 392:2b59412bb664 2648 #define TIM_CCER_CC2NE ((uint32_t)0x00000040) /*!<Capture/Compare 2 Complementary output enable */
mbed_official 392:2b59412bb664 2649 #define TIM_CCER_CC2NP ((uint32_t)0x00000080) /*!<Capture/Compare 2 Complementary output Polarity */
mbed_official 392:2b59412bb664 2650 #define TIM_CCER_CC3E ((uint32_t)0x00000100) /*!<Capture/Compare 3 output enable */
mbed_official 392:2b59412bb664 2651 #define TIM_CCER_CC3P ((uint32_t)0x00000200) /*!<Capture/Compare 3 output Polarity */
mbed_official 392:2b59412bb664 2652 #define TIM_CCER_CC3NE ((uint32_t)0x00000400) /*!<Capture/Compare 3 Complementary output enable */
mbed_official 392:2b59412bb664 2653 #define TIM_CCER_CC3NP ((uint32_t)0x00000800) /*!<Capture/Compare 3 Complementary output Polarity */
mbed_official 392:2b59412bb664 2654 #define TIM_CCER_CC4E ((uint32_t)0x00001000) /*!<Capture/Compare 4 output enable */
mbed_official 392:2b59412bb664 2655 #define TIM_CCER_CC4P ((uint32_t)0x00002000) /*!<Capture/Compare 4 output Polarity */
mbed_official 392:2b59412bb664 2656 #define TIM_CCER_CC4NP ((uint32_t)0x00008000) /*!<Capture/Compare 4 Complementary output Polarity */
mbed_official 392:2b59412bb664 2657
mbed_official 392:2b59412bb664 2658 /******************* Bit definition for TIM_CNT register *******************/
mbed_official 392:2b59412bb664 2659 #define TIM_CNT_CNT ((uint32_t)0xFFFFFFFF) /*!<Counter Value */
mbed_official 392:2b59412bb664 2660
mbed_official 392:2b59412bb664 2661 /******************* Bit definition for TIM_PSC register *******************/
mbed_official 392:2b59412bb664 2662 #define TIM_PSC_PSC ((uint32_t)0x0000FFFF) /*!<Prescaler Value */
mbed_official 392:2b59412bb664 2663
mbed_official 392:2b59412bb664 2664 /******************* Bit definition for TIM_ARR register *******************/
mbed_official 392:2b59412bb664 2665 #define TIM_ARR_ARR ((uint32_t)0xFFFFFFFF) /*!<actual auto-reload Value */
mbed_official 392:2b59412bb664 2666
mbed_official 392:2b59412bb664 2667 /******************* Bit definition for TIM_RCR register *******************/
mbed_official 392:2b59412bb664 2668 #define TIM_RCR_REP ((uint32_t)0x000000FF) /*!<Repetition Counter Value */
mbed_official 392:2b59412bb664 2669
mbed_official 392:2b59412bb664 2670 /******************* Bit definition for TIM_CCR1 register ******************/
mbed_official 392:2b59412bb664 2671 #define TIM_CCR1_CCR1 ((uint32_t)0x0000FFFF) /*!<Capture/Compare 1 Value */
mbed_official 392:2b59412bb664 2672
mbed_official 392:2b59412bb664 2673 /******************* Bit definition for TIM_CCR2 register ******************/
mbed_official 392:2b59412bb664 2674 #define TIM_CCR2_CCR2 ((uint32_t)0x0000FFFF) /*!<Capture/Compare 2 Value */
mbed_official 392:2b59412bb664 2675
mbed_official 392:2b59412bb664 2676 /******************* Bit definition for TIM_CCR3 register ******************/
mbed_official 392:2b59412bb664 2677 #define TIM_CCR3_CCR3 ((uint32_t)0x0000FFFF) /*!<Capture/Compare 3 Value */
mbed_official 392:2b59412bb664 2678
mbed_official 392:2b59412bb664 2679 /******************* Bit definition for TIM_CCR4 register ******************/
mbed_official 392:2b59412bb664 2680 #define TIM_CCR4_CCR4 ((uint32_t)0x0000FFFF) /*!<Capture/Compare 4 Value */
mbed_official 392:2b59412bb664 2681
mbed_official 392:2b59412bb664 2682 /******************* Bit definition for TIM_BDTR register ******************/
mbed_official 392:2b59412bb664 2683 #define TIM_BDTR_DTG ((uint32_t)0x000000FF) /*!<DTG[0:7] bits (Dead-Time Generator set-up) */
mbed_official 392:2b59412bb664 2684 #define TIM_BDTR_DTG_0 ((uint32_t)0x00000001) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2685 #define TIM_BDTR_DTG_1 ((uint32_t)0x00000002) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2686 #define TIM_BDTR_DTG_2 ((uint32_t)0x00000004) /*!<Bit 2 */
mbed_official 392:2b59412bb664 2687 #define TIM_BDTR_DTG_3 ((uint32_t)0x00000008) /*!<Bit 3 */
mbed_official 392:2b59412bb664 2688 #define TIM_BDTR_DTG_4 ((uint32_t)0x00000010) /*!<Bit 4 */
mbed_official 392:2b59412bb664 2689 #define TIM_BDTR_DTG_5 ((uint32_t)0x00000020) /*!<Bit 5 */
mbed_official 392:2b59412bb664 2690 #define TIM_BDTR_DTG_6 ((uint32_t)0x00000040) /*!<Bit 6 */
mbed_official 392:2b59412bb664 2691 #define TIM_BDTR_DTG_7 ((uint32_t)0x00000080) /*!<Bit 7 */
mbed_official 392:2b59412bb664 2692
mbed_official 392:2b59412bb664 2693 #define TIM_BDTR_LOCK ((uint32_t)0x00000300) /*!<LOCK[1:0] bits (Lock Configuration) */
mbed_official 392:2b59412bb664 2694 #define TIM_BDTR_LOCK_0 ((uint32_t)0x00000100) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2695 #define TIM_BDTR_LOCK_1 ((uint32_t)0x00000200) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2696
mbed_official 392:2b59412bb664 2697 #define TIM_BDTR_OSSI ((uint32_t)0x00000400) /*!<Off-State Selection for Idle mode */
mbed_official 392:2b59412bb664 2698 #define TIM_BDTR_OSSR ((uint32_t)0x00000800) /*!<Off-State Selection for Run mode */
mbed_official 392:2b59412bb664 2699 #define TIM_BDTR_BKE ((uint32_t)0x00001000) /*!<Break enable */
mbed_official 392:2b59412bb664 2700 #define TIM_BDTR_BKP ((uint32_t)0x00002000) /*!<Break Polarity */
mbed_official 392:2b59412bb664 2701 #define TIM_BDTR_AOE ((uint32_t)0x00004000) /*!<Automatic Output enable */
mbed_official 392:2b59412bb664 2702 #define TIM_BDTR_MOE ((uint32_t)0x00008000) /*!<Main Output enable */
mbed_official 392:2b59412bb664 2703
mbed_official 392:2b59412bb664 2704 /******************* Bit definition for TIM_DCR register *******************/
mbed_official 392:2b59412bb664 2705 #define TIM_DCR_DBA ((uint32_t)0x0000001F) /*!<DBA[4:0] bits (DMA Base Address) */
mbed_official 392:2b59412bb664 2706 #define TIM_DCR_DBA_0 ((uint32_t)0x00000001) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2707 #define TIM_DCR_DBA_1 ((uint32_t)0x00000002) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2708 #define TIM_DCR_DBA_2 ((uint32_t)0x00000004) /*!<Bit 2 */
mbed_official 392:2b59412bb664 2709 #define TIM_DCR_DBA_3 ((uint32_t)0x00000008) /*!<Bit 3 */
mbed_official 392:2b59412bb664 2710 #define TIM_DCR_DBA_4 ((uint32_t)0x00000010) /*!<Bit 4 */
mbed_official 392:2b59412bb664 2711
mbed_official 392:2b59412bb664 2712 #define TIM_DCR_DBL ((uint32_t)0x00001F00) /*!<DBL[4:0] bits (DMA Burst Length) */
mbed_official 392:2b59412bb664 2713 #define TIM_DCR_DBL_0 ((uint32_t)0x00000100) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2714 #define TIM_DCR_DBL_1 ((uint32_t)0x00000200) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2715 #define TIM_DCR_DBL_2 ((uint32_t)0x00000400) /*!<Bit 2 */
mbed_official 392:2b59412bb664 2716 #define TIM_DCR_DBL_3 ((uint32_t)0x00000800) /*!<Bit 3 */
mbed_official 392:2b59412bb664 2717 #define TIM_DCR_DBL_4 ((uint32_t)0x00001000) /*!<Bit 4 */
mbed_official 392:2b59412bb664 2718
mbed_official 392:2b59412bb664 2719 /******************* Bit definition for TIM_DMAR register ******************/
mbed_official 392:2b59412bb664 2720 #define TIM_DMAR_DMAB ((uint32_t)0x0000FFFF) /*!<DMA register for burst accesses */
mbed_official 392:2b59412bb664 2721
mbed_official 392:2b59412bb664 2722 /******************* Bit definition for TIM14_OR register ********************/
mbed_official 392:2b59412bb664 2723 #define TIM14_OR_TI1_RMP ((uint32_t)0x00000003) /*!<TI1_RMP[1:0] bits (TIM14 Input 4 remap) */
mbed_official 392:2b59412bb664 2724 #define TIM14_OR_TI1_RMP_0 ((uint32_t)0x00000001) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2725 #define TIM14_OR_TI1_RMP_1 ((uint32_t)0x00000002) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2726
mbed_official 392:2b59412bb664 2727
mbed_official 392:2b59412bb664 2728 /******************************************************************************/
mbed_official 392:2b59412bb664 2729 /* */
mbed_official 392:2b59412bb664 2730 /* Universal Synchronous Asynchronous Receiver Transmitter (USART) */
mbed_official 392:2b59412bb664 2731 /* */
mbed_official 392:2b59412bb664 2732 /******************************************************************************/
mbed_official 392:2b59412bb664 2733 /****************** Bit definition for USART_CR1 register *******************/
mbed_official 392:2b59412bb664 2734 #define USART_CR1_UE ((uint32_t)0x00000001) /*!< USART Enable */
mbed_official 392:2b59412bb664 2735 #define USART_CR1_UESM ((uint32_t)0x00000002) /*!< USART Enable in STOP Mode */
mbed_official 392:2b59412bb664 2736 #define USART_CR1_RE ((uint32_t)0x00000004) /*!< Receiver Enable */
mbed_official 392:2b59412bb664 2737 #define USART_CR1_TE ((uint32_t)0x00000008) /*!< Transmitter Enable */
mbed_official 392:2b59412bb664 2738 #define USART_CR1_IDLEIE ((uint32_t)0x00000010) /*!< IDLE Interrupt Enable */
mbed_official 392:2b59412bb664 2739 #define USART_CR1_RXNEIE ((uint32_t)0x00000020) /*!< RXNE Interrupt Enable */
mbed_official 392:2b59412bb664 2740 #define USART_CR1_TCIE ((uint32_t)0x00000040) /*!< Transmission Complete Interrupt Enable */
mbed_official 392:2b59412bb664 2741 #define USART_CR1_TXEIE ((uint32_t)0x00000080) /*!< TXE Interrupt Enable */
mbed_official 392:2b59412bb664 2742 #define USART_CR1_PEIE ((uint32_t)0x00000100) /*!< PE Interrupt Enable */
mbed_official 392:2b59412bb664 2743 #define USART_CR1_PS ((uint32_t)0x00000200) /*!< Parity Selection */
mbed_official 392:2b59412bb664 2744 #define USART_CR1_PCE ((uint32_t)0x00000400) /*!< Parity Control Enable */
mbed_official 392:2b59412bb664 2745 #define USART_CR1_WAKE ((uint32_t)0x00000800) /*!< Receiver Wakeup method */
mbed_official 392:2b59412bb664 2746 #define USART_CR1_M0 ((uint32_t)0x00001000) /*!< Word length bit 0 */
mbed_official 392:2b59412bb664 2747 #define USART_CR1_M ((uint32_t)0x00001000) /*!< SmartCard Length */
mbed_official 392:2b59412bb664 2748 #define USART_CR1_MME ((uint32_t)0x00002000) /*!< Mute Mode Enable */
mbed_official 392:2b59412bb664 2749 #define USART_CR1_CMIE ((uint32_t)0x00004000) /*!< Character match interrupt enable */
mbed_official 392:2b59412bb664 2750 #define USART_CR1_OVER8 ((uint32_t)0x00008000) /*!< Oversampling by 8-bit or 16-bit mode */
mbed_official 392:2b59412bb664 2751 #define USART_CR1_DEDT ((uint32_t)0x001F0000) /*!< DEDT[4:0] bits (Driver Enable Deassertion Time) */
mbed_official 392:2b59412bb664 2752 #define USART_CR1_DEDT_0 ((uint32_t)0x00010000) /*!< Bit 0 */
mbed_official 392:2b59412bb664 2753 #define USART_CR1_DEDT_1 ((uint32_t)0x00020000) /*!< Bit 1 */
mbed_official 392:2b59412bb664 2754 #define USART_CR1_DEDT_2 ((uint32_t)0x00040000) /*!< Bit 2 */
mbed_official 392:2b59412bb664 2755 #define USART_CR1_DEDT_3 ((uint32_t)0x00080000) /*!< Bit 3 */
mbed_official 392:2b59412bb664 2756 #define USART_CR1_DEDT_4 ((uint32_t)0x00100000) /*!< Bit 4 */
mbed_official 392:2b59412bb664 2757 #define USART_CR1_DEAT ((uint32_t)0x03E00000) /*!< DEAT[4:0] bits (Driver Enable Assertion Time) */
mbed_official 392:2b59412bb664 2758 #define USART_CR1_DEAT_0 ((uint32_t)0x00200000) /*!< Bit 0 */
mbed_official 392:2b59412bb664 2759 #define USART_CR1_DEAT_1 ((uint32_t)0x00400000) /*!< Bit 1 */
mbed_official 392:2b59412bb664 2760 #define USART_CR1_DEAT_2 ((uint32_t)0x00800000) /*!< Bit 2 */
mbed_official 392:2b59412bb664 2761 #define USART_CR1_DEAT_3 ((uint32_t)0x01000000) /*!< Bit 3 */
mbed_official 392:2b59412bb664 2762 #define USART_CR1_DEAT_4 ((uint32_t)0x02000000) /*!< Bit 4 */
mbed_official 392:2b59412bb664 2763 #define USART_CR1_RTOIE ((uint32_t)0x04000000) /*!< Receive Time Out interrupt enable */
mbed_official 392:2b59412bb664 2764 #define USART_CR1_EOBIE ((uint32_t)0x08000000) /*!< End of Block interrupt enable */
mbed_official 392:2b59412bb664 2765
mbed_official 392:2b59412bb664 2766 /****************** Bit definition for USART_CR2 register *******************/
mbed_official 392:2b59412bb664 2767 #define USART_CR2_ADDM7 ((uint32_t)0x00000010) /*!< 7-bit or 4-bit Address Detection */
mbed_official 392:2b59412bb664 2768 #define USART_CR2_LBDL ((uint32_t)0x00000020) /*!< LIN Break Detection Length */
mbed_official 392:2b59412bb664 2769 #define USART_CR2_LBDIE ((uint32_t)0x00000040) /*!< LIN Break Detection Interrupt Enable */
mbed_official 392:2b59412bb664 2770 #define USART_CR2_LBCL ((uint32_t)0x00000100) /*!< Last Bit Clock pulse */
mbed_official 392:2b59412bb664 2771 #define USART_CR2_CPHA ((uint32_t)0x00000200) /*!< Clock Phase */
mbed_official 392:2b59412bb664 2772 #define USART_CR2_CPOL ((uint32_t)0x00000400) /*!< Clock Polarity */
mbed_official 392:2b59412bb664 2773 #define USART_CR2_CLKEN ((uint32_t)0x00000800) /*!< Clock Enable */
mbed_official 392:2b59412bb664 2774 #define USART_CR2_STOP ((uint32_t)0x00003000) /*!< STOP[1:0] bits (STOP bits) */
mbed_official 392:2b59412bb664 2775 #define USART_CR2_STOP_0 ((uint32_t)0x00001000) /*!< Bit 0 */
mbed_official 392:2b59412bb664 2776 #define USART_CR2_STOP_1 ((uint32_t)0x00002000) /*!< Bit 1 */
mbed_official 392:2b59412bb664 2777 #define USART_CR2_LINEN ((uint32_t)0x00004000) /*!< LIN mode enable */
mbed_official 392:2b59412bb664 2778 #define USART_CR2_SWAP ((uint32_t)0x00008000) /*!< SWAP TX/RX pins */
mbed_official 392:2b59412bb664 2779 #define USART_CR2_RXINV ((uint32_t)0x00010000) /*!< RX pin active level inversion */
mbed_official 392:2b59412bb664 2780 #define USART_CR2_TXINV ((uint32_t)0x00020000) /*!< TX pin active level inversion */
mbed_official 392:2b59412bb664 2781 #define USART_CR2_DATAINV ((uint32_t)0x00040000) /*!< Binary data inversion */
mbed_official 392:2b59412bb664 2782 #define USART_CR2_MSBFIRST ((uint32_t)0x00080000) /*!< Most Significant Bit First */
mbed_official 392:2b59412bb664 2783 #define USART_CR2_ABREN ((uint32_t)0x00100000) /*!< Auto Baud-Rate Enable*/
mbed_official 392:2b59412bb664 2784 #define USART_CR2_ABRMODE ((uint32_t)0x00600000) /*!< ABRMOD[1:0] bits (Auto Baud-Rate Mode) */
mbed_official 392:2b59412bb664 2785 #define USART_CR2_ABRMODE_0 ((uint32_t)0x00200000) /*!< Bit 0 */
mbed_official 392:2b59412bb664 2786 #define USART_CR2_ABRMODE_1 ((uint32_t)0x00400000) /*!< Bit 1 */
mbed_official 392:2b59412bb664 2787 #define USART_CR2_RTOEN ((uint32_t)0x00800000) /*!< Receiver Time-Out enable */
mbed_official 392:2b59412bb664 2788 #define USART_CR2_ADD ((uint32_t)0xFF000000) /*!< Address of the USART node */
mbed_official 392:2b59412bb664 2789
mbed_official 392:2b59412bb664 2790 /****************** Bit definition for USART_CR3 register *******************/
mbed_official 392:2b59412bb664 2791 #define USART_CR3_EIE ((uint32_t)0x00000001) /*!< Error Interrupt Enable */
mbed_official 392:2b59412bb664 2792 #define USART_CR3_IREN ((uint32_t)0x00000002) /*!< IrDA mode Enable */
mbed_official 392:2b59412bb664 2793 #define USART_CR3_IRLP ((uint32_t)0x00000004) /*!< IrDA Low-Power */
mbed_official 392:2b59412bb664 2794 #define USART_CR3_HDSEL ((uint32_t)0x00000008) /*!< Half-Duplex Selection */
mbed_official 392:2b59412bb664 2795 #define USART_CR3_NACK ((uint32_t)0x00000010) /*!< SmartCard NACK enable */
mbed_official 392:2b59412bb664 2796 #define USART_CR3_SCEN ((uint32_t)0x00000020) /*!< SmartCard mode enable */
mbed_official 392:2b59412bb664 2797 #define USART_CR3_DMAR ((uint32_t)0x00000040) /*!< DMA Enable Receiver */
mbed_official 392:2b59412bb664 2798 #define USART_CR3_DMAT ((uint32_t)0x00000080) /*!< DMA Enable Transmitter */
mbed_official 392:2b59412bb664 2799 #define USART_CR3_RTSE ((uint32_t)0x00000100) /*!< RTS Enable */
mbed_official 392:2b59412bb664 2800 #define USART_CR3_CTSE ((uint32_t)0x00000200) /*!< CTS Enable */
mbed_official 392:2b59412bb664 2801 #define USART_CR3_CTSIE ((uint32_t)0x00000400) /*!< CTS Interrupt Enable */
mbed_official 392:2b59412bb664 2802 #define USART_CR3_ONEBIT ((uint32_t)0x00000800) /*!< One sample bit method enable */
mbed_official 392:2b59412bb664 2803 #define USART_CR3_OVRDIS ((uint32_t)0x00001000) /*!< Overrun Disable */
mbed_official 392:2b59412bb664 2804 #define USART_CR3_DDRE ((uint32_t)0x00002000) /*!< DMA Disable on Reception Error */
mbed_official 392:2b59412bb664 2805 #define USART_CR3_DEM ((uint32_t)0x00004000) /*!< Driver Enable Mode */
mbed_official 392:2b59412bb664 2806 #define USART_CR3_DEP ((uint32_t)0x00008000) /*!< Driver Enable Polarity Selection */
mbed_official 392:2b59412bb664 2807 #define USART_CR3_SCARCNT ((uint32_t)0x000E0000) /*!< SCARCNT[2:0] bits (SmartCard Auto-Retry Count) */
mbed_official 392:2b59412bb664 2808 #define USART_CR3_SCARCNT_0 ((uint32_t)0x00020000) /*!< Bit 0 */
mbed_official 392:2b59412bb664 2809 #define USART_CR3_SCARCNT_1 ((uint32_t)0x00040000) /*!< Bit 1 */
mbed_official 392:2b59412bb664 2810 #define USART_CR3_SCARCNT_2 ((uint32_t)0x00080000) /*!< Bit 2 */
mbed_official 392:2b59412bb664 2811 #define USART_CR3_WUS ((uint32_t)0x00300000) /*!< WUS[1:0] bits (Wake UP Interrupt Flag Selection) */
mbed_official 392:2b59412bb664 2812 #define USART_CR3_WUS_0 ((uint32_t)0x00100000) /*!< Bit 0 */
mbed_official 392:2b59412bb664 2813 #define USART_CR3_WUS_1 ((uint32_t)0x00200000) /*!< Bit 1 */
mbed_official 392:2b59412bb664 2814 #define USART_CR3_WUFIE ((uint32_t)0x00400000) /*!< Wake Up Interrupt Enable */
mbed_official 392:2b59412bb664 2815
mbed_official 392:2b59412bb664 2816 /****************** Bit definition for USART_BRR register *******************/
mbed_official 392:2b59412bb664 2817 #define USART_BRR_DIV_FRACTION ((uint32_t)0x0000000F) /*!< Fraction of USARTDIV */
mbed_official 392:2b59412bb664 2818 #define USART_BRR_DIV_MANTISSA ((uint32_t)0x0000FFF0) /*!< Mantissa of USARTDIV */
mbed_official 392:2b59412bb664 2819
mbed_official 392:2b59412bb664 2820 /****************** Bit definition for USART_GTPR register ******************/
mbed_official 392:2b59412bb664 2821 #define USART_GTPR_PSC ((uint32_t)0x000000FF) /*!< PSC[7:0] bits (Prescaler value) */
mbed_official 392:2b59412bb664 2822 #define USART_GTPR_GT ((uint32_t)0x0000FF00) /*!< GT[7:0] bits (Guard time value) */
mbed_official 392:2b59412bb664 2823
mbed_official 392:2b59412bb664 2824
mbed_official 392:2b59412bb664 2825 /******************* Bit definition for USART_RTOR register *****************/
mbed_official 392:2b59412bb664 2826 #define USART_RTOR_RTO ((uint32_t)0x00FFFFFF) /*!< Receiver Time Out Value */
mbed_official 392:2b59412bb664 2827 #define USART_RTOR_BLEN ((uint32_t)0xFF000000) /*!< Block Length */
mbed_official 392:2b59412bb664 2828
mbed_official 392:2b59412bb664 2829 /******************* Bit definition for USART_RQR register ******************/
mbed_official 392:2b59412bb664 2830 #define USART_RQR_ABRRQ ((uint32_t)0x00000001) /*!< Auto-Baud Rate Request */
mbed_official 392:2b59412bb664 2831 #define USART_RQR_SBKRQ ((uint32_t)0x00000002) /*!< Send Break Request */
mbed_official 392:2b59412bb664 2832 #define USART_RQR_MMRQ ((uint32_t)0x00000004) /*!< Mute Mode Request */
mbed_official 392:2b59412bb664 2833 #define USART_RQR_RXFRQ ((uint32_t)0x00000008) /*!< Receive Data flush Request */
mbed_official 392:2b59412bb664 2834 #define USART_RQR_TXFRQ ((uint32_t)0x00000010) /*!< Transmit data flush Request */
mbed_official 392:2b59412bb664 2835
mbed_official 392:2b59412bb664 2836 /******************* Bit definition for USART_ISR register ******************/
mbed_official 392:2b59412bb664 2837 #define USART_ISR_PE ((uint32_t)0x00000001) /*!< Parity Error */
mbed_official 392:2b59412bb664 2838 #define USART_ISR_FE ((uint32_t)0x00000002) /*!< Framing Error */
mbed_official 392:2b59412bb664 2839 #define USART_ISR_NE ((uint32_t)0x00000004) /*!< Noise detected Flag */
mbed_official 392:2b59412bb664 2840 #define USART_ISR_ORE ((uint32_t)0x00000008) /*!< OverRun Error */
mbed_official 392:2b59412bb664 2841 #define USART_ISR_IDLE ((uint32_t)0x00000010) /*!< IDLE line detected */
mbed_official 392:2b59412bb664 2842 #define USART_ISR_RXNE ((uint32_t)0x00000020) /*!< Read Data Register Not Empty */
mbed_official 392:2b59412bb664 2843 #define USART_ISR_TC ((uint32_t)0x00000040) /*!< Transmission Complete */
mbed_official 392:2b59412bb664 2844 #define USART_ISR_TXE ((uint32_t)0x00000080) /*!< Transmit Data Register Empty */
mbed_official 392:2b59412bb664 2845 #define USART_ISR_LBDF ((uint32_t)0x00000100) /*!< LIN Break Detection Flag */
mbed_official 392:2b59412bb664 2846 #define USART_ISR_CTSIF ((uint32_t)0x00000200) /*!< CTS interrupt flag */
mbed_official 392:2b59412bb664 2847 #define USART_ISR_CTS ((uint32_t)0x00000400) /*!< CTS flag */
mbed_official 392:2b59412bb664 2848 #define USART_ISR_RTOF ((uint32_t)0x00000800) /*!< Receiver Time Out */
mbed_official 392:2b59412bb664 2849 #define USART_ISR_EOBF ((uint32_t)0x00001000) /*!< End Of Block Flag */
mbed_official 392:2b59412bb664 2850 #define USART_ISR_ABRE ((uint32_t)0x00004000) /*!< Auto-Baud Rate Error */
mbed_official 392:2b59412bb664 2851 #define USART_ISR_ABRF ((uint32_t)0x00008000) /*!< Auto-Baud Rate Flag */
mbed_official 392:2b59412bb664 2852 #define USART_ISR_BUSY ((uint32_t)0x00010000) /*!< Busy Flag */
mbed_official 392:2b59412bb664 2853 #define USART_ISR_CMF ((uint32_t)0x00020000) /*!< Character Match Flag */
mbed_official 392:2b59412bb664 2854 #define USART_ISR_SBKF ((uint32_t)0x00040000) /*!< Send Break Flag */
mbed_official 392:2b59412bb664 2855 #define USART_ISR_RWU ((uint32_t)0x00080000) /*!< Receive Wake Up from mute mode Flag */
mbed_official 392:2b59412bb664 2856 #define USART_ISR_WUF ((uint32_t)0x00100000) /*!< Wake Up from stop mode Flag */
mbed_official 392:2b59412bb664 2857 #define USART_ISR_TEACK ((uint32_t)0x00200000) /*!< Transmit Enable Acknowledge Flag */
mbed_official 392:2b59412bb664 2858 #define USART_ISR_REACK ((uint32_t)0x00400000) /*!< Receive Enable Acknowledge Flag */
mbed_official 392:2b59412bb664 2859
mbed_official 392:2b59412bb664 2860 /******************* Bit definition for USART_ICR register ******************/
mbed_official 392:2b59412bb664 2861 #define USART_ICR_PECF ((uint32_t)0x00000001) /*!< Parity Error Clear Flag */
mbed_official 392:2b59412bb664 2862 #define USART_ICR_FECF ((uint32_t)0x00000002) /*!< Framing Error Clear Flag */
mbed_official 392:2b59412bb664 2863 #define USART_ICR_NCF ((uint32_t)0x00000004) /*!< Noise detected Clear Flag */
mbed_official 392:2b59412bb664 2864 #define USART_ICR_ORECF ((uint32_t)0x00000008) /*!< OverRun Error Clear Flag */
mbed_official 392:2b59412bb664 2865 #define USART_ICR_IDLECF ((uint32_t)0x00000010) /*!< IDLE line detected Clear Flag */
mbed_official 392:2b59412bb664 2866 #define USART_ICR_TCCF ((uint32_t)0x00000040) /*!< Transmission Complete Clear Flag */
mbed_official 392:2b59412bb664 2867 #define USART_ICR_LBDCF ((uint32_t)0x00000100) /*!< LIN Break Detection Clear Flag */
mbed_official 392:2b59412bb664 2868 #define USART_ICR_CTSCF ((uint32_t)0x00000200) /*!< CTS Interrupt Clear Flag */
mbed_official 392:2b59412bb664 2869 #define USART_ICR_RTOCF ((uint32_t)0x00000800) /*!< Receiver Time Out Clear Flag */
mbed_official 392:2b59412bb664 2870 #define USART_ICR_EOBCF ((uint32_t)0x00001000) /*!< End Of Block Clear Flag */
mbed_official 392:2b59412bb664 2871 #define USART_ICR_CMCF ((uint32_t)0x00020000) /*!< Character Match Clear Flag */
mbed_official 392:2b59412bb664 2872 #define USART_ICR_WUCF ((uint32_t)0x00100000) /*!< Wake Up from stop mode Clear Flag */
mbed_official 392:2b59412bb664 2873
mbed_official 392:2b59412bb664 2874 /******************* Bit definition for USART_RDR register ******************/
mbed_official 392:2b59412bb664 2875 #define USART_RDR_RDR ((uint16_t)0x01FF) /*!< RDR[8:0] bits (Receive Data value) */
mbed_official 392:2b59412bb664 2876
mbed_official 392:2b59412bb664 2877 /******************* Bit definition for USART_TDR register ******************/
mbed_official 392:2b59412bb664 2878 #define USART_TDR_TDR ((uint16_t)0x01FF) /*!< TDR[8:0] bits (Transmit Data value) */
mbed_official 392:2b59412bb664 2879
mbed_official 392:2b59412bb664 2880 /******************************************************************************/
mbed_official 392:2b59412bb664 2881 /* */
mbed_official 392:2b59412bb664 2882 /* Window WATCHDOG (WWDG) */
mbed_official 392:2b59412bb664 2883 /* */
mbed_official 392:2b59412bb664 2884 /******************************************************************************/
mbed_official 392:2b59412bb664 2885 /******************* Bit definition for WWDG_CR register ********************/
mbed_official 392:2b59412bb664 2886 #define WWDG_CR_T ((uint32_t)0x7F) /*!<T[6:0] bits (7-Bit counter (MSB to LSB)) */
mbed_official 392:2b59412bb664 2887 #define WWDG_CR_T0 ((uint32_t)0x01) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2888 #define WWDG_CR_T1 ((uint32_t)0x02) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2889 #define WWDG_CR_T2 ((uint32_t)0x04) /*!<Bit 2 */
mbed_official 392:2b59412bb664 2890 #define WWDG_CR_T3 ((uint32_t)0x08) /*!<Bit 3 */
mbed_official 392:2b59412bb664 2891 #define WWDG_CR_T4 ((uint32_t)0x10) /*!<Bit 4 */
mbed_official 392:2b59412bb664 2892 #define WWDG_CR_T5 ((uint32_t)0x20) /*!<Bit 5 */
mbed_official 392:2b59412bb664 2893 #define WWDG_CR_T6 ((uint32_t)0x40) /*!<Bit 6 */
mbed_official 392:2b59412bb664 2894
mbed_official 392:2b59412bb664 2895 #define WWDG_CR_WDGA ((uint32_t)0x80) /*!<Activation bit */
mbed_official 392:2b59412bb664 2896
mbed_official 392:2b59412bb664 2897 /******************* Bit definition for WWDG_CFR register *******************/
mbed_official 392:2b59412bb664 2898 #define WWDG_CFR_W ((uint32_t)0x007F) /*!<W[6:0] bits (7-bit window value) */
mbed_official 392:2b59412bb664 2899 #define WWDG_CFR_W0 ((uint32_t)0x0001) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2900 #define WWDG_CFR_W1 ((uint32_t)0x0002) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2901 #define WWDG_CFR_W2 ((uint32_t)0x0004) /*!<Bit 2 */
mbed_official 392:2b59412bb664 2902 #define WWDG_CFR_W3 ((uint32_t)0x0008) /*!<Bit 3 */
mbed_official 392:2b59412bb664 2903 #define WWDG_CFR_W4 ((uint32_t)0x0010) /*!<Bit 4 */
mbed_official 392:2b59412bb664 2904 #define WWDG_CFR_W5 ((uint32_t)0x0020) /*!<Bit 5 */
mbed_official 392:2b59412bb664 2905 #define WWDG_CFR_W6 ((uint32_t)0x0040) /*!<Bit 6 */
mbed_official 392:2b59412bb664 2906
mbed_official 392:2b59412bb664 2907 #define WWDG_CFR_WDGTB ((uint32_t)0x0180) /*!<WDGTB[1:0] bits (Timer Base) */
mbed_official 392:2b59412bb664 2908 #define WWDG_CFR_WDGTB0 ((uint32_t)0x0080) /*!<Bit 0 */
mbed_official 392:2b59412bb664 2909 #define WWDG_CFR_WDGTB1 ((uint32_t)0x0100) /*!<Bit 1 */
mbed_official 392:2b59412bb664 2910
mbed_official 392:2b59412bb664 2911 #define WWDG_CFR_EWI ((uint32_t)0x0200) /*!<Early Wakeup Interrupt */
mbed_official 392:2b59412bb664 2912
mbed_official 392:2b59412bb664 2913 /******************* Bit definition for WWDG_SR register ********************/
mbed_official 392:2b59412bb664 2914 #define WWDG_SR_EWIF ((uint32_t)0x01) /*!<Early Wakeup Interrupt Flag */
mbed_official 392:2b59412bb664 2915
mbed_official 392:2b59412bb664 2916 /**
mbed_official 392:2b59412bb664 2917 * @}
mbed_official 392:2b59412bb664 2918 */
mbed_official 392:2b59412bb664 2919
mbed_official 392:2b59412bb664 2920 /**
mbed_official 392:2b59412bb664 2921 * @}
mbed_official 392:2b59412bb664 2922 */
mbed_official 392:2b59412bb664 2923
mbed_official 392:2b59412bb664 2924
mbed_official 392:2b59412bb664 2925 /** @addtogroup Exported_macro
mbed_official 392:2b59412bb664 2926 * @{
mbed_official 392:2b59412bb664 2927 */
mbed_official 392:2b59412bb664 2928
mbed_official 392:2b59412bb664 2929 /****************************** ADC Instances *********************************/
mbed_official 392:2b59412bb664 2930 #define IS_ADC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == ADC1)
mbed_official 392:2b59412bb664 2931
mbed_official 392:2b59412bb664 2932 #define IS_ADC_COMMON_INSTANCE(INSTANCE) ((INSTANCE) == ADC)
mbed_official 392:2b59412bb664 2933
mbed_official 392:2b59412bb664 2934 /****************************** CRC Instances *********************************/
mbed_official 392:2b59412bb664 2935 #define IS_CRC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CRC)
mbed_official 392:2b59412bb664 2936
mbed_official 392:2b59412bb664 2937 /******************************* DMA Instances ******************************/
mbed_official 392:2b59412bb664 2938 #define IS_DMA_ALL_INSTANCE(INSTANCE) (((INSTANCE) == DMA1_Channel1) || \
mbed_official 392:2b59412bb664 2939 ((INSTANCE) == DMA1_Channel2) || \
mbed_official 392:2b59412bb664 2940 ((INSTANCE) == DMA1_Channel3) || \
mbed_official 392:2b59412bb664 2941 ((INSTANCE) == DMA1_Channel4) || \
mbed_official 392:2b59412bb664 2942 ((INSTANCE) == DMA1_Channel5))
mbed_official 392:2b59412bb664 2943
mbed_official 392:2b59412bb664 2944 /****************************** GPIO Instances ********************************/
mbed_official 441:d2c15dda23c1 2945 #define IS_GPIO_ALL_INSTANCE(INSTANCE) (((INSTANCE) == GPIOA) || \
mbed_official 441:d2c15dda23c1 2946 ((INSTANCE) == GPIOB) || \
mbed_official 441:d2c15dda23c1 2947 ((INSTANCE) == GPIOC) || \
mbed_official 441:d2c15dda23c1 2948 ((INSTANCE) == GPIOD) || \
mbed_official 441:d2c15dda23c1 2949 ((INSTANCE) == GPIOF))
mbed_official 441:d2c15dda23c1 2950
mbed_official 441:d2c15dda23c1 2951 #define IS_GPIO_AF_INSTANCE(INSTANCE) (((INSTANCE) == GPIOA) || \
mbed_official 441:d2c15dda23c1 2952 ((INSTANCE) == GPIOB))
mbed_official 441:d2c15dda23c1 2953
mbed_official 392:2b59412bb664 2954 #define IS_GPIO_LOCK_INSTANCE(INSTANCE) (((INSTANCE) == GPIOA) || \
mbed_official 392:2b59412bb664 2955 ((INSTANCE) == GPIOB))
mbed_official 392:2b59412bb664 2956
mbed_official 392:2b59412bb664 2957 /****************************** I2C Instances *********************************/
mbed_official 392:2b59412bb664 2958 #define IS_I2C_ALL_INSTANCE(INSTANCE) (((INSTANCE) == I2C1) || \
mbed_official 392:2b59412bb664 2959 ((INSTANCE) == I2C2))
mbed_official 392:2b59412bb664 2960
mbed_official 392:2b59412bb664 2961 /****************************** IWDG Instances ********************************/
mbed_official 392:2b59412bb664 2962 #define IS_IWDG_ALL_INSTANCE(INSTANCE) ((INSTANCE) == IWDG)
mbed_official 392:2b59412bb664 2963
mbed_official 392:2b59412bb664 2964 /****************************** RTC Instances *********************************/
mbed_official 392:2b59412bb664 2965 #define IS_RTC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == RTC)
mbed_official 392:2b59412bb664 2966
mbed_official 392:2b59412bb664 2967 /****************************** SMBUS Instances *********************************/
mbed_official 392:2b59412bb664 2968 #define IS_SMBUS_ALL_INSTANCE(INSTANCE) ((INSTANCE) == I2C1)
mbed_official 392:2b59412bb664 2969
mbed_official 392:2b59412bb664 2970 /****************************** SPI Instances *********************************/
mbed_official 392:2b59412bb664 2971 #define IS_SPI_ALL_INSTANCE(INSTANCE) (((INSTANCE) == SPI1) || \
mbed_official 392:2b59412bb664 2972 ((INSTANCE) == SPI2))
mbed_official 392:2b59412bb664 2973
mbed_official 392:2b59412bb664 2974 /****************************** TIM Instances *********************************/
mbed_official 392:2b59412bb664 2975 #define IS_TIM_INSTANCE(INSTANCE)\
mbed_official 392:2b59412bb664 2976 (((INSTANCE) == TIM1) || \
mbed_official 392:2b59412bb664 2977 ((INSTANCE) == TIM3) || \
mbed_official 392:2b59412bb664 2978 ((INSTANCE) == TIM6) || \
mbed_official 392:2b59412bb664 2979 ((INSTANCE) == TIM14) || \
mbed_official 392:2b59412bb664 2980 ((INSTANCE) == TIM15) || \
mbed_official 392:2b59412bb664 2981 ((INSTANCE) == TIM16) || \
mbed_official 392:2b59412bb664 2982 ((INSTANCE) == TIM17))
mbed_official 392:2b59412bb664 2983
mbed_official 392:2b59412bb664 2984 #define IS_TIM_CC1_INSTANCE(INSTANCE)\
mbed_official 392:2b59412bb664 2985 (((INSTANCE) == TIM1) || \
mbed_official 392:2b59412bb664 2986 ((INSTANCE) == TIM3) || \
mbed_official 392:2b59412bb664 2987 ((INSTANCE) == TIM14) || \
mbed_official 392:2b59412bb664 2988 ((INSTANCE) == TIM15) || \
mbed_official 392:2b59412bb664 2989 ((INSTANCE) == TIM16) || \
mbed_official 392:2b59412bb664 2990 ((INSTANCE) == TIM17))
mbed_official 392:2b59412bb664 2991
mbed_official 392:2b59412bb664 2992 #define IS_TIM_CC2_INSTANCE(INSTANCE)\
mbed_official 392:2b59412bb664 2993 (((INSTANCE) == TIM1) || \
mbed_official 392:2b59412bb664 2994 ((INSTANCE) == TIM3) || \
mbed_official 392:2b59412bb664 2995 ((INSTANCE) == TIM15))
mbed_official 392:2b59412bb664 2996
mbed_official 392:2b59412bb664 2997 #define IS_TIM_CC3_INSTANCE(INSTANCE)\
mbed_official 392:2b59412bb664 2998 (((INSTANCE) == TIM1) || \
mbed_official 392:2b59412bb664 2999 ((INSTANCE) == TIM3))
mbed_official 392:2b59412bb664 3000
mbed_official 392:2b59412bb664 3001 #define IS_TIM_CC4_INSTANCE(INSTANCE)\
mbed_official 392:2b59412bb664 3002 (((INSTANCE) == TIM1) || \
mbed_official 392:2b59412bb664 3003 ((INSTANCE) == TIM3))
mbed_official 392:2b59412bb664 3004
mbed_official 392:2b59412bb664 3005 #define IS_TIM_CLOCKSOURCE_ETRMODE1_INSTANCE(INSTANCE)\
mbed_official 392:2b59412bb664 3006 (((INSTANCE) == TIM1) || \
mbed_official 392:2b59412bb664 3007 ((INSTANCE) == TIM3))
mbed_official 392:2b59412bb664 3008
mbed_official 392:2b59412bb664 3009 #define IS_TIM_CLOCKSOURCE_ETRMODE2_INSTANCE(INSTANCE)\
mbed_official 392:2b59412bb664 3010 (((INSTANCE) == TIM1) || \
mbed_official 392:2b59412bb664 3011 ((INSTANCE) == TIM3))
mbed_official 392:2b59412bb664 3012
mbed_official 392:2b59412bb664 3013 #define IS_TIM_CLOCKSOURCE_TIX_INSTANCE(INSTANCE)\
mbed_official 392:2b59412bb664 3014 (((INSTANCE) == TIM1) || \
mbed_official 392:2b59412bb664 3015 ((INSTANCE) == TIM3) || \
mbed_official 392:2b59412bb664 3016 ((INSTANCE) == TIM15))
mbed_official 392:2b59412bb664 3017
mbed_official 392:2b59412bb664 3018 #define IS_TIM_CLOCKSOURCE_ITRX_INSTANCE(INSTANCE)\
mbed_official 392:2b59412bb664 3019 (((INSTANCE) == TIM1) || \
mbed_official 392:2b59412bb664 3020 ((INSTANCE) == TIM3) || \
mbed_official 392:2b59412bb664 3021 ((INSTANCE) == TIM15))
mbed_official 392:2b59412bb664 3022
mbed_official 392:2b59412bb664 3023 #define IS_TIM_OCXREF_CLEAR_INSTANCE(INSTANCE)\
mbed_official 392:2b59412bb664 3024 (((INSTANCE) == TIM1) || \
mbed_official 392:2b59412bb664 3025 ((INSTANCE) == TIM3))
mbed_official 392:2b59412bb664 3026
mbed_official 392:2b59412bb664 3027 #define IS_TIM_ENCODER_INTERFACE_INSTANCE(INSTANCE)\
mbed_official 392:2b59412bb664 3028 (((INSTANCE) == TIM1) || \
mbed_official 392:2b59412bb664 3029 ((INSTANCE) == TIM3))
mbed_official 392:2b59412bb664 3030
mbed_official 392:2b59412bb664 3031 #define IS_TIM_HALL_INTERFACE_INSTANCE(INSTANCE)\
mbed_official 392:2b59412bb664 3032 (((INSTANCE) == TIM1))
mbed_official 392:2b59412bb664 3033
mbed_official 392:2b59412bb664 3034 #define IS_TIM_XOR_INSTANCE(INSTANCE)\
mbed_official 392:2b59412bb664 3035 (((INSTANCE) == TIM1) || \
mbed_official 392:2b59412bb664 3036 ((INSTANCE) == TIM3))
mbed_official 392:2b59412bb664 3037
mbed_official 392:2b59412bb664 3038 #define IS_TIM_MASTER_INSTANCE(INSTANCE)\
mbed_official 392:2b59412bb664 3039 (((INSTANCE) == TIM1) || \
mbed_official 392:2b59412bb664 3040 ((INSTANCE) == TIM3) || \
mbed_official 392:2b59412bb664 3041 ((INSTANCE) == TIM15))
mbed_official 392:2b59412bb664 3042
mbed_official 392:2b59412bb664 3043 #define IS_TIM_SLAVE_INSTANCE(INSTANCE)\
mbed_official 392:2b59412bb664 3044 (((INSTANCE) == TIM1) || \
mbed_official 392:2b59412bb664 3045 ((INSTANCE) == TIM3) || \
mbed_official 392:2b59412bb664 3046 ((INSTANCE) == TIM15))
mbed_official 392:2b59412bb664 3047
mbed_official 392:2b59412bb664 3048 #define IS_TIM_32B_COUNTER_INSTANCE(INSTANCE) (0)
mbed_official 392:2b59412bb664 3049
mbed_official 392:2b59412bb664 3050 #define IS_TIM_DMABURST_INSTANCE(INSTANCE)\
mbed_official 392:2b59412bb664 3051 (((INSTANCE) == TIM1) || \
mbed_official 392:2b59412bb664 3052 ((INSTANCE) == TIM3) || \
mbed_official 392:2b59412bb664 3053 ((INSTANCE) == TIM15) || \
mbed_official 392:2b59412bb664 3054 ((INSTANCE) == TIM16) || \
mbed_official 392:2b59412bb664 3055 ((INSTANCE) == TIM17))
mbed_official 392:2b59412bb664 3056
mbed_official 392:2b59412bb664 3057 #define IS_TIM_BREAK_INSTANCE(INSTANCE)\
mbed_official 392:2b59412bb664 3058 (((INSTANCE) == TIM1) || \
mbed_official 392:2b59412bb664 3059 ((INSTANCE) == TIM15) || \
mbed_official 392:2b59412bb664 3060 ((INSTANCE) == TIM16) || \
mbed_official 392:2b59412bb664 3061 ((INSTANCE) == TIM17))
mbed_official 392:2b59412bb664 3062
mbed_official 392:2b59412bb664 3063 #define IS_TIM_CCX_INSTANCE(INSTANCE, CHANNEL) \
mbed_official 392:2b59412bb664 3064 ((((INSTANCE) == TIM1) && \
mbed_official 392:2b59412bb664 3065 (((CHANNEL) == TIM_CHANNEL_1) || \
mbed_official 392:2b59412bb664 3066 ((CHANNEL) == TIM_CHANNEL_2) || \
mbed_official 392:2b59412bb664 3067 ((CHANNEL) == TIM_CHANNEL_3) || \
mbed_official 392:2b59412bb664 3068 ((CHANNEL) == TIM_CHANNEL_4))) \
mbed_official 392:2b59412bb664 3069 || \
mbed_official 392:2b59412bb664 3070 (((INSTANCE) == TIM3) && \
mbed_official 392:2b59412bb664 3071 (((CHANNEL) == TIM_CHANNEL_1) || \
mbed_official 392:2b59412bb664 3072 ((CHANNEL) == TIM_CHANNEL_2) || \
mbed_official 392:2b59412bb664 3073 ((CHANNEL) == TIM_CHANNEL_3) || \
mbed_official 392:2b59412bb664 3074 ((CHANNEL) == TIM_CHANNEL_4))) \
mbed_official 392:2b59412bb664 3075 || \
mbed_official 392:2b59412bb664 3076 (((INSTANCE) == TIM14) && \
mbed_official 392:2b59412bb664 3077 (((CHANNEL) == TIM_CHANNEL_1))) \
mbed_official 392:2b59412bb664 3078 || \
mbed_official 392:2b59412bb664 3079 (((INSTANCE) == TIM15) && \
mbed_official 392:2b59412bb664 3080 (((CHANNEL) == TIM_CHANNEL_1) || \
mbed_official 392:2b59412bb664 3081 ((CHANNEL) == TIM_CHANNEL_2))) \
mbed_official 392:2b59412bb664 3082 || \
mbed_official 392:2b59412bb664 3083 (((INSTANCE) == TIM16) && \
mbed_official 392:2b59412bb664 3084 (((CHANNEL) == TIM_CHANNEL_1))) \
mbed_official 392:2b59412bb664 3085 || \
mbed_official 392:2b59412bb664 3086 (((INSTANCE) == TIM17) && \
mbed_official 392:2b59412bb664 3087 (((CHANNEL) == TIM_CHANNEL_1))))
mbed_official 392:2b59412bb664 3088
mbed_official 392:2b59412bb664 3089 #define IS_TIM_CCXN_INSTANCE(INSTANCE, CHANNEL) \
mbed_official 392:2b59412bb664 3090 ((((INSTANCE) == TIM1) && \
mbed_official 392:2b59412bb664 3091 (((CHANNEL) == TIM_CHANNEL_1) || \
mbed_official 392:2b59412bb664 3092 ((CHANNEL) == TIM_CHANNEL_2) || \
mbed_official 392:2b59412bb664 3093 ((CHANNEL) == TIM_CHANNEL_3))) \
mbed_official 392:2b59412bb664 3094 || \
mbed_official 392:2b59412bb664 3095 (((INSTANCE) == TIM15) && \
mbed_official 392:2b59412bb664 3096 ((CHANNEL) == TIM_CHANNEL_1)) \
mbed_official 392:2b59412bb664 3097 || \
mbed_official 392:2b59412bb664 3098 (((INSTANCE) == TIM16) && \
mbed_official 392:2b59412bb664 3099 ((CHANNEL) == TIM_CHANNEL_1)) \
mbed_official 392:2b59412bb664 3100 || \
mbed_official 392:2b59412bb664 3101 (((INSTANCE) == TIM17) && \
mbed_official 392:2b59412bb664 3102 ((CHANNEL) == TIM_CHANNEL_1)))
mbed_official 392:2b59412bb664 3103
mbed_official 392:2b59412bb664 3104 #define IS_TIM_COUNTER_MODE_SELECT_INSTANCE(INSTANCE)\
mbed_official 392:2b59412bb664 3105 (((INSTANCE) == TIM1) || \
mbed_official 392:2b59412bb664 3106 ((INSTANCE) == TIM3))
mbed_official 392:2b59412bb664 3107
mbed_official 392:2b59412bb664 3108 #define IS_TIM_REPETITION_COUNTER_INSTANCE(INSTANCE)\
mbed_official 392:2b59412bb664 3109 (((INSTANCE) == TIM1) || \
mbed_official 392:2b59412bb664 3110 ((INSTANCE) == TIM15) || \
mbed_official 392:2b59412bb664 3111 ((INSTANCE) == TIM16) || \
mbed_official 392:2b59412bb664 3112 ((INSTANCE) == TIM17))
mbed_official 392:2b59412bb664 3113
mbed_official 392:2b59412bb664 3114 #define IS_TIM_CLOCK_DIVISION_INSTANCE(INSTANCE)\
mbed_official 392:2b59412bb664 3115 (((INSTANCE) == TIM1) || \
mbed_official 392:2b59412bb664 3116 ((INSTANCE) == TIM3) || \
mbed_official 392:2b59412bb664 3117 ((INSTANCE) == TIM14) || \
mbed_official 392:2b59412bb664 3118 ((INSTANCE) == TIM15) || \
mbed_official 392:2b59412bb664 3119 ((INSTANCE) == TIM16) || \
mbed_official 392:2b59412bb664 3120 ((INSTANCE) == TIM17))
mbed_official 392:2b59412bb664 3121
mbed_official 392:2b59412bb664 3122 #define IS_TIM_DMA_INSTANCE(INSTANCE)\
mbed_official 392:2b59412bb664 3123 (((INSTANCE) == TIM1) || \
mbed_official 392:2b59412bb664 3124 ((INSTANCE) == TIM3) || \
mbed_official 392:2b59412bb664 3125 ((INSTANCE) == TIM6) || \
mbed_official 392:2b59412bb664 3126 ((INSTANCE) == TIM15) || \
mbed_official 392:2b59412bb664 3127 ((INSTANCE) == TIM16) || \
mbed_official 392:2b59412bb664 3128 ((INSTANCE) == TIM17))
mbed_official 392:2b59412bb664 3129
mbed_official 392:2b59412bb664 3130 #define IS_TIM_DMA_CC_INSTANCE(INSTANCE)\
mbed_official 392:2b59412bb664 3131 (((INSTANCE) == TIM1) || \
mbed_official 392:2b59412bb664 3132 ((INSTANCE) == TIM3) || \
mbed_official 392:2b59412bb664 3133 ((INSTANCE) == TIM15) || \
mbed_official 392:2b59412bb664 3134 ((INSTANCE) == TIM16) || \
mbed_official 392:2b59412bb664 3135 ((INSTANCE) == TIM17))
mbed_official 392:2b59412bb664 3136
mbed_official 392:2b59412bb664 3137 #define IS_TIM_COMMUTATION_EVENT_INSTANCE(INSTANCE)\
mbed_official 392:2b59412bb664 3138 (((INSTANCE) == TIM1) || \
mbed_official 392:2b59412bb664 3139 ((INSTANCE) == TIM15) || \
mbed_official 392:2b59412bb664 3140 ((INSTANCE) == TIM16) || \
mbed_official 392:2b59412bb664 3141 ((INSTANCE) == TIM17))
mbed_official 392:2b59412bb664 3142
mbed_official 392:2b59412bb664 3143 #define IS_TIM_REMAP_INSTANCE(INSTANCE)\
mbed_official 392:2b59412bb664 3144 ((INSTANCE) == TIM14)
mbed_official 392:2b59412bb664 3145
mbed_official 392:2b59412bb664 3146 /******************** USART Instances : Synchronous mode **********************/
mbed_official 392:2b59412bb664 3147 #define IS_USART_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
mbed_official 392:2b59412bb664 3148 ((INSTANCE) == USART2))
mbed_official 392:2b59412bb664 3149
mbed_official 392:2b59412bb664 3150 /******************** USART Instances : auto Baud rate detection **************/
mbed_official 392:2b59412bb664 3151 #define IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(INSTANCE) ((INSTANCE) == USART1)
mbed_official 392:2b59412bb664 3152
mbed_official 392:2b59412bb664 3153 /******************** UART Instances : Asynchronous mode **********************/
mbed_official 392:2b59412bb664 3154 #define IS_UART_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
mbed_official 392:2b59412bb664 3155 ((INSTANCE) == USART2))
mbed_official 392:2b59412bb664 3156
mbed_official 392:2b59412bb664 3157 /******************** UART Instances : Half-Duplex mode **********************/
mbed_official 392:2b59412bb664 3158 #define IS_UART_HALFDUPLEX_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
mbed_official 392:2b59412bb664 3159 ((INSTANCE) == USART2))
mbed_official 392:2b59412bb664 3160
mbed_official 392:2b59412bb664 3161 /****************** UART Instances : Hardware Flow control ********************/
mbed_official 392:2b59412bb664 3162 #define IS_UART_HWFLOW_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
mbed_official 392:2b59412bb664 3163 ((INSTANCE) == USART2))
mbed_official 392:2b59412bb664 3164
mbed_official 392:2b59412bb664 3165 /****************** UART Instances : Auto Baud Rate detection ********************/
mbed_official 392:2b59412bb664 3166 #define IS_UART_AUTOBAUDRATE_DETECTION_INSTANCE(INSTANCE) ((INSTANCE) == USART1)
mbed_official 392:2b59412bb664 3167
mbed_official 392:2b59412bb664 3168 /****************** UART Instances : Driver enable detection ********************/
mbed_official 392:2b59412bb664 3169 #define IS_UART_DRIVER_ENABLE_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
mbed_official 392:2b59412bb664 3170 ((INSTANCE) == USART2))
mbed_official 392:2b59412bb664 3171
mbed_official 392:2b59412bb664 3172 /****************************** WWDG Instances ********************************/
mbed_official 392:2b59412bb664 3173 #define IS_WWDG_ALL_INSTANCE(INSTANCE) ((INSTANCE) == WWDG)
mbed_official 392:2b59412bb664 3174
mbed_official 392:2b59412bb664 3175 /**
mbed_official 392:2b59412bb664 3176 * @}
mbed_official 392:2b59412bb664 3177 */
mbed_official 392:2b59412bb664 3178
mbed_official 392:2b59412bb664 3179
mbed_official 392:2b59412bb664 3180 /******************************************************************************/
mbed_official 392:2b59412bb664 3181 /* For a painless codes migration between the STM32F0xx device product */
mbed_official 392:2b59412bb664 3182 /* lines, the aliases defined below are put in place to overcome the */
mbed_official 392:2b59412bb664 3183 /* differences in the interrupt handlers and IRQn definitions. */
mbed_official 392:2b59412bb664 3184 /* No need to update developed interrupt code when moving across */
mbed_official 392:2b59412bb664 3185 /* product lines within the same STM32F0 Family */
mbed_official 392:2b59412bb664 3186 /******************************************************************************/
mbed_official 392:2b59412bb664 3187
mbed_official 392:2b59412bb664 3188 /* Aliases for __IRQn */
mbed_official 392:2b59412bb664 3189 #define RCC_CRS_IRQn RCC_IRQn
mbed_official 392:2b59412bb664 3190 #define DMA1_Channel4_5_6_7_IRQn DMA1_Channel4_5_IRQn
mbed_official 392:2b59412bb664 3191 #define ADC1_COMP_IRQn ADC1_IRQn
mbed_official 392:2b59412bb664 3192 #define TIM6_DAC_IRQn TIM6_IRQn
mbed_official 392:2b59412bb664 3193
mbed_official 392:2b59412bb664 3194 /* Aliases for __IRQHandler */
mbed_official 392:2b59412bb664 3195 #define RCC_CRS_IRQHandler RCC_IRQHandler
mbed_official 392:2b59412bb664 3196 #define DMA1_Channel4_5_6_7_IRQHandler DMA1_Channel4_5_IRQHandler
mbed_official 392:2b59412bb664 3197 #define ADC1_COMP_IRQHandler ADC1_IRQHandler
mbed_official 392:2b59412bb664 3198 #define TIM6_DAC_IRQHandler TIM6_IRQHandler
mbed_official 392:2b59412bb664 3199
mbed_official 392:2b59412bb664 3200 #ifdef __cplusplus
mbed_official 392:2b59412bb664 3201 }
mbed_official 392:2b59412bb664 3202 #endif /* __cplusplus */
mbed_official 392:2b59412bb664 3203
mbed_official 392:2b59412bb664 3204 #endif /* __STM32F030x8_H */
mbed_official 392:2b59412bb664 3205
mbed_official 392:2b59412bb664 3206 /**
mbed_official 392:2b59412bb664 3207 * @}
mbed_official 392:2b59412bb664 3208 */
mbed_official 392:2b59412bb664 3209
mbed_official 392:2b59412bb664 3210 /**
mbed_official 392:2b59412bb664 3211 * @}
mbed_official 392:2b59412bb664 3212 */
mbed_official 392:2b59412bb664 3213
mbed_official 392:2b59412bb664 3214 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/