From a5bb06281011f4f0edd6f7b9331f149bd256d495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 22 Mar 2015 14:05:00 +0100 Subject: SPI moved from src subfolder and mode changes SPI USI should now work. SPI USI is now documented. Removing architecture specific folders in src. --- src/avr5/spi.c | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 src/avr5/spi.c (limited to 'src/avr5/spi.c') diff --git a/src/avr5/spi.c b/src/avr5/spi.c deleted file mode 100644 index bc026ef..0000000 --- a/src/avr5/spi.c +++ /dev/null @@ -1,47 +0,0 @@ -#include "../../spi.h" - -#if __AVR_ARCH__ == 5 - -inline void ioe_spi_join(void) { - // TODO -} - -#ifdef IOE_SPI_MASTER -inline void ioe_spi_init(void) { - // Set MOSI and SCK output, all other input - DDR_SPI = _BV(DD_MOSI) | _BV(DD_SCLK); - // Enable interrupt - SPCR |= _BV(SPIE); - // Enable SPI master and set clock rate fck/16 - SPCR = _BV(SPE) | _BV(MSTR) | _BV(SPR0); -} - -inline int ioe_spi_ready(void) { - // TODO -} - -inline void ioe_spi_transfer(int8_t data) { - SPDR = data; -} - -#else /* IOE_SPI_MASTER */ -inline void ioe_spi_init(void) { - // Set MISO as output, all other input - DDR_SPI = _BV(DD_MISO); - // Enable interrupt - SPCR |= _BV(SPIE); - // Enable SPI - SPCR = _BV(SPE); -} - -inline void ioe_spi_expose(int8_t data) { - SPDR = data; -} - -#endif /* IOE_SPI_MASTER */ - -SIGNAL(SPI_STC_vect) { - ioe_spi_retrieve(SPDR); -} - -#endif /* __AVR_ARCH__ == 5 */ -- cgit v1.2.3