TianoCore EDK2 master
|
#include <Uefi.h>
#include <Library/DebugLib.h>
#include <Library/SemihostLib.h>
#include <Library/SerialPortLib.h>
Go to the source code of this file.
Macros | |
#define | PRINT_BUFFER_SIZE 512 |
#define | PRINT_BUFFER_THRESHOLD (PRINT_BUFFER_SIZE - 4) |
Functions | |
RETURN_STATUS EFIAPI | SerialPortInitialize (VOID) |
UINTN EFIAPI | SerialPortWrite (IN UINT8 *Buffer, IN UINTN NumberOfBytes) |
UINTN EFIAPI | SerialPortRead (OUT UINT8 *Buffer, IN UINTN NumberOfBytes) |
BOOLEAN EFIAPI | SerialPortPoll (VOID) |
Serial I/O Port library functions with no library constructor/destructor
Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
Copyright (c) 2021, Arm Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file SerialPortLib.c.
#define PRINT_BUFFER_SIZE 512 |
Write data to serial device.
Buffer | Point of data buffer which need to be written. |
NumberOfBytes | Number of output bytes which are cached in Buffer. |
0 | Write data failed. |
!0 | Actual number of bytes written to serial device. |
Definition at line 47 of file SerialPortLib.c.
#define PRINT_BUFFER_THRESHOLD (PRINT_BUFFER_SIZE - 4) |
Definition at line 48 of file SerialPortLib.c.
RETURN_STATUS EFIAPI SerialPortInitialize | ( | VOID | ) |
Initialize the serial device hardware.
If no initialization is required, then return RETURN_SUCCESS. If the serial device was successfully initialized, then return RETURN_SUCCESS. If the serial device could not be initialized, then return RETURN_DEVICE_ERROR.
RETURN_SUCCESS | The serial device was initialized. |
RETURN_DEVICE_ERROR | The serial device could not be initialized. |
Definition at line 25 of file SerialPortLib.c.
BOOLEAN EFIAPI SerialPortPoll | ( | VOID | ) |
Check to see if any data is available to be read from the debug device.
TRUE | At least one byte of data is available to be read |
FALSE | No data is available to be read |
Definition at line 127 of file SerialPortLib.c.
Read data from serial device and save the datas in buffer.
Buffer | Point of data buffer which need to be written. |
NumberOfBytes | Number of output bytes which are cached in Buffer. |
0 | Read data failed. |
!0 | Actual number of bytes read from serial device. |
Definition at line 109 of file SerialPortLib.c.
Write data from buffer to serial device.
Writes NumberOfBytes data bytes from Buffer to the serial device. 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. If Buffer is NULL, then ASSERT(). If NumberOfBytes is zero, then return 0.
Buffer | Pointer to the data buffer to be written. |
NumberOfBytes | Number of bytes to written to the serial device. |
0 | NumberOfBytes is 0. |
>0 | The number of bytes written to the serial device. If this value is less than NumberOfBytes, then the write operation failed. |
Definition at line 52 of file SerialPortLib.c.