nrfcxx
0.1.0
C++-17 Framework for Nordic nRF5 Devices
|
Extension of generic_pin using an owned pin_reference. More...
#include <nrfcxx/gpio.hpp>
Public Member Functions | |
gpio_pin (int psel) | |
Construct the instance. More... | |
const pin_reference & | implementation () 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. | |
Extension of generic_pin using an owned pin_reference.
|
inline |
Construct the instance.
psel | as with pin_reference. Note that this must be a valid pin selector on the device. |
|
inlineoverridevirtual |
Return implementation-specific information about the pin configuration.
Values should be as with pin_cnf
in configure().
Reimplemented from nrfcxx::gpio::generic_pin.
|
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.
pin_cnf | a description of the desired pin configuration. This should |
Reimplemented from nrfcxx::gpio::generic_pin.
|
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.