]> git.proxmox.com Git - mirror_edk2.git/blame - EmbeddedPkg/Include/Library/SerialPortExtLib.h
ArmPlatformPkg/ArmJunoPkg: ACPI PCI Support
[mirror_edk2.git] / EmbeddedPkg / Include / Library / SerialPortExtLib.h
CommitLineData
1e57a462 1/** @file\r
2\r
5f81a620
RC
3 Serial I/O port control interface extension.\r
4\r
5 This library provides an extension to the library providing common\r
6 serial I/O port functions that is defined in MdePkg. The aim is to\r
7 provide more control over the functionalities of a serial port. The\r
8 extension covers all the needs of the UEFI Serial I/O Protocol.\r
9 Though, its use is not restricted to the UEFI Serial I/O Protocol.\r
10 It could for example be used in the PEI phase of the boot sequence\r
11 as well.\r
12\r
13 Copyright (c) 2012 - 2014, ARM Ltd. All rights reserved.\r
3402aac7 14\r
1e57a462 15 This program and the accompanying materials\r
16 are licensed and made available under the terms and conditions of the BSD License\r
17 which accompanies this distribution. The full text of the license may be found at\r
18 http://opensource.org/licenses/bsd-license.php\r
19\r
20 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
21 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
22\r
23**/\r
24\r
25#ifndef __SERIAL_PORT_EXT_LIB_H__\r
26#define __SERIAL_PORT_EXT_LIB_H__\r
27\r
28#include <Uefi/UefiBaseType.h>\r
29#include <Protocol/SerialIo.h>\r
30\r
31/**\r
1e57a462 32\r
ab716191
RC
33 Assert or deassert the control signals on a serial port.\r
34 The following control signals are set according their bit settings :\r
35 . Request to Send\r
36 . Data Terminal Ready\r
37\r
38 @param[in] Control The following bits are taken into account :\r
39 . EFI_SERIAL_REQUEST_TO_SEND : assert/deassert the\r
40 "Request To Send" control signal if this bit is\r
41 equal to one/zero.\r
42 . EFI_SERIAL_DATA_TERMINAL_READY : assert/deassert\r
43 the "Data Terminal Ready" control signal if this\r
44 bit is equal to one/zero.\r
45 . EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE : enable/disable\r
46 the hardware loopback if this bit is equal to\r
47 one/zero.\r
48 . EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE : not supported.\r
49 . EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE : enable/\r
50 disable the hardware flow control based on CTS (Clear\r
51 To Send) and RTS (Ready To Send) control signals.\r
52\r
53 @retval RETURN_SUCCESS The new control bits were set on the serial device.\r
54 @retval RETURN_UNSUPPORTED The serial device does not support this operation.\r
1e57a462 55\r
56**/\r
57RETURN_STATUS\r
58EFIAPI\r
59SerialPortSetControl (\r
ab716191 60 IN UINT32 Control\r
1e57a462 61 );\r
62\r
63/**\r
1e57a462 64\r
d2e7e385
RC
65 Retrieve the status of the control bits on a serial device.\r
66\r
67 @param[out] Control Status of the control bits on a serial device :\r
68\r
69 . EFI_SERIAL_DATA_CLEAR_TO_SEND, EFI_SERIAL_DATA_SET_READY,\r
70 EFI_SERIAL_RING_INDICATE, EFI_SERIAL_CARRIER_DETECT,\r
71 EFI_SERIAL_REQUEST_TO_SEND, EFI_SERIAL_DATA_TERMINAL_READY\r
72 are all related to the DTE (Data Terminal Equipment) and\r
73 DCE (Data Communication Equipment) modes of operation of\r
74 the serial device.\r
75 . EFI_SERIAL_INPUT_BUFFER_EMPTY : equal to one if the receive\r
76 buffer is empty, 0 otherwise.\r
77 . EFI_SERIAL_OUTPUT_BUFFER_EMPTY : equal to one if the transmit\r
78 buffer is empty, 0 otherwise.\r
79 . EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE : equal to one if the\r
80 hardware loopback is enabled (the ouput feeds the receive\r
81 buffer), 0 otherwise.\r
82 . EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE : equal to one if a\r
83 loopback is accomplished by software, 0 otherwise.\r
84 . EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE : equal to one if the\r
85 hardware flow control based on CTS (Clear To Send) and RTS\r
86 (Ready To Send) control signals is enabled, 0 otherwise.\r
87\r
88 @retval RETURN_SUCCESS The control bits were read from the serial device.\r
89 @retval RETURN_DEVICE_ERROR The serial device is not functioning correctly.\r
1e57a462 90\r
91**/\r
92RETURN_STATUS\r
93EFIAPI\r
94SerialPortGetControl (\r
d2e7e385 95 OUT UINT32 *Control\r
1e57a462 96 );\r
97\r
98/**\r
99 Set the serial device attributes.\r
100\r
101 @return Always return EFI_UNSUPPORTED.\r
102\r
103**/\r
104RETURN_STATUS\r
105EFIAPI\r
106SerialPortSetAttributes (\r
15e277d5 107 IN OUT UINT64 *BaudRate,\r
108 IN OUT UINT32 *ReceiveFifoDepth,\r
109 IN OUT UINT32 *Timeout,\r
110 IN OUT EFI_PARITY_TYPE *Parity,\r
111 IN OUT UINT8 *DataBits,\r
112 IN OUT EFI_STOP_BITS_TYPE *StopBits\r
1e57a462 113 );\r
114\r
115#endif\r
116\r