tiny6410串口驱动程序设计

本文介绍了如何为Tiny6410开发串口驱动程序,包括配置引脚功能、设置数据格式、选择工作模式、计算波特率以及实现字符的发送和接收函数。在main函数中通过调用`uart_init()`初始化串口,使用`puta()`和`geta()`函数进行数据传输。
摘要由CSDN通过智能技术生成

建立文件uart.c。

#define GPACON     (*((volatile unsigned short *)0x7F008000))
#define ULCON0     (*((volatile unsigned long *)0x7F005000))
#define UCON0       (*((volatile unsigned long *)0x7F005004))
#define UTRSTAT0   (*((volatile unsigned long *)0x7F005010))
#define UBRDIV0     (*((volatile unsigned short *)0x7F005028))
#define UTXH0       (*((volatile unsigned char *)0x7F005020))
#define URXH0       (*((volatile unsigned char *)0x7F005024))
#define UDIVSLOT0   (*((volatile unsigned short *)0x7F00502C))


#define PCLK 66500000
#define BAUD 115200


void uart_init()
{
    //1.配置引脚功能

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值