CH552/project/examples/SPI/SPI.H

67 lines
2.6 KiB
C++
Raw Normal View History

2018-10-17 10:44:45 +02:00
// #define SPI_INTERRUPT 1
#define SPI_CK_SET( n ) (SPI0_CK_SE = n) //SPIʱ<49><CAB1><EFBFBD><EFBFBD><EFBFBD>ú<EFBFBD><C3BA><EFBFBD>
/*******************************************************************************
* Function Name : SPIMasterModeSet( UINT8 mode )
* Description : SPI<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>
* Input : UINT8 mode
* Output : None
* Return : None
*******************************************************************************/
void SPIMasterModeSet(UINT8 mode);
/*******************************************************************************
* Function Name : CH554SPIInterruptInit()
* Description : CH554SPI<EFBFBD>жϳ<EFBFBD>ʼ<EFBFBD><EFBFBD>
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void CH554SPIInterruptInit();
/*******************************************************************************
* Function Name : CH554SPIMasterWrite(UINT8 dat)
* Description : CH554Ӳ<EFBFBD><EFBFBD>SPIд<EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ
* Input : UINT8 dat <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* Output : None
* Return : None
*******************************************************************************/
void CH554SPIMasterWrite(UINT8 dat);
/*******************************************************************************
* Function Name : CH554SPIMasterRead( )
* Description : CH554Ӳ<EFBFBD><EFBFBD>SPI0<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģʽ
* Input : None
* Output : None
* Return : UINT8 ret
*******************************************************************************/
UINT8 CH554SPIMasterRead();
/*******************************************************************************
* Function Name : SPISlvModeSet( )
* Description : SPI<EFBFBD>ӻ<EFBFBD>ģʽ<EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD>
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void SPISlvModeSet( );
/*******************************************************************************
* Function Name : CH554SPISlvWrite(UINT8 dat)
* Description : CH554Ӳ<EFBFBD><EFBFBD>SPIд<EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><EFBFBD>ӻ<EFBFBD>ģʽ
* Input : UINT8 dat <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* Output : None
* Return : None
*******************************************************************************/
void CH554SPISlvWrite(UINT8 dat);
/*******************************************************************************
* Function Name : CH554SPISlvRead( )
* Description : CH554Ӳ<EFBFBD><EFBFBD>SPI0<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD><EFBFBD>ӻ<EFBFBD>ģʽ
* Input : None
* Output : None
* Return : UINT8 ret
*******************************************************************************/
UINT8 CH554SPISlvRead();