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

Spi enhancements #4497

Merged
merged 3 commits into from
Mar 26, 2021
Merged

Spi enhancements #4497

merged 3 commits into from
Mar 26, 2021

Conversation

jepler
Copy link
Member

@jepler jepler commented Mar 26, 2021

This required both adding support for the "default write value" in bitbangio.SPI, and also supporting duck-typing in adafruit_bus_device's SPIDevice which, surprisingly, was overlooked when we fixed I2C.

Now, the following code works, tested on RT1010-EVK:

import os
import board
import bitbangio
import adafruit_sdcard
import storage
import digitalio

spi = bitbangio.SPI(board.SCK, MISO=board.MISO, MOSI=board.MOSI)
cs = board.D10
sdcard = adafruit_sdcard.SDCard(spi, digitalio.DigitalInOut(cs))
vfs = storage.VfsFat(sdcard)
storage.mount(vfs, "/sd")
print(os.listdir("/sd"))

Closes #4494.

@jepler jepler requested a review from gamblor21 March 26, 2021 19:58
Copy link
Member

@gamblor21 gamblor21 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. I haven't tested it, I can try just have to see if I have a display with an SD card on the back laying about somewhere.

@ladyada
Copy link
Member

ladyada commented Mar 26, 2021

will test when there's artifacts!

@ladyada
Copy link
Member

ladyada commented Mar 26, 2021

verified with a TFT shield on a metro m7!

@ladyada ladyada merged commit f8cd7d7 into adafruit:main Mar 26, 2021
@jepler jepler deleted the spi-enhancements branch March 27, 2021 00:09
@ladyada
Copy link
Member

ladyada commented Mar 27, 2021

also verified with a teensy 4.1's SDIO card slot

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.

another problem with busdevice-in-core and bitbangio?
3 participants