summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/rp2/cyw43_configport.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/ports/rp2/cyw43_configport.h b/ports/rp2/cyw43_configport.h
index 4b012ce17..4294691c6 100644
--- a/ports/rp2/cyw43_configport.h
+++ b/ports/rp2/cyw43_configport.h
@@ -53,6 +53,41 @@
#define CYW43_HOST_NAME mod_network_hostname_data
+#if CYW43_PIN_WL_DYNAMIC
+
+// Dynamic pins can be changed at runtime before initialising the CYW43
+
+typedef enum cyw43_pin_index_t {
+ CYW43_PIN_INDEX_WL_REG_ON,
+ CYW43_PIN_INDEX_WL_DATA_OUT,
+ CYW43_PIN_INDEX_WL_DATA_IN,
+ CYW43_PIN_INDEX_WL_HOST_WAKE,
+ CYW43_PIN_INDEX_WL_CLOCK,
+ CYW43_PIN_INDEX_WL_CS,
+ CYW43_PIN_INDEX_WL_COUNT // last
+} cyw43_pin_index_t;
+
+// Function to retrieve a cyw43 dynamic pin
+uint cyw43_get_pin_wl(cyw43_pin_index_t pin_id);
+
+#define CYW43_PIN_WL_REG_ON cyw43_get_pin_wl(CYW43_PIN_INDEX_WL_REG_ON)
+#define CYW43_PIN_WL_DATA_OUT cyw43_get_pin_wl(CYW43_PIN_INDEX_WL_DATA_OUT)
+#define CYW43_PIN_WL_DATA_IN cyw43_get_pin_wl(CYW43_PIN_INDEX_WL_DATA_IN)
+#define CYW43_PIN_WL_HOST_WAKE cyw43_get_pin_wl(CYW43_PIN_INDEX_WL_HOST_WAKE)
+#define CYW43_PIN_WL_CLOCK cyw43_get_pin_wl(CYW43_PIN_INDEX_WL_CLOCK)
+#define CYW43_PIN_WL_CS cyw43_get_pin_wl(CYW43_PIN_INDEX_WL_CS)
+
+#else
+
+#define CYW43_PIN_WL_REG_ON CYW43_DEFAULT_PIN_WL_REG_ON
+#define CYW43_PIN_WL_DATA_OUT CYW43_DEFAULT_PIN_WL_DATA_OUT
+#define CYW43_PIN_WL_DATA_IN CYW43_DEFAULT_PIN_WL_DATA_IN
+#define CYW43_PIN_WL_HOST_WAKE CYW43_DEFAULT_PIN_WL_HOST_WAKE
+#define CYW43_PIN_WL_CLOCK CYW43_DEFAULT_PIN_WL_CLOCK
+#define CYW43_PIN_WL_CS CYW43_DEFAULT_PIN_WL_CS
+
+#endif
+
#define CYW43_SDPCM_SEND_COMMON_WAIT \
if (get_core_num() == 0) { \
cyw43_yield(); \