| // Copyright 2018 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| library ddk.protocol.i2c; |
| |
| using zx; |
| |
| /// Low-level protocol for i2c drivers. |
| [Layout="ddk-protocol"] |
| interface I2cImpl { |
| 1: GetBusCount() -> (uint32 count); |
| 2: GetMaxTransferSize(uint32 bus_id) -> (zx.status s, usize size); |
| /// Sets the bitrate for the i2c bus in KHz units. |
| 3: SetBitrate(uint32 bus_id, uint32 bitrate) -> (zx.status s); |
| [Async] |
| 4: Transact(uint32 bus_id, uint16 address, vector<void> write) -> (vector<void> read); |
| }; |