Skip to content

Class hal::input_pin

ClassList > hal > input_pin

Digital input pin hardware abstraction interface. More...

  • #include <input_pin.hpp>

Inherited by the following classes: hal::lpc40::input_pin, hal::mock::input_pin, hal::soft::inert_input_pin, hal::soft::input_pin_inverter

Classes

Type Name
struct level_t
Input pin level reading structure.
struct settings
Generic settings for input pins.

Public Functions

Type Name
status configure (const settings & p_settings)
Configure the input pin to match the settings supplied.
result< level_t > level ()
Read the state of the input pin.
virtual ~input_pin () = default

Detailed Description

Use this to read a pin and determine if the voltage on it is HIGH or LOW.

Public Functions Documentation

function configure

Configure the input pin to match the settings supplied.

inline status hal::input_pin::configure (
    const settings & p_settings
) 

Parameters:

  • p_settings - settings to apply to input pin

Returns:

status - success or failure

Exception:

  • std::errc::invalid_argument if the settings could not be achieved.

function level

Read the state of the input pin.

inline result< level_t > hal::input_pin::level () 

Returns:

result<bool> - true indicates HIGH voltage level and false indicates LOW voltage level

function ~input_pin

virtual hal::input_pin::~input_pin () = default

The documentation for this class was generated from the following file libraries/include/libhal/input_pin.hpp