tinygo-org / drivers

TinyGo drivers for sensors, displays, wireless adaptors, and other devices that use I2C, SPI, GPIO, ADC, and UART interfaces.
https://tinygo.org
BSD 3-Clause "New" or "Revised" License
585 stars 180 forks source link

`sd` package: `sdcard` package redesign #639

Open soypat opened 5 months ago

soypat commented 5 months ago

New Features:

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

bgould commented 5 months ago

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 commented 5 months ago

@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 commented 5 months ago

@bgould I've added a draft of what I mean: https://github.com/tinygo-org/drivers/pull/639/files#diff-92f519b8e01de4c93b473c245b482f67da4e20bfbfbe48aaca799f35e45afb43R38

soypat commented 5 months ago

@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 commented 5 months ago

@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:

soypat commented 5 months ago

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

deadprogram commented 4 months ago

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

deadprogram commented 2 months ago

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