tutrc_harurobo_lib
読み取り中…
検索中…
一致する文字列を見つけられません
include
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
9
namespace
tutrc_harurobo_lib
{
10
11
class
GPIO
{
12
public
:
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
19
private
:
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
tutrc_harurobo_lib::GPIO
Definition
gpio.hpp:11
tutrc_harurobo_lib::GPIO::read
bool read()
tutrc_harurobo_lib::GPIO::write
void write(bool state)
tutrc_harurobo_lib::GPIO::set_exti_callback
void set_exti_callback(std::function< void()> &&callback)
tutrc_harurobo_lib::GPIO::init
bool init(GPIO_TypeDef *port, uint16_t pin)
tutrc_harurobo_lib::GPIO::toggle
void toggle()
tutrc_harurobo_lib
Definition
bno055.hpp:10
構築:
1.12.0