1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
use MegaHertz;
/// The system clock, used in various timer calculations
pub const SYSCLK: MegaHertz = MHz;
/// The ADC setup time is the number of seconds after the CSn line goes low before the serial clock
/// may begin. This is used for performing the internal ADC conversion.
pub const ADC_SETUP_TIME: f32 = 220e-9;
/// The maximum DAC/ADC serial clock line frequency. This is a hardware limit.
pub const ADC_DAC_SCK_MAX: MegaHertz = MHz;
/// The optimal counting frequency of the hardware timers used for timestamping and sampling.
pub const TIMER_FREQUENCY: MegaHertz = MHz;
pub const TIMER_PERIOD: f32 = 1. / ;
/// The QSPI frequency for communicating with the pounder DDS.
pub const POUNDER_QSPI_FREQUENCY: MegaHertz = MHz;
/// The delay after initiating a QSPI transfer before asserting the IO_Update for the pounder DDS.
// Pending Pounder Profile writes are up to 32 bytes (QSPI FIFO depth),
// with 2 cycles required per byte, coming out to a total of 64 QSPI clock cycles.
// The QSPI is configured for 50MHz, so this comes out to an offset
// of 1280 ns. We use 1300 ns to be safe.
pub const POUNDER_IO_UPDATE_DELAY: f32 = 1_300e-9;
/// The duration to assert IO_Update for the pounder DDS.
// IO_Update should be latched for 4 SYNC_CLK cycles after the QSPI profile write. With pounder
// SYNC_CLK running at 100MHz (1/4 of the pounder reference clock of 500MHz), this corresponds to
// 32ns. To accomodate rounding errors, we use 50ns instead.
pub const POUNDER_IO_UPDATE_DURATION: f32 = 50e-9;
/// The DDS reference clock frequency in MHz.
pub const DDS_REF_CLK: MegaHertz = MHz;
/// The multiplier used for the DDS reference clock PLL.
pub const DDS_MULTIPLIER: u8 = 5;
/// The DDS system clock frequency after the internal PLL multiplication.
pub const DDS_SYSTEM_CLK: MegaHertz =
MHz;
/// The divider from the DDS system clock to the SYNC_CLK output (sync-clk is always 1/4 of sysclk).
pub const DDS_SYNC_CLK_DIV: u8 = 4;
/// The maximum ADC/DAC sample processing buffer size.
pub const MAX_SAMPLE_BUFFER_SIZE: usize = 32;
pub type SampleBuffer = ;