Go to the source code of this file.
|
static unsigned long | clock_time (void) |
| This function performs to gets system timer0 address. More...
|
|
void | sleep_us (unsigned long us) |
| This function performs to set sleep us. More...
|
|
static unsigned int | clock_time_exceed (unsigned int ref, unsigned int us) |
| This function performs to calculation exceed us of the timer. More...
|
|
void | timer0_gpio_init (GPIO_PinTypeDef pin, GPIO_PolTypeDef pol) |
| initiate GPIO for gpio trigger and gpio width mode of timer0. More...
|
|
void | timer1_gpio_init (GPIO_PinTypeDef pin, GPIO_PolTypeDef pol) |
| initiate GPIO for gpio trigger and gpio width mode of timer1. More...
|
|
void | timer2_gpio_init (GPIO_PinTypeDef pin, GPIO_PolTypeDef pol) |
| initiate GPIO for gpio trigger and gpio width mode of timer2. More...
|
|
void | timer0_set_mode (TIMER_ModeTypeDef mode, unsigned int init_tick, unsigned int cap_tick) |
| set mode, initial tick and capture of timer0. More...
|
|
void | timer1_set_mode (TIMER_ModeTypeDef mode, unsigned int init_tick, unsigned int cap_tick) |
| set mode, initial tick and capture of timer1. More...
|
|
void | timer2_set_mode (TIMER_ModeTypeDef mode, unsigned int init_tick, unsigned int cap_tick) |
| set mode, initial tick and capture of timer2. More...
|
|
void | timer_start (TIMER_TypeDef type) |
| the specifed timer start working. More...
|
|
void | timer_stop (TIMER_TypeDef type) |
| the specifed timer stop working. More...
|
|
◆ sys_tick_per_us
#define sys_tick_per_us 16 |
◆ CLOCK_SYS_CLOCK_1250US
◆ ClockTime
◆ WaitUs
◆ WaitMs
◆ sleep_ms
#define sleep_ms |
( |
|
t | ) |
sleep_us((t)*1000) |
◆ TIMER_TypeDef
Type of Timer.
Enumerator |
---|
TIMER0 | |
TIMER1 | |
TIMER2 | |
◆ TIMER_ModeTypeDef
Mode of Timer.
Enumerator |
---|
TIMER_MODE_SYSCLK | |
TIMER_MODE_GPIO_TRIGGER | |
TIMER_MODE_GPIO_WIDTH | |
TIMER_MODE_TICK | |
◆ anonymous enum
system Timer : 16Mhz, Constant
Enumerator |
---|
CLOCK_16M_SYS_TIMER_CLK_1S | |
CLOCK_16M_SYS_TIMER_CLK_1MS | |
CLOCK_16M_SYS_TIMER_CLK_1US | |
◆ clock_time()
static unsigned long clock_time |
( |
void |
| ) |
|
|
inlinestatic |
This function performs to gets system timer0 address.
- Parameters
-
- Returns
- timer0 address.
◆ sleep_us()
void sleep_us |
( |
unsigned long |
us | ) |
|
This function performs to set sleep us.
- Parameters
-
[in] | us | - microseconds need to delay. |
- Returns
- none
◆ clock_time_exceed()
static unsigned int clock_time_exceed |
( |
unsigned int |
ref, |
|
|
unsigned int |
us |
|
) |
| |
|
inlinestatic |
This function performs to calculation exceed us of the timer.
- Parameters
-
[in] | ref | - Variable of reference timer address. |
[in] | span_us | - Variable of span us. |
- Returns
- the exceed.
◆ timer0_gpio_init()
initiate GPIO for gpio trigger and gpio width mode of timer0.
- Parameters
-
[in] | pin | - select pin for timer0. |
[in] | pol | - select polarity for gpio trigger and gpio width |
- Returns
- none
◆ timer1_gpio_init()
initiate GPIO for gpio trigger and gpio width mode of timer1.
- Parameters
-
[in] | pin | - select pin for timer1. |
[in] | pol | - select polarity for gpio trigger and gpio width |
- Returns
- none
◆ timer2_gpio_init()
initiate GPIO for gpio trigger and gpio width mode of timer2.
- Parameters
-
[in] | pin | - select pin for timer2. |
[in] | pol | - select polarity for gpio trigger and gpio width |
- Returns
- none
◆ timer0_set_mode()
void timer0_set_mode |
( |
TIMER_ModeTypeDef |
mode, |
|
|
unsigned int |
init_tick, |
|
|
unsigned int |
cap_tick |
|
) |
| |
set mode, initial tick and capture of timer0.
- Parameters
-
[in] | mode | - select mode for timer0. |
[in] | init_tick | - initial tick. |
[in] | cap_tick | - tick of capture. |
- Returns
- none
◆ timer1_set_mode()
void timer1_set_mode |
( |
TIMER_ModeTypeDef |
mode, |
|
|
unsigned int |
init_tick, |
|
|
unsigned int |
cap_tick |
|
) |
| |
set mode, initial tick and capture of timer1.
- Parameters
-
[in] | mode | - select mode for timer1. |
[in] | init_tick | - initial tick. |
[in] | cap_tick | - tick of capture. |
- Returns
- none
◆ timer2_set_mode()
void timer2_set_mode |
( |
TIMER_ModeTypeDef |
mode, |
|
|
unsigned int |
init_tick, |
|
|
unsigned int |
cap_tick |
|
) |
| |
set mode, initial tick and capture of timer2.
- Parameters
-
[in] | mode | - select mode for timer2. |
[in] | init_tick | - initial tick. |
[in] | cap_tick | - tick of capture. |
- Returns
- none
◆ timer_start()
the specifed timer start working.
- Parameters
-
[in] | type | - select the timer to start. |
- Returns
- none
◆ timer_stop()
the specifed timer stop working.
- Parameters
-
[in] | type | - select the timer to stop. |
- Returns
- none