From f4c1f296ae5ba31ede8a6fff6d1f7b9848d8e10d Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 8 May 2012 20:45:07 +0000 Subject: added simple spi test git-svn-id: https://svn.spreadspace.org/mur.sat@404 7de4ea59-55d0-425e-a1af-a3118ea81d4c --- software/hhd70dongle/spi.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'software/hhd70dongle/spi.c') diff --git a/software/hhd70dongle/spi.c b/software/hhd70dongle/spi.c index 0732716..0ffa1b9 100644 --- a/software/hhd70dongle/spi.c +++ b/software/hhd70dongle/spi.c @@ -29,19 +29,42 @@ * along with mur.sat. If not, see . * */ +#include "avr/io.h" + #include "spi.h" +#define SPI_DDR DDRB +#define SPI_PORT PORTB +#define SPI_PIN PINB +#define CS 0 +#define SCK 1 +#define MOSI 2 +#define MISO 3 +#define GDO2 4 +#define GDO0 5 +#define RE 6 +#define TE 7 + void spi_init(void) { - + SPI_PORT = 0; + SPI_DDR = (1<