分享一个
#ifndef RCC_HPP_
#define RCC_HPP_
#include "STM32F103.h"
namespace MCU
{
namespace STM32F103
{
struct RegisterRCC
{
volatile union
{
volatile uint32_t Value;
volatile struct
{
volatile uint32_t HSION : 1;
volatile const uint32_t HSIRDY : 1;
volatile uint32_t RESERVED1 : 1;
volatile uint32_t HSITRIM : 5;
volatile const uint32_t HSICAL : 8;
volatile uint32_t HSEON : 1;
volatile const uint32_t HSERDY : 1;
volatile uint32_t HSEBYP : 1;
volatile uint32_t CSSON : 1;
volatile uint32_t RESERVDE2 : 4;
volatile uint32_t PLLON : 1;
volatile const uint32_t PLLRDY : 1;
volatile uint32_t RESERVDE3 : 6;
}Bit;
}CR;
volatile union
{
volatile uint32_t Value;
volatile struct
{
volatile uint32_t SW : 2;
volatile const uint32_t SWS : 2;
volatile uint32_t HPRE : 4;
volatile uint32_t PPRE1 : 3;
volatile uint32_t PPRE2 : 3;
volatile uint32_t ADCPRE : 2;
volatile uint32_t PLLSRC : 1;
volatile uint32_t PLLXTPRE : 1;
volatile uint32_t PLLMUL : 4;
volatile uint32_t USBPRE : 1;
volatile uint32_t RESERVED1 : 1;
volatile uint32_t MCO : 3;
volatile uint32_t RESERVED2 : 5;
}Bit;
}CFGR;
volatile union
{
volatile uint32_t Value;
volatile struct
{
volatile const uint32_t LSIRDYF : 1;
volatile const uint32_t LSERDYF : 1;
volatile const uint32_t HSIRDYF : 1;
volatile const uint32_t HSERDYF : 1;
volatile const uint32_t PLLRDYF : 1;
volatile const uint32_t PLL2RDYF : 1;
volatile const uint32_t PLL3RDYF : 1;
volatile const uint32_t CSSF : 1;
volatile uint32_t LSIRDYIE : 1;
volatile uint32_t LSERDYIE : 1;
volatile uint32_t HSIRDYIE : 1;
volatile uint32_t HSERDYIE : 1;
volatile uint32_t PLLRDYIE : 1;
volatile const uint32_t PLL2RDYE : 1;
volatile const uint32_t PLL3RDYE : 1;
volatile uint32_t RESERVED1 : 1;
volatile uint32_t LSIRDYC : 1;
volatile uint32_t LSERDYC : 1;
volatile uint32_t HISRDYC : 1;
volatile uint32_t HSERDYC : 1;
volatile uint32_t PLLRDYC : 1;
volatile uint32_t PLL2RDYC : 1;
volatile uint32_t PLL3RDYC : 1;
volatile uint32_t CSSC : 1;
volatile uint32_t RESERVED2 : 8;
}Bit;
}CIR;
volatile union
{
volatile uint32_t Value;
volatile struct
{
volatile uint16_t AFIORST : 1;
volatile uint16_t RESERVED1 : 1;
volatile uint16_t IOPARST : 1;
volatile uint16_t IOPBRST : 1;
volatile uint16_t IOPCRST : 1;
volatile uint16_t IOPDRST : 1;
volatile uint16_t IOPERST : 1;
volatile uint16_t IOPFRST : 1;
volatile uint16_t IOPGRST : 1;
volatile uint16_t ADC1RST : 1;
volatile uint16_t AD