/* * idx indicate Timer0L, Timer0H, Timer1L,Timer1H * Timer affect circular in buffer. */ void stop_timer(uint8_t idx) { uint8_t ep = (idx + 1) | 0x80; circular_buffer_pools_t * cb_in = circular_buffer_pointer(ep); uint16_t timer_reload = circular_buffer_timer_reload(cb_in); switch(idx) { case 0: SI32_TIMER_A_stop_low_timer (SI32_TIMER_0); SI32_TIMER_A_clear_low_overflow_interrupt (SI32_TIMER_0); SI32_TIMER_A_set_low_count (SI32_TIMER_0, timer_reload); break; case 1: SI32_TIMER_A_stop_high_timer (SI32_TIMER_0); SI32_TIMER_A_clear_high_overflow_interrupt (SI32_TIMER_0); SI32_TIMER_A_set_high_count (SI32_TIMER_0, timer_reload); break; case 2: SI32_TIMER_A_stop_low_timer (SI32_TIMER_1); SI32_TIMER_A_clear_low_overflow_interrupt (SI32_TIMER_1); SI32_TIMER_A_set_low_count (SI32_TIMER_1, timer_reload); break; case 3: SI32_TIMER_A_stop_high_timer (SI32_TIMER_1); SI32_TIMER_A_clear_high_overflow_interrupt (SI32_TIMER_1); SI32_TIMER_A_set_high_count (SI32_TIMER_1, timer_reload); break; } circular_buffer_put_read_ready(cb_in,1); }
void wave_125k_stop(void) { SI32_TIMER_A_stop_high_timer(SI32_TIMER_1); SI32_PBCFG_A_disable_xbar0_peripherals(SI32_PBCFG_0, SI32_PBCFG_A_XBAR0_TMR1EXEN); SI32_PBSTD_A_write_pins_high(SI32_PBSTD_0, 0x0100); }