[zephyr] implement ISRInternalGPIOPin::digital_write (#17601)

This commit is contained in:
Guanzhong Chen
2026-07-16 07:57:30 -04:00
committed by GitHub
parent d748c04b28
commit 2333e6eef5
+8
View File
@@ -173,6 +173,14 @@ bool IRAM_ATTR ISRInternalGPIOPin::digital_read() {
return bool(gpio_pin_get(arg->gpio, arg->pin % arg->gpio_size) != arg->inverted);
}
void IRAM_ATTR ISRInternalGPIOPin::digital_write(bool value) {
auto *arg = (zephyr::ISRPinArg *) this->arg_;
if (arg == nullptr || arg->gpio == nullptr) {
return;
}
gpio_pin_set(arg->gpio, arg->pin % arg->gpio_size, value != arg->inverted ? 1 : 0);
}
} // namespace esphome
#endif