1 | /* $Id: VBoxVgaI2c.h 96407 2022-08-22 17:43:14Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBoxVgaI2c.h
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2009-2022 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * The contents of this file may alternatively be used under the terms
|
---|
26 | * of the Common Development and Distribution License Version 1.0
|
---|
27 | * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
|
---|
28 | * in the VirtualBox distribution, in which case the provisions of the
|
---|
29 | * CDDL are applicable instead of those of the GPL.
|
---|
30 | *
|
---|
31 | * You may elect to license modified versions of this file under the
|
---|
32 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
33 | *
|
---|
34 | * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
|
---|
35 | */
|
---|
36 |
|
---|
37 | /*
|
---|
38 | This code is based on:
|
---|
39 |
|
---|
40 | I2c Bus byte read/write functions.
|
---|
41 |
|
---|
42 | Copyright (c) 2008 - 2009, Intel Corporation
|
---|
43 | All rights reserved. This program and the accompanying materials
|
---|
44 | are licensed and made available under the terms and conditions of the BSD License
|
---|
45 | which accompanies this distribution. The full text of the license may be found at
|
---|
46 | http://opensource.org/licenses/bsd-license.php
|
---|
47 |
|
---|
48 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
---|
49 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
---|
50 |
|
---|
51 | */
|
---|
52 |
|
---|
53 | #ifndef _CIRRUS_LOGIC_I2C_H_
|
---|
54 | #define _CIRRUS_LOGIC_I2C_H_
|
---|
55 |
|
---|
56 | #include <Protocol/PciIo.h>
|
---|
57 |
|
---|
58 | /**
|
---|
59 | Read one byte data on I2C Bus.
|
---|
60 |
|
---|
61 | Read one byte data from the slave device connected to I2C Bus.
|
---|
62 | If Data is NULL, then ASSERT().
|
---|
63 |
|
---|
64 | @param PciIo The pointer to PCI_IO_PROTOCOL.
|
---|
65 | @param DeviceAddress Slave device's address.
|
---|
66 | @param RegisterAddress The register address on slave device.
|
---|
67 | @param Data The pointer to returned data if EFI_SUCCESS returned.
|
---|
68 |
|
---|
69 | @retval EFI_DEVICE_ERROR
|
---|
70 | @retval EFI_SUCCESS
|
---|
71 |
|
---|
72 | **/
|
---|
73 | EFI_STATUS
|
---|
74 | EFIAPI
|
---|
75 | I2cReadByte (
|
---|
76 | EFI_PCI_IO_PROTOCOL *PciIo,
|
---|
77 | UINT8 DeviceAddress,
|
---|
78 | UINT8 RegisterAddress,
|
---|
79 | UINT8 *Data
|
---|
80 | );
|
---|
81 |
|
---|
82 | /**
|
---|
83 | Write one byte data onto I2C Bus.
|
---|
84 |
|
---|
85 | Write one byte data to the slave device connected to I2C Bus.
|
---|
86 | If Data is NULL, then ASSERT().
|
---|
87 |
|
---|
88 | @param PciIo The pointer to PCI_IO_PROTOCOL.
|
---|
89 | @param DeviceAddress Slave device's address.
|
---|
90 | @param RegisterAddress The register address on slave device.
|
---|
91 | @param Data The pointer to write data.
|
---|
92 |
|
---|
93 | @retval EFI_DEVICE_ERROR
|
---|
94 | @retval EFI_SUCCESS
|
---|
95 |
|
---|
96 | **/
|
---|
97 | EFI_STATUS
|
---|
98 | EFIAPI
|
---|
99 | I2cWriteByte (
|
---|
100 | EFI_PCI_IO_PROTOCOL *PciIo,
|
---|
101 | UINT8 DeviceAddress,
|
---|
102 | UINT8 RegisterAddress,
|
---|
103 | UINT8 *Data
|
---|
104 | );
|
---|
105 |
|
---|
106 | #endif
|
---|