?? scif0.h
字號:
//
// Copyright(C) Renesas Technology Corp. 1999-2003. All rights reserved.
//
// Serial(SCIF0) driver for ITS-DS7
//
// FILE : scif0.c
// CREATED : 2002.06.26
// MODIFIED : 2003.06.20
// AUTHOR : Renesas Technology Corp.
// HARDWARE : RENESAS ITS-DS7
// HISTORY :
// 2003.06.20
// - Created release code.
// (based on Serial driver for
// ITS-DS4 Source Kit Ver.1.2.0 for WCE 4.2)
//
/*++
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.
Copyright (c) 1995-2000 Microsoft Corporation. All rights reserved.
Module Name:
SER_PDD.h
Abstract:
Holds definitions for sample 16550 serial interface.
Notes:
--*/
#ifndef __SER_PDD_H__
#define __SER_PDD_H__
#ifdef __cplusplus
extern "C" {
#endif
// Borrow the IR zone from MDD and use it as EP0 & USB specific stuff
#define ZONE_USB ZONE_IR
// We can be built with a simple setting 0, or optionally add
// a second setting which includes an interrupt endpoint
//#define INT_SETTING 1
#define INT_SETTING 0
#define min(a,b) (((a) < (b)) ? (a) : (b))
//828
#define SET_CONTROL_REG 0xf0
#define PORTSWITCH_USB_FUNC 0x01
// Since SH7727 doesn't interrupt on disconnect, I was trying to detect by watching
// SOFs. But that isn't guaranteed to be an actual disconnect, it could be the
// host suspending the bus to save power.
#define POLL_FOR_DISCONNECT 0
// Strict timing requirements at enumeration. Use a relatively high priority
#define DEFAULT_THREAD_PRIO 100
// We poll for device detach at the following rate.
#define UDC_POLL_RATE 500
// And simulate disconnect if SOF unchanged this many interations
#define SOF_STABLE_MAX 3
// Use this macro to determine if we are in Data0 or Data1 phase
// #define DATA1( dat_cnt ) ( ((dat_cnt) ^= 0x01) )
#define DATA1( dat_cnt ) ( ((++dat_cnt) & 0x01) )
// We use a callback for serial events
typedef VOID (*EVENT_FUNC)(PVOID Arg1, ULONG Arg2);
// Here is the callback for serial events
typedef VOID (*PFN_SER_EVENT) (
PVOID pHandle, // PHW_INDEP_INFO, but pdd doesn't know it
UINT32 events // What events where encountered?
);
/*
* @doc HWINTERNAL
* @struct SER_INFO | Private structure.
*/
// And now, all the function prototypes
PVOID
SerInit(
ULONG Identifier,
PVOID pMddHead,
PHWOBJ pHWObj
);
BOOL SerPostInit(
PVOID pHead
);
BOOL SerDeinit(
PVOID pHead
);
BOOL SerOpen(
PVOID pHead
);
ULONG SerClose(
PVOID pHead
);
VOID SerClearDTR(
PVOID pHead
);
VOID SerSetDTR(
PVOID pHead
);
VOID SerClearRTS(
PVOID pHead
);
VOID SerSetRTS(
PVOID pHead
);
VOID SerClearBreak(
PVOID pHead
);
VOID SerSetBreak(
PVOID pHead
);
VOID SerClearBreak(
PVOID pHead
);
VOID SerSetBreak(
PVOID pHead
);
ULONG SerGetByteNumber(
PVOID pHead
);
VOID SerDisableXmit(
PVOID pHead
);
VOID SerEnableXmit(
PVOID pHead
);
BOOL SerSetBaudRate(
PVOID pHead,
ULONG BaudRate // ULONG representing decimal baud rate.
);
BOOL SerSetDCB(
PVOID pHead,
LPDCB lpDCB // Pointer to DCB structure
);
ULONG SerSetCommTimeouts(
PVOID pHead,
LPCOMMTIMEOUTS lpCommTimeouts // Pointer to CommTimeout structure
);
ULONG SerGetRxBufferSize(
PVOID pHead
);
INTERRUPT_TYPE SerGetInterruptType(
PVOID pHead
);
ULONG SerRxIntr(
PVOID pHead,
PUCHAR pRxBuffer, // Pointer to receive buffer
ULONG *pBufflen // In = max bytes to read, out = bytes read
);
VOID SerTxIntr(
PVOID pHead,
PUCHAR pTxBuffer,
ULONG *pBufflen
);
VOID SerLineIntr(
PVOID pHead
);
VOID SerModemIntr(
PVOID pHead
);
ULONG SerGetStatus(
PVOID pHead,
LPCOMSTAT lpStat // Pointer to LPCOMMSTAT to hold status.
);
VOID SerReset(
PVOID pHead
);
VOID SerGetModemStatus(
PVOID pHead,
PULONG pModemStatus // PULONG passed in by user.
);
VOID SerPurgeComm(
PVOID pHead,
DWORD fdwAction // Action to take.
);
BOOL SerXmitComChar(
PVOID pHead,
UCHAR ComChar // Character to transmit.
);
BOOL SerPowerOn(
PVOID pHead
);
BOOL SerPowerOff(
PVOID pHead
);
BOOL SerIoctl(
PVOID pHead,
DWORD dwCode,
PBYTE pBufIn,
DWORD dwLenIn,
PBYTE pBufOut,
DWORD dwLenOut,
PDWORD pdwActualOut);
#ifdef __cplusplus
}
#endif
#endif __SER_PDD_H__
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -