⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pl011api.h

📁 ARM9基于WINDOWSCE的BSP源代码
💻 H
字号:
///////////////////////////////////////////////////////////////////////////////////////////////////
//
// Release Status:OS005-SW-70002-r0p0-00REL0
// $Copyright: 
// ----------------------------------------------------------------
// This confidential and proprietary software may be used only as
// authorised by a licensing agreement from ARM Limited
//   (C) COPYRIGHT 2004 ARM Limited
//       ALL RIGHTS RESERVED
// The entire notice above must be reproduced on all authorised
// copies and copies may only be made to the extent permitted
// by a licensing agreement from ARM Limited.
// ----------------------------------------------------------------
// File:     PL011api.h,v
// Revision: 1.1
// ----------------------------------------------------------------
// $
//
#ifndef PL011API_H_INCLUDED
#define PL011API_H_INCLUDED


#ifdef __cplusplus
extern "C" {
#endif


// Interrupt flags
//
#define PL011_INT_OE				0x400	// Overrun error
#define PL011_INT_BE				0x200	// Break error
#define PL011_INT_PE				0x100	// Parity error
#define PL011_INT_FE				0x080	// Framing error
#define PL011_INT_RT				0x040	// Receive time-out
#define PL011_INT_TX				0x020	// Transmit
#define PL011_INT_RX				0x010	// Receive
#define PL011_INT_DSR				0x008	// DSR
#define PL011_INT_DCD				0x004	// DCD
#define PL011_INT_CTS				0x002	// CTS
#define PL011_INT_RI				0x001	// RI

// Status flags
//
#define PL011_RSR_OE				0x08	// Overrun error
#define PL011_RSR_BE				0x04	// Break error
#define PL011_RSR_PE				0x02	// Parity error
#define PL011_RSR_FE				0x01	// Framing error
#define PL011_RSR_ALLERRORS			0x0F	// All errors

// FIFO trigger-level selects
//
#define PL011_FLSEL_1_8				0x0		// 1/8 full
#define PL011_FLSEL_1_4				0x1		// 1/4 full
#define PL011_FLSEL_1_2				0x2		// 1/2 full
#define PL011_FLSEL_3_4				0x3		// 3/4 full
#define PL011_FLSEL_7_8				0x4		// 7/8 full


// PL011 context type
//
typedef struct tagPL011_CONTEXT PL011_CONTEXT;


// Public function prototypes (external linkage, called by PDD)
//

PL011_CONTEXT* PL011Create(ULONG ulBaseAddress);
PL011_CONTEXT* PL011Delete(PL011_CONTEXT *pPL011);

BOOL PL011WaitTxEmpty(PL011_CONTEXT *pPL011, ULONG ulmsTimeout);

BOOL PL011ClearDTR(PL011_CONTEXT *pPL011);
BOOL PL011SetDTR(PL011_CONTEXT *pPL011);
BOOL PL011ClearRTS(PL011_CONTEXT *pPL011);
BOOL PL011SetRTS(PL011_CONTEXT *pPL011);
BOOL PL011ClearBreak(PL011_CONTEXT *pPL011);
BOOL PL011SetBreak(PL011_CONTEXT *pPL011);

BOOL PL011ClearPendingInterrupts(PL011_CONTEXT *pPL011);
BOOL PL011DisableAllInterrupts(PL011_CONTEXT *pPL011);
BOOL PL011EnableAllInterrupts(PL011_CONTEXT *pPL011);
BOOL PL011DisableTxInterrupts(PL011_CONTEXT *pPL011);
BOOL PL011EnableTxInterrupts(PL011_CONTEXT *pPL011);

BOOL PL011GetInterrupts(PL011_CONTEXT *pPL011, ULONG *fInterrupts);

BOOL PL011EnableFIFO(PL011_CONTEXT *pPL011, ULONG RxLevel, ULONG TxLevel);
BOOL PL011DisableFIFO(PL011_CONTEXT *pPL011);

BOOL PL011SetOutputMode(PL011_CONTEXT *pPL011, BOOL fUseIR, BOOL fUseCable);
BOOL PL011SetBaudRate(PL011_CONTEXT *pPL011, ULONG BaudRate);
BOOL PL011SetLineFormat(PL011_CONTEXT *pPL011,
						ULONG BaudRate,
						ULONG WordLength,
						ULONG Parity,
						ULONG StopBits);

BOOL PL011GetStatus(PL011_CONTEXT *pPL011, BOOL *pfDataReady, ULONG *pfModemStatus);
BOOL PL011ReadReceivedData(PL011_CONTEXT *pPL011, BOOL *pfReady, UCHAR *pbData, ULONG *pfStatus);
BOOL PL011XmitComChar(PL011_CONTEXT *pPL011, UCHAR ComChar, HANDLE hevTxReady);
BOOL PL011PurgeComm(PL011_CONTEXT *pPL011, ULONG fdwAction);
BOOL PL011GetModemStatus(PL011_CONTEXT *pPL011, ULONG *pfModemStatus);

BOOL PL011SendBytes(PL011_CONTEXT *pPL011, UCHAR const *pbBuffer, ULONG *pcbBuffLen);

BOOL PL011PowerOff(PL011_CONTEXT *pPL011);
BOOL PL011PowerOn(PL011_CONTEXT *pPL011);
BOOL PL011DMACtrl(PL011_CONTEXT *pPL011, DWORD value);

#ifdef DEBUG
BOOL PL011DumpRegisters(PL011_CONTEXT *pPL011);
#endif


#ifdef __cplusplus
}
#endif


#endif // PL011API_H_INCLUDED

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -