nrfcxx  0.1.0
C++-17 Framework for Nordic nRF5 Devices
Public Member Functions
nrfcxx::gpio::gpio_pin Class Reference

Extension of generic_pin using an owned pin_reference. More...

#include <nrfcxx/gpio.hpp>

Inheritance diagram for nrfcxx::gpio::gpio_pin:
nrfcxx::gpio::generic_pin

Public Member Functions

 gpio_pin (int psel)
 Construct the instance. More...
 
const pin_referenceimplementation () const
 Access the underlying pin_reference instance.
 
bool valid () const override
 Indicate whether the pin is functional. More...
 
void set () override
 Set the pin to drive the output high.
 
void clear () override
 Set the pin to drive the output low.
 
void toggle () override
 Toggle the pin drive state.
 
unsigned int configuration () const override
 Return implementation-specific information about the pin configuration. More...
 
void configure (unsigned int pin_cnf) override
 Set the PIN_CNF entry for the pin if the reference is valid. More...
 
bool read () const override
 Return the input signal observed at the pin, or zero if the reference is invalid.
 
bool is_set () const override
 Return true iff the pin is valid and is configured to drive the output high.
 

Detailed Description

Extension of generic_pin using an owned pin_reference.

Constructor & Destructor Documentation

◆ gpio_pin()

nrfcxx::gpio::gpio_pin::gpio_pin ( int  psel)
inline

Construct the instance.

Parameters
pselas with pin_reference. Note that this must be a valid pin selector on the device.

Member Function Documentation

◆ configuration()

unsigned int nrfcxx::gpio::gpio_pin::configuration ( ) const
inlineoverridevirtual

Return implementation-specific information about the pin configuration.

Values should be as with pin_cnf in configure().

Reimplemented from nrfcxx::gpio::generic_pin.

◆ configure()

void nrfcxx::gpio::gpio_pin::configure ( unsigned int  pin_cnf)
inlineoverridevirtual

Set the PIN_CNF entry for the pin if the reference is valid.

This API should always use the standard bit encoding of DIR, INPUT, PULL, DRIVE, and SENSE of Nordic nRF5 GPIO peripherals, even if the underlying implementation is a non-Nordic system.

Subclasses should provide access to any contained instance of a non-Nordic pin reference if the providing implementation requires configuration that is not supported in the Nordic GPIO bit encoding.

Parameters
pin_cnfa description of the desired pin configuration. This should

Reimplemented from nrfcxx::gpio::generic_pin.

◆ valid()

bool nrfcxx::gpio::gpio_pin::valid ( ) const
inlineoverridevirtual

Indicate whether the pin is functional.

Base class returns false. Subclasses should override to return true in cases where invoking the other methods provides or affects pin state.

Reimplemented from nrfcxx::gpio::generic_pin.


The documentation for this class was generated from the following file: