nrfcxx
0.1.0
C++-17 Framework for Nordic nRF5 Devices
|
Functions and classes related to clocks and time. More...
Data Structures | |
class | alarm |
Class supporting an alarm with custom callback and repeatability. More... | |
class | clock_shift |
Support for converting between time domains with the same resolution but unstable clocks. More... | |
class | hfclk |
Functions and data related to the high-frequency clock. More... | |
class | lfclk |
Functions and data related to the low-frequency clock. More... | |
class | uptime |
Support for a persistent system clock with 32 KiHz resolution. More... | |
Functions | |
int | initialize (bool enable_hfxt=false, int lfclk_src=board::default_lfclk_src(), unsigned int lfrc_cal_interval_qs=lfclk::DefaultRCOCalInterval_qs) |
Initialize the clock system. More... | |
bool | configure_pcirq (int on) |
Query or control whether the POWER_CLOCK interrupt handler is enabled. More... | |
constexpr uptime::duration_type | operator""_utt (unsigned long long n) |
User-defined literal support for uptime ticks. More... | |
Functions and classes related to clocks and time.
bool nrfcxx::clock::configure_pcirq | ( | int | on | ) |
Query or control whether the POWER_CLOCK
interrupt handler is enabled.
POWER_CLOCK_IRQHandler
plays a crucial role in maintaining a calibrated RC-based low-frequency clock. However, the application is not permitted to control this interrupt during periods when a soft device is enabled.
on | a positive value to enable POWER_CLOCK_IRQn ; zero to disable it; a negative value to return the configured state without change. |
true
iff the POWER_CLOCK
interrupt is enabled. int nrfcxx::clock::initialize | ( | bool | enable_hfxt = false , |
int | lfclk_src = board::default_lfclk_src() , |
||
unsigned int | lfrc_cal_interval_qs = lfclk::DefaultRCOCalInterval_qs |
||
) |
Initialize the clock system.
This configures the interrupt handler and must be invoked before any other function in this namespace. It unconditionally invokes lfclk::configure() to enable the low-frequency clock.
enable_hfxt | Passed to hfclk::hfxt_configure() to default-enable the high-frequency crystal. |
lfclk_src | Passed to lfclk::source_configure() prior to invoking lfclk::configure() to set the source for the low-frequency clock. The default is a 32 KiHz crystal if the board provides one, otherwise the RC oscillator. |
lfrc_cal_interval_qs | Passed to lfclk::source_configure() prior to invoking lfclk::configure() to the calibration interval when lfclk_src is CLOCK_LFCLKSRC_SRC_RC. |
POWER_CLOCK
interrupt is enabled by this function. Use configure_pcirq() to release it prior to enabling soft devices.POWER_CLOCK
interrupt handler be enabled.
|
constexpr |
User-defined literal support for uptime ticks.
using namespace nrfcxx::clock
.