LPC1768 UART0

本文档详细介绍了如何配置LPC1768微控制器的UART0接口,以中断方式实现串口通信。内容包括设置波特率、数据位、奇偶校验位、停止位以及初始化UART0的步骤,并提供了中断处理函数的实现。
摘要由CSDN通过智能技术生成

本案例中UART0的接收使用中断方式,下面是对UART0的初始操作:

 

//=============================================================================

#define BR_1200                      0
#define BR_2400                      1
#define BR_4800                      2
#define BR_9600                      3
#define BR_19200                    4
#define BR_38400                    5
#define BR_57600                    6
#define BR_115200                  7

#define WORD_LEN_5_BITS            0
#define WORD_LEN_6_BITS            1
#define WORD_LEN_7_BITS            2
#define WORD_LEN_8_BITS            3

#define NO_PARITY                    0
#define ODD_PARITY                 1
#define EVENT_PARITY              2

#define STOP_BIT_1                   0
#define STOP_BIT_2                   1

typedef struct 
{
   U8   ubDLL;      
   U8   ubDLM;    
   U8   ubFDR;      
}BaudRateReg_T;
extern BaudRateReg_T   tBaudRateReg;

 

#define UART0_BUF_LENGTH           20
extern U8   aubUart0_RxBuf[UART0_BUF_LENGTH];

//=========================================================&#

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值