Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CYW43 pins are hard coded #1938

Closed
sfe-SparkFro opened this issue Sep 20, 2024 · 8 comments
Closed

CYW43 pins are hard coded #1938

sfe-SparkFro opened this issue Sep 20, 2024 · 8 comments

Comments

@sfe-SparkFro
Copy link

These should really be set in the board definition file, so other board variants can use other pins.

#define WL_REG_ON 23
#define DATA_OUT_PIN 24u
#define DATA_IN_PIN 24u
#define IRQ_PIN 24u
// #define MONITOR_PIN 3u
#define CLOCK_PIN 29u
#define CS_PIN 25u

@kilograham
Copy link
Contributor

see #1816

@kilograham kilograham added this to the 2.0.1 milestone Sep 20, 2024
@sfe-SparkFro
Copy link
Author

Doh! Should have looked at the develop branch, thank you!

Ok, so if a variant uses different GPIO pins, is it as simple as #defineing the following in the board header?

CYW43_DEFAULT_PIN_WL_REG_ON
CYW43_DEFAULT_PIN_WL_DATA_OUT
CYW43_DEFAULT_PIN_WL_DATA_IN
CYW43_DEFAULT_PIN_WL_HOST_WAKE
CYW43_DEFAULT_PIN_WL_CLOCK
CYW43_DEFAULT_PIN_WL_CS

@sfe-SparkFro
Copy link
Author

Also, are there any restrictions on which pins can be used, or is any combination of pins valid?

@kilograham
Copy link
Contributor

Doh! Should have looked at the develop branch, thank you!

Ok, so if a variant uses different GPIO pins, is it as simple as #defineing the following in the board header?

CYW43_DEFAULT_PIN_WL_REG_ON
CYW43_DEFAULT_PIN_WL_DATA_OUT
CYW43_DEFAULT_PIN_WL_DATA_IN
CYW43_DEFAULT_PIN_WL_HOST_WAKE
CYW43_DEFAULT_PIN_WL_CLOCK
CYW43_DEFAULT_PIN_WL_CS

yes

@kilograham
Copy link
Contributor

Also, are there any restrictions on which pins can be used, or is any combination of pins valid?

question for @peterharperuk

@peterharperuk
Copy link
Contributor

Sorry, I saw this question, then lost the issue. In theory there's no restriction on what gpios you can use. But we've only tested the code with data in, out and wake set to the same pin (the configuration pico_w uses), so using different pins for these might not work. On, clock and cs must be set to their own, different pins. Assuming this is about RM2 I've had some issues running the pio at clock div of 2 when connected to a device with wires, so you may have to slow it down to 3 with CYW43_PIO_CLOCK_DIV_INT=3. Email me if you want more details.

@sfe-SparkFro
Copy link
Author

Understood, thank you!

@lurch
Copy link
Contributor

lurch commented Oct 22, 2024

See also #1982

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants