📄 uart._h
字号:
#ifndef __UART__H
#define __UART__H
//初始化RS485通讯的流控制引脚
#define RS485_RD0_DDR DDRE
#define RS485_RD0_PORT PORTE
#define RS485_RD0_BIT (1<<PE2)
#define RS485_RD0_H RS485_RD0_PORT |= RS485_RD0_BIT
#define RS485_RD0_L RS485_RD0_PORT &= ~RS485_RD0_BIT
//-----------------------------------------------------------
//串口0初始化子程序
//-----------------------------------------------------------
void Uart0_Init(void);
//-----------------------------------------------------------
//串口0接收字节子程序
//-----------------------------------------------------------
unsigned char Getchar0(void);
//-----------------------------------------------------------
//串口0发送字节子程序
//-----------------------------------------------------------
void Putchar0(unsigned char c);
//-----------------------------------------------------------
//串口0发送字符串子程序
//-----------------------------------------------------------
void Putstr0(char *s);
//-----------------------------------------------------------
//串口0发送字符串子程序(带有换行符)
//-----------------------------------------------------------
void Puts0(char *s);
//-----------------------------------------------------------
//数组转换成可发送的字符串
//-----------------------------------------------------------
char *buffer2str(char *hhh);
//-----------------------------------------------------------
//数字转换成可发送的字符串
//-----------------------------------------------------------
char *long2str(unsigned long hh);
//-----------------------------------------------------------
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -