3#include <zephyr/drivers/gpio.h>
9static const char *
const TAG =
"zephyr";
11static gpio_flags_t flags_to_mode(
gpio::Flags flags,
bool inverted,
bool value) {
18 if (value != inverted) {
19 ret |= GPIO_OUTPUT_INIT_HIGH;
21 ret |= GPIO_OUTPUT_INIT_LOW;
28 ret |= GPIO_PULL_DOWN;
31 ret |= GPIO_OPEN_DRAIN;
42 auto *arg =
new ISRPinArg{};
43 arg->pin = this->
pin_;
53 if (!device_is_ready(this->
gpio_)) {
54 ESP_LOGE(TAG,
"gpio %u is not ready.", this->
pin_);
61 if (
nullptr == this->
gpio_) {
67 ESP_LOGE(TAG,
"gpio %u cannot be configured %d.", this->
pin_, ret);
76 if (
nullptr == this->
gpio_) {
86 if (
nullptr == this->
gpio_) {
Copy of GPIOPin that is safe to use from ISRs (with no virtual functions)
void digital_write(bool value) override
void attach_interrupt(void(*func)(void *), void *arg, gpio::InterruptType type) const override
const char * pin_name_prefix_
bool digital_read() override
size_t dump_summary(char *buffer, size_t len) const override
ISRInternalGPIOPin to_isr() const override
void detach_interrupt() const override
void pin_mode(gpio::Flags flags) override
Providing packet encoding functions for exchanging data with a remote host.