d1_pac/csic/csic_top/
csic_bist_data_mask.rs1#[doc = "Register `csic_bist_data_mask` reader"]
2pub type R = crate::R<CSIC_BIST_DATA_MASK_SPEC>;
3#[doc = "Register `csic_bist_data_mask` writer"]
4pub type W = crate::W<CSIC_BIST_DATA_MASK_SPEC>;
5#[doc = "Field `bist_data_mask` reader - BIST data mask"]
6pub type BIST_DATA_MASK_R = crate::FieldReader<BIST_DATA_MASK_A>;
7#[doc = "BIST data mask\n\nValue on reset: 0"]
8#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9#[repr(u32)]
10pub enum BIST_DATA_MASK_A {
11 #[doc = "0: `0`"]
12 UNMASK = 0,
13 #[doc = "1: `1`"]
14 MASK = 1,
15}
16impl From<BIST_DATA_MASK_A> for u32 {
17 #[inline(always)]
18 fn from(variant: BIST_DATA_MASK_A) -> Self {
19 variant as _
20 }
21}
22impl crate::FieldSpec for BIST_DATA_MASK_A {
23 type Ux = u32;
24}
25impl BIST_DATA_MASK_R {
26 #[doc = "Get enumerated values variant"]
27 #[inline(always)]
28 pub const fn variant(&self) -> Option<BIST_DATA_MASK_A> {
29 match self.bits {
30 0 => Some(BIST_DATA_MASK_A::UNMASK),
31 1 => Some(BIST_DATA_MASK_A::MASK),
32 _ => None,
33 }
34 }
35 #[doc = "`0`"]
36 #[inline(always)]
37 pub fn is_unmask(&self) -> bool {
38 *self == BIST_DATA_MASK_A::UNMASK
39 }
40 #[doc = "`1`"]
41 #[inline(always)]
42 pub fn is_mask(&self) -> bool {
43 *self == BIST_DATA_MASK_A::MASK
44 }
45}
46#[doc = "Field `bist_data_mask` writer - BIST data mask"]
47pub type BIST_DATA_MASK_W<'a, REG> = crate::FieldWriter<'a, REG, 32, BIST_DATA_MASK_A>;
48impl<'a, REG> BIST_DATA_MASK_W<'a, REG>
49where
50 REG: crate::Writable + crate::RegisterSpec,
51 REG::Ux: From<u32>,
52{
53 #[doc = "`0`"]
54 #[inline(always)]
55 pub fn unmask(self) -> &'a mut crate::W<REG> {
56 self.variant(BIST_DATA_MASK_A::UNMASK)
57 }
58 #[doc = "`1`"]
59 #[inline(always)]
60 pub fn mask(self) -> &'a mut crate::W<REG> {
61 self.variant(BIST_DATA_MASK_A::MASK)
62 }
63}
64impl R {
65 #[doc = "Bits 0:31 - BIST data mask"]
66 #[inline(always)]
67 pub fn bist_data_mask(&self) -> BIST_DATA_MASK_R {
68 BIST_DATA_MASK_R::new(self.bits)
69 }
70}
71impl W {
72 #[doc = "Bits 0:31 - BIST data mask"]
73 #[inline(always)]
74 #[must_use]
75 pub fn bist_data_mask(&mut self) -> BIST_DATA_MASK_W<CSIC_BIST_DATA_MASK_SPEC> {
76 BIST_DATA_MASK_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 Data Mask Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`csic_bist_data_mask::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_data_mask::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_DATA_MASK_SPEC;
91impl crate::RegisterSpec for CSIC_BIST_DATA_MASK_SPEC {
92 type Ux = u32;
93}
94#[doc = "`read()` method returns [`csic_bist_data_mask::R`](R) reader structure"]
95impl crate::Readable for CSIC_BIST_DATA_MASK_SPEC {}
96#[doc = "`write(|w| ..)` method takes [`csic_bist_data_mask::W`](W) writer structure"]
97impl crate::Writable for CSIC_BIST_DATA_MASK_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_data_mask to value 0"]
102impl crate::Resettable for CSIC_BIST_DATA_MASK_SPEC {
103 const RESET_VALUE: Self::Ux = 0;
104}