]> git.proxmox.com Git - mirror_edk2.git/blob - OptionRomPkg/Include/Library/DxeI2cLib.h
1. add DxeI2c Library in OptionRomPkg.
[mirror_edk2.git] / OptionRomPkg / Include / Library / DxeI2cLib.h
1 /** @file
2 I2c Bus byte read/write functions.
3
4 Copyright (c) 2008, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #include <Protocol/PciIo.h>
16
17 /**
18 Read one byte data on I2C Bus.
19
20 Read one byte data from the slave device connectet to I2C Bus.
21 If Data is NULL, then ASSERT().
22
23 @param PciIo The pointer to PCI_IO_PROTOCOL.
24 @param DeviceAddress Slave device's address.
25 @param RegisterAddress The register address on slave device.
26 @param Data The pointer to returned data if EFI_SUCCESS returned.
27
28 @retval EFI_DEVICE_ERROR
29 @retval EFI_SUCCESS
30
31 **/
32 EFI_STATUS
33 EFIAPI
34 I2cReadByte (
35 EFI_PCI_IO_PROTOCOL *PciIo,
36 UINT8 DeviceAddress,
37 UINT8 RegisterAddress,
38 UINT8 *Data
39 );
40
41 /**
42 Write one byte data onto I2C Bus.
43
44 Write one byte data to the slave device connectet to I2C Bus.
45 If Data is NULL, then ASSERT().
46
47 @param PciIo The pointer to PCI_IO_PROTOCOL.
48 @param DeviceAddress Slave device's address.
49 @param RegisterAddress The register address on slave device.
50 @param Data The pointer to write data.
51
52 @retval EFI_DEVICE_ERROR
53 @retval EFI_SUCCESS
54
55 **/
56 EFI_STATUS
57 EFIAPI
58 I2cWriteByte (
59 EFI_PCI_IO_PROTOCOL *PciIo,
60 UINT8 DeviceAddress,
61 UINT8 RegisterAddress,
62 UINT8 *Data
63 );
64