Smart Knob Controller
gpio.h
1/*
2 * gpio.h
3 *
4 * Created on: Jun 4, 2025
5 * Author: nickl
6 *
7 */
8
9#ifndef INC_GPIO_H_
10#define INC_GPIO_H_
11
12#include "stm32f4xx_hal.h"
13
17class GPIO {
18public:
24 GPIO(GPIO_TypeDef* port, uint16_t pin);
25
30 void write(GPIO_PinState state) const;
32 void high() const;
34 void low() const;
35
36private:
37 GPIO_TypeDef* port;
38 uint16_t pin;
39};
40
41#endif /* INC_GPIO_H_ */
void low() const
Sets the GPIO pin low.
Definition gpio.cpp:24
void write(GPIO_PinState state) const
Writes a logic level to the GPIO pin.
Definition gpio.cpp:16
void high() const
Sets the GPIO pin high.
Definition gpio.cpp:20
GPIO(GPIO_TypeDef *port, uint16_t pin)
Constructs a GPIO object.
Definition gpio.cpp:12