From ce844f1b026b15f77432de0e24942ff220add283 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 4 May 2020 22:16:53 +0800 Subject: [PATCH] devc: add is_done() --- libboard_zynq/src/devc/mod.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libboard_zynq/src/devc/mod.rs b/libboard_zynq/src/devc/mod.rs index 56f0b5b..876048f 100644 --- a/libboard_zynq/src/devc/mod.rs +++ b/libboard_zynq/src/devc/mod.rs @@ -26,12 +26,18 @@ impl DevC { }) } + pub fn is_done(&self) -> bool { + // Note: contrary to what the TRM says, this appears to be simply + // the state of the DONE signal. + self.regs.int_sts.read().ixr_pcfg_done() + } + pub fn program(&mut self) { slcr::RegisterBlock::unlocked(|slcr| { slcr.init_preload_fpga(); }); - while !self.regs.int_sts.read().ixr_pcfg_done() {} + while !self.is_done() {} slcr::RegisterBlock::unlocked(|slcr| { slcr.init_postload_fpga();