d1_pac/csic/csic_top/
csic_bist_cs.rs1#[doc = "Register `csic_bist_cs` reader"]
2pub type R = crate::R<CSIC_BIST_CS_SPEC>;
3#[doc = "Register `csic_bist_cs` writer"]
4pub type W = crate::W<CSIC_BIST_CS_SPEC>;
5#[doc = "Field `bist_cs` reader - "]
6pub type BIST_CS_R = crate::FieldReader<BIST_CS_A>;
7#[doc = "\n\nValue on reset: 0"]
8#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9#[repr(u8)]
10pub enum BIST_CS_A {
11 #[doc = "0: Set when BK0 memory bist"]
12 SET_BK0 = 0,
13 #[doc = "1: Set when BK1 memory bist"]
14 SET_BK1 = 1,
15}
16impl From<BIST_CS_A> for u8 {
17 #[inline(always)]
18 fn from(variant: BIST_CS_A) -> Self {
19 variant as _
20 }
21}
22impl crate::FieldSpec for BIST_CS_A {
23 type Ux = u8;
24}
25impl BIST_CS_R {
26 #[doc = "Get enumerated values variant"]
27 #[inline(always)]
28 pub const fn variant(&self) -> Option<BIST_CS_A> {
29 match self.bits {
30 0 => Some(BIST_CS_A::SET_BK0),
31 1 => Some(BIST_CS_A::SET_BK1),
32 _ => None,
33 }
34 }
35 #[doc = "Set when BK0 memory bist"]
36 #[inline(always)]
37 pub fn is_set_bk0(&self) -> bool {
38 *self == BIST_CS_A::SET_BK0
39 }
40 #[doc = "Set when BK1 memory bist"]
41 #[inline(always)]
42 pub fn is_set_bk1(&self) -> bool {
43 *self == BIST_CS_A::SET_BK1
44 }
45}
46#[doc = "Field `bist_cs` writer - "]
47pub type BIST_CS_W<'a, REG> = crate::FieldWriter<'a, REG, 3, BIST_CS_A>;
48impl<'a, REG> BIST_CS_W<'a, REG>
49where
50 REG: crate::Writable + crate::RegisterSpec,
51 REG::Ux: From<u8>,
52{
53 #[doc = "Set when BK0 memory bist"]
54 #[inline(always)]
55 pub fn set_bk0(self) -> &'a mut crate::W<REG> {
56 self.variant(BIST_CS_A::SET_BK0)
57 }
58 #[doc = "Set when BK1 memory bist"]
59 #[inline(always)]
60 pub fn set_bk1(self) -> &'a mut crate::W<REG> {
61 self.variant(BIST_CS_A::SET_BK1)
62 }
63}
64impl R {
65 #[doc = "Bits 0:2"]
66 #[inline(always)]
67 pub fn bist_cs(&self) -> BIST_CS_R {
68 BIST_CS_R::new((self.bits & 7) as u8)
69 }
70}
71impl W {
72 #[doc = "Bits 0:2"]
73 #[inline(always)]
74 #[must_use]
75 pub fn bist_cs(&mut self) -> BIST_CS_W<CSIC_BIST_CS_SPEC> {
76 BIST_CS_W::new(self, 0)
77 }
78 #[doc = r" Writes raw bits to the register."]
79 #[doc = r""]
80 #[doc = r" # Safety"]
81 #[doc = r""]
82 #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
83 #[inline(always)]
84 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
85 self.bits = bits;
86 self
87 }
88}
89#[doc = "CSIC BIST CS Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`csic_bist_cs::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 [`csic_bist_cs::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
90pub struct CSIC_BIST_CS_SPEC;
91impl crate::RegisterSpec for CSIC_BIST_CS_SPEC {
92 type Ux = u32;
93}
94#[doc = "`read()` method returns [`csic_bist_cs::R`](R) reader structure"]
95impl crate::Readable for CSIC_BIST_CS_SPEC {}
96#[doc = "`write(|w| ..)` method takes [`csic_bist_cs::W`](W) writer structure"]
97impl crate::Writable for CSIC_BIST_CS_SPEC {
98 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
99 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
100}
101#[doc = "`reset()` method sets csic_bist_cs to value 0"]
102impl crate::Resettable for CSIC_BIST_CS_SPEC {
103 const RESET_VALUE: Self::Ux = 0;
104}