初学者:关于LPC1768程序
时间:10-02
整理:3721RD
点击:
void SetupTimer1(void)
{
TIM_MATCHCFG_Type TIM_MatchConfigStruct;
TIM_TIMERCFG_Type TIM_ConfigStruct;
TIM_ConfigStruct.PrescaleOption = TIM_PRESCALE_USVAL;
TIM_ConfigStruct.PrescaleValue = 25000;
TIM_MatchConfigStruct.MatchChannel = 1;
TIM_MatchConfigStruct.IntOnMatch = TRUE;
TIM_MatchConfigStruct.ResetOnMatch = TRUE;
TIM_MatchConfigStruct.StopOnMatch = FALSE;
TIM_MatchConfigStruct.ExtMatchOutputType =TIM_EXTMATCH_NOTHING;
TIM_MatchConfigStruct.MatchValue = 0xFFFFFFFF;
TIM_Init(LPC_TIM1, TIM_TIMER_MODE,&TIM_ConfigStruct);
TIM_ConfigMatch(LPC_TIM1, &TIM_MatchConfigStruct);
TIM_Cmd(LPC_TIM1, ENABLE);
NVIC_SetPriority(TIMER1_IRQn, ((0x01<<3)|0x01));
NVIC_EnableIRQ(TIMER1_IRQn);
TIM_Cmd(LPC_TIM1,ENABLE);
}
这是基于lpc1768的定时器1的初始化函数,我想问问这段函数是怎么编的,是不是用的库函数操作的呢?另外,有官员lpc的库函数吗,就像stm32那样的库函数有吗
{
TIM_MATCHCFG_Type TIM_MatchConfigStruct;
TIM_TIMERCFG_Type TIM_ConfigStruct;
TIM_ConfigStruct.PrescaleOption = TIM_PRESCALE_USVAL;
TIM_ConfigStruct.PrescaleValue = 25000;
TIM_MatchConfigStruct.MatchChannel = 1;
TIM_MatchConfigStruct.IntOnMatch = TRUE;
TIM_MatchConfigStruct.ResetOnMatch = TRUE;
TIM_MatchConfigStruct.StopOnMatch = FALSE;
TIM_MatchConfigStruct.ExtMatchOutputType =TIM_EXTMATCH_NOTHING;
TIM_MatchConfigStruct.MatchValue = 0xFFFFFFFF;
TIM_Init(LPC_TIM1, TIM_TIMER_MODE,&TIM_ConfigStruct);
TIM_ConfigMatch(LPC_TIM1, &TIM_MatchConfigStruct);
TIM_Cmd(LPC_TIM1, ENABLE);
NVIC_SetPriority(TIMER1_IRQn, ((0x01<<3)|0x01));
NVIC_EnableIRQ(TIMER1_IRQn);
TIM_Cmd(LPC_TIM1,ENABLE);
}
这是基于lpc1768的定时器1的初始化函数,我想问问这段函数是怎么编的,是不是用的库函数操作的呢?另外,有官员lpc的库函数吗,就像stm32那样的库函数有吗