stm32: Add definitions required for lwIP version of Wiznet NIC.

This commit is contained in:
robert-hh 2022-08-04 20:19:57 +02:00 committed by Damien George
parent 717924001d
commit c3305c49e4
3 changed files with 16 additions and 0 deletions

View File

@ -96,11 +96,19 @@ static inline mp_uint_t mp_hal_ticks_cpu(void) {
#define mp_hal_pin_od_high(p) mp_hal_pin_high(p)
#define mp_hal_pin_read(p) (((p)->gpio->IDR >> (p)->pin) & 1)
#define mp_hal_pin_write(p, v) ((v) ? mp_hal_pin_high(p) : mp_hal_pin_low(p))
#define mp_hal_pin_interrupt(pin, handler, trigger, hard) extint_register_pin(pin, trigger, hard, handler)
enum mp_hal_pin_interrupt_trigger {
MP_HAL_PIN_TRIGGER_NONE,
MP_HAL_PIN_TRIGGER_FALL = GPIO_MODE_IT_FALLING,
MP_HAL_PIN_TRIGGER_RISE = GPIO_MODE_IT_RISING,
};
void mp_hal_gpio_clock_enable(GPIO_TypeDef *gpio);
void mp_hal_pin_config(mp_hal_pin_obj_t pin, uint32_t mode, uint32_t pull, uint32_t alt);
bool mp_hal_pin_config_alt(mp_hal_pin_obj_t pin, uint32_t mode, uint32_t pull, uint8_t fn, uint8_t unit);
void mp_hal_pin_config_speed(mp_hal_pin_obj_t pin_obj, uint32_t speed);
void extint_register_pin(const pin_obj_t *pin, uint32_t mode, bool hard_irq, mp_obj_t callback_obj);
enum {
MP_HAL_MAC_WLAN0 = 0,

View File

@ -50,6 +50,11 @@
#if MICROPY_PY_NETWORK_WIZNET5K
void wiznet5k_poll(void);
void wiznet5k_deinit(void);
void wiznet5k_try_poll(void) {
pendsv_schedule_dispatch(PENDSV_DISPATCH_WIZNET, wiznet5k_poll);
}
#endif
u32_t sys_now(void) {

View File

@ -35,6 +35,9 @@ enum {
#if MICROPY_PY_NETWORK_CYW43
PENDSV_DISPATCH_CYW43,
#endif
#if MICROPY_PY_NETWORK_WIZNET5K
PENDSV_DISPATCH_WIZNET,
#endif
#endif
#if MICROPY_PY_BLUETOOTH && !MICROPY_PY_BLUETOOTH_USE_SYNC_EVENTS
PENDSV_DISPATCH_BLUETOOTH_HCI,