-
Notifications
You must be signed in to change notification settings - Fork 917
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
rp2040 SPI0 variable is a pointer and not struct #4663
Comments
I think we will eventually want to convert all SPI objects to use pointers instead, like we did for I2C a long time ago. See: #1693 |
The best way to fix this for now would be to use |
That makes sense. In my local environment, I updated the max72xx driver to support multiple maxis in series (up to 8) and was planning to submit a PR in future. So I will include this change. I wasn't aware of a drivers.SPI interface and am wondering if there a reason for a machine.SPI and a drivers.SPI? I noted they are different types, a struct vs interface. Possibly just legacy evolution... |
@aykevl to add support to multiple max72xx in series, I would need to make small function signature changes. Would you accept small breaking code for the max72xx or do you prefer that I create new functions? For example,
in (1) the users would have to make some small modifications to their code to identify how many devices they have. |
I am developing for the RPI Pico and noticed that the definition of the SPI0 & SPI1 variables are pointers to the SPI struct. This differ to the SPI0 definition for generic boards, which is simply a struct. As a result the following code compiles with target=pico but does not compile if target is generic/wasm.
This is because the declaration of SPI0 is different depending which tag you use:
machine/machine_rp2040_spi.go
machine/machine_generic_peripherals.go
It would be more consistent for rp2040 SPI to also be a struct, not a pointer. unless you know a particular reason why this is like that.
Happy to submit a change request if the change makes sense.
The text was updated successfully, but these errors were encountered: