satman: removed references to spi for now

This commit is contained in:
mwojcik 2021-07-27 14:44:43 +02:00
parent 4540b8ec98
commit 97d95c37f5

View File

@ -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,