root / branches / encoders / code / projects / libdragonfly / spi.h @ 749
History | View | Annotate | Download (478 Bytes)
1 |
/**
|
---|---|
2 |
* @file spi.h
|
3 |
* @brief Definitions for SPI
|
4 |
* @author Colony Project, CMU Robotics Club
|
5 |
**/
|
6 |
|
7 |
#ifndef __SPI_H__
|
8 |
#define __SPI_H__
|
9 |
|
10 |
#define DOUBLE_SCK 1 |
11 |
#define SPR0_BIT 1 |
12 |
|
13 |
#define MASTER 1 |
14 |
#define SLAVE 0 |
15 |
|
16 |
#define MOSI _BV(PB2)
|
17 |
#define MISO _BV(PB3)
|
18 |
#define SS _BV(PB0)
|
19 |
#define SCLK _BV(PB1)
|
20 |
|
21 |
typedef void (*spi_fun_recv_t)(char); |
22 |
typedef void (*spi_fun_recv_complete_t)(void); |
23 |
|
24 |
void spi_init (spi_fun_recv_t, spi_fun_recv_complete_t);
|
25 |
void spi_transfer (char); |
26 |
|
27 |
#endif
|