distortos  v0.4.0
object-oriented C++ RTOS for microcontrollers
distortos::chip::ChipInputPin Class Reference

#include <ChipInputPin.hpp>

Inheritance diagram for distortos::chip::ChipInputPin:
Collaboration diagram for distortos::chip::ChipInputPin:

Public Member Functions

 ChipInputPin (Pin pin, PinPull pull={}, bool inverted={})
 ChipInputPin's constructor. More...
bool get () const override
- Public Member Functions inherited from distortos::devices::InputPin
virtual ~InputPin ()=0
 InputPin's destructor. More...

Protected Member Functions

bool getInvertedMode () const
void setInvertedMode (const bool inverted)
 Enables or disables inverted mode. More...

Private Attributes

Pin pin_
 identifier of pin More...
bool inverted_
 selects whether the pin is inverted (true) or not (false) More...

Detailed Description

ChipInputPin class is a single input pin of GPIOv2 in STM32

Constructor & Destructor Documentation

◆ ChipInputPin()

distortos::chip::ChipInputPin::ChipInputPin ( Pin  pin,
PinPull  pull = {},
bool  inverted = {} 

ChipInputPin's constructor.

[in]pinis the identifier of pin
[in]pullis the desired pull-up/pull-down configuration of pin, default - PinPull::none
[in]invertedselects whether the pin is inverted (true) - get() returns true when GPIO state is low and false when GPIO state is high - or not (false), default - false, not inverted
Here is the call graph for this function:

Member Function Documentation

◆ get()

bool distortos::chip::ChipInputPin::get ( ) const
current state of pin

Implements distortos::devices::InputPin.

Here is the call graph for this function:

◆ getInvertedMode()

bool distortos::chip::ChipInputPin::getInvertedMode ( ) const
true if inverted mode is enabled, false otherwise

◆ setInvertedMode()

void distortos::chip::ChipInputPin::setInvertedMode ( const bool  inverted)

Enables or disables inverted mode.

[in]invertedselects whether the pin is inverted (true) or not (false)

Member Data Documentation

◆ inverted_

bool distortos::chip::ChipInputPin::inverted_

selects whether the pin is inverted (true) or not (false)

◆ pin_

Pin distortos::chip::ChipInputPin::pin_

identifier of pin

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