]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | Null Serial Port library instance with empty functions.\r | |
3 | \r | |
4 | Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r | |
5 | 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 | |
13 | **/\r | |
14 | \r | |
15 | \r | |
16 | #include <Base.h>\r | |
17 | \r | |
18 | \r | |
19 | #include <Library/SerialPortLib.h>\r | |
20 | \r | |
21 | /**\r | |
22 | Initialize the serial device hardware.\r | |
23 | \r | |
24 | If no initialization is required, then return RETURN_SUCCESS.\r | |
25 | If the serial device was successfully initialized, then return RETURN_SUCCESS.\r | |
26 | If the serial device could not be initialized, then return RETURN_DEVICE_ERROR.\r | |
27 | \r | |
28 | @retval RETURN_SUCCESS The serial device was initialized.\r | |
29 | @retval RETURN_DEVICE_ERROR The serial device could not be initialized.\r | |
30 | \r | |
31 | **/\r | |
32 | RETURN_STATUS\r | |
33 | EFIAPI\r | |
34 | SerialPortInitialize (\r | |
35 | VOID\r | |
36 | )\r | |
37 | {\r | |
38 | return RETURN_UNSUPPORTED;\r | |
39 | }\r | |
40 | \r | |
41 | /**\r | |
42 | Write data from buffer to serial device. \r | |
43 | \r | |
44 | Writes NumberOfBytes data bytes from Buffer to the serial device. \r | |
45 | The number of bytes actually written to the serial device is returned.\r | |
46 | If the return value is less than NumberOfBytes, then the write operation failed.\r | |
47 | If Buffer is NULL, then ASSERT(). \r | |
48 | If NumberOfBytes is zero, then return 0.\r | |
49 | \r | |
50 | @param Buffer Pointer to the data buffer to be written.\r | |
51 | @param NumberOfBytes Number of bytes to written to the serial device.\r | |
52 | \r | |
53 | @retval 0 NumberOfBytes is 0.\r | |
54 | @retval >0 The number of bytes written to the serial device. \r | |
55 | If this value is less than NumberOfBytes, then the read operation failed.\r | |
56 | \r | |
57 | **/\r | |
58 | UINTN\r | |
59 | EFIAPI\r | |
60 | SerialPortWrite (\r | |
61 | IN UINT8 *Buffer,\r | |
62 | IN UINTN NumberOfBytes\r | |
63 | )\r | |
64 | {\r | |
65 | return 0;\r | |
66 | }\r | |
67 | \r | |
68 | \r | |
69 | /**\r | |
70 | Read data from serial device and save the datas in buffer.\r | |
71 | \r | |
72 | Reads NumberOfBytes data bytes from a serial device into the buffer\r | |
73 | specified by Buffer. The number of bytes actually read is returned. \r | |
74 | If the return value is less than NumberOfBytes, then the rest operation failed.\r | |
75 | If Buffer is NULL, then ASSERT(). \r | |
76 | If NumberOfBytes is zero, then return 0.\r | |
77 | \r | |
78 | @param Buffer Pointer to the data buffer to store the data read from the serial device.\r | |
79 | @param NumberOfBytes Number of bytes which will be read.\r | |
80 | \r | |
81 | @retval 0 Read data failed, No data is to be read.\r | |
82 | @retval >0 Aactual number of bytes read from serial device.\r | |
83 | \r | |
84 | **/\r | |
85 | UINTN\r | |
86 | EFIAPI\r | |
87 | SerialPortRead (\r | |
88 | OUT UINT8 *Buffer,\r | |
89 | IN UINTN NumberOfBytes\r | |
90 | )\r | |
91 | {\r | |
92 | return 0;\r | |
93 | }\r | |
94 | \r | |
95 | /**\r | |
96 | Polls a serial device to see if there is any data waiting to be read.\r | |
97 | \r | |
98 | Polls a serial device to see if there is any data waiting to be read.\r | |
99 | If there is data waiting to be read from the serial device, then TRUE is returned.\r | |
100 | If there is no data waiting to be read from the serial device, then FALSE is returned.\r | |
101 | \r | |
102 | @retval TRUE Data is waiting to be read from the serial device.\r | |
103 | @retval FALSE There is no data waiting to be read from the serial device.\r | |
104 | \r | |
105 | **/\r | |
106 | BOOLEAN\r | |
107 | EFIAPI\r | |
108 | SerialPortPoll (\r | |
109 | VOID\r | |
110 | )\r | |
111 | {\r | |
112 | return FALSE;\r | |
113 | }\r | |
114 | \r |