stm32-metapac

Crates

git

Versions

stm32wb06cc

Flavors

Conf

Struct Conf 

#[repr(transparent)]
pub struct Conf(pub u32);
Expand description

CONF register.

Tuple Fields§

§0: u32

Implementations§

§

impl Conf

pub const fn cont(&self) -> bool

CONT: regular sequence runs continuously when ADC mode is enabled: 0: enable the single conversion: when the sequence is over, the conversion stops 1: enable the continuous conversion: when the sequence is over, the sequence starts again until the software sets the CTRL.STOP_OP_MODE bit.

pub fn set_cont(&mut self, val: bool)

CONT: regular sequence runs continuously when ADC mode is enabled: 0: enable the single conversion: when the sequence is over, the conversion stops 1: enable the continuous conversion: when the sequence is over, the sequence starts again until the software sets the CTRL.STOP_OP_MODE bit.

pub const fn sequence(&self) -> bool

SEQUENCE: enable the sequence mode (active by default): 0: sequence mode is disabled, only SEQ0 is selected 1: sequence mode is enabled, conversions from SEQ0 to SEQx with x=SEQ_LEN Note: clearing this bit is equivalent to SEQUENCE=1 and SEQ_LEN=0000. Ideally, this bit can be kept high as redundant with keeping high and setting SEQ_LEN=0000.

pub fn set_sequence(&mut self, val: bool)

SEQUENCE: enable the sequence mode (active by default): 0: sequence mode is disabled, only SEQ0 is selected 1: sequence mode is enabled, conversions from SEQ0 to SEQx with x=SEQ_LEN Note: clearing this bit is equivalent to SEQUENCE=1 and SEQ_LEN=0000. Ideally, this bit can be kept high as redundant with keeping high and setting SEQ_LEN=0000.

pub const fn seq_len(&self) -> u8

SEQ_LEN[3:0]: number of conversions in a regular sequence: 0000: 1 conversion, starting from SEQ0 0001: 2 conversions, starting from SEQ0 … 1111: 16 conversions, starting from SEQ0.

pub fn set_seq_len(&mut self, val: u8)

SEQ_LEN[3:0]: number of conversions in a regular sequence: 0000: 1 conversion, starting from SEQ0 0001: 2 conversions, starting from SEQ0 … 1111: 16 conversions, starting from SEQ0.

pub const fn smps_synchro_ena(&self) -> bool

SMPS_SYNCHRO_ENA: synchronize the ADC start conversion with a pulse generated by the SMPS: 0: SMPS synchronization is disabled for all ADC clock frequencies 1: SMPS synchronization is enabled (only when ADC clock is 8 MHz or 16 MHz) Note: SMPS_SYNCHRO_ENA must be 0 when the ADC analog clock is 32 MHz or when PWRC_CR5.NOSMPS = 1.

pub fn set_smps_synchro_ena(&mut self, val: bool)

SMPS_SYNCHRO_ENA: synchronize the ADC start conversion with a pulse generated by the SMPS: 0: SMPS synchronization is disabled for all ADC clock frequencies 1: SMPS synchronization is enabled (only when ADC clock is 8 MHz or 16 MHz) Note: SMPS_SYNCHRO_ENA must be 0 when the ADC analog clock is 32 MHz or when PWRC_CR5.NOSMPS = 1.

pub const fn op_mode(&self) -> u8

ADC mode selection (= data path selection).

pub fn set_op_mode(&mut self, val: u8)

ADC mode selection (= data path selection).

pub const fn sample_rate_lsb(&self) -> u8

SAMPLE_RATE_LSB: Sample Rate LSB This field is an extension of SAMPLE_RATE definition in bits 12,11 of CONF register. It impacts the conversion rate of ADC (F_ADC). See SAMPLE_RATE bits for the full description. When this field is set to a value different than 0, SMPS synchronization is not feasible. This value is hidden to the user.

pub fn set_sample_rate_lsb(&mut self, val: u8)

SAMPLE_RATE_LSB: Sample Rate LSB This field is an extension of SAMPLE_RATE definition in bits 12,11 of CONF register. It impacts the conversion rate of ADC (F_ADC). See SAMPLE_RATE bits for the full description. When this field is set to a value different than 0, SMPS synchronization is not feasible. This value is hidden to the user.

pub const fn sample_rate(&self) -> u8

SAMPLE_RATE[1:0]: conversion rate of ADC (F_ADC): F_ADC = F_ADC_CLK/(16 + 16SAMPLE_RATE_MSB + 4SAMPLE_RATE + SAMPLE_RATE_LSB),where F_ADC_CLK is the analog ADC clock frequency. By default F_ADC_CLK is 16MHz frequency.

pub fn set_sample_rate(&mut self, val: u8)

SAMPLE_RATE[1:0]: conversion rate of ADC (F_ADC): F_ADC = F_ADC_CLK/(16 + 16SAMPLE_RATE_MSB + 4SAMPLE_RATE + SAMPLE_RATE_LSB),where F_ADC_CLK is the analog ADC clock frequency. By default F_ADC_CLK is 16MHz frequency.

pub const fn dma_ds_ena(&self) -> bool

DMA_DS_EN: enable the DMA mode for the Down Sampler data path: 0: DMA mode is disabled 1: DMA mode is enabled.

pub fn set_dma_ds_ena(&mut self, val: bool)

DMA_DS_EN: enable the DMA mode for the Down Sampler data path: 0: DMA mode is disabled 1: DMA mode is enabled.

pub const fn dma_df_ena(&self) -> bool

enable DMA mode for Decimation Filter data path.

pub fn set_dma_df_ena(&mut self, val: bool)

enable DMA mode for Decimation Filter data path.

pub const fn ovr_ds_cfg(&self) -> bool

OVR_DS_CFG: Down Sampler overrun configuration: 0: the previous data is kept, the new one is lost 1: the previous data is lost, the new one is kept.

pub fn set_ovr_ds_cfg(&mut self, val: bool)

OVR_DS_CFG: Down Sampler overrun configuration: 0: the previous data is kept, the new one is lost 1: the previous data is lost, the new one is kept.

pub const fn ovr_df_cfg(&self) -> bool

decimation overrun configuration.

pub fn set_ovr_df_cfg(&mut self, val: bool)

decimation overrun configuration.

pub const fn bit_invert_sn(&self) -> bool

BIT_INVERT_SN: invert bit to bit the ADC data output (1’s complement) when a single negative input is connected to the ADC: 0: no inversion (default) 1: enable the inversion.

pub fn set_bit_invert_sn(&mut self, val: bool)

BIT_INVERT_SN: invert bit to bit the ADC data output (1’s complement) when a single negative input is connected to the ADC: 0: no inversion (default) 1: enable the inversion.

pub const fn bit_invert_diff(&self) -> bool

BIT_INVERT_DIFF: invert bit to bit the ADC data output (1’s complement) when a differential input is connected to the ADC: 0: no inversion (default) 1: enable the inversion.

pub fn set_bit_invert_diff(&mut self, val: bool)

BIT_INVERT_DIFF: invert bit to bit the ADC data output (1’s complement) when a differential input is connected to the ADC: 0: no inversion (default) 1: enable the inversion.

pub const fn adc_cont_1v2(&self) -> bool

ADC_CONT_1V2: select the input sampling method: 0: sampling only at conversion start (default) 1: sampling starts at the end of conversion.

pub fn set_adc_cont_1v2(&mut self, val: bool)

ADC_CONT_1V2: select the input sampling method: 0: sampling only at conversion start (default) 1: sampling starts at the end of conversion.

pub const fn vbias_prech_force(&self) -> bool

possibility to keep the VBIAS_PRECH enabled to deactivate the filter.

pub fn set_vbias_prech_force(&mut self, val: bool)

possibility to keep the VBIAS_PRECH enabled to deactivate the filter.

pub const fn sample_rate_msb(&self) -> u8

SAMPLE_RATE_MSB: Sample Rate MSB This field is an extension of SAMPLE_RATE definition in bits 12,11 of CONF register. It impacts the conversion rate of ADC (F_ADC). See SAMPLE_RATE bits for the full description.

pub fn set_sample_rate_msb(&mut self, val: u8)

SAMPLE_RATE_MSB: Sample Rate MSB This field is an extension of SAMPLE_RATE definition in bits 12,11 of CONF register. It impacts the conversion rate of ADC (F_ADC). See SAMPLE_RATE bits for the full description.

Trait Implementations§

§

impl Clone for Conf

§

fn clone(&self) -> Conf

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
§

impl Debug for Conf

§

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

Formats the value using the given formatter. Read more
§

impl Default for Conf

§

fn default() -> Conf

Returns the “default value” for a type. Read more
§

impl PartialEq for Conf

§

fn eq(&self, other: &Conf) -> 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.
§

impl Copy for Conf

§

impl Eq for Conf

§

impl StructuralPartialEq for Conf

Auto Trait Implementations§

§

impl Freeze for Conf

§

impl RefUnwindSafe for Conf

§

impl Send for Conf

§

impl Sync for Conf

§

impl Unpin for Conf

§

impl UnwindSafe for Conf

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.