From 17f2ac15e28c6e5700fd61ea21004db9796c73b8 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Tue, 20 Aug 2024 12:25:39 +0100 Subject: [PATCH] Config: Bring up WiFi/BT. --- presto/manifest.py | 6 +++++- presto/mpconfigboard.cmake | 9 +++++++++ presto/mpconfigboard.h | 16 +++++++++++++++- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/presto/manifest.py b/presto/manifest.py index 4819e73..f1c066c 100644 --- a/presto/manifest.py +++ b/presto/manifest.py @@ -1 +1,5 @@ -# Board-specific frozen libs go here \ No newline at end of file +# Board-specific frozen libs go here + +require("bundle-networking") +require("sdcard") +require("aioble") diff --git a/presto/mpconfigboard.cmake b/presto/mpconfigboard.cmake index 72c0077..2e181df 100644 --- a/presto/mpconfigboard.cmake +++ b/presto/mpconfigboard.cmake @@ -3,6 +3,15 @@ set(PICO_BOARD "presto") set(PICO_PLATFORM "rp2350-arm-s") set(PICO_NUM_GPIOS 48) +# WiFi +set(MICROPY_PY_LWIP ON) +set(MICROPY_PY_NETWORK_CYW43 ON) + +# Bluetooth +set(MICROPY_PY_BLUETOOTH ON) +set(MICROPY_BLUETOOTH_BTSTACK ON) +set(MICROPY_PY_BLUETOOTH_CYW43 ON) + # Make sure we find pga2350.h (PICO_BOARD) in the current dir set(PICO_BOARD_HEADER_DIRS ${CMAKE_CURRENT_LIST_DIR}) diff --git a/presto/mpconfigboard.h b/presto/mpconfigboard.h index 611534f..7154848 100644 --- a/presto/mpconfigboard.h +++ b/presto/mpconfigboard.h @@ -13,4 +13,18 @@ #define MICROPY_PY_THREAD (0) // TODO: Remove when https://github.com/micropython/micropython/pull/15655 is merged -#define core1_entry (NULL) \ No newline at end of file +#define core1_entry (NULL) + +// Enable networking. +#define MICROPY_PY_NETWORK 1 +#define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT MICROPY_HW_BOARD_NAME + +// CYW43 driver configuration. +#define CYW43_USE_SPI (1) +#define CYW43_LWIP (1) +#define CYW43_GPIO (1) +#define CYW43_SPI_PIO (1) + +// For debugging mbedtls - also set +// Debug level (0-4) 1=warning, 2=info, 3=debug, 4=verbose +// #define MODUSSL_MBEDTLS_DEBUG_LEVEL 1 \ No newline at end of file