xmc4800/fce_ke0/
ctr.rs

1#[doc = "Register `CTR` reader"]
2pub type R = crate::R<CTR_SPEC>;
3#[doc = "Register `CTR` writer"]
4pub type W = crate::W<CTR_SPEC>;
5#[doc = "Field `FCM` reader - Force CRC Mismatch"]
6pub type FCM_R = crate::BitReader;
7#[doc = "Field `FCM` writer - Force CRC Mismatch"]
8pub type FCM_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `FRM_CFG` reader - Force CFG Register Mismatch"]
10pub type FRM_CFG_R = crate::BitReader;
11#[doc = "Field `FRM_CFG` writer - Force CFG Register Mismatch"]
12pub type FRM_CFG_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `FRM_CHECK` reader - Force Check Register Mismatch"]
14pub type FRM_CHECK_R = crate::BitReader;
15#[doc = "Field `FRM_CHECK` writer - Force Check Register Mismatch"]
16pub type FRM_CHECK_W<'a, REG> = crate::BitWriter<'a, REG>;
17impl R {
18    #[doc = "Bit 0 - Force CRC Mismatch"]
19    #[inline(always)]
20    pub fn fcm(&self) -> FCM_R {
21        FCM_R::new((self.bits & 1) != 0)
22    }
23    #[doc = "Bit 1 - Force CFG Register Mismatch"]
24    #[inline(always)]
25    pub fn frm_cfg(&self) -> FRM_CFG_R {
26        FRM_CFG_R::new(((self.bits >> 1) & 1) != 0)
27    }
28    #[doc = "Bit 2 - Force Check Register Mismatch"]
29    #[inline(always)]
30    pub fn frm_check(&self) -> FRM_CHECK_R {
31        FRM_CHECK_R::new(((self.bits >> 2) & 1) != 0)
32    }
33}
34impl W {
35    #[doc = "Bit 0 - Force CRC Mismatch"]
36    #[inline(always)]
37    pub fn fcm(&mut self) -> FCM_W<CTR_SPEC> {
38        FCM_W::new(self, 0)
39    }
40    #[doc = "Bit 1 - Force CFG Register Mismatch"]
41    #[inline(always)]
42    pub fn frm_cfg(&mut self) -> FRM_CFG_W<CTR_SPEC> {
43        FRM_CFG_W::new(self, 1)
44    }
45    #[doc = "Bit 2 - Force Check Register Mismatch"]
46    #[inline(always)]
47    pub fn frm_check(&mut self) -> FRM_CHECK_W<CTR_SPEC> {
48        FRM_CHECK_W::new(self, 2)
49    }
50}
51#[doc = "CRC Test Register\n\nYou can [`read`](crate::Reg::read) this register and get [`ctr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ctr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
52pub struct CTR_SPEC;
53impl crate::RegisterSpec for CTR_SPEC {
54    type Ux = u32;
55}
56#[doc = "`read()` method returns [`ctr::R`](R) reader structure"]
57impl crate::Readable for CTR_SPEC {}
58#[doc = "`write(|w| ..)` method takes [`ctr::W`](W) writer structure"]
59impl crate::Writable for CTR_SPEC {
60    type Safety = crate::Unsafe;
61    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
62    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
63}
64#[doc = "`reset()` method sets CTR to value 0"]
65impl crate::Resettable for CTR_SPEC {
66    const RESET_VALUE: u32 = 0;
67}