Skip to content

Conversation

FoamyGuy
Copy link
Contributor

This relies on the changes from: adafruit/Adafruit_CircuitPython_Register#59 So that should be merged before this is.

Adds SPI support by using new functionality pending addition to adafruit_register

This should be a major version bump if merged because the class name changed from the bus specific SPA06_003_I2C to the now generic SPA06_003.

Tested successfully with both SPI and I2C on Adafruit CircuitPython 10.0.0-beta.3 on 2025-08-29; Adafruit Feather RP2040 with rp2040

@FoamyGuy FoamyGuy marked this pull request as ready for review October 2, 2025 17:17
@FoamyGuy FoamyGuy requested a review from a team October 2, 2025 17:17
@FoamyGuy
Copy link
Contributor Author

FoamyGuy commented Oct 2, 2025

Note: this should bump to 2.0.0 when released because the class name change from SPA06_003_I2C -> SPA06_003 will cause old code using new library to break.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question about what the new constructor args should be.

You could also make a function that looks like the old class SPA06_003_I2C() and does the I2CDevice wrapping. It should probably have a deprecation warning though too.

@FoamyGuy
Copy link
Contributor Author

FoamyGuy commented Oct 8, 2025

The latest commit has over_spi(spi, cs) and over_i2c(i2c, address) functions that can be used to create the driver using the specified bus type. Examples are updated to use those new functions.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple minor things. Definitely getting close. Thanks!

time.sleep(0.01)


class SPA06_003_I2C(SPA06_003):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need a class? Or can this be a function?

Also, please use the warnings module. I believe most CP builds will have it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this to a function and use warnings module in the latest commit.

Thank you

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thank you!

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.

2 participants