]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - MdePkg/Include/Library/SerialPortLib.h
GCC Build Clean: Add doxygen comment and fix build break issue.
[mirror_edk2.git] / MdePkg / Include / Library / SerialPortLib.h
... / ...
CommitLineData
1/** @file\r
2 This library class provides common serial I/O port functions.\r
3\r
4Copyright (c) 2006 - 2008, Intel Corporation\r
5All rights reserved. This program and the accompanying materials\r
6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12\r
13**/\r
14\r
15#ifndef __SERIAL_PORT_LIB__\r
16#define __SERIAL_PORT_LIB__\r
17\r
18/**\r
19 Initialize the serial device hardware.\r
20 \r
21 If no initialization is required, then return RETURN_SUCCESS.\r
22 If the serial device was successfuly initialized, then return RETURN_SUCCESS.\r
23 If the serial device could not be initialized, then return RETURN_DEVICE_ERROR.\r
24 \r
25 @retval RETURN_SUCCESS The serial device was initialized.\r
26 @retval RETURN_DEVICE_ERROR The serail device could not be initialized.\r
27\r
28**/\r
29RETURN_STATUS\r
30EFIAPI\r
31SerialPortInitialize (\r
32 VOID\r
33 );\r
34\r
35/**\r
36 Write data from buffer to serial device. \r
37 \r
38 Writes NumberOfBytes data bytes from Buffer to the serial device. \r
39 The number of bytes actually written to the serial device is returned.\r
40 If the return value is less than NumberOfBytes, then the write operation failed.\r
41\r
42 If Buffer is NULL, then ASSERT(). \r
43\r
44 If NumberOfBytes is zero, then return 0.\r
45\r
46 @param Buffer Pointer to the data buffer to be written.\r
47 @param NumberOfBytes Number of bytes to written to the serial device.\r
48\r
49 @retval 0 NumberOfBytes is 0.\r
50 @retval >0 The number of bytes written to the serial device. \r
51 If this value is less than NumberOfBytes, then the read operation failed.\r
52\r
53**/\r
54UINTN\r
55EFIAPI\r
56SerialPortWrite (\r
57 IN UINT8 *Buffer,\r
58 IN UINTN NumberOfBytes\r
59 );\r
60\r
61\r
62/**\r
63 Read data from serial device and save the datas in buffer.\r
64 \r
65 Reads NumberOfBytes data bytes from a serial device into the buffer\r
66 specified by Buffer. The number of bytes actually read is returned. \r
67 If the return value is less than NumberOfBytes, then the rest operation failed.\r
68\r
69 If Buffer is NULL, then ASSERT(). \r
70\r
71 If NumberOfBytes is zero, then return 0.\r
72\r
73 @param Buffer Pointer to the data buffer to store the data read from the serial device.\r
74 @param NumberOfBytes Number of bytes which will be read.\r
75\r
76 @retval 0 Read data failed, No data is to be read.\r
77 @retval !0 Aactual number of bytes read from serial device.\r
78\r
79**/\r
80UINTN\r
81EFIAPI\r
82SerialPortRead (\r
83 OUT UINT8 *Buffer,\r
84 IN UINTN NumberOfBytes\r
85 );\r
86\r
87/**\r
88 Polls a serial device to see if there is any data waiting to be read.\r
89\r
90 Polls aserial device to see if there is any data waiting to be read.\r
91 If there is data waiting to be read from the serial device, then TRUE is returned.\r
92 If there is no data waiting to be read from the serial device, then FALSE is returned.\r
93\r
94 @retval TRUE Data is waiting to be read from the serial device.\r
95 @retval FALSE There is no data waiting to be read from the serial device.\r
96\r
97**/\r
98BOOLEAN\r
99EFIAPI\r
100SerialPortPoll (\r
101 VOID\r
102 );\r
103\r
104#endif\r