Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNS - Low Pressure Sensor #73

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
3ac18ee
init commit
siny-over-cosy Feb 5, 2025
ce6e4a6
added low_pressure to include
siny-over-cosy Feb 5, 2025
a426a6e
fixed old comments and updated information
siny-over-cosy Feb 6, 2025
0d8e6d7
added conversion from adc to pressure
siny-over-cosy Feb 6, 2025
0258a9c
added hyped_adc inclusion
siny-over-cosy Feb 9, 2025
c7e1271
moved GRADIENT_LOW to global constant, removed comments
siny-over-cosy Feb 9, 2025
f38d741
fixed syntax error in path
siny-over-cosy Feb 9, 2025
f870df3
changed read_pressure return type to f32
siny-over-cosy Feb 9, 2025
9c52983
changed include order
siny-over-cosy Feb 9, 2025
d3c2d0b
formatting fixes
siny-over-cosy Feb 9, 2025
66e2874
ran clippy
siny-over-cosy Feb 9, 2025
a5744da
added documentation for clippy purposes
siny-over-cosy Feb 9, 2025
2d05367
documentation formatting fix
siny-over-cosy Feb 9, 2025
85a6522
added read_low_pressure include
siny-over-cosy Feb 9, 2025
4c8d255
init commit
siny-over-cosy Feb 9, 2025
af46e82
implemented task
siny-over-cosy Feb 9, 2025
33fb3f6
formatting fixes
siny-over-cosy Feb 9, 2025
321d44e
type fixes
siny-over-cosy Feb 9, 2025
5d56d5a
changed to #[test], fixed type errors
siny-over-cosy Feb 9, 2025
875d404
documentation update
siny-over-cosy Feb 9, 2025
5565fc6
moved read_low_pressure task to bin directory
siny-over-cosy Feb 9, 2025
3606a39
added no_std and no_main
siny-over-cosy Feb 9, 2025
53a3e61
updated imports
siny-over-cosy Feb 9, 2025
0b3c38e
replaced sender with defmt info macro
siny-over-cosy Feb 9, 2025
bd03f7d
changed adc variable to unmutable
siny-over-cosy Feb 9, 2025
e0b29dd
added hyped_adc import
siny-over-cosy Feb 9, 2025
63b51a5
removed no_std and no_main macros
siny-over-cosy Feb 9, 2025
5d950e0
added no_main
siny-over-cosy Feb 9, 2025
35989f9
made main not pub
siny-over-cosy Feb 9, 2025
0bffec6
added panic handler
siny-over-cosy Feb 9, 2025
83d2e41
added that last import line
siny-over-cosy Feb 9, 2025
fd51fb2
removed dummy panic handler
siny-over-cosy Feb 9, 2025
441fab1
changed to convert from adc reading and moved documentation
siny-over-cosy Feb 13, 2025
716d2bf
renamed from read_low_pressure.rs
siny-over-cosy Feb 13, 2025
85cd1a6
formatting fix
siny-over-cosy Feb 13, 2025
0aa3a84
Merge remote-tracking branch 'origin/main' into yu-lei/hype-58-implem…
siny-over-cosy Feb 13, 2025
9825072
removed documetation
siny-over-cosy Feb 13, 2025
229c532
bruh
siny-over-cosy Feb 13, 2025
100ab47
modified to accommodate sensor range value handling
siny-over-cosy Feb 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/sensors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
pub mod keyence;
pub mod temperature;
pub mod time_of_flight;
pub mod low_pressure;

#[must_use]
#[derive(PartialEq, Debug, Clone)]
Expand Down
36 changes: 36 additions & 0 deletions lib/sensors/src/low_pressure.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
use hyped_adc::HypedAdc;

/// The low pressure sensor ([MODEL]) is able to detect pressure in range
/// from [RANGE] bar.
///

/// Links to datasheets
/// [LINKS]

pub struct LowPressure<T: HypedAdc> {
pressure: u16,
adc: T
}

impl<T: HypedAdc> LowPressure<T> {
/// Create new high pressure sensor instance
pub fn new(adc: T) -> LowPressure<T> {
LowPressure {
pressure: 0,
adc,
}
}

/// Read pressure from high pressure sensor
pub fn read_pressure(&mut self) -> u16 {
let pressure_val = self.adc.read_value();
self.pressure = pressure_val;

self.pressure
}
}

#[cfg(test)]
mod tests {

}
Loading