| // Copyright lowRISC contributors. |
| // Licensed under the Apache License, Version 2.0, see LICENSE for details. |
| // SPDX-License-Identifier: Apache-2.0 |
| use erased_serde::Serialize; |
| use structopt::StructOpt; |
| use opentitanlib::app::command::CommandDispatch; |
| use opentitanlib::app::TransportWrapper; |
| /// Initialize state of a transport debugger device to fit the device under test. This |
| /// typically involves setting pins as input/output, open drain, etc. according to configuration |
| #[derive(Debug, StructOpt)] |
| pub struct TransportInit {} |
| impl CommandDispatch for TransportInit { |
| transport: &TransportWrapper, |
| ) -> Result<Option<Box<dyn Serialize>>> { |
| // Configure all GPIO pins to default direction and level, according to |
| // configuration files provided. |
| transport.apply_default_pin_configurations()?; |
| /// Commands for interacting with the transport debugger device itself. |
| #[derive(Debug, StructOpt, CommandDispatch)] |
| pub enum TransportCommand { |