1
0
Fork 0

cxp upconn fw: update csr name

This commit is contained in:
morgan 2024-09-02 17:19:19 +08:00
parent a4560e5f06
commit 0aaf96a459
1 changed files with 11 additions and 11 deletions

View File

@ -8,13 +8,13 @@ pub fn trigger_ack_test(timer: &mut GlobalTimer) {
let mut pak_arr: [u8; LEN] = [0; LEN]; let mut pak_arr: [u8; LEN] = [0; LEN];
unsafe { unsafe {
csr::cxp::txtrig_ack_write(1); // send IO ack csr::cxp::upconn_ack_write(1); // send IO ack
let mut i: usize = 0; let mut i: usize = 0;
while csr::cxp::txtrig_dout_valid_read() == 1 { while csr::cxp::upconn_trig_ack_dout_valid_read() == 1 {
pak_arr[i] = csr::cxp::txtrig_dout_pak_read(); pak_arr[i] = csr::cxp::upconn_trig_ack_dout_pak_read();
// println!("received {:#04X}", pak_arr[i]); // println!("received {:#04X}", pak_arr[i]);
csr::cxp::txtrig_inc_write(1); csr::cxp::upconn_trig_ack_inc_write(1);
i += 1; i += 1;
} }
@ -46,23 +46,23 @@ pub fn pipeline_test(timer: &mut GlobalTimer) {
unsafe { unsafe {
// eop = 1 (End of packet) at the last data input // eop = 1 (End of packet) at the last data input
csr::cxp::upconn_tx_command_din_len_write(arr.len() as u8); csr::cxp::upconn_command_din_len_write(arr.len() as u8);
csr::cxp::upconn_tx_command_packet_type_write(0x02); // read control command csr::cxp::upconn_command_packet_type_write(0x02); // read control command
for a in arr.iter() { for a in arr.iter() {
while csr::cxp::upconn_tx_command_din_ready_read() == 0 {} while csr::cxp::upconn_command_din_ready_read() == 0 {}
// println!("{:#04X}", *a); // println!("{:#04X}", *a);
csr::cxp::upconn_tx_command_din_data_write(*a); csr::cxp::upconn_command_din_data_write(*a);
} }
// wait for pipelining // wait for pipelining
timer.delay_us(1); timer.delay_us(1);
let mut i: usize = 0; let mut i: usize = 0;
while csr::cxp::upconn_dout_valid_read() == 1 { while csr::cxp::upconn_command_dout_valid_read() == 1 {
pak_arr[i] = csr::cxp::upconn_dout_pak_read(); pak_arr[i] = csr::cxp::upconn_command_dout_pak_read();
// println!("received {:#04X}", pak_arr[i]); // println!("received {:#04X}", pak_arr[i]);
csr::cxp::upconn_inc_write(1); csr::cxp::upconn_command_inc_write(1);
i += 1; i += 1;
} }