資源簡介
本程序使用可以讓多個串口使用Printf(),本程序中使用的是串口1和串口3
代碼片段和文件信息
#include?“usart.h“
void?USART_Configuration(void)
{
?? USART_InitTypeDef?USART_InitStructure;
?? USART_ClockInitTypeDef??USART_ClockInitStructure;
????GPIO_InitTypeDef?GPIO_InitStructure;
#if?(defined?USART3_INTERRUPT)?||?(defined?USART1_INTERRUPT)
// #if?(defined?USART3_INTERRUPT)?&&?(defined?B)
NVIC_InitTypeDef?NVIC_InitStructure;
??? #endif
?/*?Enable?USART1?and?GPIOA?clock?*/
??RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1?|?RCC_APB2Periph_GPIOA|RCC_APB2Periph_GPIOB|RCC_APB2Periph_AFIO?ENABLE);
??RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3?ENABLE);
?? /*?Configure?USART1?Tx?(PA.09)?as?alternate?function?push-pull?*/
?? GPIO_InitStructure.GPIO_Pin?=?GPIO_Pin_9;
? ?GPIO_InitStructure.GPIO_Mode?=?GPIO_Mode_AF_PP;
?? GPIO_InitStructure.GPIO_Speed?=?G
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2014-08-05?09:58??USART\
?????文件????????6749??2014-08-05?09:54??USART\usart.c
?????文件?????????556??2014-08-05?09:55??USART\usart.h
- 上一篇:eeupdate修改mac地址
- 下一篇:Verilog七段數碼管實現分時分頻功能
評論
共有 條評論