c39766d5ea501bdf78de425510bbb0bfe154959f
[goodfet] / firmware / include / spi.h
1 /*! \file spi.h
2   \author Travis Goodspeed
3   \brief Definitions for the SPI application.
4 */
5
6
7 //Pins and I/O
8 #define SS   BIT0
9 #define MOSI BIT1
10 #define MISO BIT2
11 #define SCK  BIT3
12
13 #define SETSS P5OUT|=SS
14 #define CLRSS P5OUT&=~SS
15
16 #define SETMOSI P5OUT|=MOSI
17 #define CLRMOSI P5OUT&=~MOSI
18 #define SETCLK P5OUT|=SCK
19 #define CLRCLK P5OUT&=~SCK
20 #define READMISO (P5IN&MISO?1:0)