Gpio
implementation for STM32.
More...
#include <stm32gpio.h>
Gpio
implementation for STM32.
Definition at line 22 of file stm32gpio.h.
◆ Stm32Gpio() [1/2]
semf::Stm32Gpio::Stm32Gpio |
( |
GPIO_TypeDef * |
port, |
|
|
uint16_t |
pin |
|
) |
| |
Constructor.
- Parameters
-
port | Port of GPIO. |
pin | Pin of GPIO. |
Definition at line 16 of file stm32gpio.cpp.
◆ Stm32Gpio() [2/2]
semf::Stm32Gpio::Stm32Gpio |
( |
const Stm32Gpio & |
other | ) |
|
|
explicitdelete |
◆ ~Stm32Gpio()
virtual semf::Stm32Gpio::~Stm32Gpio |
( |
| ) |
|
|
virtualdefault |
◆ direction()
Returns the direction setting of a GPIO.
- Returns
INPUT
or OUTPUT
.
Implements semf::Gpio.
Definition at line 50 of file stm32gpio.cpp.
◆ pin()
uint16_t semf::Stm32Gpio::pin |
( |
| ) |
const |
|
protected |
Returns pin number.
- Returns
- Pin number.
Definition at line 148 of file stm32gpio.cpp.
◆ pinNumberToIOPosition()
uint16_t semf::Stm32Gpio::pinNumberToIOPosition |
( |
uint16_t |
pin | ) |
const |
|
protected |
Returns the io position based on the pin number.
- Parameters
-
pin | Number of pin, given by STM HAL. |
- Returns
- Bit position to set IO registers.
Definition at line 153 of file stm32gpio.cpp.
◆ port() [1/2]
GPIO_TypeDef * semf::Stm32Gpio::port |
( |
| ) |
|
|
protected |
Returns the GPIO handler.
- Returns
- Pointer to the GPIO handler.
Definition at line 143 of file stm32gpio.cpp.
◆ port() [2/2]
GPIO_TypeDef * semf::Stm32Gpio::port |
( |
| ) |
const |
|
protected |
Returns the GPIO handler.
- Returns
- Pointer to the GPIO handler.
Definition at line 138 of file stm32gpio.cpp.
◆ pullUpPullDown()
Returns the pullup or pulldown setting of a GPIO.
- Returns
NoPullupPulldown
, Pullup
or Pulldown.
Implements semf::Gpio.
Definition at line 93 of file stm32gpio.cpp.
◆ reset()
void semf::Stm32Gpio::reset |
( |
| ) |
|
|
overridevirtual |
◆ set()
void semf::Stm32Gpio::set |
( |
| ) |
|
|
overridevirtual |
◆ setDirection()
void semf::Stm32Gpio::setDirection |
( |
Direction |
direction | ) |
|
|
overridevirtual |
Sets the direction of a GPIO.
- Parameters
-
direction | direction to set. |
Implements semf::Gpio.
Definition at line 63 of file stm32gpio.cpp.
◆ setPullUpPullDown()
void semf::Stm32Gpio::setPullUpPullDown |
( |
PullUpPullDown |
pullUpPullDown | ) |
|
|
overridevirtual |
Sets the pullup or pulldown setting of a GPIO.
- Parameters
-
pullUpPullDown | pullup/pulldown for setting up. |
Implements semf::Gpio.
Definition at line 113 of file stm32gpio.cpp.
◆ state()
bool semf::Stm32Gpio::state |
( |
| ) |
const |
|
overridevirtual |
Returns the current state of the pin.
- Returns
true
for high level, false
for low level.
Implements semf::Gpio.
Definition at line 34 of file stm32gpio.cpp.