60 cprao_aon_clken_grctl__timer_ao_pclk_en__setf(ENABLE);
65 if (AOTIMER0_IDX == reg_idx) {
66 cprao_aon_clken_grctl__timer0_ao_pclk_en__setf(ENABLE);
67 cprao_aon_clken_grctl__timer1_ao_pclk_en__setf(ENABLE);
68 }
else if (AOTIMER1_IDX == reg_idx) {
69 cprao_aon_clken_grctl__timer0_ao_pclk_en__setf(ENABLE);
70 cprao_aon_clken_grctl__timer1_ao_pclk_en__setf(ENABLE);
72 cpr_lp_ctl__timer_sysclk_sel__setf(ENABLE);
74 aotimer_tcr__tes__setf(reg_idx, DISABLE);
75 aotimer_tcr__tms__setf(reg_idx, (uint8_t)init_cfg->
aotimer_mode);
76 (void)aotimer_tic__tic__getf(reg_idx);
94 uint32_t ticks = AOTIMER_TICK_CAL(us);
96 if (ticks < AOTIMER_MIN_TLC_VAL)
97 ticks = AOTIMER_MIN_TLC_VAL;
119 aotimer_tcr__tes__setf(reg_idx, AOTIMER_TCR_TES_DISABLE);
121 aotimer_tlc_set(reg_idx, ticks);
137 NVIC_EnableIRQ( (IRQn_Type)(TIMER_AO0_IRQn+reg_idx) );
138 aotimer_tcr__tim__setf(reg_idx, 0);
139 aotimer_tcr__tes__setf(reg_idx, ENABLE);
141 while(aotimer_tcr__tes__getf(reg_idx) != ENABLE)
158 aotimer_tcr__tes__setf(reg_idx, DISABLE);
172 cprao_aon_reg1__timer_ao_sleep_clksw__setf(0);
173 (void)aotimer_tic__tic__getf(AOTIMER0_IDX);
189 cprao_aon_reg1__timer_ao_sleep_clksw__setf(0);
190 (void)aotimer_tic__tic__getf(AOTIMER1_IDX);
AOTimer_ModeTypeDef aotimer_mode
void xc_aotimer_start(uint8_t reg_idx)
xc_aotimer_start
aotimer_handler_callback aotimer_n_callback[2]
void xc_aotimer_init(uint8_t reg_idx, AOTimer_InitCfg_t *init_cfg)
xc_aotimer_init
__WEAK void aotimer1_callback(void *context)
aotimer1_callback
static uint32_t xc_aotimer_us_to_ticks(uint32_t us)
xc_aotimer_us_to_ticks
void AOTIMER1_Handler(void)
AOTIMER1_Handler
void xc_aotimer_set_value(uint8_t reg_idx, uint32_t us)
xc_aotimer_set_value
void AOTIMER0_Handler(void)
AOTIMER0_Handler
void xc_aotimer_stop(uint8_t reg_idx)
xc_aotimer_stop
__WEAK void aotimer0_callback(void *context)
aotimer0_callback
static bool aotimer_rst_flag
The header of xc_drv_aotimer.c
void(* aotimer_handler_callback)(void *context)