]> git.proxmox.com Git - mirror_edk2.git/blame - Vlv2TbltDevicePkg/Include/Library/I2CLib.h
Vlv2TbltDevicePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / Vlv2TbltDevicePkg / Include / Library / I2CLib.h
CommitLineData
4e522096
DW
1/** @file\r
2 Interface Definitions for I2C Lib.\r
3 \r
4 Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
5 \r
9dc8036d 6 SPDX-License-Identifier: BSD-2-Clause-Patent\r
4e522096
DW
7 \r
8--*/\r
9\r
10#include <Uefi.h>\r
11#include <Library/IoLib.h>\r
12\r
13#ifndef I2C_LIB_HEADER_H\r
14#define I2C_LIB_HEADER_H\r
15\r
16\r
17/**\r
18 Reads a Byte from I2C Device.\r
19 \r
20 @param I2cControllerIndex I2C Bus no to which the I2C device has been connected\r
21 @param SlaveAddress Device Address from which the byte value has to be read\r
22 @param Offset Offset from which the data has to be read\r
23 @param ReadBytes Number of bytes to be read\r
24 @param *ReadBuffer Address to which the value read has to be stored\r
25 \r
26 @return EFI_SUCCESS If the byte value has been successfully read\r
27 @return EFI_DEVICE_ERROR Operation Failed, Device Error\r
28**/\r
29EFI_STATUS \r
30ByteReadI2C(\r
31 IN UINT8 BusNo, \r
32 IN UINT8 SlaveAddress, \r
33 IN UINT8 Offset, \r
34 IN UINTN ReadBytes,\r
35 OUT UINT8 *ReadBuffer\r
36 );\r
37\r
38/**\r
39 Writes a Byte to I2C Device.\r
40 \r
41 @param I2cControllerIndex I2C Bus no to which the I2C device has been connected\r
42 @param SlaveAddress Device Address from which the byte value has to be written\r
43 @param Offset Offset from which the data has to be written\r
44 @param WriteBytes Number of bytes to be written\r
45 @param *Byte Address to which the value written is stored\r
46 \r
47 @return EFI_SUCCESS If the byte value has been successfully read\r
48 @return EFI_DEVICE_ERROR Operation Failed, Device Error\r
49**/ \r
50EFI_STATUS ByteWriteI2C(\r
51 IN UINT8 BusNo, \r
52 IN UINT8 SlaveAddress,\r
53 IN UINT8 Offset,\r
54 IN UINTN WriteBytes,\r
55 IN UINT8 *WriteBuffer\r
56 );\r
57\r
58#endif\r