mirror of https://github.com/acidanthera/audk.git
sync the comments of serialportlib library class with Mde Library Spec.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6080 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
1b88ce8644
commit
d69107aadc
|
@ -16,10 +16,14 @@
|
||||||
#define __SERIAL_PORT_LIB__
|
#define __SERIAL_PORT_LIB__
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Initialize the serial device hardware.
|
||||||
|
|
||||||
Programmed hardware of Serial port.
|
If no initialization is required, then return RETURN_SUCCESS.
|
||||||
|
If the serial device was successfuly initialized, then return RETURN_SUCCESS.
|
||||||
|
If the serial device could not be initialized, then return RETURN_DEVICE_ERROR.
|
||||||
|
|
||||||
@return Status of Serial Port Device initialization.
|
@retval RETURN_SUCCESS The serial device was initialized.
|
||||||
|
@retval RETURN_DEVICE_ERROR The serail device could not be initialized.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
RETURN_STATUS
|
RETURN_STATUS
|
||||||
|
@ -31,14 +35,20 @@ SerialPortInitialize (
|
||||||
/**
|
/**
|
||||||
Write data from buffer to serial device.
|
Write data from buffer to serial device.
|
||||||
|
|
||||||
If the Buffer is NULL, then return 0;
|
Writes NumberOfBytes data bytes from Buffer to the serial device.
|
||||||
if NumberOfBytes is zero, then return 0.
|
The number of bytes actually written to the serial device is returned.
|
||||||
|
If the return value is less than NumberOfBytes, then the write operation failed.
|
||||||
|
|
||||||
@param Buffer Point of data buffer which need to be writed.
|
If Buffer is NULL, then ASSERT().
|
||||||
@param NumberOfBytes Number of output bytes which are cached in Buffer.
|
|
||||||
|
|
||||||
@retval 0 Write data failed, or No data is to be written.
|
If NumberOfBytes is zero, then return 0.
|
||||||
@retval !0 Actual number of bytes writed to serial device.
|
|
||||||
|
@param Buffer Pointer to the data buffer to be written.
|
||||||
|
@param NumberOfBytes Number of bytes to written to the serial device.
|
||||||
|
|
||||||
|
@retval 0 NumberOfBytes is 0.
|
||||||
|
@retval >0 The number of bytes written to the serial device.
|
||||||
|
If this value is less than NumberOfBytes, then the read operation failed.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINTN
|
UINTN
|
||||||
|
@ -52,11 +62,15 @@ SerialPortWrite (
|
||||||
/**
|
/**
|
||||||
Read data from serial device and save the datas in buffer.
|
Read data from serial device and save the datas in buffer.
|
||||||
|
|
||||||
If the Buffer is NULL, then return zero;
|
Reads NumberOfBytes data bytes from a serial device into the buffer
|
||||||
if NumberOfBytes is zero, then return zero.
|
specified by Buffer. The number of bytes actually read is returned.
|
||||||
|
If the return value is less than NumberOfBytes, then the rest operation failed.
|
||||||
|
|
||||||
@param Buffer Point of data buffer, which contains the data
|
If Buffer is NULL, then ASSERT().
|
||||||
returned from the serial device.
|
|
||||||
|
If NumberOfBytes is zero, then return 0.
|
||||||
|
|
||||||
|
@param Buffer Pointer to the data buffer to store the data read from the serial device.
|
||||||
@param NumberOfBytes Number of bytes which will be read.
|
@param NumberOfBytes Number of bytes which will be read.
|
||||||
|
|
||||||
@retval 0 Read data failed, No data is to be read.
|
@retval 0 Read data failed, No data is to be read.
|
||||||
|
|
|
@ -19,9 +19,14 @@
|
||||||
#include <Library/SerialPortLib.h>
|
#include <Library/SerialPortLib.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Programmed hardware of Serial port.
|
Initialize the serial device hardware.
|
||||||
|
|
||||||
@return Always return RETURN_UNSUPPORTED.
|
If no initialization is required, then return RETURN_SUCCESS.
|
||||||
|
If the serial device was successfuly initialized, then return RETURN_SUCCESS.
|
||||||
|
If the serial device could not be initialized, then return RETURN_DEVICE_ERROR.
|
||||||
|
|
||||||
|
@retval RETURN_SUCCESS The serial device was initialized.
|
||||||
|
@retval RETURN_DEVICE_ERROR The serail device could not be initialized.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
RETURN_STATUS
|
RETURN_STATUS
|
||||||
|
@ -34,12 +39,22 @@ SerialPortInitialize (
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Write data to serial device.
|
Write data from buffer to serial device.
|
||||||
|
|
||||||
@param Buffer Point of data buffer which need to be writed.
|
Writes NumberOfBytes data bytes from Buffer to the serial device.
|
||||||
@param NumberOfBytes Number of output bytes which are cached in Buffer.
|
The number of bytes actually written to the serial device is returned.
|
||||||
|
If the return value is less than NumberOfBytes, then the write operation failed.
|
||||||
|
|
||||||
@retval 0 No data is to be written.
|
If Buffer is NULL, then ASSERT().
|
||||||
|
|
||||||
|
If NumberOfBytes is zero, then return 0.
|
||||||
|
|
||||||
|
@param Buffer Pointer to the data buffer to be written.
|
||||||
|
@param NumberOfBytes Number of bytes to written to the serial device.
|
||||||
|
|
||||||
|
@retval 0 NumberOfBytes is 0.
|
||||||
|
@retval >0 The number of bytes written to the serial device.
|
||||||
|
If this value is less than NumberOfBytes, then the read operation failed.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINTN
|
UINTN
|
||||||
|
@ -54,13 +69,14 @@ SerialPortWrite (
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Read data from serial device and save the datas in buffer.
|
Reads data from a serial device into a buffer.
|
||||||
|
|
||||||
@param Buffer Point of data buffer, which contains the data
|
@param Buffer Pointer to the data buffer to store the data read from the serial device.
|
||||||
returned from the serial device.
|
@param NumberOfBytes Number of bytes to read from the serial device.
|
||||||
@param NumberOfBytes Number of bytes which will be read.
|
|
||||||
|
|
||||||
@retval 0 No data is to be read.
|
@retval 0 NumberOfBytes is 0.
|
||||||
|
@retval >0 The number of bytes read from the serial device.
|
||||||
|
If this value is less than NumberOfBytes, then the read operation failed.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINTN
|
UINTN
|
||||||
|
|
Loading…
Reference in New Issue