2 Serial I/O Port library functions with no library constructor/destructor
4 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
5 Copyright (c) 2012, ARM Ltd. All rights reserved.
7 This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which accompanies this distribution. The full text of the license may be found at
10 http://opensource.org/licenses/bsd-license.php
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
20 #include <Library/SerialPortLib.h>
21 #include <Library/SerialPortExtLib.h>
25 Programmed hardware of Serial port.
27 @return Always return EFI_UNSUPPORTED.
32 SerialPortInitialize (
36 return RETURN_UNSUPPORTED
;
40 Set the serial device control bits.
42 @return Always return EFI_UNSUPPORTED.
47 SerialPortSetControl (
51 return RETURN_UNSUPPORTED
;
55 Get the serial device control bits.
57 @param Control Control signals read from the serial device.
59 @retval EFI_SUCCESS The control bits were read from the serial device.
60 @retval EFI_DEVICE_ERROR The serial device is not functioning correctly.
65 SerialPortGetControl (
69 if (SerialPortPoll ()) {
70 // If a character is pending don't set EFI_SERIAL_INPUT_BUFFER_EMPTY
71 *Control
= EFI_SERIAL_OUTPUT_BUFFER_EMPTY
;
73 *Control
= EFI_SERIAL_INPUT_BUFFER_EMPTY
| EFI_SERIAL_OUTPUT_BUFFER_EMPTY
;
79 Set the serial device attributes.
81 @return Always return EFI_UNSUPPORTED.
86 SerialPortSetAttributes (
87 IN OUT UINT64
*BaudRate
,
88 IN OUT UINT32
*ReceiveFifoDepth
,
89 IN OUT UINT32
*Timeout
,
90 IN OUT EFI_PARITY_TYPE
*Parity
,
91 IN OUT UINT8
*DataBits
,
92 IN OUT EFI_STOP_BITS_TYPE
*StopBits
95 return RETURN_UNSUPPORTED
;
99 Write data to serial device.
101 @param Buffer Point of data buffer which need to be written.
102 @param NumberOfBytes Number of output bytes which are cached in Buffer.
104 @retval 0 Write data failed.
105 @retval !0 Actual number of bytes written to serial device.
112 IN UINTN NumberOfBytes
120 Read data from serial device and save the data in buffer.
122 @param Buffer Point of data buffer which need to be written.
123 @param NumberOfBytes Number of output bytes which are cached in Buffer.
125 @retval 0 Read data failed.
126 @retval !0 Actual number of bytes read from serial device.
133 IN UINTN NumberOfBytes
142 Poll the serial device to see if there is any data waiting.
144 If there is data waiting to be read from the serial port, then return
145 TRUE. If there is no data waiting to be read from the serial port, then
148 @retval TRUE Data is waiting to be read.
149 @retval FALSE There is no data waiting to be read.