MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / timer_cnt_clr

Function timer_cnt_clr

bsp/loongson/ls1cdev/libraries/ls1c_timer.c:232–250  ·  view source on GitHub ↗

* ��ʱ�������� * @timer_info ��ʱ����Ϣ */

Source from the content-addressed store, hash-verified

230 * @timer_info ��ʱ����Ϣ
231 */
232void timer_cnt_clr(timer_info_t *timer_info)
233{
234 unsigned int timer_reg_base = 0; // �Ĵ�������ַ
235 unsigned int ctrl ;
236
237 // ����
238 if (NULL == timer_info)
239 {
240 return ;
241 }
242 timer_reg_base = timer_get_reg_base(timer_info->timer); // ��ȡ�Ĵ�������ַ
243 ctrl = reg_read_32((volatile unsigned int *)(timer_reg_base + LS1C_PWM_CTRL));
244 ctrl = ctrl | (1<<LS1C_PWM_CNTR_RST);
245 reg_write_32(ctrl , (volatile unsigned int *)(timer_reg_base + LS1C_PWM_CTRL));
246 ctrl = ctrl & (~(1<<LS1C_PWM_CNTR_RST)) ;
247 reg_write_32(ctrl , (volatile unsigned int *)(timer_reg_base + LS1C_PWM_CTRL));
248
249 return ;
250}
251
252/*
253 * ��ʼ����ʱ��������ʼ�ж϶�ʱ

Callers

nothing calls this directly

Calls 3

timer_get_reg_baseFunction · 0.85
reg_read_32Function · 0.70
reg_write_32Function · 0.70

Tested by

no test coverage detected