中级会员
 
- 积分
- 313
- 金钱
- 313
- 注册时间
- 2017-12-12
- 在线时间
- 26 小时
|

楼主 |
发表于 2018-9-26 15:03:22
|
显示全部楼层
是不是使用下面的函数?
/**
* @brief Returns the most recent received data by the USARTx peripheral.
* @param USARTx: Select the USART or the UART peripheral.
* This parameter can be one of the following values:
* USART1, USART2, USART3, UART4 or UART5.
* @retval The received data.
*/
uint16_t USART_ReceiveData(USART_TypeDef* USARTx)
{
/* Check the parameters */
assert_param(IS_USART_ALL_PERIPH(USARTx));
/* Receive Data */
return (uint16_t)(USARTx->DR & (uint16_t)0x01FF);
} |
|