/ firmware / src / config / mod.rs
mod.rs
 1  //! Device configuration — split by concern.
 2  //!
 3  //! - `board` — hardware truth: GPIO pins, bus wiring, sensor topology. Changes per PCB revision.
 4  //! - `app` — deployment tuning: ports, timeouts, buffers, intervals. Changes per deployment.
 5  //! - `features` — compile-time on/off switches for subsystems.
 6  
 7  pub mod board;
 8  pub mod app;
 9  pub mod features;
10  
11  const _: () = {
12      assert!(
13          board::i2c::BUS_0.sda_gpio != board::i2c::BUS_0.scl_gpio,
14          "I2C bus 0: SDA and SCL must differ"
15      );
16      assert!(
17          board::i2c::BUS_1.sda_gpio != board::i2c::BUS_1.scl_gpio,
18          "I2C bus 1: SDA and SCL must differ"
19      );
20      assert!(app::ssh::PORT > 0, "Invalid SSH port");
21      assert!(app::http::PORT > 0, "Invalid HTTP port");
22      assert!(app::shell::BUF_IN >= 64, "Shell input buffer too small");
23      assert!(app::shell::BUF_OUT >= 64, "Shell output buffer too small");
24      assert!(board::buttons::COUNT <= 8, "Too many buttons");
25  };