]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Library/SerialPortLib.h
Removed MdePkg usage of ModuleName: in file headers
[mirror_edk2.git] / MdePkg / Include / Library / SerialPortLib.h
1
2 /** @file
3 Serial I/O Port library functions with no library constructor/destructor
4
5 Copyright (c) 2006, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #ifndef __SERIAL_PORT_LIB__
17 #define __SERIAL_PORT_LIB__
18
19 /**
20
21 Programmed hardware of Serial port.
22
23 @return Status of Serial Port Device initialization.
24
25 **/
26 RETURN_STATUS
27 EFIAPI
28 SerialPortInitialize (
29 VOID
30 );
31
32 /**
33 Write data to serial device.
34
35 If the buffer is NULL, then return 0;
36 if NumberOfBytes is zero, then return 0.
37
38 @param Buffer Point of data buffer which need to be writed.
39 @param NumberOfBytes Number of output bytes which are cached in Buffer.
40
41 @retval 0 Write data failed.
42 @retval !0 Actual number of bytes writed to serial device.
43
44 **/
45 UINTN
46 EFIAPI
47 SerialPortWrite (
48 IN UINT8 *Buffer,
49 IN UINTN NumberOfBytes
50 );
51
52
53 /**
54 Read data from serial device and save the datas in buffer.
55
56 If the buffer is NULL, then return zero;
57 if NumberOfBytes is zero, then return zero.
58
59 @param Buffer Point of data buffer which need to be writed.
60 @param NumberOfBytes Number of output bytes which are cached in Buffer.
61
62 @retval 0 Read data failed.
63 @retval !0 Aactual number of bytes read from serial device.
64
65 **/
66 UINTN
67 EFIAPI
68 SerialPortRead (
69 OUT UINT8 *Buffer,
70 IN UINTN NumberOfBytes
71 );
72
73
74 #endif