Skip to main content

Pga

Enum Pga 

Source
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

Source

pub fn code(self) -> u8

Returns the 3-bit field code for this gain setting.

Source

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.

Source

pub fn full_scale_microvolts(self) -> u32

Returns the positive full-scale input voltage for this gain, in microvolts.

Trait Implementations§

Source§

impl Clone for Pga

Source§

fn clone(&self) -> Pga

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for Pga

Source§

impl Debug for Pga

Source§

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

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

impl Eq for Pga

Source§

impl PartialEq for Pga

Source§

fn eq(&self, other: &Pga) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

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> 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.