nrfcxx
0.1.0
C++-17 Framework for Nordic nRF5 Devices
|
Go to the documentation of this file. 7 #ifndef NRFCXX_SENSOR_CONTACT_HPP 8 #define NRFCXX_SENSOR_CONTACT_HPP 11 #include <type_traits> 20 namespace contact_internal {
30 template <
typename INTEGRAL>
33 ts_from_utt (INTEGRAL dur_utt)
38 template <
typename INTEGRAL>
41 utt_from_ts (INTEGRAL dur_ts)
43 return dur_ts * utt_per_ts;
92 template <
typename INTEGRAL>
99 template <
typename INTEGRAL>
102 return contact_internal::utt_from_ts(dur_ts);
128 using duration_type = std::chrono::duration<timediff_type, std::ratio<1, TIMESTAMP_Hz>>;
136 template <
typename DurT = duration_type>
255 notify_fn notify =
nullptr,
256 bool collapse =
true)
const;
328 return {[
this](
auto sp)
330 gpiote_sense_bi_(sp);
352 gpiote_event_bi_(instance);
382 return (1U <<
psel) & nrf5::GPIO->IN;
422 state_type
volatile state_bi_;
mutex_irq< GPIOTE_IRQn > mutex_type
An RAII type for mutex access to state that must be protected from GPIOTE interrupts.
Definition: periph.hpp:741
Object used to manage event callbacks.
Definition: periph.hpp:766
constexpr static unsigned int Frequency_Hz
Frequency of the uptime clock as a symbolic constant.
Definition: clock.hpp:247
Core clock-related functionality.
Object used to manage sense callbacks.
Definition: periph.hpp:854
Class supporting GPIO task and event operations.
Definition: periph.hpp:639
nvic_BlockIRQ as a template type.
Definition: core.hpp:497
constexpr uint32_t PIN_CNF_RDONLY
GPIO pin configuration for input only.
Definition: gpio.hpp:22
Structure used to convey information about pin levels to sense_listener callbacks.
Definition: periph.hpp:672
static unsigned int now24()
Low 24 bits of the uptime counter.
Definition: clock.hpp:300
static uint64_t now()
Full-range uptime counter.
constexpr static int64_t from_ms(int64_t ms)
Convert integral milliseconds to uptime ticks (rounding down).
Definition: clock.hpp:422
Abstraction of Nordic device peripherals.
Primary namespace for nrfcxx functionality.
Definition: clock.hpp:17