stm32: add some docs.
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
/// ADC resolution
|
||||
#[allow(missing_docs)]
|
||||
#[cfg(any(adc_v1, adc_v2, adc_v3, adc_g0, adc_f3, adc_f3_v1_1))]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
||||
@ -8,6 +10,8 @@ pub enum Resolution {
|
||||
SixBit,
|
||||
}
|
||||
|
||||
/// ADC resolution
|
||||
#[allow(missing_docs)]
|
||||
#[cfg(adc_v4)]
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
||||
@ -49,6 +53,9 @@ impl From<Resolution> for crate::pac::adc::vals::Res {
|
||||
}
|
||||
|
||||
impl Resolution {
|
||||
/// Get the maximum reading value for this resolution.
|
||||
///
|
||||
/// This is `2**n - 1`.
|
||||
pub fn to_max_count(&self) -> u32 {
|
||||
match self {
|
||||
#[cfg(adc_v4)]
|
||||
|
Reference in New Issue
Block a user