bl602_pac/sec_eng/
se_cdet_0_ctrl_0.rs

1#[doc = "Register `se_cdet_0_ctrl_0` reader"]
2pub struct R(crate::R<SE_CDET_0_CTRL_0_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<SE_CDET_0_CTRL_0_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<SE_CDET_0_CTRL_0_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<SE_CDET_0_CTRL_0_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `se_cdet_0_ctrl_0` writer"]
17pub struct W(crate::W<SE_CDET_0_CTRL_0_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<SE_CDET_0_CTRL_0_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<SE_CDET_0_CTRL_0_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<SE_CDET_0_CTRL_0_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `se_cdet_0_en` reader - "]
38pub type SE_CDET_0_EN_R = crate::BitReader<bool>;
39#[doc = "Field `se_cdet_0_en` writer - "]
40pub type SE_CDET_0_EN_W<'a, const O: u8> =
41    crate::BitWriter<'a, u32, SE_CDET_0_CTRL_0_SPEC, bool, O>;
42#[doc = "Field `se_cdet_0_error` reader - "]
43pub type SE_CDET_0_ERROR_R = crate::BitReader<bool>;
44#[doc = "Field `se_cdet_0_status` reader - "]
45pub type SE_CDET_0_STATUS_R = crate::FieldReader<u16, u16>;
46#[doc = "Field `se_cdet_0_g_loop_max` reader - "]
47pub type SE_CDET_0_G_LOOP_MAX_R = crate::FieldReader<u8, u8>;
48#[doc = "Field `se_cdet_0_g_loop_max` writer - "]
49pub type SE_CDET_0_G_LOOP_MAX_W<'a, const O: u8> =
50    crate::FieldWriter<'a, u32, SE_CDET_0_CTRL_0_SPEC, u8, u8, 8, O>;
51#[doc = "Field `se_cdet_0_g_loop_min` reader - "]
52pub type SE_CDET_0_G_LOOP_MIN_R = crate::FieldReader<u8, u8>;
53#[doc = "Field `se_cdet_0_g_loop_min` writer - "]
54pub type SE_CDET_0_G_LOOP_MIN_W<'a, const O: u8> =
55    crate::FieldWriter<'a, u32, SE_CDET_0_CTRL_0_SPEC, u8, u8, 8, O>;
56impl R {
57    #[doc = "Bit 0"]
58    #[inline(always)]
59    pub fn se_cdet_0_en(&self) -> SE_CDET_0_EN_R {
60        SE_CDET_0_EN_R::new((self.bits & 1) != 0)
61    }
62    #[doc = "Bit 1"]
63    #[inline(always)]
64    pub fn se_cdet_0_error(&self) -> SE_CDET_0_ERROR_R {
65        SE_CDET_0_ERROR_R::new(((self.bits >> 1) & 1) != 0)
66    }
67    #[doc = "Bits 2:15"]
68    #[inline(always)]
69    pub fn se_cdet_0_status(&self) -> SE_CDET_0_STATUS_R {
70        SE_CDET_0_STATUS_R::new(((self.bits >> 2) & 0x3fff) as u16)
71    }
72    #[doc = "Bits 16:23"]
73    #[inline(always)]
74    pub fn se_cdet_0_g_loop_max(&self) -> SE_CDET_0_G_LOOP_MAX_R {
75        SE_CDET_0_G_LOOP_MAX_R::new(((self.bits >> 16) & 0xff) as u8)
76    }
77    #[doc = "Bits 24:31"]
78    #[inline(always)]
79    pub fn se_cdet_0_g_loop_min(&self) -> SE_CDET_0_G_LOOP_MIN_R {
80        SE_CDET_0_G_LOOP_MIN_R::new(((self.bits >> 24) & 0xff) as u8)
81    }
82}
83impl W {
84    #[doc = "Bit 0"]
85    #[inline(always)]
86    #[must_use]
87    pub fn se_cdet_0_en(&mut self) -> SE_CDET_0_EN_W<0> {
88        SE_CDET_0_EN_W::new(self)
89    }
90    #[doc = "Bits 16:23"]
91    #[inline(always)]
92    #[must_use]
93    pub fn se_cdet_0_g_loop_max(&mut self) -> SE_CDET_0_G_LOOP_MAX_W<16> {
94        SE_CDET_0_G_LOOP_MAX_W::new(self)
95    }
96    #[doc = "Bits 24:31"]
97    #[inline(always)]
98    #[must_use]
99    pub fn se_cdet_0_g_loop_min(&mut self) -> SE_CDET_0_G_LOOP_MIN_W<24> {
100        SE_CDET_0_G_LOOP_MIN_W::new(self)
101    }
102    #[doc = "Writes raw bits to the register."]
103    #[inline(always)]
104    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
105        self.0.bits(bits);
106        self
107    }
108}
109#[doc = "se_cdet_0_ctrl_0.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [se_cdet_0_ctrl_0](index.html) module"]
110pub struct SE_CDET_0_CTRL_0_SPEC;
111impl crate::RegisterSpec for SE_CDET_0_CTRL_0_SPEC {
112    type Ux = u32;
113}
114#[doc = "`read()` method returns [se_cdet_0_ctrl_0::R](R) reader structure"]
115impl crate::Readable for SE_CDET_0_CTRL_0_SPEC {
116    type Reader = R;
117}
118#[doc = "`write(|w| ..)` method takes [se_cdet_0_ctrl_0::W](W) writer structure"]
119impl crate::Writable for SE_CDET_0_CTRL_0_SPEC {
120    type Writer = W;
121    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
122    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
123}
124#[doc = "`reset()` method sets se_cdet_0_ctrl_0 to value 0x2164_0004"]
125impl crate::Resettable for SE_CDET_0_CTRL_0_SPEC {
126    const RESET_VALUE: Self::Ux = 0x2164_0004;
127}