rp2/cyw43_configport: Define cyw43 pins.

The cyw43 pins used to be hardcoded and `CYW43_PIN_WL_HOST_WAKE` and
`CYW43_PIN_WL_REG_ON` were in the `pico_w.h` board header.

This has been changed so the board header just defines the "default
version of the pins, e.g. `CYW43_DEFAULT_PIN_WL_HOST_WAKE`,
`CYW43_DEFAULT_PIN_WL_REG_ON` etc.

Set the pin values in `cyw43_configport.`h so `cyw43-driver` sees them and
allow them to be changed at runtime (dynamic) if required.

Signed-off-by: Peter Harper <peter.harper@raspberrypi.com>
This commit is contained in:
Peter Harper
2024-10-23 16:41:54 +01:00
committed by Matthias Blankertz
parent 8ba7af3a70
commit ba21be5215

View File

@@ -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(); \