CircuitPython library for SD cards.
Project description
Introduction
CircuitPython driver for SD cards. This implements the basic reading and writing block functionality needed to mount an SD card using storage.VfsFat.
Dependencies
This driver depends on:
Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.
Usage Example
Mounting a filesystem on an SD card so that its available through the normal Python ways is easy.
Below is an example for the Feather M0 Adalogger. Most of this will stay the same across different boards with the exception of the pins for the SPI and chip select (cs) connections.
import adafruit_sdcard
import busio
import digitalio
import board
import storage
# Connect to the card and mount the filesystem.
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
cs = digitalio.DigitalInOut(board.SD_CS)
sdcard = adafruit_sdcard.SDCard(spi, cs)
vfs = storage.VfsFat(sdcard)
storage.mount(vfs, "/sd")
# Use the filesystem as normal.
with open("/sd/test.txt", "w") as f:
f.write("Hello world\n")
Documentation
API documentation for this library can be found on Read the Docs.
Contributing
Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.
Documentation
For information on building library documentation, please check out this guide.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file adafruit-circuitpython-sd-3.3.7.tar.gz
.
File metadata
- Download URL: adafruit-circuitpython-sd-3.3.7.tar.gz
- Upload date:
- Size: 31.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60ccf6e050b26c282283f164008426807d8cf4549ffba74e6f9c46e23c03849d |
|
MD5 | 66310febf47721962bdb18b2de2caa4c |
|
BLAKE2b-256 | 9df0daefbb7ef4e99371d9e4d93d51fa31ce7df14a403e17d76ba5dae4deb8b5 |