国产亚洲精品AA片在线观看,丰满熟妇HD,亚洲成色www成人网站妖精,丁香五月天婷婷五月天男人天堂

新聞中心

EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > stm32 SPI 讀取和寫入的問題

stm32 SPI 讀取和寫入的問題

作者: 時(shí)間:2016-11-17 來源:網(wǎng)絡(luò) 收藏
stm32 SPI讀取和寫入和USART 一樣需要判斷標(biāo)志位
unsigned char SPI1_ReadWrite(unsigned char writedat)
{
/* Loop while DR register in not emplty */
while(SPI_I2S_GetFlagStatus(SPI1,SPI_I2S_FLAG_TXE) == RESET);
/* Send byte through the SPI1 peripheral */
SPI_I2S_SendData(SPI1, writedat);
/* Wait to receive a byte */
while(SPI_I2S_GetFlagStatus(SPI1, SPI_I2S_FLAG_RXNE) == RESET);
/* Return the byte read from the SPI bus */
return SPI_I2S_ReceiveData(SPI1);
}



關(guān)鍵詞: stm32SPI讀取和寫

評(píng)論


技術(shù)專區(qū)

關(guān)閉