]>
Commit | Line | Data |
---|---|---|
fd7a76af | 1 | /** @file\r |
eceb3a4c | 2 | Serial I/O Port library functions definition.\r |
fd7a76af | 3 | \r |
eceb3a4c | 4 | Copyright (c) 2006 - 2008, Intel Corporation\r |
fd7a76af | 5 | All rights reserved. This program and the accompanying materials\r |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
fd7a76af | 13 | **/\r |
14 | \r | |
15 | #ifndef __SERIAL_PORT_LIB__\r | |
16 | #define __SERIAL_PORT_LIB__\r | |
17 | \r | |
18 | /**\r | |
19 | \r | |
20 | Programmed hardware of Serial port.\r | |
21 | \r | |
22 | @return Status of Serial Port Device initialization.\r | |
23 | \r | |
24 | **/\r | |
ef4ce186 | 25 | RETURN_STATUS\r |
fd7a76af | 26 | EFIAPI\r |
27 | SerialPortInitialize (\r | |
28 | VOID\r | |
29 | );\r | |
30 | \r | |
31 | /**\r | |
eceb3a4c | 32 | Write data from buffer to serial device. \r |
fd7a76af | 33 | \r |
eceb3a4c | 34 | If the Buffer is NULL, then return 0; \r |
fd7a76af | 35 | if NumberOfBytes is zero, then return 0. \r |
36 | \r | |
37 | @param Buffer Point of data buffer which need to be writed.\r | |
38 | @param NumberOfBytes Number of output bytes which are cached in Buffer.\r | |
39 | \r | |
eceb3a4c | 40 | @retval 0 Write data failed, or No data is to be written.\r |
fd7a76af | 41 | @retval !0 Actual number of bytes writed to serial device.\r |
42 | \r | |
43 | **/\r | |
44 | UINTN\r | |
45 | EFIAPI\r | |
46 | SerialPortWrite (\r | |
47 | IN UINT8 *Buffer,\r | |
48 | IN UINTN NumberOfBytes\r | |
ef4ce186 | 49 | );\r |
fd7a76af | 50 | \r |
51 | \r | |
52 | /**\r | |
53 | Read data from serial device and save the datas in buffer.\r | |
54 | \r | |
eceb3a4c | 55 | If the Buffer is NULL, then return zero;\r |
fd7a76af | 56 | if NumberOfBytes is zero, then return zero.\r |
57 | \r | |
eceb3a4c LG |
58 | @param Buffer Point of data buffer, which contains the data \r |
59 | returned from the serial device.\r | |
60 | @param NumberOfBytes Number of bytes which will be read.\r | |
fd7a76af | 61 | \r |
eceb3a4c | 62 | @retval 0 Read data failed, No data is to be read.\r |
fd7a76af | 63 | @retval !0 Aactual number of bytes read from serial device.\r |
64 | \r | |
65 | **/\r | |
66 | UINTN\r | |
67 | EFIAPI\r | |
68 | SerialPortRead (\r | |
69 | OUT UINT8 *Buffer,\r | |
70 | IN UINTN NumberOfBytes\r | |
ef4ce186 | 71 | );\r |
fd7a76af | 72 | \r |
73 | \r | |
74 | #endif\r |