aquarium_control/sensors/
atlas_scientific_config.rs

1/* Copyright 2025 Uwe Martin
2
3Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
5The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
7THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8*/
9
10use serde_derive::Deserialize;
11
12/// Holds the configuration data for the Atlas Scientific sensor communication.
13/// The configuration is loaded from the .toml configuration file.
14/// This struct does not contain any implementation.
15#[derive(Deserialize, Debug)]
16pub struct AtlasScientificConfig {
17    /// allows deactivation of the data acquisition
18    #[allow(unused)] // used in conditionally compiled code
19    pub active: bool,
20
21    /// indicates if the thread shall be started or not
22    pub execute: bool,
23
24    /// I2C address of Atlas Scientific pH sensor unit
25    #[allow(unused)]
26    pub address_atlas_scientific_ph: u16,
27
28    /// I2C address of Atlas Scientific conductivity sensor unit
29    #[allow(unused)]
30    pub address_atlas_scientific_conductivity: u16,
31
32    /// I2C address of Atlas Scientific temperature sensor unit    
33    #[allow(unused)]
34    pub address_atlas_scientific_temperature: u16,
35
36    /// sleep time in milliseconds before after writing before reading from the pH sensor unit
37    #[allow(unused)]
38    pub sleep_time_millis_ph: u64,
39
40    /// sleep time in milliseconds before after writing before reading from the conductivity sensor unit
41    #[allow(unused)]
42    pub sleep_time_millis_conductivity: u64,
43
44    /// sleep time in milliseconds before after writing before reading from the temperature sensor unit
45    #[allow(unused)]
46    pub sleep_time_millis_temperature: u64,
47
48    /// maximum allowed value for pH used to assess if the temperature sensor reading is valid
49    #[allow(unused)]
50    pub max_val_atlas_scientific_ph: f32,
51
52    /// minimum allowed value for pH used to assess if the temperature sensor reading is valid
53    #[allow(unused)]
54    pub min_val_atlas_scientific_ph: f32,
55
56    /// maximum allowed value for temperature used to assess if the temperature sensor reading is valid
57    #[allow(unused)]
58    pub max_val_atlas_scientific_temperature: f32,
59
60    /// minimum allowed value for temperature used to assess if the temperature sensor reading is valid
61    #[allow(unused)]
62    pub min_val_atlas_scientific_temperature: f32,
63
64    /// maximum allowed value for conductivity used to assess if the conductivity sensor reading is valid
65    #[allow(unused)]
66    pub max_val_atlas_scientific_conductivity: f32,
67
68    /// minimum allowed value for conductivity used to assess if the conductivity sensor reading is valid
69    #[allow(unused)]
70    pub min_val_atlas_scientific_conductivity: f32,
71
72    /// measurement interval in milliseconds
73    pub measurement_interval_millis: u64,
74}