STM32 SPI 问题

2019-03-23 19:26发布

第一次用STM32,在SPI上遇到个问题~

SPI写字节函数里面

unsigned char XPT2046_SendByte(unsigned char byte)
{
  /* Loop while DR register in not emplty */
  while (SPI_I2S_GetFlagStatus(SPI3, SPI_I2S_FLAG_TXE) == RESET);


  /* Send Half Word through the SPI3 peripheral */
  SPI_I2S_SendData(SPI3, byte);


  /* Wait to receive a Half Word */
  while (SPI_I2S_GetFlagStatus(SPI3, SPI_I2S_FLAG_RXNE) == RESET);


  /* Return the Half Word read from the SPI bus */
  return SPI_I2S_ReceiveData(SPI3);
}
程序一直卡死在红 {MOD}那句,不知道为什么,求教~ 此帖出自小平头技术问答
0条回答

一周热门 更多>