RTC配置
一、秒中断的配置,RTC就是一个定时器而已,没什么大不了的!
1、NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
NVIC_PriorityGroup,: specifies the priority grouping bits length.
This parameter can be one of the following values:
NVIC_PriorityGroup_0: 0 bits for pre-emption priority 4 bits for subpriority
NVIC_PriorityGroup_1: 1 bits for pre-emption priority 3 bits for subpriority
NVIC_PriorityGroup_2: 2 bits for pre-emption priority 2 bits for subpriority
NVIC_PriorityGroup_3: 3 bits for pre-emption priority 1 bits for subpriority
NVIC_PriorityGroup_4: 4 bits for pre-emption priority 0 bits for subpriority
//意思很明朗,唯一需要理解的就是pre-emption(主优先级)subpriority(副优先级);
2、NVIC_InitTypeDef NVIC_InitStructure;
一个这样的结构体,找到手册
数据成员
uint8_t NVIC_IRQChannel
FunctionalState NVIC_IRQChannelCmd
uint8_t NVIC_IRQChannelPreemptionPriority
uint8_t NVIC_IRQChannelSubPriority
3、NVIC_IRQChannel他的描述如下
Specifies the IRQ channel to be enabled or disabled.
取值
NonMaskableInt_IRQn 2 Non Maskable Interrupt
MemoryManagement_IRQn 4 Cortex-M3 Memory Management Interrupt
BusFault_IRQn 5 Cortex-M3 Bus Fault Interrupt
UsageFault_IRQn 6 Cortex-M3 Usage Fault Interrupt
SVCall_IRQn 11 Cortex-M3 SV Call Interrupt
DebugMonitor_IRQn 12 Cortex-M3 Debug Monitor Interrupt
PendSV_IRQn 14 Cortex-M3 Pend SV Interrupt
SysTick_IRQn 15 Cortex-M3 System Tick Interrupt
WWDG_IRQn Window WatchDog Interrupt
PVD_IRQn PVD through EXTI Line detection Interrupt
TAMPER_IRQn Tamper Interrupt
RTC_IRQn RTC global Interrupt
FLASH_IRQn FLASH global Interrupt
RCC_IRQn RCC global Interrupt
EXTI0_IRQn EXTI Line0 Interrupt
EXTI1_IRQn EXTI Line1 Interrupt
EXTI2_IRQn EXTI Line2 Interrupt
EXTI3_IRQn EXTI Line3 Interrupt
EXTI4_IRQn EXTI Line4 Interrupt
DMA1_Channel1_IRQn DMA1 Channel 1 global Interrupt
DMA1_Channel2_IRQn DMA1 Channel 2 global Interrupt
DMA1_Channel3_IRQn DMA1 Channel 3 global Interrupt
DMA1_Channel4_IRQn DMA1 Channel 4 global Interrupt
DMA1_Channel5_IRQn DMA1 Channel 5 global Interrupt
DMA1_Channel6_IRQn DMA1 Channel 6 global Interrupt
DMA1_Channel7_IRQn DMA1 Channel 7 global Interrupt |