2 I2C Device Enumerate Protocol as defined in the PI 1.3 specification.
4 This protocol supports the enumerations of device on the I2C bus.
6 Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
7 SPDX-License-Identifier: BSD-2-Clause-Patent
9 @par Revision Reference:
10 This protocol is from PI Version 1.3.
14 #ifndef __I2C_ENUMERATE_H__
15 #define __I2C_ENUMERATE_H__
19 #define EFI_I2C_ENUMERATE_PROTOCOL_GUID { 0xda8cd7c4, 0x1c00, 0x49e2, { 0x80, 0x3e, 0x52, 0x14, 0xe7, 0x01, 0x89, 0x4c }}
21 typedef struct _EFI_I2C_ENUMERATE_PROTOCOL EFI_I2C_ENUMERATE_PROTOCOL
;
24 Enumerate the I2C devices
26 This function enables the caller to traverse the set of I2C devices
29 @param[in] This The platform data for the next device on
30 the I2C bus was returned successfully.
31 @param[in, out] Device Pointer to a buffer containing an
32 EFI_I2C_DEVICE structure. Enumeration is
33 started by setting the initial EFI_I2C_DEVICE
34 structure pointer to NULL. The buffer
35 receives an EFI_I2C_DEVICE structure pointer
36 to the next I2C device.
38 @retval EFI_SUCCESS The platform data for the next device on
39 the I2C bus was returned successfully.
40 @retval EFI_INVALID_PARAMETER Device is NULL
41 @retval EFI_NO_MAPPING *Device does not point to a valid
42 EFI_I2C_DEVICE structure returned in a
43 previous call Enumerate().
48 (EFIAPI
*EFI_I2C_ENUMERATE_PROTOCOL_ENUMERATE
) (
49 IN CONST EFI_I2C_ENUMERATE_PROTOCOL
*This
,
50 IN OUT CONST EFI_I2C_DEVICE
**Device
54 Get the requested I2C bus frequency for a specified bus configuration.
56 This function returns the requested I2C bus clock frequency for the
57 I2cBusConfiguration. This routine is provided for diagnostic purposes
58 and is meant to be called after calling Enumerate to get the
59 I2cBusConfiguration value.
61 @param[in] This Pointer to an EFI_I2C_ENUMERATE_PROTOCOL
63 @param[in] I2cBusConfiguration I2C bus configuration to access the I2C
65 @param[out] *BusClockHertz Pointer to a buffer to receive the I2C
66 bus clock frequency in Hertz
68 @retval EFI_SUCCESS The I2C bus frequency was returned
70 @retval EFI_INVALID_PARAMETER BusClockHertz was NULL
71 @retval EFI_NO_MAPPING Invalid I2cBusConfiguration value
76 (EFIAPI
*EFI_I2C_ENUMERATE_PROTOCOL_GET_BUS_FREQUENCY
) (
77 IN CONST EFI_I2C_ENUMERATE_PROTOCOL
*This
,
78 IN UINTN I2cBusConfiguration
,
79 OUT UINTN
*BusClockHertz
83 /// I2C Enumerate protocol
85 struct _EFI_I2C_ENUMERATE_PROTOCOL
{
87 /// Traverse the set of I2C devices on an I2C bus. This routine
88 /// returns the next I2C device on an I2C bus.
90 EFI_I2C_ENUMERATE_PROTOCOL_ENUMERATE Enumerate
;
93 /// Get the requested I2C bus frequency for a specified bus
96 EFI_I2C_ENUMERATE_PROTOCOL_GET_BUS_FREQUENCY GetBusFrequency
;
100 /// Reference to variable defined in the .DEC file
102 extern EFI_GUID gEfiI2cEnumerateProtocolGuid
;
104 #endif // __I2C_ENUMERATE_H__