36 #ifdef CONFIG_INSTANCE_NAME
42 #ifdef CONFIG_TIMER_MULTI
46 const struct timer_ops *ops;
49 #ifdef CONFIG_TIMER_MULTI
54 struct timer *(*timer_init)(uint32_t index, uint32_t prescaler, uint64_t basetime, int64_t adjust);
57 int32_t (*
timer_setOverflowCallback)(
struct timer *timer, bool (*callback)(
struct timer *timer,
void *data),
void * data);
65 #ifndef CONFIG_TIMER_MULTI
75 struct timer *
timer_init(uint32_t index, uint32_t prescaler, uint64_t basetime, int64_t adjust);
123 inline struct timer *
timer_init(uint32_t index, uint32_t prescaler, uint64_t basetime, int64_t adjust) {
129 return timer->ops->timer_init(index, prescaler, basetime, adjust);
133 return t->ops->timer_deinit(timer);
136 inline int32_t
timer_setOverflowCallback(
struct timer *timer,
bool (*callback)(
struct timer *timer,
void *data),
void * data) {
138 return t->ops->timer_setOverflowCallback(timer, callback, data);
142 return t->ops->timer_start(timer);
144 inline int32_t
timer_stop(
struct timer *timer) {
146 return t->ops->timer_stop(timer);
148 inline int32_t
timer_oneshot(
struct timer *timer, uint64_t us) {
150 return t->ops->timer_oneshot(timer, us);
154 return t->ops->timer_periodic(timer, us);
158 return t->ops->timer_getTime(timer);