分支自 DSP/ADSP21569/DSP-21569

graydon
2024-02-28 420778fcee054257d540cf24fbf1b1e3f9fc0d9f
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
36
/*
 * spi.h
 *
 *  Created on: 2021Äê6ÔÂ26ÈÕ
 *      Author: graydon
 */
 
#ifndef DRV_SPI_H_
#define DRV_SPI_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "config.h"
 
typedef enum {
    SPI_BUSY,  //SPIæ²»ÄÜ·¢ËͺͽÓÊÕ
    SPI_TX,   //SPI´¦ÓÚ·¢ËÍÊý¾Ý״̬
    SPI_RX,   //SPI´¦ÓÚ½ÓÊÕÊý¾Ý״̬
    SPI_TRX,  //SPI´¦ÓÚͬʱ·¢ËͽÓÊÕÊý¾Ý״̬
}SPIStatus;
 
#define V2
 
extern volatile unsigned char     SPI_Tx_BUFFER[SPI_BUFFER_SIZE];
extern volatile unsigned char     SPI_Rx_BUFFER[SPI_BUFFER_SIZE];
extern volatile short SPIRxDone ;
extern volatile short SPITxDone ;
 
void SPI2_SetTransMode(SPIStatus status);
 
int SPI2_Init(void);
 
#ifdef __cplusplus
}
#endif
#endif /* DRV_SPI_H_ */