From 97d95c37f550b2845ad24ce5ade3253d3eeace86 Mon Sep 17 00:00:00 2001 From: mwojcik Date: Tue, 27 Jul 2021 14:44:43 +0200 Subject: [PATCH] satman: removed references to spi for now --- src/satman/main.rs | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/satman/main.rs b/src/satman/main.rs index 43a6d586..8058ebea 100644 --- a/src/satman/main.rs +++ b/src/satman/main.rs @@ -5,11 +5,11 @@ extern crate log; use core::convert::TryFrom; -use libboard_zynq::i2c::I2c; // not using a wrapper like runtime +use libboard_zynq::i2c::I2c; use libboard_zynq::timer::GlobalTimer; #[cfg(has_si5324)] use libboard_artiq::si5324; -use board_artiq::spi; // <- port?, use libboard_zynq (if spi available/necessary) +// use libboard_zynq::spi; // not yet supported in board/csr use libboard_artiq::{pl::csr, drtio_routing, drtioaux, logger, identifier_read}; mod repeater; @@ -266,24 +266,29 @@ fn process_aux_packet(_repeaters: &mut [repeater::Repeater], drtioaux::Packet::SpiSetConfigRequest { destination: _destination, busno, flags, length, div, cs } => { forward!(_routing_table, _destination, *_rank, _repeaters, &packet); - let succeeded = spi::set_config(busno, flags, length, div, cs).is_ok(); + // todo: reimplement when SPI is available + //let succeeded = spi::set_config(busno, flags, length, div, cs).is_ok(); drtioaux::send(0, - &drtioaux::Packet::SpiBasicReply { succeeded: succeeded }) + &drtioaux::Packet::SpiBasicReply { succeeded: false}) }, drtioaux::Packet::SpiWriteRequest { destination: _destination, busno, data } => { forward!(_routing_table, _destination, *_rank, _repeaters, &packet); - let succeeded = spi::write(busno, data).is_ok(); + // todo: reimplement when SPI is available + //let succeeded = spi::write(busno, data).is_ok(); drtioaux::send(0, - &drtioaux::Packet::SpiBasicReply { succeeded: succeeded }) + &drtioaux::Packet::SpiBasicReply { succeeded: false }) } drtioaux::Packet::SpiReadRequest { destination: _destination, busno } => { forward!(_routing_table, _destination, *_rank, _repeaters, &packet); - match spi::read(busno) { - Ok(data) => drtioaux::send(0, - &drtioaux::Packet::SpiReadReply { succeeded: true, data: data }), - Err(_) => drtioaux::send(0, - &drtioaux::Packet::SpiReadReply { succeeded: false, data: 0 }) - } + // todo: reimplement when SPI is available + // match spi::read(busno) { + // Ok(data) => drtioaux::send(0, + // &drtioaux::Packet::SpiReadReply { succeeded: true, data: data }), + // Err(_) => drtioaux::send(0, + // &drtioaux::Packet::SpiReadReply { succeeded: false, data: 0 }) + // } + drtioaux::send(0, + &drtioaux::Packet::SpiReadReply { succeeded: false, data: 0 }) } drtioaux::Packet::JdacBasicRequest { destination: _destination, dacno: _dacno,