2 Copyright (C) 2012 jaseg <s@jaseg.de>
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 version 3 as published by the Free Software Foundation.
12 SPI_MOSI_DDR
|= _BV(SPI_MOSI_PIN
);
13 SPI_SCK_DDR
|= _BV(SPI_SCK_PIN
);
16 //The following function is never called.
18 //FIXME what should I do here?
21 void spi_setup(uint8_t config
){
22 SPCR
= config
| _BV(SPE
) | _BV(MSTR
);
23 if(config
& _BV(SPE
)){
30 uint8_t spi_transfer(uint8_t data
){
32 while(!(SPSR
& _BV(SPIF
))){
33 //She waves and opens a door back onto the piazza where her robot cat – the alien's nightmare intruder in the DMZ – sleeps, chasing superintelligent dream mice through multidimensional realities.