xmc4800/ecat0/
status.rs

1#[doc = "Register `STATUS` reader"]
2pub type R = crate::R<STATUS_SPEC>;
3#[doc = "PARITY ERROR\n\nValue on reset: 0"]
4#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5pub enum PARERR_A {
6    #[doc = "0: No Error"]
7    VALUE1 = 0,
8    #[doc = "1: Parity Error in User or Process RAM"]
9    VALUE2 = 1,
10}
11impl From<PARERR_A> for bool {
12    #[inline(always)]
13    fn from(variant: PARERR_A) -> Self {
14        variant as u8 != 0
15    }
16}
17#[doc = "Field `PARERR` reader - PARITY ERROR"]
18pub type PARERR_R = crate::BitReader<PARERR_A>;
19impl PARERR_R {
20    #[doc = "Get enumerated values variant"]
21    #[inline(always)]
22    pub const fn variant(&self) -> PARERR_A {
23        match self.bits {
24            false => PARERR_A::VALUE1,
25            true => PARERR_A::VALUE2,
26        }
27    }
28    #[doc = "No Error"]
29    #[inline(always)]
30    pub fn is_value1(&self) -> bool {
31        *self == PARERR_A::VALUE1
32    }
33    #[doc = "Parity Error in User or Process RAM"]
34    #[inline(always)]
35    pub fn is_value2(&self) -> bool {
36        *self == PARERR_A::VALUE2
37    }
38}
39impl R {
40    #[doc = "Bit 0 - PARITY ERROR"]
41    #[inline(always)]
42    pub fn parerr(&self) -> PARERR_R {
43        PARERR_R::new((self.bits & 1) != 0)
44    }
45}
46#[doc = "ECAT0 Status\n\nYou can [`read`](crate::Reg::read) this register and get [`status::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
47pub struct STATUS_SPEC;
48impl crate::RegisterSpec for STATUS_SPEC {
49    type Ux = u32;
50}
51#[doc = "`read()` method returns [`status::R`](R) reader structure"]
52impl crate::Readable for STATUS_SPEC {}
53#[doc = "`reset()` method sets STATUS to value 0"]
54impl crate::Resettable for STATUS_SPEC {
55    const RESET_VALUE: u32 = 0;
56}