|
px-fwlib 0.10.0
Cross-platform embedded library and documentation for 8/16/32-bit microcontrollers generated with Doxygen 1.9.2
|
Driver to initalise SysTick peripheral so that a periodic system clock tick interrupt is generated.
File(s):
px_sysclk_init() configures SysTick to expire every 1/PX_SYSCLK_TICKS_PER_SEC second and generate an interrupt during which a clock tick counter is incremented. px_sysclk_get_tick_count() must be called to fetch a copy of the clock tick counter in an interrupt safe way (atomically).
A periodic timeout function can also be called by the system clock timer interrupt, for example a software RTC can be implemented by calling an RTC update function once a second. The period is specified in 'px_sysclk_cfg.h' with PX_SYSCLK_TIMEOUT_PERIOD_TICKS and the function to call with.
See px_systmr.h : Polled software timers which builds on px_sysclk.h : System Clock using a SysTick peripheral to provide multiple software timers. Example:
Typedefs | |
| typedef uint32_t | px_sysclk_ticks_t |
| Size definition of the tick counter. More... | |
Functions | |
| void | px_sysclk_init (void) |
| Start system clock (one clock tick every 1/PX_SYSCLK_TICKS_PER_SEC seconds) More... | |
| px_sysclk_ticks_t | px_sysclk_get_tick_count (void) |
| Return number of ticks since system clock started. More... | |
| void | px_sysclk_reset_tick_count (void) |
| Reset tick count. More... | |
| typedef uint32_t px_sysclk_ticks_t |
Size definition of the tick counter.
Definition at line 74 of file px_sysclk.h.
| void px_sysclk_init | ( | void | ) |
Start system clock (one clock tick every 1/PX_SYSCLK_TICKS_PER_SEC seconds)
Definition at line 79 of file px_sysclk.c.
| px_sysclk_ticks_t px_sysclk_get_tick_count | ( | void | ) |
Return number of ticks since system clock started.
Definition at line 97 of file px_sysclk.c.
| void px_sysclk_reset_tick_count | ( | void | ) |
Reset tick count.
Definition at line 102 of file px_sysclk.c.