完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
在 STM32F4 固件库中对串口 USART 的描述原文如下:
************************************************************************ * @brief This file provides firmware functions to manage the following * functionalities of the Universal synchronous asynchronous receiver * transmitter (USART): * + Initialization and Configuration * + Data transfers * + Multi-Processor Communication * + LIN mode * + Half-duplex mode * + Smartcard mode * + IrDA mode * + DMA transfers management * + Interrupts and flags management * =================================================================== ##### How to use this driver ##### =================================================================== [..] (#) Enable peripheral clock using the following functions RCC_APB2PeriphClockCmd(RCC_APB2Periph_USARTx, ENABLE) for USART1 and USART6 RCC_APB1PeriphClockCmd(RCC_APB1Periph_USARTx, ENABLE) for USART2, USART3, UART4 or UART5. (#) According to the USART mode, enable the GPIO clocks using RCC_AHB1PeriphClockCmd() function. (The I/O can be TX, RX, CTS, or/and SCLK). (#) Peripheral's alternate function: (++) Connect the pin to the desired peripherals' Alternate Function (AF) using GPIO_PinAFConfig() function (++) Configure the desired pin in alternate function by: GPIO_InitStruct->GPIO_Mode = GPIO_Mode_AF (++) Select the type, pull-up/pull-down and output speed via GPIO_PuPd, GPIO_OType and GPIO_Speed members (++) Call GPIO_Init() function (#) Program the Baud Rate, Word Length , Stop Bit, Parity, Hardware flow control and Mode(Receiver/Transmitter) using the USART_Init() function. (#) For synchronous mode, enable the clock and program the polarity, phase and last bit using the USART_ClockInit() function. (#) Enable the NVIC and the corresponding interrupt using the function USART_ITConfig() if you need to use interrupt mode. (#) When using the DMA mode (++) Configure the DMA using DMA_Init() function (++) Active the needed channel Request using USART_DMACmd() function (#) Enable the USART using the USART_Cmd() function. (#) Enable the DMA using the DMA_Cmd() function, when using DMA mode. -@- Refer to Multi-Processor, LIN, half-duplex, Smartcard, IrDA sub-sections for more details [..] In order to reach higher communication baudrates, it is possible to enable the oversampling by 8 mode using the function USART_OverSampling8Cmd(). This function should be called after enabling the USART clock (RCC_APBxPeriphClockCmd()) and before calling the function USART_Init(). @endverbatim ****************************************************************************** * @attention * *
|
|
|
|
只有小组成员才能发言,加入小组>>
调试STM32H750的FMC总线读写PSRAM遇到的问题求解?
1683 浏览 1 评论
X-NUCLEO-IHM08M1板文档中输出电流为15Arms,15Arms是怎么得出来的呢?
1582 浏览 1 评论
1013 浏览 2 评论
STM32F030F4 HSI时钟温度测试过不去是怎么回事?
703 浏览 2 评论
ST25R3916能否对ISO15693的标签芯片进行分区域写密码?
1627 浏览 2 评论
1892浏览 9评论
STM32仿真器是选择ST-LINK还是选择J-LINK?各有什么优势啊?
675浏览 4评论
STM32F0_TIM2输出pwm2后OLED变暗或者系统重启是怎么回事?
538浏览 3评论
558浏览 3评论
stm32cubemx生成mdk-arm v4项目文件无法打开是什么原因导致的?
526浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-4 02:56 , Processed in 0.627799 second(s), Total 46, Slave 39 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号