]>
Commit | Line | Data |
---|---|---|
4006b0b5 EL |
1 | /** @file\r |
2 | I2C Device Enumerate Protocol as defined in the PI 1.3 specification.\r | |
3 | \r | |
4 | This protocol supports the enumerations of device on the I2C bus.\r | |
5 | \r | |
6 | Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>\r | |
7 | This program and the accompanying materials \r | |
8 | are licensed and made available under the terms and conditions of the BSD License \r | |
9 | which accompanies this distribution. The full text of the license may be found at \r | |
10 | http://opensource.org/licenses/bsd-license.php \r | |
11 | \r | |
12 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
13 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
14 | \r | |
15 | @par Revision Reference:\r | |
16 | This protocol is from PI Version 1.3.\r | |
17 | \r | |
18 | **/\r | |
19 | \r | |
20 | #ifndef __I2C_ENUMERATE_H__\r | |
21 | #define __I2C_ENUMERATE_H__\r | |
22 | \r | |
23 | #include <Pi/PiI2c.h>\r | |
24 | \r | |
25 | #define EFI_I2C_ENUMERATE_PROTOCOL_GUID { 0xda8cd7c4, 0x1c00, 0x49e2, { 0x80, 0x3e, 0x52, 0x14, 0xe7, 0x01, 0x89, 0x4c }}\r | |
26 | \r | |
27 | typedef struct _EFI_I2C_ENUMERATE_PROTOCOL EFI_I2C_ENUMERATE_PROTOCOL;\r | |
28 | \r | |
29 | /**\r | |
30 | Enumerate the I2C devices\r | |
31 | \r | |
32 | This function enables the caller to traverse the set of I2C devices\r | |
33 | on an I2C bus.\r | |
34 | \r | |
35 | @param[in] This The platform data for the next device on\r | |
36 | the I2C bus was returned successfully.\r | |
37 | @param[in, out] Device Pointer to a buffer containing an\r | |
38 | EFI_I2C_DEVICE structure. Enumeration is\r | |
39 | started by setting the initial EFI_I2C_DEVICE\r | |
40 | structure pointer to NULL. The buffer\r | |
41 | receives an EFI_I2C_DEVICE structure pointer\r | |
42 | to the next I2C device.\r | |
43 | \r | |
44 | @retval EFI_SUCCESS The platform data for the next device on\r | |
45 | the I2C bus was returned successfully.\r | |
46 | @retval EFI_INVALID_PARAMETER Device is NULL\r | |
47 | @retval EFI_NO_MAPPING *Device does not point to a valid\r | |
48 | EFI_I2C_DEVICE structure returned in a\r | |
49 | previous call Enumerate().\r | |
50 | \r | |
51 | **/\r | |
52 | typedef\r | |
53 | EFI_STATUS\r | |
54 | (EFIAPI *EFI_I2C_ENUMERATE_PROTOCOL_ENUMERATE) (\r | |
55 | IN CONST EFI_I2C_ENUMERATE_PROTOCOL *This,\r | |
56 | IN OUT CONST EFI_I2C_DEVICE **Device\r | |
57 | );\r | |
58 | \r | |
59 | /**\r | |
60 | Get the requested I2C bus frequency for a specified bus configuration.\r | |
61 | \r | |
62 | This function returns the requested I2C bus clock frequency for the\r | |
63 | I2cBusConfiguration. This routine is provided for diagnostic purposes\r | |
64 | and is meant to be called after calling Enumerate to get the\r | |
65 | I2cBusConfiguration value.\r | |
66 | \r | |
67 | @param[in] This Pointer to an EFI_I2C_ENUMERATE_PROTOCOL\r | |
68 | structure.\r | |
69 | @param[in] I2cBusConfiguration I2C bus configuration to access the I2C\r | |
70 | device\r | |
71 | @param[out] *BusClockHertz Pointer to a buffer to receive the I2C\r | |
72 | bus clock frequency in Hertz\r | |
73 | \r | |
74 | @retval EFI_SUCCESS The I2C bus frequency was returned\r | |
75 | successfully.\r | |
76 | @retval EFI_INVALID_PARAMETER BusClockHertz was NULL\r | |
77 | @retval EFI_NO_MAPPING Invalid I2cBusConfiguration value\r | |
78 | \r | |
79 | **/\r | |
80 | typedef\r | |
81 | EFI_STATUS\r | |
82 | (EFIAPI *EFI_I2C_ENUMERATE_PROTOCOL_GET_BUS_FREQUENCY) (\r | |
83 | IN CONST EFI_I2C_ENUMERATE_PROTOCOL *This,\r | |
84 | IN UINTN I2cBusConfiguration,\r | |
85 | OUT UINTN *BusClockHertz\r | |
86 | );\r | |
87 | \r | |
88 | ///\r | |
89 | /// I2C Enumerate protocol\r | |
90 | ///\r | |
91 | struct _EFI_I2C_ENUMERATE_PROTOCOL {\r | |
92 | ///\r | |
93 | /// Traverse the set of I2C devices on an I2C bus. This routine\r | |
94 | /// returns the next I2C device on an I2C bus.\r | |
95 | ///\r | |
96 | EFI_I2C_ENUMERATE_PROTOCOL_ENUMERATE Enumerate;\r | |
97 | \r | |
98 | ///\r | |
99 | /// Get the requested I2C bus frequency for a specified bus\r | |
100 | /// configuration.\r | |
101 | ///\r | |
102 | EFI_I2C_ENUMERATE_PROTOCOL_GET_BUS_FREQUENCY GetBusFrequency;\r | |
103 | };\r | |
104 | \r | |
105 | ///\r | |
106 | /// Reference to variable defined in the .DEC file\r | |
107 | ///\r | |
108 | extern EFI_GUID gEfiI2cEnumerateProtocolGuid;\r | |
109 | \r | |
110 | #endif // __I2C_ENUMERATE_H__\r |