ht32f523x2/sci/
ccr.rs

1#[doc = "Register `CCR` reader"]
2pub type R = crate::R<CcrSpec>;
3#[doc = "Register `CCR` writer"]
4pub type W = crate::W<CcrSpec>;
5#[doc = "Field `CCLK` reader - CCLK"]
6pub type CclkR = crate::BitReader;
7#[doc = "Field `CCLK` writer - CCLK"]
8pub type CclkW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `CDIO` reader - CDIO"]
10pub type CdioR = crate::BitReader;
11#[doc = "Field `CDIO` writer - CDIO"]
12pub type CdioW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `CLKSEL` reader - CLKSEL"]
14pub type ClkselR = crate::BitReader;
15#[doc = "Field `CLKSEL` writer - CLKSEL"]
16pub type ClkselW<'a, REG> = crate::BitWriter<'a, REG>;
17impl R {
18    #[doc = "Bit 2 - CCLK"]
19    #[inline(always)]
20    pub fn cclk(&self) -> CclkR {
21        CclkR::new(((self.bits >> 2) & 1) != 0)
22    }
23    #[doc = "Bit 3 - CDIO"]
24    #[inline(always)]
25    pub fn cdio(&self) -> CdioR {
26        CdioR::new(((self.bits >> 3) & 1) != 0)
27    }
28    #[doc = "Bit 7 - CLKSEL"]
29    #[inline(always)]
30    pub fn clksel(&self) -> ClkselR {
31        ClkselR::new(((self.bits >> 7) & 1) != 0)
32    }
33}
34impl W {
35    #[doc = "Bit 2 - CCLK"]
36    #[inline(always)]
37    #[must_use]
38    pub fn cclk(&mut self) -> CclkW<CcrSpec> {
39        CclkW::new(self, 2)
40    }
41    #[doc = "Bit 3 - CDIO"]
42    #[inline(always)]
43    #[must_use]
44    pub fn cdio(&mut self) -> CdioW<CcrSpec> {
45        CdioW::new(self, 3)
46    }
47    #[doc = "Bit 7 - CLKSEL"]
48    #[inline(always)]
49    #[must_use]
50    pub fn clksel(&mut self) -> ClkselW<CcrSpec> {
51        ClkselW::new(self, 7)
52    }
53}
54#[doc = "CCR\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ccr::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 [`ccr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
55pub struct CcrSpec;
56impl crate::RegisterSpec for CcrSpec {
57    type Ux = u32;
58}
59#[doc = "`read()` method returns [`ccr::R`](R) reader structure"]
60impl crate::Readable for CcrSpec {}
61#[doc = "`write(|w| ..)` method takes [`ccr::W`](W) writer structure"]
62impl crate::Writable for CcrSpec {
63    type Safety = crate::Unsafe;
64    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
65    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
66}
67#[doc = "`reset()` method sets CCR to value 0"]
68impl crate::Resettable for CcrSpec {
69    const RESET_VALUE: u32 = 0;
70}