TianoCore EDK2 master
Loading...
Searching...
No Matches
SerialIo.h
Go to the documentation of this file.
1
12#ifndef __SERIAL_IO_PROTOCOL_H__
13#define __SERIAL_IO_PROTOCOL_H__
14
15#define EFI_SERIAL_IO_PROTOCOL_GUID \
16 { \
17 0xBB25CF6F, 0xF1D4, 0x11D2, {0x9A, 0x0C, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0xFD } \
18 }
19
20#define EFI_SERIAL_TERMINAL_DEVICE_TYPE_GUID \
21 { \
22 0X6AD9A60F, 0X5815, 0X4C7C, { 0X8A, 0X10, 0X50, 0X53, 0XD2, 0XBF, 0X7A, 0X1B } \
23 }
24
28#define SERIAL_IO_PROTOCOL EFI_SERIAL_IO_PROTOCOL_GUID
29
31
36
41typedef enum {
42 DefaultParity,
43 NoParity,
44 EvenParity,
45 OddParity,
46 MarkParity,
47 SpaceParity
49
53typedef enum {
54 DefaultStopBits,
55 OneStopBit,
56 OneFiveStopBits,
57 TwoStopBits
59
60//
61// define for Control bits, grouped by read only, write only, and read write
62//
63//
64// Read Only
65//
66#define EFI_SERIAL_CLEAR_TO_SEND 0x00000010
67#define EFI_SERIAL_DATA_SET_READY 0x00000020
68#define EFI_SERIAL_RING_INDICATE 0x00000040
69#define EFI_SERIAL_CARRIER_DETECT 0x00000080
70#define EFI_SERIAL_INPUT_BUFFER_EMPTY 0x00000100
71#define EFI_SERIAL_OUTPUT_BUFFER_EMPTY 0x00000200
72
73//
74// Write Only
75//
76#define EFI_SERIAL_REQUEST_TO_SEND 0x00000002
77#define EFI_SERIAL_DATA_TERMINAL_READY 0x00000001
78
79//
80// Read Write
81//
82#define EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE 0x00001000
83#define EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE 0x00002000
84#define EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE 0x00004000
85
86//
87// Serial IO Member Functions
88//
89
99typedef
101(EFIAPI *EFI_SERIAL_RESET)(
103 );
104
132typedef
136 IN UINT64 BaudRate,
137 IN UINT32 ReceiveFifoDepth,
138 IN UINT32 Timeout,
139 IN EFI_PARITY_TYPE Parity,
140 IN UINT8 DataBits,
141 IN EFI_STOP_BITS_TYPE StopBits
142 );
143
155typedef
159 IN UINT32 Control
160 );
161
172typedef
176 OUT UINT32 *Control
177 );
178
192typedef
194(EFIAPI *EFI_SERIAL_WRITE)(
196 IN OUT UINTN *BufferSize,
197 IN VOID *Buffer
198 );
199
213typedef
215(EFIAPI *EFI_SERIAL_READ)(
217 IN OUT UINTN *BufferSize,
218 OUT VOID *Buffer
219 );
220
256typedef struct {
257 UINT32 ControlMask;
258
259 //
260 // current Attributes
261 //
262 UINT32 Timeout;
263 UINT64 BaudRate;
264 UINT32 ReceiveFifoDepth;
265 UINT32 DataBits;
266 UINT32 Parity;
267 UINT32 StopBits;
269
270#define EFI_SERIAL_IO_PROTOCOL_REVISION 0x00010000
271#define EFI_SERIAL_IO_PROTOCOL_REVISION1p1 0x00010001
272#define SERIAL_IO_INTERFACE_REVISION EFI_SERIAL_IO_PROTOCOL_REVISION
273
285 UINT32 Revision;
286 EFI_SERIAL_RESET Reset;
287 EFI_SERIAL_SET_ATTRIBUTES SetAttributes;
290 EFI_SERIAL_WRITE Write;
291 EFI_SERIAL_READ Read;
303 CONST EFI_GUID *DeviceTypeGuid; // Revision 1.1
304};
305
306extern EFI_GUID gEfiSerialIoProtocolGuid;
307extern EFI_GUID gEfiSerialTerminalDeviceTypeGuid;
308
309#endif
UINT64 UINTN
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS(EFIAPI * EFI_SERIAL_WRITE)(IN EFI_SERIAL_IO_PROTOCOL *This, IN OUT UINTN *BufferSize, IN VOID *Buffer)
Definition: SerialIo.h:194
EFI_STOP_BITS_TYPE
Definition: SerialIo.h:53
EFI_STATUS(EFIAPI * EFI_SERIAL_RESET)(IN EFI_SERIAL_IO_PROTOCOL *This)
Definition: SerialIo.h:101
EFI_STATUS(EFIAPI * EFI_SERIAL_GET_CONTROL_BITS)(IN EFI_SERIAL_IO_PROTOCOL *This, OUT UINT32 *Control)
Definition: SerialIo.h:174
EFI_STATUS(EFIAPI * EFI_SERIAL_SET_CONTROL_BITS)(IN EFI_SERIAL_IO_PROTOCOL *This, IN UINT32 Control)
Definition: SerialIo.h:157
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)
Definition: SerialIo.h:134
EFI_STATUS(EFIAPI * EFI_SERIAL_READ)(IN EFI_SERIAL_IO_PROTOCOL *This, IN OUT UINTN *BufferSize, OUT VOID *Buffer)
Definition: SerialIo.h:215
EFI_SERIAL_IO_PROTOCOL SERIAL_IO_INTERFACE
Definition: SerialIo.h:35
EFI_PARITY_TYPE
Definition: SerialIo.h:41
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
EFI_SERIAL_IO_MODE * Mode
Definition: SerialIo.h:295
CONST EFI_GUID * DeviceTypeGuid
Definition: SerialIo.h:303
Definition: Base.h:213