forked from M-Labs/artiq
satman: check for JESD ready
This commit is contained in:
parent
90e3b83e80
commit
ebd5d890f1
|
@ -421,11 +421,20 @@ fn init_jdcgs() {
|
||||||
for dacno in 0..csr::JDCG.len() {
|
for dacno in 0..csr::JDCG.len() {
|
||||||
let dacno = dacno as u8;
|
let dacno = dacno as u8;
|
||||||
info!("DAC-{} initializing...", dacno);
|
info!("DAC-{} initializing...", dacno);
|
||||||
|
|
||||||
board_artiq::jdcg::jesd_enable(dacno, false);
|
board_artiq::jdcg::jesd_enable(dacno, false);
|
||||||
board_artiq::jdcg::jesd_prbs(dacno, false);
|
board_artiq::jdcg::jesd_prbs(dacno, false);
|
||||||
board_artiq::jdcg::jesd_stpl(dacno, false);
|
board_artiq::jdcg::jesd_stpl(dacno, false);
|
||||||
clock::spin_us(10000);
|
clock::spin_us(10000);
|
||||||
board_artiq::jdcg::jesd_enable(dacno, true);
|
board_artiq::jdcg::jesd_enable(dacno, true);
|
||||||
|
let t = clock::get_ms();
|
||||||
|
while !board_artiq::jdcg::jesd_ready(dacno) {
|
||||||
|
if clock::get_ms() > t + 200 {
|
||||||
|
error!("JESD ready timeout");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if let Err(e) = drtioaux::send(1, &drtioaux::Packet::JdacSetupRequest {
|
if let Err(e) = drtioaux::send(1, &drtioaux::Packet::JdacSetupRequest {
|
||||||
destination: 0,
|
destination: 0,
|
||||||
dacno: dacno
|
dacno: dacno
|
||||||
|
|
Loading…
Reference in New Issue