Driver SPI v2
This commit is contained in:
parent
8e0fc18a55
commit
c241703a6f
1 changed files with 1 additions and 1 deletions
|
|
@ -42,7 +42,7 @@ void MySPI_Send(char ByteToSend){
|
|||
char MySPI_Read(void){
|
||||
MySPI_Clear_NSS(); //Début transmission
|
||||
while (!(SPI1->SR & SPI_SR_TXE)){} // Attend que DR soit vide
|
||||
MySPI_Send(0x00); // Pour trasmettre la clock
|
||||
SPI1->DR = 0x00; // Pour trasmettre la clock
|
||||
while (!(SPI1->SR & SPI_SR_RXNE)) {} // On attend de recevoir dans buffer de reception le byte
|
||||
MySPI_Set_NSS(); // Fin transmission
|
||||
return SPI1->DR;
|
||||
|
|
|
|||
Loading…
Reference in a new issue