nrf51_pac/ficr/
overrideen.rs

1#[doc = "Register `OVERRIDEEN` reader"]
2pub struct R(crate::R<OVERRIDEEN_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<OVERRIDEEN_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<OVERRIDEEN_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<OVERRIDEEN_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `NRF_1MBIT` reader - Override default values for NRF_1Mbit mode."]
17pub type NRF_1MBIT_R = crate::BitReader<NRF_1MBIT_A>;
18#[doc = "Override default values for NRF_1Mbit mode.\n\nValue on reset: 1"]
19#[derive(Clone, Copy, Debug, PartialEq)]
20pub enum NRF_1MBIT_A {
21    #[doc = "0: Override the default values for NRF_1Mbit mode."]
22    OVERRIDE = 0,
23    #[doc = "1: Do not override the default values for NRF_1Mbit mode."]
24    NOT_OVERRIDE = 1,
25}
26impl From<NRF_1MBIT_A> for bool {
27    #[inline(always)]
28    fn from(variant: NRF_1MBIT_A) -> Self {
29        variant as u8 != 0
30    }
31}
32impl NRF_1MBIT_R {
33    #[doc = "Get enumerated values variant"]
34    #[inline(always)]
35    pub fn variant(&self) -> NRF_1MBIT_A {
36        match self.bits {
37            false => NRF_1MBIT_A::OVERRIDE,
38            true => NRF_1MBIT_A::NOT_OVERRIDE,
39        }
40    }
41    #[doc = "Checks if the value of the field is `OVERRIDE`"]
42    #[inline(always)]
43    pub fn is_override(&self) -> bool {
44        *self == NRF_1MBIT_A::OVERRIDE
45    }
46    #[doc = "Checks if the value of the field is `NOT_OVERRIDE`"]
47    #[inline(always)]
48    pub fn is_not_override(&self) -> bool {
49        *self == NRF_1MBIT_A::NOT_OVERRIDE
50    }
51}
52#[doc = "Field `BLE_1MBIT` reader - Override default values for BLE_1Mbit mode."]
53pub type BLE_1MBIT_R = crate::BitReader<BLE_1MBIT_A>;
54#[doc = "Override default values for BLE_1Mbit mode.\n\nValue on reset: 1"]
55#[derive(Clone, Copy, Debug, PartialEq)]
56pub enum BLE_1MBIT_A {
57    #[doc = "0: Override the default values for BLE_1Mbit mode."]
58    OVERRIDE = 0,
59    #[doc = "1: Do not override the default values for BLE_1Mbit mode."]
60    NOT_OVERRIDE = 1,
61}
62impl From<BLE_1MBIT_A> for bool {
63    #[inline(always)]
64    fn from(variant: BLE_1MBIT_A) -> Self {
65        variant as u8 != 0
66    }
67}
68impl BLE_1MBIT_R {
69    #[doc = "Get enumerated values variant"]
70    #[inline(always)]
71    pub fn variant(&self) -> BLE_1MBIT_A {
72        match self.bits {
73            false => BLE_1MBIT_A::OVERRIDE,
74            true => BLE_1MBIT_A::NOT_OVERRIDE,
75        }
76    }
77    #[doc = "Checks if the value of the field is `OVERRIDE`"]
78    #[inline(always)]
79    pub fn is_override(&self) -> bool {
80        *self == BLE_1MBIT_A::OVERRIDE
81    }
82    #[doc = "Checks if the value of the field is `NOT_OVERRIDE`"]
83    #[inline(always)]
84    pub fn is_not_override(&self) -> bool {
85        *self == BLE_1MBIT_A::NOT_OVERRIDE
86    }
87}
88impl R {
89    #[doc = "Bit 0 - Override default values for NRF_1Mbit mode."]
90    #[inline(always)]
91    pub fn nrf_1mbit(&self) -> NRF_1MBIT_R {
92        NRF_1MBIT_R::new((self.bits & 1) != 0)
93    }
94    #[doc = "Bit 3 - Override default values for BLE_1Mbit mode."]
95    #[inline(always)]
96    pub fn ble_1mbit(&self) -> BLE_1MBIT_R {
97        BLE_1MBIT_R::new(((self.bits >> 3) & 1) != 0)
98    }
99}
100#[doc = "Radio calibration override enable.\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [overrideen](index.html) module"]
101pub struct OVERRIDEEN_SPEC;
102impl crate::RegisterSpec for OVERRIDEEN_SPEC {
103    type Ux = u32;
104}
105#[doc = "`read()` method returns [overrideen::R](R) reader structure"]
106impl crate::Readable for OVERRIDEEN_SPEC {
107    type Reader = R;
108}
109#[doc = "`reset()` method sets OVERRIDEEN to value 0xffff_ffff"]
110impl crate::Resettable for OVERRIDEEN_SPEC {
111    #[inline(always)]
112    fn reset_value() -> Self::Ux {
113        0xffff_ffff
114    }
115}