]> git.proxmox.com Git - mirror_edk2.git/blame - EmbeddedPkg/Library/TemplateSerialPortExtLib/TemplateSerialPortExtLib.c
EmbeddedPkg: Introduced a separate SerialPortExtLib library
[mirror_edk2.git] / EmbeddedPkg / Library / TemplateSerialPortExtLib / TemplateSerialPortExtLib.c
CommitLineData
d38c35f9 1/** @file\r
2 Extended Serial I/O Port library functions\r
3\r
4 Copyright (c) 2012, ARM Ltd. All rights reserved.\r
5 \r
6 This program and the accompanying materials\r
7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#include <Base.h>\r
17\r
18#include <Library/SerialPortLib.h>\r
19#include <Library/SerialPortExtLib.h>\r
20\r
21/**\r
22 Set the serial device control bits.\r
23\r
24 @return Always return RETURN_UNSUPPORTED.\r
25\r
26**/\r
27RETURN_STATUS\r
28EFIAPI\r
29SerialPortSetControl (\r
30 IN UINT32 Control\r
31 )\r
32{\r
33 return RETURN_UNSUPPORTED;\r
34}\r
35\r
36/**\r
37 Get the serial device control bits.\r
38\r
39 @param Control Control signals read from the serial device.\r
40\r
41 @retval EFI_SUCCESS The control bits were read from the serial device.\r
42 @retval EFI_DEVICE_ERROR The serial device is not functioning correctly.\r
43\r
44**/\r
45RETURN_STATUS\r
46EFIAPI\r
47SerialPortGetControl (\r
48 OUT UINT32 *Control\r
49 )\r
50{\r
51 if (SerialPortPoll ()) {\r
52 // If a character is pending don't set EFI_SERIAL_INPUT_BUFFER_EMPTY\r
53 *Control = EFI_SERIAL_OUTPUT_BUFFER_EMPTY;\r
54 } else {\r
55 *Control = EFI_SERIAL_INPUT_BUFFER_EMPTY | EFI_SERIAL_OUTPUT_BUFFER_EMPTY;\r
56 }\r
57 return EFI_SUCCESS;\r
58}\r
59\r
60/**\r
61 Set the serial device attributes.\r
62\r
63 @return Always return RETURN_UNSUPPORTED.\r
64\r
65**/\r
66RETURN_STATUS\r
67EFIAPI\r
68SerialPortSetAttributes (\r
69 IN UINT64 BaudRate,\r
70 IN UINT32 ReceiveFifoDepth,\r
71 IN UINT32 Timeout,\r
72 IN EFI_PARITY_TYPE Parity,\r
73 IN UINT8 DataBits,\r
74 IN EFI_STOP_BITS_TYPE StopBits\r
75 )\r
76{\r
77 return RETURN_UNSUPPORTED;\r
78}\r
79\r