53 #define sys_tick_per_us 16 54 #define CLOCK_SYS_CLOCK_1250US (1250 * sys_tick_per_us) 85 extern void sleep_us(
unsigned long us);
87 #define ClockTime clock_time 88 #define WaitUs sleep_us 89 #define WaitMs(t) sleep_us((t)*1000) 90 #define sleep_ms(t) sleep_us((t)*1000) 101 return ((
unsigned int)(
clock_time() - ref) > us * 16);
static unsigned long clock_time(void)
This function performs to gets system timer0 address.
Definition: timer.h:71
void timer2_gpio_init(GPIO_PinTypeDef pin, GPIO_PolTypeDef pol)
initiate GPIO for gpio trigger and gpio width mode of timer2.
GPIO_PolTypeDef
Define rising/falling types.
Definition: gpio_8258.h:135
TIMER_ModeTypeDef
Mode of Timer.
Definition: timer.h:46
void timer0_gpio_init(GPIO_PinTypeDef pin, GPIO_PolTypeDef pol)
initiate GPIO for gpio trigger and gpio width mode of timer0.
void timer_start(TIMER_TypeDef type)
the specifed timer start working.
static unsigned int clock_time_exceed(unsigned int ref, unsigned int us)
This function performs to calculation exceed us of the timer.
Definition: timer.h:99
void timer1_set_mode(TIMER_ModeTypeDef mode, unsigned int init_tick, unsigned int cap_tick)
set mode, initial tick and capture of timer1.
GPIO_PinTypeDef
Define GPIO types.
Definition: gpio_8258.h:38
#define reg_system_tick
Definition: register_8258.h:809
void timer_stop(TIMER_TypeDef type)
the specifed timer stop working.
void timer2_set_mode(TIMER_ModeTypeDef mode, unsigned int init_tick, unsigned int cap_tick)
set mode, initial tick and capture of timer2.
TIMER_TypeDef
Type of Timer.
Definition: timer.h:37
void sleep_us(unsigned long us)
This function performs to set sleep us.
void timer0_set_mode(TIMER_ModeTypeDef mode, unsigned int init_tick, unsigned int cap_tick)
set mode, initial tick and capture of timer0.
void timer1_gpio_init(GPIO_PinTypeDef pin, GPIO_PolTypeDef pol)
initiate GPIO for gpio trigger and gpio width mode of timer1.