📄 stm32f103-s.h
字号:
unsigned PLLRDYIE :1; // 12 PLLRDYIE:PLL就绪中断使能
unsigned Reserved2 :3; // 15:13
unsigned LSIRDYC :1; // 16 LSIRDYC:LSI就绪中断清除
unsigned LSERDYC :1; // 17 LSERDYC:LSE就绪中断清除
unsigned HSIRDYC :1; // 18 HSIRDYC HSI就绪中断清除
unsigned HSERDYC :1; // 19 HSERDYC:HSE就绪中断清除
unsigned PLLRDYC :1; // 20 PLLRDYC:PLL就绪中断清除 1: PLL就绪中断标志位PLLRDYF清零
unsigned Reserved1 :2; // 22:21
unsigned CSSC :1; // 23 CSSC:时钟安全系统中断清除 1: CSSF安全系统中断标志位清零
unsigned Reserved0 :8; // 31:24
};
union RCC_CIR_REG {
Uint32 all;
struct RCC_CIR_BITS bit;
};
// CSSC:时钟安全系统中断清除
// 由软件置1来清除CSSF安全系统中断标志位CSSF。在清除操作完成后,该位由硬件复位
#define RCC_CSSCF ((u32)0x1<<23)
// PLLRDYC:PLL就绪中断清除
#define RCC_PLLRDYFC ((u32)0x1<<20)
// HSERDYC:HSE就绪中断清除 1: HSE就绪中断标志位HSERDYF清零
#define RCC_HSERDYC ((u32)0x1<<19)
// HSIRDYC HSI就绪中断清除
#define RCC_HSIRDYC ((u32)0x1<<18)
// LSERDYC:LSE就绪中断清除
#define RCC_LSERDYC ((u32)0x1<<17)
// LSIRDYC:LSI就绪中断清除
#define RCC_LSIRDYC ((u32)0x1<<16)
// PLLRDYIE:PLL就绪中断使能
#define RCC_PLLRDYIE ((u32)0x1<<12)
// HSERDYIE:HSE就绪中断使能 1:HSE就绪中断使能
#define RCC_HSERDYIE ((u32)0x1<<11)
// HSIRDYIE:HSI就绪中断使能
#define RCC_HSIRDYIE ((u32)0x1<<10)
// LSERDYIE:LSE就绪中断使能
#define RCC_LSERDYIE ((u32)0x1<<9)
// LSIRDYIE:LSI就绪中断使能
#define RCC_LSIRDYIE ((u32)0x1<<8)
// CSSF:时钟安全系统中断标志 1:产生HSE时钟失效安全系统中断
#define RCC_CSSF ((u32)0x1<<7)
// PLLRDYF:PLL就绪中断标志
#define RCC_PLLRDYF ((u32)0x1<<4)
// HSERDYF:HSE就绪中断标志
#define RCC_HSERDYF ((u32)0x1<<3)
// HSIRDYF:HSI就绪中断标志 1:产生内部8MHz RC振荡器就绪中断
#define RCC_HSIRDYF ((u32)0x1<<2)
// LSERDYF:LSE就绪中断标志 1:产生外部32kHz振荡器就绪中断
#define RCC_LSERDYF ((u32)0x1<<1)
// LSIRDYF:LSI就绪中断标志
#define RCC_LSIRDYF ((u32)0x1<<0)
//--------------------------------------------------------------------
// APB2 外设复位寄存器 (RCC_APB2RSTR)
//--------------------------------------------------------------------
struct RCC_APB2RSTR_BITS {
unsigned AFIORST :1; // 0 AFIORST:辅助功能IO复位
unsigned Reserved3 :1; // 1
unsigned IOPARST :1; // 2 IOPARST:IO口A复位
unsigned IOPBRST :1; // 3 IOPBRST:IO口B复位
unsigned IOPCRST :1; // 4 IOPCRST:IO口C复位
unsigned IOPDRST :1; // 5 IOPDRST:IO口D复位
unsigned IOPERST :1; // 6 IOPERST:IO口E复位
unsigned Reserved2 :2; // 8:7
unsigned ADC1RST :1; // 9 ADC1RST:ADC1复位
unsigned ADC2RST :1; // 10 ADC2RST:ADC2复位
unsigned TIM1RST :1; // 11 TIM1RST:TIM1复位
unsigned SPI1RST :1; // 12 SPI1RST:SPI1复位
unsigned Reserved1 :1; // 13
unsigned USART1RST :1; // 14 USART1RST:USART1复位
unsigned Reserved0 :17; // 31:15
};
union RCC_APB2RSTR_REG {
Uint32 all;
struct RCC_APB2RSTR_BITS bit;
};
// USART1RST:USART1复位 0:无效 1:复位USART1
#define RCC_USART1RST ((u32)0x1<<14)
// SPI1RST:SPI1复位
#define RCC_SPI1RST ((u32)0x1<<12)
// TIM1RST:TIM1复位
#define RCC_TIM1RST ((u32)0x1<<11)
// ADC2RST:ADC2复位
#define RCC_ADC2RST ((u32)0x1<<10)
// ADC1RST:ADC1复位
#define RCC_ADC1RST ((u32)0x1<<9)
// IOPERST:IO口E复位
#define RCC_IOPERST ((u32)0x1<<6)
// IOPDRST:IO口D复位
#define RCC_IOPDRST ((u32)0x1<<5)
// IOPCRST:IO口C复位
#define RCC_IOPCRST ((u32)0x1<<4)
// IOPBRST:IO口B复位
#define RCC_IOPBRST ((u32)0x1<<3)
// IOPARST:IO口A复位
#define RCC_IOPARST ((u32)0x1<<2)
// AFIORST:辅助功能IO复位
#define RCC_AFIORST ((u32)0x1<<0)
//--------------------------------------------------------------------
//APB1 外设复位寄存器 (RCC_APB1RSTR)
//--------------------------------------------------------------------
struct RCC_APB1RSTR_BITS {
unsigned TIM2RST :1; // 0 TIM2RST:定时器2复位
unsigned TIM3RST :1; // 1
unsigned TIM4RST :1; // 2
unsigned Reserved6 :8; // 10:3
unsigned WWDGRST :1; // 11 WWDGRST:窗口看门狗复位
unsigned Reserved5 :2; // 13:12
unsigned SPI2RST :1; // 14
unsigned Reserved4 :2; // 16:15
unsigned USART2RST :1; // 17
unsigned USART3RST :1; // 18
unsigned Reserved3 :2; // 20:19
unsigned I2C1RST :1; // 21
unsigned I2C2RST :1; // 22
unsigned USBRST :1; // 23
unsigned Reserved2 :1; // 24
unsigned CANRST :1; // 25 CANRST:CAN复位
unsigned Reserved1 :1; // 26
unsigned BKPRST :1; // 27
unsigned PWRRST :1; // 28 PWRRST:电源复位
unsigned Reserved0 :3; // 31:29
};
union RCC_APB1RSTR_REG {
Uint32 all;
struct RCC_APB1RSTR_BITS bit;
};
// PWRRST:电源复位 0:无效 1:复位电源电路
#define RCC_PWRRST ((u32)0x1<<28)
// BKPRST:备份复位
#define RCC_BKPRST ((u32)0x1<<27)
// CANRST:CAN复位
#define RCC_CANRST ((u32)0x1<<25)
// USBRST:USB复位
#define RCC_USBRST ((u32)0x1<<23)
// I2C2RST:I2C 2复位
#define RCC_I2C2RST ((u32)0x1<<22)
// I2C1RST:I2C 1复位
#define RCC_I2C1RST ((u32)0x1<<21)
// USART3RST:USART3复位
#define RCC_USART3RST ((u32)0x1<<18)
// USART2RST:USART2复位
#define RCC_USART2RST ((u32)0x1<<17)
// SPI2RST:SPI2复位
#define RCC_SPI2RST ((u32)0x1<<14)
// WWDGRST:窗口看门狗复位
#define RCC_WWDGRST ((u32)0x1<<11)
// TIM4RST:定时器4复位
#define RCC_TIM4RST ((u32)0x1<<2)
// TIM3RST:定时器3复位
#define RCC_TIM3RST ((u32)0x1<<1)
// TIM2RST:定时器2复位
#define RCC_TIM2RST ((u32)0x1<<0)
//--------------------------------------------------------------------
// AHB外设时钟使能寄存器 (RCC_AHBENR
//--------------------------------------------------------------------
struct RCC_AHBENR_BITS {
unsigned DMAEN :1; // 0 DMAEN:DMA时钟使能
unsigned Reserved2 :1; // 1
unsigned SRAMEN :1; // 2 SRAMEN:SRAM时钟使能
unsigned Reserved1 :1; // 3
unsigned FLITFEN :1; // 4 FLITFEN:闪存接口电路时钟使能
unsigned Reserved0 :27; // 31:5
};
union RCC_AHBENR_REG {
Uint32 all;
struct RCC_AHBENR_BITS bit;
};
// FLITFEN:闪存接口电路时钟使能
#define RCC_FLITFEN ((u32)0x1<<4)
// SRAMEN:SRAM时钟使能
#define RCC_SRAMEN ((u32)0x1<<2)
// DMAEN:DMA时钟使能
#define RCC_DMAEN ((u32)0x1<<0)
//--------------------------------------------------------------------
// APB2 外设时钟使能寄存器(RCC_APB2ENR)
//--------------------------------------------------------------------
struct RCC_APB2ENR_BITS {
unsigned AFIOEN :1; // 0 AFIOEN:辅助功能IO时钟使能
unsigned Reserved3 :1; // 1
unsigned IOPAEN :1; // 2 IOPAEN:IO口E时钟使能
unsigned IOPBEN :1; // 3
unsigned IOPCEN :1; // 4
unsigned IOPDEN :1; // 5
unsigned IOPEEN :1; // 6 IOPEEN:IO口E时钟使能
unsigned Reserved2 :2; // 8:7
unsigned ADC1EN :1; // 9 ADC1EN:ADC1时钟使能
unsigned ADC2EN :1; // 10
unsigned TIM1EN :1; // 11
unsigned SPI1EN :1; // 12
unsigned Reserved1 :1; // 13
unsigned USART1EN :1; // 14 USART1EN:USART1时钟使能
unsigned Reserved0 :17; // 31:15
};
union RCC_APB2ENR_REG {
Uint32 all;
struct RCC_APB2ENR_BITS bit;
};
// USART1EN:USART1时钟使能 0:USART1时钟关闭 1:USART1时钟开启
#define RCC_USART1EN ((u32)0x1<<14)
// SPI1EN:SPI1时钟使能
#define RCC_SPI1EN ((u32)0x1<<12)
// TIM1EN:TIM1时钟使能
#define RCC_TIM1EN ((u32)0x1<<11)
// ADC2EN:ADC2时钟使能
#define RCC_ADC2EN ((u32)0x1<<10)
// ADC1EN:ADC1时钟使能
#define RCC_ADC1EN ((u32)0x1<<9)
// IOPEEN:IO口E时钟使能
#define RCC_IOPEEN ((u32)0x1<<6)
// IOPDEN:IO口D时钟使能
#define RCC_IOPDEN ((u32)0x1<<5)
// IOPCEN:IO口C时钟使能
#define RCC_IOPCEN ((u32)0x1<<4)
// IOPBEN:IO口B时钟使能
#define RCC_IOPBEN ((u32)0x1<<3)
// IOPAEN:IO口A时钟使能
#define RCC_IOPAEN ((u32)0x1<<2)
// AFIOEN:辅助功能IO时钟使能
#define RCC_AFIOEN ((u32)0x1<<0)
//--------------------------------------------------------------------
// APB1 外设时钟使能寄存器(RCC_APB1ENR)
//--------------------------------------------------------------------
struct RCC_APB1ENR_BITS {
unsigned TIM2EN :1; // 0 TIM2EN:定时器2时钟使能
unsigned TIM3EN :1; // 1
unsigned TIM4EN :1; // 2
unsigned Reserved6 :2; // 10:3
unsigned WWDGEN :1; // 11 WWDGEN:窗口看门狗时钟使能
unsigned Reserved5 :2; // 13:12
unsigned SPI2EN :1; // 14 SPI2EN:SPI 2时钟使能
unsigned Reserved4 :2; // 16:15
unsigned USART2EN :1; // 17 USART2EN:USART 2时钟使能
unsigned USART3EN :1; // 18 USART3EN:USART 3时钟使能
unsigned Reserved3 :2; // 20:19
unsigned I2C1EN :1; // 21 I2C1EN:I2C 1时钟使能
unsigned I2C2EN :1; // 22 I2C2EN:I2C 2时钟使能
unsigned USBEN :1; // 23 USBEN:USB时钟使能
unsigned Reserved2 :1; // 24
unsigned CANEN :1; // 25 CANEN:CAN时钟使能
unsigned Reserved1 :1; // 26
unsigned BKPEN :1; // 27 BKPEN:备份时钟使能
unsigned PWREN :1; // 28 PWREN:电源时钟使能
unsigned Reserved0 :3; // 31:29
};
union RCC_APB1ENR_REG {
Uint32 all;
struct RCC_APB1ENR_BITS bit;
};
// PWREN:电源时钟使能 0:电源时钟关闭 1:电源时钟开启
#define RCC_PWREN ((u32)0x1<<28)
// BKPEN:备份时钟使能
#define RCC_BKPEN ((u32)0x1<<27)
// CANEN:CAN时钟使能
#define RCC_CANEN ((u32)0x1<<25)
// USBEN:USB时钟使能
#define RCC_USBEN ((u32)0x1<<23)
// I2C2EN:I2C 2时钟使能
#define RCC_I2C2EN ((u32)0x1<<22)
// I2C1EN:I2C 1时钟使能
#define RCC_I2C1EN ((u32)0x1<<21)
// USART3EN:USART 3时钟使能
#define RCC_USART3EN ((u32)0x1<<18)
// USART2EN:USART 2时钟使能
#define RCC_USART2EN ((u32)0x1<<17)
// SPI2EN:SPI 2时钟使能
#define RCC_SPI2EN ((u32)0x1<<14)
// WWDGEN:窗口看门狗时钟使能
#define RCC_WWDGEN ((u32)0x1<<11)
// TIM4EN:定时器4时钟使能
#define RCC_TIM4EN ((u32)0x1<<2)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -