core/time/timer.c File Reference
#include "sceptre.h"
Go to the source code of this file.
Detailed Description
Implementation of the timer functions.
Definition in file timer.c.
Function Documentation
void timer_disable |
( |
uint8_t |
timer_num |
) |
|
Disable a timer.
- Parameters:
-
| timer_num | Number (0,1) of timer to enable. |
Definition at line 109 of file timer.c.
void timer_enable |
( |
uint8_t |
timer_num |
) |
|
Enable a timer.
- Parameters:
-
| timer_num | Number (0,1) of timer to enable. |
Definition at line 91 of file timer.c.
uint32_t timer_get_10ms_counter |
( |
void |
|
) |
[inline] |
Get the value of the 10 ms tick counter.
- Returns:
- The value of the 10 ms tick counter.
Definition at line 239 of file timer.c.
uint32_t timer_get_count |
( |
uint8_t |
timer_num |
) |
|
Get the value of a timer counter.
- Parameters:
-
| timer_num | Number (0,1) of timer to get count of. |
Definition at line 184 of file timer.c.
uint32_t timer_get_system_count |
( |
void |
|
) |
[inline] |
Get the value of the system timer counter.
- Returns:
- The value of the system timer counter.
Definition at line 209 of file timer.c.
bool_t timer_init |
( |
uint8_t |
timer_num, |
|
|
uint32_t |
interval | |
|
) |
| | |
Initialize a timer.
- Parameters:
-
| timer_num | Number (0,1) of timer to initialize. |
| interval | Timer interval in clock ticks. |
- Returns:
- true on success, false if the interrupt handler could not be installed.
Definition at line 154 of file timer.c.
void timer_reset |
( |
uint8_t |
timer_num |
) |
|
Reset a timer.
- Parameters:
-
| timer_num | Number (0,1) of timer to enable. |
Definition at line 127 of file timer.c.
void timer_set_10ms_hook |
( |
timer_10ms_hook_t |
f |
) |
|
Set 10 ms hook for system timer.
- Parameters:
-
| f | Address of the hook function. |
Definition at line 250 of file timer.c.
void timer_set_count |
( |
uint8_t |
timer_num, |
|
|
uint32_t |
val | |
|
) |
| | |
Set the value of a timer counter.
- Parameters:
-
| timer_num | Number (0,1) of timer to set count of. |
| val | New value for the counter. |
Definition at line 197 of file timer.c.
void timer_set_system_count |
( |
uint32_t |
val |
) |
[inline] |
Set the value of the system timer counter.
- Parameters:
-
| val | The new value of the system timer counter. |
Definition at line 224 of file timer.c.
void timer_wait_ms |
( |
uint32_t |
delay_ms |
) |
|
Wait for a specified number of milliseconds.
- Parameters:
-
| delay_ms | The time to wait in milliseconds (ms). |
Definition at line 261 of file timer.c.