]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | Internal header file for Smbus library.\r | |
3 | \r | |
4 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r | |
5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
6 | \r | |
7 | \r | |
8 | **/\r | |
9 | \r | |
10 | #ifndef __INTERNAL_SMBUS_LIB_H_\r | |
11 | #define __INTERNAL_SMBUS_LIB_H_\r | |
12 | \r | |
13 | #include <PiPei.h>\r | |
14 | \r | |
15 | #include <Ppi/Smbus2.h>\r | |
16 | \r | |
17 | #include <Library/SmbusLib.h>\r | |
18 | #include <Library/DebugLib.h>\r | |
19 | #include <Library/PeiServicesLib.h>\r | |
20 | #include <Library/BaseMemoryLib.h>\r | |
21 | \r | |
22 | //\r | |
23 | // Declaration for internal functions\r | |
24 | //\r | |
25 | \r | |
26 | /**\r | |
27 | Gets Smbus PPIs.\r | |
28 | \r | |
29 | This internal function retrieves Smbus PPI from PPI database.\r | |
30 | \r | |
31 | @param VOID\r | |
32 | \r | |
33 | @return The pointer to Smbus PPI.\r | |
34 | \r | |
35 | **/\r | |
36 | EFI_PEI_SMBUS2_PPI *\r | |
37 | InternalGetSmbusPpi (\r | |
38 | VOID\r | |
39 | );\r | |
40 | \r | |
41 | /**\r | |
42 | Executes an SMBus operation to an SMBus controller.\r | |
43 | \r | |
44 | This function provides a standard way to execute Smbus script\r | |
45 | as defined in the SmBus Specification. The data can either be of\r | |
46 | the Length byte, word, or a block of data.\r | |
47 | \r | |
48 | @param SmbusOperation Signifies which particular SMBus hardware protocol\r | |
49 | instance that it will use to execute the SMBus transactions.\r | |
50 | @param SmBusAddress The address that encodes the SMBUS Slave Address,\r | |
51 | SMBUS Command, SMBUS Data Length, and PEC.\r | |
52 | @param Length Signifies the number of bytes that this operation will\r | |
53 | do. The maximum number of bytes can be revision specific\r | |
54 | and operation specific.\r | |
55 | @param Buffer Contains the value of data to execute to the SMBus slave\r | |
56 | device. Not all operations require this argument. The\r | |
57 | length of this buffer is identified by Length.\r | |
58 | @param Status Return status for the executed command.\r | |
59 | This is an optional parameter and may be NULL.\r | |
60 | \r | |
61 | @return The actual number of bytes that are executed for this operation.\r | |
62 | \r | |
63 | **/\r | |
64 | UINTN\r | |
65 | InternalSmBusExec (\r | |
66 | IN EFI_SMBUS_OPERATION SmbusOperation,\r | |
67 | IN UINTN SmBusAddress,\r | |
68 | IN UINTN Length,\r | |
69 | IN OUT VOID *Buffer,\r | |
70 | OUT RETURN_STATUS *Status OPTIONAL\r | |
71 | );\r | |
72 | \r | |
73 | #endif\r |