| // Copyright 2019 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 fuchsia.hardware.ftdi; |
| |
| /// Each one of these represents an I2cDevice that will exist |
| /// on the newly created bus. The I2C bus will try and bind |
| /// a driver on the bus with the given VID, PID, DID. |
| struct I2cDevice { |
| uint32 address; |
| uint32 vid; |
| uint32 pid; |
| uint32 did; |
| }; |
| |
| /// This represents the data necessary for the FTDI device |
| /// to create an I2C bus. |
| struct I2cBusLayout { |
| uint32 scl; |
| /// The FTDI needs two pins to be able to drive input and output for |
| /// SDA. Please specify the two pins here. They *must* be physically |
| /// tied together on the board with a jumper wire. |
| uint32 sda_out; |
| uint32 sda_in; |
| }; |
| |
| [Layout = "Simple"] |
| protocol Device { |
| /// Create an I2c bus on the FTDI device with a given `layout` and |
| /// with `device` attached to it. |
| CreateI2C(I2cBusLayout layout, I2cDevice device); |
| }; |