📄 uart0.h
字号:
#ifndef _UART0_H_
#define _UART0_H_
#include "config.h"
#ifdef _UART0_C_
static uint8 UART0SendSem;
static uint8 UART0ReceiveSem;
static uint8 UART0SendQSem;
static uint8 UART0ReceiveQSem;
#endif
#ifndef NULL
#define NULL (void *)0
#endif
#define UART0_SENDQ_LENGTH 64
#define UART0_Receive_LENGTH 16
#define UART0_EnterCritical()
#define UART0_ExitCritical()
#define UART0_SemCreate(sem, val, pErr) do{sem = val;*pErr = 0;}while(0)
#define UART0_SemPend(sem) do{while(sem == 0);sem--;}while(0)
#define UART0_SemPost(sem) do{sem++;}while(0)
enum
{
NO_PARITY,
ODD,
EVEN,
FORCE_0,
FORCE_1
};
uint8 UART0_Init(uint32 baud, uint8 dataBits, uint8 parityCheck, uint8 stopBits);
void UART0_Setup(uint32 baud, uint8 dataBits, uint8 parityCheck, uint8 stopBits);
void UART0_Send(uint8 *buf, uint32 nBytes);
void UART0_Receive(uint8 *buf, uint32 nBytes);
void UART0_IntService(void);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -