|
下面是一段ATIM定时例程,这两个函数有什么关联?中断是如何产生?哪位帮忙解读一下
void MF_ATIM_TimerBase_Init(void)
{
/*IO CONFIG*/
FL_ATIM_InitTypeDef TimerBaseInitStruct;
TimerBaseInitStruct.clockSource = FL_RCC_ATIM_CLK_SOURCE_APB2CLK;
TimerBaseInitStruct.prescaler = 10-1;
TimerBaseInitStruct.counterMode = FL_ATIM_COUNTER_DIR_UP;
TimerBaseInitStruct.autoReload = 0xFFFFU;
TimerBaseInitStruct.autoReloadState = FL_DISABLE;
TimerBaseInitStruct.clockDivision = FL_ATIM_CLK_DIVISION_DIV1;
TimerBaseInitStruct.repetitionCounter = 0;
FL_ATIM_Init(ATIM,&TimerBaseInitStruct );
FL_ATIM_EnableIT_Update(ATIM );
}
/**
* @brief NVIC Initialization function
* @param void
* @retval None
*/
void MF_NVIC_Init(void)
{
FL_NVIC_ConfigTypeDef InterruptConfigStruct;
InterruptConfigStruct.preemptPriority = 0x00;
FL_NVIC_Init(&InterruptConfigStruct,ATIM_IRQn );
}
|
|