1// Copyright 2018 The Fuchsia Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5library ddk.protocol.serial; 6 7using zx; 8 9struct SerialPortInfo { 10 uint32 serial_class; 11 /// Vendor and product ID of hardware attached to this serial port, 12 /// or zero if not applicable. 13 uint32 serial_vid; 14 uint32 serial_pid; 15}; 16 17/// High level serial protocol for use by client drivers. 18/// When used with the platform device protocol, "port" will be relative to 19/// the list of serial ports assigned to your device rather than the global 20/// list of serial ports. 21[Layout = "ddk-protocol"] 22interface Serial { 23 GetInfo() -> (zx.status s, SerialPortInfo info); 24 /// Configures the given serial port. 25 Config(uint32 baud_rate, uint32 flags) -> (zx.status s); 26 /// Returns a socket that can be used for reading and writing data 27 /// from the given serial port. 28 OpenSocket() -> (zx.status s, handle<socket> @handle); 29}; 30