source: firmware/FSC/usb_src/spi_master.h@ 20115

Last change on this file since 20115 was 10109, checked in by lutz, 14 years ago
niculin & dom debugged quite some stuff
File size: 1.3 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);
28U08 spi_transfer_byte(U08 data);
29void spi_set_clock_index(U08 clock_index);
30void spi_set_dord(U08 dord);
31void spi_set_cpol(U08 cpol);
32void spi_set_cpha(U08 cpha);
33void spi_setup(void);
34void spi_transfer_string(U08 length, U08* addr, U08 device);
35//-----------------------------------------------------------------------------
36
37#endif
Note: See TracBrowser for help on using the repository browser.