drivers
drivers copied to clipboard
`sd` package: `sdcard` package redesign
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.~
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
@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
@bgould I've added a draft of what I mean: https://github.com/tinygo-org/drivers/pull/639/files#diff-92f519b8e01de4c93b473c245b482f67da4e20bfbfbe48aaca799f35e45afb43R38
@bgould OK, I've finished the sd.BlockDevice type, seems to be working OK. Check it out and let me know what you think :)
@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? :smile_cat:
OK, added a Readme and switched some filenames around to make navigation easier.
@bgould have you had a chance to try this out yet?
Paging Dr. @bgould :smile_cat: any chance to try this out?