9 static const char *
const TAG =
"esp8266";
26 return INPUT_PULLDOWN_16;
28 return OUTPUT_OPEN_DRAIN;
40 auto *arg =
new ISRPinArg{};
42 arg->inverted = inverted_;
47 uint8_t arduino_mode = 0;
50 arduino_mode = inverted_ ? FALLING : RISING;
53 arduino_mode = inverted_ ? RISING : FALLING;
56 arduino_mode = CHANGE;
59 arduino_mode = inverted_ ? ONHIGH : ONLOW;
62 arduino_mode = inverted_ ? ONLOW : ONHIGH;
66 attachInterruptArg(pin_, func, arg, arduino_mode);
69 pinMode(pin_, flags_to_mode(flags, pin_));
74 snprintf(buffer,
sizeof(buffer),
"GPIO%u", pin_);
79 return bool(digitalRead(pin_)) != inverted_;
82 digitalWrite(pin_, value != inverted_ ? 1 : 0);
88 using namespace esp8266;
91 auto *arg =
reinterpret_cast<ISRPinArg *
>(arg_);
92 return bool(digitalRead(arg->pin)) != arg->inverted;
95 auto *arg =
reinterpret_cast<ISRPinArg *
>(arg_);
96 digitalWrite(arg->pin, value != arg->inverted ? 1 : 0);
99 auto *arg =
reinterpret_cast<ISRPinArg *
>(arg_);
100 GPIO_REG_WRITE(GPIO_STATUS_W1TC_ADDRESS, 1UL << arg->pin);
103 auto *arg =
reinterpret_cast<ISRPinArg *
>(arg_);
104 pinMode(arg->pin, flags_to_mode(flags, arg->pin));
109 #endif // USE_ESP8266 Copy of GPIOPin that is safe to use from ISRs (with no virtual functions)
void detach_interrupt() const override
void pin_mode(gpio::Flags flags) override
bool digital_read() override
void pin_mode(gpio::Flags flags)
ISRInternalGPIOPin to_isr() const override
void digital_write(bool value) override
std::string dump_summary() const override
Implementation of SPI Controller mode.
void digital_write(bool value)
void attach_interrupt(void(*func)(void *), void *arg, gpio::InterruptType type) const override