2021-01-20 20:43:34 +08:00
|
|
|
#![no_std]
|
|
|
|
|
|
|
|
#[macro_use]
|
|
|
|
extern crate log;
|
|
|
|
|
|
|
|
pub mod hardware;
|
2021-01-20 20:44:53 +08:00
|
|
|
pub mod server;
|
2021-01-20 20:43:34 +08:00
|
|
|
|
|
|
|
// The number of ticks in the ADC sampling timer. The timer runs at 100MHz, so the step size is
|
|
|
|
// equal to 10ns per tick.
|
|
|
|
// Currently, the sample rate is equal to: Fsample = 100/256 MHz = 390.625 KHz
|
2021-01-25 18:45:55 +08:00
|
|
|
pub const ADC_SAMPLE_TICKS_LOG2: u8 = 8;
|
2021-01-21 21:55:33 +08:00
|
|
|
pub const ADC_SAMPLE_TICKS: u16 = 1 << ADC_SAMPLE_TICKS_LOG2;
|
2021-01-20 20:43:34 +08:00
|
|
|
|
|
|
|
// The desired ADC sample processing buffer size.
|
2021-01-25 18:45:55 +08:00
|
|
|
pub const SAMPLE_BUFFER_SIZE_LOG2: u8 = 3;
|
2021-01-21 21:55:33 +08:00
|
|
|
pub const SAMPLE_BUFFER_SIZE: usize = 1 << SAMPLE_BUFFER_SIZE_LOG2;
|