Partial refactoring, forgot spi.h early.
[goodfet] / firmware / include / spi.h
1 /** SPI **/
2
3
4 //Pins and I/O
5 #define SS   BIT0
6 #define MOSI BIT1
7 #define MISO BIT2
8 #define SCK  BIT3
9
10 #define SETSS P5OUT|=SS
11 #define CLRSS P5OUT&=~SS
12
13 #define SETMOSI P5OUT|=MOSI
14 #define CLRMOSI P5OUT&=~MOSI
15 #define SETCLK P5OUT|=SCK
16 #define CLRCLK P5OUT&=~SCK
17 #define READMISO (P5IN&MISO?1:0)