uint8_t spi_transfer(uint8_t data) { USIDR = data; USISR = _BV(USIOIF); // clear flag while ( (USISR & _BV(USIOIF)) == 0 ) { USICR = (1<