Project

General

Profile

Revision 490

Added by Ben Poole over 14 years ago

slave -> master kind of works

View differences:

spi.h
1
#ifndef __SPI_H__
2
#define __SPI_H__
3

  
1 4
#define DOUBLE_SCK 1
2 5
#define SPR0_BIT 1
3 6
#define LSB 1
4 7
#define MSB 0
5 8
#define MASTER 1
6 9
#define SLAVE 0
7
#define SPI_SENDING 1
8
#define SPI_VOID 0
9
#define SPI_MASTER_RECV 2
10 10

  
11
#define SPI_IDLE _BV(0)
12
#define SPI_SEND _BV(1)
13
#define SPI_RECV _BV(2)
14
#define SPI_BOTH _BV(3)
15

  
16

  
11 17
/* Pin Defines */
12 18
#define MOSI _BV(PB2)
13 19
#define MISO _BV(PB3)
......
21 27
int spi_send(char *data, size_t bytes);
22 28
void spi_master_recv_on(void);
23 29
void spi_master_recv_off(void);
30
void spi_read_one(void);
31

  
32
#endif

Also available in: Unified diff