1
0
Fork 0

cxp upconn fw: rename csr

This commit is contained in:
morgan 2024-09-02 16:50:12 +08:00
parent 2e984ab48e
commit 730480aaa8
1 changed files with 7 additions and 7 deletions

View File

@ -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::txcore_din_len_write(arr.len() as u8); csr::cxp::upconn_tx_command_din_len_write(arr.len() as u8);
csr::cxp::txcore_packet_type_write(0x02); // read control command csr::cxp::upconn_tx_command_packet_type_write(0x02); // read control command
for a in arr.iter() { for a in arr.iter() {
while csr::cxp::txcore_din_ready_read() == 0 {} while csr::cxp::upconn_tx_command_din_ready_read() == 0 {}
// println!("{:#04X}", *a); // println!("{:#04X}", *a);
csr::cxp::txcore_din_pak_write(*a); csr::cxp::upconn_tx_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::txcore_dout_valid_read() == 1 { while csr::cxp::upconn_dout_valid_read() == 1 {
pak_arr[i] = csr::cxp::txcore_dout_pak_read(); pak_arr[i] = csr::cxp::upconn_dout_pak_read();
// println!("received {:#04X}", pak_arr[i]); // println!("received {:#04X}", pak_arr[i]);
csr::cxp::txcore_inc_write(1); csr::cxp::upconn_inc_write(1);
i += 1; i += 1;
} }