#[doc = "Register `VERID` reader"]
pub type R = crate::R<VeridSpec>;
#[doc = "Module Identification Number\n\nValue on reset: 4"]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u16)]
pub enum Feature {
#[doc = "4: Standard feature set supporting a 32-bit shift register."]
Standard = 4,
}
impl From<Feature> for u16 {
#[inline(always)]
fn from(variant: Feature) -> Self {
variant as _
}
}
impl crate::FieldSpec for Feature {
type Ux = u16;
}
impl crate::IsEnum for Feature {}
#[doc = "Field `FEATURE` reader - Module Identification Number"]
pub type FeatureR = crate::FieldReader<Feature>;
impl FeatureR {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub const fn variant(&self) -> Option<Feature> {
match self.bits {
4 => Some(Feature::Standard),
_ => None,
}
}
#[doc = "Standard feature set supporting a 32-bit shift register."]
#[inline(always)]
pub fn is_standard(&self) -> bool {
*self == Feature::Standard
}
}
#[doc = "Field `MINOR` reader - Minor Version Number"]
pub type MinorR = crate::FieldReader;
#[doc = "Field `MAJOR` reader - Major Version Number"]
pub type MajorR = crate::FieldReader;
impl R {
#[doc = "Bits 0:15 - Module Identification Number"]
#[inline(always)]
pub fn feature(&self) -> FeatureR {
FeatureR::new((self.bits & 0xffff) as u16)
}
#[doc = "Bits 16:23 - Minor Version Number"]
#[inline(always)]
pub fn minor(&self) -> MinorR {
MinorR::new(((self.bits >> 16) & 0xff) as u8)
}
#[doc = "Bits 24:31 - Major Version Number"]
#[inline(always)]
pub fn major(&self) -> MajorR {
MajorR::new(((self.bits >> 24) & 0xff) as u8)
}
}
#[cfg(feature = "debug")]
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("VERID")
.field("feature", &self.feature())
.field("minor", &self.minor())
.field("major", &self.major())
.finish()
}
}
#[doc = "Version ID\n\nYou can [`read`](crate::Reg::read) this register and get [`verid::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct VeridSpec;
impl crate::RegisterSpec for VeridSpec {
type Ux = u32;
}
#[doc = "`read()` method returns [`verid::R`](R) reader structure"]
impl crate::Readable for VeridSpec {}
#[doc = "`reset()` method sets VERID to value 0x0200_0004"]
impl crate::Resettable for VeridSpec {
const RESET_VALUE: u32 = 0x0200_0004;
}