Copy project
This commit is contained in:
parent
ce7a467af7
commit
26a0fd884f
173 changed files with 157458 additions and 1 deletions
30
ad_astra/AdAstra/src/hardware_access/spi/spi.c
Normal file
30
ad_astra/AdAstra/src/hardware_access/spi/spi.c
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#include "spi.h"
|
||||
|
||||
#include <avr/interrupt.h>
|
||||
|
||||
#define SWAP_BIT (BV(USIWM0) | BV(USICLK) | BV(USITC) | BV(USICS1))
|
||||
|
||||
|
||||
void sendByteOnSPI(uint8_t byte) {
|
||||
USIDR = byte;
|
||||
|
||||
USICR = SWAP_BIT;
|
||||
USICR = SWAP_BIT;
|
||||
USICR = SWAP_BIT;
|
||||
USICR = SWAP_BIT;
|
||||
|
||||
USICR = SWAP_BIT;
|
||||
USICR = SWAP_BIT;
|
||||
USICR = SWAP_BIT;
|
||||
USICR = SWAP_BIT;
|
||||
|
||||
USICR = SWAP_BIT;
|
||||
USICR = SWAP_BIT;
|
||||
USICR = SWAP_BIT;
|
||||
USICR = SWAP_BIT;
|
||||
|
||||
USICR = SWAP_BIT;
|
||||
USICR = SWAP_BIT;
|
||||
USICR = SWAP_BIT;
|
||||
USICR = SWAP_BIT;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue