distortos  v0.7.0
object-oriented C++ RTOS for microcontrollers
ChipInputPin.hpp
Go to the documentation of this file.
1 
12 #ifndef SOURCE_CHIP_STM32_PERIPHERALS_GPIOV2_INCLUDE_DISTORTOS_CHIP_CHIPINPUTPIN_HPP_
13 #define SOURCE_CHIP_STM32_PERIPHERALS_GPIOV2_INCLUDE_DISTORTOS_CHIP_CHIPINPUTPIN_HPP_
14 
16 
18 
19 namespace distortos
20 {
21 
22 namespace chip
23 {
24 
32 {
33 public:
34 
44  explicit ChipInputPin(Pin pin, PinPull pull = {}, bool inverted = {});
45 
50  bool get() const override;
51 
52 protected:
53 
58  bool getInvertedMode() const
59  {
60  return inverted_;
61  }
62 
69  void setInvertedMode(const bool inverted)
70  {
71  inverted_ = inverted;
72  }
73 
74 private:
75 
78 
80  bool inverted_;
81 };
82 
83 } // namespace chip
84 
85 } // namespace distortos
86 
87 #endif // SOURCE_CHIP_STM32_PERIPHERALS_GPIOV2_INCLUDE_DISTORTOS_CHIP_CHIPINPUTPIN_HPP_
bool get() const override
Definition: STM32-GPIOv2-ChipInputPin.cpp:31
void setInvertedMode(const bool inverted)
Enables or disables inverted mode.
Definition: ChipInputPin.hpp:69
Pin pin_
identifier of pin
Definition: ChipInputPin.hpp:77
ChipInputPin(Pin pin, PinPull pull={}, bool inverted={})
ChipInputPin's constructor.
Definition: STM32-GPIOv2-ChipInputPin.cpp:24
Header for GPIOv2 functions for STM32.
InputPin class header.
bool inverted_
selects whether the pin is inverted (true) or not (false)
Definition: ChipInputPin.hpp:80
PinPull
all possible pull-up/pull-down configurations of pin
Definition: STM32-GPIOv2.hpp:552
Top-level namespace of distortos project.
Definition: buttons.hpp:33
Definition: InputPin.hpp:27
Definition: ChipInputPin.hpp:31
bool getInvertedMode() const
Definition: ChipInputPin.hpp:58
Pin
identifier of single pin - combined address of GPIO port with pin number
Definition: STM32-GPIOv2.hpp:74