Exemplo n.º 1
0
/* idx indicate Timer0L, Timer0H, Timer1L,Timer1H*/
void start_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:
            //  Set Next Timer Reload to finish transfer after there is room in FIFO
            SI32_TIMER_A_set_low_count (SI32_TIMER_0, timer_reload);
            SI32_TIMER_A_set_low_reload (SI32_TIMER_0, timer_reload);
            SI32_TIMER_A_start_low_timer (SI32_TIMER_0);
            break;
        case 1:
            //  Set Next Timer Reload to finish transfer after there is room in FIFO
            SI32_TIMER_A_set_high_count (SI32_TIMER_0, timer_reload);
            SI32_TIMER_A_set_high_reload (SI32_TIMER_0, timer_reload);
            SI32_TIMER_A_start_high_timer (SI32_TIMER_0);
            break;
        case 2:
            //  Set Next Timer Reload to finish transfer after there is room in FIFO
            SI32_TIMER_A_set_low_count (SI32_TIMER_1, timer_reload);
            SI32_TIMER_A_set_low_reload (SI32_TIMER_1, timer_reload);
            SI32_TIMER_A_start_low_timer (SI32_TIMER_1);
            break;
        case 3:
            //  Set Next Timer Reload to finish transfer after there is room in FIFO
            SI32_TIMER_A_set_high_count (SI32_TIMER_1, timer_reload);
            SI32_TIMER_A_set_high_reload (SI32_TIMER_1,timer_reload);
            SI32_TIMER_A_start_high_timer (SI32_TIMER_1);
            break;
    }

}
Exemplo n.º 2
0
void wave_125k_start(void)
{	
	SI32_PBCFG_A_enable_xbar0_peripherals(SI32_PBCFG_0, SI32_PBCFG_A_XBAR0_TMR1EXEN);
	SI32_TIMER_A_start_high_timer(SI32_TIMER_1);
}