]> git.proxmox.com Git - mirror_edk2.git/blob - EmbeddedPkg/Library/TemplateSerialPortLib/TemplateSerialPortLib.c
EmbeddedPkg: Introduced a separate SerialPortExtLib library
[mirror_edk2.git] / EmbeddedPkg / Library / TemplateSerialPortLib / TemplateSerialPortLib.c
1 /** @file
2 Serial I/O Port library functions with no library constructor/destructor
3
4 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
5 Copyright (c) 2012, ARM Ltd. All rights reserved.
6
7 This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
11
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14
15 **/
16
17 #include <Base.h>
18
19
20 #include <Library/SerialPortLib.h>
21
22 /**
23
24 Programmed hardware of Serial port.
25
26 @return Always return EFI_UNSUPPORTED.
27
28 **/
29 RETURN_STATUS
30 EFIAPI
31 SerialPortInitialize (
32 VOID
33 )
34 {
35 return RETURN_UNSUPPORTED;
36 }
37
38 /**
39 Write data to serial device.
40
41 @param Buffer Point of data buffer which need to be written.
42 @param NumberOfBytes Number of output bytes which are cached in Buffer.
43
44 @retval 0 Write data failed.
45 @retval !0 Actual number of bytes written to serial device.
46
47 **/
48 UINTN
49 EFIAPI
50 SerialPortWrite (
51 IN UINT8 *Buffer,
52 IN UINTN NumberOfBytes
53 )
54 {
55 return 0;
56 }
57
58
59 /**
60 Read data from serial device and save the data in buffer.
61
62 @param Buffer Point of data buffer which need to be written.
63 @param NumberOfBytes Number of output bytes which are cached in Buffer.
64
65 @retval 0 Read data failed.
66 @retval !0 Actual number of bytes read from serial device.
67
68 **/
69 UINTN
70 EFIAPI
71 SerialPortRead (
72 OUT UINT8 *Buffer,
73 IN UINTN NumberOfBytes
74 )
75 {
76 return 0;
77 }
78
79
80
81 /**
82 Poll the serial device to see if there is any data waiting.
83
84 If there is data waiting to be read from the serial port, then return
85 TRUE. If there is no data waiting to be read from the serial port, then
86 return FALSE.
87
88 @retval TRUE Data is waiting to be read.
89 @retval FALSE There is no data waiting to be read.
90
91 **/
92 BOOLEAN
93 EFIAPI
94 SerialPortPoll (
95 VOID
96 )
97 {
98 return 0;
99 }
100