电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

STM32f407一个串口收传给另一个串口再发送出去串口收发设置VIP专享VIP免费

STM32f407一个串口收传给另一个串口再发送出去串口收发设置_第1页
STM32f407一个串口收传给另一个串口再发送出去串口收发设置_第2页
STM32f407一个串口收传给另一个串口再发送出去串口收发设置_第3页
/* Includes ------------------------------------------------------------------*/ #include "stm32f4xx_conf.h" #include void Delay(__IO uint32_t nCount); //*********************************************** //函数功能:延时ms //入口参数:延时长度 //出口参数:无 //备 注: //************************************************ void Delay_ms(u16 ms) { u32 j; for(;ms>0;ms--) for(j=0;j<9700;j++); } //*********************************************** //函数功能:IO 配置 //入口参数:无 //出口参数:无 //备 注: //************************************************ void GPIO_Configuration(void) { GPIO_InitTypeDef GPIO_InitStructure; /* GPIOD Periph clock enable */ RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE); /* Configure PD12, PD13, PD14 and PD15 in output pushpull mode */ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(GPIOC, &GPIO_InitStructure); /* Configure PA0 pin as input floating */ //GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN; //GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; //GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0; //GPIO_Init(GPIOA, &GPIO_InitStructure); } //*********************************************** //函数功能:UART 配置 //入口参数:无 //出口参数:无 //备 注: //************************************************ void USART_Configuration(void) { USART_InitTypeDef USART_InitStructure; USART_InitStructure.USART_BaudRate =9600; //波特率 USART_InitStructure.USART_WordLength = USART_WordLength_8b; //8 位数据 USART_InitStructure.USART_StopBits = USART_StopBits_1; //停止位 USART_InitStructure.USART_Parity = USART_Parity_No; // 校验方式:无 USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None; //硬件流控制失能 ...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部