This commit is contained in:
Zachary Sunforge
2023-06-23 20:32:01 -07:00
parent 2a0013481c
commit c46680247b
18 changed files with 193 additions and 133 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "physical-ads1256"
description = "Shared abstractions for ADS1256 components."
description = "Shared node abstractions for ADS1256 components."
version.workspace = true
edition.workspace = true
repository.workspace = true
@ -10,17 +10,12 @@ license.workspace = true
[features]
embassy-sync = ["dep:embassy-sync", "ads1256/embassy-sync", "physical-node/embassy-sync"]
poll = ["standard-multiplexer", "embassy-sync"]
config = ["physical-ads1256-types/config"]
standard-input = ["physical-ads1256-types/standard-input"]
standard-multiplexer = ["standard-input"]
standard-multiplexer = []
[dependencies.physical-node]
path = "../../../node"
[dependencies.node-poll-variants]
path = "../../../macros/node-poll-variants"
[dependencies.physical-ads1256-types]
path = "../types"
features = ["defmt"]
[dependencies.ads1256]
workspace = true
[dependencies.embedded-hal]

View File

@ -1,9 +1,4 @@
#![no_std]
#![feature(async_fn_in_trait, impl_trait_projections)]
#[cfg(feature = "standard-multiplexer")]
mod standard_multiplexer;
#[cfg(feature = "poll")]
mod poll;
pub use physical_ads1256_types::*;
pub mod standard;

View File

@ -0,0 +1,2 @@
#[cfg(feature = "standard-input")]
pub mod multiplexer;

View File

@ -38,11 +38,10 @@ where
type Value = f32::ElectricPotential;
async fn poll(&self) -> Result<Self::Value, CriticalError> {
let result = self
.ads1256
.lock()
.await
.deref_mut()
let mut ads1256_guard = self.ads1256.lock().await;
let ads1256 = ads1256_guard.deref_mut();
let result = ads1256
.autocal_convert_m(
self.spi,
self.input_mod.multiplexer(),