Browse Source

stm32/cyw43_configport: Provide cyw43_hal_pin_config_irq_falling func.

Signed-off-by: Damien George <damien@micropython.org>
pull/10955/merge
Damien George 2 years ago
parent
commit
a14e79bcfb
  1. 7
      ports/stm32/cyw43_configport.h
  2. 1
      ports/stm32/extint.h

7
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));
}

1
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);

Loading…
Cancel
Save