mirror of
https://github.com/hubaldv/bioz-firmware-rs.git
synced 2026-03-10 02:50:30 +00:00
Add FIFO reset function and return periods per DFT to GUI.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user