Skip to content

Commit

Permalink
lib: Add build_navigator_v2_pi5
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick José Pereira <[email protected]>
  • Loading branch information
patrickelectric authored and joaoantoniocardoso committed Dec 10, 2024
1 parent ddfbf64 commit ab216af
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,4 +400,52 @@ impl NavigatorBuilder {

Navigator { devices }
}

pub fn build_navigator_v2_pi5(self) -> Navigator {
let gpiochip = "/dev/gpiochip4";
let devices: Vec<Box<dyn AnyHardware>> = vec![
Box::new(
Ads1115Device::builder()
.build()
.expect("Failed to create Ads1115"),
),
Box::new(
Ak09915Device::builder()
.build()
.expect("Failed to create Ak09915"),
),
Box::new(
Bmp390Device::builder()
.build()
.expect("Failed to create Bmp390"),
),
Box::new(
Icm20689Device::builder()
.build()
.expect("Failed to create Icm20689"),
),
Box::new(
LeakDetector::builder()
.with_gpiochip(gpiochip)
.build()
.expect("Failed to create LedDetector"),
),
Box::new(LedController::builder().with_gpiochip(gpiochip).build()),
Box::new(
Pca9685Device::builder()
.with_gpiochip(gpiochip)
.with_i2c_bus("/dev/i2c-3")
.build()
.expect("Failed to create Pca9685"),
),
Box::new(
RgbController::builder()
.with_led_count(self.rgb_led_strip_size)
.build()
.expect("Failed to create RgbController"),
),
];

Navigator { devices }
}
}

0 comments on commit ab216af

Please sign in to comment.