收藏 分享(赏)

stm32快速学习4——串口发送字符.doc

上传人:wspkg9802 文档编号:6614394 上传时间:2019-04-18 格式:DOC 页数:2 大小:22.50KB
下载 相关 举报
stm32快速学习4——串口发送字符.doc_第1页
第1页 / 共2页
stm32快速学习4——串口发送字符.doc_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

1、设定 UART1 时钟设定发送脚功能串口设置,使能#include “stm32f10x.h“void RCC_Configuration(void);void GPIO_Configuration(void);void USART_Configuration(void);unsigned char str=“A“;int main(void)RCC_Configuration();GPIO_Configuration();USART_Configuration();USART_SendData(USART1,str0); while(1);void RCC_Configuration(voi

2、d) RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, ENABLE);void GPIO_Configuration(void)GPIO_InitTypeDef GPIO_InitStructure;/*只设定了发送*/GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;GPIO_Init(GPIOA, void USART_Con

3、figuration(void)USART_InitTypeDef USART_InitStructure;USART_InitStructure.USART_BaudRate = 115200;USART_InitStructure.USART_WordLength = USART_WordLength_8b;USART_InitStructure.USART_StopBits = USART_StopBits_1;USART_InitStructure.USART_Parity = USART_Parity_No;USART_InitStructure.USART_HardwareFlowControl= USART_HardwareFlowControl_None;USART_InitStructure.USART_Mode = USART_Mode_Tx; /*只设定了发送*/USART_Init(USART1 , USART_Cmd(USART1, ENABLE);

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 企业管理 > 管理学资料

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报