You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
815 B
35 lines
815 B
"""
|
|
|
|
Example for pca10040 / nrf52832 to show how mount
|
|
and list a sdcard connected over SPI.
|
|
|
|
|
|
Direct wireing on SD card (SPI):
|
|
______________________________
|
|
| \
|
|
| 9. | NC | \
|
|
| 1. | ~CS | |
|
|
| 2. | MOSI | |
|
|
| 3. | GND | |
|
|
| 4. | VCC3.3| |
|
|
| 5. | SCK | |
|
|
| 6. | GND | |
|
|
| 7. | MISO | |
|
|
| 8. | NC | |
|
|
| |
|
|
---------------------------------
|
|
"""
|
|
|
|
import os
|
|
from machine import SPI, Pin
|
|
from sdcard import SDCard
|
|
|
|
def mnt():
|
|
cs = Pin("P22", mode=Pin.OUT)
|
|
sd = SDCard(SPI(0), cs)
|
|
os.mount(sd, '/')
|
|
|
|
def list():
|
|
files = os.listdir()
|
|
print(files)
|
|
|
|
|