pounder_test/src/configuration.rs

42 lines
1.3 KiB
Rust
Raw Normal View History

2021-07-15 19:28:19 +08:00
//! This module contains any compile-time configuration parameters for the Stabilizer firmware.
/// MQTT broker IPv4 address
///
/// In the default configuration, the IP address is defined as 10.34.16.10.
pub const MQTT_BROKER: [u8; 4] = [10, 34, 16, 10];
/// Sampling Frequency
///
/// Define the frequency at which ADCs (and DACs) are sampled at.
///
/// # Units
/// The units of this parameter are specified as a logarithmic number of ticks of the internal
/// timer, which runs at 100 MHz.
2021-07-15 19:28:19 +08:00
///
/// ## Example
2021-07-16 20:36:46 +08:00
/// With a value of 7, this corresponds to 2^7 = 128 ticks. Each tick of the 100 MHz timer requires
2021-07-15 19:28:19 +08:00
/// 10ns.
///
/// Sampling Period = 10ns * 128 = 1.28 us
2021-07-16 20:36:46 +08:00
/// Sampling Frequency = 781.25 KHz
2021-07-15 19:28:19 +08:00
///
/// Or more succinctly:
2021-07-16 20:36:46 +08:00
/// `F_s = 100 MHz / (2 ^ ADC_SAMPLE_TICKS_LOG2)`
2021-07-15 19:28:19 +08:00
pub const ADC_SAMPLE_TICKS_LOG2: u8 = 7;
/// Sample Batch Sizing
///
/// The sample batch size defines how many samples are collected before the DSP routines are
/// executed.
///
/// # Note
/// Smaller batch sizes result in less input -> output latency, but come at the cost of reduced
/// maximum sampling frequency.
///
/// # Units
/// The units of the batch size are specified logarithmically.
///
/// ## Example
/// With a value of 3, the number of samples per batch is 2^3 = 8.
pub const SAMPLE_BUFFER_SIZE_LOG2: u8 = 3;