Zephyr C++ Toolkit
Loading...
Searching...
No Matches
GpioReal.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <functional>
4
5#include <zephyr/drivers/gpio.h>
6
7#include "IGpio.hpp"
8
9namespace zct {
10
11// Forward declaration of the GpioReal class.
12class GpioReal;
13
24
32class GpioReal : public IGpio {
33public:
34
44
48 ~GpioReal();
49
57 void setPhysical(bool value) override;
58
66 bool getPhysical() const override;
67
74 void configureInterrupt(InterruptMode interruptMode, std::function<void()> callback) override;
75
76protected:
82 void configurePinBasedOnSettings() override;
83
94 static void interruptCallback(const struct device* dev, struct gpio_callback* cb, gpio_port_pins_t pins);
95
99 const struct gpio_dt_spec* m_spec;
100
107};
108
109} // namespace zct
Definition GpioReal.hpp:32
GpioCallbackDataAndObject m_gpioCallbackDataAndObject
Definition GpioReal.hpp:106
~GpioReal()
Destroy the GPIO. Does nothing.
Definition GpioReal.cpp:20
void setPhysical(bool value) override
Definition GpioReal.cpp:22
static void interruptCallback(const struct device *dev, struct gpio_callback *cb, gpio_port_pins_t pins)
Definition GpioReal.cpp:107
void configurePinBasedOnSettings() override
Definition GpioReal.cpp:36
const struct gpio_dt_spec * m_spec
Definition GpioReal.hpp:99
void configureInterrupt(InterruptMode interruptMode, std::function< void()> callback) override
Definition GpioReal.cpp:69
bool getPhysical() const override
Definition GpioReal.cpp:29
Definition IGpio.hpp:7
LogicMode
Definition IGpio.hpp:20
virtual bool get() const
Definition IGpio.cpp:31
InterruptMode
Definition IGpio.hpp:34
Direction
Definition IGpio.hpp:10
Definition Mutex.hpp:6
Definition GpioReal.hpp:20
GpioReal * m_obj
Definition GpioReal.hpp:21
struct gpio_callback m_gpioCallbackData
Definition GpioReal.hpp:22