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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#[doc = "Register `CCHP` reader"]
pub type R = crate::R<CchpSpec>;
#[doc = "Register `CCHP` writer"]
pub type W = crate::W<CchpSpec>;
#[doc = "Field `DTCFG` reader - Dead time configure"]
pub type DtcfgR = crate::FieldReader;
#[doc = "Field `DTCFG` writer - Dead time configure"]
pub type DtcfgW<'a, REG> = crate::FieldWriterSafe<'a, REG, 8>;
#[doc = "Break enable"]
pub use crate::gd32f190::timer0::cchp::Brken;
#[doc = "Field `BRKEN` reader - Break enable"]
pub use crate::gd32f190::timer0::cchp::BrkenR;
#[doc = "Field `BRKEN` writer - Break enable"]
pub use crate::gd32f190::timer0::cchp::BrkenW;
#[doc = "Break polarity"]
pub use crate::gd32f190::timer0::cchp::Brkp;
#[doc = "Field `BRKP` reader - Break polarity"]
pub use crate::gd32f190::timer0::cchp::BrkpR;
#[doc = "Field `BRKP` writer - Break polarity"]
pub use crate::gd32f190::timer0::cchp::BrkpW;
#[doc = "Idle mode off-state configure"]
pub use crate::gd32f190::timer0::cchp::Ios;
#[doc = "Field `IOS` reader - Idle mode off-state configure"]
pub use crate::gd32f190::timer0::cchp::IosR;
#[doc = "Field `IOS` writer - Idle mode off-state configure"]
pub use crate::gd32f190::timer0::cchp::IosW;
#[doc = "Output automatic enable"]
pub use crate::gd32f190::timer0::cchp::Oaen;
#[doc = "Field `OAEN` reader - Output automatic enable"]
pub use crate::gd32f190::timer0::cchp::OaenR;
#[doc = "Field `OAEN` writer - Output automatic enable"]
pub use crate::gd32f190::timer0::cchp::OaenW;
#[doc = "Primary output enable"]
pub use crate::gd32f190::timer0::cchp::Poen;
#[doc = "Field `POEN` reader - Primary output enable"]
pub use crate::gd32f190::timer0::cchp::PoenR;
#[doc = "Field `POEN` writer - Primary output enable"]
pub use crate::gd32f190::timer0::cchp::PoenW;
#[doc = "Complementary register protect control"]
pub use crate::gd32f190::timer0::cchp::Prot;
#[doc = "Field `PROT` reader - Complementary register protect control"]
pub use crate::gd32f190::timer0::cchp::ProtR;
#[doc = "Field `PROT` writer - Complementary register protect control"]
pub use crate::gd32f190::timer0::cchp::ProtW;
#[doc = "Run mode off-state configure"]
pub use crate::gd32f190::timer0::cchp::Ros;
#[doc = "Field `ROS` reader - Run mode off-state configure"]
pub use crate::gd32f190::timer0::cchp::RosR;
#[doc = "Field `ROS` writer - Run mode off-state configure"]
pub use crate::gd32f190::timer0::cchp::RosW;
impl R {
    #[doc = "Bits 0:7 - Dead time configure"]
    #[inline(always)]
    pub fn dtcfg(&self) -> DtcfgR {
        DtcfgR::new((self.bits & 0xff) as u8)
    }
    #[doc = "Bits 8:9 - Complementary register protect control"]
    #[inline(always)]
    pub fn prot(&self) -> ProtR {
        ProtR::new(((self.bits >> 8) & 3) as u8)
    }
    #[doc = "Bit 10 - Idle mode off-state configure"]
    #[inline(always)]
    pub fn ios(&self) -> IosR {
        IosR::new(((self.bits >> 10) & 1) != 0)
    }
    #[doc = "Bit 11 - Run mode off-state configure"]
    #[inline(always)]
    pub fn ros(&self) -> RosR {
        RosR::new(((self.bits >> 11) & 1) != 0)
    }
    #[doc = "Bit 12 - Break enable"]
    #[inline(always)]
    pub fn brken(&self) -> BrkenR {
        BrkenR::new(((self.bits >> 12) & 1) != 0)
    }
    #[doc = "Bit 13 - Break polarity"]
    #[inline(always)]
    pub fn brkp(&self) -> BrkpR {
        BrkpR::new(((self.bits >> 13) & 1) != 0)
    }
    #[doc = "Bit 14 - Output automatic enable"]
    #[inline(always)]
    pub fn oaen(&self) -> OaenR {
        OaenR::new(((self.bits >> 14) & 1) != 0)
    }
    #[doc = "Bit 15 - Primary output enable"]
    #[inline(always)]
    pub fn poen(&self) -> PoenR {
        PoenR::new(((self.bits >> 15) & 1) != 0)
    }
}
impl W {
    #[doc = "Bits 0:7 - Dead time configure"]
    #[inline(always)]
    #[must_use]
    pub fn dtcfg(&mut self) -> DtcfgW<CchpSpec> {
        DtcfgW::new(self, 0)
    }
    #[doc = "Bits 8:9 - Complementary register protect control"]
    #[inline(always)]
    #[must_use]
    pub fn prot(&mut self) -> ProtW<CchpSpec> {
        ProtW::new(self, 8)
    }
    #[doc = "Bit 10 - Idle mode off-state configure"]
    #[inline(always)]
    #[must_use]
    pub fn ios(&mut self) -> IosW<CchpSpec> {
        IosW::new(self, 10)
    }
    #[doc = "Bit 11 - Run mode off-state configure"]
    #[inline(always)]
    #[must_use]
    pub fn ros(&mut self) -> RosW<CchpSpec> {
        RosW::new(self, 11)
    }
    #[doc = "Bit 12 - Break enable"]
    #[inline(always)]
    #[must_use]
    pub fn brken(&mut self) -> BrkenW<CchpSpec> {
        BrkenW::new(self, 12)
    }
    #[doc = "Bit 13 - Break polarity"]
    #[inline(always)]
    #[must_use]
    pub fn brkp(&mut self) -> BrkpW<CchpSpec> {
        BrkpW::new(self, 13)
    }
    #[doc = "Bit 14 - Output automatic enable"]
    #[inline(always)]
    #[must_use]
    pub fn oaen(&mut self) -> OaenW<CchpSpec> {
        OaenW::new(self, 14)
    }
    #[doc = "Bit 15 - Primary output enable"]
    #[inline(always)]
    #[must_use]
    pub fn poen(&mut self) -> PoenW<CchpSpec> {
        PoenW::new(self, 15)
    }
}
#[doc = "Complementary Channel Protection register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cchp::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 [`cchp::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct CchpSpec;
impl crate::RegisterSpec for CchpSpec {
    type Ux = u16;
}
#[doc = "`read()` method returns [`cchp::R`](R) reader structure"]
impl crate::Readable for CchpSpec {}
#[doc = "`write(|w| ..)` method takes [`cchp::W`](W) writer structure"]
impl crate::Writable for CchpSpec {
    type Safety = crate::Unsafe;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u16 = 0;
}
#[doc = "`reset()` method sets CCHP to value 0"]
impl crate::Resettable for CchpSpec {
    const RESET_VALUE: u16 = 0;
}