xmc4800/ecat0/
eep_conf.rs

1#[doc = "Register `EEP_CONF` reader"]
2pub type R = crate::R<EEP_CONF_SPEC>;
3#[doc = "EEPROM control is offered to PDI\n\nValue on reset: 0"]
4#[derive(Clone, Copy, Debug, PartialEq, Eq)]
5pub enum TO_PDI_A {
6    #[doc = "0: No"]
7    VALUE1 = 0,
8    #[doc = "1: Yes (PDI has EEPROM control)"]
9    VALUE2 = 1,
10}
11impl From<TO_PDI_A> for bool {
12    #[inline(always)]
13    fn from(variant: TO_PDI_A) -> Self {
14        variant as u8 != 0
15    }
16}
17#[doc = "Field `TO_PDI` reader - EEPROM control is offered to PDI"]
18pub type TO_PDI_R = crate::BitReader<TO_PDI_A>;
19impl TO_PDI_R {
20    #[doc = "Get enumerated values variant"]
21    #[inline(always)]
22    pub const fn variant(&self) -> TO_PDI_A {
23        match self.bits {
24            false => TO_PDI_A::VALUE1,
25            true => TO_PDI_A::VALUE2,
26        }
27    }
28    #[doc = "No"]
29    #[inline(always)]
30    pub fn is_value1(&self) -> bool {
31        *self == TO_PDI_A::VALUE1
32    }
33    #[doc = "Yes (PDI has EEPROM control)"]
34    #[inline(always)]
35    pub fn is_value2(&self) -> bool {
36        *self == TO_PDI_A::VALUE2
37    }
38}
39#[doc = "Force ECAT access\n\nValue on reset: 0"]
40#[derive(Clone, Copy, Debug, PartialEq, Eq)]
41pub enum FORCE_A {
42    #[doc = "0: Do not change Bit 501.0"]
43    VALUE1 = 0,
44    #[doc = "1: Reset Bit 501.0 to 0"]
45    VALUE2 = 1,
46}
47impl From<FORCE_A> for bool {
48    #[inline(always)]
49    fn from(variant: FORCE_A) -> Self {
50        variant as u8 != 0
51    }
52}
53#[doc = "Field `FORCE` reader - Force ECAT access"]
54pub type FORCE_R = crate::BitReader<FORCE_A>;
55impl FORCE_R {
56    #[doc = "Get enumerated values variant"]
57    #[inline(always)]
58    pub const fn variant(&self) -> FORCE_A {
59        match self.bits {
60            false => FORCE_A::VALUE1,
61            true => FORCE_A::VALUE2,
62        }
63    }
64    #[doc = "Do not change Bit 501.0"]
65    #[inline(always)]
66    pub fn is_value1(&self) -> bool {
67        *self == FORCE_A::VALUE1
68    }
69    #[doc = "Reset Bit 501.0 to 0"]
70    #[inline(always)]
71    pub fn is_value2(&self) -> bool {
72        *self == FORCE_A::VALUE2
73    }
74}
75impl R {
76    #[doc = "Bit 0 - EEPROM control is offered to PDI"]
77    #[inline(always)]
78    pub fn to_pdi(&self) -> TO_PDI_R {
79        TO_PDI_R::new((self.bits & 1) != 0)
80    }
81    #[doc = "Bit 1 - Force ECAT access"]
82    #[inline(always)]
83    pub fn force(&self) -> FORCE_R {
84        FORCE_R::new(((self.bits >> 1) & 1) != 0)
85    }
86}
87#[doc = "EEPROM Configuration\n\nYou can [`read`](crate::Reg::read) this register and get [`eep_conf::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
88pub struct EEP_CONF_SPEC;
89impl crate::RegisterSpec for EEP_CONF_SPEC {
90    type Ux = u8;
91}
92#[doc = "`read()` method returns [`eep_conf::R`](R) reader structure"]
93impl crate::Readable for EEP_CONF_SPEC {}
94#[doc = "`reset()` method sets EEP_CONF to value 0"]
95impl crate::Resettable for EEP_CONF_SPEC {
96    const RESET_VALUE: u8 = 0;
97}