#include "main.h" #include void SPI_MasterInit(void) { /* Set MOSI, SCK and SS output, all others input */ DDRB = _BV(PB2) | _BV(PB3) | _BV(PB5); // set MISO as input DDRB &= ~_BV(PB4); PORTB = _BV(PB5) | _BV(PB2); // SCK and PB2 high /* Enable SPI, Master, set clock rate fck/16 */ SPCR = (1<