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