A.3.6 SerialIo.c File

Example A-18-Serial I/O Protocol implementation template

/** @file
<<BriefDescription>>
<<DetailedDescription>>
<<Copyright>>
<<License>>
**/
#include "<<DriverName>>.h"
///
/// Serial I/O Protocol Mode instance
///
GLOBAL_REMOVE_IF_UNREFERENCED
EFI_SERIAL_IO_MODE g<<DriverName>>SerialIoMode = {
0x00000000, // ControlMask
0, // Timeout
0, // BaudRate
0, // ReceiveF ifoDepth
0, // DataBits
DefaultParity, // Parity
DefaultStopBits // StopBits
};
///
/// Serial I/O Protocol instance
///
GLOBAL_REMOVE_IF_UNREFERENCED
EFI_SERIAL_IO_PROTOCOL g<<DriverName>>SerialIo = {
EFI_SERIAL_IO_PROTOCOL_REVISION,
<<DriverName>>SerialIoReset,
<<DriverName>>SerialIoSetAttributes,
<<DriverName>>SerialIoSetControl,
<<DriverName>>SerialIoGetControl,
<<DriverName>>SerialIoWrite,
<<DriverName>>SerialIoRead,
&g<<DriverName>>SerialIoMode
};
EFI_STATUS
EFIAPI
<<DriverName>>SerialIoReset (
IN EFI_SERIAL_IO_PROTOCOL *This
)
{
}
EFI_STATUS
EFIAPI
<<DriverName>>SerialIoSetAttributes (
IN EFI_SERIAL_IO_PROTOCOL *This,
IN UINT64 BaudRate,
IN UINT32 ReceiveFifoDepth,
IN UINT32 Timeout,
IN EFI_PARITY_TYPE Parity,
IN UINT8 DataBits,
IN EFI_STOP_BITS_TYPE StopBits
)
{
}
EFI_STATUS
EFIAPI
<<DriverName>>SerialIoSetControl (
IN EFI_SERIAL_IO_PROTOCOL *This,
IN UINT32 Control
)
{
}
EFI_STATUS
EFIAPI
<<DriverName>>SerialIoGetControl (
IN EFI_SERIAL_IO_PROTOCOL *This,
OUT UINT32 *Control
)
{
}
EFI_STATUS
EFIAPI
<<DriverName>>SerialIoWrite (
IN EFI_SERIAL_IO_PROTOCOL *This,
IN OUT UINTN *BufferSize,
IN VOID *Buffer
)
{
}
EFI_STATUS
EFIAPI
<<DriverName>>SerialIoRead (
IN EFI_SERIAL_IO_PROTOCOL *This,
IN OUT UINTN *BufferSize,
OUT VOID *Buffer
)
{
}