diff --git a/src/libboard_artiq/src/cxp_proto.rs b/src/libboard_artiq/src/cxp_proto.rs index b3b41a0..815d041 100644 --- a/src/libboard_artiq/src/cxp_proto.rs +++ b/src/libboard_artiq/src/cxp_proto.rs @@ -192,17 +192,18 @@ pub fn print_packet(pak: &[u8]) { println!("============================================"); } -pub fn print_packetu32(pak: &[u32]) { +pub fn print_packetu32(pak: &[u32], k: &[u8]) { println!("pak = ["); for i in 0..(pak.len()) { let data: [u8; 4] = pak[i].to_be_bytes(); println!( - "{:#03} {:#04X} {:#04X} {:#04X} {:#04X},", + "{:#03} {:#04X} {:#04X} {:#04X} {:#04X} | K {:04b},", i + 1, data[0], data[1], data[2], - data[3] + data[3], + k[i], ) } println!("]"); @@ -216,6 +217,7 @@ pub fn downconn_debug_send(packet: &Packet) -> Result<(), Error> { packet.write_to(&mut writer)?; unsafe { + csr::cxp::downconn_mux_sel_write(0); let len = writer.position(); csr::cxp::downconn_debug_src_len_write(len as u8); for data in writer.get_ref()[..len].iter() { @@ -227,3 +229,10 @@ pub fn downconn_debug_send(packet: &Packet) -> Result<(), Error> { Ok(()) } + +pub fn downconn_debug_send_trig_ack() { + unsafe { + csr::cxp::downconn_mux_sel_write(1); + csr::cxp::downconn_ack_write(1); + } +}