AVR单片机的串口查询设计

* code adapted from atmel avr application note avr306
* polledmode driver foruart, this is the similar to the
* library default putchar() and getchar() in iccavr
*/
#include
#include
#include “uart.h”
/* initialize uart */
void inituart( unsigned char baudrate )
{
ubrr = baudrate; /* set the baud rate */
ucr = bit(rxen) | bit(txen); /* enable uart receiver and transmitter */
}
/* read and write functions */
unsigned char receivebyte( void )
{
while ( !(usr & (1《; /* return the data */
return udr;
}
void transmitbyte( unsigned char data )
{
while ( !(usr & (1《; /* wait for empty transmit buffer */
udr = data; /* start transmittion */
}
#ifdef test
/* main - a simple test program*/
void main( void )
{
inituart( 11 ); /* set the baudrate to 19,200 bps using a
3.6864mhzcrystal */
while ( 1 ) /* forever */
{
transmitbyte( receivebyte() ); /* echo the received character */
}
}
#endif

高德红外子公司轩辕智驾承担红外辅助驾驶制造供应任务
ARM暂停与华为的业务将会对华为会构成难以克服的打击
STM32F407IGHX与Ubuntu20.04虚拟串口通信
紫光展锐正式跻身全球芯片设计第一梯队
【回顾往年CES】联想推出一款智能跑步鞋,可通过手机APP收集数据
AVR单片机的串口查询设计
iPhone8再曝渲染图,iOS出现大BUG!
三星、爱立信开始“对掐”起来了
浅谈IDC数据中心综合布线互联
增程式电动汽车与纯电动汽车有什么不同
OPPO投资重金建印度工业园 华为提出10%的市场目标
不用电力电容器补偿电损会增大多少
电缆线防剪报讯机电路原理
中国正打造无人机运输网 四川或为最先实验地区
传海力士收购英特尔大连厂:打破日本封锁,欲为从中国购买材料
边缘的超低功耗关键短语检测
华为在韩国建立5G开放实验室 OPPO Reno Z在香港发布
智能化妆镜是什么,它的功能都有哪些
太阳能混合动力系统中安科瑞光伏直流电能计量表的应用
传感器在我们的生活中都有哪些应用案例