<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          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)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();