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

sd package: sdcard package redesign #639

Open
wants to merge 25 commits into
base: dev
Choose a base branch
from
Open

sd package: sdcard package redesign #639

wants to merge 25 commits into from

Conversation

soypat
Copy link
Contributor

@soypat soypat commented Jan 14, 2024

New Features:

  • Idiomatic CSD V1,V2 support with V3 API compatibility
  • No heap allocations
  • Complete error handling
  • CRC support
  • Design for interface compatibility with other SDCard implementations i.e. Using raw SDIO with a Raspberry Pi Pico.
  • Added tests for what is testable
  • Renamed ReadData to more idiomatic ReadBlock, same with Write methods
  • More checks for OOB write/read requests
  • Allow multi block writing and multi block reading in a double method interface, making it easier to use.
  • Easily enable highest transfer rate available for SDCard using CSD

Is still a WIP. CRC7 still does not work and I'm getting errors on ever other ReadBlock call.

@soypat soypat marked this pull request as ready for review January 15, 2024 04:34
@bgould
Copy link
Member

bgould commented Jan 15, 2024

Is it possible to make this implement BlockDevice so that it is natively compatible with tinyfs? Skimming definitions.go, it looks there are some similar methods in there

https://github.com/tinygo-org/tinyfs/blob/release/tinyfs.go#L43

@soypat
Copy link
Contributor Author

soypat commented Jan 15, 2024

@bgould Will do, but I'll do it through another type that uses the ReadBlocks/WriteBlocks interface set to implement the tinyfs.BlockDevice interface. Already had this in mind as the next addition to sd

@soypat
Copy link
Contributor Author

soypat commented Jan 15, 2024

@soypat soypat marked this pull request as draft January 16, 2024 02:37
@soypat soypat marked this pull request as ready for review January 16, 2024 03:47
@soypat
Copy link
Contributor Author

soypat commented Jan 16, 2024

@bgould OK, I've finished the sd.BlockDevice type, seems to be working OK. Check it out and let me know what you think :)

@deadprogram
Copy link
Member

deadprogram commented Jan 23, 2024

@soypat would you perhaps be able to add a README with some small explanation about how this works?

For example what is rustref.go do? 😸

@soypat
Copy link
Contributor Author

soypat commented Jan 23, 2024

OK, added a Readme and switched some filenames around to make navigation easier.

@deadprogram
Copy link
Member

@bgould have you had a chance to try this out yet?

@deadprogram deadprogram requested a review from bgould April 1, 2024 06:44
@deadprogram
Copy link
Member

Paging Dr. @bgould 😸 any chance to try this out?

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