1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#[doc = "Register `PCSCNTR` reader"]
pub struct R(crate::R<PCSCNTR_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<PCSCNTR_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<PCSCNTR_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<PCSCNTR_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Register `PCSCNTR` writer"]
pub struct W(crate::W<PCSCNTR_SPEC>);
impl core::ops::Deref for W {
    type Target = crate::W<PCSCNTR_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl core::ops::DerefMut for W {
    #[inline(always)]
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}
impl From<crate::W<PCSCNTR_SPEC>> for W {
    #[inline(always)]
    fn from(writer: crate::W<PCSCNTR_SPEC>) -> Self {
        W(writer)
    }
}
#[doc = "Field `CSCOUNT` reader - CSCOUNT"]
pub type CSCOUNT_R = crate::FieldReader<u16, u16>;
#[doc = "Field `CSCOUNT` writer - CSCOUNT"]
pub type CSCOUNT_W<'a, const O: u8> = crate::FieldWriter<'a, u32, PCSCNTR_SPEC, u16, u16, 16, O>;
#[doc = "Field `CNTB1EN` reader - CNTB1EN"]
pub type CNTB1EN_R = crate::BitReader<bool>;
#[doc = "Field `CNTB1EN` writer - CNTB1EN"]
pub type CNTB1EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCSCNTR_SPEC, bool, O>;
#[doc = "Field `CNTB2EN` reader - CNTB2EN"]
pub type CNTB2EN_R = crate::BitReader<bool>;
#[doc = "Field `CNTB2EN` writer - CNTB2EN"]
pub type CNTB2EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCSCNTR_SPEC, bool, O>;
#[doc = "Field `CNTB3EN` reader - CNTB3EN"]
pub type CNTB3EN_R = crate::BitReader<bool>;
#[doc = "Field `CNTB3EN` writer - CNTB3EN"]
pub type CNTB3EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCSCNTR_SPEC, bool, O>;
#[doc = "Field `CNTB4EN` reader - CNTB4EN"]
pub type CNTB4EN_R = crate::BitReader<bool>;
#[doc = "Field `CNTB4EN` writer - CNTB4EN"]
pub type CNTB4EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, PCSCNTR_SPEC, bool, O>;
impl R {
    #[doc = "Bits 0:15 - CSCOUNT"]
    #[inline(always)]
    pub fn cscount(&self) -> CSCOUNT_R {
        CSCOUNT_R::new((self.bits & 0xffff) as u16)
    }
    #[doc = "Bit 16 - CNTB1EN"]
    #[inline(always)]
    pub fn cntb1en(&self) -> CNTB1EN_R {
        CNTB1EN_R::new(((self.bits >> 16) & 1) != 0)
    }
    #[doc = "Bit 17 - CNTB2EN"]
    #[inline(always)]
    pub fn cntb2en(&self) -> CNTB2EN_R {
        CNTB2EN_R::new(((self.bits >> 17) & 1) != 0)
    }
    #[doc = "Bit 18 - CNTB3EN"]
    #[inline(always)]
    pub fn cntb3en(&self) -> CNTB3EN_R {
        CNTB3EN_R::new(((self.bits >> 18) & 1) != 0)
    }
    #[doc = "Bit 19 - CNTB4EN"]
    #[inline(always)]
    pub fn cntb4en(&self) -> CNTB4EN_R {
        CNTB4EN_R::new(((self.bits >> 19) & 1) != 0)
    }
}
impl W {
    #[doc = "Bits 0:15 - CSCOUNT"]
    #[inline(always)]
    pub fn cscount(&mut self) -> CSCOUNT_W<0> {
        CSCOUNT_W::new(self)
    }
    #[doc = "Bit 16 - CNTB1EN"]
    #[inline(always)]
    pub fn cntb1en(&mut self) -> CNTB1EN_W<16> {
        CNTB1EN_W::new(self)
    }
    #[doc = "Bit 17 - CNTB2EN"]
    #[inline(always)]
    pub fn cntb2en(&mut self) -> CNTB2EN_W<17> {
        CNTB2EN_W::new(self)
    }
    #[doc = "Bit 18 - CNTB3EN"]
    #[inline(always)]
    pub fn cntb3en(&mut self) -> CNTB3EN_W<18> {
        CNTB3EN_W::new(self)
    }
    #[doc = "Bit 19 - CNTB4EN"]
    #[inline(always)]
    pub fn cntb4en(&mut self) -> CNTB4EN_W<19> {
        CNTB4EN_W::new(self)
    }
    #[doc = "Writes raw bits to the register."]
    #[inline(always)]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.0.bits(bits);
        self
    }
}
#[doc = "PSRAM chip select counter register\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 [pcscntr](index.html) module"]
pub struct PCSCNTR_SPEC;
impl crate::RegisterSpec for PCSCNTR_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [pcscntr::R](R) reader structure"]
impl crate::Readable for PCSCNTR_SPEC {
    type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [pcscntr::W](W) writer structure"]
impl crate::Writable for PCSCNTR_SPEC {
    type Writer = W;
}
#[doc = "`reset()` method sets PCSCNTR to value 0"]
impl crate::Resettable for PCSCNTR_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}