Add christmas edition
This commit is contained in:
parent
2f1c7d9e82
commit
b62af486a7
1 changed files with 3422 additions and 1 deletions
30
christmas/AdAstra/src/hardware_access/spi/spi.c
Normal file
30
christmas/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…
Reference in a new issue