Home | History | Annotate | Download | only in CirrusLogic5430Dxe
      1 /** @file
      2   I2c Bus byte read/write functions.
      3 
      4   Copyright (c) 2008 - 2009, Intel Corporation. All rights reserved.<BR>
      5   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 #ifndef _CIRRUS_LOGIC_I2C_H_
     16 #define _CIRRUS_LOGIC_I2C_H_
     17 
     18 #include <Protocol/PciIo.h>
     19 
     20 /**
     21   Read one byte data on I2C Bus.
     22 
     23   Read one byte data from the slave device connectet to I2C Bus.
     24   If Data is NULL, then ASSERT().
     25 
     26   @param  PciIo              The pointer to PCI_IO_PROTOCOL.
     27   @param  DeviceAddress      Slave device's address.
     28   @param  RegisterAddress    The register address on slave device.
     29   @param  Data               The pointer to returned data if EFI_SUCCESS returned.
     30 
     31   @retval EFI_DEVICE_ERROR
     32   @retval EFI_SUCCESS
     33 
     34 **/
     35 EFI_STATUS
     36 EFIAPI
     37 I2cReadByte (
     38   EFI_PCI_IO_PROTOCOL    *PciIo,
     39   UINT8                  DeviceAddress,
     40   UINT8                  RegisterAddress,
     41   UINT8                  *Data
     42   );
     43 
     44 /**
     45   Write one byte data onto I2C Bus.
     46 
     47   Write one byte data to the slave device connectet to I2C Bus.
     48   If Data is NULL, then ASSERT().
     49 
     50   @param  PciIo              The pointer to PCI_IO_PROTOCOL.
     51   @param  DeviceAddress      Slave device's address.
     52   @param  RegisterAddress    The register address on slave device.
     53   @param  Data               The pointer to write data.
     54 
     55   @retval EFI_DEVICE_ERROR
     56   @retval EFI_SUCCESS
     57 
     58 **/
     59 EFI_STATUS
     60 EFIAPI
     61 I2cWriteByte (
     62   EFI_PCI_IO_PROTOCOL    *PciIo,
     63   UINT8                  DeviceAddress,
     64   UINT8                  RegisterAddress,
     65   UINT8                  *Data
     66   );
     67 
     68 #endif
     69