]>
Commit | Line | Data |
---|---|---|
fd7a76af | 1 | \r |
2 | /** @file\r | |
3 | Serial I/O Port library functions with no library constructor/destructor\r | |
4 | \r | |
5 | Copyright (c) 2006, Intel Corporation\r | |
6 | All rights reserved. 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 | Module Name: SerialPortLib.h\r | |
15 | \r | |
16 | **/\r | |
17 | \r | |
18 | #ifndef __SERIAL_PORT_LIB__\r | |
19 | #define __SERIAL_PORT_LIB__\r | |
20 | \r | |
21 | /**\r | |
22 | \r | |
23 | Programmed hardware of Serial port.\r | |
24 | \r | |
25 | @return Status of Serial Port Device initialization.\r | |
26 | \r | |
27 | **/\r | |
ef4ce186 | 28 | RETURN_STATUS\r |
fd7a76af | 29 | EFIAPI\r |
30 | SerialPortInitialize (\r | |
31 | VOID\r | |
32 | );\r | |
33 | \r | |
34 | /**\r | |
35 | Write data to serial device. \r | |
36 | \r | |
37 | If the buffer is NULL, then return 0; \r | |
38 | if NumberOfBytes is zero, then return 0. \r | |
39 | \r | |
40 | @param Buffer Point of data buffer which need to be writed.\r | |
41 | @param NumberOfBytes Number of output bytes which are cached in Buffer.\r | |
42 | \r | |
43 | @retval 0 Write data failed.\r | |
44 | @retval !0 Actual number of bytes writed to serial device.\r | |
45 | \r | |
46 | **/\r | |
47 | UINTN\r | |
48 | EFIAPI\r | |
49 | SerialPortWrite (\r | |
50 | IN UINT8 *Buffer,\r | |
51 | IN UINTN NumberOfBytes\r | |
ef4ce186 | 52 | );\r |
fd7a76af | 53 | \r |
54 | \r | |
55 | /**\r | |
56 | Read data from serial device and save the datas in buffer.\r | |
57 | \r | |
58 | If the buffer is NULL, then return zero;\r | |
59 | if NumberOfBytes is zero, then return zero.\r | |
60 | \r | |
61 | @param Buffer Point of data buffer which need to be writed.\r | |
62 | @param NumberOfBytes Number of output bytes which are cached in Buffer.\r | |
63 | \r | |
64 | @retval 0 Read data failed.\r | |
65 | @retval !0 Aactual number of bytes read from serial device.\r | |
66 | \r | |
67 | **/\r | |
68 | UINTN\r | |
69 | EFIAPI\r | |
70 | SerialPortRead (\r | |
71 | OUT UINT8 *Buffer,\r | |
72 | IN UINTN NumberOfBytes\r | |
ef4ce186 | 73 | );\r |
fd7a76af | 74 | \r |
75 | \r | |
76 | #endif\r |