1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
| #ifndef _SANECORE_ADSP_DRV_SPI_H__
| #define _SANECORE_ADSP_DRV_SPI_H__
|
| #include "protocol.h"
|
| #define SELECT_SPI_SLAVE(spiselect) (*pSPIFLG &= ~(spiselect<<8))
| #define DESELECT_SPI_SLAVE(spiselect) (*pSPIFLG |= (spiselect<<8))
|
|
| typedef enum{
| spi_idle,
| spi_processing,
| spi_completed,
| }spi_status_e;
|
| typedef enum{
| spi_tx,
| spi_rx,
| }spi_direction_e;
|
| void spi_init(int mode);
|
| int spi_xfer(short *pin,const short* pout,int len);
|
| void spi_process(void);
|
| void spi_config_dma(spi_direction_e direction);
|
| spi_status_e spi_get_status(void);
|
| spi_direction_e spi_get_direction(void);
|
| void* spi_get_buffer(void);
|
| #endif
|
|