Add FIFO reset function and return periods per DFT to GUI.

This commit is contained in:
2025-10-07 13:00:43 +02:00
parent 50e1894edf
commit ef0cecced7
4 changed files with 38 additions and 10 deletions

View File

@@ -765,6 +765,17 @@ impl AD5940 {
Ok((data >> 16) & 0x7FF)
}
pub async fn clear_and_enable_fifo(&mut self) -> Result<(), Error> {
let mut fifocon = self.read_reg(Register::FIFOCON).await?;
fifocon = DATAFIFOEN::apply(fifocon, DATAFIFOEN::FIFOisReset as u32); // Disable FIFO
self.write_reg(Register::FIFOCON, fifocon).await?;
fifocon = DATAFIFOEN::apply(fifocon, DATAFIFOEN::Normal as u32); // Enable FIFO
self.write_reg(Register::FIFOCON, fifocon).await?;
Ok(())
}
pub async fn init_waveform(&mut self) -> Result<(), Error> {
// Set frequency
let freq: u32 = 1000;