mirror of
https://github.com/isometimes/rpi4-osdev
synced 2024-11-09 20:00:40 +00:00
Simplifying the encspi.c
This commit is contained in:
parent
a59a53728d
commit
dde4667e37
1 changed files with 0 additions and 4 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue