Base HAL SPI Changes

This commit is contained in:
Christopher Pepper
2017-07-25 17:28:13 +01:00
committed by Scott Lahteine
parent bcd050f33b
commit a31e32969f
2 changed files with 14 additions and 12 deletions

View File

@@ -30,6 +30,7 @@
#if ENABLED(SDSUPPORT)
#include "Sd2Card.h"
#include "src/HAL/spi_api.h"
//------------------------------------------------------------------------------
// send command and return error code. Return zero for OK
@@ -89,14 +90,14 @@ uint32_t Sd2Card::cardSize() {
}
//------------------------------------------------------------------------------
void Sd2Card::chipSelectHigh() {
digitalWrite(chipSelectPin_, HIGH);
HAL::SPI::disable_cs(SD_SPI_CHANNEL);
}
//------------------------------------------------------------------------------
void Sd2Card::chipSelectLow() {
#if DISABLED(SOFTWARE_SPI)
spiInit(spiRate_);
#endif // SOFTWARE_SPI
digitalWrite(chipSelectPin_, LOW);
HAL::SPI::enable_cs(SD_SPI_CHANNEL);
}
//------------------------------------------------------------------------------
/** Erase a range of blocks.