From 7be22a53613ab7c44c2b6f580ba1d80e73fd8ae0 Mon Sep 17 00:00:00 2001 From: Ramya Subramanyam Date: Sat, 7 Jun 2025 16:14:51 +0530 Subject: [PATCH] cores/psoc6: ./docs: Add interrupt modes high and low. Signed-off-by: Ramya Subramanyam --- cores/psoc6/interrupts.c | 2 ++ docs/arduino-deviations.rst | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/cores/psoc6/interrupts.c b/cores/psoc6/interrupts.c index a18b32e9..259270d1 100644 --- a/cores/psoc6/interrupts.c +++ b/cores/psoc6/interrupts.c @@ -41,10 +41,12 @@ void attachInterrupt(pin_size_t interruptNumber, voidFuncPtr callback, PinStatus break; case RISING: + case HIGH: event = CYHAL_GPIO_IRQ_RISE; break; case FALLING: + case LOW: event = CYHAL_GPIO_IRQ_FALL; break; diff --git a/docs/arduino-deviations.rst b/docs/arduino-deviations.rst index 55e4a5c7..f1b9fd68 100644 --- a/docs/arduino-deviations.rst +++ b/docs/arduino-deviations.rst @@ -8,6 +8,21 @@ Digital IO Once a pin is configured using pinMode as GPIO pins, it may no longer be available for use with any other peripherals (e.g., PWM, I2C, SPI, GPIO, etc.). + +Interrupts +---------- + +.. code-block:: cpp + + void attachInterrupt(pin_size_t interruptNumber, voidFuncPtr callback, PinStatus mode) + +Interrupts are triggered only for the RISING or FALLING edge by the hardware. The LOW and HIGH modes are not natively supported but are internally mapped for compatibility: + +- LOW mode is mapped to FALLING edge detection. +- HIGH mode is mapped to RISING edge detection. + +This mapping simplifies compatibility but may not replicate the exact behavior of other Arduino platforms that natively support LOW and HIGH interrupt levels. + Analog IO ---------