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 | //-----------------------------------------------------------------------------
|
---|
15 | extern volatile U08 spi_clock_index;
|
---|
16 | extern volatile U08 spi_cpol;
|
---|
17 | extern volatile U08 spi_cpha;
|
---|
18 | extern volatile U08 spi_dord;
|
---|
19 | extern volatile U08 SPI_DEVICE_SS[2];
|
---|
20 | extern volatile BOOL SPI_DEVICE_ACTIVE_HIGH[2];
|
---|
21 |
|
---|
22 | extern volatile U08 spi_read_buffer[SPI_READ_BUFFER_SIZE];
|
---|
23 | extern volatile U08 spi_write_buffer[SPI_WRITE_BUFFER_SIZE];
|
---|
24 | //-----------------------------------------------------------------------------
|
---|
25 |
|
---|
26 | void spi_init(void);
|
---|
27 | void spi_transfer(U08 bytes, U08 device);
|
---|
28 | U08 spi_transfer_byte(U08 data);
|
---|
29 | void spi_set_clock_index(U08 clock_index);
|
---|
30 | void spi_set_dord(U08 dord);
|
---|
31 | void spi_set_cpol(U08 cpol);
|
---|
32 | void spi_set_cpha(U08 cpha);
|
---|
33 | void spi_setup(void);
|
---|
34 | void spi_transfer_string(U08 length, U08* addr, U08 device);
|
---|
35 | //-----------------------------------------------------------------------------
|
---|
36 |
|
---|
37 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.