]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Library/SerialPortLib.h
Function headers in .h and .c files synchronized with spec
[mirror_edk2.git] / MdePkg / Include / Library / SerialPortLib.h
CommitLineData
fd7a76af 1/** @file\r
d0218f26 2 This library class provides common serial I/O port functions.\r
fd7a76af 3\r
50a64e5b 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
fd7a76af 9\r
50a64e5b 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
fd7a76af 12\r
fd7a76af 13**/\r
14\r
15#ifndef __SERIAL_PORT_LIB__\r
16#define __SERIAL_PORT_LIB__\r
17\r
18/**\r
d69107aa 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
fd7a76af 27\r
28**/\r
ef4ce186 29RETURN_STATUS\r
fd7a76af 30EFIAPI\r
31SerialPortInitialize (\r
32 VOID\r
33 );\r
34\r
35/**\r
eceb3a4c 36 Write data from buffer to serial device. \r
fd7a76af 37 \r
d69107aa 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
d69107aa 41 If Buffer is NULL, then ASSERT(). \r
d69107aa 42 If NumberOfBytes is zero, then return 0.\r
fd7a76af 43\r
d69107aa 44 @param Buffer Pointer to the data buffer to be written.\r
45 @param NumberOfBytes Number of bytes to written to the serial device.\r
46\r
47 @retval 0 NumberOfBytes is 0.\r
48 @retval >0 The number of bytes written to the serial device. \r
49 If this value is less than NumberOfBytes, then the read operation failed.\r
fd7a76af 50\r
51**/\r
52UINTN\r
53EFIAPI\r
54SerialPortWrite (\r
d0218f26 55 IN UINT8 *Buffer,\r
56 IN UINTN NumberOfBytes\r
ef4ce186 57 );\r
fd7a76af 58\r
59\r
60/**\r
61 Read data from serial device and save the datas in buffer.\r
62 \r
d69107aa 63 Reads NumberOfBytes data bytes from a serial device into the buffer\r
64 specified by Buffer. The number of bytes actually read is returned. \r
65 If the return value is less than NumberOfBytes, then the rest operation failed.\r
d69107aa 66 If Buffer is NULL, then ASSERT(). \r
d69107aa 67 If NumberOfBytes is zero, then return 0.\r
fd7a76af 68\r
d69107aa 69 @param Buffer Pointer to the data buffer to store the data read from the serial device.\r
eceb3a4c 70 @param NumberOfBytes Number of bytes which will be read.\r
fd7a76af 71\r
eceb3a4c 72 @retval 0 Read data failed, No data is to be read.\r
71871514 73 @retval >0 Aactual number of bytes read from serial device.\r
fd7a76af 74\r
75**/\r
76UINTN\r
77EFIAPI\r
78SerialPortRead (\r
d0218f26 79 OUT UINT8 *Buffer,\r
80 IN UINTN NumberOfBytes\r
ef4ce186 81 );\r
fd7a76af 82\r
a2ddd00b 83/**\r
07974e78 84 Polls a serial device to see if there is any data waiting to be read.\r
a2ddd00b 85\r
07974e78 86 Polls aserial device to see if there is any data waiting to be read.\r
87 If there is data waiting to be read from the serial device, then TRUE is returned.\r
88 If there is no data waiting to be read from the serial device, then FALSE is returned.\r
a2ddd00b 89\r
07974e78 90 @retval TRUE Data is waiting to be read from the serial device.\r
91 @retval FALSE There is no data waiting to be read from the serial device.\r
a2ddd00b
LG
92\r
93**/\r
94BOOLEAN\r
95EFIAPI\r
96SerialPortPoll (\r
97 VOID\r
98 );\r
fd7a76af 99\r
100#endif\r