Skip to content

Conversation

@deadprogram
Copy link
Member

This PR is to update all SPI usage to use either *machine.SPI or drivers.SPI to accommodate recent switch in machine package to always use *machine.SPI.

… to accomodate recent switch in machine package

Signed-off-by: deadprogram <[email protected]>
@gandarez
Copy link

Wouldn't this introduce a breaking change since we are changing the NewXXX() funcs to accept an interface as param?

@deadprogram
Copy link
Member Author

@gandarez that is potentially true, however it is already something we have been moving towards with the I2C interface, for example.

The benefit is greater compatibility in the future, and also ability to write tests such as that proposed in PR #742

@gandarez
Copy link

What's the rationale to decide between machine or drivers package?

@deadprogram
Copy link
Member Author

I would like to switch entirely to use drivers.SPI so that it is testable interface and also no dependency on the TinyGo machine package.

However, some current drivers are calling specific SPI methods and I did not want to have to address that problem at the same time, which is why I did not change all of them to use drivers.SPI in this PR.

@deadprogram
Copy link
Member Author

Thanks for review @gandarez now merging.

@deadprogram deadprogram merged commit 156d6e7 into dev Mar 11, 2025
1 check passed
@deadprogram deadprogram deleted the update-spi-pointer branch March 11, 2025 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants