3 Intel I2C library implementation built upon I/O library
6 Copyright (c) 2013-2015 Intel Corporation.
8 SPDX-License-Identifier: BSD-2-Clause-Patent
19 The I2cWriteByte() function is a wrapper function for the WriteByte() function.
20 Provides a standard way to execute a standard single byte write to an IC2 device
21 (without accessing sub-addresses), as defined in the I2C Specification.
23 @param SlaveAddress The I2C slave address of the device
24 with which to communicate.
26 @param AddrMode I2C Addressing Mode: 7-bit or 10-bit address.
28 @param Buffer Contains the value of byte data to execute to the
32 @retval EFI_SUCCESS Transfer success.
33 @retval EFI_INVALID_PARAMETER This or Buffer pointers are invalid.
34 @retval EFI_TIMEOUT Timeout while waiting xfer.
35 @retval EFI_ABORTED Controller aborted xfer.
36 @retval EFI_DEVICE_ERROR Device error detected by controller.
42 IN EFI_I2C_DEVICE_ADDRESS SlaveAddress
,
43 IN EFI_I2C_ADDR_MODE AddrMode
,
49 The I2cReadByte() function is a wrapper function for the ReadByte() function.
50 Provides a standard way to execute a standard single byte read to an I2C device
51 (without accessing sub-addresses), as defined in the I2C Specification.
53 @param SlaveAddress The I2C slave address of the device
54 with which to communicate.
56 @param AddrMode I2C Addressing Mode: 7-bit or 10-bit address.
58 @param Buffer Contains the value of byte data read from the
62 @retval EFI_SUCCESS Transfer success.
63 @retval EFI_INVALID_PARAMETER This or Buffer pointers are invalid.
64 @retval EFI_TIMEOUT Timeout while waiting xfer.
65 @retval EFI_ABORTED Controller aborted xfer.
66 @retval EFI_DEVICE_ERROR Device error detected by controller.
72 IN EFI_I2C_DEVICE_ADDRESS SlaveAddress
,
73 IN EFI_I2C_ADDR_MODE AddrMode
,
79 The I2cWriteMultipleByte() function is a wrapper function for the WriteMultipleByte()
80 function. Provides a standard way to execute multiple byte writes to an I2C device (e.g. when
81 accessing sub-addresses or writing block of data), as defined in the I2C Specification.
83 @param SlaveAddress The I2C slave address of the device
84 with which to communicate.
86 @param AddrMode I2C Addressing Mode: 7-bit or 10-bit address.
88 @param Length No. of bytes to be written.
90 @param Buffer Contains the value of byte to be written to the
93 @retval EFI_SUCCESS Transfer success.
94 @retval EFI_INVALID_PARAMETER This, Length or Buffer pointers are invalid.
95 @retval EFI_UNSUPPORTED Unsupported input param.
96 @retval EFI_TIMEOUT Timeout while waiting xfer.
97 @retval EFI_ABORTED Controller aborted xfer.
98 @retval EFI_DEVICE_ERROR Device error detected by controller.
103 I2cWriteMultipleByte (
104 IN EFI_I2C_DEVICE_ADDRESS SlaveAddress
,
105 IN EFI_I2C_ADDR_MODE AddrMode
,
112 The I2cReadMultipleByte() function is a wrapper function for the ReadMultipleByte
113 function. Provides a standard way to execute multiple byte writes to an IC2 device
114 (e.g. when accessing sub-addresses or when reading block of data), as defined
115 in the I2C Specification (I2C combined write/read protocol).
117 @param SlaveAddress The I2C slave address of the device
118 with which to communicate.
120 @param AddrMode I2C Addressing Mode: 7-bit or 10-bit address.
122 @param WriteLength No. of bytes to be written. In this case data
123 written typically contains sub-address or sub-addresses
124 in Hi-Lo format, that need to be read (I2C combined
125 write/read protocol).
127 @param ReadLength No. of bytes to be read from I2C slave device.
130 @param Buffer Contains the value of byte data read from the
133 @retval EFI_SUCCESS Transfer success.
134 @retval EFI_INVALID_PARAMETER This, WriteLength, ReadLength or Buffer
135 pointers are invalid.
136 @retval EFI_UNSUPPORTED Unsupported input param.
137 @retval EFI_TIMEOUT Timeout while waiting xfer.
138 @retval EFI_ABORTED Controller aborted xfer.
139 @retval EFI_DEVICE_ERROR Device error detected by controller.
144 I2cReadMultipleByte (
145 IN EFI_I2C_DEVICE_ADDRESS SlaveAddress
,
146 IN EFI_I2C_ADDR_MODE AddrMode
,
147 IN UINTN
*WriteLength
,
148 IN UINTN
*ReadLength
,