30 lines
622 B
C++
30 lines
622 B
C++
/*
|
|
* GPIO_Pin_STM32.hpp
|
|
*
|
|
* Created on: Feb 10, 2024
|
|
* Author: Gabriel
|
|
*/
|
|
|
|
#ifndef SRC_COMPONENTS_GPIO_PIN_STM32_HPP_
|
|
#define SRC_COMPONENTS_GPIO_PIN_STM32_HPP_
|
|
|
|
#include "main.h"
|
|
#include "GPIO_Pin.hpp"
|
|
|
|
class GPIO_Pin_STM32 : public GPIO_Pin {
|
|
public:
|
|
GPIO_Pin_STM32(GPIO_TypeDef* gpio_port, uint16_t gpio_pin);
|
|
virtual ~GPIO_Pin_STM32();
|
|
int32_t init();
|
|
int32_t read(uint8_t* state);
|
|
int32_t write(uint8_t state);
|
|
int32_t set();
|
|
int32_t reset();
|
|
int32_t toggle();
|
|
private:
|
|
GPIO_TypeDef* gpio_port;
|
|
uint16_t gpio_pin;
|
|
};
|
|
|
|
#endif /* SRC_COMPONENTS_GPIO_PIN_STM32_HPP_ */
|