| // 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. |
| @available(added=7) |
| 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. |
| type I2cDevice = struct { |
| address uint32; |
| vid uint32; |
| pid uint32; |
| did uint32; |
| }; |
| |
| /// This represents the data necessary for the FTDI device |
| /// to create an I2C bus. |
| type I2cBusLayout = struct { |
| scl uint32; |
| /// 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. |
| sda_out uint32; |
| sda_in uint32; |
| }; |
| |
| protocol Device { |
| /// Create an I2c bus on the FTDI device with a given `layout` and |
| /// with `device` attached to it. |
| CreateI2C(struct { |
| layout I2cBusLayout; |
| device I2cDevice; |
| }); |
| }; |