efm32pg22-pac 0.1.1

Peripheral access API for EFM32PG22 MCU (generated using svd2rust)
Documentation
#[doc = "Register `SWCAPA0` reader"]
pub struct R(crate::R<SWCAPA0_SPEC>);
impl core::ops::Deref for R {
    type Target = crate::R<SWCAPA0_SPEC>;
    #[inline(always)]
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}
impl From<crate::R<SWCAPA0_SPEC>> for R {
    #[inline(always)]
    fn from(reader: crate::R<SWCAPA0_SPEC>) -> Self {
        R(reader)
    }
}
#[doc = "Zigbee Capability\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum ZIGBEE_A {
    #[doc = "0: Zigbee stack capability not available"]
    LEVEL0 = 0,
    #[doc = "1: Green Power only"]
    LEVEL1 = 1,
    #[doc = "2: Zigbee and Green Power"]
    LEVEL2 = 2,
    #[doc = "3: Zigbee Only"]
    LEVEL3 = 3,
}
impl From<ZIGBEE_A> for u8 {
    #[inline(always)]
    fn from(variant: ZIGBEE_A) -> Self {
        variant as _
    }
}
#[doc = "Field `ZIGBEE` reader - Zigbee Capability"]
pub type ZIGBEE_R = crate::FieldReader<u8, ZIGBEE_A>;
impl ZIGBEE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> ZIGBEE_A {
        match self.bits {
            0 => ZIGBEE_A::LEVEL0,
            1 => ZIGBEE_A::LEVEL1,
            2 => ZIGBEE_A::LEVEL2,
            3 => ZIGBEE_A::LEVEL3,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `LEVEL0`"]
    #[inline(always)]
    pub fn is_level0(&self) -> bool {
        *self == ZIGBEE_A::LEVEL0
    }
    #[doc = "Checks if the value of the field is `LEVEL1`"]
    #[inline(always)]
    pub fn is_level1(&self) -> bool {
        *self == ZIGBEE_A::LEVEL1
    }
    #[doc = "Checks if the value of the field is `LEVEL2`"]
    #[inline(always)]
    pub fn is_level2(&self) -> bool {
        *self == ZIGBEE_A::LEVEL2
    }
    #[doc = "Checks if the value of the field is `LEVEL3`"]
    #[inline(always)]
    pub fn is_level3(&self) -> bool {
        *self == ZIGBEE_A::LEVEL3
    }
}
#[doc = "Thread Capability\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum THREAD_A {
    #[doc = "0: Thread stack capability not available"]
    LEVEL0 = 0,
    #[doc = "1: Thread stack enabled"]
    LEVEL1 = 1,
    #[doc = "2: N/A"]
    LEVEL2 = 2,
    #[doc = "3: N/A"]
    LEVEL3 = 3,
}
impl From<THREAD_A> for u8 {
    #[inline(always)]
    fn from(variant: THREAD_A) -> Self {
        variant as _
    }
}
#[doc = "Field `THREAD` reader - Thread Capability"]
pub type THREAD_R = crate::FieldReader<u8, THREAD_A>;
impl THREAD_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> THREAD_A {
        match self.bits {
            0 => THREAD_A::LEVEL0,
            1 => THREAD_A::LEVEL1,
            2 => THREAD_A::LEVEL2,
            3 => THREAD_A::LEVEL3,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `LEVEL0`"]
    #[inline(always)]
    pub fn is_level0(&self) -> bool {
        *self == THREAD_A::LEVEL0
    }
    #[doc = "Checks if the value of the field is `LEVEL1`"]
    #[inline(always)]
    pub fn is_level1(&self) -> bool {
        *self == THREAD_A::LEVEL1
    }
    #[doc = "Checks if the value of the field is `LEVEL2`"]
    #[inline(always)]
    pub fn is_level2(&self) -> bool {
        *self == THREAD_A::LEVEL2
    }
    #[doc = "Checks if the value of the field is `LEVEL3`"]
    #[inline(always)]
    pub fn is_level3(&self) -> bool {
        *self == THREAD_A::LEVEL3
    }
}
#[doc = "RF4CE Capability\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum RF4CE_A {
    #[doc = "0: RF4CE stack capability not available"]
    LEVEL0 = 0,
    #[doc = "1: RF4CE stack enabled"]
    LEVEL1 = 1,
    #[doc = "2: N/A"]
    LEVEL2 = 2,
    #[doc = "3: N/A"]
    LEVEL3 = 3,
}
impl From<RF4CE_A> for u8 {
    #[inline(always)]
    fn from(variant: RF4CE_A) -> Self {
        variant as _
    }
}
#[doc = "Field `RF4CE` reader - RF4CE Capability"]
pub type RF4CE_R = crate::FieldReader<u8, RF4CE_A>;
impl RF4CE_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> RF4CE_A {
        match self.bits {
            0 => RF4CE_A::LEVEL0,
            1 => RF4CE_A::LEVEL1,
            2 => RF4CE_A::LEVEL2,
            3 => RF4CE_A::LEVEL3,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `LEVEL0`"]
    #[inline(always)]
    pub fn is_level0(&self) -> bool {
        *self == RF4CE_A::LEVEL0
    }
    #[doc = "Checks if the value of the field is `LEVEL1`"]
    #[inline(always)]
    pub fn is_level1(&self) -> bool {
        *self == RF4CE_A::LEVEL1
    }
    #[doc = "Checks if the value of the field is `LEVEL2`"]
    #[inline(always)]
    pub fn is_level2(&self) -> bool {
        *self == RF4CE_A::LEVEL2
    }
    #[doc = "Checks if the value of the field is `LEVEL3`"]
    #[inline(always)]
    pub fn is_level3(&self) -> bool {
        *self == RF4CE_A::LEVEL3
    }
}
#[doc = "Bluetooth Smart Capability\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum BTSMART_A {
    #[doc = "0: Bluetooth SMART stack capability not available"]
    LEVEL0 = 0,
    #[doc = "1: Bluetooth SMART enabled"]
    LEVEL1 = 1,
    #[doc = "2: N/A"]
    LEVEL2 = 2,
    #[doc = "3: N/A"]
    LEVEL3 = 3,
}
impl From<BTSMART_A> for u8 {
    #[inline(always)]
    fn from(variant: BTSMART_A) -> Self {
        variant as _
    }
}
#[doc = "Field `BTSMART` reader - Bluetooth Smart Capability"]
pub type BTSMART_R = crate::FieldReader<u8, BTSMART_A>;
impl BTSMART_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> BTSMART_A {
        match self.bits {
            0 => BTSMART_A::LEVEL0,
            1 => BTSMART_A::LEVEL1,
            2 => BTSMART_A::LEVEL2,
            3 => BTSMART_A::LEVEL3,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `LEVEL0`"]
    #[inline(always)]
    pub fn is_level0(&self) -> bool {
        *self == BTSMART_A::LEVEL0
    }
    #[doc = "Checks if the value of the field is `LEVEL1`"]
    #[inline(always)]
    pub fn is_level1(&self) -> bool {
        *self == BTSMART_A::LEVEL1
    }
    #[doc = "Checks if the value of the field is `LEVEL2`"]
    #[inline(always)]
    pub fn is_level2(&self) -> bool {
        *self == BTSMART_A::LEVEL2
    }
    #[doc = "Checks if the value of the field is `LEVEL3`"]
    #[inline(always)]
    pub fn is_level3(&self) -> bool {
        *self == BTSMART_A::LEVEL3
    }
}
#[doc = "Connect Capability\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum CONNECT_A {
    #[doc = "0: Connect stack capability not available"]
    LEVEL0 = 0,
    #[doc = "1: Connect enabled"]
    LEVEL1 = 1,
    #[doc = "2: N/A"]
    LEVEL2 = 2,
    #[doc = "3: N/A"]
    LEVEL3 = 3,
}
impl From<CONNECT_A> for u8 {
    #[inline(always)]
    fn from(variant: CONNECT_A) -> Self {
        variant as _
    }
}
#[doc = "Field `CONNECT` reader - Connect Capability"]
pub type CONNECT_R = crate::FieldReader<u8, CONNECT_A>;
impl CONNECT_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> CONNECT_A {
        match self.bits {
            0 => CONNECT_A::LEVEL0,
            1 => CONNECT_A::LEVEL1,
            2 => CONNECT_A::LEVEL2,
            3 => CONNECT_A::LEVEL3,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `LEVEL0`"]
    #[inline(always)]
    pub fn is_level0(&self) -> bool {
        *self == CONNECT_A::LEVEL0
    }
    #[doc = "Checks if the value of the field is `LEVEL1`"]
    #[inline(always)]
    pub fn is_level1(&self) -> bool {
        *self == CONNECT_A::LEVEL1
    }
    #[doc = "Checks if the value of the field is `LEVEL2`"]
    #[inline(always)]
    pub fn is_level2(&self) -> bool {
        *self == CONNECT_A::LEVEL2
    }
    #[doc = "Checks if the value of the field is `LEVEL3`"]
    #[inline(always)]
    pub fn is_level3(&self) -> bool {
        *self == CONNECT_A::LEVEL3
    }
}
#[doc = "RAIL Capability\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum SRI_A {
    #[doc = "0: RAIL capability not available"]
    LEVEL0 = 0,
    #[doc = "1: RAIL enabled"]
    LEVEL1 = 1,
    #[doc = "2: N/A"]
    LEVEL2 = 2,
    #[doc = "3: N/A"]
    LEVEL3 = 3,
}
impl From<SRI_A> for u8 {
    #[inline(always)]
    fn from(variant: SRI_A) -> Self {
        variant as _
    }
}
#[doc = "Field `SRI` reader - RAIL Capability"]
pub type SRI_R = crate::FieldReader<u8, SRI_A>;
impl SRI_R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> SRI_A {
        match self.bits {
            0 => SRI_A::LEVEL0,
            1 => SRI_A::LEVEL1,
            2 => SRI_A::LEVEL2,
            3 => SRI_A::LEVEL3,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `LEVEL0`"]
    #[inline(always)]
    pub fn is_level0(&self) -> bool {
        *self == SRI_A::LEVEL0
    }
    #[doc = "Checks if the value of the field is `LEVEL1`"]
    #[inline(always)]
    pub fn is_level1(&self) -> bool {
        *self == SRI_A::LEVEL1
    }
    #[doc = "Checks if the value of the field is `LEVEL2`"]
    #[inline(always)]
    pub fn is_level2(&self) -> bool {
        *self == SRI_A::LEVEL2
    }
    #[doc = "Checks if the value of the field is `LEVEL3`"]
    #[inline(always)]
    pub fn is_level3(&self) -> bool {
        *self == SRI_A::LEVEL3
    }
}
impl R {
    #[doc = "Bits 0:1 - Zigbee Capability"]
    #[inline(always)]
    pub fn zigbee(&self) -> ZIGBEE_R {
        ZIGBEE_R::new((self.bits & 3) as u8)
    }
    #[doc = "Bits 4:5 - Thread Capability"]
    #[inline(always)]
    pub fn thread(&self) -> THREAD_R {
        THREAD_R::new(((self.bits >> 4) & 3) as u8)
    }
    #[doc = "Bits 8:9 - RF4CE Capability"]
    #[inline(always)]
    pub fn rf4ce(&self) -> RF4CE_R {
        RF4CE_R::new(((self.bits >> 8) & 3) as u8)
    }
    #[doc = "Bits 12:13 - Bluetooth Smart Capability"]
    #[inline(always)]
    pub fn btsmart(&self) -> BTSMART_R {
        BTSMART_R::new(((self.bits >> 12) & 3) as u8)
    }
    #[doc = "Bits 16:17 - Connect Capability"]
    #[inline(always)]
    pub fn connect(&self) -> CONNECT_R {
        CONNECT_R::new(((self.bits >> 16) & 3) as u8)
    }
    #[doc = "Bits 20:21 - RAIL Capability"]
    #[inline(always)]
    pub fn sri(&self) -> SRI_R {
        SRI_R::new(((self.bits >> 20) & 3) as u8)
    }
}
#[doc = "Software Capability Vector 0\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 [swcapa0](index.html) module"]
pub struct SWCAPA0_SPEC;
impl crate::RegisterSpec for SWCAPA0_SPEC {
    type Ux = u32;
}
#[doc = "`read()` method returns [swcapa0::R](R) reader structure"]
impl crate::Readable for SWCAPA0_SPEC {
    type Reader = R;
}
#[doc = "`reset()` method sets SWCAPA0 to value 0"]
impl crate::Resettable for SWCAPA0_SPEC {
    #[inline(always)]
    fn reset_value() -> Self::Ux {
        0
    }
}