add Chapter13
This commit is contained in:
19
Chapter13/lfs_raii/hal/gpio/inc/gpio.hpp
Normal file
19
Chapter13/lfs_raii/hal/gpio/inc/gpio.hpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user