XenevaOS
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations | Variables
SerialIo.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  EFI_SERIAL_IO_MODE
 
struct  _EFI_SERIAL_IO_PROTOCOL
 

Macros

#define EFI_SERIAL_IO_PROTOCOL_GUID
 
#define SERIAL_IO_PROTOCOL   EFI_SERIAL_IO_PROTOCOL_GUID
 
#define EFI_SERIAL_CLEAR_TO_SEND   0x00000010
 
#define EFI_SERIAL_DATA_SET_READY   0x00000020
 
#define EFI_SERIAL_RING_INDICATE   0x00000040
 
#define EFI_SERIAL_CARRIER_DETECT   0x00000080
 
#define EFI_SERIAL_INPUT_BUFFER_EMPTY   0x00000100
 
#define EFI_SERIAL_OUTPUT_BUFFER_EMPTY   0x00000200
 
#define EFI_SERIAL_REQUEST_TO_SEND   0x00000002
 
#define EFI_SERIAL_DATA_TERMINAL_READY   0x00000001
 
#define EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE   0x00001000
 
#define EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE   0x00002000
 
#define EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE   0x00004000
 
#define EFI_SERIAL_IO_PROTOCOL_REVISION   0x00010000
 
#define SERIAL_IO_INTERFACE_REVISION   EFI_SERIAL_IO_PROTOCOL_REVISION
 

Typedefs

typedef struct _EFI_SERIAL_IO_PROTOCOL EFI_SERIAL_IO_PROTOCOL
 
typedef EFI_SERIAL_IO_PROTOCOL SERIAL_IO_INTERFACE
 
typedef EFI_STATUS(EFIAPIEFI_SERIAL_RESET) (IN EFI_SERIAL_IO_PROTOCOL *This)
 
typedef EFI_STATUS(EFIAPIEFI_SERIAL_SET_ATTRIBUTES) (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)
 
typedef EFI_STATUS(EFIAPIEFI_SERIAL_SET_CONTROL_BITS) (IN EFI_SERIAL_IO_PROTOCOL *This, IN UINT32 Control)
 
typedef EFI_STATUS(EFIAPIEFI_SERIAL_GET_CONTROL_BITS) (IN EFI_SERIAL_IO_PROTOCOL *This, OUT UINT32 *Control)
 
typedef EFI_STATUS(EFIAPIEFI_SERIAL_WRITE) (IN EFI_SERIAL_IO_PROTOCOL *This, IN OUT UINTN *BufferSize, IN VOID *Buffer)
 
typedef EFI_STATUS(EFIAPIEFI_SERIAL_READ) (IN EFI_SERIAL_IO_PROTOCOL *This, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
 

Enumerations

enum  EFI_PARITY_TYPE {
  DefaultParity , NoParity , EvenParity , OddParity ,
  MarkParity , SpaceParity
}
 
enum  EFI_STOP_BITS_TYPE { DefaultStopBits , OneStopBit , OneFiveStopBits , TwoStopBits }
 

Variables

EFI_GUID gEfiSerialIoProtocolGuid
 

Detailed Description

Serial IO protocol as defined in the UEFI 2.0 specification.

Abstraction of a basic serial device. Targeted at 16550 UART, but could be much more generic.

Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

Macro Definition Documentation

◆ EFI_SERIAL_CARRIER_DETECT

#define EFI_SERIAL_CARRIER_DETECT   0x00000080

◆ EFI_SERIAL_CLEAR_TO_SEND

#define EFI_SERIAL_CLEAR_TO_SEND   0x00000010

◆ EFI_SERIAL_DATA_SET_READY

#define EFI_SERIAL_DATA_SET_READY   0x00000020

◆ EFI_SERIAL_DATA_TERMINAL_READY

#define EFI_SERIAL_DATA_TERMINAL_READY   0x00000001

◆ EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE

#define EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE   0x00004000

◆ EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE

#define EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE   0x00001000

◆ EFI_SERIAL_INPUT_BUFFER_EMPTY

#define EFI_SERIAL_INPUT_BUFFER_EMPTY   0x00000100

◆ EFI_SERIAL_IO_PROTOCOL_GUID

#define EFI_SERIAL_IO_PROTOCOL_GUID
Value:
{ \
0xBB25CF6F, 0xF1D4, 0x11D2, {0x9A, 0x0C, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0xFD } \
}

◆ EFI_SERIAL_IO_PROTOCOL_REVISION

#define EFI_SERIAL_IO_PROTOCOL_REVISION   0x00010000

◆ EFI_SERIAL_OUTPUT_BUFFER_EMPTY

#define EFI_SERIAL_OUTPUT_BUFFER_EMPTY   0x00000200

◆ EFI_SERIAL_REQUEST_TO_SEND

#define EFI_SERIAL_REQUEST_TO_SEND   0x00000002

◆ EFI_SERIAL_RING_INDICATE

#define EFI_SERIAL_RING_INDICATE   0x00000040

◆ EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE

#define EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE   0x00002000

◆ SERIAL_IO_INTERFACE_REVISION

#define SERIAL_IO_INTERFACE_REVISION   EFI_SERIAL_IO_PROTOCOL_REVISION

◆ SERIAL_IO_PROTOCOL

#define SERIAL_IO_PROTOCOL   EFI_SERIAL_IO_PROTOCOL_GUID

Protocol GUID defined in EFI1.1.

Typedef Documentation

◆ EFI_SERIAL_GET_CONTROL_BITS

typedef EFI_STATUS(EFIAPI * EFI_SERIAL_GET_CONTROL_BITS) (IN EFI_SERIAL_IO_PROTOCOL *This, OUT UINT32 *Control)

Retrieves the status of thecontrol bits on a serial device

Parameters
ThisProtocol instance pointer.
ControlA pointer to return the current Control signals from the serial device.
Return values
EFI_SUCCESSThe control bits were read from the serial device.
EFI_DEVICE_ERRORThe serial device is not functioning correctly.

◆ EFI_SERIAL_IO_PROTOCOL

◆ EFI_SERIAL_READ

typedef EFI_STATUS(EFIAPI * EFI_SERIAL_READ) (IN EFI_SERIAL_IO_PROTOCOL *This, IN OUT UINTN *BufferSize, OUT VOID *Buffer)

Writes data to a serial device.

Parameters
ThisProtocol instance pointer.
BufferSizeOn input, the size of the Buffer. On output, the amount of data returned in Buffer.
BufferThe buffer to return the data into.
Return values
EFI_SUCCESSThe data was read.
EFI_DEVICE_ERRORThe device reported an error.
EFI_TIMEOUTThe data write was stopped due to a timeout.

◆ EFI_SERIAL_RESET

typedef EFI_STATUS(EFIAPI * EFI_SERIAL_RESET) (IN EFI_SERIAL_IO_PROTOCOL *This)

Reset the serial device.

Parameters
ThisProtocol instance pointer.
Return values
EFI_SUCCESSThe device was reset.
EFI_DEVICE_ERRORThe serial device could not be reset.

◆ EFI_SERIAL_SET_ATTRIBUTES

typedef EFI_STATUS(EFIAPI * EFI_SERIAL_SET_ATTRIBUTES) (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)

Sets the baud rate, receive FIFO depth, transmit/receice time out, parity, data bits, and stop bits on a serial device.

Parameters
ThisProtocol instance pointer.
BaudRateThe requested baud rate. A BaudRate value of 0 will use the device's default interface speed.
ReveiveFifoDepthThe requested depth of the FIFO on the receive side of the serial interface. A ReceiveFifoDepth value of 0 will use the device's default FIFO depth.
TimeoutThe requested time out for a single character in microseconds. This timeout applies to both the transmit and receive side of the interface. A Timeout value of 0 will use the device's default time out value.
ParityThe type of parity to use on this serial device. A Parity value of DefaultParity will use the device's default parity value.
DataBitsThe number of data bits to use on the serial device. A DataBits vaule of 0 will use the device's default data bit setting.
StopBitsThe number of stop bits to use on this serial device. A StopBits value of DefaultStopBits will use the device's default number of stop bits.
Return values
EFI_SUCCESSThe device was reset.
EFI_INVALID_PARAMETEROne or more attributes has an unsupported value.
EFI_DEVICE_ERRORThe serial device is not functioning correctly.

◆ EFI_SERIAL_SET_CONTROL_BITS

typedef EFI_STATUS(EFIAPI * EFI_SERIAL_SET_CONTROL_BITS) (IN EFI_SERIAL_IO_PROTOCOL *This, IN UINT32 Control)

Set the control bits on a serial device

Parameters
ThisProtocol instance pointer.
ControlSet the bits of Control that are settable.
Return values
EFI_SUCCESSThe new control bits were set on the serial device.
EFI_UNSUPPORTEDThe serial device does not support this operation.
EFI_DEVICE_ERRORThe serial device is not functioning correctly.

◆ EFI_SERIAL_WRITE

typedef EFI_STATUS(EFIAPI * EFI_SERIAL_WRITE) (IN EFI_SERIAL_IO_PROTOCOL *This, IN OUT UINTN *BufferSize, IN VOID *Buffer)

Writes data to a serial device.

Parameters
ThisProtocol instance pointer.
BufferSizeOn input, the size of the Buffer. On output, the amount of data actually written.
BufferThe buffer of data to write
Return values
EFI_SUCCESSThe data was written.
EFI_DEVICE_ERRORThe device reported an error.
EFI_TIMEOUTThe data write was stopped due to a timeout.

◆ SERIAL_IO_INTERFACE

Backward-compatible with EFI1.1.

Enumeration Type Documentation

◆ EFI_PARITY_TYPE

Parity type that is computed or checked as each character is transmitted or received. If the device does not support parity, the value is the default parity value.

Enumerator
DefaultParity 
NoParity 
EvenParity 
OddParity 
MarkParity 
SpaceParity 

◆ EFI_STOP_BITS_TYPE

Stop bits type

Enumerator
DefaultStopBits 
OneStopBit 
OneFiveStopBits 
TwoStopBits 

Variable Documentation

◆ gEfiSerialIoProtocolGuid

EFI_GUID gEfiSerialIoProtocolGuid
extern