]>
Commit | Line | Data |
---|---|---|
878ddf1f | 1 | /** @file\r |
2 | Internal header file for Smbus library.\r | |
3 | \r | |
4 | Copyright (c) 2006, Intel Corporation<BR>\r | |
5 | All rights reserved. This program and the accompanying materials \r | |
6 | are licensed and made available under the terms and conditions of the BSD License \r | |
7 | which accompanies this distribution. The full text of the license may be found at \r | |
8 | http://opensource.org/licenses/bsd-license.php \r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
12 | \r | |
13 | \r | |
878ddf1f | 14 | **/\r |
15 | \r | |
16 | #ifndef __INTERNAL_SMBUS_LIB_H\r | |
17 | #define __INTERNAL_SMBUS_LIB_H\r | |
18 | \r | |
abea19db | 19 | #define SMBUS_LIB_SLAVE_ADDRESS(SmBusAddress) (((SmBusAddress) >> 1) & 0x7f)\r |
20 | #define SMBUS_LIB_COMMAND(SmBusAddress) (((SmBusAddress) >> 8) & 0xff)\r | |
4ba61e5e | 21 | #define SMBUS_LIB_LENGTH(SmBusAddress) (((SmBusAddress) >> 16) & 0x3f)\r |
abea19db | 22 | #define SMBUS_LIB_PEC(SmBusAddress) ((BOOLEAN) (((SmBusAddress) & SMBUS_LIB_PEC_BIT) != 0))\r |
4ba61e5e | 23 | #define SMBUS_LIB_RESEARVED(SmBusAddress) ((SmBusAddress) & ~(((1 << 22) - 2) | SMBUS_LIB_PEC_BIT))\r |
878ddf1f | 24 | \r |
25 | //\r | |
26 | // Declaration for internal functions\r | |
27 | //\r | |
28 | /**\r | |
29 | Executes an SMBus operation to an SMBus controller. \r | |
30 | \r | |
31 | This function provides a standard way to execute Smbus script\r | |
32 | as defined in the SmBus Specification. The data can either be of\r | |
33 | the Length byte, word, or a block of data.\r | |
34 | \r | |
35 | @param SmbusOperation Signifies which particular SMBus hardware protocol instance that it will use to\r | |
36 | execute the SMBus transactions.\r | |
37 | @param SmBusAddress Address that encodes the SMBUS Slave Address,\r | |
38 | SMBUS Command, SMBUS Data Length, and PEC.\r | |
39 | @param Length Signifies the number of bytes that this operation will do. The maximum number of\r | |
40 | bytes can be revision specific and operation specific.\r | |
41 | @param Buffer Contains the value of data to execute to the SMBus slave device. Not all operations\r | |
42 | require this argument. The length of this buffer is identified by Length.\r | |
43 | @param Status Return status for the executed command.\r | |
44 | This is an optional parameter and may be NULL.\r | |
45 | \r | |
abea19db | 46 | @return The actual number of bytes that are executed for this operation.\r |
878ddf1f | 47 | \r |
48 | **/\r | |
49 | UINTN\r | |
50 | InternalSmBusExec (\r | |
51 | IN EFI_SMBUS_OPERATION SmbusOperation,\r | |
52 | IN UINTN SmBusAddress,\r | |
53 | IN UINTN Length,\r | |
abea19db | 54 | IN OUT VOID *Buffer,\r |
878ddf1f | 55 | OUT RETURN_STATUS *Status OPTIONAL\r |
56 | );\r | |
57 | \r | |
878ddf1f | 58 | #endif\r |