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

#include <ChipOutputPin.hpp>

Inheritance diagram for distortos::chip::ChipOutputPin:
Collaboration diagram for distortos::chip::ChipOutputPin:

Public Member Functions

 ChipOutputPin (Pin pin, bool openDrain={}, PinOutputSpeed outputSpeed={}, PinPull pull={}, bool initialState={}, bool inverted={})
 ChipOutputPin's constructor. More...
bool get () const override
void set (bool state) override
 Sets state of pin. More...
- 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

ChipOutputPin class is a single output pin of GPIOv2 in STM32

Constructor & Destructor Documentation

◆ ChipOutputPin()

distortos::chip::ChipOutputPin::ChipOutputPin ( Pin  pin,
bool  openDrain = {},
PinOutputSpeed  outputSpeed = {},
PinPull  pull = {},
bool  initialState = {},
bool  inverted = {} 

ChipOutputPin's constructor.

[in]pinis the identifier of pin
[in]openDrainis the desired output type of pin: push-pull (false) or open-drain (true), default - push-pull (false)
[in]outputSpeedis the desired output speed of pin, default - PinOutputSpeed::low
[in]pullis the desired pull-up/pull-down configuration of pin, default - PinPull::none
[in]initialStateis the initial state of pin, default - false
[in]invertedselects whether the pin is inverted (true) - get() returns true when GPIO state is low and false when GPIO state is high, set() sets GPIO state to low when argument is true and to high when argument is false - or not (false), default - false, not inverted
Here is the call graph for this function:

Member Function Documentation

◆ get()

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

Implements distortos::devices::InputPin.

Here is the call graph for this function:

◆ getInvertedMode()

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

◆ set()

void distortos::chip::ChipOutputPin::set ( bool  state)

Sets state of pin.

[in]stateis the new state of pin

Implements distortos::devices::OutputPin.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setInvertedMode()

void distortos::chip::ChipOutputPin::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::ChipOutputPin::inverted_

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

◆ pin_

Pin distortos::chip::ChipOutputPin::pin_

identifier of pin

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