CirrusLogic5430I2c.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /** @file
  2. I2c Bus byte read/write functions.
  3. Copyright (c) 2008 - 2009, Intel Corporation. All rights reserved.<BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef _CIRRUS_LOGIC_I2C_H_
  7. #define _CIRRUS_LOGIC_I2C_H_
  8. #include <Protocol/PciIo.h>
  9. /**
  10. Read one byte data on I2C Bus.
  11. Read one byte data from the slave device connectet to I2C Bus.
  12. If Data is NULL, then ASSERT().
  13. @param PciIo The pointer to PCI_IO_PROTOCOL.
  14. @param DeviceAddress Slave device's address.
  15. @param RegisterAddress The register address on slave device.
  16. @param Data The pointer to returned data if EFI_SUCCESS returned.
  17. @retval EFI_DEVICE_ERROR
  18. @retval EFI_SUCCESS
  19. **/
  20. EFI_STATUS
  21. EFIAPI
  22. I2cReadByte (
  23. EFI_PCI_IO_PROTOCOL *PciIo,
  24. UINT8 DeviceAddress,
  25. UINT8 RegisterAddress,
  26. UINT8 *Data
  27. );
  28. /**
  29. Write one byte data onto I2C Bus.
  30. Write one byte data to the slave device connectet to I2C Bus.
  31. If Data is NULL, then ASSERT().
  32. @param PciIo The pointer to PCI_IO_PROTOCOL.
  33. @param DeviceAddress Slave device's address.
  34. @param RegisterAddress The register address on slave device.
  35. @param Data The pointer to write data.
  36. @retval EFI_DEVICE_ERROR
  37. @retval EFI_SUCCESS
  38. **/
  39. EFI_STATUS
  40. EFIAPI
  41. I2cWriteByte (
  42. EFI_PCI_IO_PROTOCOL *PciIo,
  43. UINT8 DeviceAddress,
  44. UINT8 RegisterAddress,
  45. UINT8 *Data
  46. );
  47. #endif