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