bl61x_pac/aon/
tsen.rs

1#[doc = "Register `tsen` reader"]
2pub type R = crate::R<TSEN_SPEC>;
3#[doc = "Register `tsen` writer"]
4pub type W = crate::W<TSEN_SPEC>;
5#[doc = "Field `tsen_refcode_corner` reader - "]
6pub type TSEN_REFCODE_CORNER_R = crate::FieldReader<u16>;
7#[doc = "Field `tsen_refcode_corner` writer - "]
8pub type TSEN_REFCODE_CORNER_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16>;
9#[doc = "Field `tsen_refcode_rfcal` reader - "]
10pub type TSEN_REFCODE_RFCAL_R = crate::FieldReader<u16>;
11#[doc = "Field `tsen_refcode_rfcal` writer - "]
12pub type TSEN_REFCODE_RFCAL_W<'a, REG> = crate::FieldWriter<'a, REG, 12, u16>;
13#[doc = "Field `xtal_rdy` reader - "]
14pub type XTAL_RDY_R = crate::BitReader;
15#[doc = "Field `xtal_rdy` writer - "]
16pub type XTAL_RDY_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `xtal_inn_cfg_en_aon` reader - "]
18pub type XTAL_INN_CFG_EN_AON_R = crate::BitReader;
19#[doc = "Field `xtal_inn_cfg_en_aon` writer - "]
20pub type XTAL_INN_CFG_EN_AON_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `xtal_rdy_int_sel_aon` reader - "]
22pub type XTAL_RDY_INT_SEL_AON_R = crate::FieldReader;
23#[doc = "Field `xtal_rdy_int_sel_aon` writer - "]
24pub type XTAL_RDY_INT_SEL_AON_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
25impl R {
26    #[doc = "Bits 0:11"]
27    #[inline(always)]
28    pub fn tsen_refcode_corner(&self) -> TSEN_REFCODE_CORNER_R {
29        TSEN_REFCODE_CORNER_R::new((self.bits & 0x0fff) as u16)
30    }
31    #[doc = "Bits 16:27"]
32    #[inline(always)]
33    pub fn tsen_refcode_rfcal(&self) -> TSEN_REFCODE_RFCAL_R {
34        TSEN_REFCODE_RFCAL_R::new(((self.bits >> 16) & 0x0fff) as u16)
35    }
36    #[doc = "Bit 28"]
37    #[inline(always)]
38    pub fn xtal_rdy(&self) -> XTAL_RDY_R {
39        XTAL_RDY_R::new(((self.bits >> 28) & 1) != 0)
40    }
41    #[doc = "Bit 29"]
42    #[inline(always)]
43    pub fn xtal_inn_cfg_en_aon(&self) -> XTAL_INN_CFG_EN_AON_R {
44        XTAL_INN_CFG_EN_AON_R::new(((self.bits >> 29) & 1) != 0)
45    }
46    #[doc = "Bits 30:31"]
47    #[inline(always)]
48    pub fn xtal_rdy_int_sel_aon(&self) -> XTAL_RDY_INT_SEL_AON_R {
49        XTAL_RDY_INT_SEL_AON_R::new(((self.bits >> 30) & 3) as u8)
50    }
51}
52impl W {
53    #[doc = "Bits 0:11"]
54    #[inline(always)]
55    #[must_use]
56    pub fn tsen_refcode_corner(&mut self) -> TSEN_REFCODE_CORNER_W<TSEN_SPEC> {
57        TSEN_REFCODE_CORNER_W::new(self, 0)
58    }
59    #[doc = "Bits 16:27"]
60    #[inline(always)]
61    #[must_use]
62    pub fn tsen_refcode_rfcal(&mut self) -> TSEN_REFCODE_RFCAL_W<TSEN_SPEC> {
63        TSEN_REFCODE_RFCAL_W::new(self, 16)
64    }
65    #[doc = "Bit 28"]
66    #[inline(always)]
67    #[must_use]
68    pub fn xtal_rdy(&mut self) -> XTAL_RDY_W<TSEN_SPEC> {
69        XTAL_RDY_W::new(self, 28)
70    }
71    #[doc = "Bit 29"]
72    #[inline(always)]
73    #[must_use]
74    pub fn xtal_inn_cfg_en_aon(&mut self) -> XTAL_INN_CFG_EN_AON_W<TSEN_SPEC> {
75        XTAL_INN_CFG_EN_AON_W::new(self, 29)
76    }
77    #[doc = "Bits 30:31"]
78    #[inline(always)]
79    #[must_use]
80    pub fn xtal_rdy_int_sel_aon(&mut self) -> XTAL_RDY_INT_SEL_AON_W<TSEN_SPEC> {
81        XTAL_RDY_INT_SEL_AON_W::new(self, 30)
82    }
83    #[doc = r" Writes raw bits to the register."]
84    #[doc = r""]
85    #[doc = r" # Safety"]
86    #[doc = r""]
87    #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
88    #[inline(always)]
89    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
90        self.bits = bits;
91        self
92    }
93}
94#[doc = "tsen.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tsen::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tsen::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
95pub struct TSEN_SPEC;
96impl crate::RegisterSpec for TSEN_SPEC {
97    type Ux = u32;
98}
99#[doc = "`read()` method returns [`tsen::R`](R) reader structure"]
100impl crate::Readable for TSEN_SPEC {}
101#[doc = "`write(|w| ..)` method takes [`tsen::W`](W) writer structure"]
102impl crate::Writable for TSEN_SPEC {
103    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
104    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
105}
106#[doc = "`reset()` method sets tsen to value 0"]
107impl crate::Resettable for TSEN_SPEC {
108    const RESET_VALUE: Self::Ux = 0;
109}