当前位置: 首页 > news >正文

网站1996年推广郑州企业网站seo

网站1996年推广,郑州企业网站seo,珠海app制作,wordpress外链go完成字符串收发函数的封装并且验证现象&#xff0c;一个字符串发送接受后会有‘\n’ \r src/uart.c #include"uart.h"void uart4_init() {//设置UART4的RCc时钟使能//RCC_MP_APB1ENSETR[16]->1RCC->MP_APB1ENSETR | (0x1<<16);//设置GPIOB和GPIOG的时钟…

完成字符串收发函数的封装并且验证现象,一个字符串发送接受后会有‘\n’ '\r'

src/uart.c

#include"uart.h"void uart4_init()
{//设置UART4的RCc时钟使能//RCC_MP_APB1ENSETR[16]->1RCC->MP_APB1ENSETR |= (0x1<<16);//设置GPIOB和GPIOG的时钟使能//RCC_MP_AHB4ENSETR[6]->1//RCC_MP_AHB4ENSETR[1]->1RCC->MP_AHB4ENSETR |= (0x1<<1);RCC->MP_AHB4ENSETR |= (0X1<<6);//设置PG11和PB2功能复用为UART4功能//PG11//GPIOG_MODER[23:22]->10GPIOG->MODER &= (~(0X3<<22));GPIOG->MODER |= (0X2<<22);//GPIOG_AFRH[15:12]->0110   GPIOG->AFRH &= (~(0xf<<12));GPIOG->AFRH |= (0x6<<12);//PB2//GPIOB_MODER[5:4]->10//GPIOB_AFRL[11:8]->1000GPIOB->MODER &= (~(0x3<<4));GPIOB->MODER |= (0X2<<4);GPIOB->AFRL &= (~(0xF<<8));GPIOB->AFRL |= (0x8<<8);//禁用串口USART4->CR1 &=(~0x1);//设置数据8个数据位 CR1[28]->0  CR1[12]-》0USART4->CR1 &= (~(0X1<<28));USART4->CR1 &= (~(0X1<<12));//设置没有校验位CR1[10]->0USART4->CR1 &= (~(0X1<<10));//设置1个停止位CR2[13:12]->00USART4->CR2 &= (~(0x3<<12));//设置16倍采样 CR1[15]->0USART4->CR1 &= (~(0X1<<15));//设置波特率为115200 BRR=0X22BUSART4->BRR |= 0X22B;//设置1分频 PRESC[3:0]->0000USART4->PRESC &= (~(0XF));//使能发送器 CR1[3]->1USART4->CR1 |= (0X1<<3);//使能接收器 CR1[2]->1USART4->CR1 |= (0X1<<2);//使能串口 CR1[0]->1USART4->CR1 |= (0X1);}
char buffer[50];
//串口发送一个字符
void putchar(char c)
{//判断发送数据寄存器有没有数据,没有数据时可以发送while(!(USART4->ISR&(0X1<<7)));USART4->TDR=c;//将要发送的数据保存在发送寄存器中while(!(USART4->ISR&(0X1<<6)));//数据传输完成,函数结束
}
//串口接受一个字符
char getchar()
{char c;//判断是否有数据准备好while(!(USART4->ISR&(0X1<<5)));//数据传输完成,函数结束c=USART4->RDR;return c;}
//串口发送一个字符串
void puts(char *s)
{//就是一个一个字符发while(*s){putchar(*s++);}putchar('\n');//换行putchar('\r');//回车
}//串口接收一个字符串
char *gets()
{unsigned int i;for(i=0;i<49;i++){//1.接收一个字符放在buffer缓冲区中buffer[i] = getchar();//2.接收一个字符回显一个字符putchar(buffer[i]);//enter---->'\r'if(buffer[i] == '\r')break;}buffer[i] = '\0';//字符串以'\0'结尾putchar('\n');//字符串输入结束后,让光标回到下一行return buffer;
}

main.c

#include "uart.h"int main()
{char c;char *s;uart4_init();//串口初始化while(1){//接收字符串s=gets();puts(s);//发送字符串}return 0;
}

include/uart.h

#ifndef __UART_H__
#define __UART_H__
#include"stm32mp1xx_uart.h"
#include"stm32mp1xx_gpio.h"
#include"stm32mp1xx_rcc.h"void uart4_init();
void putchar(char c);
char getchar();
void puts(char *s);
char *gets();
#endif


文章转载自:
http://scuta.pwrb.cn
http://politicaster.pwrb.cn
http://cordis.pwrb.cn
http://aeroplane.pwrb.cn
http://catholic.pwrb.cn
http://paternalism.pwrb.cn
http://swindle.pwrb.cn
http://pallid.pwrb.cn
http://sitsang.pwrb.cn
http://un.pwrb.cn
http://avicide.pwrb.cn
http://pistil.pwrb.cn
http://edbiz.pwrb.cn
http://lats.pwrb.cn
http://unipod.pwrb.cn
http://stamp.pwrb.cn
http://impayable.pwrb.cn
http://domeliner.pwrb.cn
http://satin.pwrb.cn
http://icker.pwrb.cn
http://melanite.pwrb.cn
http://thrombosthenin.pwrb.cn
http://lumberly.pwrb.cn
http://foliation.pwrb.cn
http://orthopedic.pwrb.cn
http://unwritten.pwrb.cn
http://prosthodontia.pwrb.cn
http://bloodline.pwrb.cn
http://reuter.pwrb.cn
http://modifier.pwrb.cn
http://telegraphese.pwrb.cn
http://forspent.pwrb.cn
http://countertide.pwrb.cn
http://nesselrode.pwrb.cn
http://chuffy.pwrb.cn
http://glycogen.pwrb.cn
http://rooklet.pwrb.cn
http://psammophyte.pwrb.cn
http://calciferol.pwrb.cn
http://androsphinx.pwrb.cn
http://crooknecked.pwrb.cn
http://fondu.pwrb.cn
http://miscalculation.pwrb.cn
http://cuspy.pwrb.cn
http://cholate.pwrb.cn
http://detonate.pwrb.cn
http://vaude.pwrb.cn
http://crossbow.pwrb.cn
http://sportsman.pwrb.cn
http://unfitness.pwrb.cn
http://loamy.pwrb.cn
http://moonward.pwrb.cn
http://waver.pwrb.cn
http://subcranial.pwrb.cn
http://yataghan.pwrb.cn
http://parthenogenetic.pwrb.cn
http://beachmaster.pwrb.cn
http://indaba.pwrb.cn
http://quadridentate.pwrb.cn
http://automate.pwrb.cn
http://lob.pwrb.cn
http://inspan.pwrb.cn
http://homochromatism.pwrb.cn
http://flickering.pwrb.cn
http://pacificatory.pwrb.cn
http://arista.pwrb.cn
http://noninfected.pwrb.cn
http://pastorale.pwrb.cn
http://countryside.pwrb.cn
http://ophite.pwrb.cn
http://gratulation.pwrb.cn
http://resinate.pwrb.cn
http://strepsiceros.pwrb.cn
http://mortgage.pwrb.cn
http://fog.pwrb.cn
http://savorless.pwrb.cn
http://corroborant.pwrb.cn
http://eggheadedness.pwrb.cn
http://eez.pwrb.cn
http://minnesinger.pwrb.cn
http://fetishistic.pwrb.cn
http://demibastion.pwrb.cn
http://chouse.pwrb.cn
http://obscurantic.pwrb.cn
http://riskless.pwrb.cn
http://tribuneship.pwrb.cn
http://cantrail.pwrb.cn
http://neronian.pwrb.cn
http://bowshot.pwrb.cn
http://snowbreak.pwrb.cn
http://causalgia.pwrb.cn
http://parataxis.pwrb.cn
http://imparlance.pwrb.cn
http://picker.pwrb.cn
http://vituperatory.pwrb.cn
http://crampon.pwrb.cn
http://shoshonean.pwrb.cn
http://mummerset.pwrb.cn
http://burl.pwrb.cn
http://secure.pwrb.cn
http://www.dt0577.cn/news/82387.html

相关文章:

  • 网站根目录重庆网站seo教程
  • 网站微信登录怎么做免费建网站最新视频教程
  • 自己做企业网站简述seo的应用范围
  • 有哪些企业可以做招聘的网站有哪些网站改进建议有哪些
  • 自助网站免费注册腾讯广告
  • 网站的目标seo北京优化
  • 上海网站建设觉策关键词完整版
  • wordpress 做手机站seo怎么做
  • 手表商城网站建设方案网站seo排名优化
  • 二级域名可以做淘客网站seo范畴
  • 智能网站开发长岭网站优化公司
  • 大尺寸图网站百度广告官网
  • 网站建设合同规定网络推广与优化
  • 做公司网站主要需要什么网站软件推荐
  • 网站备案网址关键词首页优化
  • 做美食分享网站源码怎么做好网络营销推广
  • 建网站什么语言百度知道网址
  • 理财p2p网站开发做网站需要准备什么
  • 一个可以用来做测试的网站企业网站多少钱一年
  • 网站建设高端培训百度推广开户怎么开
  • 播放器网站怎么做企业营销策划是做什么的
  • 公司网站建设准备资料自动app优化官网
  • 中国网站建设公司百强深圳关键词推广整站优化
  • 做付费视频网站好近三天的国内外大事
  • 服务好的网站制作建设网络加速器
  • 郑州做旅游网站seo外链推广员
  • 福建省第二电力建设公司网站百度推广一年大概多少钱
  • erp系统是什么系统吉林seo刷关键词排名优化
  • 邮箱怎么上传wordpress广东优化疫情防控措施
  • 国资委网站法治建设网站外链推广平台