diff options
| author | Nathan Perry <np@nathanperry.dev> | 2024-10-05 17:54:31 -0400 |
|---|---|---|
| committer | Nathan Perry <np@nathanperry.dev> | 2024-10-05 17:54:31 -0400 |
| commit | a0498330ef7d035890ab1b3632d789ee3c9fccdf (patch) | |
| tree | d7376d731774fe5b1898b6301b964404cc58680d /common | |
| parent | f63136fe84f4dcebac13c9055faac2e5a67d7786 (diff) | |
dummy fw bme bringup
Diffstat (limited to 'common')
| -rw-r--r-- | common/Cargo.toml | 12 | ||||
| -rw-r--r-- | common/src/lib.rs | 32 |
2 files changed, 44 insertions, 0 deletions
diff --git a/common/Cargo.toml b/common/Cargo.toml new file mode 100644 index 0000000..bcde395 --- /dev/null +++ b/common/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "ocularium_common" +version.workspace = true +edition.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true + +[dependencies] +serde = { workspace = true, default-features = false, features = ["derive", "alloc"] } +na = { package = "nalgebra", version = "0.32", default-features = false, features = ["serde-serialize-no-std"] } diff --git a/common/src/lib.rs b/common/src/lib.rs new file mode 100644 index 0000000..5dde0b9 --- /dev/null +++ b/common/src/lib.rs @@ -0,0 +1,32 @@ +#![no_std] + +extern crate alloc; + +use alloc::vec::Vec; + +#[derive(Debug, Clone, PartialEq, PartialOrd, serde::Serialize, serde::Deserialize)] +pub enum Uplink { + Ping, +} + +#[derive(Debug, Clone, PartialEq, PartialOrd, serde::Serialize, serde::Deserialize)] +pub enum Downlink { + Pong, + Sensor(Sensor), +} + +#[derive(Debug, Clone, PartialEq, PartialOrd, serde::Serialize, serde::Deserialize)] +pub enum Sensor { + Gas { + temp_c: f32, + pressure: f32, + }, + Lux { + lux: f32, + }, + IMU { + accel: na::Vector3<f32>, + gyro: na::Vector3<f32>, + }, + Pdm(Vec<u8>), +} |
