2 Internal header file for Smbus library.
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #ifndef __INTERNAL_SMBUS_LIB_H_
11 #define __INTERNAL_SMBUS_LIB_H_
15 #include <Ppi/Smbus2.h>
17 #include <Library/SmbusLib.h>
18 #include <Library/DebugLib.h>
19 #include <Library/PeiServicesLib.h>
20 #include <Library/BaseMemoryLib.h>
23 // Declaration for internal functions
29 This internal function retrieves Smbus PPI from PPI database.
33 @return The pointer to Smbus PPI.
42 Executes an SMBus operation to an SMBus controller.
44 This function provides a standard way to execute Smbus script
45 as defined in the SmBus Specification. The data can either be of
46 the Length byte, word, or a block of data.
48 @param SmbusOperation Signifies which particular SMBus hardware protocol
49 instance that it will use to execute the SMBus transactions.
50 @param SmBusAddress The address that encodes the SMBUS Slave Address,
51 SMBUS Command, SMBUS Data Length, and PEC.
52 @param Length Signifies the number of bytes that this operation will
53 do. The maximum number of bytes can be revision specific
54 and operation specific.
55 @param Buffer Contains the value of data to execute to the SMBus slave
56 device. Not all operations require this argument. The
57 length of this buffer is identified by Length.
58 @param Status Return status for the executed command.
59 This is an optional parameter and may be NULL.
61 @return The actual number of bytes that are executed for this operation.
66 IN EFI_SMBUS_OPERATION SmbusOperation
,
67 IN UINTN SmBusAddress
,
70 OUT RETURN_STATUS
*Status OPTIONAL