/**
******************************************************************************
* @file stm32w108xx.h
* @author MCD Application Team
* @version V0.0.1RC1
* @date 28-May-2012
* @brief CMSIS Cortex-M3 Device Peripheral Access Layer Header File.
* This file contains all the peripheral register's definitions, bits
* definitions and memory mapping for STM32W108xx devices.
*
* The file is the unique include file that the application programmer
* is using in the C source code, usually in main.c. This file contains:
* - Configuration section that allows to select:
* - The device used in the target application
* - To use or not the peripheral’s drivers in application code(i.e.
* code will be based on direct access to peripheral’s registers
* rather than drivers API), this option is controlled by
* "#define USE_STDPERIPH_DRIVER"
* - To change few application-specific parameters such as the HSE
* crystal frequency
* - Data structures and the address mapping for all peripherals
* - Peripheral's registers declarations and bits definition
* - Macros to access peripheral’s registers hardware
*
******************************************************************************
* @attention
*
*
© COPYRIGHT 2012 STMicroelectronics
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
/** @addtogroup CMSIS
* @{
*/
/** @addtogroup stm32w108xx
* @{
*/
#ifndef __STM32W108XX_H
#define __STM32W108XX_H
#ifdef __cplusplus
extern "C" {
#endif
/** @addtogroup Library_configuration_section
* @{
*/
/** Uncomment the line below according to the target STM32 device used in your
* application
*/
#if !defined (STM32W108C8) && !defined (STM32W108CB) && !defined (STM32W108CC) && !defined (STM32W108CZ) && !defined (STM32W108HB)
/* #define STM32W108C8 */ /*!< STM32W108C8: 64k FLASH */
/* #define STM32W108CB */ /*!< STM32W108CB: 128k FLASH */
/* #define STM32W108CC */ /*!< STM32W108CC: 256k FLASH */
/* #define STM32W108CZ */ /*!< STM32W108CZ: 192k FLASH */
/* #define STM32W108HB */ /*!< STM32W108HB: 128k FLASH */
#endif
/** Tip: To avoid modifying this file each time you need to switch between these
* devices, you can define the device in your toolchain compiler preprocessor.
*/
#if !defined (STM32W108C8) && !defined (STM32W108CB) && !defined (STM32W108CC) && !defined (STM32W108CZ) && !defined (STM32W108HB)
#error "Please select first the target STM32W108XX device used in your application (in stm32w108xx.h file)"
#endif
#if !defined (USE_STDPERIPH_DRIVER)
/**
* @brief Comment the line below if you will not use the peripherals drivers.
* In this case, these drivers will not be included and the application code will
* be based on direct access to peripherals registers
*/
/* #define USE_STDPERIPH_DRIVER */
#endif /* USE_STDPERIPH_DRIVER */
/**
* @brief In the following line adjust the value of External High Speed oscillator (HSE)
* used in your application
*
* Tip: To avoid modifying this file each time you need to use different HSE, you
* can define the HSE value in your toolchain compiler preprocessor.
*/
#if !defined (HSE_VALUE)
#define HSE_VALUE ((uint32_t)24000000) /*!< Value of the External oscillator in Hz */
#endif /* HSE_VALUE */
/**
* @brief In the following line adjust the External High Speed oscillator (HSE) Startup
* Timeout value
*/
#if !defined (HSE_STARTUP_TIMEOUT)
#define HSE_STARTUP_TIMEOUT ((uint16_t)0x0500) /*!< Time out for HSE start up */
#endif /* HSE_STARTUP_TIMEOUT */
/**
* @brief The internal high speed clock (HSI) should be calibrated before using it.
* The defined one is the theoretical value.
*/
#if !defined (HSI_VALUE)
#define HSI_VALUE ((uint32_t)12000000) /*!< Value of the Internal oscillator in Hz*/
#endif /* HSI_VALUE */
/**
* @brief The internal low speed clock (LSI) should be calibrated before using it.
* The defined one is the theoretical value.
*/
#if !defined (LSI_VALUE)
#define LSI_VALUE ((uint32_t)10000) /*!< Value of the Internal Low Speed oscillator in Hz
The real value may vary depending on the variations
in voltage and temperature. */
#endif
/**
* @brief The following line define the External low Speed oscillator (LSE).
*
*/
#if !defined (LSE_VALUE)
#define LSE_VALUE ((uint32_t)32768) /*!< Value of the External Low Speed oscillator in Hz */
#endif
/**
* @brief STM32W108XX Standard Peripherals Library version number V0.0.1RC1
*/
#define __STM32W108XX_STDPERIPH_VERSION_MAIN (0x00) /*!< [31:24] main version */
#define __STM32W108XX_STDPERIPH_VERSION_SUB1 (0x00) /*!< [23:16] sub1 version */
#define __STM32W108XX_STDPERIPH_VERSION_SUB2 (0x01) /*!< [15:8] sub2 version */
#define __STM32W108XX_STDPERIPH_VERSION_RC (0x01) /*!< [7:0] release candidate */
#define __STM32W108XX_STDPERIPH_VERSION ((__STM32W108XX_STDPERIPH_VERSION_MAIN << 24)\
|(__STM32W108XX_STDPERIPH_VERSION_SUB1 << 16)\
|(__STM32W108XX_STDPERIPH_VERSION_SUB2 << 8)\
|(__STM32W108XX_STDPERIPH_VERSION_RC))
/**
* @}
*/
/** @addtogroup Configuration_section_for_CMSIS
* @{
*/
/**
* @brief Configuration of the Cortex-M3 Processor and Core Peripherals
*/
#define __CM3_REV 0x0101 /*!< Core revision r1p1 */
#define __MPU_PRESENT 1 /*!< STM32W108XX provides an MPU */
#define __NVIC_PRIO_BITS 4 /*!< STM32W108XX uses 4 Bits for the Priority Levels */
#define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
#define __FPU_PRESENT 0 /*!< FPU is not present */
/**
* @brief STM32W108XX Interrupt Number Definition, according to the selected device
* in @ref Library_configuration_section
*/
typedef enum IRQn
{
/****** Cortex-M3 Processor Exceptions Numbers ****************************************************************/
NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */
MemoryManagement_IRQn = -12, /*!< 4 Cortex-M3 Memory Management Interrupt */
BusFault_IRQn = -11, /*!< 5 Cortex-M3 Bus Fault Interrupt */
UsageFault_IRQn = -10, /*!< 6 Cortex-M3 Usage Fault Interrupt */
SVCall_IRQn = -5, /*!< 11 Cortex-M3 SV Call Interrupt */
DebugMonitor_IRQn = -4, /*!< 12 Cortex-M3 Debug Monitor Interrupt */
PendSV_IRQn = -2, /*!< 14 Cortex-M3 Pend SV Interrupt */
SysTick_IRQn = -1, /*!< 15 Cortex-M3 System Tick Interrupt */
/****** STM32W108xx specific Interrupt Numbers ****************************************************************/
TIM1_IRQn = 0, /*!< Timer 1 Interrupt */
TIM2_IRQn = 1, /*!< Timer 1 Interrupt */
MNG_IRQn = 2, /*!< Management Peripheral Interrupt */
BASEBAND_IRQn = 3, /*!< Base Band Interrupt */
SLPTIM_IRQn = 4, /*!< Sleep Timer Interrupt */
SC1_IRQn = 5, /*!< Serial Controller 1 Interrupt */
SC2_IRQn = 6, /*!< Serial Controller 2 Interrupt */
SECURITY_IRQn = 7, /*!< Security Interrupt */
MAC_TIM_IRQn = 8, /*!< MAC Timer Interrupt */
MAC_TR_IRQn = 9, /*!< MAC Transmit Interrupt */
MAC_RE_IRQn = 10, /*!< MAC Receive Interrupt */
ADC_IRQn = 11, /*!< ADC Interrupt */
EXTIA_IRQn = 12, /*!< EXTI port A interrupt */
EXTIB_IRQn = 13, /*!< EXTI port B interrupt */
EXTIC_IRQn = 14, /*!< EXTI port C interrupt */
EXTID_IRQn = 15, /*!< EXTI port D interrupt */
DEBUG_IRQn = 16 /*!< Debug Interrupt */
} IRQn_Type;
/**
* @}
*/
#include "core_cm3.h" /* Cortex-M3 processor and core peripherals */
#include "system_stm32w108xx.h"
#include
/** @addtogroup Exported_types
* @{
*/
typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
#define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus;
/**
* @}
*/
/** @addtogroup Peripheral_registers_structures
* @{
*/
/**
* @brief Clock Controller Registers
*/
typedef struct
{
__IO uint32_t SLEEPCR; /*!< Sleep timer control register, Address offset: 0x0000 */
__IO uint32_t LSI10KCR; /*!< LSI Clock (10KHz) control register, Address offset: 0x0004 */
__IO uint32_t LSI1KCR; /*!< LSI Clock (1KHz) control register, Address offset: 0x0008 */
uint32_t RESERVED0[4092];
__IO uint32_t HSECR1; /*!< HSE Clock (24MHz) control register 1, Address offset: 0x4000 */
__IO uint32_t HSICR; /*!< HSI Clock (12MHz) trim register, Address offset: 0x4004 */
uint32_t RESERVED1;
__IO uint32_t PERIODCR; /*!< Clock period control register, Address offset: 0x400C */
__IO uint32_t PERIODSR; /*!< Clock period status register, Address offset: 0x4010 */
__IO uint32_t DITHERCR; /*!< Clock dither control register, Address offset: 0x4014 */
__IO uint32_t HSECR2; /*!< HSE Clock (24MHz) control register 2, Address offset: 0x4018 */
__IO uint32_t CPUCR; /*!< Clock source select register, Address offset: 0x401C */
uint32_t RESERVED2;
__IO uint32_t PCTRACECR; /*!< Clock PC trace register, Address offset: 0x4024 */
} CLK_TypeDef;
/**
* @brief Power Management Registers (PWR)
*/
typedef struct
{
__IO uint32_t DSLEEPCR1; /*!< Deep Sleep Control register 1 Address offset 0x00 */
uint32_t RESERVED0[3]; /*!< Reserved 0x04 - 0x0C */
__IO uint32_t DSLEEPCR2; /*!< Deep Sleep Control register 2 Address offset 0x10 */
__IO uint32_t VREGCR; /*!< Voltage regulator Control register 1 Address offset 0x14 */
uint32_t RESERVED1; /*!< Reserved 0x18 */
__IO uint32_t WAKECR1; /*!< Wake Control register 1 Address offset 0x1C */
__IO uint32_t WAKECR2; /*!< Wake Control register 2 Address offset 0x20 */
__IO uint32_t WAKESR; /*!< Wake Status register Address offset 0x24 */
uint32_t RESERVED2[2]; /*!< Reserved 0x2C - 0x30 */
__IO uint32_t CPWRUPREQSR; /*!< CPWRUPREQ status register Address offset 0x30 */
__IO uint32_t CSYSPWRUPREQSR; /*!< CSYSPWRUPREQ status register Address offset 0x34 */
__IO uint32_t CSYSPWRUPACKSR; /*!< CSYSPWRUPACK status register Address offset 0x38 */
__IO uint32_t CSYSPWRUPACKCR; /*!< CSYSPWRUPACK control register Address offset 0x3C */
uint32_t RESERVED3[12017]; /*!< Reserved 0x40 - 0xBC00 */
__IO uint32_t WAKEPAR; /*!< Wake GPIO Port A register Address offset 0xBC04 */
__IO uint32_t WAKEPBR; /*!< Wake GPIO Port B register Address offset 0xBC08 */
__IO uint32_t WAKEPCR; /*!< Wake GPIO Port C register Address offset 0xBC0C */
uint32_t RESERVED4[2]; /*!< Reserved 0xBC10 - 0xBC14 */
__IO uint32_t WAKEFILTR; /*!< Wake filter register Address offset 0xBC18 */
} PWR_TypeDef;
/**
* @brief Reset Registers
*/
typedef struct
{
__IO uint32_t SR; /*!< Reset Status Register Address offset: 0x2C */
} RST_TypeDef;
/**
* @brief FLASH Registers
*/
typedef struct
{
__IO uint32_t CLKER; /*!< FLASH controller clock enable register Address offset: 0x0000 */
__IO uint32_t CLKSR; /*!< FLASH controller clock status register Address offset: 0x0004 */
uint32_t RESERVED0[4083]; /*!< Reserved 0x08 */
__IO uint32_t ACR; /*!< FLASH access control register, Address offset: 0x3FD4 */
__IO uint32_t KEYR; /*!< FLASH key register, Address offset: 0x3FD8 */
__IO uint32_t OPTKEYR; /*!< FLASH OPT key register, Address offset: 0x3FDC */
__IO uint32_t SR; /*!< FLASH status register, Address offset: 0x3FE0 */
__IO uint32_t CR; /*!< FLASH control register, Address offset: 0x3FE4 */
__IO uint32_t AR; /*!< FLASH address register, Address offset: 0x3FE8 */
uint32_t RESERVED1; /*!< Reserved 0x3FEC */
__IO uint32_t OBR; /*!< FLASH option bytes register, Address offset: 0x3FF0 */
__IO uint32_t WRPR; /*!< FLASH option bytes register, Address offset: 0x3FF4 */
} FLASH_TypeDef;
/**
* @brief Memory Registers
*/
typedef struct
{
__IO uint32_t RAMPROTR1; /*!< Memory protection register1, Address offset: 0x00 */
__IO uint32_t RAMPROTR2; /*!< Memory protection register2, Address offset: 0x04 */
__IO uint32_t RAMPROTR3; /*!< Memory protection register3, Address offset: 0x08 */
__IO uint32_t RAMPROTR4; /*!< Memory protection register4, Address offset: 0x0C */
__IO uint32_t RAMPROTR5; /*!< Memory protection register5, Address offset: 0x10 */
__IO uint32_t RAMPROTR6; /*!< Memory protection register6, Address offset: 0x14 */
__IO uint32_t RAMPROTR7; /*!< Memory protection register7, Address offset: 0x18 */
__IO uint32_t RAMPROTR8; /*!< Memory protection register8, Address offset: 0x1C */
__IO uint32_t DMAPROTR1; /*!< DMA protection register1, Address offset: 0x20 */
__IO uint32_t DMAPROTR2; /*!< DMA protection register2, Address offset: 0x24 */
__IO uint32_t RAMCR; /*!< Memory configuration register, Address offset: 0x28 */
} MEM_TypeDef;
/**
* @brief Option Bytes Registers
*/
typedef struct
{
__IO uint16_t RDP; /*!< FLASH option byte Read protection, Address offset: 0x00 */
__IO uint16_t Rsvd0; /*!< Reserved 0x02 */
__IO uint16_t Rsvd1; /*!< Reserved 0x04 */
__IO uint16_t Rsvd2; /*!< Reserved 0x06 */
__IO uint16_t WRP0; /*!< FLASH option byte write protection 0, Address offset: 0x08 */
__IO uint16_t WRP1; /*!< FLASH option byte write protection 1, Address offset: 0x0A */
__IO uint16_t WRP2; /*!< FLASH option byte write protection 2, Address offset: 0x0C */
__IO uint16_t WRP3; /*!< FLASH option byte write protection 0, Address offset: 0x0E */
} OB_TypeDef;
/**
* @brief GPIO Registers
*/
typedef struct
{
__IO uint32_t CRL; /*!< GPIO port configuration low register, Address offset: 0x00 */
__IO uint32_t CRH; /*!< GPIO port configuration high register, Address offset: 0x04 */
__IO uint32_t IDR; /*!< GPIO port input data register, Address offset: 0x08 */
__IO uint32_t ODR; /*!< GPIO port output data register, Address offset: 0x0C */
__IO uint32_t BSR; /*!< GPIO port bit set registerBSR, Address offset: 0x10 */
__IO uint32_t BRR; /*!< GPIO port bit reset registerBRR, Address offset: 0x14 */
} GPIO_TypeDef;
/**
* @brief GPIO Debug Registers
*/
typedef struct
{
__IO uint32_t DBGCR; /*!< GPIO debug configuration register, Address offset 0x00 */
__IO uint32_t DBGSR; /*!< GPIO debug status register, Address offset 0x04 */
} GPIO_DBG_TypeDef;
/**
* @brief Management interrupt Registers
*/
typedef struct
{
__IO uint32_t ISR; /*!< Management Interrupt status Register, Address offset 0x00 */
uint32_t RESERVED0[15]; /*!< Reserved 0x0004 - 0x003C */
__IO uint32_t IER; /*!< Management Interrupt Enable Register, Address offset 0x40 */
} MGMT_IT_TypeDef;
/**
* @brief EXTI Registers
*/
typedef struct
{
__IO uint32_t PR; /*!< EXTI pending register, Address offset 0x0000 */
uint32_t RESERVED0[18]; /*!< Reserved 0x0004 - 0x004C */
__IO uint32_t TSR[4]; /*!< EXTI trigger source register, Address offset 0x0050 */
uint32_t RESERVED1[1257]; /*!< Reserved 0x0054 - 0x13F4 */
__IO uint32_t CR[2]; /*!< EXTI configuration register, Address offset 0x13F8 */
} EXTI_TypeDef;
/**
* @brief WDG Registers
*/
typedef struct
{
__IO uint32_t CR; /*!< WDG configuration register, Address offset 0x00 */
__IO uint32_t KR; /*!< WDG key register, Address offset 0x04 */
__IO uint32_t KICKSR; /*!< WDG kick-start register, Address offset 0x08 */
} WDG_TypeDef;
/**
* @brief Sleep Timer Registers
*/
typedef struct
{
__IO uint32_t CR; /*!< SLPTMR configuration register, Address offset 0x0000 */
__IO uint32_t CNTH; /*!< SLPTMR counter high register, Address offset 0x0004 */
__IO uint32_t CNTL; /*!< SLPTMR counter high register, Address offset 0x0008 */
__IO uint32_t CMPAH; /*!< SLPTMR compare A high register, Address offset 0x000C */
__IO uint32_t CMPAL; /*!< SLPTMR compare A low register, Address offset 0x0010 */
__IO uint32_t CMPBH; /*!< SLPTMR compare B high register, Address offset 0x0014 */
__IO uint32_t CMPBL; /*!< SLPTMR compare B low register, Address offset 0x0018 */
uint32_t RESERVED0[4091]; /*!< Reserved 0x001C - 0x4008 */
__IO uint32_t ISR; /*!< SLPTMR interrupt status register, Address offset 0x400C */
uint32_t RESERVED1[2]; /*!< Reserved 0x4010 - 0x4018 */
__IO uint32_t IFR; /*!< SLPTMR force interrupts register, Address offset 0x4020 */
uint32_t RESERVED2[12]; /*!< Reserved 0x4024 - 0x4050 */
__IO uint32_t IER; /*!< SLPTMR interrupt enable register, Address offset 0x4054 */
} SLPTMR_TypeDef;
/**
* @brief Analog to Digital Converter (ADC) Registers
*/
typedef struct
{
__IO uint32_t ISR; /*!< ADC Interrupt Status Register, Address offset: 0x0000 */
uint32_t RESERVED0[15]; /*!< Reserved, 0x04 - 0x3C */
__IO uint32_t IER; /*!< ADC Interrupt Enable Register, Address offset: 0x0040 */
uint32_t RESERVED1[2540]; /*!< Reserved, 0x44 - 0x27F0 */
__IO uint32_t CR; /*!< ADC Configuration Register, Address offset: 0x27F4 */
__IO uint32_t OFFSETR; /*!< ADC Offset Register, Address offset: 0x27F8 */
__IO uint32_t GAINR; /*!< ADC Gain Register, Address offset: 0x27FC */
__IO uint32_t DMACR; /*!< ADC DMA Configuration Register, Address offset: 0x2800 */
__IO uint32_t DMASR; /*!< ADC DMA Status Register, Address offset: 0x2804 */
__IO uint32_t DMAMSAR; /*!< ADC DMA Memory Start Address Register, Address offset: 0x2808 */
__IO uint32_t DMANDTR; /*!< ADC DMA Number of Data Register, Address offset: 0x280C */
__IO uint32_t DMAMNAR; /*!< ADC DMA Memory Next Address Register, Address offset: 0x2810 */
__IO uint32_t DMACNDTR; /*!< ADC DMA Channel Number of Data Register, Address offset: 0x2814 */
} ADC_TypeDef;
/**
* @brief Timer Registers
*/
typedef struct
{
__IO uint32_t CR1; /*!< TIM control register 1, Address offset 0x00 */
__IO uint32_t CR2; /*!< TIM control register 2, Address offset 0x04 */
__IO uint32_t SMCR; /*!< TIM slave Mode Control register, Address offset 0x08 */
uint32_t RESERVED0[2]; /*!< Reserved 0x0C - 0x10 */
__IO uint32_t EGR; /*!< TIM event generation register Address offset 0x14 */
__IO uint32_t CCMR1; /*!< TIM capture/compare mode register 1, Address offset 0x18 */
__IO uint32_t CCMR2; /*!< TIM capture/compare mode register 2, Address offset 0x1C */
__IO uint32_t CCER; /*!< TIM capture/compare enable register, Address offset 0x20 */
__IO uint32_t CNT; /*!< TIM counter register, Address offset 0x24 */
__IO uint32_t PSC; /*!< TIM prescaler register, Address offset 0x28 */
__IO uint32_t ARR; /*!< TIM auto-reload register, Address offset 0x2C */
uint32_t RESERVED1; /*!< Reserved 0x30 */
__IO uint32_t CCR1; /*!< TIM capture/compare register 1, Address offset 0x34 */
__IO uint32_t CCR2; /*!< TIM capture/compare register 2, Address offset 0x38 */
__IO uint32_t CCR3; /*!< TIM capture/compare register 3, Address offset 0x3C */
__IO uint32_t CCR4; /*!< TIM capture/compare register 4, Address offset 0x40 */
uint32_t RESERVED2[3]; /*!< Reserved 0x44 - 0x4C */
__IO uint32_t OR; /*!< TIM option register, Address offset 0x50 */
} TIM_TypeDef;
/**
* @brief Serial Controller Registers (Universal Asynchronous Receiver/Transmitter)
*/
typedef struct
{
__IO uint32_t DR; /*!< Serial control Data register Address offset 0x00 */
uint32_t RESERVED0[2]; /*!< Reserved 0x04 */
__IO uint32_t UARTSR; /*!< UART control register Address offset 0x08 */
uint32_t RESERVED1[2]; /*!< Reserved 0x0C - 0x10 */
__IO uint32_t CR; /*!< Serial control control register Address offset 0x14 */
uint32_t RESERVED2[1]; /*!< Reserved 0x18 */
__IO uint32_t UARTCR; /*!< UART control register Address offset 0x1C */
uint32_t RESERVED3[2]; /*!< Reserved 0x20 - 0x24 */
__IO uint32_t UARTBRR1; /*!< UART Baud rate register 1 Address offset 0x28 */
__IO uint32_t UARTBRR2; /*!< UART Baud rate register 2 Address offset 0x2C */
} SC_UART_TypeDef;
/**
* @brief Serial Controller Registers (Serial peripheral interface)
*/
typedef struct
{
__IO uint32_t DR; /*!< Serial control Data register Address offset 0x00 */
__IO uint32_t SPISR; /*!< SPI status register Address offset 0x04 */
uint32_t RESERVED0[4]; /*!< Reserved 0x08 - 0x14 */
__IO uint32_t CR; /*!< Serial control control register Address offset 0x18 */
__IO uint32_t SPICR; /*!< SPI status register Address offset 0x1C */
uint32_t RESERVED1[1]; /*!< Reserved 0x20 */
__IO uint32_t CRR1; /*!< Serial control clock rate register 1 Address offset 0x24 */
__IO uint32_t CRR2; /*!< Serial control clock rate register 2 Address offset 0x28 */
} SC_SPI_TypeDef;
/**
* @brief Serial Controller Registers (Inter-Integrated circuit)
*/
typedef struct
{
__IO uint32_t DR; /*!< Serial control Data register Address offset 0x00 */
uint32_t RESERVED0[1]; /*!< Reserved 0x04 */
__IO uint32_t I2CSR; /*!< I2C status register Address offset 0x08 */
uint32_t RESERVED1[1]; /*!< Reserved 0x0C */
__IO uint32_t I2CCR1; /*!< I2C control register 1 Address offset 0x10 */
__IO uint32_t I2CCR2; /*!< I2C control register 2 Address offset 0x14 */
__IO uint32_t CR; /*!< Serial control control register Address offset 0x18 */
uint32_t RESERVED2[2]; /*!< Reserved 0x1C - 0x20 */
__IO uint32_t CRR1; /*!< Serial control clock rate register 1 Address offset 0x24 */
__IO uint32_t CRR2; /*!< Serial control clock rate register 2 Address offset 0x28 */
} SC_I2C_TypeDef;
/**
* @brief Timer Interrupt Registers
*/
typedef struct
{
__IO uint32_t ISR; /*!< TIM interrupt and status register Address offset 0x00 */
uint32_t RESERVED0[5]; /*!< Reserved 0x04 - 0x14 */
__IO uint32_t IMR; /*!< TIM interrupt missed register Address offset 0x18 */
uint32_t RESERVED1[9]; /*!< Reserved 0x1C - 0x3C */
__IO uint32_t IER; /*!< TIM interrupt enable register Address offset 0x40 */
} TIM_IT_TypeDef;
/**
* @brief Serial Controller interrupt Registers
*/
typedef struct
{
__IO uint32_t ISR; /*!< Interrupt Status register Address offset 0x08 */
uint32_t RESERVED0[15]; /*!< Reserved 0x0C - 0x44 */
__IO uint32_t IER; /*!< Interrupt Enable register Address offset 0x48 */
uint32_t RESERVED1[2]; /*!< Reserved 0x4C - 0x50 */
__IO uint32_t ICR; /*!< Interrupt Control register Address offset 0x54 */
} SC_IT_TypeDef;
/**
* @brief Serial Controller DMA Registers
*/
typedef struct
{
__IO uint32_t DMARXCNTAR; /*!< DMA Rx counter A register Address offset 0x20 */
__IO uint32_t DMARXCNTBR; /*!< DMA Rx counter B register Address offset 0x24 */
__IO uint32_t DMATXCNTR; /*!< DMA Tx counter register Address offset 0x28 */
__IO uint32_t DMASR; /*!< DMA status register Address offset 0x2C */
__IO uint32_t DMACR; /*!< DMA control register Address offset 0x30 */
__IO uint32_t DMARXERRAR; /*!< DMA Rx error A register Address offset 0x34 */
__IO uint32_t DMARXERRBR; /*!< DMA Rx error B register Address offset 0x38 */
uint32_t RESERVED0[13]; /*!< Reserved 0x3C - 0x6C */
__IO uint32_t DMARXCNTSAVEDR; /*!< DMA Rx Counter saved register Address offset 0x70 */
} SC_DMA_TypeDef;
/**
* @brief Serial Controller DMA Channel Registers
*/
typedef struct
{
__IO uint32_t DMABEGADDAR; /*!< DMA begin address A register Address offset 0x00 */
__IO uint32_t DMAENDADDAR; /*!< DMA end address A register Address offset 0x04 */
__IO uint32_t DMABEGADDBR; /*!< DMA begin address B register Address offset 0x08 */
__IO uint32_t DMAENDADDBR; /*!< DMA end address B register Address offset 0x0C */
} SC_DMA_Channel_TypeDef;
/** @addtogroup Peripheral_memory_map
* @{
*/
#define FLASH_BASE ((uint32_t)0x08000000) /*!< FLASH base address in the alias region */
#define SRAM_BASE ((uint32_t)0x20000000) /*!< SRAM base address in the alias region */
#define PERIPH_BASE ((uint32_t)0x40000000) /*!< Peripheral base address in the alias region */
#define SRAM_BB_BASE ((uint32_t)0x22000000) /*!< SRAM base address in the bit-band region */
#define PERIPH_BB_BASE ((uint32_t)0x42000000) /*!< Peripheral base address in the bit-band region */
/*!< Peripheral memory map */
#define PWR_BASE (PERIPH_BASE + 0x0004)
#define CLK_BASE (PERIPH_BASE + 0x0008)
#define RST_BASE (PERIPH_BASE + 0x002C)
#define FLASH_R_BASE (PERIPH_BASE + 0x402C)
#define MEM_R_BASE (PERIPH_BASE + 0x5000)
#define WDG_BASE (PERIPH_BASE + 0x6000)
#define SLPTMR_BASE (PERIPH_BASE + 0x600C)
#define ADC_BASE (PERIPH_BASE + 0xA810)
#define EXTI_BASE (PERIPH_BASE + 0xA814)
#define GPIOA_BASE (PERIPH_BASE + 0xB000)
#define GPIOB_BASE (PERIPH_BASE + 0xB400)
#define GPIOC_BASE (PERIPH_BASE + 0xB800)
#define GPIO_DBG_BASE (PERIPH_BASE + 0xBC00)
#define SC1_UART_BASE (PERIPH_BASE + 0xC83C)
#define SC1_SPI_BASE (PERIPH_BASE + 0xC83C)
#define SC1_I2C_BASE (PERIPH_BASE + 0xC83C)
#define SC2_UART_BASE (PERIPH_BASE + 0xC03C)
#define SC2_SPI_BASE (PERIPH_BASE + 0xC03C)
#define SC2_I2C_BASE (PERIPH_BASE + 0xC03C)
#define TIM1_BASE (PERIPH_BASE + 0xE000)
#define TIM2_BASE (PERIPH_BASE + 0xF000)
#define OB_BASE ((uint32_t)0x08040800) /*!< Flash Option Bytes base address */
#define MGMT_IT_BASE (PERIPH_BASE + 0xA018)
#define TIM1_IT_BASE (PERIPH_BASE + 0xA800)
#define TIM2_IT_BASE (PERIPH_BASE + 0xA804)
#define SC1_IT_BASE (PERIPH_BASE + 0xA808)
#define SC2_IT_BASE (PERIPH_BASE + 0xA80C)
#define SC2_DMA_ChannelRx_BASE (PERIPH_BASE + 0xC000)
#define SC2_DMA_ChannelTx_BASE (PERIPH_BASE + 0xC010)
#define SC2_DMA_BASE (PERIPH_BASE + 0xC020)
#define SC1_DMA_ChannelRx_BASE (PERIPH_BASE + 0xC800)
#define SC1_DMA_ChannelTx_BASE (PERIPH_BASE + 0xC810)
#define SC1_DMA_BASE (PERIPH_BASE + 0xC820)
/** @addtogroup Peripheral_declaration
* @{
*/
#define PWR ((PWR_TypeDef *) PWR_BASE)
#define CLK ((CLK_TypeDef *) CLK_BASE)
#define RST ((RST_TypeDef *) RST_BASE)
#define FLASH ((FLASH_TypeDef *) FLASH_R_BASE)
#define MEM ((MEM_TypeDef *) MEM_R_BASE)
#define WDG ((WDG_TypeDef *) WDG_BASE)
#define SLPTMR ((SLPTMR_TypeDef *) SLPTMR_BASE)
#define EXTI ((EXTI_TypeDef *) EXTI_BASE)
#define GPIOA ((GPIO_TypeDef *) GPIOA_BASE)
#define GPIOB ((GPIO_TypeDef *) GPIOB_BASE)
#define GPIOC ((GPIO_TypeDef *) GPIOC_BASE)
#define GPIO_DBG ((GPIO_DBG_TypeDef *) GPIO_DBG_BASE)
#define SC1_UART ((SC_UART_TypeDef *) SC1_UART_BASE)
#define SC1_SPI ((SC_SPI_TypeDef *) SC1_SPI_BASE)
#define SC1_I2C ((SC_I2C_TypeDef *) SC1_I2C_BASE)
#define SC2_UART ((SC_UART_TypeDef *) SC2_UART_BASE)
#define SC2_SPI ((SC_SPI_TypeDef *) SC2_SPI_BASE)
#define SC2_I2C ((SC_I2C_TypeDef *) SC2_I2C_BASE)
#define ADC ((ADC_TypeDef *) ADC_BASE)
#define TIM1 ((TIM_TypeDef *) TIM1_BASE)
#define TIM2 ((TIM_TypeDef *) TIM2_BASE)
#define OB ((OB_TypeDef *) OB_BASE)
#define MGMT_IT ((MGMT_IT_TypeDef *) MGMT_IT_BASE)
#define TIM1_IT ((TIM_IT_TypeDef *) TIM1_IT_BASE)
#define TIM2_IT ((TIM_IT_TypeDef *) TIM2_IT_BASE)
#define SC1_IT ((SC_IT_TypeDef *) SC1_IT_BASE)
#define SC2_IT ((SC_IT_TypeDef *) SC2_IT_BASE)
#define SC2_DMA_ChannelRx ((SC_DMA_Channel_TypeDef *) SC2_DMA_ChannelRx_BASE)
#define SC2_DMA_ChannelTx ((SC_DMA_Channel_TypeDef *) SC2_DMA_ChannelTx_BASE)
#define SC2_DMA ((SC_DMA_TypeDef *) SC2_DMA_BASE)
#define SC1_DMA_ChannelRx ((SC_DMA_Channel_TypeDef *) SC1_DMA_ChannelRx_BASE)
#define SC1_DMA_ChannelTx ((SC_DMA_Channel_TypeDef *) SC1_DMA_ChannelTx_BASE)
#define SC1_DMA ((SC_DMA_TypeDef *) SC1_DMA_BASE)
/**
* @}
*/
/** @defgroup PPP_Exported_Constants
* @{
*/
/** @defgroup Peripheral_Registers_Bits_Definition
* @{
*/
/******************************************************************************/
/* */
/* Clock Control (CLK) */
/* */
/******************************************************************************/
/******************** Bit definition for CLK_SLEEPCR register ***************/
#define CLK_SLEEPCR_LSEEN ((uint32_t)0x00000001) /*!< Enables 32kHz external XTAL */
#define CLK_SLEEPCR_LSI10KEN ((uint32_t)0x00000002) /*!< Enables 10kHz internal RC during deep */
/******************** Bit definition for CLK_LSI10KCR register **************/
#define CLK_LSI10KCR_TUNE ((uint32_t)0x0000000F) /*!< Tune value for clkrc */
/******************** Bit definition for CLK_LSI1KCR register ***************/
#define CLK_LSI1KCR_CALFRAC ((uint32_t)0x000007FF) /*!< Divider value fractional portion */
#define CLK_LSI1KCR_CALINT ((uint32_t)0x0000F800) /*!< Divider value integer portion */
/******************** Bit definition for CLK_HSECR1 register ****************/
#define CLK_HSECR1_BIASTRIM ((uint32_t)0x0000000F) /*!< Bias trim setting for 24MHz oscillator */
/******************** Bit definition for CLK_HSICR register *****************/
#define CLK_HSICR_TUNE ((uint32_t)0x0000001F) /*!< Frequency trim setting for HF RC oscillator */
/******************** Bit definition for CLK_PERIODCR register **************/
#define CLK_PERIODCR_MODE ((uint32_t)0x00000003) /*!< Sets clock to be measured by CLK_PERIOD */
/******************** Bit definition for CLK_PERIODSR register **************/
#define CLK_PERIODSR_PERIOD ((uint32_t)0x0000FFFF) /*!< Clock period measurement */
/******************** Bit definition for CLK_DITHERCR register **************/
#define CLK_DITHERCR_DIS ((uint32_t)0x00000001) /*!< Dither disable */
/******************** Bit definition for CLK_HSECR2 register ****************/
#define CLK_HSECR2_SW1 ((uint32_t)0x00000001) /*!< 0/1: OSCHF/XTAL is selected */
#define CLK_HSECR2_EN ((uint32_t)0x00000002) /*!< 1: 24 MHz crystal oscillator is main clock */
/******************** Bit definition for CLK_CPUCR register *****************/
#define CLK_CPUCR_SW2 ((uint32_t)0x00000001) /*!< 0/1: 12MHz/24MHz is selected */
/******************** Bit definition for CLK_PCTRACECR register *************/
#define CLK_PCTRACECR_SEL ((uint32_t)0x00000001) /*!< selects PC_TRACE source on bb_debug GPIO pins */
/******************************************************************************/
/* */
/* Reset Event source (RST) */
/* */
/******************************************************************************/
/******************** Bit definition for RST_SR register ********************/
#define RST_SR_PWRHV ((uint32_t)0x00000001) /*!< Normal power applied */
#define RST_SR_PWRLV ((uint32_t)0x00000002) /*!< The application of a Core power supply */
#define RST_SR_PIN ((uint32_t)0x00000004) /*!< External reset pin signal */
#define RST_SR_WDG ((uint32_t)0x00000008) /*!< Watchdog expiration */
#define RST_SR_SWRST ((uint32_t)0x00000010) /*!< Software reset */
#define RST_SR_WKUP ((uint32_t)0x00000020) /*!< Wake-up from Deep Sleep */
#define RST_SR_OBFAIL ((uint32_t)0x00000040) /*!< Option byte load failure */
#define RST_SR_LKUP ((uint32_t)0x00000080) /*!< Core lockup */
/******************************************************************************/
/* */
/* PWR */
/* */
/******************************************************************************/
/******************* Bit definition for PWR_DSLEEPCR1 register **************/
#define PWR_DSLEEPCR1_LVFREEZE ((uint32_t)0x00000002) /*!< Freeze state LV output states */
/******************* Bit definition for PWR_DSLEEPCR2 register **************/
#define PWR_DSLEEPCR2_MODE ((uint32_t)0x00000001) /*!< Selects deep sleep mode 0 when the debugger is attached */
/******************* Bit definition for PWR_VREGCR register *****************/
#define PWR_VREGCR_VREFEN ((uint32_t)0x00008000) /*!< VREF on/off */
#define PWR_VREGCR_1V8EN ((uint32_t)0x00000800) /*!< 1V8 direct controle of regulator on/off */
#define PWR_VREGCR_1V8TRIM ((uint32_t)0x00000380) /*!< 1V2 regulator trim value */
#define PWR_VREGCR_1V2EN ((uint32_t)0x00000010) /*!< 1V2 direct controle of regulator on/off */
#define PWR_VREGCR_1V2TRIM ((uint32_t)0x00000007) /*!< 1V2 regulator trim value */
/******************* Bit definition for PWR_WAKECR1 register ****************/
#define PWR_WAKECR1_CSYSPWRRUPREQ ((uint32_t)0x00000200) /*!< Wake up method on CSYSPWRUPREQ event */
#define PWR_WAKECR1_CPWRRUPREQ ((uint32_t)0x00000100) /*!< Wake up method on CPWRRUPREQ event */
#define PWR_WAKECR1_CORE ((uint32_t)0x00000080) /*!< Wake up method on COREWAKE bit */
#define PWR_WAKECR1_WRAP ((uint32_t)0x00000040) /*!< Wake up method on sleep timer compare wrap/overflow event */
#define PWR_WAKECR1_COMPB ((uint32_t)0x00000020) /*!< Wake up method on sleep timer compare B event */
#define PWR_WAKECR1_COMPA ((uint32_t)0x00000010) /*!< Wake up method on sleep timer compare A event */
#define PWR_WAKECR1_IRQD ((uint32_t)0x00000008) /*!< Wake up method on falling/rising edge of pin PC0*/
#define PWR_WAKECR1_SC2 ((uint32_t)0x00000004) /*!< Wake up method on falling/rising edge of pin PA2 for SC2 */
#define PWR_WAKECR1_SC1 ((uint32_t)0x00000002) /*!< Wake up method on falling/rising edge of pin PB2 for SC1*/
#define PWR_WAKECR1_MONEN ((uint32_t)0x00000001) /*!< Enable the GPIO monitoring to wake from deep sleep */
/******************* Bit definition for PWR_WAKECR2 register ****************/
#define PWR_WAKECR2_COREWAKE ((uint32_t)0x00000020) /*!< Power up controlled by debug port activity */
/******************* Bit definition for PWR_WAKESR register ******************/
#define PWR_WAKESR_CSYSPWRRUPREQ ((uint32_t)0x00000200) /*!< Wake up done using the DAP access to SYS registers */
#define PWR_WAKESR_CPWRRUPREQ ((uint32_t)0x00000100) /*!< Wake up done using the DAP access to DBG registers */
#define PWR_WAKESR_CORE ((uint32_t)0x00000080) /*!< Wake up done using debug port activity */
#define PWR_WAKESR_WRAP ((uint32_t)0x00000040) /*!< Wake up done using sleep timer wrap */
#define PWR_WAKESR_COMPB ((uint32_t)0x00000020) /*!< Wake up done using sleep timer compare B */
#define PWR_WAKESR_COMPA ((uint32_t)0x00000010) /*!< Wake up done using sleep timer compare A */
#define PWR_WAKESR_IRQD ((uint32_t)0x00000008) /*!< Wake up done using external interrupt IRQD */
#define PWR_WAKESR_SC2 ((uint32_t)0x00000004) /*!< Wake up done using serial controller 2 (PA2) */
#define PWR_WAKESR_SC1 ((uint32_t)0x00000002) /*!< Wake up done using serial controller 1 (PB2) */
#define PWR_WAKESR_MON ((uint32_t)0x00000001) /*!< Wake up done using GPIO monitoring */
/******************* Bit definition for PWR_CPWRUPREQSR register ************/
#define PWR_CPWRUPREQSR_REQ ((uint32_t)0x00000001) /*!< Current value of CPWRUPREQ */
/******************* Bit definition for PWR_CSYSPWRUPREQSR register *********/
#define PWR_CSYSPWRUPREQSR_REQ ((uint32_t)0x00000001) /*!< Current value of CSYSPWRUPREQ */
/******************* Bit definition for PWR_CSYSPWRUPACKSR register *********/
#define PWR_CSYSPWRUPACKSR_ACK ((uint32_t)0x00000001) /*!< Current value of CSYSPWRUPACK */
/******************* Bit definition for PWR_CSYSPWRUPACKCR register *********/
#define PWR_CSYSPWRUPACKCR_INHIBIT ((uint32_t)0x00000001) /*!< Inhibit CSYSPWRUPACK */
/******************* Bit definition for PWR_WAKEPxR register ****************/
#define PWR_WAKEPxR_Px0 ((uint32_t)0x00000001)
#define PWR_WAKEPxR_Px1 ((uint32_t)0x00000002)
#define PWR_WAKEPxR_Px2 ((uint32_t)0x00000004)
#define PWR_WAKEPxR_Px3 ((uint32_t)0x00000008)
#define PWR_WAKEPxR_Px4 ((uint32_t)0x00000010)
#define PWR_WAKEPxR_Px5 ((uint32_t)0x00000020)
#define PWR_WAKEPxR_Px6 ((uint32_t)0x00000040)
#define PWR_WAKEPxR_Px7 ((uint32_t)0x00000080)
/******************* Bit definition for PWR_WAKEFILTR register **************/
#define PWR_WAKEFILTR_GPIO ((uint32_t)0x00000001) /*!< Enable filter on GPIO wakeup sources enabled by the PWR_WAKEPxR registers */
#define PWR_WAKEFILTR_SC1 ((uint32_t)0x00000002) /*!< Enable filter on GPIO wakeup source SC1 (PB2) */
#define PWR_WAKEFILTR_SC2 ((uint32_t)0x00000004) /*!< Enable filter on GPIO wakeup source SC2 (PA2) */
#define PWR_WAKEFILTR_IRQD ((uint32_t)0x00000008) /*!< Enable filter on GPIO wakeup source EXTI D */
/******************************************************************************/
/* */
/* General Purpose IOs (GPIO) */
/* */
/******************************************************************************/
/******************* Bit definition for GPIO_CRL register *******************/
#define GPIO_CRL_CNFMODE0 ((uint32_t)0x0000000F) /*!< CNFMODE0[3:0] bits (GPIO Configuration and Mode Control) */
#define GPIO_CRL_CNFMODE0_0 ((uint32_t)0x00000001)
#define GPIO_CRL_CNFMODE0_1 ((uint32_t)0x00000002)
#define GPIO_CRL_CNFMODE0_2 ((uint32_t)0x00000004)
#define GPIO_CRL_CNFMODE0_3 ((uint32_t)0x00000008)
#define GPIO_CRL_CNFMODE1 ((uint32_t)0x000000F0) /*!< CNFMODE1[3:0] bits (GPIO Configuration and Mode Control) */
#define GPIO_CRL_CNFMODE1_0 ((uint32_t)0x00000010)
#define GPIO_CRL_CNFMODE1_1 ((uint32_t)0x00000020)
#define GPIO_CRL_CNFMODE1_2 ((uint32_t)0x00000040)
#define GPIO_CRL_CNFMODE1_3 ((uint32_t)0x00000080)
#define GPIO_CRL_CNFMODE2 ((uint32_t)0x00000F00) /*!< CNFMODE2[3:0] bits (GPIO Configuration and Mode Control) */
#define GPIO_CRL_CNFMODE2_0 ((uint32_t)0x00000100)
#define GPIO_CRL_CNFMODE2_1 ((uint32_t)0x00000200)
#define GPIO_CRL_CNFMODE2_2 ((uint32_t)0x00000400)
#define GPIO_CRL_CNFMODE2_3 ((uint32_t)0x00000800)
#define GPIO_CRL_CNFMODE3 ((uint32_t)0x0000F000) /*!< CNFMODE3[3:0] bits (GPIO Configuration and Mode Control) */
#define GPIO_CRL_CNFMODE3_0 ((uint32_t)0x00001000)
#define GPIO_CRL_CNFMODE3_1 ((uint32_t)0x00002000)
#define GPIO_CRL_CNFMODE3_2 ((uint32_t)0x00004000)
#define GPIO_CRL_CNFMODE3_3 ((uint32_t)0x00008000)
/******************* Bit definition for GPIO_CRH register *******************/
#define GPIO_CRH_CNFMODE4 ((uint32_t)0x0000000F) /*!< CNFMODE4[3:0] bits (GPIO Configuration and Mode Control) */
#define GPIO_CRH_CNFMODE4_0 ((uint32_t)0x00000001)
#define GPIO_CRH_CNFMODE4_1 ((uint32_t)0x00000002)
#define GPIO_CRH_CNFMODE4_2 ((uint32_t)0x00000004)
#define GPIO_CRH_CNFMODE4_3 ((uint32_t)0x00000008)
#define GPIO_CRH_CNFMODE5 ((uint32_t)0x000000F0) /*!< CNFMODE5[3:0] bits (GPIO Configuration and Mode Control) */
#define GPIO_CRH_CNFMODE5_0 ((uint32_t)0x00000010)
#define GPIO_CRH_CNFMODE5_1 ((uint32_t)0x00000020)
#define GPIO_CRH_CNFMODE5_2 ((uint32_t)0x00000040)
#define GPIO_CRH_CNFMODE5_3 ((uint32_t)0x00000080)
#define GPIO_CRH_CNFMODE6 ((uint32_t)0x00000F00) /*!< CNFMODE6[3:0] bits (GPIO Configuration and Mode Control) */
#define GPIO_CRH_CNFMODE6_0 ((uint32_t)0x00000100)
#define GPIO_CRH_CNFMODE6_1 ((uint32_t)0x00000200)
#define GPIO_CRH_CNFMODE6_2 ((uint32_t)0x00000400)
#define GPIO_CRH_CNFMODE6_3 ((uint32_t)0x00000800)
#define GPIO_CRH_CNFMODE7 ((uint32_t)0x0000F000) /*!< CNFMODE7[3:0] bits (GPIO Configuration and Mode Control) */
#define GPIO_CRH_CNFMODE7_0 ((uint32_t)0x00001000)
#define GPIO_CRH_CNFMODE7_1 ((uint32_t)0x00002000)
#define GPIO_CRH_CNFMODE7_2 ((uint32_t)0x00004000)
#define GPIO_CRH_CNFMODE7_3 ((uint32_t)0x00008000)
/******************* Bit definition for GPIO_IDR register ****************/
#define GPIO_IDR_IDR0 ((uint32_t)0x00000001)
#define GPIO_IDR_IDR1 ((uint32_t)0x00000002)
#define GPIO_IDR_IDR2 ((uint32_t)0x00000004)
#define GPIO_IDR_IDR3 ((uint32_t)0x00000008)
#define GPIO_IDR_IDR4 ((uint32_t)0x00000010)
#define GPIO_IDR_IDR5 ((uint32_t)0x00000020)
#define GPIO_IDR_IDR6 ((uint32_t)0x00000040)
#define GPIO_IDR_IDR7 ((uint32_t)0x00000080)
/******************* Bit definition for GPIO_ODR register ****************/
#define GPIO_ODR_ODR0 ((uint32_t)0x00000001)
#define GPIO_ODR_ODR1 ((uint32_t)0x00000002)
#define GPIO_ODR_ODR2 ((uint32_t)0x00000004)
#define GPIO_ODR_ODR3 ((uint32_t)0x00000008)
#define GPIO_ODR_ODR4 ((uint32_t)0x00000010)
#define GPIO_ODR_ODR5 ((uint32_t)0x00000020)
#define GPIO_ODR_ODR6 ((uint32_t)0x00000040)
#define GPIO_ODR_ODR7 ((uint32_t)0x00000080)
/******************* Bit definition for GPIO_BRR register ****************/
#define GPIO_BRR_BR0 ((uint32_t)0x00000001)
#define GPIO_BRR_BR1 ((uint32_t)0x00000002)
#define GPIO_BRR_BR2 ((uint32_t)0x00000004)
#define GPIO_BRR_BR3 ((uint32_t)0x00000008)
#define GPIO_BRR_BR4 ((uint32_t)0x00000010)
#define GPIO_BRR_BR5 ((uint32_t)0x00000020)
#define GPIO_BRR_BR6 ((uint32_t)0x00000040)
#define GPIO_BRR_BR7 ((uint32_t)0x00000080)
/******************* Bit definition for GPIO_BSR register ****************/
#define GPIO_BSR_BS0 ((uint32_t)0x00000001)
#define GPIO_BSR_BS1 ((uint32_t)0x00000002)
#define GPIO_BSR_BS2 ((uint32_t)0x00000004)
#define GPIO_BSR_BS3 ((uint32_t)0x00000008)
#define GPIO_BSR_BS4 ((uint32_t)0x00000010)
#define GPIO_BSR_BS5 ((uint32_t)0x00000020)
#define GPIO_BSR_BS6 ((uint32_t)0x00000040)
#define GPIO_BSR_BS7 ((uint32_t)0x00000080)
/******************* Bit definition for GPIO_DBGCR register ****************/
#define GPIO_DBGCR_EXTREGEN ((uint32_t)0x00000010) /*!< Disable REG_EN override of PA7's normal GPIO configuration */
#define GPIO_DBGCR_DBGDIS ((uint32_t)0x00000020) /*!< Disable debug interface override of normal GPIO configuration */
/******************* Bit definition for GPIO_DBGSR register ****************/
#define GPIO_DBGSR_SWEN ((uint32_t)0x00000001) /*!< Status of Serial Wire interface */
#define GPIO_DBGSR_FORCEDBG ((uint32_t)0x00000002) /*!< Status of debugger interface */
#define GPIO_DBGSR_BOOTMODE ((uint32_t)0x00000008) /*!< Status of the nBOOTMODE signal sampled at the end of reset */
/******************************************************************************/
/* */
/* EXTI */
/* */
/******************************************************************************/
/******************* Bit definition for EXTI_CR register ********************/
#define EXTI_CR_GPIO_SEL ((uint32_t)0x0000001F) /*!< GPIO_SEL[4:0]bits (GPIO EXTIx Selection) */
#define EXTI_CR_GPIO_SEL_0 ((uint32_t)0x00000001) /*!< bit0 */
#define EXTI_CR_GPIO_SEL_1 ((uint32_t)0x00000002) /*!< bit1 */
#define EXTI_CR_GPIO_SEL_2 ((uint32_t)0x00000004) /*!< bit2 */
#define EXTI_CR_GPIO_SEL_3 ((uint32_t)0x00000008) /*!< bit3 */
#define EXTI_CR_GPIO_SEL_4 ((uint32_t)0x00000010) /*!< bit4 */
/******************* Bit definition for EXTI_TSR register ****************/
#define EXTI_TSR_INTMOD ((uint32_t)0x000000E0) /*!< INTMOD[7:5]bits (EXTIx triggering mode) */
#define EXTI_TSR_INTMOD_0 ((uint32_t)0x00000020) /*!< bit5 */
#define EXTI_TSR_INTMOD_1 ((uint32_t)0x00000040) /*!< bit6 */
#define EXTI_TSR_INTMOD_2 ((uint32_t)0x00000080) /*!< bit7 */
#define EXTI_TSR_FILTEN ((uint32_t)0x00000100) /*!< Set this bit to enable digital filtering on EXTIx */
/******************* Bit definition for EXTI_PR register ****************/
#define EXTI_PR_IRQAP ((uint32_t)0x00000001) /*!< EXTIA interrupt pending */
#define EXTI_PR_IRQBP ((uint32_t)0x00000002) /*!< EXTIB interrupt pending */
#define EXTI_PR_IRQCP ((uint32_t)0x00000004) /*!< EXTIC interrupt pending */
#define EXTI_PR_IRQDP ((uint32_t)0x00000008) /*!< EXTID interrupt pending */
/******************************************************************************/
/* */
/* WDG */
/* */
/******************************************************************************/
/******************* Bit definition for WDG_CR register *********************/
#define WDG_CR_WDGEN ((uint32_t)0x00000001) /*!< WDG enable */
#define WDG_CR_WDGDIS ((uint32_t)0x00000002) /*!< WDG disable */
/******************* Bit definition for WDG_KR register *********************/
#define WDG_KR_KEY ((uint32_t)0x0000FFFF) /*!< WDG key value */
/******************* Bit definition for WDG_KICKSR register *****************/
#define WDG_KICKSR_KS ((uint32_t)0x0000FFFF) /*!< WDG kick start value */
/******************************************************************************/
/* */
/* Sleep Timer */
/* */
/******************************************************************************/
/******************* Bit definition for SLPTMR_CR register ******************/
#define SLPTMR_CR_CLKSEL ((uint32_t)0x00000001) /*!< clock select */
#define SLPTMR_CR_PSC ((uint32_t)0x000000F0) /*!< Sleep timer prescaler setting */
#define SLPTMR_CR_DBGP ((uint32_t)0x00000400) /*!< Debug Pause */
#define SLPTMR_CR_EN ((uint32_t)0x00000800) /*!< Enable/Disable Sleep Timer */
#define SLPTMR_CR_REVERSE ((uint32_t)0x00001000) /*!< count forward or backword */
/******************* Bit definition for SLPTMR_CNTH register *****************/
#define SLPTMR_CNTH_CNTH ((uint32_t)0x0000FFFF) /*!< Sleep timer count high register */
/******************* Bit definition for SLPTMR_CNTL register *****************/
#define SLPTMR_CNTL_CNTL ((uint32_t)0x0000FFFF) /*!< Sleep timer count low register */
/******************* Bit definition for SLPTMR_CMPAH register ****************/
#define SLPTMR_CMPAH_CMPAH ((uint32_t)0x0000FFFF) /*!< Sleep timer compare A high register */
/******************* Bit definition for SLPTMR_CMPAL register ****************/
#define SLPTMR_CMPAL_CMPAL ((uint32_t)0x0000FFFF) /*!< Sleep timer compare A low register */
/******************* Bit definition for SLPTMR_CMPBH register ****************/
#define SLPTMR_CMPBH_CMPBH ((uint32_t)0x0000FFFF) /*!< Sleep timer compare B high register */
/******************* Bit definition for SLPTMR_CMPBL register ****************/
#define SLPTMR_CMPBL_CMPBL ((uint32_t)0x0000FFFF) /*!< Sleep timer compare B low register */
/******************* Bit definition for SLPTMR_ISR register ******************/
#define SLPTMR_ISR_WRAP ((uint32_t)0x00000001) /*!