|
SatCat5
|
Microchip SAM V71 implementation of the "TimeRef" API.
This class uses configures and uses the SysTick Timer on the SAMV71 to track elapsed time for SatCat. At instantiation, it uses the CPU frequency and desired tick rate to configure the interrupt. It will will increment member when the interrupt is triggered, and SatCat can poll this value to find elapsed time.
Definition at line 21 of file systick_timer.h.
#include <systick_timer.h>
Public Member Functions | |
| SysTickTimer (const u32 cpu_freq_hz, const u32 tick_rate_hz) | |
| Constructor requires the CPU frequency and timer tick-rate. | |
| u32 | raw () override |
| Get raw tick-count,. More... | |
| void | timer_callback (satcat5::poll::OnDemand *callback) |
| Set callback for timer events. More... | |
| TimeVal | now () |
| Create a TimeVal object using the tick-count from raw(). | |
| TimeVal | checkpoint_usec (unsigned usec) |
| Create an oven-timer, set N microseconds from now. More... | |
| TimeVal | checkpoint_msec (unsigned msec) |
| Create an oven-timer, set N milliseconds from now. More... | |
| void | busywait_usec (unsigned usec) |
| If timer resolution allows, busywait for X microseconds. More... | |
| u32 | ticks_per_sec () const |
| Stable accessors for unit conversion. More... | |
| u32 | ticks_per_msec () const |
| Stable accessors for unit conversion. More... | |
| u32 | ticks_per_usec () const |
| Stable accessors for unit conversion. More... | |
Public Attributes | |
| const char *const | m_label |
| Human-readable label, for debugging. | |
| const int | m_irq_idx |
| IRQ index for this interrupt handler. | |
Protected Member Functions | |
| void | irq_event () override |
| Method called whenever an interrupt is triggered. | |
Protected Attributes | |
| u32 * | m_ctrl |
| unsigned int | m_tick_num = 0 |
| satcat5::poll::OnDemand * | m_callback |
| u32 | m_max_irqtime |
| Statistics tracking for time consumed by this interrupt. | |
Private Attributes | |
| u64 const | m_msec_per_tick |
| u64 const | m_usec_per_tick |
| u64 const | m_tick_per_msec |
| u64 const | m_tick_per_usec |
| satcat5::irq::Handler * | m_next |
|
inherited |
If timer resolution allows, busywait for X microseconds.
(May return immediately if backing reference is too coarse.)
Definition at line 93 of file timeref.cc.
|
inherited |
Create an oven-timer, set N milliseconds from now.
An over-timer TimeVal is a timestamp a short time in the future. To use it, create the TimeVal and then poll checkpoint_elapsed(). (The returned TimeVal is intended to be used exactly once.)
Definition at line 73 of file timeref.cc.
|
inherited |
Create an oven-timer, set N microseconds from now.
An over-timer TimeVal is a timestamp a short time in the future. To use it, create the TimeVal and then poll checkpoint_elapsed(). (The returned TimeVal is intended to be used exactly once.)
Definition at line 69 of file timeref.cc.
|
overridevirtual |
Get raw tick-count,.
Implements satcat5::util::TimeRef.
Definition at line 54 of file systick_timer.cc.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
| void SysTickTimer::timer_callback | ( | satcat5::poll::OnDemand * | callback | ) |
Set callback for timer events.
(This is usually poll::timekeeper.)
Definition at line 59 of file systick_timer.cc.