static int a20t_oneshot_relative(const pstimer_t *timer, uint64_t ns) { A20TIMER *a20t = (A20TIMER *)timer->data; configure_timeout(timer, ns); switch (a20t->id) { case 0: rawWriteUInt32(a20t->a20t_map + TMR0_CTRL_REG_OFF, rawReadUInt32(a20t->a20t_map + TMR0_CTRL_REG_OFF) | BIT(1) | BIT(0)); } return 0; }
static int gpt_periodic(const pstimer_t *timer, uint64_t ns) { gpt_t *gpt = (gpt_t *)timer->data; configure_timeout(timer, ns); /* Set autoreload and start the timer. */ *(volatile uint32_t *)&(gpt->gpt_map->tclr) = BIT(AR) | BIT(ST); return 0; }
static int gpt_oneshot_relative(const pstimer_t *timer, uint64_t ns) { gpt_t *gpt = (gpt_t*) timer->data; configure_timeout(timer, ns); /* Set start the timer with no autoreload. */ gpt->gpt_map->tclr = BIT(ST); return 0; }
static int a20t_periodic(const pstimer_t *timer, uint64_t ns) { A20TIMER *a20t = (A20TIMER *)timer->data; /* Set autoreload and start the timer. */ configure_timeout(timer, ns); switch (a20t->id) { case 0: rawWriteUInt32(a20t->a20t_map + TMR0_CTRL_REG_OFF, BIT(1) | BIT(0)); break; } return 0; }
static int gpt_oneshot_relative(const pstimer_t *timer, uint64_t ns) { gpt_t *gpt = (gpt_t *)timer->data; struct gpt_map *gptMap = gpt->gpt_map; configure_timeout(timer, ns); /* Set start the timer with no autoreload. */ *(volatile uint32_t *)&(gptMap->tclr) |= BIT(ST); //BIT(PRE) | BIT(AR) | BIT(PT) | BIT(ST) | BIT(TRG); *(volatile uint32_t *)(gptMap->towr) = 0x0; return 0; }