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

This commit is contained in:
Guanzhong Chen
2026-07-21 09:27:55 +12:00
committed by Jesse Hills
parent 24a8634a4b
commit 718b04c15a
+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