/* spi.c */ #include #include "common.h" #define DDR_SPI DDRB #define PORT_SPI PORTB #define PIN_MOSI 3 #define PIN_SCK 5 #define PIN_SS 2 void spi_init(void) { /* Set MOSI, SCK and SS output */ PORT_SPI |= (1<