aquarium_control/sensors/i2c_interface_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 I2C interface.
13/// The configuration is loaded from the .toml configuration file.
14/// This struct does not contain any implementation.
15/// Struct is intentionally placed here instead of creating i2c_interface.
16#[derive(Deserialize, Debug)]
17pub struct I2cInterfaceConfig {
18 /// indicates if the thread shall be started or not
19 #[cfg(feature = "target_hw")]
20 pub execute: bool,
21
22 /// maximum number of read attempts
23 #[allow(unused)]
24 pub max_read_attempts: u16,
25
26 /// timeout for transactions in milliseconds
27 #[allow(unused)]
28 pub timeout_transaction: u32,
29}