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