source: firmware/FSC/src/spi_master.h@ 19366

Last change on this file since 19366 was 17630, checked in by dneise, 11 years ago
mostly whitespace changes and removed the use of the usart
File size: 1.4 KB
Line 
1#ifndef __SPI_MASTER_H
2#define __SPI_MASTER_H
3//-----------------------------------------------------------------------------
4
5#include "typedefs.h"
6#include "application.h"
7//#include "usart.h"
8//-----------------------------------------------------------------------------
9#define SPI_READ_BUFFER_SIZE 16
10#define SPI_WRITE_BUFFER_SIZE 16
11
12#define SPI_MAX_SLAVE_INDEX 2 //?
13#define SPI_MAX_CLOCK_INDEX 6 //?
14//-----------------------------------------------------------------------------
15extern volatile U08 spi_clock_index;
16extern volatile U08 spi_cpol;
17extern volatile U08 spi_cpha;
18extern volatile U08 spi_dord;
19extern volatile U08 SPI_DEVICE_SS[4];
20extern volatile BOOL SPI_DEVICE_ACTIVE_HIGH[4];
21
22extern volatile U08 spi_read_buffer[SPI_READ_BUFFER_SIZE];
23extern volatile U08 spi_write_buffer[SPI_WRITE_BUFFER_SIZE];
24//-----------------------------------------------------------------------------
25
26void spi_init(void);
27void spi_transfer(U08 bytes, U08 device);
28void spi_transfer_w5100(U08 bytes);
29U08 spi_transfer_byte(U08 data);
30void spi_set_clock_index(U08 clock_index);
31void spi_set_dord(U08 dord);
32void spi_set_cpol(U08 cpol);
33void spi_set_cpha(U08 cpha);
34void spi_setup(void);
35void spi_setup_ad7719();
36void spi_setup_w5100();
37void spi_transfer_string(U08 length, U08* addr, U08 device);
38//-----------------------------------------------------------------------------
39
40#endif
Note: See TracBrowser for help on using the repository browser.