pub enum Range {
V10,
V5,
V2,
}Expand description
输入量程(AFE 模块的量程档位),逐路可设,上电默认 ±10 V。
Variants§
Implementations§
Source§impl Range
impl Range
Sourcepub fn from_volts(v: u32) -> Result<Range>
pub fn from_volts(v: u32) -> Result<Range>
由标称值构造。
Sourcepub fn typical_lsb_per_volt(self) -> f64
pub fn typical_lsb_per_volt(self) -> f64
典型灵敏度(LSB/V),取自 2026-12-01 对 12 路输入的实测中位数;通道间一致性约 ±1.2 %,未经逐路校准。
Sourcepub fn code_to_volts(self, code: f64) -> f64
pub fn code_to_volts(self, code: f64) -> f64
用典型灵敏度把 ADC 码值换算成输入电压(伏)。不含零点偏置修正。
Trait Implementations§
impl Copy for Range
impl Eq for Range
impl StructuralPartialEq for Range
Auto Trait Implementations§
impl Freeze for Range
impl RefUnwindSafe for Range
impl Send for Range
impl Sync for Range
impl Unpin for Range
impl UnwindSafe for Range
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more