Revert "SPI API platform implementation stubs" (#7416)
This reverts commit 2dfa6ca72a2e8d43caf4932ca0d35792f0638917. Revert "Base HAL SPI Changes" This reverts commit 2afc521b8b6a81b2281a038f1b99a69f4a008e64. Revert "Initial HAL SPI API" This reverts commit 58f7ffe09ab5bc034b6510f5204f8d342138abaa.
This commit is contained in:
committed by
Scott Lahteine
parent
a5cf3a190c
commit
61c0a10efe
@ -37,12 +37,12 @@
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
#include "../../../MarlinConfig.h"
|
||||
#include "../spi_api.h"
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Public Variables
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Public functions
|
||||
// --------------------------------------------------------------------------
|
||||
@ -138,32 +138,39 @@
|
||||
}
|
||||
#else
|
||||
void spiBegin() {
|
||||
HAL::SPI::initialise(SD_SPI_CHANNEL);
|
||||
}
|
||||
|
||||
void spiInit(uint8_t spiRate) {
|
||||
uint32_t freq = 8000000 / (1u << spiRate);
|
||||
HAL::SPI::set_frequency(SD_SPI_CHANNEL, freq);
|
||||
}
|
||||
|
||||
void spiSend(byte b) {
|
||||
HAL::SPI::write(SD_SPI_CHANNEL, b);
|
||||
}
|
||||
|
||||
void spiSend(const uint8_t* buf, size_t n) {
|
||||
}
|
||||
|
||||
void spiSend(uint32_t chan, byte b) {
|
||||
}
|
||||
|
||||
void spiSend(uint32_t chan, const uint8_t* buf, size_t n) {
|
||||
|
||||
}
|
||||
|
||||
// Read single byte from SPI
|
||||
uint8_t spiRec() {
|
||||
return HAL::SPI::read(SD_SPI_CHANNEL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t spiRec(uint32_t chan) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Read from SPI into buffer
|
||||
void spiRead(uint8_t*buf, uint16_t nbyte) {
|
||||
HAL::SPI::read(SD_SPI_CHANNEL, buf, nbyte);
|
||||
}
|
||||
|
||||
// Write from buffer to SPI
|
||||
void spiSendBlock(uint8_t token, const uint8_t* buf) {
|
||||
HAL::SPI::write(SD_SPI_CHANNEL, token);
|
||||
HAL::SPI::write(SD_SPI_CHANNEL, buf, 512);
|
||||
}
|
||||
#endif // ENABLED(SOFTWARE_SPI)
|
||||
|
||||
|
Reference in New Issue
Block a user