新聞中心

stm32 Usart 初始化

作者: 時(shí)間:2016-11-17 來源:網(wǎng)絡(luò) 收藏
庫文件中給出了初始化stm32 USART 的范例
/**
* @brief Fills each USART_InitStruct member with its default value.
* @param USART_InitStruct: pointer to a USART_InitTypeDef structure
* which will be initialized.
* @retval None
*/
void USART_StructInit(USART_InitTypeDef* USART_InitStruct)
{
/* USART_InitStruct members default value */
USART_InitStruct->USART_BaudRate = 9600;
USART_InitStruct->USART_WordLength = USART_WordLength_8b;
USART_InitStruct->USART_StopBits = USART_StopBits_1;
USART_InitStruct->USART_Parity = USART_Parity_No ;
USART_InitStruct->USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
USART_InitStruct->USART_HardwareFlowControl = USART_HardwareFlowControl_None;
}
所以初始設(shè)置也是依樣畫葫蘆。


關(guān)鍵詞: stm32Usart初始

評論


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

關(guān)閉