Configuration

Struct Configuration 

Source
pub struct Configuration { /* private fields */ }
Expand description

Configuration register of the tpm117

Implementations§

Source§

impl Configuration

Source

pub fn new( reset: bool, dr_alert: AlertPinSelect, polarity: Polarity, trigger_mode: TriggerMode, average: Average, conversion: Conversion, mode: ConversionMode, eeprom_busy: bool, data_ready: bool, low_alert: bool, high_alert: bool, ) -> Self

Source

pub fn reset(&self) -> bool

Software reset. When enabled, cause a reset with a duration of 2ms. The bit will always read back 0

Source

pub fn set_reset(&mut self, value: bool)

Software reset. When enabled, cause a reset with a duration of 2ms. The bit will always read back 0

Source

pub fn dr_alert(&self) -> AlertPinSelect

Data ready or Alert pin select bit.

Source

pub fn set_dr_alert(&mut self, value: AlertPinSelect)

Data ready or Alert pin select bit.

Source

pub fn polarity(&self) -> Polarity

Alert pin polarity.

Source

pub fn set_polarity(&mut self, value: Polarity)

Alert pin polarity.

Source

pub fn trigger_mode(&self) -> TriggerMode

Thermal/alert mode select

Source

pub fn set_trigger_mode(&mut self, value: TriggerMode)

Thermal/alert mode select

Source

pub fn average(&self) -> Average

Average used for the conversion

Source

pub fn set_average(&mut self, value: Average)

Average used for the conversion

Source

pub fn conversion(&self) -> Conversion

Conversion cycle

Source

pub fn set_conversion(&mut self, value: Conversion)

Conversion cycle

Source

pub fn mode(&self) -> ConversionMode

Conversion mode

Source

pub fn set_mode(&mut self, value: ConversionMode)

Conversion mode

Source

pub fn eeprom_busy(&self) -> bool

EEPROM busy flag, either caused by programming or power-up

Source

pub fn set_eeprom_busy(&mut self, value: bool)

EEPROM busy flag, either caused by programming or power-up

Source

pub fn data_ready(&self) -> bool

Data ready flag. This flag indicates that the conversion is complete and the temperature register can be read. Every time the temperature register or configuration register is read, this bit is cleared. This bit is set at the end of the conversion when the temperature register is updated. Data ready can be monitored on the ALERT pin by setting bit 2 of the configuration register.

Source

pub fn set_data_ready(&mut self, value: bool)

Data ready flag. This flag indicates that the conversion is complete and the temperature register can be read. Every time the temperature register or configuration register is read, this bit is cleared. This bit is set at the end of the conversion when the temperature register is updated. Data ready can be monitored on the ALERT pin by setting bit 2 of the configuration register.

Source

pub fn low_alert(&self) -> bool

Alert mode: Set when the conversion result is lower than the low limit. Cleared when read. Thermal mode: Always 0 in Thermal mode.

Source

pub fn set_low_alert(&mut self, value: bool)

Alert mode: Set when the conversion result is lower than the low limit. Cleared when read. Thermal mode: Always 0 in Thermal mode.

Source

pub fn high_alert(&self) -> bool

Alert mode: Set when the conversion result is higher than the high limit. Cleared when read. Thermal mode: Set when the conversion result is higher than the therm limit Cleared when the conversion result is lower than the hysteresis

Source

pub fn set_high_alert(&mut self, value: bool)

Alert mode: Set when the conversion result is higher than the high limit. Cleared when read. Thermal mode: Set when the conversion result is higher than the therm limit Cleared when the conversion result is lower than the hysteresis

Trait Implementations§

Source§

impl Bitsized for Configuration

Source§

const BITS: usize = 16usize

Source§

const MAX: Self::ArbitraryInt = {transmute(0xffff): <register::Configuration as bilge::Bitsized>::ArbitraryInt}

Source§

type ArbitraryInt = u16

Source§

impl Clone for Configuration

Source§

fn clone(&self) -> Configuration

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 Configuration

Source§

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

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

impl From<Configuration> for u16

Source§

fn from(struct_value: Configuration) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Configuration

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 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 Register for Configuration

Source§

const ADDRESS: Self::Address = {transmute(0x01): <register::Configuration as device_register::Register>::Address}

The address of the register
Source§

type Address = Address

Type of the adress, can be used to constrain the registers accepted
Source§

impl TryFrom<u16> for Configuration

Source§

type Error = BitsError

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

fn try_from(value: u16) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl Copy for Configuration

Source§

impl EditableRegister for Configuration

Source§

impl Eq for Configuration

Source§

impl ReadableRegister for Configuration

Source§

impl StructuralPartialEq for Configuration

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.