Public Member Functions | |
LowPowerTickerWrapper (const ticker_data_t *data, const ticker_interface_t *interface, uint32_t min_cycles_between_writes, uint32_t min_cycles_until_match) | |
Create a new wrapped low power ticker object. More... | |
void | irq_handler (ticker_irq_handler_type handler) |
Interrupt handler called by the underlying driver/hardware. More... | |
void | suspend () |
Suspend wrapper operation and pass through interrupts. More... | |
void | resume () |
Resume wrapper operation and filter interrupts normally. More... | |
bool | timeout_pending () |
Check if a Timeout object is being used. More... | |
Definition at line 30 of file LowPowerTickerWrapper.h.
LowPowerTickerWrapper | ( | const ticker_data_t * | data, |
const ticker_interface_t * | interface, | ||
uint32_t | min_cycles_between_writes, | ||
uint32_t | min_cycles_until_match | ||
) |
Create a new wrapped low power ticker object.
data | Low power ticker data to wrap |
interface | new ticker interface functions |
min_cycles_between_writes | The number of whole low power clock periods which must complete before subsequent calls to set_interrupt |
min_cycles_until_match | The minimum number of whole low power clock periods from the current time for which the match timestamp passed to set_interrupt is guaranteed to fire. |
N = min_cycles_between_writes
0 1 N - 1 N N + 1 N + 2 N + 3 |-------|------...------|-------|-------|-------|-------| ^ ^ | | set_interrupt Next set_interrupt allowed
N = min_cycles_until_match
0 1 N - 1 N N + 1 N + 2 N + 3 |-------|------...------|-------|-------|-------|-------| ^ ^ | | set_interrupt Earliest match timestamp allowed
void irq_handler | ( | ticker_irq_handler_type | handler | ) |
Interrupt handler called by the underlying driver/hardware.
handler | The callback which would normally be called by the underlying driver/hardware |
void resume | ( | ) |
Resume wrapper operation and filter interrupts normally.
void suspend | ( | ) |
Suspend wrapper operation and pass through interrupts.
This stops to wrapper layer from using the microsecond ticker. This should be called before using the low power ticker APIs directly.
bool timeout_pending | ( | ) |
Check if a Timeout object is being used.