OLED_ShowNum(2, 5, timer_counter_read(TIMER2), 5);OLED_ShowNum(3, 5, timer_prescaler_read(...
timer_initpara.counterdirection = TIMER_COUNTER_UP; timer_initpara.period = 0xffff; timer_init(TIMER5, &timer_initpara); timer_counter_value_config(TIMER5, 0); timer_update_source_config(TIMER5, TIMER_UPDATE_SRC_REGULAR); timer_auto_reload_shadow_disable(TIMER5); timer_single_pulse_mode_...
timer_initpara.alignedmode = TIMER_COUNTER_EDGE;timer_initpara.counterdirection = TIMER_COUNTER_UP;...
timer_icinitpara.icselection=TIMER_IC_SELECTION_DIRECTTI; timer_icinitpara.icprescaler=TIMER_IC_PSC_DIV1; timer_icinitpara.icfilter=0; timer_input_capture_config(TIMER3,TIMER_CH_2,&timer_icinitpara); }else///捕获到下降沿,为0是下降沿{ Dval=timer_counter_read(TIMER3); timer_icinitpara.ic...
timer_initpara.counterdirection = TIMER_COUNTER_UP; timer_initpara.period = 4000-1; //800ms timer_initpara.clockdivision = TIMER_CKDIV_DIV1; timer_init(TIMER4, &timer_initpara); 对于定时器定时周期的计算,设 TIMER4 的经过总线分频后得到的时钟为 30MHz,通过预分频 5999,得到 TIMER4 每个计 数...
实验原理timer_channel_eapture_value_register_read函数的功能是读取通道捕获值。具体描述如表13-7所示。实验原理timer_counter_value_config函数的功能是配置外设TIMERx的计数器值。具体描述如表13-8所示。实验原理输入捕获实验的程序架构如图13-7所示。实验原理03实验步骤步骤1:复制并编译原始工程;步骤2:添加Capture...
/* 注册定义定时器中断使用的timer */TIMER_BASE_DEF(TIMER_INT,TIMER5);/*!* 说明 定时器中断初始化* 输入[1] counter_frequency:计数器频率值* 输入[2] period:周期值* 返回值 无*/void bsp_timer_init(uint32_t counter_frequency,uint16_t period){driver_timer_base_int_init(&TIMER_INT,counter...
表3-486.函数timer_prescaler_config409 表3-487.函数timer_repetition_value_config410 表3-488.函数timer_autoreload_value_config411 表3-489.函数timer_counter_value_config411 表3-490.函数timer_counter_read412 表3-491.函数timer_prescaler_read413 ...
TIMER_COUNTER_EDGE,//定时器增长方向timer_parameter.counterdirection = TIMER_COUNTER_UP,//定时器自动加载值timer_parameter.period = arr,//时钟分频值timer_parameter.clockdivision = TIMER_CKDIV_DIV4,timer_init(TIMER1, &timer_parameter);timer_interrupt_enable(TIMER1, TIMER_INT_UP);nvic_irq_enable(...
timer_deinit(TIMER2);/* TIMER2 configuration */timer_initpara.prescaler =120-1;//定时器的时钟频率是120MHz,预分频120-1timer_initpara.alignedmode = TIMER_COUNTER_EDGE;//对齐模式timer_initpara.counterdirection = TIMER_COUNTER_UP;//向上计数timer_initpara.period =65535;//重载值timer_initpara.cl...