版本: 14/07/2004 : V1.3 我觉得这个库软件是不是只适用8位的,不适用16位的: inline void BSPI_WordSend(BSPI_TypeDef *BSPIx, u16 Data) { if ((BSPIx->CSR1 & 0x0400) == 0) Data <<= 8; BSPIx->TXR = Data; } inline u16 BSPI_WordReceive(BSPI_TypeDef *BSPIx) { return (BSPIx->CSR1 & 0x0400) == 0 ? BSPIx->RXR >> 8 : BSPIx->RXR; } void BSPI_BufferSend(BSPI_TypeDef *BSPIx, u8 *PtrToBuffer, u8 NbOfWords) { vu8 SendWord = 0; while (SendWord < NbOfWords) { BSPI_WordSend(BSPIx, *(PtrToBuffer+SendWord)); SendWord++; } } void BSPI_BufferReceive(BSPI_TypeDef *BSPIx, u8 *PtrToBuffer, u8 NbOfWords) { vu16 ReceiveWord = 0; while (ReceiveWord < NbOfWords) { *(PtrToBuffer+ReceiveWord) = BSPI_WordReceive(BSPIx); ReceiveWord++; } } 这两个函数的指针是U8的,SendWord++和ReceiveWord++只能8位地址加一,所以发和收都应该只能是8位的呀!小弟迷惑,请赐教!
|