Files
Cpp-in-Embedded-Systems/Chapter11/compile_time/hal/gpio/inc/gpio.hpp
Amar Mahmutbegovic f10d0ef610 add Chapter11
2024-09-22 16:52:43 +02:00

22 lines
426 B
C++

#pragma once
#include <cstdint>
#include <functional>
//#include <gpio_interrupt_handler.hpp>
namespace hal
{
class gpio
{
public:
gpio(const std::function<void()> & on_press = nullptr);
void execute_interrupt_handler() const;
[[nodiscard]] virtual bool is_interrupt_generated() const = 0;
virtual void clear_interrupt_flag() const = 0;
private:
std::function<void()> on_press_;
};
}; // namespace hal