machine_spi.c: Bug fixes + SD-Card & SPI flash support #27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
sdcard.py: Add SD card driver to the scripts directory
SD cards require to use FAT. Thus it was enabled here.
polarity and phase were assigned wrongly and evaluated wrong
firstbit keyword was evaluated wrong
use the same default values for make_new and init.
No default assignment of the cs Pin
This removes the default assignment of PB_15 to the cs pin.
As a result, cs will not be pulled automatically. If that is
wanted, assign cs in the SPI constructor or spi.init() call.
Without the automatic cs assignment, the drivers for SD-Card and spi
flash work with the hard SPI and not Pin has to be salvaged.
The old code is kept as commented line.
Add write_readinto support to the SDK supporting the respective
Python method. This required a change to wm_hostspi.c
Since the original SDK should not be touched, I copied the required
files into the Micropython branch, which is the second best option.
The driver for the SD card is part of this commit.
The driver for SPI-flash can be found here, subdir flash:
https://github.com/peterhinch/micropython_eeprom.git