From fbf3b48d13ca0109d9fd756899a16904579a23db Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Thu, 19 Dec 2024 11:07:37 +0000 Subject: [PATCH] All: Backport enable_cyw43.h. --- boards/enable_cyw43.h | 25 +++++++++++++++++++++++++ boards/pico2_w_cosmic/mpconfigboard.h | 2 +- boards/pico2_w_galactic/mpconfigboard.h | 2 +- boards/pico2_w_stellar/mpconfigboard.h | 2 +- 4 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 boards/enable_cyw43.h diff --git a/boards/enable_cyw43.h b/boards/enable_cyw43.h new file mode 100644 index 0000000..96b3da6 --- /dev/null +++ b/boards/enable_cyw43.h @@ -0,0 +1,25 @@ +// Enable networking. +#define MICROPY_PY_NETWORK 1 + +#ifndef MICROPY_PY_NETWORK_HOSTNAME_DEFAULT +#define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT "Pico" +#endif + +// 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 + +#ifndef CYW43_WL_GPIO_COUNT +#define CYW43_WL_GPIO_COUNT 3 +#endif + +#define MICROPY_HW_PIN_EXT_COUNT CYW43_WL_GPIO_COUNT + +int mp_hal_is_pin_reserved(int n); +#define MICROPY_HW_PIN_RESERVED(i) mp_hal_is_pin_reserved(i) \ No newline at end of file diff --git a/boards/pico2_w_cosmic/mpconfigboard.h b/boards/pico2_w_cosmic/mpconfigboard.h index 3cba368..75e2e0a 100644 --- a/boards/pico2_w_cosmic/mpconfigboard.h +++ b/boards/pico2_w_cosmic/mpconfigboard.h @@ -7,7 +7,7 @@ // Enable networking. #define MICROPY_PY_NETWORK_PPP_LWIP (1) #define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT "CosmicUnicorn2W" -#include "enable_cyw43.h" +#include "../enable_cyw43.h" // For debugging mbedtls - also set // Debug level (0-4) 1=warning, 2=info, 3=debug, 4=verbose diff --git a/boards/pico2_w_galactic/mpconfigboard.h b/boards/pico2_w_galactic/mpconfigboard.h index 67ab2ac..7a63860 100644 --- a/boards/pico2_w_galactic/mpconfigboard.h +++ b/boards/pico2_w_galactic/mpconfigboard.h @@ -7,7 +7,7 @@ // Enable networking. #define MICROPY_PY_NETWORK_PPP_LWIP (1) #define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT "GalacticUnicorn2W" -#include "enable_cyw43.h" +#include "../enable_cyw43.h" // For debugging mbedtls - also set // Debug level (0-4) 1=warning, 2=info, 3=debug, 4=verbose diff --git a/boards/pico2_w_stellar/mpconfigboard.h b/boards/pico2_w_stellar/mpconfigboard.h index 42bad2b..9fb66d5 100644 --- a/boards/pico2_w_stellar/mpconfigboard.h +++ b/boards/pico2_w_stellar/mpconfigboard.h @@ -7,7 +7,7 @@ // Enable networking. #define MICROPY_PY_NETWORK_PPP_LWIP (1) #define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT "StellarUnicorn2W" -#include "enable_cyw43.h" +#include "../enable_cyw43.h" // For debugging mbedtls - also set // Debug level (0-4) 1=warning, 2=info, 3=debug, 4=verbose