Simplifying the encspi.c

This commit is contained in:
Adam Greenwood-Byrne 2021-10-31 00:18:05 +01:00
parent a59a53728d
commit dde4667e37

View file

@ -7,18 +7,14 @@ void ENC_SPI_Select(unsigned char truefalse) {
void ENC_SPI_SendBuf(unsigned char *master2slave, unsigned char *slave2master, unsigned short bufferSize) { void ENC_SPI_SendBuf(unsigned char *master2slave, unsigned char *slave2master, unsigned short bufferSize) {
spi_chip_select(0); spi_chip_select(0);
HAL_Delay(1);
spi_send_recv(master2slave, slave2master, bufferSize); spi_send_recv(master2slave, slave2master, bufferSize);
spi_chip_select(1); // De-select the ENC spi_chip_select(1); // De-select the ENC
HAL_Delay(1);
} }
void ENC_SPI_Send(unsigned char command) { void ENC_SPI_Send(unsigned char command) {
spi_chip_select(0); spi_chip_select(0);
HAL_Delay(1);
spi_send(&command, 1); spi_send(&command, 1);
spi_chip_select(1); // De-select the ENC spi_chip_select(1); // De-select the ENC
HAL_Delay(1);
} }
void ENC_SPI_SendWithoutSelection(unsigned char command) { void ENC_SPI_SendWithoutSelection(unsigned char command) {