Struct max116xx_10bit::Max116xx10Bit [−][src]
pub struct Max116xx10Bit<SPI, CS, CLOCKED = ExternallyClocked, WAKEUP = WithoutWakeupDelay> { /* fields omitted */ }
Implementations
impl<SpiE, PinE, CS, SPI> Max116xx10Bit<SPI, CS, ExternallyClocked, WithoutWakeupDelay> where
SPI: Transfer<u8, Error = SpiE> + FullDuplex<u8, Error = SpiE>,
CS: OutputPin<Error = PinE>,
impl<SpiE, PinE, CS, SPI> Max116xx10Bit<SPI, CS, ExternallyClocked, WithoutWakeupDelay> where
SPI: Transfer<u8, Error = SpiE> + FullDuplex<u8, Error = SpiE>,
CS: OutputPin<Error = PinE>,
Create a new generic MAX116xx instance. By default the generated ADC struct is configured
for externally clocked mode with conversions timed through the serial interface and
an external voltage reference. You can convert the ADC to use other SETUP register
configurations using the into*
functions.
The corresponding SETUP register is 0b0111_0100
Please note that you still might have to reset and setup the ADC.
pub fn into_ext_clkd_with_int_ref_wakeup_delay(
self
) -> Max116xx10Bit<SPI, CS, ExternallyClocked, WithWakeupDelay>
pub fn into_ext_clkd_with_int_ref_wakeup_delay(
self
) -> Max116xx10Bit<SPI, CS, ExternallyClocked, WithWakeupDelay>
Use internal reference which is off after scan. This means that the device needs a wakeup delay
The corresponding SETUP register is 0b0111_0000
pub fn into_ext_clkd_with_int_ref_no_wakeup_delay(
self
) -> Max116xx10Bit<SPI, CS, ExternallyClocked, WithoutWakeupDelay>
pub fn into_ext_clkd_with_int_ref_no_wakeup_delay(
self
) -> Max116xx10Bit<SPI, CS, ExternallyClocked, WithoutWakeupDelay>
Use SPI clock as conversion clock and use the internal voltage reference without a wakeup delay
The corresponding SETUP register is 0b0111_1000
pub fn into_int_clkd_int_timed_through_ser_if_with_wakeup<EOC: InputPin<Error = PinE>>(
self,
eoc: EOC
) -> Max116xx10BitEocExt<SPI, CS, EOC, InternallyClockedInternallyTimedSerialInterface>
pub fn into_int_clkd_int_timed_through_ser_if_with_wakeup<EOC: InputPin<Error = PinE>>(
self,
eoc: EOC
) -> Max116xx10BitEocExt<SPI, CS, EOC, InternallyClockedInternallyTimedSerialInterface>
Convert into interally clocked mode with internal timing initiated by the serial interface and a wakeup delay. This can be used to reduce power consumption
The corresponding SETUP register is 0b0110_1100
pub fn into_int_clkd_int_timed_through_ser_if_without_wakeup<EOC: InputPin<Error = PinE>>(
self,
v_ref: VoltageRefMode,
eoc: EOC
) -> Result<Max116xx10BitEocExt<SPI, CS, EOC, InternallyClockedInternallyTimedSerialInterface>, AdcError>
pub fn into_int_clkd_int_timed_through_ser_if_without_wakeup<EOC: InputPin<Error = PinE>>(
self,
v_ref: VoltageRefMode,
eoc: EOC
) -> Result<Max116xx10BitEocExt<SPI, CS, EOC, InternallyClockedInternallyTimedSerialInterface>, AdcError>
Convert into interally clocked mode with internal timing initiated by the serial interface and no wakeup delay.
The corresponding SETUP register can be one of the two
- External Voltage reference:
0b0110_0100
- Internal Voltage reference always on:
0b0110_1000
impl<SpiE, PinE, CS, SPI, CLOCKED: Clocked, WAKEUP> Max116xx10Bit<SPI, CS, CLOCKED, WAKEUP> where
SPI: Transfer<u8, Error = SpiE> + FullDuplex<u8, Error = SpiE>,
CS: OutputPin<Error = PinE>,
impl<SpiE, PinE, CS, SPI, CLOCKED: Clocked, WAKEUP> Max116xx10Bit<SPI, CS, CLOCKED, WAKEUP> where
SPI: Transfer<u8, Error = SpiE> + FullDuplex<u8, Error = SpiE>,
CS: OutputPin<Error = PinE>,
Set up the ADC depending on clock and reference configuration
pub fn averaging(
&mut self,
avg_conv: AveragingConversions,
avg_res: AveragingResults
) -> Result<(), Error<SpiE, PinE>>
pub fn averaging(
&mut self,
avg_conv: AveragingConversions,
avg_res: AveragingResults
) -> Result<(), Error<SpiE, PinE>>
Set up the Averaging register. This sets the AVGON, NAVG1, NAVG0, NSCAN1 and NSCAN0 bits accordingly
impl<SpiE, PinE, SPI, CS> Max116xx10Bit<SPI, CS, ExternallyClocked, WithoutWakeupDelay> where
SPI: Transfer<u8, Error = SpiE> + FullDuplex<u8, Error = SpiE>,
CS: OutputPin<Error = PinE>,
impl<SpiE, PinE, SPI, CS> Max116xx10Bit<SPI, CS, ExternallyClocked, WithoutWakeupDelay> where
SPI: Transfer<u8, Error = SpiE> + FullDuplex<u8, Error = SpiE>,
CS: OutputPin<Error = PinE>,
Implementations when using the external SPI clock to time the conversions
impl<SpiE, PinE, SPI, CS> Max116xx10Bit<SPI, CS, ExternallyClocked, WithWakeupDelay> where
SPI: Transfer<u8, Error = SpiE> + FullDuplex<u8, Error = SpiE>,
CS: OutputPin<Error = PinE>,
impl<SpiE, PinE, SPI, CS> Max116xx10Bit<SPI, CS, ExternallyClocked, WithWakeupDelay> where
SPI: Transfer<u8, Error = SpiE> + FullDuplex<u8, Error = SpiE>,
CS: OutputPin<Error = PinE>,
Implementations when using the external SPI clock to time the conversions but also requiring a wakeup delay