ctrl FW: update csr

This commit is contained in:
morgan 2025-01-14 15:03:15 +08:00
parent 4250a1b432
commit 50bc5e591c

View File

@ -58,7 +58,7 @@ fn send_data_packet(channel: u8, packet: &TXPacket) -> Result<(), Error> {
// assume tx is enabled // assume tx is enabled
let channel = channel as usize; let channel = channel as usize;
unsafe { unsafe {
while (CXP[channel].tx_bootstrap_tx_busy_read)() == 1 {} while (CXP[channel].tx_writer_busy_read)() == 1 {}
let ptr = CXP_MEM[channel].base as *mut u32; let ptr = CXP_MEM[channel].base as *mut u32;
let mut writer = Cursor::new(slice::from_raw_parts_mut(ptr as *mut u8, BUF_LEN)); let mut writer = Cursor::new(slice::from_raw_parts_mut(ptr as *mut u8, BUF_LEN));
@ -67,8 +67,8 @@ fn send_data_packet(channel: u8, packet: &TXPacket) -> Result<(), Error> {
// println!("TX MEM after writing"); // println!("TX MEM after writing");
// print_packet(&writer.get_ref()[0..40]); // print_packet(&writer.get_ref()[0..40]);
(CXP[channel].tx_bootstrap_tx_word_len_write)(writer.position() as u16 / 4); (CXP[channel].tx_writer_word_len_write)(writer.position() as u16 / 4);
(CXP[channel].tx_bootstrap_tx_write)(1); (CXP[channel].tx_writer_stb_write)(1);
} }
Ok(()) Ok(())
@ -78,8 +78,8 @@ pub fn send_test_packet(channel: u8) -> Result<(), Error> {
// assume tx is enabled // assume tx is enabled
let channel = channel as usize; let channel = channel as usize;
unsafe { unsafe {
while (CXP[channel].tx_bootstrap_tx_busy_read)() == 1 {} while (CXP[channel].tx_writer_busy_read)() == 1 {}
(CXP[channel].tx_bootstrap_tx_testseq_write)(1); (CXP[channel].tx_writer_stb_testseq_write)(1);
} }
Ok(()) Ok(())
} }
@ -102,7 +102,7 @@ pub fn print_decode_error(channel: u8) {
println!( println!(
"CH#{} Decode error = {}", "CH#{} Decode error = {}",
channel, channel,
(CXP[channel as usize].rx_bootstrap_decoder_err_read)() (CXP[channel as usize].rx_reader_decode_err_read)()
); );
} }
} }