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

Core GPIO functionality. More...

#include <nrfcxx/impl.hpp>

Go to the source code of this file.

Data Structures

class  nrfcxx::gpio::instr_psel< PSEL >
 Instrumentation through toggling GPIOs. More...
 
class  nrfcxx::gpio::instr_psel_scoped< INSTR_PSEL >
 RAII class for scoped instrumentation. More...
 
class  nrfcxx::gpio::pin_reference
 Generalized reference to a GPIO pin using a global psel ordinal. More...
 
class  nrfcxx::gpio::generic_pin
 Class supporting a generic GPIO pin interface. More...
 
class  nrfcxx::gpio::gpio_pin
 Extension of generic_pin using an owned pin_reference. More...
 
class  nrfcxx::gpio::active_signal< ACTIVE_HIGH >
 Wrapper supporting GPIO control of output signals by explicit or scoped assertion. More...
 
struct  nrfcxx::gpio::active_signal< ACTIVE_HIGH >::scoped_assert
 RAII instance used to assert the signal within a scope. More...
 

Namespaces

 nrfcxx
 Primary namespace for nrfcxx functionality.
 
 nrfcxx::gpio
 Abstractions and constants around GPIO capability.
 

Typedefs

using nrfcxx::gpio::active_low = active_signal< false >
 Alias type used for CSn, RESETn, and other active low output signals.
 

Functions

static constexpr int nrfcxx::gpio::instance_for_psel (int psel)
 Determine the GPIO instance associated with a given pin selector. More...
 
template<typename INSTR_PSEL >
instr_psel_scoped< INSTR_PSEL > nrfcxx::gpio::make_scoped_instr (const INSTR_PSEL &instance, bool start_set=true)
 Create an RAII-style object that instruments a code block. More...
 
constexpr uint32_t nrfcxx::gpio::pin_config (unsigned int dir=GPIO_PIN_CNF_DIR_Input, unsigned int input=GPIO_PIN_CNF_INPUT_Disconnect, unsigned int pull=GPIO_PIN_CNF_PULL_Disabled, unsigned int drive=GPIO_PIN_CNF_DRIVE_S0S1, unsigned int sense=GPIO_PIN_CNF_SENSE_Disabled)
 Helper to build up a GPIO PIN_CNF. More...
 
template<typename mutex_type = null_mutex>
void nrfcxx::gpio::clear_sense (unsigned int psel)
 Function to clear the SENSE field of a GPIO pin configuration. More...
 
unsigned int nrfcxx::gpio::update_sense_bi (unsigned int psel, bool assume_change=false)
 Function to set the SENSE field of a GPIO pin configuration to detect a change in the input signal. More...
 

Variables

constexpr uint32_t nrfcxx::gpio::PIN_CNF_RDONLY
 GPIO pin configuration for input only. More...
 
constexpr uint32_t nrfcxx::gpio::PIN_CNF_WRONLY
 GPIO pin configuration for output only. More...
 
constexpr uint32_t nrfcxx::gpio::PIN_CNF_RDWR
 GPIO pin configuration for input and output. More...
 
constexpr uint32_t nrfcxx::gpio::PIN_CNF_PWRUP
 GPIO pin configuration at power-up. More...
 
constexpr uint32_t nrfcxx::gpio::PIN_CNF_PULLUP = (GPIO_PIN_CNF_PULL_Pullup << GPIO_PIN_CNF_PULL_Pos)
 Addition to no-pull GPIO pin configuration to pull up.
 
constexpr uint32_t nrfcxx::gpio::PIN_CNF_PULLDOWN = (GPIO_PIN_CNF_PULL_Pulldown << GPIO_PIN_CNF_PULL_Pos)
 Addition to no-pull GPIO pin configuration to pull down.
 
constexpr uint32_t nrfcxx::gpio::PIN_CNF_ACTIVE_LOW_NOPULL
 GPIO pin configuration to detect active-low signals without pulling to inactive. More...
 
constexpr uint32_t nrfcxx::gpio::PIN_CNF_ACTIVE_LOW = (PIN_CNF_ACTIVE_LOW_NOPULL | PIN_CNF_PULLUP)
 GPIO pin configuration to detect active-low signals with pull to inactive. More...
 
constexpr uint32_t nrfcxx::gpio::PIN_CNF_ACTIVE_HIGH_NOPULL
 GPIO pin configuration to detect active-high signals without pulling to inactive. More...
 
constexpr uint32_t nrfcxx::gpio::PIN_CNF_ACTIVE_HIGH = (PIN_CNF_ACTIVE_HIGH_NOPULL | PIN_CNF_PULLDOWN)
 GPIO pin configuration to detect active-low signals with pull to inactive. More...
 

Detailed Description

Core GPIO functionality.