Skip to content

Commit

Permalink
stm32/cyw43_configport: Provide cyw43_hal_pin_config_irq_falling func.
Browse files Browse the repository at this point in the history
Signed-off-by: Damien George <[email protected]>
  • Loading branch information
dpgeorge committed Apr 26, 2023
1 parent 41a2415 commit a14e79b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ports/stm32/cyw43_configport.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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));
}
Expand Down
1 change: 1 addition & 0 deletions ports/stm32/extint.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a14e79b

Please sign in to comment.