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