Wrapper around the nRF51 RTC peripheral.
More...
#include <nrfcxx/periph.hpp>
|
uint32_t | counter () const |
| Return the underlying 24-bit counter value.
|
|
const nrf5::RTC_Type & | peripheral () const |
| Reference the nRF5 RTC peripheral instance used by the abstraction.
|
|
const unsigned int | ccr_count () const |
| The number of capture/compare registers on the device.
|
|
|
constexpr static unsigned int | counter_delta (uint32_t a, uint32_t b) |
| Calculate the tick-count between two counter values. More...
|
|
static RTC & | instance (int idx) |
| Reference the abstraction instance for a specific peripheral instance. More...
|
|
Wrapper around the nRF51 RTC peripheral.
- Note
- When a soft device is used RTC0 is restricted to the soft device. RTC1 is available to applications, but is probably taken by clock::uptime.
◆ counter_delta()
constexpr static unsigned int nrfcxx::periph::RTC::counter_delta |
( |
uint32_t |
a, |
|
|
uint32_t |
b |
|
) |
| |
|
inlinestaticconstexpr |
Calculate the tick-count between two counter values.
- Returns
- The value that when added to counter value
a
would produce counter value b
.
- Note
a
and b
are assumed to be 24-bit counter values; if bits are set outside counter_mask the result may be incorrect.
◆ instance()
static RTC& nrfcxx::periph::RTC::instance |
( |
int |
idx | ) |
|
|
static |
Reference the abstraction instance for a specific peripheral instance.
- Parameters
-
idx | the peripheral instance desired. |
- Warning
- If
idx
specifies a peripheral instance that does not exist on the device the system will reset into failsafe mode with FailSafeCode::NO_SUCH_PERIPHERAL.
The documentation for this class was generated from the following file: