Struct DeviceCapabilities

Source
pub struct DeviceCapabilities {
Show 13 fields pub device_type: DeviceType, pub max_channels: u8, pub max_spi_frequency_hz: u32, pub internal_reference: bool, pub programmable_gain: bool, pub self_test: bool, pub low_power_mode: bool, pub high_precision: bool, pub diagnostic_mode: bool, pub burnout_current: bool, pub continuous_mode: bool, pub single_shot_mode: bool, pub digital_filtering: bool,
}
Expand description

Device capabilities structure (runtime capability detection)

Fields§

§device_type: DeviceType

The specific device type (AD7124-4, AD7124-8, etc.)

§max_channels: u8

Maximum number of analog input channels supported

§max_spi_frequency_hz: u32

Maximum SPI clock frequency supported in Hz

§internal_reference: bool

Whether device has built-in voltage reference

§programmable_gain: bool

Whether device supports programmable gain amplification

§self_test: bool

Whether device supports built-in self-test functionality

§low_power_mode: bool

Whether device supports low-power operation modes

§high_precision: bool

Whether device provides high-precision (24-bit) measurements

§diagnostic_mode: bool

Whether device supports diagnostic and status monitoring

§burnout_current: bool

Whether device supports burnout current sources for sensor diagnostics

§continuous_mode: bool

Whether device supports continuous conversion mode

§single_shot_mode: bool

Whether device supports single-shot conversion mode

§digital_filtering: bool

Whether device supports digital filtering options

Implementations§

Source§

impl DeviceCapabilities

Source

pub fn for_device(device_type: DeviceType) -> Self

Create capabilities for detected device type

Source

pub fn supports(&self, feature: DeviceFeature) -> bool

Check if device supports a specific feature

Source

pub fn validate_channel(&self, channel: u8) -> bool

Validate channel number against device capabilities

Trait Implementations§

Source§

impl Clone for DeviceCapabilities

Source§

fn clone(&self) -> DeviceCapabilities

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DeviceCapabilities

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DeviceCapabilities

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Copy for DeviceCapabilities

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.