pub enum Pga {
Fsr6_144,
Fsr4_096,
Fsr2_048,
Fsr1_024,
Fsr0_512,
Fsr0_256,
}Expand description
The programmable gain amplifier’s full-scale range (Config bits 11:9).
Variants§
Fsr6_144
Full-scale range ±6.144 V.
Fsr4_096
Full-scale range ±4.096 V.
Fsr2_048
Full-scale range ±2.048 V (the default).
Fsr1_024
Full-scale range ±1.024 V.
Fsr0_512
Full-scale range ±0.512 V.
Fsr0_256
Full-scale range ±0.256 V.
Implementations§
Source§impl Pga
impl Pga
Sourcepub fn from_code(code: u8) -> Pga
pub fn from_code(code: u8) -> Pga
Builds a gain setting from a 3-bit field code.
Codes 110 and 111 are documented as also selecting ±0.256 V and map here
to Pga::Fsr0_256.
Sourcepub fn full_scale_microvolts(self) -> u32
pub fn full_scale_microvolts(self) -> u32
Returns the positive full-scale input voltage for this gain, in microvolts.
Trait Implementations§
impl Copy for Pga
impl Eq for Pga
impl StructuralPartialEq for Pga
Auto Trait Implementations§
impl Freeze for Pga
impl RefUnwindSafe for Pga
impl Send for Pga
impl Sync for Pga
impl Unpin for Pga
impl UnsafeUnpin for Pga
impl UnwindSafe for Pga
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