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

#include "distortos/chip/ChipOutputPin.hpp"

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

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 ()=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

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

ChipOutputPin's constructor.

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

Member Function Documentation

◆ get()

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

Implements distortos::devices::InputPin.

Here is the call graph for this function:

◆ getInvertedMode()

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

◆ set()

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

Sets state of pin.

Parameters
[in]stateis the new state of pin

Implements distortos::devices::OutputPin.

Here is the call graph for this function:

◆ setInvertedMode()

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

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

◆ pin_

Pin distortos::chip::ChipOutputPin::pin_
private

identifier of pin


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