[][src]Struct max3010x::Max3010x

pub struct Max3010x<I2C, IC, MODE> { /* fields omitted */ }

MAX3010x device driver.

Methods

impl<I2C, E, IC, MODE> Max3010x<I2C, IC, MODE> where
    I2C: WriteRead<Error = E> + Write<Error = E>, 
[src]

pub fn clear_fifo(&mut self) -> Result<(), Error<E>>[src]

Resets the FIFO read and write pointers and overflow counter to 0.

pub fn set_sample_averaging(
    &mut self,
    sample_averaging: SampleAveraging
) -> Result<(), Error<E>>
[src]

Set sample averaging

pub fn reset(&mut self) -> Result<(), Error<E>>[src]

Trigger a software reset

pub fn shutdown(&mut self) -> Result<(), Error<E>>[src]

Put the device in power-save mode.

pub fn wake_up(&mut self) -> Result<(), Error<E>>[src]

Wake up from power-save mode.

pub fn enable_fifo_rollover(&mut self) -> Result<(), Error<E>>[src]

Enable FIFO rollover

pub fn disable_fifo_rollover(&mut self) -> Result<(), Error<E>>[src]

Disable FIFO rollover

pub fn set_fifo_almost_full_level_interrupt(
    &mut self,
    level: FifoAlmostFullLevelInterrupt
) -> Result<(), Error<E>>
[src]

Set number of empty data samples available in the FIFO when a FIFO-almost-full interrupt will be issued.

pub fn enable_fifo_almost_full_interrupt(&mut self) -> Result<(), Error<E>>[src]

Enable FIFO almost full interrupt

pub fn disable_fifo_almost_full_interrupt(&mut self) -> Result<(), Error<E>>[src]

Disable FIFO almost full interrupt

pub fn enable_alc_overflow_interrupt(&mut self) -> Result<(), Error<E>>[src]

Enable ambient light cancellation overflow interrupt

pub fn disable_alc_overflow_interrupt(&mut self) -> Result<(), Error<E>>[src]

Disable ambient light cancellation overflow interrupt

pub fn enable_temperature_ready_interrupt(&mut self) -> Result<(), Error<E>>[src]

Enable internal die temperature conversion ready interrupt

pub fn disable_temperature_ready_interrupt(&mut self) -> Result<(), Error<E>>[src]

Disable internal die temperature conversion ready interrupt

impl<I2C, E, IC, MODE> Max3010x<I2C, IC, MODE> where
    I2C: WriteRead<Error = E> + Write<Error = E>,
    MODE: ValidateSrPw, 
[src]

pub fn set_pulse_width(&mut self, width: LedPulseWidth) -> Result<(), Error<E>>[src]

Configure the LED pulse width.

This determines the ADC resolution.

pub fn set_sampling_rate(
    &mut self,
    sampling_rate: SamplingRate
) -> Result<(), Error<E>>
[src]

Configure the sample rate

This depends on the LED pulse width. Calling this with an inappropriate value for the selected pulse with will return Error::InvalidArgument

impl<I2C, E, IC> Max3010x<I2C, IC, Oximeter> where
    I2C: Write<Error = E>, 
[src]

pub fn set_adc_range(&mut self, range: AdcRange) -> Result<(), Error<E>>[src]

Configure analog-to-digital converter range. (Only available in Oximeter mode)

impl<I2C, E, IC, MODE> Max3010x<I2C, IC, MODE> where
    I2C: Write<Error = E>,
    MODE: HasDataReadyInterrupt, 
[src]

pub fn enable_new_fifo_data_ready_interrupt(&mut self) -> Result<(), Error<E>>[src]

Enable new FIFO data ready interrupt

pub fn disable_new_fifo_data_ready_interrupt(&mut self) -> Result<(), Error<E>>[src]

Disable new FIFO data ready interrupt

impl<I2C, E, MODE> Max3010x<I2C, Max30102, MODE> where
    I2C: WriteRead<Error = E> + Write<Error = E>, 
[src]

pub fn into_heart_rate(
    self
) -> Result<Max3010x<I2C, Max30102, HeartRate>, Error<E>>
[src]

Change into heart-rate mode.

This changes the mode and clears the FIFO data.

pub fn into_oximeter(
    self
) -> Result<Max3010x<I2C, Max30102, Oximeter>, Error<E>>
[src]

Change into SpO2 (oximeter) mode.

This changes the mode and clears the FIFO data.

pub fn into_multi_led(
    self
) -> Result<Max3010x<I2C, Max30102, MultiLED>, Error<E>>
[src]

Change into multi-LED mode.

This changes the mode and clears the FIFO data.

pub fn set_pulse_amplitude(
    &mut self,
    led: Led,
    amplitude: u8
) -> Result<(), Error<E>>
[src]

Set the LED pulse amplitude

The amplitude value corresponds to a typical current of 0.0 mA for 0 up to 51.0 mA for 255.

impl<I2C, E> Max3010x<I2C, Max30102, MultiLED> where
    I2C: WriteRead<Error = E> + Write<Error = E>, 
[src]

pub fn set_led_time_slots(
    &mut self,
    slots: [TimeSlot; 4]
) -> Result<(), Error<E>>
[src]

Configure LED time slots in Multi-LED mode

The slots should be activated in order. i.e. slot 2 cannot be activated if slot 1 is disabled. Failing to do so will return Error::InvalidArguments.

impl<I2C, E, IC, MODE> Max3010x<I2C, IC, MODE> where
    I2C: WriteRead<Error = E> + Write<Error = E>,
    MODE: ChannelCount<IC, MODE>, 
[src]

pub fn read_fifo(&mut self, output_data: &mut [u32]) -> Result<u8, Error<E>>[src]

Reads samples from FIFO.

Reads data from the FIFO until all the available samples are read or the input buffer is full.

Returns the number of samples read.

The output buffer must contain one element per channel per sample.

Note: This method takes care of shifting the data according to the ADC resolution.

impl<I2C, E, IC, MODE> Max3010x<I2C, IC, MODE> where
    I2C: WriteRead<Error = E> + Write<Error = E>, 
[src]

pub fn get_available_sample_count(&mut self) -> Result<u8, Error<E>>[src]

Get number of samples available for reading from FIFO.

pub fn get_overflow_sample_count(&mut self) -> Result<u8, Error<E>>[src]

Get number of samples lost from FIFO.

If FIFO rollover is not enabled, when the FIFO is full the samples are not pushed on to the FIFO.

pub fn read_temperature(&mut self) -> Result<f32, Error<E>>[src]

Perform a temperature measurement.

This starts a temperature measurement if none is currently ongoing. When the measurement is finished, returns the result.

pub fn read_interrupt_status(&mut self) -> Result<InterruptStatus, Error<E>>[src]

Read status of all interrupts

pub fn get_revision_id(&mut self) -> Result<u8, Error<E>>[src]

Get revision ID

pub fn get_part_id(&mut self) -> Result<u8, Error<E>>[src]

Get part ID

impl<I2C, E> Max3010x<I2C, Max30102, None> where
    I2C: WriteRead<Error = E> + Write<Error = E>, 
[src]

pub fn new_max30102(i2c: I2C) -> Self[src]

Create new instance of the MAX3010x device.

impl<I2C, E, IC, MODE> Max3010x<I2C, IC, MODE> where
    I2C: Write<Error = E>, 
[src]

pub fn destroy(self) -> I2C[src]

Destroy driver instance, return I²C bus instance.

Trait Implementations

impl<I2C: Debug, IC: Debug, MODE: Debug> Debug for Max3010x<I2C, IC, MODE>[src]

impl<I2C: Default, IC: Default, MODE: Default> Default for Max3010x<I2C, IC, MODE>[src]

Auto Trait Implementations

impl<I2C, IC, MODE> Send for Max3010x<I2C, IC, MODE> where
    I2C: Send,
    IC: Send,
    MODE: Send

impl<I2C, IC, MODE> Sync for Max3010x<I2C, IC, MODE> where
    I2C: Sync,
    IC: Sync,
    MODE: Sync

Blanket Implementations

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]