Input Pin#
Hardware Interface#
Defined in namespace hal
#include <libhal/input_pin.hpp>
-
class input_pin#
Digital input pin hardware abstraction interface.
Use this to read a pin and determine if the voltage on it is HIGH or LOW.
Subclassed by hal::inert_input_pin, hal::lpc40::input_pin, hal::mock::input_pin, hal::mock_input_pin, hal::soft::inert_input_pin, hal::soft::input_pin_inverter, hal::stm32f1::input_pin, hal::stm32f411::input_pin
Public Functions
-
inline void configure(settings const &p_settings)#
Configure the input pin to match the settings supplied.
- Parameters:
p_settings – - settings to apply to input pin
- Throws:
hal::operation_not_supported – - if the settings could not be achieved.
-
inline bool level()#
Read the state of the input pin.
- Returns:
bool - true indicates HIGH voltage level and false indicates LOW voltage level
-
struct settings#
Generic settings for input pins.
Public Members
-
pin_resistor resistor = pin_resistor::pull_up#
Pull resistor for an input pin.
-
pin_resistor resistor = pin_resistor::pull_up#
-
inline void configure(settings const &p_settings)#
Utilities#
Defined in namespace hal
#include <libhal-util/input_pin.hpp>
- group InputPin