From a14e79bcfbff83129b2e889332f5f1b8ce5c6c3e Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 26 Apr 2023 12:57:35 +1000 Subject: [PATCH] stm32/cyw43_configport: Provide cyw43_hal_pin_config_irq_falling func. Signed-off-by: Damien George --- ports/stm32/cyw43_configport.h | 7 +++++++ ports/stm32/extint.h | 1 + 2 files changed, 8 insertions(+) diff --git a/ports/stm32/cyw43_configport.h b/ports/stm32/cyw43_configport.h index b7137ef61e..4b6dde3c43 100644 --- a/ports/stm32/cyw43_configport.h +++ b/ports/stm32/cyw43_configport.h @@ -32,6 +32,7 @@ #include "py/mperrno.h" #include "py/mphal.h" #include "extmod/modnetwork.h" +#include "extint.h" #include "pendsv.h" #include "sdio.h" @@ -115,6 +116,12 @@ static inline void cyw43_delay_ms(uint32_t ms) { } } +static inline void cyw43_hal_pin_config_irq_falling(cyw43_hal_pin_obj_t pin, int enable) { + if (enable) { + extint_set(pin, GPIO_MODE_IT_FALLING); + } +} + static inline void cyw43_sdio_init(void) { sdio_init(NVIC_EncodePriority(NVIC_PRIORITYGROUP_4, 14, 0)); } diff --git a/ports/stm32/extint.h b/ports/stm32/extint.h index fddcc2ae7a..84eb876d8d 100644 --- a/ports/stm32/extint.h +++ b/ports/stm32/extint.h @@ -66,6 +66,7 @@ void extint_init0(void); uint extint_register(mp_obj_t pin_obj, uint32_t mode, uint32_t pull, mp_obj_t callback_obj, bool override_callback_obj); void extint_register_pin(const pin_obj_t *pin, uint32_t mode, bool hard_irq, mp_obj_t callback_obj); +void extint_set(const pin_obj_t *pin, uint32_t mode); void extint_enable(uint line); void extint_disable(uint line);