2009-12-06 02:57:05 +01:00
|
|
|
/** @file
|
|
|
|
Serial I/O Port library functions with no library constructor/destructor
|
|
|
|
|
2010-04-29 14:40:51 +02:00
|
|
|
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
|
2012-09-28 12:56:12 +02:00
|
|
|
Copyright (c) 2012, ARM Ltd. All rights reserved.
|
2009-12-06 02:57:05 +01:00
|
|
|
|
2010-04-29 14:40:51 +02:00
|
|
|
This program and the accompanying materials
|
2009-12-06 02:57:05 +01:00
|
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
#include <Base.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include <Library/SerialPortLib.h>
|
|
|
|
|
2012-09-28 12:56:12 +02:00
|
|
|
/**
|
2009-12-06 02:57:05 +01:00
|
|
|
|
|
|
|
Programmed hardware of Serial port.
|
|
|
|
|
|
|
|
@return Always return EFI_UNSUPPORTED.
|
|
|
|
|
|
|
|
**/
|
|
|
|
RETURN_STATUS
|
|
|
|
EFIAPI
|
|
|
|
SerialPortInitialize (
|
|
|
|
VOID
|
|
|
|
)
|
|
|
|
{
|
|
|
|
return RETURN_UNSUPPORTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Write data to serial device.
|
|
|
|
|
2011-09-23 00:53:54 +02:00
|
|
|
@param Buffer Point of data buffer which need to be written.
|
2009-12-06 02:57:05 +01:00
|
|
|
@param NumberOfBytes Number of output bytes which are cached in Buffer.
|
|
|
|
|
|
|
|
@retval 0 Write data failed.
|
2011-09-23 00:53:54 +02:00
|
|
|
@retval !0 Actual number of bytes written to serial device.
|
2009-12-06 02:57:05 +01:00
|
|
|
|
|
|
|
**/
|
|
|
|
UINTN
|
|
|
|
EFIAPI
|
|
|
|
SerialPortWrite (
|
|
|
|
IN UINT8 *Buffer,
|
|
|
|
IN UINTN NumberOfBytes
|
2012-09-28 12:56:12 +02:00
|
|
|
)
|
2009-12-06 02:57:05 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2011-09-23 00:53:54 +02:00
|
|
|
Read data from serial device and save the data in buffer.
|
2009-12-06 02:57:05 +01:00
|
|
|
|
2011-09-23 00:53:54 +02:00
|
|
|
@param Buffer Point of data buffer which need to be written.
|
2009-12-06 02:57:05 +01:00
|
|
|
@param NumberOfBytes Number of output bytes which are cached in Buffer.
|
|
|
|
|
|
|
|
@retval 0 Read data failed.
|
2011-09-23 00:53:54 +02:00
|
|
|
@retval !0 Actual number of bytes read from serial device.
|
2009-12-06 02:57:05 +01:00
|
|
|
|
|
|
|
**/
|
|
|
|
UINTN
|
|
|
|
EFIAPI
|
|
|
|
SerialPortRead (
|
|
|
|
OUT UINT8 *Buffer,
|
|
|
|
IN UINTN NumberOfBytes
|
2012-09-28 12:56:12 +02:00
|
|
|
)
|
2009-12-06 02:57:05 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Poll the serial device to see if there is any data waiting.
|
|
|
|
|
|
|
|
If there is data waiting to be read from the serial port, then return
|
|
|
|
TRUE. If there is no data waiting to be read from the serial port, then
|
|
|
|
return FALSE.
|
|
|
|
|
|
|
|
@retval TRUE Data is waiting to be read.
|
|
|
|
@retval FALSE There is no data waiting to be read.
|
|
|
|
|
|
|
|
**/
|
|
|
|
BOOLEAN
|
|
|
|
EFIAPI
|
|
|
|
SerialPortPoll (
|
|
|
|
VOID
|
|
|
|
)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|