ARM输入输出
来源:互联网 发布:2008最伤感网络歌曲 编辑:程序博客网 时间:2024/06/10 21:50
//GPA1
#define GPA1CON (volatile unsigned int *)0x11400020//#define GPA1DAT (volatile unsigned int *)0x11400024
//ULCON2
#define ULCON2 (volatile unsigned int *)0x13820000
#define UCON2 (volatile unsigned int *)0x13820004
#define UBRDIV2 (volatile unsigned int *)0x13820028
#define UFRACVAL2 (volatile unsigned int *)0x1382002c
#define UTXH2 (volatile unsigned int *)0x13820020
#define URXH2 (volatile unsigned int *)0x13820024
#define UTRSTAT2 (volatile unsigned int *)0x13820010
void uart_init(void)
{
*GPA1CON = *GPA1CON & ~(0xff) | 0x22;//复用
*ULCON2 = 0x3;
*UCON2 = *UCON2 & ~(0xf) | 0x5;
*UBRDIV2 = 53;
*UFRACVAL2 = 4;
}
char uart_rxd(void)
{
while(!(*UTRSTAT2 & (0x1)));
return *URXH2;
}
void uart_txd(char c)
{
while(!(*UTRSTAT2 & (0x2)));
*UTXH2 = c;
}
void main(void)
{
uart_init();
while(1)
{
uart_txd(uart_rxd());
}
}
阅读全文
0 0
- ARM输入输出
- 输入输出
- 输入输出
- 输入输出
- 输入输出
- 输入输出
- 输入输出
- 输入输出
- 输入输出
- 输入输出
- 输入输出
- 输入输出
- 输入输出
- 输入输出
- 输入输出
- 输入输出
- 输入输出
- 输入输出
- Android开发-微信分享功能
- MyBatis学习
- jquery制作简单的投票系统
- AES加密
- 程导微编MikroElektronika.Compilers.and.Software.Tools.2017.09 11CD
- ARM输入输出
- ubuntu14.04拒绝winscp的连接请求问题的解决笔记
- Could not resolve com.android.supportsupport-annotations25.4.0
- 编译LEDE-Openwrt系统
- Idea快捷键
- Python2.7+PyQt4 QtDesigner学习笔记系列——3:QtDesigner第一个小程序
- 小米XiaoMi MIUI 7/8/9开发版怎么设置锁屏QQ来消息时弹出消息框?
- VirtualBox 复制虚拟机网络连接失败
- 25、C#里面TextBox编辑框的使用