mirror of
https://github.com/hubaldv/bioz-icd-rs.git
synced 2026-04-24 08:42:05 +00:00
Added electrode config.
This commit is contained in:
74
src/lib.rs
74
src/lib.rs
@@ -23,6 +23,7 @@ endpoints! {
|
|||||||
| ---------- | --------- | ---------- | ---- |
|
| ---------- | --------- | ---------- | ---- |
|
||||||
| PingEndpoint | u32 | u32 | "ping" |
|
| PingEndpoint | u32 | u32 | "ping" |
|
||||||
| GetUniqueIdEndpoint | () | [u8; 12] | "get_id" |
|
| GetUniqueIdEndpoint | () | [u8; 12] | "get_id" |
|
||||||
|
| GetMultiplexerCapabilityEndpoint | () | MultiplexerCapability | "get_device_info" |
|
||||||
| SetGreenLedEndpoint | f32 | () | "led/green" |
|
| SetGreenLedEndpoint | f32 | () | "led/green" |
|
||||||
| StartSingleImpedanceEndpoint | SingleImpedanceStartRequest | ImpedanceInitResult | "imp/start_single" |
|
| StartSingleImpedanceEndpoint | SingleImpedanceStartRequest | ImpedanceInitResult | "imp/start_single" |
|
||||||
| StartSweepImpedanceEndpoint | SweepImpedanceStartRequest | SweepImpedanceInitResult | "imp/start_sweep" |
|
| StartSweepImpedanceEndpoint | SweepImpedanceStartRequest | SweepImpedanceInitResult | "imp/start_sweep" |
|
||||||
@@ -74,12 +75,83 @@ pub struct SweepImpedanceResult {
|
|||||||
pub periods_per_dft_18: Vec<f32, 18>,
|
pub periods_per_dft_18: Vec<f32, 18>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Copy, Serialize, Deserialize, Schema, Debug, PartialEq)]
|
||||||
|
pub enum MultiplexerCapability {
|
||||||
|
Absent,
|
||||||
|
Present,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Serialize, Deserialize, Schema, Debug, PartialEq)]
|
#[derive(Clone, Copy, Serialize, Deserialize, Schema, Debug, PartialEq)]
|
||||||
pub enum BioImpedanceLeadMode {
|
pub enum BioImpedanceLeadMode {
|
||||||
TwoLead,
|
TwoLead,
|
||||||
FourLead,
|
FourLead,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Copy, Serialize, Deserialize, Schema, Debug, PartialEq, Eq)]
|
||||||
|
pub enum ElectrodeOptionsWithMultiplexer {
|
||||||
|
E0,
|
||||||
|
E1,
|
||||||
|
E2,
|
||||||
|
E3,
|
||||||
|
E4,
|
||||||
|
E5,
|
||||||
|
E6,
|
||||||
|
E7,
|
||||||
|
E8,
|
||||||
|
E9,
|
||||||
|
E10,
|
||||||
|
E11,
|
||||||
|
E12,
|
||||||
|
E13,
|
||||||
|
E14,
|
||||||
|
E15,
|
||||||
|
E16,
|
||||||
|
E17,
|
||||||
|
E18,
|
||||||
|
E19,
|
||||||
|
E20,
|
||||||
|
E21,
|
||||||
|
E22,
|
||||||
|
E23,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ElectrodeOptionsWithMultiplexer {
|
||||||
|
pub const ALL: [Self; 24] = [
|
||||||
|
Self::E0,
|
||||||
|
Self::E1,
|
||||||
|
Self::E2,
|
||||||
|
Self::E3,
|
||||||
|
Self::E4,
|
||||||
|
Self::E5,
|
||||||
|
Self::E6,
|
||||||
|
Self::E7,
|
||||||
|
Self::E8,
|
||||||
|
Self::E9,
|
||||||
|
Self::E10,
|
||||||
|
Self::E11,
|
||||||
|
Self::E12,
|
||||||
|
Self::E13,
|
||||||
|
Self::E14,
|
||||||
|
Self::E15,
|
||||||
|
Self::E16,
|
||||||
|
Self::E17,
|
||||||
|
Self::E18,
|
||||||
|
Self::E19,
|
||||||
|
Self::E20,
|
||||||
|
Self::E21,
|
||||||
|
Self::E22,
|
||||||
|
Self::E23,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Copy, Serialize, Deserialize, Schema, Debug, PartialEq)]
|
||||||
|
pub enum ElectrodeConfiguration {
|
||||||
|
// WithoutMultiplexer2Lead(ElectrodeOptionsWithoutMultiplexer, ElectrodeOptionsWithoutMultiplexer), // Electrode +, Electrode -
|
||||||
|
// WithoutMultiplexer4Lead(ElectrodeOptionsWithoutMultiplexer, ElectrodeOptionsWithoutMultiplexer, ElectrodeOptionsWithoutMultiplexer, ElectrodeOptionsWithoutMultiplexer), // V+, I+, V-, I-
|
||||||
|
WithMultiplexer2Lead(ElectrodeOptionsWithMultiplexer, ElectrodeOptionsWithMultiplexer), // Electrode +, Electrode -
|
||||||
|
WithMultiplexer4Lead(ElectrodeOptionsWithMultiplexer, ElectrodeOptionsWithMultiplexer, ElectrodeOptionsWithMultiplexer, ElectrodeOptionsWithMultiplexer), // V+, I+, V-, I-
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Serialize, Deserialize, Schema, Debug, PartialEq)]
|
#[derive(Clone, Copy, Serialize, Deserialize, Schema, Debug, PartialEq)]
|
||||||
pub enum IcdDftNum {
|
pub enum IcdDftNum {
|
||||||
Num4,
|
Num4,
|
||||||
@@ -102,6 +174,7 @@ pub struct SingleImpedanceStartRequest {
|
|||||||
pub update_frequency: u32,
|
pub update_frequency: u32,
|
||||||
pub sinus_frequency: u32,
|
pub sinus_frequency: u32,
|
||||||
pub lead_mode: BioImpedanceLeadMode,
|
pub lead_mode: BioImpedanceLeadMode,
|
||||||
|
pub electrode_config: Option<ElectrodeConfiguration>,
|
||||||
pub dft_number: IcdDftNum,
|
pub dft_number: IcdDftNum,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,5 +210,6 @@ impl MeasurementPointSet {
|
|||||||
#[derive(Serialize, Deserialize, Schema, Debug, PartialEq)]
|
#[derive(Serialize, Deserialize, Schema, Debug, PartialEq)]
|
||||||
pub struct SweepImpedanceStartRequest {
|
pub struct SweepImpedanceStartRequest {
|
||||||
pub lead_mode: BioImpedanceLeadMode,
|
pub lead_mode: BioImpedanceLeadMode,
|
||||||
|
pub electrode_config: Option<ElectrodeConfiguration>,
|
||||||
pub points: MeasurementPointSet,
|
pub points: MeasurementPointSet,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user