1
0
Fork 0

cxp upconn fw: update trigger csr

This commit is contained in:
morgan 2024-09-03 12:49:49 +08:00
parent d84c7c9523
commit 7ee867d7c4
1 changed files with 8 additions and 8 deletions

View File

@ -3,25 +3,25 @@ use libboard_zynq::{println, timer::GlobalTimer};
use crate::pl::csr; use crate::pl::csr;
pub fn trigger_test(timer: &mut GlobalTimer) { pub fn trigger_test(timer: &mut GlobalTimer, linktrig_mode: u8) {
const LEN: usize = 4 * 8; const LEN: usize = 4 * 8;
let mut pak_arr: [u8; LEN] = [0; LEN]; let mut pak_arr: [u8; LEN] = [0; LEN];
unsafe { unsafe {
csr::cxp::trig_trig_delay_write(0x05); csr::cxp::upconn_trig_delay_write(0x05);
csr::cxp::trig_linktrigger_write(0x05); // mode 0 csr::cxp::upconn_linktrigger_write(linktrig_mode);
csr::cxp::trig_stb_write(1); // send trig csr::cxp::upconn_trig_stb_write(1); // send trig
timer.delay_us(1); timer.delay_us(1);
let mut i: usize = 0; let mut i: usize = 0;
while csr::cxp::trig_dout_valid_read() == 1 { while csr::cxp::upconn_trig_dout_valid_read() == 1 {
pak_arr[i] = csr::cxp::trig_dout_pak_read(); pak_arr[i] = csr::cxp::upconn_trig_dout_pak_read();
// println!("received {:#04X}", pak_arr[i]); // println!("received {:#04X}", pak_arr[i]);
csr::cxp::trig_inc_write(1); csr::cxp::upconn_trig_inc_write(1);
i += 1; i += 1;
} }
println!("trigger packet"); println!("trigger packet | linktrigger = {}", linktrig_mode);
println!("arr = ["); println!("arr = [");
for i in 0..(LEN / 4) { for i in 0..(LEN / 4) {
println!( println!(