Struct afe4400::Afe4400[][src]

pub struct Afe4400<SPI: FullDuplex<u8>, IN: InputPin, OUT: OutputPin> {
    pub spi: SPI,
    pub diag_end: Option<IN>,
    pub adc_done: Option<IN>,
    pub led_err: Option<IN>,
    pub sensor_err: Option<IN>,
    pub afe_pdn: OUT,
    pub adc_rdy: IN,
}

Controller in charge of communication with AFE4400

Fields

Methods

impl<SPI, IN, OUT> Afe4400<SPI, IN, OUT> where
    SPI: FullDuplex<u8>,
    IN: InputPin,
    OUT: OutputPin,
    <SPI as FullDuplex<u8>>::Error: Debug
[src]

Send data to a specified register.

register should be a constant defined in afe4400::registers.

Can return an SPI error if communication failure occurs.

Read data from a specified register

register should be a constant defined in afe4400::registers.

Can return an SPI error if communication failure occurs.

Get data from LED1 (IR) after subtracting ambient background.

Get data from LED2 (Red) after subtracting ambient background.

Set the cancellation filter gain resistor R_f value

LED current and cancellation filter gain are used to compensate for changing ambient light conditions.

TIA_AMB_GAIN: RF_LED[2:0] set to 110 (see p.64 in docs for all R_f options)

Set current sent to LEDs.

LED current and cancellation filter gain are used to compensate for changing ambient light conditions.

LEDCNTRL (0x22) LED1[15:8], LED2[7:0] Formula: LED_Register_value ------------------ * 50 mA = current 256

Recommended default pulse timings according to the AFE4400 data sheet.

Perform a self check to verify connections and chip clock integrity.

Returns Ok(()) if the self-check passes

Auto Trait Implementations

impl<SPI, IN, OUT> Send for Afe4400<SPI, IN, OUT> where
    IN: Send,
    OUT: Send,
    SPI: Send

impl<SPI, IN, OUT> Sync for Afe4400<SPI, IN, OUT> where
    IN: Sync,
    OUT: Sync,
    SPI: Sync