added part from SD fat lib which enables SPI 2 device write access
taken from SdSpiSTM32F1.cpp - Victor's lib, and adapted to support device selection. To be checked with other libs which are using the SPI lib.
This commit is contained in:
parent
536cec8f5d
commit
37fbb642ea
|
@ -323,6 +323,10 @@ void SPIClass::write(uint16 data) {
|
|||
spi_tx_reg(_currentSetting->spi_d, data); // "2. Write the first data item to be transmitted into the SPI_DR register (this clears the TXE flag)."
|
||||
while (spi_is_tx_empty(_currentSetting->spi_d) == 0); // "5. Wait until TXE=1 ..."
|
||||
while (spi_is_busy(_currentSetting->spi_d) != 0); // "... and then wait until BSY=0 before disabling the SPI."
|
||||
// taken from SdSpiSTM32F1.cpp - Victor's lib, and adapted to support device selection
|
||||
if (spi_is_rx_nonempty(_currentSetting->spi_d)) {
|
||||
uint8_t b = spi_rx_reg(_currentSetting->spi_d);
|
||||
}
|
||||
}
|
||||
|
||||
//void SPIClass::write(uint8 byte) {
|
||||
|
|
Loading…
Reference in New Issue