Initial proof of concept

This commit is contained in:
Zachary Levy
2025-03-09 12:13:14 -07:00
commit e06e76e46b
55 changed files with 4508 additions and 0 deletions

9
src/adc/stm32.rs Normal file
View File

@ -0,0 +1,9 @@
use crate::quantity::{MilliVolts, Quantity};
pub fn reading_to_voltage(
reading: u32,
reference_voltage: MilliVolts<u32>,
v_ref_int_scale: u32,
) -> MilliVolts<u16> {
MilliVolts((reading * v_ref_int_scale / reference_voltage.value()) as u16)
}