You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
535 B
33 lines
535 B
#ifndef __TIMER_H___
|
|
#define __TIMER_H___
|
|
|
|
#include "config.h"
|
|
|
|
#ifndef TARGET_HAS_TIM1
|
|
#define TARGET_HAS_TIM1 0
|
|
#endif
|
|
|
|
#ifndef TARGET_HAS_TIM3
|
|
#define TARGET_HAS_TIM3 0
|
|
#endif
|
|
|
|
struct timer;
|
|
|
|
int timer_setup(struct timer *tm, unsigned int ms, int (*irq)(struct timer *, void *user), void *user);
|
|
|
|
void timer_start(struct timer *tm);
|
|
|
|
void timer_stop(struct timer *tm);
|
|
|
|
void timer_close(struct timer *tm);
|
|
|
|
#if (TARGET_HAS_TIM1)
|
|
extern struct timer timer0;
|
|
#endif
|
|
|
|
#if (TARGET_HAS_TIM3)
|
|
extern struct timer timer2;
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|