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

#include "distortos/chip/ChipInputPin.hpp"

Inheritance diagram for distortos::chip::ChipInputPin:
[legend]
Collaboration diagram for distortos::chip::ChipInputPin:
[legend]

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 ()=default
 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 = {} 
)
explicit

ChipInputPin's constructor.

Parameters
[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

Member Function Documentation

◆ get()

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

Implements distortos::devices::InputPin.

Here is the call graph for this function:

◆ getInvertedMode()

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

◆ setInvertedMode()

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

Enables or disables inverted mode.

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

Member Data Documentation

◆ inverted_

bool distortos::chip::ChipInputPin::inverted_
private

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

◆ pin_

Pin distortos::chip::ChipInputPin::pin_
private

identifier of pin


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