stm32: Add definitions required for lwIP version of Wiznet NIC.
This commit is contained in:
parent
717924001d
commit
c3305c49e4
|
@ -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_od_high(p) mp_hal_pin_high(p)
|
||||||
#define mp_hal_pin_read(p) (((p)->gpio->IDR >> (p)->pin) & 1)
|
#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_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_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);
|
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);
|
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 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 {
|
enum {
|
||||||
MP_HAL_MAC_WLAN0 = 0,
|
MP_HAL_MAC_WLAN0 = 0,
|
||||||
|
|
|
@ -50,6 +50,11 @@
|
||||||
|
|
||||||
#if MICROPY_PY_NETWORK_WIZNET5K
|
#if MICROPY_PY_NETWORK_WIZNET5K
|
||||||
void wiznet5k_poll(void);
|
void wiznet5k_poll(void);
|
||||||
|
void wiznet5k_deinit(void);
|
||||||
|
|
||||||
|
void wiznet5k_try_poll(void) {
|
||||||
|
pendsv_schedule_dispatch(PENDSV_DISPATCH_WIZNET, wiznet5k_poll);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
u32_t sys_now(void) {
|
u32_t sys_now(void) {
|
||||||
|
|
|
@ -35,6 +35,9 @@ enum {
|
||||||
#if MICROPY_PY_NETWORK_CYW43
|
#if MICROPY_PY_NETWORK_CYW43
|
||||||
PENDSV_DISPATCH_CYW43,
|
PENDSV_DISPATCH_CYW43,
|
||||||
#endif
|
#endif
|
||||||
|
#if MICROPY_PY_NETWORK_WIZNET5K
|
||||||
|
PENDSV_DISPATCH_WIZNET,
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#if MICROPY_PY_BLUETOOTH && !MICROPY_PY_BLUETOOTH_USE_SYNC_EVENTS
|
#if MICROPY_PY_BLUETOOTH && !MICROPY_PY_BLUETOOTH_USE_SYNC_EVENTS
|
||||||
PENDSV_DISPATCH_BLUETOOTH_HCI,
|
PENDSV_DISPATCH_BLUETOOTH_HCI,
|
||||||
|
|
Loading…
Reference in New Issue