greiman / SdFat

Arduino FAT16/FAT32 exFAT Library
MIT License
1.07k stars 503 forks source link

Using SERCOM1 SPI with SdFat (Feather M0) #286

Open philatdunetive opened 3 years ago

philatdunetive commented 3 years ago

I can get soft SPI working fine on an Feather M0 (uses pins 11,12,13), but wish to use the added hardwired SPI from setting up SERCOM1 (which, rather nicely also comes out on those pins). I have the code to set up the SERCOM1

This so I can talk to a SD card whilst also talking to on board BLE chip (both SPI) without worrying about chip select.

You suggest using a SdSpiBaseClass, then setting SPI_DRIVER_SELECT to 3 (happy with the latter). I have been unable to find a tutorial or example code for such a class given SPI hardware. Has this been done elsewhere? It seems a shame to have to use softspi when the Feather M0 is capable of SERCOM1

thanks in advance

greiman commented 3 years ago

You should be able do something like this example for STM32.