Skip to main content

ra2a1/sdadc24/
clbssr.rs

1#[doc = "Register `CLBSSR` reader"]
2pub struct R(crate::R<CLBSSR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<CLBSSR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<CLBSSR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<CLBSSR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `CLBSS` reader - Calibration status"]
17pub type CLBSS_R = crate::BitReader<CLBSS_A>;
18#[doc = "Calibration status\n\nValue on reset: 0"]
19#[derive(Clone, Copy, Debug, PartialEq, Eq)]
20pub enum CLBSS_A {
21    #[doc = "0: Calibration is not running"]
22    _0 = 0,
23    #[doc = "1: Calibration is running"]
24    _1 = 1,
25}
26impl From<CLBSS_A> for bool {
27    #[inline(always)]
28    fn from(variant: CLBSS_A) -> Self {
29        variant as u8 != 0
30    }
31}
32impl CLBSS_R {
33    #[doc = "Get enumerated values variant"]
34    #[inline(always)]
35    pub fn variant(&self) -> CLBSS_A {
36        match self.bits {
37            false => CLBSS_A::_0,
38            true => CLBSS_A::_1,
39        }
40    }
41    #[doc = "Checks if the value of the field is `_0`"]
42    #[inline(always)]
43    pub fn is_0(&self) -> bool {
44        *self == CLBSS_A::_0
45    }
46    #[doc = "Checks if the value of the field is `_1`"]
47    #[inline(always)]
48    pub fn is_1(&self) -> bool {
49        *self == CLBSS_A::_1
50    }
51}
52impl R {
53    #[doc = "Bit 0 - Calibration status"]
54    #[inline(always)]
55    pub fn clbss(&self) -> CLBSS_R {
56        CLBSS_R::new((self.bits & 1) != 0)
57    }
58}
59#[doc = "Calibration Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [clbssr](index.html) module"]
60pub struct CLBSSR_SPEC;
61impl crate::RegisterSpec for CLBSSR_SPEC {
62    type Ux = u8;
63}
64#[doc = "`read()` method returns [clbssr::R](R) reader structure"]
65impl crate::Readable for CLBSSR_SPEC {
66    type Reader = R;
67}
68#[doc = "`reset()` method sets CLBSSR to value 0"]
69impl crate::Resettable for CLBSSR_SPEC {
70    const RESET_VALUE: Self::Ux = 0;
71}