stm32: Integrate in the cyw43 driver and network.WLAN class.

Enable it by setting MICROPY_PY_NETWORK_CYW43=1 at the Makefile level.
This commit is contained in:
Damien George
2019-06-01 16:11:03 +10:00
parent 12ed6f91ee
commit 8b7409c295
5 changed files with 55 additions and 0 deletions

View File

@@ -39,6 +39,7 @@
#if MICROPY_PY_LWIP
#include "lwip/init.h"
#include "drivers/cyw43/cyw43.h"
#endif
#include "systick.h"
@@ -481,6 +482,17 @@ void stm32_main(uint32_t reset_mode) {
systick_enable_dispatch(SYSTICK_DISPATCH_LWIP, mod_network_lwip_poll_wrapper);
#endif
#if MICROPY_PY_NETWORK_CYW43
{
cyw43_init(&cyw43_state);
uint8_t buf[8];
memcpy(&buf[0], "PYBD", 4);
mp_hal_get_mac_ascii(MP_HAL_MAC_WLAN0, 8, 4, (char*)&buf[4]);
cyw43_wifi_ap_set_ssid(&cyw43_state, 8, buf);
cyw43_wifi_ap_set_password(&cyw43_state, 8, (const uint8_t*)"pybd0123");
}
#endif
#if defined(MICROPY_HW_UART_REPL)
// Set up a UART REPL using a statically allocated object
pyb_uart_repl_obj.base.type = &pyb_uart_type;