Microsoft Windows CE 3.0  

HW_VTBL

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

This structure stores function pointers to the functions that serial port drivers must implement.

typedef struct __HW_VTBL {
PVOID (*
HWInit
)(ULONG
Identifier
,
PVOID
pMDDContext
,
PHWOBJ
pHWObj
);
ULONG (*
HWDeinit
)(PVOIDpHead
);
BOOL (*
HWOpen
)(PVOID
pHead
);
ULONG (*
HWClose
)(PVOID
pHead
);
ULONG (*
HWGetBytes
)(PVOID
pHead
, PUCHAR
pTarget
,

                    PULONGpBytes
);
PVOID (*
HWGetRxStart
)(PVOID
pHead
);
INTERRUPT_TYPE (*
HWGetIntrType
)(PVOID
pHead
);
VOID (*
HWOtherIntrHandler
)(PVOID
pHead
);
VOID (*
HWLineIntrHandler
)(PVOID
pHead
);
ULONG (*
HWGetRxBufferSize
)(PVOID
pHead
);
VOID (*
HWTxIntrHandler
)(PVOID
pHead
);
ULONG (*
HWPutBytes
)(PVOID
pHead
, PUCHAR
pSrc
,

                    ULONG
NumBytes
, PULONG
pBytesSent
);
BOOL (*
HWPowerOff
)(PVOID
pHead
);
BOOL (*
HWPowerOn
)(PVOID
pHead
);
VOID (*
HWClearDTR
)(PVOID
pHead
);
VOID (*
HWSetDTR
)(PVOID
pHead
);
VOID (*
HWClearRTS
)(PVOID
pHead
);
VOID (*
HWSetRTS
)(PVOID
pHead
);
BOOL (*
HWEnableIR
)(PVOID
pHead
, ULONG
BaudRate
);
BOOL (*
HWDisableIR
)(PVOID
pHead
);
VOID (*
HWClearBreak
)(PVOID
pHead
);
VOID (*HWSetBreak)(PVOID
pHead
);
BOOL (*
HWXmitComChar
)(PVOID
pHead
, UCHAR
ComChar
);
ULONG (*
HWGetStatus
)(PVOID
pHead
, LPCOMSTAT
lpStat
);
VOID (*
HWReset
)(PVOID
pHead
);
VOID (*
HWGetModemStatus
)(PVOID
pHead
, PULONG
pModemStatus
);
VOID (*
HWGetCommProperties
)(PVOID
pHead
, LPCOMMPROP
pCommProp
);
VOID (*
HWPurgeComm
)(PVOID
pHead
, DWORD
fdwAction
);
BOOL (*
HWSetDCB
)(PVOID
pHead
, LPDCB
pDCB
);
BOOL (*
HWSetCommTimeouts
)(PVOID
pHead
, LPCOMMTIMEOUTS
lpCommTO
);
BOOL (*
HWIoctl
)(PVOID
pHead
, DWORD
dwCode
, PBYTE
pBufIn
,

                DWORD
dwLenIn
, PBYTE
pBufOut
,DWORD
dwLenOut
,

                PDWORD
pdwActualOut
);
} HW_VTBL, *PHW_VTBL;

Members

HWInit
A function which performs the required initialization for the serial port driver's PDD layer.
HWDeinit
A function which performs any required work, such as freeing allocated data structures, when the driver is deinitialized.
HWOpen
A function that is called when an application opens a serial port. Typically this function is responsible for powering the serial port hardware and initializing its state, if it is not already open.
HWClose
A function that is called when an application closes a serial port. Typically this function is responsible for freeing any data allocated in HWOpenand removing power from serial port hardware.
HWGetBytes
A function that is called by the MDD layer to retrieve received characters from the UART when RX_INTR is returned from the HWGetIntrTypefunction. The return value indicates number of received bytes, if any, that were dropped by the UART or the PDD.
HWGetRxStart
A function that returns the address of the start of the hardware receive buffer. This is subsequently passed to the InterruptInitializefunction.
HWGetIntrType
This function is called by the MDD layer when an interrupt event is signaled. This function determines the cause of the interrupt and returns an interrupt mask composed of the possible types INTR_RX, INTR_TX, INTR_MODEM, INTR_LINE, or INTR_NONE.
HWOtherIntrHandler
This function is called by the MDD layer to handle an INTR_MODEM interrupt.
HWLineIntrHandler
This function is called by the MDD layer to handle an INTR_LINE interrupt.
HWGetRxBufferSize
This function returns the number of bytes which can be held in the receive buffer or FIFO.
HWTxIntrHandler
This function is called by the MDD layer to handle an INTR_TX interrupt.
HWPutBytes
This function is called by the MDD layer's COM_Writefunction to transmit data. It loads the data in first-in, first-out (FIFO) order and returns to the MDD. A non-zero return code indicates that the MDD must perform polling to detect changes in the flow control state. Hardware which supports interrupt generation when the line state changes should return 0. The return value indicates number of milliseconds to wait before polling.
HWPowerOff
This function is called as part of the system's power-down sequence. This function may make no system calls, and should perform the minimum work required to save the serial port hardware's status.
HWPowerOn
This function is called as part of the system's power-on sequence. It should use data saved in HWPowerOffto restore the state of the serial port hardware. This function may not make system calls.
HWClearDTR
This function clears the Data Terminal Ready (DTR) signal.
HWSetDTR
This function sets the DTR signal.
HWClearRTS
This function clears the Request to Send (RTS) line
HWSetRTS
This function sets the RTS line.
HWEnableIR
This function enables the infrared (IR) interface for ports which support IR mode. Typically, this involves switching the UART outputs from a standard line driver to an IR LED interface.
HWDisableIR
This function disables IR mode on ports which support it.
HWClearBreak
This function clears the break condition on the TX line.
HWSetBreak
This function sets the break condition on the TX line. It is not supported by all UART chips.
HWXmitComChar
This function transmits the specified character ahead of any other data which may already have been queued by the HWPutBytesroutine. Not supported by all hardware.
HWGetStatus
This function is called in response to the IOCTL_SERIAL_GET_COMMSTATUS I/O control code. It returns the serial port's current status. This function must also clear the CommErrorsfield.
HWReset
This function resets the ComStatus structure used by HWGetStatus.
HWGetModemStatus
This function is called in response to the IOCTL_SERIAL_GET_MODEMSTATUS I/O control code. See the Win32 documentation for a description of the ModemStatusstructure.
HWGetCommProperties
This function fills in the CommPropertiesstructure with information about the serial port's device capabilities.
HWPurgeComm
This function clears the UART data as indicated by the TX_CLEAR, RX_CLEAR, TX_ABORT, and RX_ABORT flags.
HWSetDCB
This function sets the port characteristics as indicated by the DCBstructure passed as input to the function.
HWSetCommTimeouts
This function sets communications time-out values as indicated. One of the primary tasks of the MDD layer is to handle communications time-outs. The PDD layer typically does not have to do anything in its implementation of this function.
HWIoctl
This function handles any I/O control codes. In addition to the standard Win32 codes, any PDD layer may choose to implement additional codes specific to the underlying hardware capabilities.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 1.0 and later      
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.


 Last updated on Tuesday, July 13, 2004

© 2004 Microsoft Corporation. All rights reserved.