Cleanups for STM32F7

This commit is contained in:
Scott Lahteine
2018-01-15 02:28:39 -06:00
parent a0246c5c96
commit 42933c804a
18 changed files with 988 additions and 1293 deletions

View File

@@ -82,20 +82,17 @@ void spiBegin(void) {
#if !PIN_EXISTS(SS)
#error SS_PIN not defined!
#endif
SET_OUTPUT(SS_PIN);
WRITE(SS_PIN, HIGH);
}
/** Configure SPI for specified SPI speed */
void spiInit(uint8_t spiRate) {
// Use datarates Marlin uses
uint32_t clock;
switch (spiRate) {
case SPI_FULL_SPEED: clock = 20000000; break; //13.9mhz=20000000 6.75mhz=10000000 3.38mhz=5000000 .833mhz=1000000
case SPI_FULL_SPEED: clock = 20000000; break; // 13.9mhz=20000000 6.75mhz=10000000 3.38mhz=5000000 .833mhz=1000000
case SPI_HALF_SPEED: clock = 5000000; break;
case SPI_QUARTER_SPEED: clock = 2500000; break;
case SPI_EIGHTH_SPEED: clock = 1250000; break;
@@ -108,8 +105,6 @@ void spiInit(uint8_t spiRate) {
SPI.begin();
}
/**
* @brief Receives a single byte from the SPI port.
*
@@ -133,8 +128,6 @@ uint8_t spiRec(void) {
*
* @details Uses DMA
*/
void spiRead(uint8_t* buf, uint16_t nbyte) {
SPI.beginTransaction(spiConfig);
SPI.dmaTransfer(0, const_cast<uint8_t*>(buf), nbyte);
@@ -162,8 +155,6 @@ void spiSend(uint8_t b) {
*
* @details Use DMA
*/
void spiSendBlock(uint8_t token, const uint8_t* buf) {
SPI.beginTransaction(spiConfig);
SPI.transfer(token);
@@ -171,8 +162,6 @@ void spiSendBlock(uint8_t token, const uint8_t* buf) {
SPI.endTransaction();
}
#endif // SOFTWARE_SPI
#endif // STM32F7