tutrc_harurobo_lib
読み取り中…
検索中…
一致する文字列を見つけられません
gpio.hpp
[詳解]
1#pragma once
2
3#include "main.h"
4
5#include <cstdint>
6#include <functional>
7#include <unordered_map>
8
9namespace tutrc_harurobo_lib {
10
11class GPIO {
12public:
13 bool init(GPIO_TypeDef *port, uint16_t pin);
14 void write(bool state);
15 bool read();
16 void toggle();
17 void set_exti_callback(std::function<void()> &&callback);
18
19private:
20 GPIO_TypeDef *port_;
21 uint16_t pin_;
22 std::function<void()> exti_callback_;
23
24 static std::unordered_map<uint16_t, GPIO *> instances_;
25 friend void ::HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin);
26};
27
28} // namespace tutrc_harurobo_lib
Definition gpio.hpp:11
void write(bool state)
void set_exti_callback(std::function< void()> &&callback)
bool init(GPIO_TypeDef *port, uint16_t pin)
Definition bno055.hpp:10