nrfcxx  0.1.0
C++-17 Framework for Nordic nRF5 Devices
Data Structures | Namespaces | Functions | Variables
contact.hpp File Reference

Abstraction of a dry contact monitor using nrfcxx::gpio::gpiote. More...

#include <type_traits>
#include <nrfcxx/clock.hpp>
#include <nrfcxx/gpio.hpp>
#include <nrfcxx/periph.hpp>

Go to the source code of this file.

Data Structures

class  nrfcxx::sensor::contact
 State and functionality related to monitoring dry contacts. More...
 
struct  nrfcxx::sensor::contact::state_type
 An aggregate capturing consistent contact state. More...
 

Namespaces

 nrfcxx
 Primary namespace for nrfcxx functionality.
 
 nrfcxx::sensor
 Namespace for abstractions of various sensors.
 

Functions

template<typename INTEGRAL >
constexpr INTEGRAL nrfcxx::sensor::contact_internal::ts_from_utt (INTEGRAL dur_utt)
 
template<typename INTEGRAL >
constexpr INTEGRAL nrfcxx::sensor::contact_internal::utt_from_ts (INTEGRAL dur_ts)
 

Variables

static constexpr auto nrfcxx::sensor::contact_internal::utt_per_ts = 256U
 Divisor to convert from uptime ticks to contact timestamp clock ticks. More...
 

Detailed Description

Abstraction of a dry contact monitor using nrfcxx::gpio::gpiote.

Variable Documentation

◆ utt_per_ts

constexpr auto nrfcxx::sensor::contact_internal::utt_per_ts = 256U
staticconstexpr

Divisor to convert from uptime ticks to contact timestamp clock ticks.

This is selected so the 24-bit reduced range uptime clock can be converted to a 16-bit contact timestamp clock with the same representational range.