diff --git a/src/circuit/mod.rs b/src/circuit/mod.rs new file mode 100644 index 0000000..aa258b0 --- /dev/null +++ b/src/circuit/mod.rs @@ -0,0 +1,2 @@ +#[cfg(feature = "resistive-divider")] +pub mod resistive_divider; \ No newline at end of file diff --git a/src/resistive_divider.rs b/src/circuit/resistive_divider.rs similarity index 100% rename from src/resistive_divider.rs rename to src/circuit/resistive_divider.rs diff --git a/src/lib.rs b/src/lib.rs index 94a73c5..dc334f2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,7 +5,7 @@ pub mod control; pub mod error; pub mod adc; -#[cfg(feature = "resistive-divider")] -pub mod resistive_divider; +pub mod uom; +pub mod circuit; pub use error::CriticalError; diff --git a/src/uom.rs b/src/uom.rs new file mode 100644 index 0000000..955a205 --- /dev/null +++ b/src/uom.rs @@ -0,0 +1,16 @@ +//TODO: Everything in here is implemented standalone and not integrated with uom library because it is spawned from macro +// soup + has shit documentation and I cannot figure out how to add a custom unit to SI. This should be integrated with +// UoM + +#[derive(Copy, Clone, PartialEq, PartialOrd, Debug, Default)] +pub struct Irradiance(f32); + +pub fn watts_per_sq_meter(value: f32) -> Irradiance { + Irradiance(value) +} + +impl Irradiance { + fn to_watts_per_sq_meter(self) -> f32 { + self.0 + } +} \ No newline at end of file