commit 060cfea26442ceadbee6ee4668a5a55f4647ed6e Author: Thomas Klaehn Date: Fri Jun 4 07:58:05 2021 +0200 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..96ef6c0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/target +Cargo.lock diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..0a5b2a2 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "nrf52" +version = "0.1.0" +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +cortex-m = "0.7.2" +vcell = "0.1.3" diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..597923f --- /dev/null +++ b/build.rs @@ -0,0 +1,16 @@ +use std::env; +use std::fs::File; +use std::io::Write; +use std::path::PathBuf; +fn main() { + if env::var_os("CARGO_FEATURE_RT").is_some() { + let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap()); + File::create(out.join("device.x")) + .unwrap() + .write_all(include_bytes!("device.x")) + .unwrap(); + println!("cargo:rustc-link-search={}", out.display()); + println!("cargo:rerun-if-changed=device.x"); + } + println!("cargo:rerun-if-changed=build.rs"); +} diff --git a/device.x b/device.x new file mode 100644 index 0000000..8b4bb81 --- /dev/null +++ b/device.x @@ -0,0 +1,38 @@ +PROVIDE(POWER_CLOCK = DefaultHandler); +PROVIDE(RADIO = DefaultHandler); +PROVIDE(UARTE0_UART0 = DefaultHandler); +PROVIDE(SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0 = DefaultHandler); +PROVIDE(SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1 = DefaultHandler); +PROVIDE(NFCT = DefaultHandler); +PROVIDE(GPIOTE = DefaultHandler); +PROVIDE(SAADC = DefaultHandler); +PROVIDE(TIMER0 = DefaultHandler); +PROVIDE(TIMER1 = DefaultHandler); +PROVIDE(TIMER2 = DefaultHandler); +PROVIDE(RTC0 = DefaultHandler); +PROVIDE(TEMP = DefaultHandler); +PROVIDE(RNG = DefaultHandler); +PROVIDE(ECB = DefaultHandler); +PROVIDE(CCM_AAR = DefaultHandler); +PROVIDE(WDT = DefaultHandler); +PROVIDE(RTC1 = DefaultHandler); +PROVIDE(QDEC = DefaultHandler); +PROVIDE(COMP_LPCOMP = DefaultHandler); +PROVIDE(SWI0_EGU0 = DefaultHandler); +PROVIDE(SWI1_EGU1 = DefaultHandler); +PROVIDE(SWI2_EGU2 = DefaultHandler); +PROVIDE(SWI3_EGU3 = DefaultHandler); +PROVIDE(SWI4_EGU4 = DefaultHandler); +PROVIDE(SWI5_EGU5 = DefaultHandler); +PROVIDE(TIMER3 = DefaultHandler); +PROVIDE(TIMER4 = DefaultHandler); +PROVIDE(PWM0 = DefaultHandler); +PROVIDE(PDM = DefaultHandler); +PROVIDE(MWU = DefaultHandler); +PROVIDE(PWM1 = DefaultHandler); +PROVIDE(PWM2 = DefaultHandler); +PROVIDE(SPIM2_SPIS2_SPI2 = DefaultHandler); +PROVIDE(RTC2 = DefaultHandler); +PROVIDE(I2S = DefaultHandler); +PROVIDE(FPU = DefaultHandler); + diff --git a/src/aar.rs b/src/aar.rs new file mode 100644 index 0000000..60b7ead --- /dev/null +++ b/src/aar.rs @@ -0,0 +1,88 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "0x00 - Start resolving addresses based on IRKs specified in the IRK data structure"] + pub tasks_start: crate::Reg, + _reserved1: [u8; 0x04], + #[doc = "0x08 - Stop resolving addresses"] + pub tasks_stop: crate::Reg, + _reserved2: [u8; 0xf4], + #[doc = "0x100 - Address resolution procedure complete"] + pub events_end: crate::Reg, + #[doc = "0x104 - Address resolved"] + pub events_resolved: crate::Reg, + #[doc = "0x108 - Address not resolved"] + pub events_notresolved: crate::Reg, + _reserved5: [u8; 0x01f8], + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved7: [u8; 0xf4], + #[doc = "0x400 - Resolution status"] + pub status: crate::Reg, + _reserved8: [u8; 0xfc], + #[doc = "0x500 - Enable AAR"] + pub enable: crate::Reg, + #[doc = "0x504 - Number of IRKs"] + pub nirk: crate::Reg, + #[doc = "0x508 - Pointer to IRK data structure"] + pub irkptr: crate::Reg, + _reserved11: [u8; 0x04], + #[doc = "0x510 - Pointer to the resolvable address"] + pub addrptr: crate::Reg, + #[doc = "0x514 - Pointer to data area used for temporary storage"] + pub scratchptr: crate::Reg, +} +#[doc = "TASKS_START register accessor: an alias for `Reg`"] +pub type TASKS_START = crate::Reg; +#[doc = "Start resolving addresses based on IRKs specified in the IRK data structure"] +pub mod tasks_start; +#[doc = "TASKS_STOP register accessor: an alias for `Reg`"] +pub type TASKS_STOP = crate::Reg; +#[doc = "Stop resolving addresses"] +pub mod tasks_stop; +#[doc = "EVENTS_END register accessor: an alias for `Reg`"] +pub type EVENTS_END = crate::Reg; +#[doc = "Address resolution procedure complete"] +pub mod events_end; +#[doc = "EVENTS_RESOLVED register accessor: an alias for `Reg`"] +pub type EVENTS_RESOLVED = crate::Reg; +#[doc = "Address resolved"] +pub mod events_resolved; +#[doc = "EVENTS_NOTRESOLVED register accessor: an alias for `Reg`"] +pub type EVENTS_NOTRESOLVED = crate::Reg; +#[doc = "Address not resolved"] +pub mod events_notresolved; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "STATUS register accessor: an alias for `Reg`"] +pub type STATUS = crate::Reg; +#[doc = "Resolution status"] +pub mod status; +#[doc = "ENABLE register accessor: an alias for `Reg`"] +pub type ENABLE = crate::Reg; +#[doc = "Enable AAR"] +pub mod enable; +#[doc = "NIRK register accessor: an alias for `Reg`"] +pub type NIRK = crate::Reg; +#[doc = "Number of IRKs"] +pub mod nirk; +#[doc = "IRKPTR register accessor: an alias for `Reg`"] +pub type IRKPTR = crate::Reg; +#[doc = "Pointer to IRK data structure"] +pub mod irkptr; +#[doc = "ADDRPTR register accessor: an alias for `Reg`"] +pub type ADDRPTR = crate::Reg; +#[doc = "Pointer to the resolvable address"] +pub mod addrptr; +#[doc = "SCRATCHPTR register accessor: an alias for `Reg`"] +pub type SCRATCHPTR = crate::Reg; +#[doc = "Pointer to data area used for temporary storage"] +pub mod scratchptr; diff --git a/src/aar/addrptr.rs b/src/aar/addrptr.rs new file mode 100644 index 0000000..571e38b --- /dev/null +++ b/src/aar/addrptr.rs @@ -0,0 +1,102 @@ +#[doc = "Register `ADDRPTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ADDRPTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `ADDRPTR` reader - Pointer to the resolvable address (6-bytes)"] +pub struct ADDRPTR_R(crate::FieldReader); +impl ADDRPTR_R { + pub(crate) fn new(bits: u32) -> Self { + ADDRPTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ADDRPTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ADDRPTR` writer - Pointer to the resolvable address (6-bytes)"] +pub struct ADDRPTR_W<'a> { + w: &'a mut W, +} +impl<'a> ADDRPTR_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Pointer to the resolvable address (6-bytes)"] + #[inline(always)] + pub fn addrptr(&self) -> ADDRPTR_R { + ADDRPTR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Pointer to the resolvable address (6-bytes)"] + #[inline(always)] + pub fn addrptr(&mut self) -> ADDRPTR_W { + ADDRPTR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pointer to the resolvable address\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [addrptr](index.html) module"] +pub struct ADDRPTR_SPEC; +impl crate::RegisterSpec for ADDRPTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [addrptr::R](R) reader structure"] +impl crate::Readable for ADDRPTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [addrptr::W](W) writer structure"] +impl crate::Writable for ADDRPTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ADDRPTR to value 0"] +impl crate::Resettable for ADDRPTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/aar/enable.rs b/src/aar/enable.rs new file mode 100644 index 0000000..3d42050 --- /dev/null +++ b/src/aar/enable.rs @@ -0,0 +1,151 @@ +#[doc = "Register `ENABLE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ENABLE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable AAR\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum ENABLE_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "3: Enable"] + ENABLED = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: ENABLE_A) -> Self { + variant as _ + } +} +#[doc = "Field `ENABLE` reader - Enable or disable AAR"] +pub struct ENABLE_R(crate::FieldReader); +impl ENABLE_R { + pub(crate) fn new(bits: u8) -> Self { + ENABLE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(ENABLE_A::DISABLED), + 3 => Some(ENABLE_A::ENABLED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENABLE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENABLE_A::ENABLED + } +} +impl core::ops::Deref for ENABLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENABLE` writer - Enable or disable AAR"] +pub struct ENABLE_W<'a> { + w: &'a mut W, +} +impl<'a> ENABLE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENABLE_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENABLE_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENABLE_A::ENABLED) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); + self.w + } +} +impl R { + #[doc = "Bits 0:1 - Enable or disable AAR"] + #[inline(always)] + pub fn enable(&self) -> ENABLE_R { + ENABLE_R::new((self.bits & 0x03) as u8) + } +} +impl W { + #[doc = "Bits 0:1 - Enable or disable AAR"] + #[inline(always)] + pub fn enable(&mut self) -> ENABLE_W { + ENABLE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable AAR\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [enable](index.html) module"] +pub struct ENABLE_SPEC; +impl crate::RegisterSpec for ENABLE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [enable::R](R) reader structure"] +impl crate::Readable for ENABLE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [enable::W](W) writer structure"] +impl crate::Writable for ENABLE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ENABLE to value 0"] +impl crate::Resettable for ENABLE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/aar/events_end.rs b/src/aar/events_end.rs new file mode 100644 index 0000000..18366ea --- /dev/null +++ b/src/aar/events_end.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_END` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_END` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Address resolution procedure complete\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_end](index.html) module"] +pub struct EVENTS_END_SPEC; +impl crate::RegisterSpec for EVENTS_END_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_end::R](R) reader structure"] +impl crate::Readable for EVENTS_END_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_end::W](W) writer structure"] +impl crate::Writable for EVENTS_END_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_END to value 0"] +impl crate::Resettable for EVENTS_END_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/aar/events_notresolved.rs b/src/aar/events_notresolved.rs new file mode 100644 index 0000000..f85996a --- /dev/null +++ b/src/aar/events_notresolved.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_NOTRESOLVED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_NOTRESOLVED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Address not resolved\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_notresolved](index.html) module"] +pub struct EVENTS_NOTRESOLVED_SPEC; +impl crate::RegisterSpec for EVENTS_NOTRESOLVED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_notresolved::R](R) reader structure"] +impl crate::Readable for EVENTS_NOTRESOLVED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_notresolved::W](W) writer structure"] +impl crate::Writable for EVENTS_NOTRESOLVED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_NOTRESOLVED to value 0"] +impl crate::Resettable for EVENTS_NOTRESOLVED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/aar/events_resolved.rs b/src/aar/events_resolved.rs new file mode 100644 index 0000000..85bcc4c --- /dev/null +++ b/src/aar/events_resolved.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_RESOLVED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_RESOLVED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Address resolved\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_resolved](index.html) module"] +pub struct EVENTS_RESOLVED_SPEC; +impl crate::RegisterSpec for EVENTS_RESOLVED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_resolved::R](R) reader structure"] +impl crate::Readable for EVENTS_RESOLVED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_resolved::W](W) writer structure"] +impl crate::Writable for EVENTS_RESOLVED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_RESOLVED to value 0"] +impl crate::Resettable for EVENTS_RESOLVED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/aar/intenclr.rs b/src/aar/intenclr.rs new file mode 100644 index 0000000..30a552f --- /dev/null +++ b/src/aar/intenclr.rs @@ -0,0 +1,366 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for END event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END` reader - Write '1' to Disable interrupt for END event"] +pub struct END_R(crate::FieldReader); +impl END_R { + pub(crate) fn new(bits: bool) -> Self { + END_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> END_A { + match self.bits { + false => END_A::DISABLED, + true => END_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == END_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == END_A::ENABLED + } +} +impl core::ops::Deref for END_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for END event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END` writer - Write '1' to Disable interrupt for END event"] +pub struct END_W<'a> { + w: &'a mut W, +} +impl<'a> END_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: END_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(END_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for RESOLVED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RESOLVED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RESOLVED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RESOLVED` reader - Write '1' to Disable interrupt for RESOLVED event"] +pub struct RESOLVED_R(crate::FieldReader); +impl RESOLVED_R { + pub(crate) fn new(bits: bool) -> Self { + RESOLVED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RESOLVED_A { + match self.bits { + false => RESOLVED_A::DISABLED, + true => RESOLVED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RESOLVED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RESOLVED_A::ENABLED + } +} +impl core::ops::Deref for RESOLVED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for RESOLVED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RESOLVED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RESOLVED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RESOLVED` writer - Write '1' to Disable interrupt for RESOLVED event"] +pub struct RESOLVED_W<'a> { + w: &'a mut W, +} +impl<'a> RESOLVED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RESOLVED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(RESOLVED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for NOTRESOLVED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum NOTRESOLVED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: NOTRESOLVED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `NOTRESOLVED` reader - Write '1' to Disable interrupt for NOTRESOLVED event"] +pub struct NOTRESOLVED_R(crate::FieldReader); +impl NOTRESOLVED_R { + pub(crate) fn new(bits: bool) -> Self { + NOTRESOLVED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> NOTRESOLVED_A { + match self.bits { + false => NOTRESOLVED_A::DISABLED, + true => NOTRESOLVED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == NOTRESOLVED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == NOTRESOLVED_A::ENABLED + } +} +impl core::ops::Deref for NOTRESOLVED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for NOTRESOLVED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum NOTRESOLVED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: NOTRESOLVED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `NOTRESOLVED` writer - Write '1' to Disable interrupt for NOTRESOLVED event"] +pub struct NOTRESOLVED_W<'a> { + w: &'a mut W, +} +impl<'a> NOTRESOLVED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: NOTRESOLVED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(NOTRESOLVED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Disable interrupt for END event"] + #[inline(always)] + pub fn end(&self) -> END_R { + END_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for RESOLVED event"] + #[inline(always)] + pub fn resolved(&self) -> RESOLVED_R { + RESOLVED_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for NOTRESOLVED event"] + #[inline(always)] + pub fn notresolved(&self) -> NOTRESOLVED_R { + NOTRESOLVED_R::new(((self.bits >> 2) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Disable interrupt for END event"] + #[inline(always)] + pub fn end(&mut self) -> END_W { + END_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for RESOLVED event"] + #[inline(always)] + pub fn resolved(&mut self) -> RESOLVED_W { + RESOLVED_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for NOTRESOLVED event"] + #[inline(always)] + pub fn notresolved(&mut self) -> NOTRESOLVED_W { + NOTRESOLVED_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/aar/intenset.rs b/src/aar/intenset.rs new file mode 100644 index 0000000..45fa094 --- /dev/null +++ b/src/aar/intenset.rs @@ -0,0 +1,366 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for END event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END` reader - Write '1' to Enable interrupt for END event"] +pub struct END_R(crate::FieldReader); +impl END_R { + pub(crate) fn new(bits: bool) -> Self { + END_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> END_A { + match self.bits { + false => END_A::DISABLED, + true => END_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == END_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == END_A::ENABLED + } +} +impl core::ops::Deref for END_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for END event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END` writer - Write '1' to Enable interrupt for END event"] +pub struct END_W<'a> { + w: &'a mut W, +} +impl<'a> END_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: END_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(END_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for RESOLVED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RESOLVED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RESOLVED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RESOLVED` reader - Write '1' to Enable interrupt for RESOLVED event"] +pub struct RESOLVED_R(crate::FieldReader); +impl RESOLVED_R { + pub(crate) fn new(bits: bool) -> Self { + RESOLVED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RESOLVED_A { + match self.bits { + false => RESOLVED_A::DISABLED, + true => RESOLVED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RESOLVED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RESOLVED_A::ENABLED + } +} +impl core::ops::Deref for RESOLVED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for RESOLVED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RESOLVED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RESOLVED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RESOLVED` writer - Write '1' to Enable interrupt for RESOLVED event"] +pub struct RESOLVED_W<'a> { + w: &'a mut W, +} +impl<'a> RESOLVED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RESOLVED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(RESOLVED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for NOTRESOLVED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum NOTRESOLVED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: NOTRESOLVED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `NOTRESOLVED` reader - Write '1' to Enable interrupt for NOTRESOLVED event"] +pub struct NOTRESOLVED_R(crate::FieldReader); +impl NOTRESOLVED_R { + pub(crate) fn new(bits: bool) -> Self { + NOTRESOLVED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> NOTRESOLVED_A { + match self.bits { + false => NOTRESOLVED_A::DISABLED, + true => NOTRESOLVED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == NOTRESOLVED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == NOTRESOLVED_A::ENABLED + } +} +impl core::ops::Deref for NOTRESOLVED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for NOTRESOLVED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum NOTRESOLVED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: NOTRESOLVED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `NOTRESOLVED` writer - Write '1' to Enable interrupt for NOTRESOLVED event"] +pub struct NOTRESOLVED_W<'a> { + w: &'a mut W, +} +impl<'a> NOTRESOLVED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: NOTRESOLVED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(NOTRESOLVED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Enable interrupt for END event"] + #[inline(always)] + pub fn end(&self) -> END_R { + END_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for RESOLVED event"] + #[inline(always)] + pub fn resolved(&self) -> RESOLVED_R { + RESOLVED_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for NOTRESOLVED event"] + #[inline(always)] + pub fn notresolved(&self) -> NOTRESOLVED_R { + NOTRESOLVED_R::new(((self.bits >> 2) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Enable interrupt for END event"] + #[inline(always)] + pub fn end(&mut self) -> END_W { + END_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for RESOLVED event"] + #[inline(always)] + pub fn resolved(&mut self) -> RESOLVED_W { + RESOLVED_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for NOTRESOLVED event"] + #[inline(always)] + pub fn notresolved(&mut self) -> NOTRESOLVED_W { + NOTRESOLVED_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/aar/irkptr.rs b/src/aar/irkptr.rs new file mode 100644 index 0000000..028f5a3 --- /dev/null +++ b/src/aar/irkptr.rs @@ -0,0 +1,102 @@ +#[doc = "Register `IRKPTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `IRKPTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `IRKPTR` reader - Pointer to the IRK data structure"] +pub struct IRKPTR_R(crate::FieldReader); +impl IRKPTR_R { + pub(crate) fn new(bits: u32) -> Self { + IRKPTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for IRKPTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `IRKPTR` writer - Pointer to the IRK data structure"] +pub struct IRKPTR_W<'a> { + w: &'a mut W, +} +impl<'a> IRKPTR_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Pointer to the IRK data structure"] + #[inline(always)] + pub fn irkptr(&self) -> IRKPTR_R { + IRKPTR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Pointer to the IRK data structure"] + #[inline(always)] + pub fn irkptr(&mut self) -> IRKPTR_W { + IRKPTR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pointer to IRK data structure\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [irkptr](index.html) module"] +pub struct IRKPTR_SPEC; +impl crate::RegisterSpec for IRKPTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [irkptr::R](R) reader structure"] +impl crate::Readable for IRKPTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [irkptr::W](W) writer structure"] +impl crate::Writable for IRKPTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets IRKPTR to value 0"] +impl crate::Resettable for IRKPTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/aar/nirk.rs b/src/aar/nirk.rs new file mode 100644 index 0000000..911501d --- /dev/null +++ b/src/aar/nirk.rs @@ -0,0 +1,102 @@ +#[doc = "Register `NIRK` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NIRK` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `NIRK` reader - Number of Identity root keys available in the IRK data structure"] +pub struct NIRK_R(crate::FieldReader); +impl NIRK_R { + pub(crate) fn new(bits: u8) -> Self { + NIRK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NIRK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NIRK` writer - Number of Identity root keys available in the IRK data structure"] +pub struct NIRK_W<'a> { + w: &'a mut W, +} +impl<'a> NIRK_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Number of Identity root keys available in the IRK data structure"] + #[inline(always)] + pub fn nirk(&self) -> NIRK_R { + NIRK_R::new((self.bits & 0x1f) as u8) + } +} +impl W { + #[doc = "Bits 0:4 - Number of Identity root keys available in the IRK data structure"] + #[inline(always)] + pub fn nirk(&mut self) -> NIRK_W { + NIRK_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Number of IRKs\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nirk](index.html) module"] +pub struct NIRK_SPEC; +impl crate::RegisterSpec for NIRK_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nirk::R](R) reader structure"] +impl crate::Readable for NIRK_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nirk::W](W) writer structure"] +impl crate::Writable for NIRK_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NIRK to value 0x01"] +impl crate::Resettable for NIRK_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x01 + } +} diff --git a/src/aar/scratchptr.rs b/src/aar/scratchptr.rs new file mode 100644 index 0000000..50bcb29 --- /dev/null +++ b/src/aar/scratchptr.rs @@ -0,0 +1,102 @@ +#[doc = "Register `SCRATCHPTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SCRATCHPTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `SCRATCHPTR` reader - Pointer to a scratch data area used for temporary storage during resolution.A space of minimum 3 bytes must be reserved."] +pub struct SCRATCHPTR_R(crate::FieldReader); +impl SCRATCHPTR_R { + pub(crate) fn new(bits: u32) -> Self { + SCRATCHPTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SCRATCHPTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SCRATCHPTR` writer - Pointer to a scratch data area used for temporary storage during resolution.A space of minimum 3 bytes must be reserved."] +pub struct SCRATCHPTR_W<'a> { + w: &'a mut W, +} +impl<'a> SCRATCHPTR_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Pointer to a scratch data area used for temporary storage during resolution.A space of minimum 3 bytes must be reserved."] + #[inline(always)] + pub fn scratchptr(&self) -> SCRATCHPTR_R { + SCRATCHPTR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Pointer to a scratch data area used for temporary storage during resolution.A space of minimum 3 bytes must be reserved."] + #[inline(always)] + pub fn scratchptr(&mut self) -> SCRATCHPTR_W { + SCRATCHPTR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pointer to data area used for temporary storage\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [scratchptr](index.html) module"] +pub struct SCRATCHPTR_SPEC; +impl crate::RegisterSpec for SCRATCHPTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [scratchptr::R](R) reader structure"] +impl crate::Readable for SCRATCHPTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [scratchptr::W](W) writer structure"] +impl crate::Writable for SCRATCHPTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SCRATCHPTR to value 0"] +impl crate::Resettable for SCRATCHPTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/aar/status.rs b/src/aar/status.rs new file mode 100644 index 0000000..5c06810 --- /dev/null +++ b/src/aar/status.rs @@ -0,0 +1,52 @@ +#[doc = "Register `STATUS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `STATUS` reader - The IRK that was used last time an address was resolved"] +pub struct STATUS_R(crate::FieldReader); +impl STATUS_R { + pub(crate) fn new(bits: u8) -> Self { + STATUS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for STATUS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:3 - The IRK that was used last time an address was resolved"] + #[inline(always)] + pub fn status(&self) -> STATUS_R { + STATUS_R::new((self.bits & 0x0f) as u8) + } +} +#[doc = "Resolution status\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 [status](index.html) module"] +pub struct STATUS_SPEC; +impl crate::RegisterSpec for STATUS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [status::R](R) reader structure"] +impl crate::Readable for STATUS_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets STATUS to value 0"] +impl crate::Resettable for STATUS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/aar/tasks_start.rs b/src/aar/tasks_start.rs new file mode 100644 index 0000000..8047892 --- /dev/null +++ b/src/aar/tasks_start.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_START` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start resolving addresses based on IRKs specified in the IRK data structure\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_start](index.html) module"] +pub struct TASKS_START_SPEC; +impl crate::RegisterSpec for TASKS_START_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_start::W](W) writer structure"] +impl crate::Writable for TASKS_START_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_START to value 0"] +impl crate::Resettable for TASKS_START_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/aar/tasks_stop.rs b/src/aar/tasks_stop.rs new file mode 100644 index 0000000..cec6cc9 --- /dev/null +++ b/src/aar/tasks_stop.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STOP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Stop resolving addresses\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_stop](index.html) module"] +pub struct TASKS_STOP_SPEC; +impl crate::RegisterSpec for TASKS_STOP_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_stop::W](W) writer structure"] +impl crate::Writable for TASKS_STOP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STOP to value 0"] +impl crate::Resettable for TASKS_STOP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/approtect.rs b/src/approtect.rs new file mode 100644 index 0000000..753ffce --- /dev/null +++ b/src/approtect.rs @@ -0,0 +1,18 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + _reserved0: [u8; 0x0550], + #[doc = "0x550 - Software force enable APPROTECT mechanism until next reset. This register can only be written once."] + pub forceprotect: crate::Reg, + _reserved1: [u8; 0x04], + #[doc = "0x558 - Software disable APPROTECT mechanism"] + pub disable: crate::Reg, +} +#[doc = "FORCEPROTECT register accessor: an alias for `Reg`"] +pub type FORCEPROTECT = crate::Reg; +#[doc = "Software force enable APPROTECT mechanism until next reset. This register can only be written once."] +pub mod forceprotect; +#[doc = "DISABLE register accessor: an alias for `Reg`"] +pub type DISABLE = crate::Reg; +#[doc = "Software disable APPROTECT mechanism"] +pub mod disable; diff --git a/src/approtect/disable.rs b/src/approtect/disable.rs new file mode 100644 index 0000000..212788e --- /dev/null +++ b/src/approtect/disable.rs @@ -0,0 +1,138 @@ +#[doc = "Register `DISABLE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DISABLE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Software disable APPROTECT mechanism\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum DISABLE_A { + #[doc = "90: Software disable APPROTECT mechanism"] + SWDISABLE = 90, +} +impl From for u8 { + #[inline(always)] + fn from(variant: DISABLE_A) -> Self { + variant as _ + } +} +#[doc = "Field `DISABLE` reader - Software disable APPROTECT mechanism"] +pub struct DISABLE_R(crate::FieldReader); +impl DISABLE_R { + pub(crate) fn new(bits: u8) -> Self { + DISABLE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 90 => Some(DISABLE_A::SWDISABLE), + _ => None, + } + } + #[doc = "Checks if the value of the field is `SWDISABLE`"] + #[inline(always)] + pub fn is_sw_disable(&self) -> bool { + **self == DISABLE_A::SWDISABLE + } +} +impl core::ops::Deref for DISABLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DISABLE` writer - Software disable APPROTECT mechanism"] +pub struct DISABLE_W<'a> { + w: &'a mut W, +} +impl<'a> DISABLE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DISABLE_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Software disable APPROTECT mechanism"] + #[inline(always)] + pub fn sw_disable(self) -> &'a mut W { + self.variant(DISABLE_A::SWDISABLE) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - Software disable APPROTECT mechanism"] + #[inline(always)] + pub fn disable(&self) -> DISABLE_R { + DISABLE_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - Software disable APPROTECT mechanism"] + #[inline(always)] + pub fn disable(&mut self) -> DISABLE_W { + DISABLE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Software disable APPROTECT mechanism\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [disable](index.html) module"] +pub struct DISABLE_SPEC; +impl crate::RegisterSpec for DISABLE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [disable::R](R) reader structure"] +impl crate::Readable for DISABLE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [disable::W](W) writer structure"] +impl crate::Writable for DISABLE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DISABLE to value 0"] +impl crate::Resettable for DISABLE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/approtect/forceprotect.rs b/src/approtect/forceprotect.rs new file mode 100644 index 0000000..c1a46b1 --- /dev/null +++ b/src/approtect/forceprotect.rs @@ -0,0 +1,138 @@ +#[doc = "Register `FORCEPROTECT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `FORCEPROTECT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write 0x0 to force enable APPROTECT mechanism\n\nValue on reset: 255"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum FORCEPROTECT_A { + #[doc = "0: Software force enable APPROTECT mechanism"] + FORCE = 0, +} +impl From for u8 { + #[inline(always)] + fn from(variant: FORCEPROTECT_A) -> Self { + variant as _ + } +} +#[doc = "Field `FORCEPROTECT` reader - Write 0x0 to force enable APPROTECT mechanism"] +pub struct FORCEPROTECT_R(crate::FieldReader); +impl FORCEPROTECT_R { + pub(crate) fn new(bits: u8) -> Self { + FORCEPROTECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(FORCEPROTECT_A::FORCE), + _ => None, + } + } + #[doc = "Checks if the value of the field is `FORCE`"] + #[inline(always)] + pub fn is_force(&self) -> bool { + **self == FORCEPROTECT_A::FORCE + } +} +impl core::ops::Deref for FORCEPROTECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FORCEPROTECT` writer - Write 0x0 to force enable APPROTECT mechanism"] +pub struct FORCEPROTECT_W<'a> { + w: &'a mut W, +} +impl<'a> FORCEPROTECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: FORCEPROTECT_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Software force enable APPROTECT mechanism"] + #[inline(always)] + pub fn force(self) -> &'a mut W { + self.variant(FORCEPROTECT_A::FORCE) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - Write 0x0 to force enable APPROTECT mechanism"] + #[inline(always)] + pub fn forceprotect(&self) -> FORCEPROTECT_R { + FORCEPROTECT_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - Write 0x0 to force enable APPROTECT mechanism"] + #[inline(always)] + pub fn forceprotect(&mut self) -> FORCEPROTECT_W { + FORCEPROTECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Software force enable APPROTECT mechanism until next reset. This register can only be written once.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [forceprotect](index.html) module"] +pub struct FORCEPROTECT_SPEC; +impl crate::RegisterSpec for FORCEPROTECT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [forceprotect::R](R) reader structure"] +impl crate::Readable for FORCEPROTECT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [forceprotect::W](W) writer structure"] +impl crate::Writable for FORCEPROTECT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets FORCEPROTECT to value 0xffff_ffff"] +impl crate::Resettable for FORCEPROTECT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/bprot.rs b/src/bprot.rs new file mode 100644 index 0000000..9d61eeb --- /dev/null +++ b/src/bprot.rs @@ -0,0 +1,41 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + _reserved0: [u8; 0x0600], + #[doc = "0x600 - Block protect configuration register 0"] + pub config0: crate::Reg, + #[doc = "0x604 - Block protect configuration register 1"] + pub config1: crate::Reg, + #[doc = "0x608 - Disable protection mechanism in debug interface mode"] + pub disableindebug: crate::Reg, + #[doc = "0x60c - Unspecified"] + pub unused0: crate::Reg, + #[doc = "0x610 - Block protect configuration register 2"] + pub config2: crate::Reg, + #[doc = "0x614 - Block protect configuration register 3"] + pub config3: crate::Reg, +} +#[doc = "CONFIG0 register accessor: an alias for `Reg`"] +pub type CONFIG0 = crate::Reg; +#[doc = "Block protect configuration register 0"] +pub mod config0; +#[doc = "CONFIG1 register accessor: an alias for `Reg`"] +pub type CONFIG1 = crate::Reg; +#[doc = "Block protect configuration register 1"] +pub mod config1; +#[doc = "DISABLEINDEBUG register accessor: an alias for `Reg`"] +pub type DISABLEINDEBUG = crate::Reg; +#[doc = "Disable protection mechanism in debug interface mode"] +pub mod disableindebug; +#[doc = "UNUSED0 register accessor: an alias for `Reg`"] +pub type UNUSED0 = crate::Reg; +#[doc = "Unspecified"] +pub mod unused0; +#[doc = "CONFIG2 register accessor: an alias for `Reg`"] +pub type CONFIG2 = crate::Reg; +#[doc = "Block protect configuration register 2"] +pub mod config2; +#[doc = "CONFIG3 register accessor: an alias for `Reg`"] +pub type CONFIG3 = crate::Reg; +#[doc = "Block protect configuration register 3"] +pub mod config3; diff --git a/src/bprot/config0.rs b/src/bprot/config0.rs new file mode 100644 index 0000000..f193e2d --- /dev/null +++ b/src/bprot/config0.rs @@ -0,0 +1,3042 @@ +#[doc = "Register `CONFIG0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CONFIG0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable protection for region 0. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION0_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION0` reader - Enable protection for region 0. Write '0' has no effect."] +pub struct REGION0_R(crate::FieldReader); +impl REGION0_R { + pub(crate) fn new(bits: bool) -> Self { + REGION0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION0_A { + match self.bits { + false => REGION0_A::DISABLED, + true => REGION0_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION0_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION0_A::ENABLED + } +} +impl core::ops::Deref for REGION0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION0` writer - Enable protection for region 0. Write '0' has no effect."] +pub struct REGION0_W<'a> { + w: &'a mut W, +} +impl<'a> REGION0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION0_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION0_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION0_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Enable protection for region 1. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION1_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION1` reader - Enable protection for region 1. Write '0' has no effect."] +pub struct REGION1_R(crate::FieldReader); +impl REGION1_R { + pub(crate) fn new(bits: bool) -> Self { + REGION1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION1_A { + match self.bits { + false => REGION1_A::DISABLED, + true => REGION1_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION1_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION1_A::ENABLED + } +} +impl core::ops::Deref for REGION1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION1` writer - Enable protection for region 1. Write '0' has no effect."] +pub struct REGION1_W<'a> { + w: &'a mut W, +} +impl<'a> REGION1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION1_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION1_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION1_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Enable protection for region 2. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION2_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION2` reader - Enable protection for region 2. Write '0' has no effect."] +pub struct REGION2_R(crate::FieldReader); +impl REGION2_R { + pub(crate) fn new(bits: bool) -> Self { + REGION2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION2_A { + match self.bits { + false => REGION2_A::DISABLED, + true => REGION2_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION2_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION2_A::ENABLED + } +} +impl core::ops::Deref for REGION2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION2` writer - Enable protection for region 2. Write '0' has no effect."] +pub struct REGION2_W<'a> { + w: &'a mut W, +} +impl<'a> REGION2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION2_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION2_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION2_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Enable protection for region 3. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION3_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION3` reader - Enable protection for region 3. Write '0' has no effect."] +pub struct REGION3_R(crate::FieldReader); +impl REGION3_R { + pub(crate) fn new(bits: bool) -> Self { + REGION3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION3_A { + match self.bits { + false => REGION3_A::DISABLED, + true => REGION3_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION3_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION3_A::ENABLED + } +} +impl core::ops::Deref for REGION3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION3` writer - Enable protection for region 3. Write '0' has no effect."] +pub struct REGION3_W<'a> { + w: &'a mut W, +} +impl<'a> REGION3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION3_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION3_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION3_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Enable protection for region 4. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION4_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION4_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION4` reader - Enable protection for region 4. Write '0' has no effect."] +pub struct REGION4_R(crate::FieldReader); +impl REGION4_R { + pub(crate) fn new(bits: bool) -> Self { + REGION4_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION4_A { + match self.bits { + false => REGION4_A::DISABLED, + true => REGION4_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION4_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION4_A::ENABLED + } +} +impl core::ops::Deref for REGION4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION4` writer - Enable protection for region 4. Write '0' has no effect."] +pub struct REGION4_W<'a> { + w: &'a mut W, +} +impl<'a> REGION4_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION4_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION4_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION4_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Enable protection for region 5. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION5_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION5_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION5` reader - Enable protection for region 5. Write '0' has no effect."] +pub struct REGION5_R(crate::FieldReader); +impl REGION5_R { + pub(crate) fn new(bits: bool) -> Self { + REGION5_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION5_A { + match self.bits { + false => REGION5_A::DISABLED, + true => REGION5_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION5_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION5_A::ENABLED + } +} +impl core::ops::Deref for REGION5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION5` writer - Enable protection for region 5. Write '0' has no effect."] +pub struct REGION5_W<'a> { + w: &'a mut W, +} +impl<'a> REGION5_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION5_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION5_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION5_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Enable protection for region 6. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION6_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION6_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION6` reader - Enable protection for region 6. Write '0' has no effect."] +pub struct REGION6_R(crate::FieldReader); +impl REGION6_R { + pub(crate) fn new(bits: bool) -> Self { + REGION6_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION6_A { + match self.bits { + false => REGION6_A::DISABLED, + true => REGION6_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION6_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION6_A::ENABLED + } +} +impl core::ops::Deref for REGION6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION6` writer - Enable protection for region 6. Write '0' has no effect."] +pub struct REGION6_W<'a> { + w: &'a mut W, +} +impl<'a> REGION6_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION6_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION6_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION6_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Enable protection for region 7. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION7_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION7_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION7` reader - Enable protection for region 7. Write '0' has no effect."] +pub struct REGION7_R(crate::FieldReader); +impl REGION7_R { + pub(crate) fn new(bits: bool) -> Self { + REGION7_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION7_A { + match self.bits { + false => REGION7_A::DISABLED, + true => REGION7_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION7_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION7_A::ENABLED + } +} +impl core::ops::Deref for REGION7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION7` writer - Enable protection for region 7. Write '0' has no effect."] +pub struct REGION7_W<'a> { + w: &'a mut W, +} +impl<'a> REGION7_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION7_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION7_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION7_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Enable protection for region 8. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION8_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION8_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION8` reader - Enable protection for region 8. Write '0' has no effect."] +pub struct REGION8_R(crate::FieldReader); +impl REGION8_R { + pub(crate) fn new(bits: bool) -> Self { + REGION8_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION8_A { + match self.bits { + false => REGION8_A::DISABLED, + true => REGION8_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION8_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION8_A::ENABLED + } +} +impl core::ops::Deref for REGION8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION8` writer - Enable protection for region 8. Write '0' has no effect."] +pub struct REGION8_W<'a> { + w: &'a mut W, +} +impl<'a> REGION8_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION8_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION8_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION8_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Enable protection for region 9. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION9_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION9_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION9` reader - Enable protection for region 9. Write '0' has no effect."] +pub struct REGION9_R(crate::FieldReader); +impl REGION9_R { + pub(crate) fn new(bits: bool) -> Self { + REGION9_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION9_A { + match self.bits { + false => REGION9_A::DISABLED, + true => REGION9_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION9_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION9_A::ENABLED + } +} +impl core::ops::Deref for REGION9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION9` writer - Enable protection for region 9. Write '0' has no effect."] +pub struct REGION9_W<'a> { + w: &'a mut W, +} +impl<'a> REGION9_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION9_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION9_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION9_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Enable protection for region 10. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION10_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION10_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION10` reader - Enable protection for region 10. Write '0' has no effect."] +pub struct REGION10_R(crate::FieldReader); +impl REGION10_R { + pub(crate) fn new(bits: bool) -> Self { + REGION10_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION10_A { + match self.bits { + false => REGION10_A::DISABLED, + true => REGION10_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION10_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION10_A::ENABLED + } +} +impl core::ops::Deref for REGION10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION10` writer - Enable protection for region 10. Write '0' has no effect."] +pub struct REGION10_W<'a> { + w: &'a mut W, +} +impl<'a> REGION10_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION10_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION10_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION10_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Enable protection for region 11. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION11_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION11_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION11` reader - Enable protection for region 11. Write '0' has no effect."] +pub struct REGION11_R(crate::FieldReader); +impl REGION11_R { + pub(crate) fn new(bits: bool) -> Self { + REGION11_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION11_A { + match self.bits { + false => REGION11_A::DISABLED, + true => REGION11_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION11_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION11_A::ENABLED + } +} +impl core::ops::Deref for REGION11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION11` writer - Enable protection for region 11. Write '0' has no effect."] +pub struct REGION11_W<'a> { + w: &'a mut W, +} +impl<'a> REGION11_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION11_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION11_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION11_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Enable protection for region 12. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION12_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION12_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION12` reader - Enable protection for region 12. Write '0' has no effect."] +pub struct REGION12_R(crate::FieldReader); +impl REGION12_R { + pub(crate) fn new(bits: bool) -> Self { + REGION12_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION12_A { + match self.bits { + false => REGION12_A::DISABLED, + true => REGION12_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION12_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION12_A::ENABLED + } +} +impl core::ops::Deref for REGION12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION12` writer - Enable protection for region 12. Write '0' has no effect."] +pub struct REGION12_W<'a> { + w: &'a mut W, +} +impl<'a> REGION12_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION12_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION12_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION12_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Enable protection for region 13. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION13_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION13_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION13` reader - Enable protection for region 13. Write '0' has no effect."] +pub struct REGION13_R(crate::FieldReader); +impl REGION13_R { + pub(crate) fn new(bits: bool) -> Self { + REGION13_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION13_A { + match self.bits { + false => REGION13_A::DISABLED, + true => REGION13_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION13_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION13_A::ENABLED + } +} +impl core::ops::Deref for REGION13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION13` writer - Enable protection for region 13. Write '0' has no effect."] +pub struct REGION13_W<'a> { + w: &'a mut W, +} +impl<'a> REGION13_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION13_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION13_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION13_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Enable protection for region 14. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION14_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION14_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION14` reader - Enable protection for region 14. Write '0' has no effect."] +pub struct REGION14_R(crate::FieldReader); +impl REGION14_R { + pub(crate) fn new(bits: bool) -> Self { + REGION14_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION14_A { + match self.bits { + false => REGION14_A::DISABLED, + true => REGION14_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION14_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION14_A::ENABLED + } +} +impl core::ops::Deref for REGION14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION14` writer - Enable protection for region 14. Write '0' has no effect."] +pub struct REGION14_W<'a> { + w: &'a mut W, +} +impl<'a> REGION14_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION14_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION14_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION14_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Enable protection for region 15. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION15_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION15_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION15` reader - Enable protection for region 15. Write '0' has no effect."] +pub struct REGION15_R(crate::FieldReader); +impl REGION15_R { + pub(crate) fn new(bits: bool) -> Self { + REGION15_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION15_A { + match self.bits { + false => REGION15_A::DISABLED, + true => REGION15_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION15_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION15_A::ENABLED + } +} +impl core::ops::Deref for REGION15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION15` writer - Enable protection for region 15. Write '0' has no effect."] +pub struct REGION15_W<'a> { + w: &'a mut W, +} +impl<'a> REGION15_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION15_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION15_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION15_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Enable protection for region 16. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION16_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION16_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION16` reader - Enable protection for region 16. Write '0' has no effect."] +pub struct REGION16_R(crate::FieldReader); +impl REGION16_R { + pub(crate) fn new(bits: bool) -> Self { + REGION16_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION16_A { + match self.bits { + false => REGION16_A::DISABLED, + true => REGION16_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION16_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION16_A::ENABLED + } +} +impl core::ops::Deref for REGION16_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION16` writer - Enable protection for region 16. Write '0' has no effect."] +pub struct REGION16_W<'a> { + w: &'a mut W, +} +impl<'a> REGION16_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION16_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION16_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION16_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Enable protection for region 17. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION17_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION17_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION17` reader - Enable protection for region 17. Write '0' has no effect."] +pub struct REGION17_R(crate::FieldReader); +impl REGION17_R { + pub(crate) fn new(bits: bool) -> Self { + REGION17_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION17_A { + match self.bits { + false => REGION17_A::DISABLED, + true => REGION17_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION17_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION17_A::ENABLED + } +} +impl core::ops::Deref for REGION17_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION17` writer - Enable protection for region 17. Write '0' has no effect."] +pub struct REGION17_W<'a> { + w: &'a mut W, +} +impl<'a> REGION17_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION17_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION17_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION17_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Enable protection for region 18. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION18_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION18_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION18` reader - Enable protection for region 18. Write '0' has no effect."] +pub struct REGION18_R(crate::FieldReader); +impl REGION18_R { + pub(crate) fn new(bits: bool) -> Self { + REGION18_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION18_A { + match self.bits { + false => REGION18_A::DISABLED, + true => REGION18_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION18_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION18_A::ENABLED + } +} +impl core::ops::Deref for REGION18_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION18` writer - Enable protection for region 18. Write '0' has no effect."] +pub struct REGION18_W<'a> { + w: &'a mut W, +} +impl<'a> REGION18_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION18_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION18_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION18_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Enable protection for region 19. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION19_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION19_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION19` reader - Enable protection for region 19. Write '0' has no effect."] +pub struct REGION19_R(crate::FieldReader); +impl REGION19_R { + pub(crate) fn new(bits: bool) -> Self { + REGION19_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION19_A { + match self.bits { + false => REGION19_A::DISABLED, + true => REGION19_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION19_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION19_A::ENABLED + } +} +impl core::ops::Deref for REGION19_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION19` writer - Enable protection for region 19. Write '0' has no effect."] +pub struct REGION19_W<'a> { + w: &'a mut W, +} +impl<'a> REGION19_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION19_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION19_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION19_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Enable protection for region 20. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION20_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION20_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION20` reader - Enable protection for region 20. Write '0' has no effect."] +pub struct REGION20_R(crate::FieldReader); +impl REGION20_R { + pub(crate) fn new(bits: bool) -> Self { + REGION20_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION20_A { + match self.bits { + false => REGION20_A::DISABLED, + true => REGION20_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION20_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION20_A::ENABLED + } +} +impl core::ops::Deref for REGION20_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION20` writer - Enable protection for region 20. Write '0' has no effect."] +pub struct REGION20_W<'a> { + w: &'a mut W, +} +impl<'a> REGION20_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION20_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION20_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION20_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Enable protection for region 21. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION21_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION21_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION21` reader - Enable protection for region 21. Write '0' has no effect."] +pub struct REGION21_R(crate::FieldReader); +impl REGION21_R { + pub(crate) fn new(bits: bool) -> Self { + REGION21_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION21_A { + match self.bits { + false => REGION21_A::DISABLED, + true => REGION21_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION21_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION21_A::ENABLED + } +} +impl core::ops::Deref for REGION21_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION21` writer - Enable protection for region 21. Write '0' has no effect."] +pub struct REGION21_W<'a> { + w: &'a mut W, +} +impl<'a> REGION21_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION21_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION21_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION21_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); + self.w + } +} +#[doc = "Enable protection for region 22. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION22_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION22_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION22` reader - Enable protection for region 22. Write '0' has no effect."] +pub struct REGION22_R(crate::FieldReader); +impl REGION22_R { + pub(crate) fn new(bits: bool) -> Self { + REGION22_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION22_A { + match self.bits { + false => REGION22_A::DISABLED, + true => REGION22_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION22_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION22_A::ENABLED + } +} +impl core::ops::Deref for REGION22_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION22` writer - Enable protection for region 22. Write '0' has no effect."] +pub struct REGION22_W<'a> { + w: &'a mut W, +} +impl<'a> REGION22_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION22_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION22_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION22_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); + self.w + } +} +#[doc = "Enable protection for region 23. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION23_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION23_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION23` reader - Enable protection for region 23. Write '0' has no effect."] +pub struct REGION23_R(crate::FieldReader); +impl REGION23_R { + pub(crate) fn new(bits: bool) -> Self { + REGION23_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION23_A { + match self.bits { + false => REGION23_A::DISABLED, + true => REGION23_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION23_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION23_A::ENABLED + } +} +impl core::ops::Deref for REGION23_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION23` writer - Enable protection for region 23. Write '0' has no effect."] +pub struct REGION23_W<'a> { + w: &'a mut W, +} +impl<'a> REGION23_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION23_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION23_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION23_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); + self.w + } +} +#[doc = "Enable protection for region 24. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION24_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION24_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION24` reader - Enable protection for region 24. Write '0' has no effect."] +pub struct REGION24_R(crate::FieldReader); +impl REGION24_R { + pub(crate) fn new(bits: bool) -> Self { + REGION24_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION24_A { + match self.bits { + false => REGION24_A::DISABLED, + true => REGION24_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION24_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION24_A::ENABLED + } +} +impl core::ops::Deref for REGION24_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION24` writer - Enable protection for region 24. Write '0' has no effect."] +pub struct REGION24_W<'a> { + w: &'a mut W, +} +impl<'a> REGION24_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION24_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION24_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION24_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Enable protection for region 25. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION25_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION25_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION25` reader - Enable protection for region 25. Write '0' has no effect."] +pub struct REGION25_R(crate::FieldReader); +impl REGION25_R { + pub(crate) fn new(bits: bool) -> Self { + REGION25_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION25_A { + match self.bits { + false => REGION25_A::DISABLED, + true => REGION25_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION25_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION25_A::ENABLED + } +} +impl core::ops::Deref for REGION25_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION25` writer - Enable protection for region 25. Write '0' has no effect."] +pub struct REGION25_W<'a> { + w: &'a mut W, +} +impl<'a> REGION25_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION25_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION25_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION25_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Enable protection for region 26. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION26_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION26_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION26` reader - Enable protection for region 26. Write '0' has no effect."] +pub struct REGION26_R(crate::FieldReader); +impl REGION26_R { + pub(crate) fn new(bits: bool) -> Self { + REGION26_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION26_A { + match self.bits { + false => REGION26_A::DISABLED, + true => REGION26_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION26_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION26_A::ENABLED + } +} +impl core::ops::Deref for REGION26_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION26` writer - Enable protection for region 26. Write '0' has no effect."] +pub struct REGION26_W<'a> { + w: &'a mut W, +} +impl<'a> REGION26_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION26_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION26_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION26_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Enable protection for region 27. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION27_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION27_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION27` reader - Enable protection for region 27. Write '0' has no effect."] +pub struct REGION27_R(crate::FieldReader); +impl REGION27_R { + pub(crate) fn new(bits: bool) -> Self { + REGION27_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION27_A { + match self.bits { + false => REGION27_A::DISABLED, + true => REGION27_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION27_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION27_A::ENABLED + } +} +impl core::ops::Deref for REGION27_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION27` writer - Enable protection for region 27. Write '0' has no effect."] +pub struct REGION27_W<'a> { + w: &'a mut W, +} +impl<'a> REGION27_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION27_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION27_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION27_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +#[doc = "Enable protection for region 28. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION28_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION28_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION28` reader - Enable protection for region 28. Write '0' has no effect."] +pub struct REGION28_R(crate::FieldReader); +impl REGION28_R { + pub(crate) fn new(bits: bool) -> Self { + REGION28_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION28_A { + match self.bits { + false => REGION28_A::DISABLED, + true => REGION28_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION28_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION28_A::ENABLED + } +} +impl core::ops::Deref for REGION28_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION28` writer - Enable protection for region 28. Write '0' has no effect."] +pub struct REGION28_W<'a> { + w: &'a mut W, +} +impl<'a> REGION28_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION28_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION28_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION28_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); + self.w + } +} +#[doc = "Enable protection for region 29. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION29_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION29_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION29` reader - Enable protection for region 29. Write '0' has no effect."] +pub struct REGION29_R(crate::FieldReader); +impl REGION29_R { + pub(crate) fn new(bits: bool) -> Self { + REGION29_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION29_A { + match self.bits { + false => REGION29_A::DISABLED, + true => REGION29_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION29_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION29_A::ENABLED + } +} +impl core::ops::Deref for REGION29_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION29` writer - Enable protection for region 29. Write '0' has no effect."] +pub struct REGION29_W<'a> { + w: &'a mut W, +} +impl<'a> REGION29_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION29_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION29_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION29_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); + self.w + } +} +#[doc = "Enable protection for region 30. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION30_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION30_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION30` reader - Enable protection for region 30. Write '0' has no effect."] +pub struct REGION30_R(crate::FieldReader); +impl REGION30_R { + pub(crate) fn new(bits: bool) -> Self { + REGION30_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION30_A { + match self.bits { + false => REGION30_A::DISABLED, + true => REGION30_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION30_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION30_A::ENABLED + } +} +impl core::ops::Deref for REGION30_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION30` writer - Enable protection for region 30. Write '0' has no effect."] +pub struct REGION30_W<'a> { + w: &'a mut W, +} +impl<'a> REGION30_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION30_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION30_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION30_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); + self.w + } +} +#[doc = "Enable protection for region 31. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION31_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION31_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION31` reader - Enable protection for region 31. Write '0' has no effect."] +pub struct REGION31_R(crate::FieldReader); +impl REGION31_R { + pub(crate) fn new(bits: bool) -> Self { + REGION31_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION31_A { + match self.bits { + false => REGION31_A::DISABLED, + true => REGION31_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION31_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION31_A::ENABLED + } +} +impl core::ops::Deref for REGION31_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION31` writer - Enable protection for region 31. Write '0' has no effect."] +pub struct REGION31_W<'a> { + w: &'a mut W, +} +impl<'a> REGION31_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION31_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION31_A::DISABLED) + } + #[doc = "Protection enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION31_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable protection for region 0. Write '0' has no effect."] + #[inline(always)] + pub fn region0(&self) -> REGION0_R { + REGION0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Enable protection for region 1. Write '0' has no effect."] + #[inline(always)] + pub fn region1(&self) -> REGION1_R { + REGION1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Enable protection for region 2. Write '0' has no effect."] + #[inline(always)] + pub fn region2(&self) -> REGION2_R { + REGION2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Enable protection for region 3. Write '0' has no effect."] + #[inline(always)] + pub fn region3(&self) -> REGION3_R { + REGION3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Enable protection for region 4. Write '0' has no effect."] + #[inline(always)] + pub fn region4(&self) -> REGION4_R { + REGION4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Enable protection for region 5. Write '0' has no effect."] + #[inline(always)] + pub fn region5(&self) -> REGION5_R { + REGION5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Enable protection for region 6. Write '0' has no effect."] + #[inline(always)] + pub fn region6(&self) -> REGION6_R { + REGION6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Enable protection for region 7. Write '0' has no effect."] + #[inline(always)] + pub fn region7(&self) -> REGION7_R { + REGION7_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Enable protection for region 8. Write '0' has no effect."] + #[inline(always)] + pub fn region8(&self) -> REGION8_R { + REGION8_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Enable protection for region 9. Write '0' has no effect."] + #[inline(always)] + pub fn region9(&self) -> REGION9_R { + REGION9_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Enable protection for region 10. Write '0' has no effect."] + #[inline(always)] + pub fn region10(&self) -> REGION10_R { + REGION10_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Enable protection for region 11. Write '0' has no effect."] + #[inline(always)] + pub fn region11(&self) -> REGION11_R { + REGION11_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Enable protection for region 12. Write '0' has no effect."] + #[inline(always)] + pub fn region12(&self) -> REGION12_R { + REGION12_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Enable protection for region 13. Write '0' has no effect."] + #[inline(always)] + pub fn region13(&self) -> REGION13_R { + REGION13_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Enable protection for region 14. Write '0' has no effect."] + #[inline(always)] + pub fn region14(&self) -> REGION14_R { + REGION14_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Enable protection for region 15. Write '0' has no effect."] + #[inline(always)] + pub fn region15(&self) -> REGION15_R { + REGION15_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Enable protection for region 16. Write '0' has no effect."] + #[inline(always)] + pub fn region16(&self) -> REGION16_R { + REGION16_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Enable protection for region 17. Write '0' has no effect."] + #[inline(always)] + pub fn region17(&self) -> REGION17_R { + REGION17_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Enable protection for region 18. Write '0' has no effect."] + #[inline(always)] + pub fn region18(&self) -> REGION18_R { + REGION18_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Enable protection for region 19. Write '0' has no effect."] + #[inline(always)] + pub fn region19(&self) -> REGION19_R { + REGION19_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Enable protection for region 20. Write '0' has no effect."] + #[inline(always)] + pub fn region20(&self) -> REGION20_R { + REGION20_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 21 - Enable protection for region 21. Write '0' has no effect."] + #[inline(always)] + pub fn region21(&self) -> REGION21_R { + REGION21_R::new(((self.bits >> 21) & 0x01) != 0) + } + #[doc = "Bit 22 - Enable protection for region 22. Write '0' has no effect."] + #[inline(always)] + pub fn region22(&self) -> REGION22_R { + REGION22_R::new(((self.bits >> 22) & 0x01) != 0) + } + #[doc = "Bit 23 - Enable protection for region 23. Write '0' has no effect."] + #[inline(always)] + pub fn region23(&self) -> REGION23_R { + REGION23_R::new(((self.bits >> 23) & 0x01) != 0) + } + #[doc = "Bit 24 - Enable protection for region 24. Write '0' has no effect."] + #[inline(always)] + pub fn region24(&self) -> REGION24_R { + REGION24_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Enable protection for region 25. Write '0' has no effect."] + #[inline(always)] + pub fn region25(&self) -> REGION25_R { + REGION25_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Enable protection for region 26. Write '0' has no effect."] + #[inline(always)] + pub fn region26(&self) -> REGION26_R { + REGION26_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Enable protection for region 27. Write '0' has no effect."] + #[inline(always)] + pub fn region27(&self) -> REGION27_R { + REGION27_R::new(((self.bits >> 27) & 0x01) != 0) + } + #[doc = "Bit 28 - Enable protection for region 28. Write '0' has no effect."] + #[inline(always)] + pub fn region28(&self) -> REGION28_R { + REGION28_R::new(((self.bits >> 28) & 0x01) != 0) + } + #[doc = "Bit 29 - Enable protection for region 29. Write '0' has no effect."] + #[inline(always)] + pub fn region29(&self) -> REGION29_R { + REGION29_R::new(((self.bits >> 29) & 0x01) != 0) + } + #[doc = "Bit 30 - Enable protection for region 30. Write '0' has no effect."] + #[inline(always)] + pub fn region30(&self) -> REGION30_R { + REGION30_R::new(((self.bits >> 30) & 0x01) != 0) + } + #[doc = "Bit 31 - Enable protection for region 31. Write '0' has no effect."] + #[inline(always)] + pub fn region31(&self) -> REGION31_R { + REGION31_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Enable protection for region 0. Write '0' has no effect."] + #[inline(always)] + pub fn region0(&mut self) -> REGION0_W { + REGION0_W { w: self } + } + #[doc = "Bit 1 - Enable protection for region 1. Write '0' has no effect."] + #[inline(always)] + pub fn region1(&mut self) -> REGION1_W { + REGION1_W { w: self } + } + #[doc = "Bit 2 - Enable protection for region 2. Write '0' has no effect."] + #[inline(always)] + pub fn region2(&mut self) -> REGION2_W { + REGION2_W { w: self } + } + #[doc = "Bit 3 - Enable protection for region 3. Write '0' has no effect."] + #[inline(always)] + pub fn region3(&mut self) -> REGION3_W { + REGION3_W { w: self } + } + #[doc = "Bit 4 - Enable protection for region 4. Write '0' has no effect."] + #[inline(always)] + pub fn region4(&mut self) -> REGION4_W { + REGION4_W { w: self } + } + #[doc = "Bit 5 - Enable protection for region 5. Write '0' has no effect."] + #[inline(always)] + pub fn region5(&mut self) -> REGION5_W { + REGION5_W { w: self } + } + #[doc = "Bit 6 - Enable protection for region 6. Write '0' has no effect."] + #[inline(always)] + pub fn region6(&mut self) -> REGION6_W { + REGION6_W { w: self } + } + #[doc = "Bit 7 - Enable protection for region 7. Write '0' has no effect."] + #[inline(always)] + pub fn region7(&mut self) -> REGION7_W { + REGION7_W { w: self } + } + #[doc = "Bit 8 - Enable protection for region 8. Write '0' has no effect."] + #[inline(always)] + pub fn region8(&mut self) -> REGION8_W { + REGION8_W { w: self } + } + #[doc = "Bit 9 - Enable protection for region 9. Write '0' has no effect."] + #[inline(always)] + pub fn region9(&mut self) -> REGION9_W { + REGION9_W { w: self } + } + #[doc = "Bit 10 - Enable protection for region 10. Write '0' has no effect."] + #[inline(always)] + pub fn region10(&mut self) -> REGION10_W { + REGION10_W { w: self } + } + #[doc = "Bit 11 - Enable protection for region 11. Write '0' has no effect."] + #[inline(always)] + pub fn region11(&mut self) -> REGION11_W { + REGION11_W { w: self } + } + #[doc = "Bit 12 - Enable protection for region 12. Write '0' has no effect."] + #[inline(always)] + pub fn region12(&mut self) -> REGION12_W { + REGION12_W { w: self } + } + #[doc = "Bit 13 - Enable protection for region 13. Write '0' has no effect."] + #[inline(always)] + pub fn region13(&mut self) -> REGION13_W { + REGION13_W { w: self } + } + #[doc = "Bit 14 - Enable protection for region 14. Write '0' has no effect."] + #[inline(always)] + pub fn region14(&mut self) -> REGION14_W { + REGION14_W { w: self } + } + #[doc = "Bit 15 - Enable protection for region 15. Write '0' has no effect."] + #[inline(always)] + pub fn region15(&mut self) -> REGION15_W { + REGION15_W { w: self } + } + #[doc = "Bit 16 - Enable protection for region 16. Write '0' has no effect."] + #[inline(always)] + pub fn region16(&mut self) -> REGION16_W { + REGION16_W { w: self } + } + #[doc = "Bit 17 - Enable protection for region 17. Write '0' has no effect."] + #[inline(always)] + pub fn region17(&mut self) -> REGION17_W { + REGION17_W { w: self } + } + #[doc = "Bit 18 - Enable protection for region 18. Write '0' has no effect."] + #[inline(always)] + pub fn region18(&mut self) -> REGION18_W { + REGION18_W { w: self } + } + #[doc = "Bit 19 - Enable protection for region 19. Write '0' has no effect."] + #[inline(always)] + pub fn region19(&mut self) -> REGION19_W { + REGION19_W { w: self } + } + #[doc = "Bit 20 - Enable protection for region 20. Write '0' has no effect."] + #[inline(always)] + pub fn region20(&mut self) -> REGION20_W { + REGION20_W { w: self } + } + #[doc = "Bit 21 - Enable protection for region 21. Write '0' has no effect."] + #[inline(always)] + pub fn region21(&mut self) -> REGION21_W { + REGION21_W { w: self } + } + #[doc = "Bit 22 - Enable protection for region 22. Write '0' has no effect."] + #[inline(always)] + pub fn region22(&mut self) -> REGION22_W { + REGION22_W { w: self } + } + #[doc = "Bit 23 - Enable protection for region 23. Write '0' has no effect."] + #[inline(always)] + pub fn region23(&mut self) -> REGION23_W { + REGION23_W { w: self } + } + #[doc = "Bit 24 - Enable protection for region 24. Write '0' has no effect."] + #[inline(always)] + pub fn region24(&mut self) -> REGION24_W { + REGION24_W { w: self } + } + #[doc = "Bit 25 - Enable protection for region 25. Write '0' has no effect."] + #[inline(always)] + pub fn region25(&mut self) -> REGION25_W { + REGION25_W { w: self } + } + #[doc = "Bit 26 - Enable protection for region 26. Write '0' has no effect."] + #[inline(always)] + pub fn region26(&mut self) -> REGION26_W { + REGION26_W { w: self } + } + #[doc = "Bit 27 - Enable protection for region 27. Write '0' has no effect."] + #[inline(always)] + pub fn region27(&mut self) -> REGION27_W { + REGION27_W { w: self } + } + #[doc = "Bit 28 - Enable protection for region 28. Write '0' has no effect."] + #[inline(always)] + pub fn region28(&mut self) -> REGION28_W { + REGION28_W { w: self } + } + #[doc = "Bit 29 - Enable protection for region 29. Write '0' has no effect."] + #[inline(always)] + pub fn region29(&mut self) -> REGION29_W { + REGION29_W { w: self } + } + #[doc = "Bit 30 - Enable protection for region 30. Write '0' has no effect."] + #[inline(always)] + pub fn region30(&mut self) -> REGION30_W { + REGION30_W { w: self } + } + #[doc = "Bit 31 - Enable protection for region 31. Write '0' has no effect."] + #[inline(always)] + pub fn region31(&mut self) -> REGION31_W { + REGION31_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Block protect configuration register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [config0](index.html) module"] +pub struct CONFIG0_SPEC; +impl crate::RegisterSpec for CONFIG0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [config0::R](R) reader structure"] +impl crate::Readable for CONFIG0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [config0::W](W) writer structure"] +impl crate::Writable for CONFIG0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CONFIG0 to value 0"] +impl crate::Resettable for CONFIG0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/bprot/config1.rs b/src/bprot/config1.rs new file mode 100644 index 0000000..8ecba62 --- /dev/null +++ b/src/bprot/config1.rs @@ -0,0 +1,3042 @@ +#[doc = "Register `CONFIG1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CONFIG1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable protection for region 32. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION32_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION32_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION32` reader - Enable protection for region 32. Write '0' has no effect."] +pub struct REGION32_R(crate::FieldReader); +impl REGION32_R { + pub(crate) fn new(bits: bool) -> Self { + REGION32_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION32_A { + match self.bits { + false => REGION32_A::DISABLED, + true => REGION32_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION32_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION32_A::ENABLED + } +} +impl core::ops::Deref for REGION32_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION32` writer - Enable protection for region 32. Write '0' has no effect."] +pub struct REGION32_W<'a> { + w: &'a mut W, +} +impl<'a> REGION32_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION32_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION32_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION32_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Enable protection for region 33. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION33_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION33_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION33` reader - Enable protection for region 33. Write '0' has no effect."] +pub struct REGION33_R(crate::FieldReader); +impl REGION33_R { + pub(crate) fn new(bits: bool) -> Self { + REGION33_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION33_A { + match self.bits { + false => REGION33_A::DISABLED, + true => REGION33_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION33_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION33_A::ENABLED + } +} +impl core::ops::Deref for REGION33_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION33` writer - Enable protection for region 33. Write '0' has no effect."] +pub struct REGION33_W<'a> { + w: &'a mut W, +} +impl<'a> REGION33_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION33_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION33_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION33_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Enable protection for region 34. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION34_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION34_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION34` reader - Enable protection for region 34. Write '0' has no effect."] +pub struct REGION34_R(crate::FieldReader); +impl REGION34_R { + pub(crate) fn new(bits: bool) -> Self { + REGION34_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION34_A { + match self.bits { + false => REGION34_A::DISABLED, + true => REGION34_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION34_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION34_A::ENABLED + } +} +impl core::ops::Deref for REGION34_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION34` writer - Enable protection for region 34. Write '0' has no effect."] +pub struct REGION34_W<'a> { + w: &'a mut W, +} +impl<'a> REGION34_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION34_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION34_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION34_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Enable protection for region 35. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION35_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION35_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION35` reader - Enable protection for region 35. Write '0' has no effect."] +pub struct REGION35_R(crate::FieldReader); +impl REGION35_R { + pub(crate) fn new(bits: bool) -> Self { + REGION35_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION35_A { + match self.bits { + false => REGION35_A::DISABLED, + true => REGION35_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION35_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION35_A::ENABLED + } +} +impl core::ops::Deref for REGION35_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION35` writer - Enable protection for region 35. Write '0' has no effect."] +pub struct REGION35_W<'a> { + w: &'a mut W, +} +impl<'a> REGION35_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION35_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION35_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION35_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Enable protection for region 36. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION36_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION36_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION36` reader - Enable protection for region 36. Write '0' has no effect."] +pub struct REGION36_R(crate::FieldReader); +impl REGION36_R { + pub(crate) fn new(bits: bool) -> Self { + REGION36_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION36_A { + match self.bits { + false => REGION36_A::DISABLED, + true => REGION36_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION36_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION36_A::ENABLED + } +} +impl core::ops::Deref for REGION36_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION36` writer - Enable protection for region 36. Write '0' has no effect."] +pub struct REGION36_W<'a> { + w: &'a mut W, +} +impl<'a> REGION36_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION36_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION36_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION36_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Enable protection for region 37. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION37_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION37_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION37` reader - Enable protection for region 37. Write '0' has no effect."] +pub struct REGION37_R(crate::FieldReader); +impl REGION37_R { + pub(crate) fn new(bits: bool) -> Self { + REGION37_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION37_A { + match self.bits { + false => REGION37_A::DISABLED, + true => REGION37_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION37_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION37_A::ENABLED + } +} +impl core::ops::Deref for REGION37_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION37` writer - Enable protection for region 37. Write '0' has no effect."] +pub struct REGION37_W<'a> { + w: &'a mut W, +} +impl<'a> REGION37_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION37_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION37_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION37_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Enable protection for region 38. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION38_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION38_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION38` reader - Enable protection for region 38. Write '0' has no effect."] +pub struct REGION38_R(crate::FieldReader); +impl REGION38_R { + pub(crate) fn new(bits: bool) -> Self { + REGION38_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION38_A { + match self.bits { + false => REGION38_A::DISABLED, + true => REGION38_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION38_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION38_A::ENABLED + } +} +impl core::ops::Deref for REGION38_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION38` writer - Enable protection for region 38. Write '0' has no effect."] +pub struct REGION38_W<'a> { + w: &'a mut W, +} +impl<'a> REGION38_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION38_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION38_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION38_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Enable protection for region 39. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION39_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION39_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION39` reader - Enable protection for region 39. Write '0' has no effect."] +pub struct REGION39_R(crate::FieldReader); +impl REGION39_R { + pub(crate) fn new(bits: bool) -> Self { + REGION39_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION39_A { + match self.bits { + false => REGION39_A::DISABLED, + true => REGION39_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION39_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION39_A::ENABLED + } +} +impl core::ops::Deref for REGION39_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION39` writer - Enable protection for region 39. Write '0' has no effect."] +pub struct REGION39_W<'a> { + w: &'a mut W, +} +impl<'a> REGION39_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION39_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION39_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION39_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Enable protection for region 40. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION40_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION40_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION40` reader - Enable protection for region 40. Write '0' has no effect."] +pub struct REGION40_R(crate::FieldReader); +impl REGION40_R { + pub(crate) fn new(bits: bool) -> Self { + REGION40_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION40_A { + match self.bits { + false => REGION40_A::DISABLED, + true => REGION40_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION40_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION40_A::ENABLED + } +} +impl core::ops::Deref for REGION40_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION40` writer - Enable protection for region 40. Write '0' has no effect."] +pub struct REGION40_W<'a> { + w: &'a mut W, +} +impl<'a> REGION40_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION40_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION40_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION40_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Enable protection for region 41. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION41_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION41_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION41` reader - Enable protection for region 41. Write '0' has no effect."] +pub struct REGION41_R(crate::FieldReader); +impl REGION41_R { + pub(crate) fn new(bits: bool) -> Self { + REGION41_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION41_A { + match self.bits { + false => REGION41_A::DISABLED, + true => REGION41_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION41_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION41_A::ENABLED + } +} +impl core::ops::Deref for REGION41_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION41` writer - Enable protection for region 41. Write '0' has no effect."] +pub struct REGION41_W<'a> { + w: &'a mut W, +} +impl<'a> REGION41_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION41_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION41_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION41_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Enable protection for region 42. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION42_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION42_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION42` reader - Enable protection for region 42. Write '0' has no effect."] +pub struct REGION42_R(crate::FieldReader); +impl REGION42_R { + pub(crate) fn new(bits: bool) -> Self { + REGION42_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION42_A { + match self.bits { + false => REGION42_A::DISABLED, + true => REGION42_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION42_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION42_A::ENABLED + } +} +impl core::ops::Deref for REGION42_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION42` writer - Enable protection for region 42. Write '0' has no effect."] +pub struct REGION42_W<'a> { + w: &'a mut W, +} +impl<'a> REGION42_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION42_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION42_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION42_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Enable protection for region 43. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION43_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION43_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION43` reader - Enable protection for region 43. Write '0' has no effect."] +pub struct REGION43_R(crate::FieldReader); +impl REGION43_R { + pub(crate) fn new(bits: bool) -> Self { + REGION43_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION43_A { + match self.bits { + false => REGION43_A::DISABLED, + true => REGION43_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION43_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION43_A::ENABLED + } +} +impl core::ops::Deref for REGION43_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION43` writer - Enable protection for region 43. Write '0' has no effect."] +pub struct REGION43_W<'a> { + w: &'a mut W, +} +impl<'a> REGION43_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION43_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION43_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION43_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Enable protection for region 44. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION44_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION44_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION44` reader - Enable protection for region 44. Write '0' has no effect."] +pub struct REGION44_R(crate::FieldReader); +impl REGION44_R { + pub(crate) fn new(bits: bool) -> Self { + REGION44_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION44_A { + match self.bits { + false => REGION44_A::DISABLED, + true => REGION44_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION44_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION44_A::ENABLED + } +} +impl core::ops::Deref for REGION44_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION44` writer - Enable protection for region 44. Write '0' has no effect."] +pub struct REGION44_W<'a> { + w: &'a mut W, +} +impl<'a> REGION44_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION44_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION44_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION44_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Enable protection for region 45. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION45_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION45_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION45` reader - Enable protection for region 45. Write '0' has no effect."] +pub struct REGION45_R(crate::FieldReader); +impl REGION45_R { + pub(crate) fn new(bits: bool) -> Self { + REGION45_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION45_A { + match self.bits { + false => REGION45_A::DISABLED, + true => REGION45_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION45_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION45_A::ENABLED + } +} +impl core::ops::Deref for REGION45_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION45` writer - Enable protection for region 45. Write '0' has no effect."] +pub struct REGION45_W<'a> { + w: &'a mut W, +} +impl<'a> REGION45_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION45_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION45_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION45_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Enable protection for region 46. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION46_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION46_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION46` reader - Enable protection for region 46. Write '0' has no effect."] +pub struct REGION46_R(crate::FieldReader); +impl REGION46_R { + pub(crate) fn new(bits: bool) -> Self { + REGION46_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION46_A { + match self.bits { + false => REGION46_A::DISABLED, + true => REGION46_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION46_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION46_A::ENABLED + } +} +impl core::ops::Deref for REGION46_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION46` writer - Enable protection for region 46. Write '0' has no effect."] +pub struct REGION46_W<'a> { + w: &'a mut W, +} +impl<'a> REGION46_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION46_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION46_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION46_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Enable protection for region 47. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION47_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION47_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION47` reader - Enable protection for region 47. Write '0' has no effect."] +pub struct REGION47_R(crate::FieldReader); +impl REGION47_R { + pub(crate) fn new(bits: bool) -> Self { + REGION47_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION47_A { + match self.bits { + false => REGION47_A::DISABLED, + true => REGION47_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION47_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION47_A::ENABLED + } +} +impl core::ops::Deref for REGION47_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION47` writer - Enable protection for region 47. Write '0' has no effect."] +pub struct REGION47_W<'a> { + w: &'a mut W, +} +impl<'a> REGION47_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION47_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION47_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION47_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Enable protection for region 48. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION48_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION48_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION48` reader - Enable protection for region 48. Write '0' has no effect."] +pub struct REGION48_R(crate::FieldReader); +impl REGION48_R { + pub(crate) fn new(bits: bool) -> Self { + REGION48_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION48_A { + match self.bits { + false => REGION48_A::DISABLED, + true => REGION48_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION48_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION48_A::ENABLED + } +} +impl core::ops::Deref for REGION48_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION48` writer - Enable protection for region 48. Write '0' has no effect."] +pub struct REGION48_W<'a> { + w: &'a mut W, +} +impl<'a> REGION48_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION48_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION48_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION48_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Enable protection for region 49. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION49_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION49_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION49` reader - Enable protection for region 49. Write '0' has no effect."] +pub struct REGION49_R(crate::FieldReader); +impl REGION49_R { + pub(crate) fn new(bits: bool) -> Self { + REGION49_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION49_A { + match self.bits { + false => REGION49_A::DISABLED, + true => REGION49_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION49_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION49_A::ENABLED + } +} +impl core::ops::Deref for REGION49_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION49` writer - Enable protection for region 49. Write '0' has no effect."] +pub struct REGION49_W<'a> { + w: &'a mut W, +} +impl<'a> REGION49_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION49_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION49_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION49_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Enable protection for region 50. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION50_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION50_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION50` reader - Enable protection for region 50. Write '0' has no effect."] +pub struct REGION50_R(crate::FieldReader); +impl REGION50_R { + pub(crate) fn new(bits: bool) -> Self { + REGION50_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION50_A { + match self.bits { + false => REGION50_A::DISABLED, + true => REGION50_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION50_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION50_A::ENABLED + } +} +impl core::ops::Deref for REGION50_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION50` writer - Enable protection for region 50. Write '0' has no effect."] +pub struct REGION50_W<'a> { + w: &'a mut W, +} +impl<'a> REGION50_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION50_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION50_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION50_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Enable protection for region 51. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION51_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION51_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION51` reader - Enable protection for region 51. Write '0' has no effect."] +pub struct REGION51_R(crate::FieldReader); +impl REGION51_R { + pub(crate) fn new(bits: bool) -> Self { + REGION51_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION51_A { + match self.bits { + false => REGION51_A::DISABLED, + true => REGION51_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION51_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION51_A::ENABLED + } +} +impl core::ops::Deref for REGION51_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION51` writer - Enable protection for region 51. Write '0' has no effect."] +pub struct REGION51_W<'a> { + w: &'a mut W, +} +impl<'a> REGION51_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION51_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION51_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION51_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Enable protection for region 52. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION52_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION52_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION52` reader - Enable protection for region 52. Write '0' has no effect."] +pub struct REGION52_R(crate::FieldReader); +impl REGION52_R { + pub(crate) fn new(bits: bool) -> Self { + REGION52_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION52_A { + match self.bits { + false => REGION52_A::DISABLED, + true => REGION52_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION52_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION52_A::ENABLED + } +} +impl core::ops::Deref for REGION52_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION52` writer - Enable protection for region 52. Write '0' has no effect."] +pub struct REGION52_W<'a> { + w: &'a mut W, +} +impl<'a> REGION52_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION52_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION52_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION52_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Enable protection for region 53. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION53_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION53_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION53` reader - Enable protection for region 53. Write '0' has no effect."] +pub struct REGION53_R(crate::FieldReader); +impl REGION53_R { + pub(crate) fn new(bits: bool) -> Self { + REGION53_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION53_A { + match self.bits { + false => REGION53_A::DISABLED, + true => REGION53_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION53_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION53_A::ENABLED + } +} +impl core::ops::Deref for REGION53_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION53` writer - Enable protection for region 53. Write '0' has no effect."] +pub struct REGION53_W<'a> { + w: &'a mut W, +} +impl<'a> REGION53_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION53_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION53_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION53_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); + self.w + } +} +#[doc = "Enable protection for region 54. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION54_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION54_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION54` reader - Enable protection for region 54. Write '0' has no effect."] +pub struct REGION54_R(crate::FieldReader); +impl REGION54_R { + pub(crate) fn new(bits: bool) -> Self { + REGION54_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION54_A { + match self.bits { + false => REGION54_A::DISABLED, + true => REGION54_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION54_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION54_A::ENABLED + } +} +impl core::ops::Deref for REGION54_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION54` writer - Enable protection for region 54. Write '0' has no effect."] +pub struct REGION54_W<'a> { + w: &'a mut W, +} +impl<'a> REGION54_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION54_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION54_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION54_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); + self.w + } +} +#[doc = "Enable protection for region 55. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION55_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION55_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION55` reader - Enable protection for region 55. Write '0' has no effect."] +pub struct REGION55_R(crate::FieldReader); +impl REGION55_R { + pub(crate) fn new(bits: bool) -> Self { + REGION55_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION55_A { + match self.bits { + false => REGION55_A::DISABLED, + true => REGION55_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION55_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION55_A::ENABLED + } +} +impl core::ops::Deref for REGION55_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION55` writer - Enable protection for region 55. Write '0' has no effect."] +pub struct REGION55_W<'a> { + w: &'a mut W, +} +impl<'a> REGION55_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION55_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION55_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION55_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); + self.w + } +} +#[doc = "Enable protection for region 56. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION56_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION56_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION56` reader - Enable protection for region 56. Write '0' has no effect."] +pub struct REGION56_R(crate::FieldReader); +impl REGION56_R { + pub(crate) fn new(bits: bool) -> Self { + REGION56_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION56_A { + match self.bits { + false => REGION56_A::DISABLED, + true => REGION56_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION56_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION56_A::ENABLED + } +} +impl core::ops::Deref for REGION56_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION56` writer - Enable protection for region 56. Write '0' has no effect."] +pub struct REGION56_W<'a> { + w: &'a mut W, +} +impl<'a> REGION56_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION56_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION56_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION56_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Enable protection for region 57. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION57_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION57_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION57` reader - Enable protection for region 57. Write '0' has no effect."] +pub struct REGION57_R(crate::FieldReader); +impl REGION57_R { + pub(crate) fn new(bits: bool) -> Self { + REGION57_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION57_A { + match self.bits { + false => REGION57_A::DISABLED, + true => REGION57_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION57_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION57_A::ENABLED + } +} +impl core::ops::Deref for REGION57_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION57` writer - Enable protection for region 57. Write '0' has no effect."] +pub struct REGION57_W<'a> { + w: &'a mut W, +} +impl<'a> REGION57_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION57_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION57_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION57_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Enable protection for region 58. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION58_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION58_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION58` reader - Enable protection for region 58. Write '0' has no effect."] +pub struct REGION58_R(crate::FieldReader); +impl REGION58_R { + pub(crate) fn new(bits: bool) -> Self { + REGION58_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION58_A { + match self.bits { + false => REGION58_A::DISABLED, + true => REGION58_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION58_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION58_A::ENABLED + } +} +impl core::ops::Deref for REGION58_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION58` writer - Enable protection for region 58. Write '0' has no effect."] +pub struct REGION58_W<'a> { + w: &'a mut W, +} +impl<'a> REGION58_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION58_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION58_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION58_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Enable protection for region 59. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION59_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION59_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION59` reader - Enable protection for region 59. Write '0' has no effect."] +pub struct REGION59_R(crate::FieldReader); +impl REGION59_R { + pub(crate) fn new(bits: bool) -> Self { + REGION59_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION59_A { + match self.bits { + false => REGION59_A::DISABLED, + true => REGION59_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION59_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION59_A::ENABLED + } +} +impl core::ops::Deref for REGION59_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION59` writer - Enable protection for region 59. Write '0' has no effect."] +pub struct REGION59_W<'a> { + w: &'a mut W, +} +impl<'a> REGION59_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION59_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION59_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION59_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +#[doc = "Enable protection for region 60. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION60_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION60_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION60` reader - Enable protection for region 60. Write '0' has no effect."] +pub struct REGION60_R(crate::FieldReader); +impl REGION60_R { + pub(crate) fn new(bits: bool) -> Self { + REGION60_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION60_A { + match self.bits { + false => REGION60_A::DISABLED, + true => REGION60_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION60_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION60_A::ENABLED + } +} +impl core::ops::Deref for REGION60_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION60` writer - Enable protection for region 60. Write '0' has no effect."] +pub struct REGION60_W<'a> { + w: &'a mut W, +} +impl<'a> REGION60_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION60_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION60_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION60_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); + self.w + } +} +#[doc = "Enable protection for region 61. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION61_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION61_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION61` reader - Enable protection for region 61. Write '0' has no effect."] +pub struct REGION61_R(crate::FieldReader); +impl REGION61_R { + pub(crate) fn new(bits: bool) -> Self { + REGION61_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION61_A { + match self.bits { + false => REGION61_A::DISABLED, + true => REGION61_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION61_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION61_A::ENABLED + } +} +impl core::ops::Deref for REGION61_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION61` writer - Enable protection for region 61. Write '0' has no effect."] +pub struct REGION61_W<'a> { + w: &'a mut W, +} +impl<'a> REGION61_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION61_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION61_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION61_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); + self.w + } +} +#[doc = "Enable protection for region 62. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION62_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION62_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION62` reader - Enable protection for region 62. Write '0' has no effect."] +pub struct REGION62_R(crate::FieldReader); +impl REGION62_R { + pub(crate) fn new(bits: bool) -> Self { + REGION62_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION62_A { + match self.bits { + false => REGION62_A::DISABLED, + true => REGION62_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION62_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION62_A::ENABLED + } +} +impl core::ops::Deref for REGION62_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION62` writer - Enable protection for region 62. Write '0' has no effect."] +pub struct REGION62_W<'a> { + w: &'a mut W, +} +impl<'a> REGION62_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION62_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION62_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION62_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); + self.w + } +} +#[doc = "Enable protection for region 63. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION63_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION63_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION63` reader - Enable protection for region 63. Write '0' has no effect."] +pub struct REGION63_R(crate::FieldReader); +impl REGION63_R { + pub(crate) fn new(bits: bool) -> Self { + REGION63_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION63_A { + match self.bits { + false => REGION63_A::DISABLED, + true => REGION63_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION63_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION63_A::ENABLED + } +} +impl core::ops::Deref for REGION63_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION63` writer - Enable protection for region 63. Write '0' has no effect."] +pub struct REGION63_W<'a> { + w: &'a mut W, +} +impl<'a> REGION63_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION63_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION63_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION63_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable protection for region 32. Write '0' has no effect."] + #[inline(always)] + pub fn region32(&self) -> REGION32_R { + REGION32_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Enable protection for region 33. Write '0' has no effect."] + #[inline(always)] + pub fn region33(&self) -> REGION33_R { + REGION33_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Enable protection for region 34. Write '0' has no effect."] + #[inline(always)] + pub fn region34(&self) -> REGION34_R { + REGION34_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Enable protection for region 35. Write '0' has no effect."] + #[inline(always)] + pub fn region35(&self) -> REGION35_R { + REGION35_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Enable protection for region 36. Write '0' has no effect."] + #[inline(always)] + pub fn region36(&self) -> REGION36_R { + REGION36_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Enable protection for region 37. Write '0' has no effect."] + #[inline(always)] + pub fn region37(&self) -> REGION37_R { + REGION37_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Enable protection for region 38. Write '0' has no effect."] + #[inline(always)] + pub fn region38(&self) -> REGION38_R { + REGION38_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Enable protection for region 39. Write '0' has no effect."] + #[inline(always)] + pub fn region39(&self) -> REGION39_R { + REGION39_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Enable protection for region 40. Write '0' has no effect."] + #[inline(always)] + pub fn region40(&self) -> REGION40_R { + REGION40_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Enable protection for region 41. Write '0' has no effect."] + #[inline(always)] + pub fn region41(&self) -> REGION41_R { + REGION41_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Enable protection for region 42. Write '0' has no effect."] + #[inline(always)] + pub fn region42(&self) -> REGION42_R { + REGION42_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Enable protection for region 43. Write '0' has no effect."] + #[inline(always)] + pub fn region43(&self) -> REGION43_R { + REGION43_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Enable protection for region 44. Write '0' has no effect."] + #[inline(always)] + pub fn region44(&self) -> REGION44_R { + REGION44_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Enable protection for region 45. Write '0' has no effect."] + #[inline(always)] + pub fn region45(&self) -> REGION45_R { + REGION45_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Enable protection for region 46. Write '0' has no effect."] + #[inline(always)] + pub fn region46(&self) -> REGION46_R { + REGION46_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Enable protection for region 47. Write '0' has no effect."] + #[inline(always)] + pub fn region47(&self) -> REGION47_R { + REGION47_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Enable protection for region 48. Write '0' has no effect."] + #[inline(always)] + pub fn region48(&self) -> REGION48_R { + REGION48_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Enable protection for region 49. Write '0' has no effect."] + #[inline(always)] + pub fn region49(&self) -> REGION49_R { + REGION49_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Enable protection for region 50. Write '0' has no effect."] + #[inline(always)] + pub fn region50(&self) -> REGION50_R { + REGION50_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Enable protection for region 51. Write '0' has no effect."] + #[inline(always)] + pub fn region51(&self) -> REGION51_R { + REGION51_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Enable protection for region 52. Write '0' has no effect."] + #[inline(always)] + pub fn region52(&self) -> REGION52_R { + REGION52_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 21 - Enable protection for region 53. Write '0' has no effect."] + #[inline(always)] + pub fn region53(&self) -> REGION53_R { + REGION53_R::new(((self.bits >> 21) & 0x01) != 0) + } + #[doc = "Bit 22 - Enable protection for region 54. Write '0' has no effect."] + #[inline(always)] + pub fn region54(&self) -> REGION54_R { + REGION54_R::new(((self.bits >> 22) & 0x01) != 0) + } + #[doc = "Bit 23 - Enable protection for region 55. Write '0' has no effect."] + #[inline(always)] + pub fn region55(&self) -> REGION55_R { + REGION55_R::new(((self.bits >> 23) & 0x01) != 0) + } + #[doc = "Bit 24 - Enable protection for region 56. Write '0' has no effect."] + #[inline(always)] + pub fn region56(&self) -> REGION56_R { + REGION56_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Enable protection for region 57. Write '0' has no effect."] + #[inline(always)] + pub fn region57(&self) -> REGION57_R { + REGION57_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Enable protection for region 58. Write '0' has no effect."] + #[inline(always)] + pub fn region58(&self) -> REGION58_R { + REGION58_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Enable protection for region 59. Write '0' has no effect."] + #[inline(always)] + pub fn region59(&self) -> REGION59_R { + REGION59_R::new(((self.bits >> 27) & 0x01) != 0) + } + #[doc = "Bit 28 - Enable protection for region 60. Write '0' has no effect."] + #[inline(always)] + pub fn region60(&self) -> REGION60_R { + REGION60_R::new(((self.bits >> 28) & 0x01) != 0) + } + #[doc = "Bit 29 - Enable protection for region 61. Write '0' has no effect."] + #[inline(always)] + pub fn region61(&self) -> REGION61_R { + REGION61_R::new(((self.bits >> 29) & 0x01) != 0) + } + #[doc = "Bit 30 - Enable protection for region 62. Write '0' has no effect."] + #[inline(always)] + pub fn region62(&self) -> REGION62_R { + REGION62_R::new(((self.bits >> 30) & 0x01) != 0) + } + #[doc = "Bit 31 - Enable protection for region 63. Write '0' has no effect."] + #[inline(always)] + pub fn region63(&self) -> REGION63_R { + REGION63_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Enable protection for region 32. Write '0' has no effect."] + #[inline(always)] + pub fn region32(&mut self) -> REGION32_W { + REGION32_W { w: self } + } + #[doc = "Bit 1 - Enable protection for region 33. Write '0' has no effect."] + #[inline(always)] + pub fn region33(&mut self) -> REGION33_W { + REGION33_W { w: self } + } + #[doc = "Bit 2 - Enable protection for region 34. Write '0' has no effect."] + #[inline(always)] + pub fn region34(&mut self) -> REGION34_W { + REGION34_W { w: self } + } + #[doc = "Bit 3 - Enable protection for region 35. Write '0' has no effect."] + #[inline(always)] + pub fn region35(&mut self) -> REGION35_W { + REGION35_W { w: self } + } + #[doc = "Bit 4 - Enable protection for region 36. Write '0' has no effect."] + #[inline(always)] + pub fn region36(&mut self) -> REGION36_W { + REGION36_W { w: self } + } + #[doc = "Bit 5 - Enable protection for region 37. Write '0' has no effect."] + #[inline(always)] + pub fn region37(&mut self) -> REGION37_W { + REGION37_W { w: self } + } + #[doc = "Bit 6 - Enable protection for region 38. Write '0' has no effect."] + #[inline(always)] + pub fn region38(&mut self) -> REGION38_W { + REGION38_W { w: self } + } + #[doc = "Bit 7 - Enable protection for region 39. Write '0' has no effect."] + #[inline(always)] + pub fn region39(&mut self) -> REGION39_W { + REGION39_W { w: self } + } + #[doc = "Bit 8 - Enable protection for region 40. Write '0' has no effect."] + #[inline(always)] + pub fn region40(&mut self) -> REGION40_W { + REGION40_W { w: self } + } + #[doc = "Bit 9 - Enable protection for region 41. Write '0' has no effect."] + #[inline(always)] + pub fn region41(&mut self) -> REGION41_W { + REGION41_W { w: self } + } + #[doc = "Bit 10 - Enable protection for region 42. Write '0' has no effect."] + #[inline(always)] + pub fn region42(&mut self) -> REGION42_W { + REGION42_W { w: self } + } + #[doc = "Bit 11 - Enable protection for region 43. Write '0' has no effect."] + #[inline(always)] + pub fn region43(&mut self) -> REGION43_W { + REGION43_W { w: self } + } + #[doc = "Bit 12 - Enable protection for region 44. Write '0' has no effect."] + #[inline(always)] + pub fn region44(&mut self) -> REGION44_W { + REGION44_W { w: self } + } + #[doc = "Bit 13 - Enable protection for region 45. Write '0' has no effect."] + #[inline(always)] + pub fn region45(&mut self) -> REGION45_W { + REGION45_W { w: self } + } + #[doc = "Bit 14 - Enable protection for region 46. Write '0' has no effect."] + #[inline(always)] + pub fn region46(&mut self) -> REGION46_W { + REGION46_W { w: self } + } + #[doc = "Bit 15 - Enable protection for region 47. Write '0' has no effect."] + #[inline(always)] + pub fn region47(&mut self) -> REGION47_W { + REGION47_W { w: self } + } + #[doc = "Bit 16 - Enable protection for region 48. Write '0' has no effect."] + #[inline(always)] + pub fn region48(&mut self) -> REGION48_W { + REGION48_W { w: self } + } + #[doc = "Bit 17 - Enable protection for region 49. Write '0' has no effect."] + #[inline(always)] + pub fn region49(&mut self) -> REGION49_W { + REGION49_W { w: self } + } + #[doc = "Bit 18 - Enable protection for region 50. Write '0' has no effect."] + #[inline(always)] + pub fn region50(&mut self) -> REGION50_W { + REGION50_W { w: self } + } + #[doc = "Bit 19 - Enable protection for region 51. Write '0' has no effect."] + #[inline(always)] + pub fn region51(&mut self) -> REGION51_W { + REGION51_W { w: self } + } + #[doc = "Bit 20 - Enable protection for region 52. Write '0' has no effect."] + #[inline(always)] + pub fn region52(&mut self) -> REGION52_W { + REGION52_W { w: self } + } + #[doc = "Bit 21 - Enable protection for region 53. Write '0' has no effect."] + #[inline(always)] + pub fn region53(&mut self) -> REGION53_W { + REGION53_W { w: self } + } + #[doc = "Bit 22 - Enable protection for region 54. Write '0' has no effect."] + #[inline(always)] + pub fn region54(&mut self) -> REGION54_W { + REGION54_W { w: self } + } + #[doc = "Bit 23 - Enable protection for region 55. Write '0' has no effect."] + #[inline(always)] + pub fn region55(&mut self) -> REGION55_W { + REGION55_W { w: self } + } + #[doc = "Bit 24 - Enable protection for region 56. Write '0' has no effect."] + #[inline(always)] + pub fn region56(&mut self) -> REGION56_W { + REGION56_W { w: self } + } + #[doc = "Bit 25 - Enable protection for region 57. Write '0' has no effect."] + #[inline(always)] + pub fn region57(&mut self) -> REGION57_W { + REGION57_W { w: self } + } + #[doc = "Bit 26 - Enable protection for region 58. Write '0' has no effect."] + #[inline(always)] + pub fn region58(&mut self) -> REGION58_W { + REGION58_W { w: self } + } + #[doc = "Bit 27 - Enable protection for region 59. Write '0' has no effect."] + #[inline(always)] + pub fn region59(&mut self) -> REGION59_W { + REGION59_W { w: self } + } + #[doc = "Bit 28 - Enable protection for region 60. Write '0' has no effect."] + #[inline(always)] + pub fn region60(&mut self) -> REGION60_W { + REGION60_W { w: self } + } + #[doc = "Bit 29 - Enable protection for region 61. Write '0' has no effect."] + #[inline(always)] + pub fn region61(&mut self) -> REGION61_W { + REGION61_W { w: self } + } + #[doc = "Bit 30 - Enable protection for region 62. Write '0' has no effect."] + #[inline(always)] + pub fn region62(&mut self) -> REGION62_W { + REGION62_W { w: self } + } + #[doc = "Bit 31 - Enable protection for region 63. Write '0' has no effect."] + #[inline(always)] + pub fn region63(&mut self) -> REGION63_W { + REGION63_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Block protect configuration register 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [config1](index.html) module"] +pub struct CONFIG1_SPEC; +impl crate::RegisterSpec for CONFIG1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [config1::R](R) reader structure"] +impl crate::Readable for CONFIG1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [config1::W](W) writer structure"] +impl crate::Writable for CONFIG1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CONFIG1 to value 0"] +impl crate::Resettable for CONFIG1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/bprot/config2.rs b/src/bprot/config2.rs new file mode 100644 index 0000000..44c42cd --- /dev/null +++ b/src/bprot/config2.rs @@ -0,0 +1,3042 @@ +#[doc = "Register `CONFIG2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CONFIG2` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable protection for region 64. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION64_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION64_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION64` reader - Enable protection for region 64. Write '0' has no effect."] +pub struct REGION64_R(crate::FieldReader); +impl REGION64_R { + pub(crate) fn new(bits: bool) -> Self { + REGION64_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION64_A { + match self.bits { + false => REGION64_A::DISABLED, + true => REGION64_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION64_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION64_A::ENABLED + } +} +impl core::ops::Deref for REGION64_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION64` writer - Enable protection for region 64. Write '0' has no effect."] +pub struct REGION64_W<'a> { + w: &'a mut W, +} +impl<'a> REGION64_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION64_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION64_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION64_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Enable protection for region 65. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION65_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION65_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION65` reader - Enable protection for region 65. Write '0' has no effect."] +pub struct REGION65_R(crate::FieldReader); +impl REGION65_R { + pub(crate) fn new(bits: bool) -> Self { + REGION65_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION65_A { + match self.bits { + false => REGION65_A::DISABLED, + true => REGION65_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION65_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION65_A::ENABLED + } +} +impl core::ops::Deref for REGION65_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION65` writer - Enable protection for region 65. Write '0' has no effect."] +pub struct REGION65_W<'a> { + w: &'a mut W, +} +impl<'a> REGION65_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION65_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION65_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION65_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Enable protection for region 66. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION66_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION66_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION66` reader - Enable protection for region 66. Write '0' has no effect."] +pub struct REGION66_R(crate::FieldReader); +impl REGION66_R { + pub(crate) fn new(bits: bool) -> Self { + REGION66_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION66_A { + match self.bits { + false => REGION66_A::DISABLED, + true => REGION66_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION66_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION66_A::ENABLED + } +} +impl core::ops::Deref for REGION66_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION66` writer - Enable protection for region 66. Write '0' has no effect."] +pub struct REGION66_W<'a> { + w: &'a mut W, +} +impl<'a> REGION66_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION66_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION66_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION66_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Enable protection for region 67. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION67_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION67_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION67` reader - Enable protection for region 67. Write '0' has no effect."] +pub struct REGION67_R(crate::FieldReader); +impl REGION67_R { + pub(crate) fn new(bits: bool) -> Self { + REGION67_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION67_A { + match self.bits { + false => REGION67_A::DISABLED, + true => REGION67_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION67_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION67_A::ENABLED + } +} +impl core::ops::Deref for REGION67_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION67` writer - Enable protection for region 67. Write '0' has no effect."] +pub struct REGION67_W<'a> { + w: &'a mut W, +} +impl<'a> REGION67_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION67_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION67_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION67_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Enable protection for region 68. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION68_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION68_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION68` reader - Enable protection for region 68. Write '0' has no effect."] +pub struct REGION68_R(crate::FieldReader); +impl REGION68_R { + pub(crate) fn new(bits: bool) -> Self { + REGION68_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION68_A { + match self.bits { + false => REGION68_A::DISABLED, + true => REGION68_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION68_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION68_A::ENABLED + } +} +impl core::ops::Deref for REGION68_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION68` writer - Enable protection for region 68. Write '0' has no effect."] +pub struct REGION68_W<'a> { + w: &'a mut W, +} +impl<'a> REGION68_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION68_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION68_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION68_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Enable protection for region 69. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION69_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION69_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION69` reader - Enable protection for region 69. Write '0' has no effect."] +pub struct REGION69_R(crate::FieldReader); +impl REGION69_R { + pub(crate) fn new(bits: bool) -> Self { + REGION69_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION69_A { + match self.bits { + false => REGION69_A::DISABLED, + true => REGION69_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION69_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION69_A::ENABLED + } +} +impl core::ops::Deref for REGION69_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION69` writer - Enable protection for region 69. Write '0' has no effect."] +pub struct REGION69_W<'a> { + w: &'a mut W, +} +impl<'a> REGION69_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION69_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION69_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION69_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Enable protection for region 70. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION70_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION70_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION70` reader - Enable protection for region 70. Write '0' has no effect."] +pub struct REGION70_R(crate::FieldReader); +impl REGION70_R { + pub(crate) fn new(bits: bool) -> Self { + REGION70_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION70_A { + match self.bits { + false => REGION70_A::DISABLED, + true => REGION70_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION70_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION70_A::ENABLED + } +} +impl core::ops::Deref for REGION70_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION70` writer - Enable protection for region 70. Write '0' has no effect."] +pub struct REGION70_W<'a> { + w: &'a mut W, +} +impl<'a> REGION70_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION70_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION70_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION70_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Enable protection for region 71. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION71_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION71_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION71` reader - Enable protection for region 71. Write '0' has no effect."] +pub struct REGION71_R(crate::FieldReader); +impl REGION71_R { + pub(crate) fn new(bits: bool) -> Self { + REGION71_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION71_A { + match self.bits { + false => REGION71_A::DISABLED, + true => REGION71_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION71_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION71_A::ENABLED + } +} +impl core::ops::Deref for REGION71_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION71` writer - Enable protection for region 71. Write '0' has no effect."] +pub struct REGION71_W<'a> { + w: &'a mut W, +} +impl<'a> REGION71_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION71_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION71_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION71_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Enable protection for region 72. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION72_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION72_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION72` reader - Enable protection for region 72. Write '0' has no effect."] +pub struct REGION72_R(crate::FieldReader); +impl REGION72_R { + pub(crate) fn new(bits: bool) -> Self { + REGION72_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION72_A { + match self.bits { + false => REGION72_A::DISABLED, + true => REGION72_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION72_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION72_A::ENABLED + } +} +impl core::ops::Deref for REGION72_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION72` writer - Enable protection for region 72. Write '0' has no effect."] +pub struct REGION72_W<'a> { + w: &'a mut W, +} +impl<'a> REGION72_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION72_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION72_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION72_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Enable protection for region 73. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION73_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION73_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION73` reader - Enable protection for region 73. Write '0' has no effect."] +pub struct REGION73_R(crate::FieldReader); +impl REGION73_R { + pub(crate) fn new(bits: bool) -> Self { + REGION73_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION73_A { + match self.bits { + false => REGION73_A::DISABLED, + true => REGION73_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION73_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION73_A::ENABLED + } +} +impl core::ops::Deref for REGION73_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION73` writer - Enable protection for region 73. Write '0' has no effect."] +pub struct REGION73_W<'a> { + w: &'a mut W, +} +impl<'a> REGION73_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION73_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION73_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION73_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Enable protection for region 74. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION74_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION74_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION74` reader - Enable protection for region 74. Write '0' has no effect."] +pub struct REGION74_R(crate::FieldReader); +impl REGION74_R { + pub(crate) fn new(bits: bool) -> Self { + REGION74_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION74_A { + match self.bits { + false => REGION74_A::DISABLED, + true => REGION74_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION74_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION74_A::ENABLED + } +} +impl core::ops::Deref for REGION74_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION74` writer - Enable protection for region 74. Write '0' has no effect."] +pub struct REGION74_W<'a> { + w: &'a mut W, +} +impl<'a> REGION74_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION74_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION74_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION74_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Enable protection for region 75. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION75_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION75_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION75` reader - Enable protection for region 75. Write '0' has no effect."] +pub struct REGION75_R(crate::FieldReader); +impl REGION75_R { + pub(crate) fn new(bits: bool) -> Self { + REGION75_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION75_A { + match self.bits { + false => REGION75_A::DISABLED, + true => REGION75_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION75_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION75_A::ENABLED + } +} +impl core::ops::Deref for REGION75_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION75` writer - Enable protection for region 75. Write '0' has no effect."] +pub struct REGION75_W<'a> { + w: &'a mut W, +} +impl<'a> REGION75_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION75_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION75_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION75_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Enable protection for region 76. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION76_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION76_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION76` reader - Enable protection for region 76. Write '0' has no effect."] +pub struct REGION76_R(crate::FieldReader); +impl REGION76_R { + pub(crate) fn new(bits: bool) -> Self { + REGION76_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION76_A { + match self.bits { + false => REGION76_A::DISABLED, + true => REGION76_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION76_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION76_A::ENABLED + } +} +impl core::ops::Deref for REGION76_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION76` writer - Enable protection for region 76. Write '0' has no effect."] +pub struct REGION76_W<'a> { + w: &'a mut W, +} +impl<'a> REGION76_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION76_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION76_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION76_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Enable protection for region 77. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION77_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION77_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION77` reader - Enable protection for region 77. Write '0' has no effect."] +pub struct REGION77_R(crate::FieldReader); +impl REGION77_R { + pub(crate) fn new(bits: bool) -> Self { + REGION77_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION77_A { + match self.bits { + false => REGION77_A::DISABLED, + true => REGION77_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION77_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION77_A::ENABLED + } +} +impl core::ops::Deref for REGION77_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION77` writer - Enable protection for region 77. Write '0' has no effect."] +pub struct REGION77_W<'a> { + w: &'a mut W, +} +impl<'a> REGION77_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION77_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION77_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION77_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Enable protection for region 78. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION78_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION78_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION78` reader - Enable protection for region 78. Write '0' has no effect."] +pub struct REGION78_R(crate::FieldReader); +impl REGION78_R { + pub(crate) fn new(bits: bool) -> Self { + REGION78_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION78_A { + match self.bits { + false => REGION78_A::DISABLED, + true => REGION78_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION78_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION78_A::ENABLED + } +} +impl core::ops::Deref for REGION78_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION78` writer - Enable protection for region 78. Write '0' has no effect."] +pub struct REGION78_W<'a> { + w: &'a mut W, +} +impl<'a> REGION78_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION78_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION78_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION78_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Enable protection for region 79. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION79_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION79_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION79` reader - Enable protection for region 79. Write '0' has no effect."] +pub struct REGION79_R(crate::FieldReader); +impl REGION79_R { + pub(crate) fn new(bits: bool) -> Self { + REGION79_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION79_A { + match self.bits { + false => REGION79_A::DISABLED, + true => REGION79_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION79_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION79_A::ENABLED + } +} +impl core::ops::Deref for REGION79_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION79` writer - Enable protection for region 79. Write '0' has no effect."] +pub struct REGION79_W<'a> { + w: &'a mut W, +} +impl<'a> REGION79_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION79_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION79_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION79_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Enable protection for region 80. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION80_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION80_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION80` reader - Enable protection for region 80. Write '0' has no effect."] +pub struct REGION80_R(crate::FieldReader); +impl REGION80_R { + pub(crate) fn new(bits: bool) -> Self { + REGION80_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION80_A { + match self.bits { + false => REGION80_A::DISABLED, + true => REGION80_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION80_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION80_A::ENABLED + } +} +impl core::ops::Deref for REGION80_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION80` writer - Enable protection for region 80. Write '0' has no effect."] +pub struct REGION80_W<'a> { + w: &'a mut W, +} +impl<'a> REGION80_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION80_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION80_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION80_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Enable protection for region 81. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION81_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION81_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION81` reader - Enable protection for region 81. Write '0' has no effect."] +pub struct REGION81_R(crate::FieldReader); +impl REGION81_R { + pub(crate) fn new(bits: bool) -> Self { + REGION81_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION81_A { + match self.bits { + false => REGION81_A::DISABLED, + true => REGION81_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION81_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION81_A::ENABLED + } +} +impl core::ops::Deref for REGION81_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION81` writer - Enable protection for region 81. Write '0' has no effect."] +pub struct REGION81_W<'a> { + w: &'a mut W, +} +impl<'a> REGION81_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION81_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION81_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION81_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Enable protection for region 82. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION82_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION82_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION82` reader - Enable protection for region 82. Write '0' has no effect."] +pub struct REGION82_R(crate::FieldReader); +impl REGION82_R { + pub(crate) fn new(bits: bool) -> Self { + REGION82_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION82_A { + match self.bits { + false => REGION82_A::DISABLED, + true => REGION82_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION82_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION82_A::ENABLED + } +} +impl core::ops::Deref for REGION82_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION82` writer - Enable protection for region 82. Write '0' has no effect."] +pub struct REGION82_W<'a> { + w: &'a mut W, +} +impl<'a> REGION82_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION82_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION82_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION82_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Enable protection for region 83. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION83_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION83_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION83` reader - Enable protection for region 83. Write '0' has no effect."] +pub struct REGION83_R(crate::FieldReader); +impl REGION83_R { + pub(crate) fn new(bits: bool) -> Self { + REGION83_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION83_A { + match self.bits { + false => REGION83_A::DISABLED, + true => REGION83_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION83_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION83_A::ENABLED + } +} +impl core::ops::Deref for REGION83_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION83` writer - Enable protection for region 83. Write '0' has no effect."] +pub struct REGION83_W<'a> { + w: &'a mut W, +} +impl<'a> REGION83_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION83_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION83_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION83_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Enable protection for region 84. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION84_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION84_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION84` reader - Enable protection for region 84. Write '0' has no effect."] +pub struct REGION84_R(crate::FieldReader); +impl REGION84_R { + pub(crate) fn new(bits: bool) -> Self { + REGION84_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION84_A { + match self.bits { + false => REGION84_A::DISABLED, + true => REGION84_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION84_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION84_A::ENABLED + } +} +impl core::ops::Deref for REGION84_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION84` writer - Enable protection for region 84. Write '0' has no effect."] +pub struct REGION84_W<'a> { + w: &'a mut W, +} +impl<'a> REGION84_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION84_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION84_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION84_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Enable protection for region 85. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION85_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION85_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION85` reader - Enable protection for region 85. Write '0' has no effect."] +pub struct REGION85_R(crate::FieldReader); +impl REGION85_R { + pub(crate) fn new(bits: bool) -> Self { + REGION85_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION85_A { + match self.bits { + false => REGION85_A::DISABLED, + true => REGION85_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION85_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION85_A::ENABLED + } +} +impl core::ops::Deref for REGION85_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION85` writer - Enable protection for region 85. Write '0' has no effect."] +pub struct REGION85_W<'a> { + w: &'a mut W, +} +impl<'a> REGION85_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION85_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION85_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION85_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); + self.w + } +} +#[doc = "Enable protection for region 86. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION86_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION86_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION86` reader - Enable protection for region 86. Write '0' has no effect."] +pub struct REGION86_R(crate::FieldReader); +impl REGION86_R { + pub(crate) fn new(bits: bool) -> Self { + REGION86_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION86_A { + match self.bits { + false => REGION86_A::DISABLED, + true => REGION86_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION86_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION86_A::ENABLED + } +} +impl core::ops::Deref for REGION86_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION86` writer - Enable protection for region 86. Write '0' has no effect."] +pub struct REGION86_W<'a> { + w: &'a mut W, +} +impl<'a> REGION86_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION86_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION86_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION86_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); + self.w + } +} +#[doc = "Enable protection for region 87. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION87_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION87_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION87` reader - Enable protection for region 87. Write '0' has no effect."] +pub struct REGION87_R(crate::FieldReader); +impl REGION87_R { + pub(crate) fn new(bits: bool) -> Self { + REGION87_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION87_A { + match self.bits { + false => REGION87_A::DISABLED, + true => REGION87_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION87_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION87_A::ENABLED + } +} +impl core::ops::Deref for REGION87_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION87` writer - Enable protection for region 87. Write '0' has no effect."] +pub struct REGION87_W<'a> { + w: &'a mut W, +} +impl<'a> REGION87_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION87_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION87_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION87_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); + self.w + } +} +#[doc = "Enable protection for region 88. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION88_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION88_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION88` reader - Enable protection for region 88. Write '0' has no effect."] +pub struct REGION88_R(crate::FieldReader); +impl REGION88_R { + pub(crate) fn new(bits: bool) -> Self { + REGION88_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION88_A { + match self.bits { + false => REGION88_A::DISABLED, + true => REGION88_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION88_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION88_A::ENABLED + } +} +impl core::ops::Deref for REGION88_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION88` writer - Enable protection for region 88. Write '0' has no effect."] +pub struct REGION88_W<'a> { + w: &'a mut W, +} +impl<'a> REGION88_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION88_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION88_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION88_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Enable protection for region 89. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION89_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION89_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION89` reader - Enable protection for region 89. Write '0' has no effect."] +pub struct REGION89_R(crate::FieldReader); +impl REGION89_R { + pub(crate) fn new(bits: bool) -> Self { + REGION89_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION89_A { + match self.bits { + false => REGION89_A::DISABLED, + true => REGION89_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION89_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION89_A::ENABLED + } +} +impl core::ops::Deref for REGION89_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION89` writer - Enable protection for region 89. Write '0' has no effect."] +pub struct REGION89_W<'a> { + w: &'a mut W, +} +impl<'a> REGION89_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION89_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION89_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION89_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Enable protection for region 90. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION90_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION90_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION90` reader - Enable protection for region 90. Write '0' has no effect."] +pub struct REGION90_R(crate::FieldReader); +impl REGION90_R { + pub(crate) fn new(bits: bool) -> Self { + REGION90_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION90_A { + match self.bits { + false => REGION90_A::DISABLED, + true => REGION90_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION90_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION90_A::ENABLED + } +} +impl core::ops::Deref for REGION90_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION90` writer - Enable protection for region 90. Write '0' has no effect."] +pub struct REGION90_W<'a> { + w: &'a mut W, +} +impl<'a> REGION90_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION90_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION90_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION90_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Enable protection for region 91. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION91_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION91_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION91` reader - Enable protection for region 91. Write '0' has no effect."] +pub struct REGION91_R(crate::FieldReader); +impl REGION91_R { + pub(crate) fn new(bits: bool) -> Self { + REGION91_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION91_A { + match self.bits { + false => REGION91_A::DISABLED, + true => REGION91_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION91_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION91_A::ENABLED + } +} +impl core::ops::Deref for REGION91_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION91` writer - Enable protection for region 91. Write '0' has no effect."] +pub struct REGION91_W<'a> { + w: &'a mut W, +} +impl<'a> REGION91_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION91_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION91_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION91_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +#[doc = "Enable protection for region 92. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION92_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION92_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION92` reader - Enable protection for region 92. Write '0' has no effect."] +pub struct REGION92_R(crate::FieldReader); +impl REGION92_R { + pub(crate) fn new(bits: bool) -> Self { + REGION92_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION92_A { + match self.bits { + false => REGION92_A::DISABLED, + true => REGION92_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION92_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION92_A::ENABLED + } +} +impl core::ops::Deref for REGION92_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION92` writer - Enable protection for region 92. Write '0' has no effect."] +pub struct REGION92_W<'a> { + w: &'a mut W, +} +impl<'a> REGION92_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION92_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION92_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION92_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); + self.w + } +} +#[doc = "Enable protection for region 93. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION93_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION93_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION93` reader - Enable protection for region 93. Write '0' has no effect."] +pub struct REGION93_R(crate::FieldReader); +impl REGION93_R { + pub(crate) fn new(bits: bool) -> Self { + REGION93_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION93_A { + match self.bits { + false => REGION93_A::DISABLED, + true => REGION93_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION93_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION93_A::ENABLED + } +} +impl core::ops::Deref for REGION93_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION93` writer - Enable protection for region 93. Write '0' has no effect."] +pub struct REGION93_W<'a> { + w: &'a mut W, +} +impl<'a> REGION93_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION93_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION93_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION93_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); + self.w + } +} +#[doc = "Enable protection for region 94. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION94_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION94_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION94` reader - Enable protection for region 94. Write '0' has no effect."] +pub struct REGION94_R(crate::FieldReader); +impl REGION94_R { + pub(crate) fn new(bits: bool) -> Self { + REGION94_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION94_A { + match self.bits { + false => REGION94_A::DISABLED, + true => REGION94_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION94_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION94_A::ENABLED + } +} +impl core::ops::Deref for REGION94_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION94` writer - Enable protection for region 94. Write '0' has no effect."] +pub struct REGION94_W<'a> { + w: &'a mut W, +} +impl<'a> REGION94_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION94_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION94_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION94_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); + self.w + } +} +#[doc = "Enable protection for region 95. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION95_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION95_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION95` reader - Enable protection for region 95. Write '0' has no effect."] +pub struct REGION95_R(crate::FieldReader); +impl REGION95_R { + pub(crate) fn new(bits: bool) -> Self { + REGION95_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION95_A { + match self.bits { + false => REGION95_A::DISABLED, + true => REGION95_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION95_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION95_A::ENABLED + } +} +impl core::ops::Deref for REGION95_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION95` writer - Enable protection for region 95. Write '0' has no effect."] +pub struct REGION95_W<'a> { + w: &'a mut W, +} +impl<'a> REGION95_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION95_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION95_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION95_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable protection for region 64. Write '0' has no effect."] + #[inline(always)] + pub fn region64(&self) -> REGION64_R { + REGION64_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Enable protection for region 65. Write '0' has no effect."] + #[inline(always)] + pub fn region65(&self) -> REGION65_R { + REGION65_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Enable protection for region 66. Write '0' has no effect."] + #[inline(always)] + pub fn region66(&self) -> REGION66_R { + REGION66_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Enable protection for region 67. Write '0' has no effect."] + #[inline(always)] + pub fn region67(&self) -> REGION67_R { + REGION67_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Enable protection for region 68. Write '0' has no effect."] + #[inline(always)] + pub fn region68(&self) -> REGION68_R { + REGION68_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Enable protection for region 69. Write '0' has no effect."] + #[inline(always)] + pub fn region69(&self) -> REGION69_R { + REGION69_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Enable protection for region 70. Write '0' has no effect."] + #[inline(always)] + pub fn region70(&self) -> REGION70_R { + REGION70_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Enable protection for region 71. Write '0' has no effect."] + #[inline(always)] + pub fn region71(&self) -> REGION71_R { + REGION71_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Enable protection for region 72. Write '0' has no effect."] + #[inline(always)] + pub fn region72(&self) -> REGION72_R { + REGION72_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Enable protection for region 73. Write '0' has no effect."] + #[inline(always)] + pub fn region73(&self) -> REGION73_R { + REGION73_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Enable protection for region 74. Write '0' has no effect."] + #[inline(always)] + pub fn region74(&self) -> REGION74_R { + REGION74_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Enable protection for region 75. Write '0' has no effect."] + #[inline(always)] + pub fn region75(&self) -> REGION75_R { + REGION75_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Enable protection for region 76. Write '0' has no effect."] + #[inline(always)] + pub fn region76(&self) -> REGION76_R { + REGION76_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Enable protection for region 77. Write '0' has no effect."] + #[inline(always)] + pub fn region77(&self) -> REGION77_R { + REGION77_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Enable protection for region 78. Write '0' has no effect."] + #[inline(always)] + pub fn region78(&self) -> REGION78_R { + REGION78_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Enable protection for region 79. Write '0' has no effect."] + #[inline(always)] + pub fn region79(&self) -> REGION79_R { + REGION79_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Enable protection for region 80. Write '0' has no effect."] + #[inline(always)] + pub fn region80(&self) -> REGION80_R { + REGION80_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Enable protection for region 81. Write '0' has no effect."] + #[inline(always)] + pub fn region81(&self) -> REGION81_R { + REGION81_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Enable protection for region 82. Write '0' has no effect."] + #[inline(always)] + pub fn region82(&self) -> REGION82_R { + REGION82_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Enable protection for region 83. Write '0' has no effect."] + #[inline(always)] + pub fn region83(&self) -> REGION83_R { + REGION83_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Enable protection for region 84. Write '0' has no effect."] + #[inline(always)] + pub fn region84(&self) -> REGION84_R { + REGION84_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 21 - Enable protection for region 85. Write '0' has no effect."] + #[inline(always)] + pub fn region85(&self) -> REGION85_R { + REGION85_R::new(((self.bits >> 21) & 0x01) != 0) + } + #[doc = "Bit 22 - Enable protection for region 86. Write '0' has no effect."] + #[inline(always)] + pub fn region86(&self) -> REGION86_R { + REGION86_R::new(((self.bits >> 22) & 0x01) != 0) + } + #[doc = "Bit 23 - Enable protection for region 87. Write '0' has no effect."] + #[inline(always)] + pub fn region87(&self) -> REGION87_R { + REGION87_R::new(((self.bits >> 23) & 0x01) != 0) + } + #[doc = "Bit 24 - Enable protection for region 88. Write '0' has no effect."] + #[inline(always)] + pub fn region88(&self) -> REGION88_R { + REGION88_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Enable protection for region 89. Write '0' has no effect."] + #[inline(always)] + pub fn region89(&self) -> REGION89_R { + REGION89_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Enable protection for region 90. Write '0' has no effect."] + #[inline(always)] + pub fn region90(&self) -> REGION90_R { + REGION90_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Enable protection for region 91. Write '0' has no effect."] + #[inline(always)] + pub fn region91(&self) -> REGION91_R { + REGION91_R::new(((self.bits >> 27) & 0x01) != 0) + } + #[doc = "Bit 28 - Enable protection for region 92. Write '0' has no effect."] + #[inline(always)] + pub fn region92(&self) -> REGION92_R { + REGION92_R::new(((self.bits >> 28) & 0x01) != 0) + } + #[doc = "Bit 29 - Enable protection for region 93. Write '0' has no effect."] + #[inline(always)] + pub fn region93(&self) -> REGION93_R { + REGION93_R::new(((self.bits >> 29) & 0x01) != 0) + } + #[doc = "Bit 30 - Enable protection for region 94. Write '0' has no effect."] + #[inline(always)] + pub fn region94(&self) -> REGION94_R { + REGION94_R::new(((self.bits >> 30) & 0x01) != 0) + } + #[doc = "Bit 31 - Enable protection for region 95. Write '0' has no effect."] + #[inline(always)] + pub fn region95(&self) -> REGION95_R { + REGION95_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Enable protection for region 64. Write '0' has no effect."] + #[inline(always)] + pub fn region64(&mut self) -> REGION64_W { + REGION64_W { w: self } + } + #[doc = "Bit 1 - Enable protection for region 65. Write '0' has no effect."] + #[inline(always)] + pub fn region65(&mut self) -> REGION65_W { + REGION65_W { w: self } + } + #[doc = "Bit 2 - Enable protection for region 66. Write '0' has no effect."] + #[inline(always)] + pub fn region66(&mut self) -> REGION66_W { + REGION66_W { w: self } + } + #[doc = "Bit 3 - Enable protection for region 67. Write '0' has no effect."] + #[inline(always)] + pub fn region67(&mut self) -> REGION67_W { + REGION67_W { w: self } + } + #[doc = "Bit 4 - Enable protection for region 68. Write '0' has no effect."] + #[inline(always)] + pub fn region68(&mut self) -> REGION68_W { + REGION68_W { w: self } + } + #[doc = "Bit 5 - Enable protection for region 69. Write '0' has no effect."] + #[inline(always)] + pub fn region69(&mut self) -> REGION69_W { + REGION69_W { w: self } + } + #[doc = "Bit 6 - Enable protection for region 70. Write '0' has no effect."] + #[inline(always)] + pub fn region70(&mut self) -> REGION70_W { + REGION70_W { w: self } + } + #[doc = "Bit 7 - Enable protection for region 71. Write '0' has no effect."] + #[inline(always)] + pub fn region71(&mut self) -> REGION71_W { + REGION71_W { w: self } + } + #[doc = "Bit 8 - Enable protection for region 72. Write '0' has no effect."] + #[inline(always)] + pub fn region72(&mut self) -> REGION72_W { + REGION72_W { w: self } + } + #[doc = "Bit 9 - Enable protection for region 73. Write '0' has no effect."] + #[inline(always)] + pub fn region73(&mut self) -> REGION73_W { + REGION73_W { w: self } + } + #[doc = "Bit 10 - Enable protection for region 74. Write '0' has no effect."] + #[inline(always)] + pub fn region74(&mut self) -> REGION74_W { + REGION74_W { w: self } + } + #[doc = "Bit 11 - Enable protection for region 75. Write '0' has no effect."] + #[inline(always)] + pub fn region75(&mut self) -> REGION75_W { + REGION75_W { w: self } + } + #[doc = "Bit 12 - Enable protection for region 76. Write '0' has no effect."] + #[inline(always)] + pub fn region76(&mut self) -> REGION76_W { + REGION76_W { w: self } + } + #[doc = "Bit 13 - Enable protection for region 77. Write '0' has no effect."] + #[inline(always)] + pub fn region77(&mut self) -> REGION77_W { + REGION77_W { w: self } + } + #[doc = "Bit 14 - Enable protection for region 78. Write '0' has no effect."] + #[inline(always)] + pub fn region78(&mut self) -> REGION78_W { + REGION78_W { w: self } + } + #[doc = "Bit 15 - Enable protection for region 79. Write '0' has no effect."] + #[inline(always)] + pub fn region79(&mut self) -> REGION79_W { + REGION79_W { w: self } + } + #[doc = "Bit 16 - Enable protection for region 80. Write '0' has no effect."] + #[inline(always)] + pub fn region80(&mut self) -> REGION80_W { + REGION80_W { w: self } + } + #[doc = "Bit 17 - Enable protection for region 81. Write '0' has no effect."] + #[inline(always)] + pub fn region81(&mut self) -> REGION81_W { + REGION81_W { w: self } + } + #[doc = "Bit 18 - Enable protection for region 82. Write '0' has no effect."] + #[inline(always)] + pub fn region82(&mut self) -> REGION82_W { + REGION82_W { w: self } + } + #[doc = "Bit 19 - Enable protection for region 83. Write '0' has no effect."] + #[inline(always)] + pub fn region83(&mut self) -> REGION83_W { + REGION83_W { w: self } + } + #[doc = "Bit 20 - Enable protection for region 84. Write '0' has no effect."] + #[inline(always)] + pub fn region84(&mut self) -> REGION84_W { + REGION84_W { w: self } + } + #[doc = "Bit 21 - Enable protection for region 85. Write '0' has no effect."] + #[inline(always)] + pub fn region85(&mut self) -> REGION85_W { + REGION85_W { w: self } + } + #[doc = "Bit 22 - Enable protection for region 86. Write '0' has no effect."] + #[inline(always)] + pub fn region86(&mut self) -> REGION86_W { + REGION86_W { w: self } + } + #[doc = "Bit 23 - Enable protection for region 87. Write '0' has no effect."] + #[inline(always)] + pub fn region87(&mut self) -> REGION87_W { + REGION87_W { w: self } + } + #[doc = "Bit 24 - Enable protection for region 88. Write '0' has no effect."] + #[inline(always)] + pub fn region88(&mut self) -> REGION88_W { + REGION88_W { w: self } + } + #[doc = "Bit 25 - Enable protection for region 89. Write '0' has no effect."] + #[inline(always)] + pub fn region89(&mut self) -> REGION89_W { + REGION89_W { w: self } + } + #[doc = "Bit 26 - Enable protection for region 90. Write '0' has no effect."] + #[inline(always)] + pub fn region90(&mut self) -> REGION90_W { + REGION90_W { w: self } + } + #[doc = "Bit 27 - Enable protection for region 91. Write '0' has no effect."] + #[inline(always)] + pub fn region91(&mut self) -> REGION91_W { + REGION91_W { w: self } + } + #[doc = "Bit 28 - Enable protection for region 92. Write '0' has no effect."] + #[inline(always)] + pub fn region92(&mut self) -> REGION92_W { + REGION92_W { w: self } + } + #[doc = "Bit 29 - Enable protection for region 93. Write '0' has no effect."] + #[inline(always)] + pub fn region93(&mut self) -> REGION93_W { + REGION93_W { w: self } + } + #[doc = "Bit 30 - Enable protection for region 94. Write '0' has no effect."] + #[inline(always)] + pub fn region94(&mut self) -> REGION94_W { + REGION94_W { w: self } + } + #[doc = "Bit 31 - Enable protection for region 95. Write '0' has no effect."] + #[inline(always)] + pub fn region95(&mut self) -> REGION95_W { + REGION95_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Block protect configuration register 2\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [config2](index.html) module"] +pub struct CONFIG2_SPEC; +impl crate::RegisterSpec for CONFIG2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [config2::R](R) reader structure"] +impl crate::Readable for CONFIG2_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [config2::W](W) writer structure"] +impl crate::Writable for CONFIG2_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CONFIG2 to value 0"] +impl crate::Resettable for CONFIG2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/bprot/config3.rs b/src/bprot/config3.rs new file mode 100644 index 0000000..26c72f6 --- /dev/null +++ b/src/bprot/config3.rs @@ -0,0 +1,3042 @@ +#[doc = "Register `CONFIG3` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CONFIG3` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable protection for region 96. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION96_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION96_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION96` reader - Enable protection for region 96. Write '0' has no effect."] +pub struct REGION96_R(crate::FieldReader); +impl REGION96_R { + pub(crate) fn new(bits: bool) -> Self { + REGION96_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION96_A { + match self.bits { + false => REGION96_A::DISABLED, + true => REGION96_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION96_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION96_A::ENABLED + } +} +impl core::ops::Deref for REGION96_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION96` writer - Enable protection for region 96. Write '0' has no effect."] +pub struct REGION96_W<'a> { + w: &'a mut W, +} +impl<'a> REGION96_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION96_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION96_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION96_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Enable protection for region 97. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION97_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION97_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION97` reader - Enable protection for region 97. Write '0' has no effect."] +pub struct REGION97_R(crate::FieldReader); +impl REGION97_R { + pub(crate) fn new(bits: bool) -> Self { + REGION97_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION97_A { + match self.bits { + false => REGION97_A::DISABLED, + true => REGION97_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION97_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION97_A::ENABLED + } +} +impl core::ops::Deref for REGION97_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION97` writer - Enable protection for region 97. Write '0' has no effect."] +pub struct REGION97_W<'a> { + w: &'a mut W, +} +impl<'a> REGION97_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION97_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION97_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION97_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Enable protection for region 98. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION98_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION98_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION98` reader - Enable protection for region 98. Write '0' has no effect."] +pub struct REGION98_R(crate::FieldReader); +impl REGION98_R { + pub(crate) fn new(bits: bool) -> Self { + REGION98_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION98_A { + match self.bits { + false => REGION98_A::DISABLED, + true => REGION98_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION98_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION98_A::ENABLED + } +} +impl core::ops::Deref for REGION98_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION98` writer - Enable protection for region 98. Write '0' has no effect."] +pub struct REGION98_W<'a> { + w: &'a mut W, +} +impl<'a> REGION98_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION98_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION98_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION98_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Enable protection for region 99. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION99_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION99_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION99` reader - Enable protection for region 99. Write '0' has no effect."] +pub struct REGION99_R(crate::FieldReader); +impl REGION99_R { + pub(crate) fn new(bits: bool) -> Self { + REGION99_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION99_A { + match self.bits { + false => REGION99_A::DISABLED, + true => REGION99_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION99_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION99_A::ENABLED + } +} +impl core::ops::Deref for REGION99_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION99` writer - Enable protection for region 99. Write '0' has no effect."] +pub struct REGION99_W<'a> { + w: &'a mut W, +} +impl<'a> REGION99_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION99_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION99_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION99_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Enable protection for region 100. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION100_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION100_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION100` reader - Enable protection for region 100. Write '0' has no effect."] +pub struct REGION100_R(crate::FieldReader); +impl REGION100_R { + pub(crate) fn new(bits: bool) -> Self { + REGION100_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION100_A { + match self.bits { + false => REGION100_A::DISABLED, + true => REGION100_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION100_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION100_A::ENABLED + } +} +impl core::ops::Deref for REGION100_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION100` writer - Enable protection for region 100. Write '0' has no effect."] +pub struct REGION100_W<'a> { + w: &'a mut W, +} +impl<'a> REGION100_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION100_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION100_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION100_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Enable protection for region 101. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION101_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION101_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION101` reader - Enable protection for region 101. Write '0' has no effect."] +pub struct REGION101_R(crate::FieldReader); +impl REGION101_R { + pub(crate) fn new(bits: bool) -> Self { + REGION101_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION101_A { + match self.bits { + false => REGION101_A::DISABLED, + true => REGION101_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION101_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION101_A::ENABLED + } +} +impl core::ops::Deref for REGION101_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION101` writer - Enable protection for region 101. Write '0' has no effect."] +pub struct REGION101_W<'a> { + w: &'a mut W, +} +impl<'a> REGION101_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION101_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION101_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION101_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Enable protection for region 102. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION102_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION102_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION102` reader - Enable protection for region 102. Write '0' has no effect."] +pub struct REGION102_R(crate::FieldReader); +impl REGION102_R { + pub(crate) fn new(bits: bool) -> Self { + REGION102_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION102_A { + match self.bits { + false => REGION102_A::DISABLED, + true => REGION102_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION102_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION102_A::ENABLED + } +} +impl core::ops::Deref for REGION102_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION102` writer - Enable protection for region 102. Write '0' has no effect."] +pub struct REGION102_W<'a> { + w: &'a mut W, +} +impl<'a> REGION102_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION102_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION102_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION102_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Enable protection for region 103. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION103_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION103_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION103` reader - Enable protection for region 103. Write '0' has no effect."] +pub struct REGION103_R(crate::FieldReader); +impl REGION103_R { + pub(crate) fn new(bits: bool) -> Self { + REGION103_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION103_A { + match self.bits { + false => REGION103_A::DISABLED, + true => REGION103_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION103_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION103_A::ENABLED + } +} +impl core::ops::Deref for REGION103_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION103` writer - Enable protection for region 103. Write '0' has no effect."] +pub struct REGION103_W<'a> { + w: &'a mut W, +} +impl<'a> REGION103_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION103_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION103_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION103_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Enable protection for region 104. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION104_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION104_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION104` reader - Enable protection for region 104. Write '0' has no effect."] +pub struct REGION104_R(crate::FieldReader); +impl REGION104_R { + pub(crate) fn new(bits: bool) -> Self { + REGION104_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION104_A { + match self.bits { + false => REGION104_A::DISABLED, + true => REGION104_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION104_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION104_A::ENABLED + } +} +impl core::ops::Deref for REGION104_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION104` writer - Enable protection for region 104. Write '0' has no effect."] +pub struct REGION104_W<'a> { + w: &'a mut W, +} +impl<'a> REGION104_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION104_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION104_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION104_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Enable protection for region 105. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION105_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION105_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION105` reader - Enable protection for region 105. Write '0' has no effect."] +pub struct REGION105_R(crate::FieldReader); +impl REGION105_R { + pub(crate) fn new(bits: bool) -> Self { + REGION105_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION105_A { + match self.bits { + false => REGION105_A::DISABLED, + true => REGION105_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION105_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION105_A::ENABLED + } +} +impl core::ops::Deref for REGION105_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION105` writer - Enable protection for region 105. Write '0' has no effect."] +pub struct REGION105_W<'a> { + w: &'a mut W, +} +impl<'a> REGION105_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION105_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION105_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION105_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Enable protection for region 106. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION106_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION106_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION106` reader - Enable protection for region 106. Write '0' has no effect."] +pub struct REGION106_R(crate::FieldReader); +impl REGION106_R { + pub(crate) fn new(bits: bool) -> Self { + REGION106_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION106_A { + match self.bits { + false => REGION106_A::DISABLED, + true => REGION106_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION106_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION106_A::ENABLED + } +} +impl core::ops::Deref for REGION106_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION106` writer - Enable protection for region 106. Write '0' has no effect."] +pub struct REGION106_W<'a> { + w: &'a mut W, +} +impl<'a> REGION106_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION106_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION106_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION106_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Enable protection for region 107. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION107_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION107_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION107` reader - Enable protection for region 107. Write '0' has no effect."] +pub struct REGION107_R(crate::FieldReader); +impl REGION107_R { + pub(crate) fn new(bits: bool) -> Self { + REGION107_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION107_A { + match self.bits { + false => REGION107_A::DISABLED, + true => REGION107_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION107_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION107_A::ENABLED + } +} +impl core::ops::Deref for REGION107_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION107` writer - Enable protection for region 107. Write '0' has no effect."] +pub struct REGION107_W<'a> { + w: &'a mut W, +} +impl<'a> REGION107_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION107_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION107_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION107_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Enable protection for region 108. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION108_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION108_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION108` reader - Enable protection for region 108. Write '0' has no effect."] +pub struct REGION108_R(crate::FieldReader); +impl REGION108_R { + pub(crate) fn new(bits: bool) -> Self { + REGION108_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION108_A { + match self.bits { + false => REGION108_A::DISABLED, + true => REGION108_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION108_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION108_A::ENABLED + } +} +impl core::ops::Deref for REGION108_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION108` writer - Enable protection for region 108. Write '0' has no effect."] +pub struct REGION108_W<'a> { + w: &'a mut W, +} +impl<'a> REGION108_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION108_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION108_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION108_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Enable protection for region 109. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION109_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION109_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION109` reader - Enable protection for region 109. Write '0' has no effect."] +pub struct REGION109_R(crate::FieldReader); +impl REGION109_R { + pub(crate) fn new(bits: bool) -> Self { + REGION109_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION109_A { + match self.bits { + false => REGION109_A::DISABLED, + true => REGION109_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION109_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION109_A::ENABLED + } +} +impl core::ops::Deref for REGION109_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION109` writer - Enable protection for region 109. Write '0' has no effect."] +pub struct REGION109_W<'a> { + w: &'a mut W, +} +impl<'a> REGION109_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION109_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION109_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION109_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Enable protection for region 110. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION110_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION110_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION110` reader - Enable protection for region 110. Write '0' has no effect."] +pub struct REGION110_R(crate::FieldReader); +impl REGION110_R { + pub(crate) fn new(bits: bool) -> Self { + REGION110_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION110_A { + match self.bits { + false => REGION110_A::DISABLED, + true => REGION110_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION110_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION110_A::ENABLED + } +} +impl core::ops::Deref for REGION110_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION110` writer - Enable protection for region 110. Write '0' has no effect."] +pub struct REGION110_W<'a> { + w: &'a mut W, +} +impl<'a> REGION110_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION110_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION110_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION110_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Enable protection for region 111. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION111_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION111_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION111` reader - Enable protection for region 111. Write '0' has no effect."] +pub struct REGION111_R(crate::FieldReader); +impl REGION111_R { + pub(crate) fn new(bits: bool) -> Self { + REGION111_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION111_A { + match self.bits { + false => REGION111_A::DISABLED, + true => REGION111_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION111_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION111_A::ENABLED + } +} +impl core::ops::Deref for REGION111_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION111` writer - Enable protection for region 111. Write '0' has no effect."] +pub struct REGION111_W<'a> { + w: &'a mut W, +} +impl<'a> REGION111_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION111_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION111_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION111_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Enable protection for region 112. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION112_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION112_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION112` reader - Enable protection for region 112. Write '0' has no effect."] +pub struct REGION112_R(crate::FieldReader); +impl REGION112_R { + pub(crate) fn new(bits: bool) -> Self { + REGION112_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION112_A { + match self.bits { + false => REGION112_A::DISABLED, + true => REGION112_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION112_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION112_A::ENABLED + } +} +impl core::ops::Deref for REGION112_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION112` writer - Enable protection for region 112. Write '0' has no effect."] +pub struct REGION112_W<'a> { + w: &'a mut W, +} +impl<'a> REGION112_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION112_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION112_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION112_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Enable protection for region 113. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION113_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION113_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION113` reader - Enable protection for region 113. Write '0' has no effect."] +pub struct REGION113_R(crate::FieldReader); +impl REGION113_R { + pub(crate) fn new(bits: bool) -> Self { + REGION113_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION113_A { + match self.bits { + false => REGION113_A::DISABLED, + true => REGION113_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION113_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION113_A::ENABLED + } +} +impl core::ops::Deref for REGION113_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION113` writer - Enable protection for region 113. Write '0' has no effect."] +pub struct REGION113_W<'a> { + w: &'a mut W, +} +impl<'a> REGION113_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION113_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION113_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION113_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Enable protection for region 114. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION114_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION114_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION114` reader - Enable protection for region 114. Write '0' has no effect."] +pub struct REGION114_R(crate::FieldReader); +impl REGION114_R { + pub(crate) fn new(bits: bool) -> Self { + REGION114_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION114_A { + match self.bits { + false => REGION114_A::DISABLED, + true => REGION114_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION114_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION114_A::ENABLED + } +} +impl core::ops::Deref for REGION114_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION114` writer - Enable protection for region 114. Write '0' has no effect."] +pub struct REGION114_W<'a> { + w: &'a mut W, +} +impl<'a> REGION114_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION114_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION114_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION114_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Enable protection for region 115. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION115_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION115_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION115` reader - Enable protection for region 115. Write '0' has no effect."] +pub struct REGION115_R(crate::FieldReader); +impl REGION115_R { + pub(crate) fn new(bits: bool) -> Self { + REGION115_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION115_A { + match self.bits { + false => REGION115_A::DISABLED, + true => REGION115_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION115_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION115_A::ENABLED + } +} +impl core::ops::Deref for REGION115_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION115` writer - Enable protection for region 115. Write '0' has no effect."] +pub struct REGION115_W<'a> { + w: &'a mut W, +} +impl<'a> REGION115_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION115_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION115_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION115_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Enable protection for region 116. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION116_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION116_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION116` reader - Enable protection for region 116. Write '0' has no effect."] +pub struct REGION116_R(crate::FieldReader); +impl REGION116_R { + pub(crate) fn new(bits: bool) -> Self { + REGION116_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION116_A { + match self.bits { + false => REGION116_A::DISABLED, + true => REGION116_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION116_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION116_A::ENABLED + } +} +impl core::ops::Deref for REGION116_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION116` writer - Enable protection for region 116. Write '0' has no effect."] +pub struct REGION116_W<'a> { + w: &'a mut W, +} +impl<'a> REGION116_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION116_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION116_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION116_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Enable protection for region 117. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION117_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION117_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION117` reader - Enable protection for region 117. Write '0' has no effect."] +pub struct REGION117_R(crate::FieldReader); +impl REGION117_R { + pub(crate) fn new(bits: bool) -> Self { + REGION117_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION117_A { + match self.bits { + false => REGION117_A::DISABLED, + true => REGION117_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION117_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION117_A::ENABLED + } +} +impl core::ops::Deref for REGION117_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION117` writer - Enable protection for region 117. Write '0' has no effect."] +pub struct REGION117_W<'a> { + w: &'a mut W, +} +impl<'a> REGION117_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION117_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION117_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION117_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); + self.w + } +} +#[doc = "Enable protection for region 118. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION118_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION118_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION118` reader - Enable protection for region 118. Write '0' has no effect."] +pub struct REGION118_R(crate::FieldReader); +impl REGION118_R { + pub(crate) fn new(bits: bool) -> Self { + REGION118_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION118_A { + match self.bits { + false => REGION118_A::DISABLED, + true => REGION118_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION118_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION118_A::ENABLED + } +} +impl core::ops::Deref for REGION118_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION118` writer - Enable protection for region 118. Write '0' has no effect."] +pub struct REGION118_W<'a> { + w: &'a mut W, +} +impl<'a> REGION118_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION118_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION118_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION118_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); + self.w + } +} +#[doc = "Enable protection for region 119. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION119_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION119_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION119` reader - Enable protection for region 119. Write '0' has no effect."] +pub struct REGION119_R(crate::FieldReader); +impl REGION119_R { + pub(crate) fn new(bits: bool) -> Self { + REGION119_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION119_A { + match self.bits { + false => REGION119_A::DISABLED, + true => REGION119_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION119_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION119_A::ENABLED + } +} +impl core::ops::Deref for REGION119_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION119` writer - Enable protection for region 119. Write '0' has no effect."] +pub struct REGION119_W<'a> { + w: &'a mut W, +} +impl<'a> REGION119_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION119_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION119_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION119_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); + self.w + } +} +#[doc = "Enable protection for region 120. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION120_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION120_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION120` reader - Enable protection for region 120. Write '0' has no effect."] +pub struct REGION120_R(crate::FieldReader); +impl REGION120_R { + pub(crate) fn new(bits: bool) -> Self { + REGION120_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION120_A { + match self.bits { + false => REGION120_A::DISABLED, + true => REGION120_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION120_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION120_A::ENABLED + } +} +impl core::ops::Deref for REGION120_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION120` writer - Enable protection for region 120. Write '0' has no effect."] +pub struct REGION120_W<'a> { + w: &'a mut W, +} +impl<'a> REGION120_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION120_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION120_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION120_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Enable protection for region 121. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION121_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION121_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION121` reader - Enable protection for region 121. Write '0' has no effect."] +pub struct REGION121_R(crate::FieldReader); +impl REGION121_R { + pub(crate) fn new(bits: bool) -> Self { + REGION121_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION121_A { + match self.bits { + false => REGION121_A::DISABLED, + true => REGION121_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION121_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION121_A::ENABLED + } +} +impl core::ops::Deref for REGION121_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION121` writer - Enable protection for region 121. Write '0' has no effect."] +pub struct REGION121_W<'a> { + w: &'a mut W, +} +impl<'a> REGION121_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION121_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION121_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION121_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Enable protection for region 122. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION122_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION122_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION122` reader - Enable protection for region 122. Write '0' has no effect."] +pub struct REGION122_R(crate::FieldReader); +impl REGION122_R { + pub(crate) fn new(bits: bool) -> Self { + REGION122_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION122_A { + match self.bits { + false => REGION122_A::DISABLED, + true => REGION122_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION122_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION122_A::ENABLED + } +} +impl core::ops::Deref for REGION122_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION122` writer - Enable protection for region 122. Write '0' has no effect."] +pub struct REGION122_W<'a> { + w: &'a mut W, +} +impl<'a> REGION122_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION122_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION122_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION122_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Enable protection for region 123. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION123_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION123_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION123` reader - Enable protection for region 123. Write '0' has no effect."] +pub struct REGION123_R(crate::FieldReader); +impl REGION123_R { + pub(crate) fn new(bits: bool) -> Self { + REGION123_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION123_A { + match self.bits { + false => REGION123_A::DISABLED, + true => REGION123_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION123_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION123_A::ENABLED + } +} +impl core::ops::Deref for REGION123_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION123` writer - Enable protection for region 123. Write '0' has no effect."] +pub struct REGION123_W<'a> { + w: &'a mut W, +} +impl<'a> REGION123_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION123_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION123_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION123_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +#[doc = "Enable protection for region 124. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION124_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION124_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION124` reader - Enable protection for region 124. Write '0' has no effect."] +pub struct REGION124_R(crate::FieldReader); +impl REGION124_R { + pub(crate) fn new(bits: bool) -> Self { + REGION124_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION124_A { + match self.bits { + false => REGION124_A::DISABLED, + true => REGION124_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION124_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION124_A::ENABLED + } +} +impl core::ops::Deref for REGION124_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION124` writer - Enable protection for region 124. Write '0' has no effect."] +pub struct REGION124_W<'a> { + w: &'a mut W, +} +impl<'a> REGION124_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION124_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION124_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION124_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); + self.w + } +} +#[doc = "Enable protection for region 125. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION125_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION125_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION125` reader - Enable protection for region 125. Write '0' has no effect."] +pub struct REGION125_R(crate::FieldReader); +impl REGION125_R { + pub(crate) fn new(bits: bool) -> Self { + REGION125_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION125_A { + match self.bits { + false => REGION125_A::DISABLED, + true => REGION125_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION125_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION125_A::ENABLED + } +} +impl core::ops::Deref for REGION125_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION125` writer - Enable protection for region 125. Write '0' has no effect."] +pub struct REGION125_W<'a> { + w: &'a mut W, +} +impl<'a> REGION125_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION125_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION125_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION125_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); + self.w + } +} +#[doc = "Enable protection for region 126. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION126_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION126_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION126` reader - Enable protection for region 126. Write '0' has no effect."] +pub struct REGION126_R(crate::FieldReader); +impl REGION126_R { + pub(crate) fn new(bits: bool) -> Self { + REGION126_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION126_A { + match self.bits { + false => REGION126_A::DISABLED, + true => REGION126_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION126_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION126_A::ENABLED + } +} +impl core::ops::Deref for REGION126_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION126` writer - Enable protection for region 126. Write '0' has no effect."] +pub struct REGION126_W<'a> { + w: &'a mut W, +} +impl<'a> REGION126_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION126_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION126_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION126_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); + self.w + } +} +#[doc = "Enable protection for region 127. Write '0' has no effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION127_A { + #[doc = "0: Protection disabled"] + DISABLED = 0, + #[doc = "1: Protection enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION127_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION127` reader - Enable protection for region 127. Write '0' has no effect."] +pub struct REGION127_R(crate::FieldReader); +impl REGION127_R { + pub(crate) fn new(bits: bool) -> Self { + REGION127_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION127_A { + match self.bits { + false => REGION127_A::DISABLED, + true => REGION127_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION127_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION127_A::ENABLED + } +} +impl core::ops::Deref for REGION127_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION127` writer - Enable protection for region 127. Write '0' has no effect."] +pub struct REGION127_W<'a> { + w: &'a mut W, +} +impl<'a> REGION127_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION127_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Protection disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION127_A::DISABLED) + } + #[doc = "Protection enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION127_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable protection for region 96. Write '0' has no effect."] + #[inline(always)] + pub fn region96(&self) -> REGION96_R { + REGION96_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Enable protection for region 97. Write '0' has no effect."] + #[inline(always)] + pub fn region97(&self) -> REGION97_R { + REGION97_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Enable protection for region 98. Write '0' has no effect."] + #[inline(always)] + pub fn region98(&self) -> REGION98_R { + REGION98_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Enable protection for region 99. Write '0' has no effect."] + #[inline(always)] + pub fn region99(&self) -> REGION99_R { + REGION99_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Enable protection for region 100. Write '0' has no effect."] + #[inline(always)] + pub fn region100(&self) -> REGION100_R { + REGION100_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Enable protection for region 101. Write '0' has no effect."] + #[inline(always)] + pub fn region101(&self) -> REGION101_R { + REGION101_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Enable protection for region 102. Write '0' has no effect."] + #[inline(always)] + pub fn region102(&self) -> REGION102_R { + REGION102_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Enable protection for region 103. Write '0' has no effect."] + #[inline(always)] + pub fn region103(&self) -> REGION103_R { + REGION103_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Enable protection for region 104. Write '0' has no effect."] + #[inline(always)] + pub fn region104(&self) -> REGION104_R { + REGION104_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Enable protection for region 105. Write '0' has no effect."] + #[inline(always)] + pub fn region105(&self) -> REGION105_R { + REGION105_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Enable protection for region 106. Write '0' has no effect."] + #[inline(always)] + pub fn region106(&self) -> REGION106_R { + REGION106_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Enable protection for region 107. Write '0' has no effect."] + #[inline(always)] + pub fn region107(&self) -> REGION107_R { + REGION107_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Enable protection for region 108. Write '0' has no effect."] + #[inline(always)] + pub fn region108(&self) -> REGION108_R { + REGION108_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Enable protection for region 109. Write '0' has no effect."] + #[inline(always)] + pub fn region109(&self) -> REGION109_R { + REGION109_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Enable protection for region 110. Write '0' has no effect."] + #[inline(always)] + pub fn region110(&self) -> REGION110_R { + REGION110_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Enable protection for region 111. Write '0' has no effect."] + #[inline(always)] + pub fn region111(&self) -> REGION111_R { + REGION111_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Enable protection for region 112. Write '0' has no effect."] + #[inline(always)] + pub fn region112(&self) -> REGION112_R { + REGION112_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Enable protection for region 113. Write '0' has no effect."] + #[inline(always)] + pub fn region113(&self) -> REGION113_R { + REGION113_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Enable protection for region 114. Write '0' has no effect."] + #[inline(always)] + pub fn region114(&self) -> REGION114_R { + REGION114_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Enable protection for region 115. Write '0' has no effect."] + #[inline(always)] + pub fn region115(&self) -> REGION115_R { + REGION115_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Enable protection for region 116. Write '0' has no effect."] + #[inline(always)] + pub fn region116(&self) -> REGION116_R { + REGION116_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 21 - Enable protection for region 117. Write '0' has no effect."] + #[inline(always)] + pub fn region117(&self) -> REGION117_R { + REGION117_R::new(((self.bits >> 21) & 0x01) != 0) + } + #[doc = "Bit 22 - Enable protection for region 118. Write '0' has no effect."] + #[inline(always)] + pub fn region118(&self) -> REGION118_R { + REGION118_R::new(((self.bits >> 22) & 0x01) != 0) + } + #[doc = "Bit 23 - Enable protection for region 119. Write '0' has no effect."] + #[inline(always)] + pub fn region119(&self) -> REGION119_R { + REGION119_R::new(((self.bits >> 23) & 0x01) != 0) + } + #[doc = "Bit 24 - Enable protection for region 120. Write '0' has no effect."] + #[inline(always)] + pub fn region120(&self) -> REGION120_R { + REGION120_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Enable protection for region 121. Write '0' has no effect."] + #[inline(always)] + pub fn region121(&self) -> REGION121_R { + REGION121_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Enable protection for region 122. Write '0' has no effect."] + #[inline(always)] + pub fn region122(&self) -> REGION122_R { + REGION122_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Enable protection for region 123. Write '0' has no effect."] + #[inline(always)] + pub fn region123(&self) -> REGION123_R { + REGION123_R::new(((self.bits >> 27) & 0x01) != 0) + } + #[doc = "Bit 28 - Enable protection for region 124. Write '0' has no effect."] + #[inline(always)] + pub fn region124(&self) -> REGION124_R { + REGION124_R::new(((self.bits >> 28) & 0x01) != 0) + } + #[doc = "Bit 29 - Enable protection for region 125. Write '0' has no effect."] + #[inline(always)] + pub fn region125(&self) -> REGION125_R { + REGION125_R::new(((self.bits >> 29) & 0x01) != 0) + } + #[doc = "Bit 30 - Enable protection for region 126. Write '0' has no effect."] + #[inline(always)] + pub fn region126(&self) -> REGION126_R { + REGION126_R::new(((self.bits >> 30) & 0x01) != 0) + } + #[doc = "Bit 31 - Enable protection for region 127. Write '0' has no effect."] + #[inline(always)] + pub fn region127(&self) -> REGION127_R { + REGION127_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Enable protection for region 96. Write '0' has no effect."] + #[inline(always)] + pub fn region96(&mut self) -> REGION96_W { + REGION96_W { w: self } + } + #[doc = "Bit 1 - Enable protection for region 97. Write '0' has no effect."] + #[inline(always)] + pub fn region97(&mut self) -> REGION97_W { + REGION97_W { w: self } + } + #[doc = "Bit 2 - Enable protection for region 98. Write '0' has no effect."] + #[inline(always)] + pub fn region98(&mut self) -> REGION98_W { + REGION98_W { w: self } + } + #[doc = "Bit 3 - Enable protection for region 99. Write '0' has no effect."] + #[inline(always)] + pub fn region99(&mut self) -> REGION99_W { + REGION99_W { w: self } + } + #[doc = "Bit 4 - Enable protection for region 100. Write '0' has no effect."] + #[inline(always)] + pub fn region100(&mut self) -> REGION100_W { + REGION100_W { w: self } + } + #[doc = "Bit 5 - Enable protection for region 101. Write '0' has no effect."] + #[inline(always)] + pub fn region101(&mut self) -> REGION101_W { + REGION101_W { w: self } + } + #[doc = "Bit 6 - Enable protection for region 102. Write '0' has no effect."] + #[inline(always)] + pub fn region102(&mut self) -> REGION102_W { + REGION102_W { w: self } + } + #[doc = "Bit 7 - Enable protection for region 103. Write '0' has no effect."] + #[inline(always)] + pub fn region103(&mut self) -> REGION103_W { + REGION103_W { w: self } + } + #[doc = "Bit 8 - Enable protection for region 104. Write '0' has no effect."] + #[inline(always)] + pub fn region104(&mut self) -> REGION104_W { + REGION104_W { w: self } + } + #[doc = "Bit 9 - Enable protection for region 105. Write '0' has no effect."] + #[inline(always)] + pub fn region105(&mut self) -> REGION105_W { + REGION105_W { w: self } + } + #[doc = "Bit 10 - Enable protection for region 106. Write '0' has no effect."] + #[inline(always)] + pub fn region106(&mut self) -> REGION106_W { + REGION106_W { w: self } + } + #[doc = "Bit 11 - Enable protection for region 107. Write '0' has no effect."] + #[inline(always)] + pub fn region107(&mut self) -> REGION107_W { + REGION107_W { w: self } + } + #[doc = "Bit 12 - Enable protection for region 108. Write '0' has no effect."] + #[inline(always)] + pub fn region108(&mut self) -> REGION108_W { + REGION108_W { w: self } + } + #[doc = "Bit 13 - Enable protection for region 109. Write '0' has no effect."] + #[inline(always)] + pub fn region109(&mut self) -> REGION109_W { + REGION109_W { w: self } + } + #[doc = "Bit 14 - Enable protection for region 110. Write '0' has no effect."] + #[inline(always)] + pub fn region110(&mut self) -> REGION110_W { + REGION110_W { w: self } + } + #[doc = "Bit 15 - Enable protection for region 111. Write '0' has no effect."] + #[inline(always)] + pub fn region111(&mut self) -> REGION111_W { + REGION111_W { w: self } + } + #[doc = "Bit 16 - Enable protection for region 112. Write '0' has no effect."] + #[inline(always)] + pub fn region112(&mut self) -> REGION112_W { + REGION112_W { w: self } + } + #[doc = "Bit 17 - Enable protection for region 113. Write '0' has no effect."] + #[inline(always)] + pub fn region113(&mut self) -> REGION113_W { + REGION113_W { w: self } + } + #[doc = "Bit 18 - Enable protection for region 114. Write '0' has no effect."] + #[inline(always)] + pub fn region114(&mut self) -> REGION114_W { + REGION114_W { w: self } + } + #[doc = "Bit 19 - Enable protection for region 115. Write '0' has no effect."] + #[inline(always)] + pub fn region115(&mut self) -> REGION115_W { + REGION115_W { w: self } + } + #[doc = "Bit 20 - Enable protection for region 116. Write '0' has no effect."] + #[inline(always)] + pub fn region116(&mut self) -> REGION116_W { + REGION116_W { w: self } + } + #[doc = "Bit 21 - Enable protection for region 117. Write '0' has no effect."] + #[inline(always)] + pub fn region117(&mut self) -> REGION117_W { + REGION117_W { w: self } + } + #[doc = "Bit 22 - Enable protection for region 118. Write '0' has no effect."] + #[inline(always)] + pub fn region118(&mut self) -> REGION118_W { + REGION118_W { w: self } + } + #[doc = "Bit 23 - Enable protection for region 119. Write '0' has no effect."] + #[inline(always)] + pub fn region119(&mut self) -> REGION119_W { + REGION119_W { w: self } + } + #[doc = "Bit 24 - Enable protection for region 120. Write '0' has no effect."] + #[inline(always)] + pub fn region120(&mut self) -> REGION120_W { + REGION120_W { w: self } + } + #[doc = "Bit 25 - Enable protection for region 121. Write '0' has no effect."] + #[inline(always)] + pub fn region121(&mut self) -> REGION121_W { + REGION121_W { w: self } + } + #[doc = "Bit 26 - Enable protection for region 122. Write '0' has no effect."] + #[inline(always)] + pub fn region122(&mut self) -> REGION122_W { + REGION122_W { w: self } + } + #[doc = "Bit 27 - Enable protection for region 123. Write '0' has no effect."] + #[inline(always)] + pub fn region123(&mut self) -> REGION123_W { + REGION123_W { w: self } + } + #[doc = "Bit 28 - Enable protection for region 124. Write '0' has no effect."] + #[inline(always)] + pub fn region124(&mut self) -> REGION124_W { + REGION124_W { w: self } + } + #[doc = "Bit 29 - Enable protection for region 125. Write '0' has no effect."] + #[inline(always)] + pub fn region125(&mut self) -> REGION125_W { + REGION125_W { w: self } + } + #[doc = "Bit 30 - Enable protection for region 126. Write '0' has no effect."] + #[inline(always)] + pub fn region126(&mut self) -> REGION126_W { + REGION126_W { w: self } + } + #[doc = "Bit 31 - Enable protection for region 127. Write '0' has no effect."] + #[inline(always)] + pub fn region127(&mut self) -> REGION127_W { + REGION127_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Block protect configuration register 3\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [config3](index.html) module"] +pub struct CONFIG3_SPEC; +impl crate::RegisterSpec for CONFIG3_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [config3::R](R) reader structure"] +impl crate::Readable for CONFIG3_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [config3::W](W) writer structure"] +impl crate::Writable for CONFIG3_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CONFIG3 to value 0"] +impl crate::Resettable for CONFIG3_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/bprot/disableindebug.rs b/src/bprot/disableindebug.rs new file mode 100644 index 0000000..e9c9035 --- /dev/null +++ b/src/bprot/disableindebug.rs @@ -0,0 +1,159 @@ +#[doc = "Register `DISABLEINDEBUG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DISABLEINDEBUG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Disable the protection mechanism for NVM regions while in debug interface mode. This register will only disable the protection mechanism if the device is in debug interface mode.\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DISABLEINDEBUG_A { + #[doc = "1: Disable in debug"] + DISABLED = 1, + #[doc = "0: Enable in debug"] + ENABLED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: DISABLEINDEBUG_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DISABLEINDEBUG` reader - Disable the protection mechanism for NVM regions while in debug interface mode. This register will only disable the protection mechanism if the device is in debug interface mode."] +pub struct DISABLEINDEBUG_R(crate::FieldReader); +impl DISABLEINDEBUG_R { + pub(crate) fn new(bits: bool) -> Self { + DISABLEINDEBUG_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DISABLEINDEBUG_A { + match self.bits { + true => DISABLEINDEBUG_A::DISABLED, + false => DISABLEINDEBUG_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DISABLEINDEBUG_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DISABLEINDEBUG_A::ENABLED + } +} +impl core::ops::Deref for DISABLEINDEBUG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DISABLEINDEBUG` writer - Disable the protection mechanism for NVM regions while in debug interface mode. This register will only disable the protection mechanism if the device is in debug interface mode."] +pub struct DISABLEINDEBUG_W<'a> { + w: &'a mut W, +} +impl<'a> DISABLEINDEBUG_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DISABLEINDEBUG_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable in debug"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(DISABLEINDEBUG_A::DISABLED) + } + #[doc = "Enable in debug"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(DISABLEINDEBUG_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Disable the protection mechanism for NVM regions while in debug interface mode. This register will only disable the protection mechanism if the device is in debug interface mode."] + #[inline(always)] + pub fn disableindebug(&self) -> DISABLEINDEBUG_R { + DISABLEINDEBUG_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Disable the protection mechanism for NVM regions while in debug interface mode. This register will only disable the protection mechanism if the device is in debug interface mode."] + #[inline(always)] + pub fn disableindebug(&mut self) -> DISABLEINDEBUG_W { + DISABLEINDEBUG_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable protection mechanism in debug interface mode\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [disableindebug](index.html) module"] +pub struct DISABLEINDEBUG_SPEC; +impl crate::RegisterSpec for DISABLEINDEBUG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [disableindebug::R](R) reader structure"] +impl crate::Readable for DISABLEINDEBUG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [disableindebug::W](W) writer structure"] +impl crate::Writable for DISABLEINDEBUG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DISABLEINDEBUG to value 0x01"] +impl crate::Resettable for DISABLEINDEBUG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x01 + } +} diff --git a/src/bprot/unused0.rs b/src/bprot/unused0.rs new file mode 100644 index 0000000..c1af181 --- /dev/null +++ b/src/bprot/unused0.rs @@ -0,0 +1,64 @@ +#[doc = "Register `UNUSED0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `UNUSED0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Unspecified\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [unused0](index.html) module"] +pub struct UNUSED0_SPEC; +impl crate::RegisterSpec for UNUSED0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [unused0::R](R) reader structure"] +impl crate::Readable for UNUSED0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [unused0::W](W) writer structure"] +impl crate::Writable for UNUSED0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets UNUSED0 to value 0"] +impl crate::Resettable for UNUSED0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccm.rs b/src/ccm.rs new file mode 100644 index 0000000..6b98a96 --- /dev/null +++ b/src/ccm.rs @@ -0,0 +1,105 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "0x00 - Start generation of key-stream. This operation will stop by itself when completed."] + pub tasks_ksgen: crate::Reg, + #[doc = "0x04 - Start encryption/decryption. This operation will stop by itself when completed."] + pub tasks_crypt: crate::Reg, + #[doc = "0x08 - Stop encryption/decryption"] + pub tasks_stop: crate::Reg, + _reserved3: [u8; 0xf4], + #[doc = "0x100 - Key-stream generation complete"] + pub events_endksgen: crate::Reg, + #[doc = "0x104 - Encrypt/decrypt complete"] + pub events_endcrypt: crate::Reg, + #[doc = "0x108 - CCM error event"] + pub events_error: crate::Reg, + _reserved6: [u8; 0xf4], + #[doc = "0x200 - Shortcut register"] + pub shorts: crate::Reg, + _reserved7: [u8; 0x0100], + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved9: [u8; 0xf4], + #[doc = "0x400 - MIC check result"] + pub micstatus: crate::Reg, + _reserved10: [u8; 0xfc], + #[doc = "0x500 - Enable"] + pub enable: crate::Reg, + #[doc = "0x504 - Operation mode"] + pub mode: crate::Reg, + #[doc = "0x508 - Pointer to data structure holding AES key and NONCE vector"] + pub cnfptr: crate::Reg, + #[doc = "0x50c - Input pointer"] + pub inptr: crate::Reg, + #[doc = "0x510 - Output pointer"] + pub outptr: crate::Reg, + #[doc = "0x514 - Pointer to data area used for temporary storage"] + pub scratchptr: crate::Reg, +} +#[doc = "TASKS_KSGEN register accessor: an alias for `Reg`"] +pub type TASKS_KSGEN = crate::Reg; +#[doc = "Start generation of key-stream. This operation will stop by itself when completed."] +pub mod tasks_ksgen; +#[doc = "TASKS_CRYPT register accessor: an alias for `Reg`"] +pub type TASKS_CRYPT = crate::Reg; +#[doc = "Start encryption/decryption. This operation will stop by itself when completed."] +pub mod tasks_crypt; +#[doc = "TASKS_STOP register accessor: an alias for `Reg`"] +pub type TASKS_STOP = crate::Reg; +#[doc = "Stop encryption/decryption"] +pub mod tasks_stop; +#[doc = "EVENTS_ENDKSGEN register accessor: an alias for `Reg`"] +pub type EVENTS_ENDKSGEN = crate::Reg; +#[doc = "Key-stream generation complete"] +pub mod events_endksgen; +#[doc = "EVENTS_ENDCRYPT register accessor: an alias for `Reg`"] +pub type EVENTS_ENDCRYPT = crate::Reg; +#[doc = "Encrypt/decrypt complete"] +pub mod events_endcrypt; +#[doc = "EVENTS_ERROR register accessor: an alias for `Reg`"] +pub type EVENTS_ERROR = crate::Reg; +#[doc = "CCM error event"] +pub mod events_error; +#[doc = "SHORTS register accessor: an alias for `Reg`"] +pub type SHORTS = crate::Reg; +#[doc = "Shortcut register"] +pub mod shorts; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "MICSTATUS register accessor: an alias for `Reg`"] +pub type MICSTATUS = crate::Reg; +#[doc = "MIC check result"] +pub mod micstatus; +#[doc = "ENABLE register accessor: an alias for `Reg`"] +pub type ENABLE = crate::Reg; +#[doc = "Enable"] +pub mod enable; +#[doc = "MODE register accessor: an alias for `Reg`"] +pub type MODE = crate::Reg; +#[doc = "Operation mode"] +pub mod mode; +#[doc = "CNFPTR register accessor: an alias for `Reg`"] +pub type CNFPTR = crate::Reg; +#[doc = "Pointer to data structure holding AES key and NONCE vector"] +pub mod cnfptr; +#[doc = "INPTR register accessor: an alias for `Reg`"] +pub type INPTR = crate::Reg; +#[doc = "Input pointer"] +pub mod inptr; +#[doc = "OUTPTR register accessor: an alias for `Reg`"] +pub type OUTPTR = crate::Reg; +#[doc = "Output pointer"] +pub mod outptr; +#[doc = "SCRATCHPTR register accessor: an alias for `Reg`"] +pub type SCRATCHPTR = crate::Reg; +#[doc = "Pointer to data area used for temporary storage"] +pub mod scratchptr; diff --git a/src/ccm/cnfptr.rs b/src/ccm/cnfptr.rs new file mode 100644 index 0000000..fd2c298 --- /dev/null +++ b/src/ccm/cnfptr.rs @@ -0,0 +1,102 @@ +#[doc = "Register `CNFPTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CNFPTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CNFPTR` reader - Pointer to the data structure holding the AES key and the CCM NONCE vector (see Table 1 CCM data structure overview)"] +pub struct CNFPTR_R(crate::FieldReader); +impl CNFPTR_R { + pub(crate) fn new(bits: u32) -> Self { + CNFPTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CNFPTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CNFPTR` writer - Pointer to the data structure holding the AES key and the CCM NONCE vector (see Table 1 CCM data structure overview)"] +pub struct CNFPTR_W<'a> { + w: &'a mut W, +} +impl<'a> CNFPTR_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Pointer to the data structure holding the AES key and the CCM NONCE vector (see Table 1 CCM data structure overview)"] + #[inline(always)] + pub fn cnfptr(&self) -> CNFPTR_R { + CNFPTR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Pointer to the data structure holding the AES key and the CCM NONCE vector (see Table 1 CCM data structure overview)"] + #[inline(always)] + pub fn cnfptr(&mut self) -> CNFPTR_W { + CNFPTR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pointer to data structure holding AES key and NONCE vector\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cnfptr](index.html) module"] +pub struct CNFPTR_SPEC; +impl crate::RegisterSpec for CNFPTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cnfptr::R](R) reader structure"] +impl crate::Readable for CNFPTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [cnfptr::W](W) writer structure"] +impl crate::Writable for CNFPTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CNFPTR to value 0"] +impl crate::Resettable for CNFPTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccm/enable.rs b/src/ccm/enable.rs new file mode 100644 index 0000000..0a8b8b3 --- /dev/null +++ b/src/ccm/enable.rs @@ -0,0 +1,151 @@ +#[doc = "Register `ENABLE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ENABLE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable CCM\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum ENABLE_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "2: Enable"] + ENABLED = 2, +} +impl From for u8 { + #[inline(always)] + fn from(variant: ENABLE_A) -> Self { + variant as _ + } +} +#[doc = "Field `ENABLE` reader - Enable or disable CCM"] +pub struct ENABLE_R(crate::FieldReader); +impl ENABLE_R { + pub(crate) fn new(bits: u8) -> Self { + ENABLE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(ENABLE_A::DISABLED), + 2 => Some(ENABLE_A::ENABLED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENABLE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENABLE_A::ENABLED + } +} +impl core::ops::Deref for ENABLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENABLE` writer - Enable or disable CCM"] +pub struct ENABLE_W<'a> { + w: &'a mut W, +} +impl<'a> ENABLE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENABLE_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENABLE_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENABLE_A::ENABLED) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); + self.w + } +} +impl R { + #[doc = "Bits 0:1 - Enable or disable CCM"] + #[inline(always)] + pub fn enable(&self) -> ENABLE_R { + ENABLE_R::new((self.bits & 0x03) as u8) + } +} +impl W { + #[doc = "Bits 0:1 - Enable or disable CCM"] + #[inline(always)] + pub fn enable(&mut self) -> ENABLE_W { + ENABLE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [enable](index.html) module"] +pub struct ENABLE_SPEC; +impl crate::RegisterSpec for ENABLE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [enable::R](R) reader structure"] +impl crate::Readable for ENABLE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [enable::W](W) writer structure"] +impl crate::Writable for ENABLE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ENABLE to value 0"] +impl crate::Resettable for ENABLE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccm/events_endcrypt.rs b/src/ccm/events_endcrypt.rs new file mode 100644 index 0000000..723eb96 --- /dev/null +++ b/src/ccm/events_endcrypt.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_ENDCRYPT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_ENDCRYPT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Encrypt/decrypt complete\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_endcrypt](index.html) module"] +pub struct EVENTS_ENDCRYPT_SPEC; +impl crate::RegisterSpec for EVENTS_ENDCRYPT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_endcrypt::R](R) reader structure"] +impl crate::Readable for EVENTS_ENDCRYPT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_endcrypt::W](W) writer structure"] +impl crate::Writable for EVENTS_ENDCRYPT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_ENDCRYPT to value 0"] +impl crate::Resettable for EVENTS_ENDCRYPT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccm/events_endksgen.rs b/src/ccm/events_endksgen.rs new file mode 100644 index 0000000..4fac18c --- /dev/null +++ b/src/ccm/events_endksgen.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_ENDKSGEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_ENDKSGEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Key-stream generation complete\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_endksgen](index.html) module"] +pub struct EVENTS_ENDKSGEN_SPEC; +impl crate::RegisterSpec for EVENTS_ENDKSGEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_endksgen::R](R) reader structure"] +impl crate::Readable for EVENTS_ENDKSGEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_endksgen::W](W) writer structure"] +impl crate::Writable for EVENTS_ENDKSGEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_ENDKSGEN to value 0"] +impl crate::Resettable for EVENTS_ENDKSGEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccm/events_error.rs b/src/ccm/events_error.rs new file mode 100644 index 0000000..ea1a4e2 --- /dev/null +++ b/src/ccm/events_error.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_ERROR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_ERROR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "CCM error event\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_error](index.html) module"] +pub struct EVENTS_ERROR_SPEC; +impl crate::RegisterSpec for EVENTS_ERROR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_error::R](R) reader structure"] +impl crate::Readable for EVENTS_ERROR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_error::W](W) writer structure"] +impl crate::Writable for EVENTS_ERROR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_ERROR to value 0"] +impl crate::Resettable for EVENTS_ERROR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccm/inptr.rs b/src/ccm/inptr.rs new file mode 100644 index 0000000..62659b5 --- /dev/null +++ b/src/ccm/inptr.rs @@ -0,0 +1,102 @@ +#[doc = "Register `INPTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INPTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `INPTR` reader - Input pointer"] +pub struct INPTR_R(crate::FieldReader); +impl INPTR_R { + pub(crate) fn new(bits: u32) -> Self { + INPTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for INPTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INPTR` writer - Input pointer"] +pub struct INPTR_W<'a> { + w: &'a mut W, +} +impl<'a> INPTR_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Input pointer"] + #[inline(always)] + pub fn inptr(&self) -> INPTR_R { + INPTR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Input pointer"] + #[inline(always)] + pub fn inptr(&mut self) -> INPTR_W { + INPTR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Input pointer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [inptr](index.html) module"] +pub struct INPTR_SPEC; +impl crate::RegisterSpec for INPTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [inptr::R](R) reader structure"] +impl crate::Readable for INPTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [inptr::W](W) writer structure"] +impl crate::Writable for INPTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INPTR to value 0"] +impl crate::Resettable for INPTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccm/intenclr.rs b/src/ccm/intenclr.rs new file mode 100644 index 0000000..b1d3bcf --- /dev/null +++ b/src/ccm/intenclr.rs @@ -0,0 +1,366 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for ENDKSGEN event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDKSGEN_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDKSGEN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDKSGEN` reader - Write '1' to Disable interrupt for ENDKSGEN event"] +pub struct ENDKSGEN_R(crate::FieldReader); +impl ENDKSGEN_R { + pub(crate) fn new(bits: bool) -> Self { + ENDKSGEN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDKSGEN_A { + match self.bits { + false => ENDKSGEN_A::DISABLED, + true => ENDKSGEN_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENDKSGEN_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENDKSGEN_A::ENABLED + } +} +impl core::ops::Deref for ENDKSGEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for ENDKSGEN event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDKSGEN_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDKSGEN_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDKSGEN` writer - Write '1' to Disable interrupt for ENDKSGEN event"] +pub struct ENDKSGEN_W<'a> { + w: &'a mut W, +} +impl<'a> ENDKSGEN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDKSGEN_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(ENDKSGEN_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for ENDCRYPT event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDCRYPT_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDCRYPT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDCRYPT` reader - Write '1' to Disable interrupt for ENDCRYPT event"] +pub struct ENDCRYPT_R(crate::FieldReader); +impl ENDCRYPT_R { + pub(crate) fn new(bits: bool) -> Self { + ENDCRYPT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDCRYPT_A { + match self.bits { + false => ENDCRYPT_A::DISABLED, + true => ENDCRYPT_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENDCRYPT_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENDCRYPT_A::ENABLED + } +} +impl core::ops::Deref for ENDCRYPT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for ENDCRYPT event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDCRYPT_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDCRYPT_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDCRYPT` writer - Write '1' to Disable interrupt for ENDCRYPT event"] +pub struct ENDCRYPT_W<'a> { + w: &'a mut W, +} +impl<'a> ENDCRYPT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDCRYPT_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(ENDCRYPT_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` reader - Write '1' to Disable interrupt for ERROR event"] +pub struct ERROR_R(crate::FieldReader); +impl ERROR_R { + pub(crate) fn new(bits: bool) -> Self { + ERROR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ERROR_A { + match self.bits { + false => ERROR_A::DISABLED, + true => ERROR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ERROR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ERROR_A::ENABLED + } +} +impl core::ops::Deref for ERROR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` writer - Write '1' to Disable interrupt for ERROR event"] +pub struct ERROR_W<'a> { + w: &'a mut W, +} +impl<'a> ERROR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ERROR_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(ERROR_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Disable interrupt for ENDKSGEN event"] + #[inline(always)] + pub fn endksgen(&self) -> ENDKSGEN_R { + ENDKSGEN_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for ENDCRYPT event"] + #[inline(always)] + pub fn endcrypt(&self) -> ENDCRYPT_R { + ENDCRYPT_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&self) -> ERROR_R { + ERROR_R::new(((self.bits >> 2) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Disable interrupt for ENDKSGEN event"] + #[inline(always)] + pub fn endksgen(&mut self) -> ENDKSGEN_W { + ENDKSGEN_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for ENDCRYPT event"] + #[inline(always)] + pub fn endcrypt(&mut self) -> ENDCRYPT_W { + ENDCRYPT_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&mut self) -> ERROR_W { + ERROR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccm/intenset.rs b/src/ccm/intenset.rs new file mode 100644 index 0000000..3943d83 --- /dev/null +++ b/src/ccm/intenset.rs @@ -0,0 +1,366 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for ENDKSGEN event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDKSGEN_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDKSGEN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDKSGEN` reader - Write '1' to Enable interrupt for ENDKSGEN event"] +pub struct ENDKSGEN_R(crate::FieldReader); +impl ENDKSGEN_R { + pub(crate) fn new(bits: bool) -> Self { + ENDKSGEN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDKSGEN_A { + match self.bits { + false => ENDKSGEN_A::DISABLED, + true => ENDKSGEN_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENDKSGEN_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENDKSGEN_A::ENABLED + } +} +impl core::ops::Deref for ENDKSGEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for ENDKSGEN event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDKSGEN_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDKSGEN_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDKSGEN` writer - Write '1' to Enable interrupt for ENDKSGEN event"] +pub struct ENDKSGEN_W<'a> { + w: &'a mut W, +} +impl<'a> ENDKSGEN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDKSGEN_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(ENDKSGEN_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for ENDCRYPT event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDCRYPT_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDCRYPT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDCRYPT` reader - Write '1' to Enable interrupt for ENDCRYPT event"] +pub struct ENDCRYPT_R(crate::FieldReader); +impl ENDCRYPT_R { + pub(crate) fn new(bits: bool) -> Self { + ENDCRYPT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDCRYPT_A { + match self.bits { + false => ENDCRYPT_A::DISABLED, + true => ENDCRYPT_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENDCRYPT_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENDCRYPT_A::ENABLED + } +} +impl core::ops::Deref for ENDCRYPT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for ENDCRYPT event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDCRYPT_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDCRYPT_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDCRYPT` writer - Write '1' to Enable interrupt for ENDCRYPT event"] +pub struct ENDCRYPT_W<'a> { + w: &'a mut W, +} +impl<'a> ENDCRYPT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDCRYPT_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(ENDCRYPT_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` reader - Write '1' to Enable interrupt for ERROR event"] +pub struct ERROR_R(crate::FieldReader); +impl ERROR_R { + pub(crate) fn new(bits: bool) -> Self { + ERROR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ERROR_A { + match self.bits { + false => ERROR_A::DISABLED, + true => ERROR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ERROR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ERROR_A::ENABLED + } +} +impl core::ops::Deref for ERROR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` writer - Write '1' to Enable interrupt for ERROR event"] +pub struct ERROR_W<'a> { + w: &'a mut W, +} +impl<'a> ERROR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ERROR_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(ERROR_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Enable interrupt for ENDKSGEN event"] + #[inline(always)] + pub fn endksgen(&self) -> ENDKSGEN_R { + ENDKSGEN_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for ENDCRYPT event"] + #[inline(always)] + pub fn endcrypt(&self) -> ENDCRYPT_R { + ENDCRYPT_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&self) -> ERROR_R { + ERROR_R::new(((self.bits >> 2) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Enable interrupt for ENDKSGEN event"] + #[inline(always)] + pub fn endksgen(&mut self) -> ENDKSGEN_W { + ENDKSGEN_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for ENDCRYPT event"] + #[inline(always)] + pub fn endcrypt(&mut self) -> ENDCRYPT_W { + ENDCRYPT_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&mut self) -> ERROR_W { + ERROR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccm/micstatus.rs b/src/ccm/micstatus.rs new file mode 100644 index 0000000..b996228 --- /dev/null +++ b/src/ccm/micstatus.rs @@ -0,0 +1,84 @@ +#[doc = "Register `MICSTATUS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "The result of the MIC check performed during the previous decryption operation\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum MICSTATUS_A { + #[doc = "0: MIC check failed"] + CHECKFAILED = 0, + #[doc = "1: MIC check passed"] + CHECKPASSED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: MICSTATUS_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `MICSTATUS` reader - The result of the MIC check performed during the previous decryption operation"] +pub struct MICSTATUS_R(crate::FieldReader); +impl MICSTATUS_R { + pub(crate) fn new(bits: bool) -> Self { + MICSTATUS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> MICSTATUS_A { + match self.bits { + false => MICSTATUS_A::CHECKFAILED, + true => MICSTATUS_A::CHECKPASSED, + } + } + #[doc = "Checks if the value of the field is `CHECKFAILED`"] + #[inline(always)] + pub fn is_check_failed(&self) -> bool { + **self == MICSTATUS_A::CHECKFAILED + } + #[doc = "Checks if the value of the field is `CHECKPASSED`"] + #[inline(always)] + pub fn is_check_passed(&self) -> bool { + **self == MICSTATUS_A::CHECKPASSED + } +} +impl core::ops::Deref for MICSTATUS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bit 0 - The result of the MIC check performed during the previous decryption operation"] + #[inline(always)] + pub fn micstatus(&self) -> MICSTATUS_R { + MICSTATUS_R::new((self.bits & 0x01) != 0) + } +} +#[doc = "MIC check result\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 [micstatus](index.html) module"] +pub struct MICSTATUS_SPEC; +impl crate::RegisterSpec for MICSTATUS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [micstatus::R](R) reader structure"] +impl crate::Readable for MICSTATUS_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets MICSTATUS to value 0"] +impl crate::Resettable for MICSTATUS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccm/mode.rs b/src/ccm/mode.rs new file mode 100644 index 0000000..14d11be --- /dev/null +++ b/src/ccm/mode.rs @@ -0,0 +1,345 @@ +#[doc = "Register `MODE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MODE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "The mode of operation to be used\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum MODE_A { + #[doc = "0: AES CCM packet encryption mode"] + ENCRYPTION = 0, + #[doc = "1: AES CCM packet decryption mode"] + DECRYPTION = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: MODE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `MODE` reader - The mode of operation to be used"] +pub struct MODE_R(crate::FieldReader); +impl MODE_R { + pub(crate) fn new(bits: bool) -> Self { + MODE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> MODE_A { + match self.bits { + false => MODE_A::ENCRYPTION, + true => MODE_A::DECRYPTION, + } + } + #[doc = "Checks if the value of the field is `ENCRYPTION`"] + #[inline(always)] + pub fn is_encryption(&self) -> bool { + **self == MODE_A::ENCRYPTION + } + #[doc = "Checks if the value of the field is `DECRYPTION`"] + #[inline(always)] + pub fn is_decryption(&self) -> bool { + **self == MODE_A::DECRYPTION + } +} +impl core::ops::Deref for MODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MODE` writer - The mode of operation to be used"] +pub struct MODE_W<'a> { + w: &'a mut W, +} +impl<'a> MODE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: MODE_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "AES CCM packet encryption mode"] + #[inline(always)] + pub fn encryption(self) -> &'a mut W { + self.variant(MODE_A::ENCRYPTION) + } + #[doc = "AES CCM packet decryption mode"] + #[inline(always)] + pub fn decryption(self) -> &'a mut W { + self.variant(MODE_A::DECRYPTION) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Data rate that the CCM shall run in synch with\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DATARATE_A { + #[doc = "0: In synch with 1 Mbit data rate"] + _1MBIT = 0, + #[doc = "1: In synch with 2 Mbit data rate"] + _2MBIT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DATARATE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DATARATE` reader - Data rate that the CCM shall run in synch with"] +pub struct DATARATE_R(crate::FieldReader); +impl DATARATE_R { + pub(crate) fn new(bits: bool) -> Self { + DATARATE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DATARATE_A { + match self.bits { + false => DATARATE_A::_1MBIT, + true => DATARATE_A::_2MBIT, + } + } + #[doc = "Checks if the value of the field is `_1MBIT`"] + #[inline(always)] + pub fn is_1mbit(&self) -> bool { + **self == DATARATE_A::_1MBIT + } + #[doc = "Checks if the value of the field is `_2MBIT`"] + #[inline(always)] + pub fn is_2mbit(&self) -> bool { + **self == DATARATE_A::_2MBIT + } +} +impl core::ops::Deref for DATARATE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DATARATE` writer - Data rate that the CCM shall run in synch with"] +pub struct DATARATE_W<'a> { + w: &'a mut W, +} +impl<'a> DATARATE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DATARATE_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "In synch with 1 Mbit data rate"] + #[inline(always)] + pub fn _1mbit(self) -> &'a mut W { + self.variant(DATARATE_A::_1MBIT) + } + #[doc = "In synch with 2 Mbit data rate"] + #[inline(always)] + pub fn _2mbit(self) -> &'a mut W { + self.variant(DATARATE_A::_2MBIT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Packet length configuration\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LENGTH_A { + #[doc = "0: Default length. Effective length of LENGTH field is 5-bit"] + DEFAULT = 0, + #[doc = "1: Extended length. Effective length of LENGTH field is 8-bit"] + EXTENDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LENGTH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LENGTH` reader - Packet length configuration"] +pub struct LENGTH_R(crate::FieldReader); +impl LENGTH_R { + pub(crate) fn new(bits: bool) -> Self { + LENGTH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> LENGTH_A { + match self.bits { + false => LENGTH_A::DEFAULT, + true => LENGTH_A::EXTENDED, + } + } + #[doc = "Checks if the value of the field is `DEFAULT`"] + #[inline(always)] + pub fn is_default(&self) -> bool { + **self == LENGTH_A::DEFAULT + } + #[doc = "Checks if the value of the field is `EXTENDED`"] + #[inline(always)] + pub fn is_extended(&self) -> bool { + **self == LENGTH_A::EXTENDED + } +} +impl core::ops::Deref for LENGTH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LENGTH` writer - Packet length configuration"] +pub struct LENGTH_W<'a> { + w: &'a mut W, +} +impl<'a> LENGTH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LENGTH_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Default length. Effective length of LENGTH field is 5-bit"] + #[inline(always)] + pub fn default(self) -> &'a mut W { + self.variant(LENGTH_A::DEFAULT) + } + #[doc = "Extended length. Effective length of LENGTH field is 8-bit"] + #[inline(always)] + pub fn extended(self) -> &'a mut W { + self.variant(LENGTH_A::EXTENDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +impl R { + #[doc = "Bit 0 - The mode of operation to be used"] + #[inline(always)] + pub fn mode(&self) -> MODE_R { + MODE_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 16 - Data rate that the CCM shall run in synch with"] + #[inline(always)] + pub fn datarate(&self) -> DATARATE_R { + DATARATE_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 24 - Packet length configuration"] + #[inline(always)] + pub fn length(&self) -> LENGTH_R { + LENGTH_R::new(((self.bits >> 24) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - The mode of operation to be used"] + #[inline(always)] + pub fn mode(&mut self) -> MODE_W { + MODE_W { w: self } + } + #[doc = "Bit 16 - Data rate that the CCM shall run in synch with"] + #[inline(always)] + pub fn datarate(&mut self) -> DATARATE_W { + DATARATE_W { w: self } + } + #[doc = "Bit 24 - Packet length configuration"] + #[inline(always)] + pub fn length(&mut self) -> LENGTH_W { + LENGTH_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Operation mode\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mode](index.html) module"] +pub struct MODE_SPEC; +impl crate::RegisterSpec for MODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mode::R](R) reader structure"] +impl crate::Readable for MODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mode::W](W) writer structure"] +impl crate::Writable for MODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MODE to value 0x01"] +impl crate::Resettable for MODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x01 + } +} diff --git a/src/ccm/outptr.rs b/src/ccm/outptr.rs new file mode 100644 index 0000000..8fd23b8 --- /dev/null +++ b/src/ccm/outptr.rs @@ -0,0 +1,102 @@ +#[doc = "Register `OUTPTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `OUTPTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `OUTPTR` reader - Output pointer"] +pub struct OUTPTR_R(crate::FieldReader); +impl OUTPTR_R { + pub(crate) fn new(bits: u32) -> Self { + OUTPTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for OUTPTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OUTPTR` writer - Output pointer"] +pub struct OUTPTR_W<'a> { + w: &'a mut W, +} +impl<'a> OUTPTR_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Output pointer"] + #[inline(always)] + pub fn outptr(&self) -> OUTPTR_R { + OUTPTR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Output pointer"] + #[inline(always)] + pub fn outptr(&mut self) -> OUTPTR_W { + OUTPTR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Output pointer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [outptr](index.html) module"] +pub struct OUTPTR_SPEC; +impl crate::RegisterSpec for OUTPTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [outptr::R](R) reader structure"] +impl crate::Readable for OUTPTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [outptr::W](W) writer structure"] +impl crate::Writable for OUTPTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets OUTPTR to value 0"] +impl crate::Resettable for OUTPTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccm/scratchptr.rs b/src/ccm/scratchptr.rs new file mode 100644 index 0000000..b246dfd --- /dev/null +++ b/src/ccm/scratchptr.rs @@ -0,0 +1,102 @@ +#[doc = "Register `SCRATCHPTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SCRATCHPTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `SCRATCHPTR` reader - Pointer to a scratch data area used for temporary storage during key-stream generation, MIC generation and encryption/decryption."] +pub struct SCRATCHPTR_R(crate::FieldReader); +impl SCRATCHPTR_R { + pub(crate) fn new(bits: u32) -> Self { + SCRATCHPTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SCRATCHPTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SCRATCHPTR` writer - Pointer to a scratch data area used for temporary storage during key-stream generation, MIC generation and encryption/decryption."] +pub struct SCRATCHPTR_W<'a> { + w: &'a mut W, +} +impl<'a> SCRATCHPTR_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Pointer to a scratch data area used for temporary storage during key-stream generation, MIC generation and encryption/decryption."] + #[inline(always)] + pub fn scratchptr(&self) -> SCRATCHPTR_R { + SCRATCHPTR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Pointer to a scratch data area used for temporary storage during key-stream generation, MIC generation and encryption/decryption."] + #[inline(always)] + pub fn scratchptr(&mut self) -> SCRATCHPTR_W { + SCRATCHPTR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pointer to data area used for temporary storage\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [scratchptr](index.html) module"] +pub struct SCRATCHPTR_SPEC; +impl crate::RegisterSpec for SCRATCHPTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [scratchptr::R](R) reader structure"] +impl crate::Readable for SCRATCHPTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [scratchptr::W](W) writer structure"] +impl crate::Writable for SCRATCHPTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SCRATCHPTR to value 0"] +impl crate::Resettable for SCRATCHPTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccm/shorts.rs b/src/ccm/shorts.rs new file mode 100644 index 0000000..50f33f4 --- /dev/null +++ b/src/ccm/shorts.rs @@ -0,0 +1,159 @@ +#[doc = "Register `SHORTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SHORTS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Shortcut between ENDKSGEN event and CRYPT task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDKSGEN_CRYPT_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDKSGEN_CRYPT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDKSGEN_CRYPT` reader - Shortcut between ENDKSGEN event and CRYPT task"] +pub struct ENDKSGEN_CRYPT_R(crate::FieldReader); +impl ENDKSGEN_CRYPT_R { + pub(crate) fn new(bits: bool) -> Self { + ENDKSGEN_CRYPT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDKSGEN_CRYPT_A { + match self.bits { + false => ENDKSGEN_CRYPT_A::DISABLED, + true => ENDKSGEN_CRYPT_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENDKSGEN_CRYPT_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENDKSGEN_CRYPT_A::ENABLED + } +} +impl core::ops::Deref for ENDKSGEN_CRYPT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENDKSGEN_CRYPT` writer - Shortcut between ENDKSGEN event and CRYPT task"] +pub struct ENDKSGEN_CRYPT_W<'a> { + w: &'a mut W, +} +impl<'a> ENDKSGEN_CRYPT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDKSGEN_CRYPT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENDKSGEN_CRYPT_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENDKSGEN_CRYPT_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Shortcut between ENDKSGEN event and CRYPT task"] + #[inline(always)] + pub fn endksgen_crypt(&self) -> ENDKSGEN_CRYPT_R { + ENDKSGEN_CRYPT_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Shortcut between ENDKSGEN event and CRYPT task"] + #[inline(always)] + pub fn endksgen_crypt(&mut self) -> ENDKSGEN_CRYPT_W { + ENDKSGEN_CRYPT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Shortcut register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [shorts](index.html) module"] +pub struct SHORTS_SPEC; +impl crate::RegisterSpec for SHORTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [shorts::R](R) reader structure"] +impl crate::Readable for SHORTS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [shorts::W](W) writer structure"] +impl crate::Writable for SHORTS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SHORTS to value 0"] +impl crate::Resettable for SHORTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccm/tasks_crypt.rs b/src/ccm/tasks_crypt.rs new file mode 100644 index 0000000..79560be --- /dev/null +++ b/src/ccm/tasks_crypt.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_CRYPT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start encryption/decryption. This operation will stop by itself when completed.\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_crypt](index.html) module"] +pub struct TASKS_CRYPT_SPEC; +impl crate::RegisterSpec for TASKS_CRYPT_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_crypt::W](W) writer structure"] +impl crate::Writable for TASKS_CRYPT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_CRYPT to value 0"] +impl crate::Resettable for TASKS_CRYPT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccm/tasks_ksgen.rs b/src/ccm/tasks_ksgen.rs new file mode 100644 index 0000000..980f03f --- /dev/null +++ b/src/ccm/tasks_ksgen.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_KSGEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start generation of key-stream. This operation will stop by itself when completed.\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_ksgen](index.html) module"] +pub struct TASKS_KSGEN_SPEC; +impl crate::RegisterSpec for TASKS_KSGEN_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_ksgen::W](W) writer structure"] +impl crate::Writable for TASKS_KSGEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_KSGEN to value 0"] +impl crate::Resettable for TASKS_KSGEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ccm/tasks_stop.rs b/src/ccm/tasks_stop.rs new file mode 100644 index 0000000..03963cb --- /dev/null +++ b/src/ccm/tasks_stop.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STOP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Stop encryption/decryption\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_stop](index.html) module"] +pub struct TASKS_STOP_SPEC; +impl crate::RegisterSpec for TASKS_STOP_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_stop::W](W) writer structure"] +impl crate::Writable for TASKS_STOP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STOP to value 0"] +impl crate::Resettable for TASKS_STOP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/clock.rs b/src/clock.rs new file mode 100644 index 0000000..306f773 --- /dev/null +++ b/src/clock.rs @@ -0,0 +1,138 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "0x00 - Start HFCLK crystal oscillator"] + pub tasks_hfclkstart: crate::Reg, + #[doc = "0x04 - Stop HFCLK crystal oscillator"] + pub tasks_hfclkstop: crate::Reg, + #[doc = "0x08 - Start LFCLK source"] + pub tasks_lfclkstart: crate::Reg, + #[doc = "0x0c - Stop LFCLK source"] + pub tasks_lfclkstop: crate::Reg, + #[doc = "0x10 - Start calibration of LFRC oscillator"] + pub tasks_cal: crate::Reg, + #[doc = "0x14 - Start calibration timer"] + pub tasks_ctstart: crate::Reg, + #[doc = "0x18 - Stop calibration timer"] + pub tasks_ctstop: crate::Reg, + _reserved7: [u8; 0xe4], + #[doc = "0x100 - HFCLK oscillator started"] + pub events_hfclkstarted: crate::Reg, + #[doc = "0x104 - LFCLK started"] + pub events_lfclkstarted: crate::Reg, + _reserved9: [u8; 0x04], + #[doc = "0x10c - Calibration of LFCLK RC oscillator complete event"] + pub events_done: crate::Reg, + #[doc = "0x110 - Calibration timer timeout"] + pub events_ctto: crate::Reg, + _reserved11: [u8; 0x01f0], + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved13: [u8; 0xfc], + #[doc = "0x408 - Status indicating that HFCLKSTART task has been triggered"] + pub hfclkrun: crate::Reg, + #[doc = "0x40c - HFCLK status"] + pub hfclkstat: crate::Reg, + _reserved15: [u8; 0x04], + #[doc = "0x414 - Status indicating that LFCLKSTART task has been triggered"] + pub lfclkrun: crate::Reg, + #[doc = "0x418 - LFCLK status"] + pub lfclkstat: crate::Reg, + #[doc = "0x41c - Copy of LFCLKSRC register, set when LFCLKSTART task was triggered"] + pub lfclksrccopy: crate::Reg, + _reserved18: [u8; 0xf8], + #[doc = "0x518 - Clock source for the LFCLK"] + pub lfclksrc: crate::Reg, + _reserved19: [u8; 0x1c], + #[doc = "0x538 - Calibration timer interval"] + pub ctiv: crate::Reg, + _reserved20: [u8; 0x20], + #[doc = "0x55c - Clocking options for the Trace Port debug interface"] + pub traceconfig: crate::Reg, +} +#[doc = "TASKS_HFCLKSTART register accessor: an alias for `Reg`"] +pub type TASKS_HFCLKSTART = crate::Reg; +#[doc = "Start HFCLK crystal oscillator"] +pub mod tasks_hfclkstart; +#[doc = "TASKS_HFCLKSTOP register accessor: an alias for `Reg`"] +pub type TASKS_HFCLKSTOP = crate::Reg; +#[doc = "Stop HFCLK crystal oscillator"] +pub mod tasks_hfclkstop; +#[doc = "TASKS_LFCLKSTART register accessor: an alias for `Reg`"] +pub type TASKS_LFCLKSTART = crate::Reg; +#[doc = "Start LFCLK source"] +pub mod tasks_lfclkstart; +#[doc = "TASKS_LFCLKSTOP register accessor: an alias for `Reg`"] +pub type TASKS_LFCLKSTOP = crate::Reg; +#[doc = "Stop LFCLK source"] +pub mod tasks_lfclkstop; +#[doc = "TASKS_CAL register accessor: an alias for `Reg`"] +pub type TASKS_CAL = crate::Reg; +#[doc = "Start calibration of LFRC oscillator"] +pub mod tasks_cal; +#[doc = "TASKS_CTSTART register accessor: an alias for `Reg`"] +pub type TASKS_CTSTART = crate::Reg; +#[doc = "Start calibration timer"] +pub mod tasks_ctstart; +#[doc = "TASKS_CTSTOP register accessor: an alias for `Reg`"] +pub type TASKS_CTSTOP = crate::Reg; +#[doc = "Stop calibration timer"] +pub mod tasks_ctstop; +#[doc = "EVENTS_HFCLKSTARTED register accessor: an alias for `Reg`"] +pub type EVENTS_HFCLKSTARTED = crate::Reg; +#[doc = "HFCLK oscillator started"] +pub mod events_hfclkstarted; +#[doc = "EVENTS_LFCLKSTARTED register accessor: an alias for `Reg`"] +pub type EVENTS_LFCLKSTARTED = crate::Reg; +#[doc = "LFCLK started"] +pub mod events_lfclkstarted; +#[doc = "EVENTS_DONE register accessor: an alias for `Reg`"] +pub type EVENTS_DONE = crate::Reg; +#[doc = "Calibration of LFCLK RC oscillator complete event"] +pub mod events_done; +#[doc = "EVENTS_CTTO register accessor: an alias for `Reg`"] +pub type EVENTS_CTTO = crate::Reg; +#[doc = "Calibration timer timeout"] +pub mod events_ctto; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "HFCLKRUN register accessor: an alias for `Reg`"] +pub type HFCLKRUN = crate::Reg; +#[doc = "Status indicating that HFCLKSTART task has been triggered"] +pub mod hfclkrun; +#[doc = "HFCLKSTAT register accessor: an alias for `Reg`"] +pub type HFCLKSTAT = crate::Reg; +#[doc = "HFCLK status"] +pub mod hfclkstat; +#[doc = "LFCLKRUN register accessor: an alias for `Reg`"] +pub type LFCLKRUN = crate::Reg; +#[doc = "Status indicating that LFCLKSTART task has been triggered"] +pub mod lfclkrun; +#[doc = "LFCLKSTAT register accessor: an alias for `Reg`"] +pub type LFCLKSTAT = crate::Reg; +#[doc = "LFCLK status"] +pub mod lfclkstat; +#[doc = "LFCLKSRCCOPY register accessor: an alias for `Reg`"] +pub type LFCLKSRCCOPY = crate::Reg; +#[doc = "Copy of LFCLKSRC register, set when LFCLKSTART task was triggered"] +pub mod lfclksrccopy; +#[doc = "LFCLKSRC register accessor: an alias for `Reg`"] +pub type LFCLKSRC = crate::Reg; +#[doc = "Clock source for the LFCLK"] +pub mod lfclksrc; +#[doc = "CTIV register accessor: an alias for `Reg`"] +pub type CTIV = crate::Reg; +#[doc = "Calibration timer interval"] +pub mod ctiv; +#[doc = "TRACECONFIG register accessor: an alias for `Reg`"] +pub type TRACECONFIG = crate::Reg; +#[doc = "Clocking options for the Trace Port debug interface"] +pub mod traceconfig; diff --git a/src/clock/ctiv.rs b/src/clock/ctiv.rs new file mode 100644 index 0000000..2d46549 --- /dev/null +++ b/src/clock/ctiv.rs @@ -0,0 +1,102 @@ +#[doc = "Register `CTIV` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CTIV` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CTIV` reader - Calibration timer interval in multiple of 0.25 seconds. Range: 0.25 seconds to 31.75 seconds."] +pub struct CTIV_R(crate::FieldReader); +impl CTIV_R { + pub(crate) fn new(bits: u8) -> Self { + CTIV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CTIV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTIV` writer - Calibration timer interval in multiple of 0.25 seconds. Range: 0.25 seconds to 31.75 seconds."] +pub struct CTIV_W<'a> { + w: &'a mut W, +} +impl<'a> CTIV_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x7f) | (value as u32 & 0x7f); + self.w + } +} +impl R { + #[doc = "Bits 0:6 - Calibration timer interval in multiple of 0.25 seconds. Range: 0.25 seconds to 31.75 seconds."] + #[inline(always)] + pub fn ctiv(&self) -> CTIV_R { + CTIV_R::new((self.bits & 0x7f) as u8) + } +} +impl W { + #[doc = "Bits 0:6 - Calibration timer interval in multiple of 0.25 seconds. Range: 0.25 seconds to 31.75 seconds."] + #[inline(always)] + pub fn ctiv(&mut self) -> CTIV_W { + CTIV_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Calibration timer interval\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ctiv](index.html) module"] +pub struct CTIV_SPEC; +impl crate::RegisterSpec for CTIV_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ctiv::R](R) reader structure"] +impl crate::Readable for CTIV_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ctiv::W](W) writer structure"] +impl crate::Writable for CTIV_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CTIV to value 0"] +impl crate::Resettable for CTIV_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/clock/events_ctto.rs b/src/clock/events_ctto.rs new file mode 100644 index 0000000..aec00b7 --- /dev/null +++ b/src/clock/events_ctto.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_CTTO` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_CTTO` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Calibration timer timeout\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_ctto](index.html) module"] +pub struct EVENTS_CTTO_SPEC; +impl crate::RegisterSpec for EVENTS_CTTO_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_ctto::R](R) reader structure"] +impl crate::Readable for EVENTS_CTTO_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_ctto::W](W) writer structure"] +impl crate::Writable for EVENTS_CTTO_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_CTTO to value 0"] +impl crate::Resettable for EVENTS_CTTO_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/clock/events_done.rs b/src/clock/events_done.rs new file mode 100644 index 0000000..423bb0d --- /dev/null +++ b/src/clock/events_done.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_DONE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_DONE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Calibration of LFCLK RC oscillator complete event\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_done](index.html) module"] +pub struct EVENTS_DONE_SPEC; +impl crate::RegisterSpec for EVENTS_DONE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_done::R](R) reader structure"] +impl crate::Readable for EVENTS_DONE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_done::W](W) writer structure"] +impl crate::Writable for EVENTS_DONE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_DONE to value 0"] +impl crate::Resettable for EVENTS_DONE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/clock/events_hfclkstarted.rs b/src/clock/events_hfclkstarted.rs new file mode 100644 index 0000000..90c3dce --- /dev/null +++ b/src/clock/events_hfclkstarted.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_HFCLKSTARTED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_HFCLKSTARTED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "HFCLK oscillator started\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_hfclkstarted](index.html) module"] +pub struct EVENTS_HFCLKSTARTED_SPEC; +impl crate::RegisterSpec for EVENTS_HFCLKSTARTED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_hfclkstarted::R](R) reader structure"] +impl crate::Readable for EVENTS_HFCLKSTARTED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_hfclkstarted::W](W) writer structure"] +impl crate::Writable for EVENTS_HFCLKSTARTED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_HFCLKSTARTED to value 0"] +impl crate::Resettable for EVENTS_HFCLKSTARTED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/clock/events_lfclkstarted.rs b/src/clock/events_lfclkstarted.rs new file mode 100644 index 0000000..665dd12 --- /dev/null +++ b/src/clock/events_lfclkstarted.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_LFCLKSTARTED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_LFCLKSTARTED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "LFCLK started\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_lfclkstarted](index.html) module"] +pub struct EVENTS_LFCLKSTARTED_SPEC; +impl crate::RegisterSpec for EVENTS_LFCLKSTARTED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_lfclkstarted::R](R) reader structure"] +impl crate::Readable for EVENTS_LFCLKSTARTED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_lfclkstarted::W](W) writer structure"] +impl crate::Writable for EVENTS_LFCLKSTARTED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_LFCLKSTARTED to value 0"] +impl crate::Resettable for EVENTS_LFCLKSTARTED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/clock/hfclkrun.rs b/src/clock/hfclkrun.rs new file mode 100644 index 0000000..41737b8 --- /dev/null +++ b/src/clock/hfclkrun.rs @@ -0,0 +1,84 @@ +#[doc = "Register `HFCLKRUN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "HFCLKSTART task triggered or not\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STATUS_A { + #[doc = "0: Task not triggered"] + NOTTRIGGERED = 0, + #[doc = "1: Task triggered"] + TRIGGERED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STATUS_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STATUS` reader - HFCLKSTART task triggered or not"] +pub struct STATUS_R(crate::FieldReader); +impl STATUS_R { + pub(crate) fn new(bits: bool) -> Self { + STATUS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STATUS_A { + match self.bits { + false => STATUS_A::NOTTRIGGERED, + true => STATUS_A::TRIGGERED, + } + } + #[doc = "Checks if the value of the field is `NOTTRIGGERED`"] + #[inline(always)] + pub fn is_not_triggered(&self) -> bool { + **self == STATUS_A::NOTTRIGGERED + } + #[doc = "Checks if the value of the field is `TRIGGERED`"] + #[inline(always)] + pub fn is_triggered(&self) -> bool { + **self == STATUS_A::TRIGGERED + } +} +impl core::ops::Deref for STATUS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bit 0 - HFCLKSTART task triggered or not"] + #[inline(always)] + pub fn status(&self) -> STATUS_R { + STATUS_R::new((self.bits & 0x01) != 0) + } +} +#[doc = "Status indicating that HFCLKSTART task has been triggered\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 [hfclkrun](index.html) module"] +pub struct HFCLKRUN_SPEC; +impl crate::RegisterSpec for HFCLKRUN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [hfclkrun::R](R) reader structure"] +impl crate::Readable for HFCLKRUN_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets HFCLKRUN to value 0"] +impl crate::Resettable for HFCLKRUN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/clock/hfclkstat.rs b/src/clock/hfclkstat.rs new file mode 100644 index 0000000..8b893f0 --- /dev/null +++ b/src/clock/hfclkstat.rs @@ -0,0 +1,135 @@ +#[doc = "Register `HFCLKSTAT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Source of HFCLK\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SRC_A { + #[doc = "0: 64 MHz internal oscillator (HFINT)"] + RC = 0, + #[doc = "1: 64 MHz crystal oscillator (HFXO)"] + XTAL = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SRC_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SRC` reader - Source of HFCLK"] +pub struct SRC_R(crate::FieldReader); +impl SRC_R { + pub(crate) fn new(bits: bool) -> Self { + SRC_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SRC_A { + match self.bits { + false => SRC_A::RC, + true => SRC_A::XTAL, + } + } + #[doc = "Checks if the value of the field is `RC`"] + #[inline(always)] + pub fn is_rc(&self) -> bool { + **self == SRC_A::RC + } + #[doc = "Checks if the value of the field is `XTAL`"] + #[inline(always)] + pub fn is_xtal(&self) -> bool { + **self == SRC_A::XTAL + } +} +impl core::ops::Deref for SRC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "HFCLK state\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STATE_A { + #[doc = "0: HFCLK not running"] + NOTRUNNING = 0, + #[doc = "1: HFCLK running"] + RUNNING = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STATE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STATE` reader - HFCLK state"] +pub struct STATE_R(crate::FieldReader); +impl STATE_R { + pub(crate) fn new(bits: bool) -> Self { + STATE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STATE_A { + match self.bits { + false => STATE_A::NOTRUNNING, + true => STATE_A::RUNNING, + } + } + #[doc = "Checks if the value of the field is `NOTRUNNING`"] + #[inline(always)] + pub fn is_not_running(&self) -> bool { + **self == STATE_A::NOTRUNNING + } + #[doc = "Checks if the value of the field is `RUNNING`"] + #[inline(always)] + pub fn is_running(&self) -> bool { + **self == STATE_A::RUNNING + } +} +impl core::ops::Deref for STATE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bit 0 - Source of HFCLK"] + #[inline(always)] + pub fn src(&self) -> SRC_R { + SRC_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 16 - HFCLK state"] + #[inline(always)] + pub fn state(&self) -> STATE_R { + STATE_R::new(((self.bits >> 16) & 0x01) != 0) + } +} +#[doc = "HFCLK status\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 [hfclkstat](index.html) module"] +pub struct HFCLKSTAT_SPEC; +impl crate::RegisterSpec for HFCLKSTAT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [hfclkstat::R](R) reader structure"] +impl crate::Readable for HFCLKSTAT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets HFCLKSTAT to value 0"] +impl crate::Resettable for HFCLKSTAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/clock/intenclr.rs b/src/clock/intenclr.rs new file mode 100644 index 0000000..d751941 --- /dev/null +++ b/src/clock/intenclr.rs @@ -0,0 +1,466 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for HFCLKSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum HFCLKSTARTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: HFCLKSTARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `HFCLKSTARTED` reader - Write '1' to Disable interrupt for HFCLKSTARTED event"] +pub struct HFCLKSTARTED_R(crate::FieldReader); +impl HFCLKSTARTED_R { + pub(crate) fn new(bits: bool) -> Self { + HFCLKSTARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> HFCLKSTARTED_A { + match self.bits { + false => HFCLKSTARTED_A::DISABLED, + true => HFCLKSTARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == HFCLKSTARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == HFCLKSTARTED_A::ENABLED + } +} +impl core::ops::Deref for HFCLKSTARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for HFCLKSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum HFCLKSTARTED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: HFCLKSTARTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `HFCLKSTARTED` writer - Write '1' to Disable interrupt for HFCLKSTARTED event"] +pub struct HFCLKSTARTED_W<'a> { + w: &'a mut W, +} +impl<'a> HFCLKSTARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: HFCLKSTARTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(HFCLKSTARTED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for LFCLKSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LFCLKSTARTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LFCLKSTARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LFCLKSTARTED` reader - Write '1' to Disable interrupt for LFCLKSTARTED event"] +pub struct LFCLKSTARTED_R(crate::FieldReader); +impl LFCLKSTARTED_R { + pub(crate) fn new(bits: bool) -> Self { + LFCLKSTARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> LFCLKSTARTED_A { + match self.bits { + false => LFCLKSTARTED_A::DISABLED, + true => LFCLKSTARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == LFCLKSTARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == LFCLKSTARTED_A::ENABLED + } +} +impl core::ops::Deref for LFCLKSTARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for LFCLKSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LFCLKSTARTED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LFCLKSTARTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LFCLKSTARTED` writer - Write '1' to Disable interrupt for LFCLKSTARTED event"] +pub struct LFCLKSTARTED_W<'a> { + w: &'a mut W, +} +impl<'a> LFCLKSTARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LFCLKSTARTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(LFCLKSTARTED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for DONE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DONE_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DONE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DONE` reader - Write '1' to Disable interrupt for DONE event"] +pub struct DONE_R(crate::FieldReader); +impl DONE_R { + pub(crate) fn new(bits: bool) -> Self { + DONE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DONE_A { + match self.bits { + false => DONE_A::DISABLED, + true => DONE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DONE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DONE_A::ENABLED + } +} +impl core::ops::Deref for DONE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for DONE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DONE_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DONE_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DONE` writer - Write '1' to Disable interrupt for DONE event"] +pub struct DONE_W<'a> { + w: &'a mut W, +} +impl<'a> DONE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DONE_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(DONE_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for CTTO event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CTTO_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CTTO_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CTTO` reader - Write '1' to Disable interrupt for CTTO event"] +pub struct CTTO_R(crate::FieldReader); +impl CTTO_R { + pub(crate) fn new(bits: bool) -> Self { + CTTO_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CTTO_A { + match self.bits { + false => CTTO_A::DISABLED, + true => CTTO_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CTTO_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CTTO_A::ENABLED + } +} +impl core::ops::Deref for CTTO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for CTTO event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CTTO_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CTTO_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CTTO` writer - Write '1' to Disable interrupt for CTTO event"] +pub struct CTTO_W<'a> { + w: &'a mut W, +} +impl<'a> CTTO_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CTTO_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CTTO_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Disable interrupt for HFCLKSTARTED event"] + #[inline(always)] + pub fn hfclkstarted(&self) -> HFCLKSTARTED_R { + HFCLKSTARTED_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for LFCLKSTARTED event"] + #[inline(always)] + pub fn lfclkstarted(&self) -> LFCLKSTARTED_R { + LFCLKSTARTED_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 3 - Write '1' to Disable interrupt for DONE event"] + #[inline(always)] + pub fn done(&self) -> DONE_R { + DONE_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Write '1' to Disable interrupt for CTTO event"] + #[inline(always)] + pub fn ctto(&self) -> CTTO_R { + CTTO_R::new(((self.bits >> 4) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Disable interrupt for HFCLKSTARTED event"] + #[inline(always)] + pub fn hfclkstarted(&mut self) -> HFCLKSTARTED_W { + HFCLKSTARTED_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for LFCLKSTARTED event"] + #[inline(always)] + pub fn lfclkstarted(&mut self) -> LFCLKSTARTED_W { + LFCLKSTARTED_W { w: self } + } + #[doc = "Bit 3 - Write '1' to Disable interrupt for DONE event"] + #[inline(always)] + pub fn done(&mut self) -> DONE_W { + DONE_W { w: self } + } + #[doc = "Bit 4 - Write '1' to Disable interrupt for CTTO event"] + #[inline(always)] + pub fn ctto(&mut self) -> CTTO_W { + CTTO_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/clock/intenset.rs b/src/clock/intenset.rs new file mode 100644 index 0000000..4861f51 --- /dev/null +++ b/src/clock/intenset.rs @@ -0,0 +1,466 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for HFCLKSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum HFCLKSTARTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: HFCLKSTARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `HFCLKSTARTED` reader - Write '1' to Enable interrupt for HFCLKSTARTED event"] +pub struct HFCLKSTARTED_R(crate::FieldReader); +impl HFCLKSTARTED_R { + pub(crate) fn new(bits: bool) -> Self { + HFCLKSTARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> HFCLKSTARTED_A { + match self.bits { + false => HFCLKSTARTED_A::DISABLED, + true => HFCLKSTARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == HFCLKSTARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == HFCLKSTARTED_A::ENABLED + } +} +impl core::ops::Deref for HFCLKSTARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for HFCLKSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum HFCLKSTARTED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: HFCLKSTARTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `HFCLKSTARTED` writer - Write '1' to Enable interrupt for HFCLKSTARTED event"] +pub struct HFCLKSTARTED_W<'a> { + w: &'a mut W, +} +impl<'a> HFCLKSTARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: HFCLKSTARTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(HFCLKSTARTED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for LFCLKSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LFCLKSTARTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LFCLKSTARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LFCLKSTARTED` reader - Write '1' to Enable interrupt for LFCLKSTARTED event"] +pub struct LFCLKSTARTED_R(crate::FieldReader); +impl LFCLKSTARTED_R { + pub(crate) fn new(bits: bool) -> Self { + LFCLKSTARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> LFCLKSTARTED_A { + match self.bits { + false => LFCLKSTARTED_A::DISABLED, + true => LFCLKSTARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == LFCLKSTARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == LFCLKSTARTED_A::ENABLED + } +} +impl core::ops::Deref for LFCLKSTARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for LFCLKSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LFCLKSTARTED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LFCLKSTARTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LFCLKSTARTED` writer - Write '1' to Enable interrupt for LFCLKSTARTED event"] +pub struct LFCLKSTARTED_W<'a> { + w: &'a mut W, +} +impl<'a> LFCLKSTARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LFCLKSTARTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(LFCLKSTARTED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for DONE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DONE_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DONE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DONE` reader - Write '1' to Enable interrupt for DONE event"] +pub struct DONE_R(crate::FieldReader); +impl DONE_R { + pub(crate) fn new(bits: bool) -> Self { + DONE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DONE_A { + match self.bits { + false => DONE_A::DISABLED, + true => DONE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DONE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DONE_A::ENABLED + } +} +impl core::ops::Deref for DONE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for DONE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DONE_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DONE_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DONE` writer - Write '1' to Enable interrupt for DONE event"] +pub struct DONE_W<'a> { + w: &'a mut W, +} +impl<'a> DONE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DONE_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(DONE_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for CTTO event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CTTO_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CTTO_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CTTO` reader - Write '1' to Enable interrupt for CTTO event"] +pub struct CTTO_R(crate::FieldReader); +impl CTTO_R { + pub(crate) fn new(bits: bool) -> Self { + CTTO_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CTTO_A { + match self.bits { + false => CTTO_A::DISABLED, + true => CTTO_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CTTO_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CTTO_A::ENABLED + } +} +impl core::ops::Deref for CTTO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for CTTO event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CTTO_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CTTO_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CTTO` writer - Write '1' to Enable interrupt for CTTO event"] +pub struct CTTO_W<'a> { + w: &'a mut W, +} +impl<'a> CTTO_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CTTO_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CTTO_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Enable interrupt for HFCLKSTARTED event"] + #[inline(always)] + pub fn hfclkstarted(&self) -> HFCLKSTARTED_R { + HFCLKSTARTED_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for LFCLKSTARTED event"] + #[inline(always)] + pub fn lfclkstarted(&self) -> LFCLKSTARTED_R { + LFCLKSTARTED_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 3 - Write '1' to Enable interrupt for DONE event"] + #[inline(always)] + pub fn done(&self) -> DONE_R { + DONE_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Write '1' to Enable interrupt for CTTO event"] + #[inline(always)] + pub fn ctto(&self) -> CTTO_R { + CTTO_R::new(((self.bits >> 4) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Enable interrupt for HFCLKSTARTED event"] + #[inline(always)] + pub fn hfclkstarted(&mut self) -> HFCLKSTARTED_W { + HFCLKSTARTED_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for LFCLKSTARTED event"] + #[inline(always)] + pub fn lfclkstarted(&mut self) -> LFCLKSTARTED_W { + LFCLKSTARTED_W { w: self } + } + #[doc = "Bit 3 - Write '1' to Enable interrupt for DONE event"] + #[inline(always)] + pub fn done(&mut self) -> DONE_W { + DONE_W { w: self } + } + #[doc = "Bit 4 - Write '1' to Enable interrupt for CTTO event"] + #[inline(always)] + pub fn ctto(&mut self) -> CTTO_W { + CTTO_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/clock/lfclkrun.rs b/src/clock/lfclkrun.rs new file mode 100644 index 0000000..6a627c7 --- /dev/null +++ b/src/clock/lfclkrun.rs @@ -0,0 +1,84 @@ +#[doc = "Register `LFCLKRUN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "LFCLKSTART task triggered or not\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STATUS_A { + #[doc = "0: Task not triggered"] + NOTTRIGGERED = 0, + #[doc = "1: Task triggered"] + TRIGGERED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STATUS_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STATUS` reader - LFCLKSTART task triggered or not"] +pub struct STATUS_R(crate::FieldReader); +impl STATUS_R { + pub(crate) fn new(bits: bool) -> Self { + STATUS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STATUS_A { + match self.bits { + false => STATUS_A::NOTTRIGGERED, + true => STATUS_A::TRIGGERED, + } + } + #[doc = "Checks if the value of the field is `NOTTRIGGERED`"] + #[inline(always)] + pub fn is_not_triggered(&self) -> bool { + **self == STATUS_A::NOTTRIGGERED + } + #[doc = "Checks if the value of the field is `TRIGGERED`"] + #[inline(always)] + pub fn is_triggered(&self) -> bool { + **self == STATUS_A::TRIGGERED + } +} +impl core::ops::Deref for STATUS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bit 0 - LFCLKSTART task triggered or not"] + #[inline(always)] + pub fn status(&self) -> STATUS_R { + STATUS_R::new((self.bits & 0x01) != 0) + } +} +#[doc = "Status indicating that LFCLKSTART task has been triggered\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 [lfclkrun](index.html) module"] +pub struct LFCLKRUN_SPEC; +impl crate::RegisterSpec for LFCLKRUN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [lfclkrun::R](R) reader structure"] +impl crate::Readable for LFCLKRUN_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets LFCLKRUN to value 0"] +impl crate::Resettable for LFCLKRUN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/clock/lfclksrc.rs b/src/clock/lfclksrc.rs new file mode 100644 index 0000000..fc0d479 --- /dev/null +++ b/src/clock/lfclksrc.rs @@ -0,0 +1,350 @@ +#[doc = "Register `LFCLKSRC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `LFCLKSRC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Clock source\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum SRC_A { + #[doc = "0: 32.768 kHz RC oscillator"] + RC = 0, + #[doc = "1: 32.768 kHz crystal oscillator"] + XTAL = 1, + #[doc = "2: 32.768 kHz synthesized from HFCLK"] + SYNTH = 2, +} +impl From for u8 { + #[inline(always)] + fn from(variant: SRC_A) -> Self { + variant as _ + } +} +#[doc = "Field `SRC` reader - Clock source"] +pub struct SRC_R(crate::FieldReader); +impl SRC_R { + pub(crate) fn new(bits: u8) -> Self { + SRC_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(SRC_A::RC), + 1 => Some(SRC_A::XTAL), + 2 => Some(SRC_A::SYNTH), + _ => None, + } + } + #[doc = "Checks if the value of the field is `RC`"] + #[inline(always)] + pub fn is_rc(&self) -> bool { + **self == SRC_A::RC + } + #[doc = "Checks if the value of the field is `XTAL`"] + #[inline(always)] + pub fn is_xtal(&self) -> bool { + **self == SRC_A::XTAL + } + #[doc = "Checks if the value of the field is `SYNTH`"] + #[inline(always)] + pub fn is_synth(&self) -> bool { + **self == SRC_A::SYNTH + } +} +impl core::ops::Deref for SRC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SRC` writer - Clock source"] +pub struct SRC_W<'a> { + w: &'a mut W, +} +impl<'a> SRC_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SRC_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "32.768 kHz RC oscillator"] + #[inline(always)] + pub fn rc(self) -> &'a mut W { + self.variant(SRC_A::RC) + } + #[doc = "32.768 kHz crystal oscillator"] + #[inline(always)] + pub fn xtal(self) -> &'a mut W { + self.variant(SRC_A::XTAL) + } + #[doc = "32.768 kHz synthesized from HFCLK"] + #[inline(always)] + pub fn synth(self) -> &'a mut W { + self.variant(SRC_A::SYNTH) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); + self.w + } +} +#[doc = "Enable or disable bypass of LFCLK crystal oscillator with external clock source\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum BYPASS_A { + #[doc = "0: Disable (use with Xtal or low-swing external source)"] + DISABLED = 0, + #[doc = "1: Enable (use with rail-to-rail external source)"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: BYPASS_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `BYPASS` reader - Enable or disable bypass of LFCLK crystal oscillator with external clock source"] +pub struct BYPASS_R(crate::FieldReader); +impl BYPASS_R { + pub(crate) fn new(bits: bool) -> Self { + BYPASS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> BYPASS_A { + match self.bits { + false => BYPASS_A::DISABLED, + true => BYPASS_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == BYPASS_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == BYPASS_A::ENABLED + } +} +impl core::ops::Deref for BYPASS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BYPASS` writer - Enable or disable bypass of LFCLK crystal oscillator with external clock source"] +pub struct BYPASS_W<'a> { + w: &'a mut W, +} +impl<'a> BYPASS_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: BYPASS_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable (use with Xtal or low-swing external source)"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(BYPASS_A::DISABLED) + } + #[doc = "Enable (use with rail-to-rail external source)"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(BYPASS_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Enable or disable external source for LFCLK\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum EXTERNAL_A { + #[doc = "0: Disable external source (use with Xtal)"] + DISABLED = 0, + #[doc = "1: Enable use of external source instead of Xtal (SRC needs to be set to Xtal)"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: EXTERNAL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `EXTERNAL` reader - Enable or disable external source for LFCLK"] +pub struct EXTERNAL_R(crate::FieldReader); +impl EXTERNAL_R { + pub(crate) fn new(bits: bool) -> Self { + EXTERNAL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> EXTERNAL_A { + match self.bits { + false => EXTERNAL_A::DISABLED, + true => EXTERNAL_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == EXTERNAL_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == EXTERNAL_A::ENABLED + } +} +impl core::ops::Deref for EXTERNAL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EXTERNAL` writer - Enable or disable external source for LFCLK"] +pub struct EXTERNAL_W<'a> { + w: &'a mut W, +} +impl<'a> EXTERNAL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: EXTERNAL_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable external source (use with Xtal)"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(EXTERNAL_A::DISABLED) + } + #[doc = "Enable use of external source instead of Xtal (SRC needs to be set to Xtal)"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(EXTERNAL_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +impl R { + #[doc = "Bits 0:1 - Clock source"] + #[inline(always)] + pub fn src(&self) -> SRC_R { + SRC_R::new((self.bits & 0x03) as u8) + } + #[doc = "Bit 16 - Enable or disable bypass of LFCLK crystal oscillator with external clock source"] + #[inline(always)] + pub fn bypass(&self) -> BYPASS_R { + BYPASS_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Enable or disable external source for LFCLK"] + #[inline(always)] + pub fn external(&self) -> EXTERNAL_R { + EXTERNAL_R::new(((self.bits >> 17) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:1 - Clock source"] + #[inline(always)] + pub fn src(&mut self) -> SRC_W { + SRC_W { w: self } + } + #[doc = "Bit 16 - Enable or disable bypass of LFCLK crystal oscillator with external clock source"] + #[inline(always)] + pub fn bypass(&mut self) -> BYPASS_W { + BYPASS_W { w: self } + } + #[doc = "Bit 17 - Enable or disable external source for LFCLK"] + #[inline(always)] + pub fn external(&mut self) -> EXTERNAL_W { + EXTERNAL_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Clock source for the LFCLK\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [lfclksrc](index.html) module"] +pub struct LFCLKSRC_SPEC; +impl crate::RegisterSpec for LFCLKSRC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [lfclksrc::R](R) reader structure"] +impl crate::Readable for LFCLKSRC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [lfclksrc::W](W) writer structure"] +impl crate::Writable for LFCLKSRC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LFCLKSRC to value 0"] +impl crate::Resettable for LFCLKSRC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/clock/lfclksrccopy.rs b/src/clock/lfclksrccopy.rs new file mode 100644 index 0000000..4eca27f --- /dev/null +++ b/src/clock/lfclksrccopy.rs @@ -0,0 +1,94 @@ +#[doc = "Register `LFCLKSRCCOPY` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Clock source\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum SRC_A { + #[doc = "0: 32.768 kHz RC oscillator"] + RC = 0, + #[doc = "1: 32.768 kHz crystal oscillator"] + XTAL = 1, + #[doc = "2: 32.768 kHz synthesized from HFCLK"] + SYNTH = 2, +} +impl From for u8 { + #[inline(always)] + fn from(variant: SRC_A) -> Self { + variant as _ + } +} +#[doc = "Field `SRC` reader - Clock source"] +pub struct SRC_R(crate::FieldReader); +impl SRC_R { + pub(crate) fn new(bits: u8) -> Self { + SRC_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(SRC_A::RC), + 1 => Some(SRC_A::XTAL), + 2 => Some(SRC_A::SYNTH), + _ => None, + } + } + #[doc = "Checks if the value of the field is `RC`"] + #[inline(always)] + pub fn is_rc(&self) -> bool { + **self == SRC_A::RC + } + #[doc = "Checks if the value of the field is `XTAL`"] + #[inline(always)] + pub fn is_xtal(&self) -> bool { + **self == SRC_A::XTAL + } + #[doc = "Checks if the value of the field is `SYNTH`"] + #[inline(always)] + pub fn is_synth(&self) -> bool { + **self == SRC_A::SYNTH + } +} +impl core::ops::Deref for SRC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:1 - Clock source"] + #[inline(always)] + pub fn src(&self) -> SRC_R { + SRC_R::new((self.bits & 0x03) as u8) + } +} +#[doc = "Copy of LFCLKSRC register, set when LFCLKSTART task was triggered\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 [lfclksrccopy](index.html) module"] +pub struct LFCLKSRCCOPY_SPEC; +impl crate::RegisterSpec for LFCLKSRCCOPY_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [lfclksrccopy::R](R) reader structure"] +impl crate::Readable for LFCLKSRCCOPY_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets LFCLKSRCCOPY to value 0"] +impl crate::Resettable for LFCLKSRCCOPY_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/clock/lfclkstat.rs b/src/clock/lfclkstat.rs new file mode 100644 index 0000000..2445ce5 --- /dev/null +++ b/src/clock/lfclkstat.rs @@ -0,0 +1,145 @@ +#[doc = "Register `LFCLKSTAT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Source of LFCLK\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum SRC_A { + #[doc = "0: 32.768 kHz RC oscillator"] + RC = 0, + #[doc = "1: 32.768 kHz crystal oscillator"] + XTAL = 1, + #[doc = "2: 32.768 kHz synthesized from HFCLK"] + SYNTH = 2, +} +impl From for u8 { + #[inline(always)] + fn from(variant: SRC_A) -> Self { + variant as _ + } +} +#[doc = "Field `SRC` reader - Source of LFCLK"] +pub struct SRC_R(crate::FieldReader); +impl SRC_R { + pub(crate) fn new(bits: u8) -> Self { + SRC_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(SRC_A::RC), + 1 => Some(SRC_A::XTAL), + 2 => Some(SRC_A::SYNTH), + _ => None, + } + } + #[doc = "Checks if the value of the field is `RC`"] + #[inline(always)] + pub fn is_rc(&self) -> bool { + **self == SRC_A::RC + } + #[doc = "Checks if the value of the field is `XTAL`"] + #[inline(always)] + pub fn is_xtal(&self) -> bool { + **self == SRC_A::XTAL + } + #[doc = "Checks if the value of the field is `SYNTH`"] + #[inline(always)] + pub fn is_synth(&self) -> bool { + **self == SRC_A::SYNTH + } +} +impl core::ops::Deref for SRC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "LFCLK state\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STATE_A { + #[doc = "0: LFCLK not running"] + NOTRUNNING = 0, + #[doc = "1: LFCLK running"] + RUNNING = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STATE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STATE` reader - LFCLK state"] +pub struct STATE_R(crate::FieldReader); +impl STATE_R { + pub(crate) fn new(bits: bool) -> Self { + STATE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STATE_A { + match self.bits { + false => STATE_A::NOTRUNNING, + true => STATE_A::RUNNING, + } + } + #[doc = "Checks if the value of the field is `NOTRUNNING`"] + #[inline(always)] + pub fn is_not_running(&self) -> bool { + **self == STATE_A::NOTRUNNING + } + #[doc = "Checks if the value of the field is `RUNNING`"] + #[inline(always)] + pub fn is_running(&self) -> bool { + **self == STATE_A::RUNNING + } +} +impl core::ops::Deref for STATE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:1 - Source of LFCLK"] + #[inline(always)] + pub fn src(&self) -> SRC_R { + SRC_R::new((self.bits & 0x03) as u8) + } + #[doc = "Bit 16 - LFCLK state"] + #[inline(always)] + pub fn state(&self) -> STATE_R { + STATE_R::new(((self.bits >> 16) & 0x01) != 0) + } +} +#[doc = "LFCLK status\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 [lfclkstat](index.html) module"] +pub struct LFCLKSTAT_SPEC; +impl crate::RegisterSpec for LFCLKSTAT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [lfclkstat::R](R) reader structure"] +impl crate::Readable for LFCLKSTAT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets LFCLKSTAT to value 0"] +impl crate::Resettable for LFCLKSTAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/clock/tasks_cal.rs b/src/clock/tasks_cal.rs new file mode 100644 index 0000000..348ebaf --- /dev/null +++ b/src/clock/tasks_cal.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_CAL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start calibration of LFRC oscillator\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_cal](index.html) module"] +pub struct TASKS_CAL_SPEC; +impl crate::RegisterSpec for TASKS_CAL_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_cal::W](W) writer structure"] +impl crate::Writable for TASKS_CAL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_CAL to value 0"] +impl crate::Resettable for TASKS_CAL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/clock/tasks_ctstart.rs b/src/clock/tasks_ctstart.rs new file mode 100644 index 0000000..703e29b --- /dev/null +++ b/src/clock/tasks_ctstart.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_CTSTART` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start calibration timer\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_ctstart](index.html) module"] +pub struct TASKS_CTSTART_SPEC; +impl crate::RegisterSpec for TASKS_CTSTART_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_ctstart::W](W) writer structure"] +impl crate::Writable for TASKS_CTSTART_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_CTSTART to value 0"] +impl crate::Resettable for TASKS_CTSTART_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/clock/tasks_ctstop.rs b/src/clock/tasks_ctstop.rs new file mode 100644 index 0000000..7edc3c8 --- /dev/null +++ b/src/clock/tasks_ctstop.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_CTSTOP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Stop calibration timer\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_ctstop](index.html) module"] +pub struct TASKS_CTSTOP_SPEC; +impl crate::RegisterSpec for TASKS_CTSTOP_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_ctstop::W](W) writer structure"] +impl crate::Writable for TASKS_CTSTOP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_CTSTOP to value 0"] +impl crate::Resettable for TASKS_CTSTOP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/clock/tasks_hfclkstart.rs b/src/clock/tasks_hfclkstart.rs new file mode 100644 index 0000000..61268d4 --- /dev/null +++ b/src/clock/tasks_hfclkstart.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_HFCLKSTART` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start HFCLK crystal oscillator\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_hfclkstart](index.html) module"] +pub struct TASKS_HFCLKSTART_SPEC; +impl crate::RegisterSpec for TASKS_HFCLKSTART_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_hfclkstart::W](W) writer structure"] +impl crate::Writable for TASKS_HFCLKSTART_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_HFCLKSTART to value 0"] +impl crate::Resettable for TASKS_HFCLKSTART_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/clock/tasks_hfclkstop.rs b/src/clock/tasks_hfclkstop.rs new file mode 100644 index 0000000..d9bfb80 --- /dev/null +++ b/src/clock/tasks_hfclkstop.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_HFCLKSTOP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Stop HFCLK crystal oscillator\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_hfclkstop](index.html) module"] +pub struct TASKS_HFCLKSTOP_SPEC; +impl crate::RegisterSpec for TASKS_HFCLKSTOP_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_hfclkstop::W](W) writer structure"] +impl crate::Writable for TASKS_HFCLKSTOP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_HFCLKSTOP to value 0"] +impl crate::Resettable for TASKS_HFCLKSTOP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/clock/tasks_lfclkstart.rs b/src/clock/tasks_lfclkstart.rs new file mode 100644 index 0000000..e841ced --- /dev/null +++ b/src/clock/tasks_lfclkstart.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_LFCLKSTART` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start LFCLK source\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_lfclkstart](index.html) module"] +pub struct TASKS_LFCLKSTART_SPEC; +impl crate::RegisterSpec for TASKS_LFCLKSTART_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_lfclkstart::W](W) writer structure"] +impl crate::Writable for TASKS_LFCLKSTART_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_LFCLKSTART to value 0"] +impl crate::Resettable for TASKS_LFCLKSTART_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/clock/tasks_lfclkstop.rs b/src/clock/tasks_lfclkstop.rs new file mode 100644 index 0000000..21295bf --- /dev/null +++ b/src/clock/tasks_lfclkstop.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_LFCLKSTOP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Stop LFCLK source\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_lfclkstop](index.html) module"] +pub struct TASKS_LFCLKSTOP_SPEC; +impl crate::RegisterSpec for TASKS_LFCLKSTOP_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_lfclkstop::W](W) writer structure"] +impl crate::Writable for TASKS_LFCLKSTOP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_LFCLKSTOP to value 0"] +impl crate::Resettable for TASKS_LFCLKSTOP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/clock/traceconfig.rs b/src/clock/traceconfig.rs new file mode 100644 index 0000000..12e3f67 --- /dev/null +++ b/src/clock/traceconfig.rs @@ -0,0 +1,275 @@ +#[doc = "Register `TRACECONFIG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `TRACECONFIG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Speed of Trace Port clock. Note that the TRACECLK pin will output this clock divided by two.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum TRACEPORTSPEED_A { + #[doc = "0: 32 MHz Trace Port clock (TRACECLK = 16 MHz)"] + _32MHZ = 0, + #[doc = "1: 16 MHz Trace Port clock (TRACECLK = 8 MHz)"] + _16MHZ = 1, + #[doc = "2: 8 MHz Trace Port clock (TRACECLK = 4 MHz)"] + _8MHZ = 2, + #[doc = "3: 4 MHz Trace Port clock (TRACECLK = 2 MHz)"] + _4MHZ = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: TRACEPORTSPEED_A) -> Self { + variant as _ + } +} +#[doc = "Field `TRACEPORTSPEED` reader - Speed of Trace Port clock. Note that the TRACECLK pin will output this clock divided by two."] +pub struct TRACEPORTSPEED_R(crate::FieldReader); +impl TRACEPORTSPEED_R { + pub(crate) fn new(bits: u8) -> Self { + TRACEPORTSPEED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRACEPORTSPEED_A { + match self.bits { + 0 => TRACEPORTSPEED_A::_32MHZ, + 1 => TRACEPORTSPEED_A::_16MHZ, + 2 => TRACEPORTSPEED_A::_8MHZ, + 3 => TRACEPORTSPEED_A::_4MHZ, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `_32MHZ`"] + #[inline(always)] + pub fn is_32mhz(&self) -> bool { + **self == TRACEPORTSPEED_A::_32MHZ + } + #[doc = "Checks if the value of the field is `_16MHZ`"] + #[inline(always)] + pub fn is_16mhz(&self) -> bool { + **self == TRACEPORTSPEED_A::_16MHZ + } + #[doc = "Checks if the value of the field is `_8MHZ`"] + #[inline(always)] + pub fn is_8mhz(&self) -> bool { + **self == TRACEPORTSPEED_A::_8MHZ + } + #[doc = "Checks if the value of the field is `_4MHZ`"] + #[inline(always)] + pub fn is_4mhz(&self) -> bool { + **self == TRACEPORTSPEED_A::_4MHZ + } +} +impl core::ops::Deref for TRACEPORTSPEED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRACEPORTSPEED` writer - Speed of Trace Port clock. Note that the TRACECLK pin will output this clock divided by two."] +pub struct TRACEPORTSPEED_W<'a> { + w: &'a mut W, +} +impl<'a> TRACEPORTSPEED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRACEPORTSPEED_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "32 MHz Trace Port clock (TRACECLK = 16 MHz)"] + #[inline(always)] + pub fn _32mhz(self) -> &'a mut W { + self.variant(TRACEPORTSPEED_A::_32MHZ) + } + #[doc = "16 MHz Trace Port clock (TRACECLK = 8 MHz)"] + #[inline(always)] + pub fn _16mhz(self) -> &'a mut W { + self.variant(TRACEPORTSPEED_A::_16MHZ) + } + #[doc = "8 MHz Trace Port clock (TRACECLK = 4 MHz)"] + #[inline(always)] + pub fn _8mhz(self) -> &'a mut W { + self.variant(TRACEPORTSPEED_A::_8MHZ) + } + #[doc = "4 MHz Trace Port clock (TRACECLK = 2 MHz)"] + #[inline(always)] + pub fn _4mhz(self) -> &'a mut W { + self.variant(TRACEPORTSPEED_A::_4MHZ) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); + self.w + } +} +#[doc = "Pin multiplexing of trace signals.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum TRACEMUX_A { + #[doc = "0: GPIOs multiplexed onto all trace-pins"] + GPIO = 0, + #[doc = "1: SWO multiplexed onto P0.18, GPIO multiplexed onto other trace pins"] + SERIAL = 1, + #[doc = "2: TRACECLK and TRACEDATA multiplexed onto P0.20, P0.18, P0.16, P0.15 and P0.14."] + PARALLEL = 2, +} +impl From for u8 { + #[inline(always)] + fn from(variant: TRACEMUX_A) -> Self { + variant as _ + } +} +#[doc = "Field `TRACEMUX` reader - Pin multiplexing of trace signals."] +pub struct TRACEMUX_R(crate::FieldReader); +impl TRACEMUX_R { + pub(crate) fn new(bits: u8) -> Self { + TRACEMUX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(TRACEMUX_A::GPIO), + 1 => Some(TRACEMUX_A::SERIAL), + 2 => Some(TRACEMUX_A::PARALLEL), + _ => None, + } + } + #[doc = "Checks if the value of the field is `GPIO`"] + #[inline(always)] + pub fn is_gpio(&self) -> bool { + **self == TRACEMUX_A::GPIO + } + #[doc = "Checks if the value of the field is `SERIAL`"] + #[inline(always)] + pub fn is_serial(&self) -> bool { + **self == TRACEMUX_A::SERIAL + } + #[doc = "Checks if the value of the field is `PARALLEL`"] + #[inline(always)] + pub fn is_parallel(&self) -> bool { + **self == TRACEMUX_A::PARALLEL + } +} +impl core::ops::Deref for TRACEMUX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRACEMUX` writer - Pin multiplexing of trace signals."] +pub struct TRACEMUX_W<'a> { + w: &'a mut W, +} +impl<'a> TRACEMUX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRACEMUX_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "GPIOs multiplexed onto all trace-pins"] + #[inline(always)] + pub fn gpio(self) -> &'a mut W { + self.variant(TRACEMUX_A::GPIO) + } + #[doc = "SWO multiplexed onto P0.18, GPIO multiplexed onto other trace pins"] + #[inline(always)] + pub fn serial(self) -> &'a mut W { + self.variant(TRACEMUX_A::SERIAL) + } + #[doc = "TRACECLK and TRACEDATA multiplexed onto P0.20, P0.18, P0.16, P0.15 and P0.14."] + #[inline(always)] + pub fn parallel(self) -> &'a mut W { + self.variant(TRACEMUX_A::PARALLEL) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x03 << 16)) | ((value as u32 & 0x03) << 16); + self.w + } +} +impl R { + #[doc = "Bits 0:1 - Speed of Trace Port clock. Note that the TRACECLK pin will output this clock divided by two."] + #[inline(always)] + pub fn traceportspeed(&self) -> TRACEPORTSPEED_R { + TRACEPORTSPEED_R::new((self.bits & 0x03) as u8) + } + #[doc = "Bits 16:17 - Pin multiplexing of trace signals."] + #[inline(always)] + pub fn tracemux(&self) -> TRACEMUX_R { + TRACEMUX_R::new(((self.bits >> 16) & 0x03) as u8) + } +} +impl W { + #[doc = "Bits 0:1 - Speed of Trace Port clock. Note that the TRACECLK pin will output this clock divided by two."] + #[inline(always)] + pub fn traceportspeed(&mut self) -> TRACEPORTSPEED_W { + TRACEPORTSPEED_W { w: self } + } + #[doc = "Bits 16:17 - Pin multiplexing of trace signals."] + #[inline(always)] + pub fn tracemux(&mut self) -> TRACEMUX_W { + TRACEMUX_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Clocking options for the Trace Port debug interface\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [traceconfig](index.html) module"] +pub struct TRACECONFIG_SPEC; +impl crate::RegisterSpec for TRACECONFIG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [traceconfig::R](R) reader structure"] +impl crate::Readable for TRACECONFIG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [traceconfig::W](W) writer structure"] +impl crate::Writable for TRACECONFIG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TRACECONFIG to value 0"] +impl crate::Resettable for TRACECONFIG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/comp.rs b/src/comp.rs new file mode 100644 index 0000000..cf85448 --- /dev/null +++ b/src/comp.rs @@ -0,0 +1,130 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "0x00 - Start comparator"] + pub tasks_start: crate::Reg, + #[doc = "0x04 - Stop comparator"] + pub tasks_stop: crate::Reg, + #[doc = "0x08 - Sample comparator value"] + pub tasks_sample: crate::Reg, + _reserved3: [u8; 0xf4], + #[doc = "0x100 - COMP is ready and output is valid"] + pub events_ready: crate::Reg, + #[doc = "0x104 - Downward crossing"] + pub events_down: crate::Reg, + #[doc = "0x108 - Upward crossing"] + pub events_up: crate::Reg, + #[doc = "0x10c - Downward or upward crossing"] + pub events_cross: crate::Reg, + _reserved7: [u8; 0xf0], + #[doc = "0x200 - Shortcut register"] + pub shorts: crate::Reg, + _reserved8: [u8; 0xfc], + #[doc = "0x300 - Enable or disable interrupt"] + pub inten: crate::Reg, + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved11: [u8; 0xf4], + #[doc = "0x400 - Compare result"] + pub result: crate::Reg, + _reserved12: [u8; 0xfc], + #[doc = "0x500 - COMP enable"] + pub enable: crate::Reg, + #[doc = "0x504 - Pin select"] + pub psel: crate::Reg, + #[doc = "0x508 - Reference source select for single-ended mode"] + pub refsel: crate::Reg, + #[doc = "0x50c - External reference select"] + pub extrefsel: crate::Reg, + _reserved16: [u8; 0x20], + #[doc = "0x530 - Threshold configuration for hysteresis unit"] + pub th: crate::Reg, + #[doc = "0x534 - Mode configuration"] + pub mode: crate::Reg, + #[doc = "0x538 - Comparator hysteresis enable"] + pub hyst: crate::Reg, + #[doc = "0x53c - Current source select on analog input"] + pub isource: crate::Reg, +} +#[doc = "TASKS_START register accessor: an alias for `Reg`"] +pub type TASKS_START = crate::Reg; +#[doc = "Start comparator"] +pub mod tasks_start; +#[doc = "TASKS_STOP register accessor: an alias for `Reg`"] +pub type TASKS_STOP = crate::Reg; +#[doc = "Stop comparator"] +pub mod tasks_stop; +#[doc = "TASKS_SAMPLE register accessor: an alias for `Reg`"] +pub type TASKS_SAMPLE = crate::Reg; +#[doc = "Sample comparator value"] +pub mod tasks_sample; +#[doc = "EVENTS_READY register accessor: an alias for `Reg`"] +pub type EVENTS_READY = crate::Reg; +#[doc = "COMP is ready and output is valid"] +pub mod events_ready; +#[doc = "EVENTS_DOWN register accessor: an alias for `Reg`"] +pub type EVENTS_DOWN = crate::Reg; +#[doc = "Downward crossing"] +pub mod events_down; +#[doc = "EVENTS_UP register accessor: an alias for `Reg`"] +pub type EVENTS_UP = crate::Reg; +#[doc = "Upward crossing"] +pub mod events_up; +#[doc = "EVENTS_CROSS register accessor: an alias for `Reg`"] +pub type EVENTS_CROSS = crate::Reg; +#[doc = "Downward or upward crossing"] +pub mod events_cross; +#[doc = "SHORTS register accessor: an alias for `Reg`"] +pub type SHORTS = crate::Reg; +#[doc = "Shortcut register"] +pub mod shorts; +#[doc = "INTEN register accessor: an alias for `Reg`"] +pub type INTEN = crate::Reg; +#[doc = "Enable or disable interrupt"] +pub mod inten; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "RESULT register accessor: an alias for `Reg`"] +pub type RESULT = crate::Reg; +#[doc = "Compare result"] +pub mod result; +#[doc = "ENABLE register accessor: an alias for `Reg`"] +pub type ENABLE = crate::Reg; +#[doc = "COMP enable"] +pub mod enable; +#[doc = "PSEL register accessor: an alias for `Reg`"] +pub type PSEL = crate::Reg; +#[doc = "Pin select"] +pub mod psel; +#[doc = "REFSEL register accessor: an alias for `Reg`"] +pub type REFSEL = crate::Reg; +#[doc = "Reference source select for single-ended mode"] +pub mod refsel; +#[doc = "EXTREFSEL register accessor: an alias for `Reg`"] +pub type EXTREFSEL = crate::Reg; +#[doc = "External reference select"] +pub mod extrefsel; +#[doc = "TH register accessor: an alias for `Reg`"] +pub type TH = crate::Reg; +#[doc = "Threshold configuration for hysteresis unit"] +pub mod th; +#[doc = "MODE register accessor: an alias for `Reg`"] +pub type MODE = crate::Reg; +#[doc = "Mode configuration"] +pub mod mode; +#[doc = "HYST register accessor: an alias for `Reg`"] +pub type HYST = crate::Reg; +#[doc = "Comparator hysteresis enable"] +pub mod hyst; +#[doc = "ISOURCE register accessor: an alias for `Reg`"] +pub type ISOURCE = crate::Reg; +#[doc = "Current source select on analog input"] +pub mod isource; diff --git a/src/comp/enable.rs b/src/comp/enable.rs new file mode 100644 index 0000000..51b5d40 --- /dev/null +++ b/src/comp/enable.rs @@ -0,0 +1,151 @@ +#[doc = "Register `ENABLE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ENABLE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable COMP\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum ENABLE_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "2: Enable"] + ENABLED = 2, +} +impl From for u8 { + #[inline(always)] + fn from(variant: ENABLE_A) -> Self { + variant as _ + } +} +#[doc = "Field `ENABLE` reader - Enable or disable COMP"] +pub struct ENABLE_R(crate::FieldReader); +impl ENABLE_R { + pub(crate) fn new(bits: u8) -> Self { + ENABLE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(ENABLE_A::DISABLED), + 2 => Some(ENABLE_A::ENABLED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENABLE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENABLE_A::ENABLED + } +} +impl core::ops::Deref for ENABLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENABLE` writer - Enable or disable COMP"] +pub struct ENABLE_W<'a> { + w: &'a mut W, +} +impl<'a> ENABLE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENABLE_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENABLE_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENABLE_A::ENABLED) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); + self.w + } +} +impl R { + #[doc = "Bits 0:1 - Enable or disable COMP"] + #[inline(always)] + pub fn enable(&self) -> ENABLE_R { + ENABLE_R::new((self.bits & 0x03) as u8) + } +} +impl W { + #[doc = "Bits 0:1 - Enable or disable COMP"] + #[inline(always)] + pub fn enable(&mut self) -> ENABLE_W { + ENABLE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "COMP enable\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [enable](index.html) module"] +pub struct ENABLE_SPEC; +impl crate::RegisterSpec for ENABLE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [enable::R](R) reader structure"] +impl crate::Readable for ENABLE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [enable::W](W) writer structure"] +impl crate::Writable for ENABLE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ENABLE to value 0"] +impl crate::Resettable for ENABLE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/comp/events_cross.rs b/src/comp/events_cross.rs new file mode 100644 index 0000000..9670e7c --- /dev/null +++ b/src/comp/events_cross.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_CROSS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_CROSS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Downward or upward crossing\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_cross](index.html) module"] +pub struct EVENTS_CROSS_SPEC; +impl crate::RegisterSpec for EVENTS_CROSS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_cross::R](R) reader structure"] +impl crate::Readable for EVENTS_CROSS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_cross::W](W) writer structure"] +impl crate::Writable for EVENTS_CROSS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_CROSS to value 0"] +impl crate::Resettable for EVENTS_CROSS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/comp/events_down.rs b/src/comp/events_down.rs new file mode 100644 index 0000000..5cd2bf0 --- /dev/null +++ b/src/comp/events_down.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_DOWN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_DOWN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Downward crossing\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_down](index.html) module"] +pub struct EVENTS_DOWN_SPEC; +impl crate::RegisterSpec for EVENTS_DOWN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_down::R](R) reader structure"] +impl crate::Readable for EVENTS_DOWN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_down::W](W) writer structure"] +impl crate::Writable for EVENTS_DOWN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_DOWN to value 0"] +impl crate::Resettable for EVENTS_DOWN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/comp/events_ready.rs b/src/comp/events_ready.rs new file mode 100644 index 0000000..bac318c --- /dev/null +++ b/src/comp/events_ready.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_READY` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_READY` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "COMP is ready and output is valid\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_ready](index.html) module"] +pub struct EVENTS_READY_SPEC; +impl crate::RegisterSpec for EVENTS_READY_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_ready::R](R) reader structure"] +impl crate::Readable for EVENTS_READY_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_ready::W](W) writer structure"] +impl crate::Writable for EVENTS_READY_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_READY to value 0"] +impl crate::Resettable for EVENTS_READY_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/comp/events_up.rs b/src/comp/events_up.rs new file mode 100644 index 0000000..6592e6b --- /dev/null +++ b/src/comp/events_up.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_UP` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_UP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Upward crossing\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_up](index.html) module"] +pub struct EVENTS_UP_SPEC; +impl crate::RegisterSpec for EVENTS_UP_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_up::R](R) reader structure"] +impl crate::Readable for EVENTS_UP_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_up::W](W) writer structure"] +impl crate::Writable for EVENTS_UP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_UP to value 0"] +impl crate::Resettable for EVENTS_UP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/comp/extrefsel.rs b/src/comp/extrefsel.rs new file mode 100644 index 0000000..2152d8d --- /dev/null +++ b/src/comp/extrefsel.rs @@ -0,0 +1,229 @@ +#[doc = "Register `EXTREFSEL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EXTREFSEL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "External analog reference select\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum EXTREFSEL_A { + #[doc = "0: Use AIN0 as external analog reference"] + ANALOGREFERENCE0 = 0, + #[doc = "1: Use AIN1 as external analog reference"] + ANALOGREFERENCE1 = 1, + #[doc = "2: Use AIN2 as external analog reference"] + ANALOGREFERENCE2 = 2, + #[doc = "3: Use AIN3 as external analog reference"] + ANALOGREFERENCE3 = 3, + #[doc = "4: Use AIN4 as external analog reference"] + ANALOGREFERENCE4 = 4, + #[doc = "5: Use AIN5 as external analog reference"] + ANALOGREFERENCE5 = 5, + #[doc = "6: Use AIN6 as external analog reference"] + ANALOGREFERENCE6 = 6, + #[doc = "7: Use AIN7 as external analog reference"] + ANALOGREFERENCE7 = 7, +} +impl From for u8 { + #[inline(always)] + fn from(variant: EXTREFSEL_A) -> Self { + variant as _ + } +} +#[doc = "Field `EXTREFSEL` reader - External analog reference select"] +pub struct EXTREFSEL_R(crate::FieldReader); +impl EXTREFSEL_R { + pub(crate) fn new(bits: u8) -> Self { + EXTREFSEL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> EXTREFSEL_A { + match self.bits { + 0 => EXTREFSEL_A::ANALOGREFERENCE0, + 1 => EXTREFSEL_A::ANALOGREFERENCE1, + 2 => EXTREFSEL_A::ANALOGREFERENCE2, + 3 => EXTREFSEL_A::ANALOGREFERENCE3, + 4 => EXTREFSEL_A::ANALOGREFERENCE4, + 5 => EXTREFSEL_A::ANALOGREFERENCE5, + 6 => EXTREFSEL_A::ANALOGREFERENCE6, + 7 => EXTREFSEL_A::ANALOGREFERENCE7, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `ANALOGREFERENCE0`"] + #[inline(always)] + pub fn is_analog_reference0(&self) -> bool { + **self == EXTREFSEL_A::ANALOGREFERENCE0 + } + #[doc = "Checks if the value of the field is `ANALOGREFERENCE1`"] + #[inline(always)] + pub fn is_analog_reference1(&self) -> bool { + **self == EXTREFSEL_A::ANALOGREFERENCE1 + } + #[doc = "Checks if the value of the field is `ANALOGREFERENCE2`"] + #[inline(always)] + pub fn is_analog_reference2(&self) -> bool { + **self == EXTREFSEL_A::ANALOGREFERENCE2 + } + #[doc = "Checks if the value of the field is `ANALOGREFERENCE3`"] + #[inline(always)] + pub fn is_analog_reference3(&self) -> bool { + **self == EXTREFSEL_A::ANALOGREFERENCE3 + } + #[doc = "Checks if the value of the field is `ANALOGREFERENCE4`"] + #[inline(always)] + pub fn is_analog_reference4(&self) -> bool { + **self == EXTREFSEL_A::ANALOGREFERENCE4 + } + #[doc = "Checks if the value of the field is `ANALOGREFERENCE5`"] + #[inline(always)] + pub fn is_analog_reference5(&self) -> bool { + **self == EXTREFSEL_A::ANALOGREFERENCE5 + } + #[doc = "Checks if the value of the field is `ANALOGREFERENCE6`"] + #[inline(always)] + pub fn is_analog_reference6(&self) -> bool { + **self == EXTREFSEL_A::ANALOGREFERENCE6 + } + #[doc = "Checks if the value of the field is `ANALOGREFERENCE7`"] + #[inline(always)] + pub fn is_analog_reference7(&self) -> bool { + **self == EXTREFSEL_A::ANALOGREFERENCE7 + } +} +impl core::ops::Deref for EXTREFSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EXTREFSEL` writer - External analog reference select"] +pub struct EXTREFSEL_W<'a> { + w: &'a mut W, +} +impl<'a> EXTREFSEL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: EXTREFSEL_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "Use AIN0 as external analog reference"] + #[inline(always)] + pub fn analog_reference0(self) -> &'a mut W { + self.variant(EXTREFSEL_A::ANALOGREFERENCE0) + } + #[doc = "Use AIN1 as external analog reference"] + #[inline(always)] + pub fn analog_reference1(self) -> &'a mut W { + self.variant(EXTREFSEL_A::ANALOGREFERENCE1) + } + #[doc = "Use AIN2 as external analog reference"] + #[inline(always)] + pub fn analog_reference2(self) -> &'a mut W { + self.variant(EXTREFSEL_A::ANALOGREFERENCE2) + } + #[doc = "Use AIN3 as external analog reference"] + #[inline(always)] + pub fn analog_reference3(self) -> &'a mut W { + self.variant(EXTREFSEL_A::ANALOGREFERENCE3) + } + #[doc = "Use AIN4 as external analog reference"] + #[inline(always)] + pub fn analog_reference4(self) -> &'a mut W { + self.variant(EXTREFSEL_A::ANALOGREFERENCE4) + } + #[doc = "Use AIN5 as external analog reference"] + #[inline(always)] + pub fn analog_reference5(self) -> &'a mut W { + self.variant(EXTREFSEL_A::ANALOGREFERENCE5) + } + #[doc = "Use AIN6 as external analog reference"] + #[inline(always)] + pub fn analog_reference6(self) -> &'a mut W { + self.variant(EXTREFSEL_A::ANALOGREFERENCE6) + } + #[doc = "Use AIN7 as external analog reference"] + #[inline(always)] + pub fn analog_reference7(self) -> &'a mut W { + self.variant(EXTREFSEL_A::ANALOGREFERENCE7) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); + self.w + } +} +impl R { + #[doc = "Bits 0:2 - External analog reference select"] + #[inline(always)] + pub fn extrefsel(&self) -> EXTREFSEL_R { + EXTREFSEL_R::new((self.bits & 0x07) as u8) + } +} +impl W { + #[doc = "Bits 0:2 - External analog reference select"] + #[inline(always)] + pub fn extrefsel(&mut self) -> EXTREFSEL_W { + EXTREFSEL_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "External reference select\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [extrefsel](index.html) module"] +pub struct EXTREFSEL_SPEC; +impl crate::RegisterSpec for EXTREFSEL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [extrefsel::R](R) reader structure"] +impl crate::Readable for EXTREFSEL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [extrefsel::W](W) writer structure"] +impl crate::Writable for EXTREFSEL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EXTREFSEL to value 0"] +impl crate::Resettable for EXTREFSEL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/comp/hyst.rs b/src/comp/hyst.rs new file mode 100644 index 0000000..b4e08ef --- /dev/null +++ b/src/comp/hyst.rs @@ -0,0 +1,159 @@ +#[doc = "Register `HYST` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `HYST` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Comparator hysteresis\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum HYST_A { + #[doc = "0: Comparator hysteresis disabled"] + NOHYST = 0, + #[doc = "1: Comparator hysteresis enabled"] + HYST50MV = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: HYST_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `HYST` reader - Comparator hysteresis"] +pub struct HYST_R(crate::FieldReader); +impl HYST_R { + pub(crate) fn new(bits: bool) -> Self { + HYST_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> HYST_A { + match self.bits { + false => HYST_A::NOHYST, + true => HYST_A::HYST50MV, + } + } + #[doc = "Checks if the value of the field is `NOHYST`"] + #[inline(always)] + pub fn is_no_hyst(&self) -> bool { + **self == HYST_A::NOHYST + } + #[doc = "Checks if the value of the field is `HYST50MV`"] + #[inline(always)] + pub fn is_hyst50m_v(&self) -> bool { + **self == HYST_A::HYST50MV + } +} +impl core::ops::Deref for HYST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HYST` writer - Comparator hysteresis"] +pub struct HYST_W<'a> { + w: &'a mut W, +} +impl<'a> HYST_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: HYST_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Comparator hysteresis disabled"] + #[inline(always)] + pub fn no_hyst(self) -> &'a mut W { + self.variant(HYST_A::NOHYST) + } + #[doc = "Comparator hysteresis enabled"] + #[inline(always)] + pub fn hyst50m_v(self) -> &'a mut W { + self.variant(HYST_A::HYST50MV) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Comparator hysteresis"] + #[inline(always)] + pub fn hyst(&self) -> HYST_R { + HYST_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Comparator hysteresis"] + #[inline(always)] + pub fn hyst(&mut self) -> HYST_W { + HYST_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Comparator hysteresis enable\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hyst](index.html) module"] +pub struct HYST_SPEC; +impl crate::RegisterSpec for HYST_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [hyst::R](R) reader structure"] +impl crate::Readable for HYST_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [hyst::W](W) writer structure"] +impl crate::Writable for HYST_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets HYST to value 0"] +impl crate::Resettable for HYST_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/comp/inten.rs b/src/comp/inten.rs new file mode 100644 index 0000000..9778255 --- /dev/null +++ b/src/comp/inten.rs @@ -0,0 +1,438 @@ +#[doc = "Register `INTEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable interrupt for READY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY` reader - Enable or disable interrupt for READY event"] +pub struct READY_R(crate::FieldReader); +impl READY_R { + pub(crate) fn new(bits: bool) -> Self { + READY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> READY_A { + match self.bits { + false => READY_A::DISABLED, + true => READY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == READY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == READY_A::ENABLED + } +} +impl core::ops::Deref for READY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `READY` writer - Enable or disable interrupt for READY event"] +pub struct READY_W<'a> { + w: &'a mut W, +} +impl<'a> READY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: READY_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(READY_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(READY_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Enable or disable interrupt for DOWN event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DOWN_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DOWN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DOWN` reader - Enable or disable interrupt for DOWN event"] +pub struct DOWN_R(crate::FieldReader); +impl DOWN_R { + pub(crate) fn new(bits: bool) -> Self { + DOWN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DOWN_A { + match self.bits { + false => DOWN_A::DISABLED, + true => DOWN_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DOWN_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DOWN_A::ENABLED + } +} +impl core::ops::Deref for DOWN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DOWN` writer - Enable or disable interrupt for DOWN event"] +pub struct DOWN_W<'a> { + w: &'a mut W, +} +impl<'a> DOWN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DOWN_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(DOWN_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(DOWN_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Enable or disable interrupt for UP event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum UP_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: UP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `UP` reader - Enable or disable interrupt for UP event"] +pub struct UP_R(crate::FieldReader); +impl UP_R { + pub(crate) fn new(bits: bool) -> Self { + UP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> UP_A { + match self.bits { + false => UP_A::DISABLED, + true => UP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == UP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == UP_A::ENABLED + } +} +impl core::ops::Deref for UP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `UP` writer - Enable or disable interrupt for UP event"] +pub struct UP_W<'a> { + w: &'a mut W, +} +impl<'a> UP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: UP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(UP_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(UP_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Enable or disable interrupt for CROSS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CROSS_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CROSS_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CROSS` reader - Enable or disable interrupt for CROSS event"] +pub struct CROSS_R(crate::FieldReader); +impl CROSS_R { + pub(crate) fn new(bits: bool) -> Self { + CROSS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CROSS_A { + match self.bits { + false => CROSS_A::DISABLED, + true => CROSS_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CROSS_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CROSS_A::ENABLED + } +} +impl core::ops::Deref for CROSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CROSS` writer - Enable or disable interrupt for CROSS event"] +pub struct CROSS_W<'a> { + w: &'a mut W, +} +impl<'a> CROSS_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CROSS_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CROSS_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CROSS_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable or disable interrupt for READY event"] + #[inline(always)] + pub fn ready(&self) -> READY_R { + READY_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Enable or disable interrupt for DOWN event"] + #[inline(always)] + pub fn down(&self) -> DOWN_R { + DOWN_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Enable or disable interrupt for UP event"] + #[inline(always)] + pub fn up(&self) -> UP_R { + UP_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Enable or disable interrupt for CROSS event"] + #[inline(always)] + pub fn cross(&self) -> CROSS_R { + CROSS_R::new(((self.bits >> 3) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Enable or disable interrupt for READY event"] + #[inline(always)] + pub fn ready(&mut self) -> READY_W { + READY_W { w: self } + } + #[doc = "Bit 1 - Enable or disable interrupt for DOWN event"] + #[inline(always)] + pub fn down(&mut self) -> DOWN_W { + DOWN_W { w: self } + } + #[doc = "Bit 2 - Enable or disable interrupt for UP event"] + #[inline(always)] + pub fn up(&mut self) -> UP_W { + UP_W { w: self } + } + #[doc = "Bit 3 - Enable or disable interrupt for CROSS event"] + #[inline(always)] + pub fn cross(&mut self) -> CROSS_W { + CROSS_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable or disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [inten](index.html) module"] +pub struct INTEN_SPEC; +impl crate::RegisterSpec for INTEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [inten::R](R) reader structure"] +impl crate::Readable for INTEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [inten::W](W) writer structure"] +impl crate::Writable for INTEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTEN to value 0"] +impl crate::Resettable for INTEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/comp/intenclr.rs b/src/comp/intenclr.rs new file mode 100644 index 0000000..66acb1d --- /dev/null +++ b/src/comp/intenclr.rs @@ -0,0 +1,466 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for READY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY` reader - Write '1' to Disable interrupt for READY event"] +pub struct READY_R(crate::FieldReader); +impl READY_R { + pub(crate) fn new(bits: bool) -> Self { + READY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> READY_A { + match self.bits { + false => READY_A::DISABLED, + true => READY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == READY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == READY_A::ENABLED + } +} +impl core::ops::Deref for READY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for READY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY` writer - Write '1' to Disable interrupt for READY event"] +pub struct READY_W<'a> { + w: &'a mut W, +} +impl<'a> READY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: READY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(READY_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for DOWN event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DOWN_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DOWN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DOWN` reader - Write '1' to Disable interrupt for DOWN event"] +pub struct DOWN_R(crate::FieldReader); +impl DOWN_R { + pub(crate) fn new(bits: bool) -> Self { + DOWN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DOWN_A { + match self.bits { + false => DOWN_A::DISABLED, + true => DOWN_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DOWN_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DOWN_A::ENABLED + } +} +impl core::ops::Deref for DOWN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for DOWN event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DOWN_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DOWN_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DOWN` writer - Write '1' to Disable interrupt for DOWN event"] +pub struct DOWN_W<'a> { + w: &'a mut W, +} +impl<'a> DOWN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DOWN_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(DOWN_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for UP event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum UP_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: UP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `UP` reader - Write '1' to Disable interrupt for UP event"] +pub struct UP_R(crate::FieldReader); +impl UP_R { + pub(crate) fn new(bits: bool) -> Self { + UP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> UP_A { + match self.bits { + false => UP_A::DISABLED, + true => UP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == UP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == UP_A::ENABLED + } +} +impl core::ops::Deref for UP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for UP event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum UP_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: UP_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `UP` writer - Write '1' to Disable interrupt for UP event"] +pub struct UP_W<'a> { + w: &'a mut W, +} +impl<'a> UP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: UP_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(UP_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for CROSS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CROSS_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CROSS_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CROSS` reader - Write '1' to Disable interrupt for CROSS event"] +pub struct CROSS_R(crate::FieldReader); +impl CROSS_R { + pub(crate) fn new(bits: bool) -> Self { + CROSS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CROSS_A { + match self.bits { + false => CROSS_A::DISABLED, + true => CROSS_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CROSS_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CROSS_A::ENABLED + } +} +impl core::ops::Deref for CROSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for CROSS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CROSS_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CROSS_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CROSS` writer - Write '1' to Disable interrupt for CROSS event"] +pub struct CROSS_W<'a> { + w: &'a mut W, +} +impl<'a> CROSS_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CROSS_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CROSS_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Disable interrupt for READY event"] + #[inline(always)] + pub fn ready(&self) -> READY_R { + READY_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for DOWN event"] + #[inline(always)] + pub fn down(&self) -> DOWN_R { + DOWN_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for UP event"] + #[inline(always)] + pub fn up(&self) -> UP_R { + UP_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Write '1' to Disable interrupt for CROSS event"] + #[inline(always)] + pub fn cross(&self) -> CROSS_R { + CROSS_R::new(((self.bits >> 3) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Disable interrupt for READY event"] + #[inline(always)] + pub fn ready(&mut self) -> READY_W { + READY_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for DOWN event"] + #[inline(always)] + pub fn down(&mut self) -> DOWN_W { + DOWN_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for UP event"] + #[inline(always)] + pub fn up(&mut self) -> UP_W { + UP_W { w: self } + } + #[doc = "Bit 3 - Write '1' to Disable interrupt for CROSS event"] + #[inline(always)] + pub fn cross(&mut self) -> CROSS_W { + CROSS_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/comp/intenset.rs b/src/comp/intenset.rs new file mode 100644 index 0000000..1c41dd3 --- /dev/null +++ b/src/comp/intenset.rs @@ -0,0 +1,466 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for READY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY` reader - Write '1' to Enable interrupt for READY event"] +pub struct READY_R(crate::FieldReader); +impl READY_R { + pub(crate) fn new(bits: bool) -> Self { + READY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> READY_A { + match self.bits { + false => READY_A::DISABLED, + true => READY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == READY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == READY_A::ENABLED + } +} +impl core::ops::Deref for READY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for READY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY` writer - Write '1' to Enable interrupt for READY event"] +pub struct READY_W<'a> { + w: &'a mut W, +} +impl<'a> READY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: READY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(READY_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for DOWN event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DOWN_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DOWN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DOWN` reader - Write '1' to Enable interrupt for DOWN event"] +pub struct DOWN_R(crate::FieldReader); +impl DOWN_R { + pub(crate) fn new(bits: bool) -> Self { + DOWN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DOWN_A { + match self.bits { + false => DOWN_A::DISABLED, + true => DOWN_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DOWN_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DOWN_A::ENABLED + } +} +impl core::ops::Deref for DOWN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for DOWN event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DOWN_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DOWN_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DOWN` writer - Write '1' to Enable interrupt for DOWN event"] +pub struct DOWN_W<'a> { + w: &'a mut W, +} +impl<'a> DOWN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DOWN_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(DOWN_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for UP event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum UP_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: UP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `UP` reader - Write '1' to Enable interrupt for UP event"] +pub struct UP_R(crate::FieldReader); +impl UP_R { + pub(crate) fn new(bits: bool) -> Self { + UP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> UP_A { + match self.bits { + false => UP_A::DISABLED, + true => UP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == UP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == UP_A::ENABLED + } +} +impl core::ops::Deref for UP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for UP event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum UP_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: UP_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `UP` writer - Write '1' to Enable interrupt for UP event"] +pub struct UP_W<'a> { + w: &'a mut W, +} +impl<'a> UP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: UP_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(UP_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for CROSS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CROSS_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CROSS_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CROSS` reader - Write '1' to Enable interrupt for CROSS event"] +pub struct CROSS_R(crate::FieldReader); +impl CROSS_R { + pub(crate) fn new(bits: bool) -> Self { + CROSS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CROSS_A { + match self.bits { + false => CROSS_A::DISABLED, + true => CROSS_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CROSS_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CROSS_A::ENABLED + } +} +impl core::ops::Deref for CROSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for CROSS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CROSS_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CROSS_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CROSS` writer - Write '1' to Enable interrupt for CROSS event"] +pub struct CROSS_W<'a> { + w: &'a mut W, +} +impl<'a> CROSS_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CROSS_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CROSS_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Enable interrupt for READY event"] + #[inline(always)] + pub fn ready(&self) -> READY_R { + READY_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for DOWN event"] + #[inline(always)] + pub fn down(&self) -> DOWN_R { + DOWN_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for UP event"] + #[inline(always)] + pub fn up(&self) -> UP_R { + UP_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Write '1' to Enable interrupt for CROSS event"] + #[inline(always)] + pub fn cross(&self) -> CROSS_R { + CROSS_R::new(((self.bits >> 3) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Enable interrupt for READY event"] + #[inline(always)] + pub fn ready(&mut self) -> READY_W { + READY_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for DOWN event"] + #[inline(always)] + pub fn down(&mut self) -> DOWN_W { + DOWN_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for UP event"] + #[inline(always)] + pub fn up(&mut self) -> UP_W { + UP_W { w: self } + } + #[doc = "Bit 3 - Write '1' to Enable interrupt for CROSS event"] + #[inline(always)] + pub fn cross(&mut self) -> CROSS_W { + CROSS_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/comp/isource.rs b/src/comp/isource.rs new file mode 100644 index 0000000..8a8d2ed --- /dev/null +++ b/src/comp/isource.rs @@ -0,0 +1,177 @@ +#[doc = "Register `ISOURCE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ISOURCE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Comparator hysteresis\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum ISOURCE_A { + #[doc = "0: Current source disabled"] + OFF = 0, + #[doc = "1: Current source enabled (+/- 2.5 uA)"] + IEN2MA5 = 1, + #[doc = "2: Current source enabled (+/- 5 uA)"] + IEN5MA = 2, + #[doc = "3: Current source enabled (+/- 10 uA)"] + IEN10MA = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: ISOURCE_A) -> Self { + variant as _ + } +} +#[doc = "Field `ISOURCE` reader - Comparator hysteresis"] +pub struct ISOURCE_R(crate::FieldReader); +impl ISOURCE_R { + pub(crate) fn new(bits: u8) -> Self { + ISOURCE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ISOURCE_A { + match self.bits { + 0 => ISOURCE_A::OFF, + 1 => ISOURCE_A::IEN2MA5, + 2 => ISOURCE_A::IEN5MA, + 3 => ISOURCE_A::IEN10MA, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `OFF`"] + #[inline(always)] + pub fn is_off(&self) -> bool { + **self == ISOURCE_A::OFF + } + #[doc = "Checks if the value of the field is `IEN2MA5`"] + #[inline(always)] + pub fn is_ien2m_a5(&self) -> bool { + **self == ISOURCE_A::IEN2MA5 + } + #[doc = "Checks if the value of the field is `IEN5MA`"] + #[inline(always)] + pub fn is_ien5m_a(&self) -> bool { + **self == ISOURCE_A::IEN5MA + } + #[doc = "Checks if the value of the field is `IEN10MA`"] + #[inline(always)] + pub fn is_ien10m_a(&self) -> bool { + **self == ISOURCE_A::IEN10MA + } +} +impl core::ops::Deref for ISOURCE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ISOURCE` writer - Comparator hysteresis"] +pub struct ISOURCE_W<'a> { + w: &'a mut W, +} +impl<'a> ISOURCE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ISOURCE_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "Current source disabled"] + #[inline(always)] + pub fn off(self) -> &'a mut W { + self.variant(ISOURCE_A::OFF) + } + #[doc = "Current source enabled (+/- 2.5 uA)"] + #[inline(always)] + pub fn ien2m_a5(self) -> &'a mut W { + self.variant(ISOURCE_A::IEN2MA5) + } + #[doc = "Current source enabled (+/- 5 uA)"] + #[inline(always)] + pub fn ien5m_a(self) -> &'a mut W { + self.variant(ISOURCE_A::IEN5MA) + } + #[doc = "Current source enabled (+/- 10 uA)"] + #[inline(always)] + pub fn ien10m_a(self) -> &'a mut W { + self.variant(ISOURCE_A::IEN10MA) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); + self.w + } +} +impl R { + #[doc = "Bits 0:1 - Comparator hysteresis"] + #[inline(always)] + pub fn isource(&self) -> ISOURCE_R { + ISOURCE_R::new((self.bits & 0x03) as u8) + } +} +impl W { + #[doc = "Bits 0:1 - Comparator hysteresis"] + #[inline(always)] + pub fn isource(&mut self) -> ISOURCE_W { + ISOURCE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Current source select on analog input\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [isource](index.html) module"] +pub struct ISOURCE_SPEC; +impl crate::RegisterSpec for ISOURCE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [isource::R](R) reader structure"] +impl crate::Readable for ISOURCE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [isource::W](W) writer structure"] +impl crate::Writable for ISOURCE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ISOURCE to value 0"] +impl crate::Resettable for ISOURCE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/comp/mode.rs b/src/comp/mode.rs new file mode 100644 index 0000000..b9d7f3e --- /dev/null +++ b/src/comp/mode.rs @@ -0,0 +1,257 @@ +#[doc = "Register `MODE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MODE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Speed and power modes\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum SP_A { + #[doc = "0: Low-power mode"] + LOW = 0, + #[doc = "1: Normal mode"] + NORMAL = 1, + #[doc = "2: High-speed mode"] + HIGH = 2, +} +impl From for u8 { + #[inline(always)] + fn from(variant: SP_A) -> Self { + variant as _ + } +} +#[doc = "Field `SP` reader - Speed and power modes"] +pub struct SP_R(crate::FieldReader); +impl SP_R { + pub(crate) fn new(bits: u8) -> Self { + SP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(SP_A::LOW), + 1 => Some(SP_A::NORMAL), + 2 => Some(SP_A::HIGH), + _ => None, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == SP_A::LOW + } + #[doc = "Checks if the value of the field is `NORMAL`"] + #[inline(always)] + pub fn is_normal(&self) -> bool { + **self == SP_A::NORMAL + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == SP_A::HIGH + } +} +impl core::ops::Deref for SP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SP` writer - Speed and power modes"] +pub struct SP_W<'a> { + w: &'a mut W, +} +impl<'a> SP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SP_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Low-power mode"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(SP_A::LOW) + } + #[doc = "Normal mode"] + #[inline(always)] + pub fn normal(self) -> &'a mut W { + self.variant(SP_A::NORMAL) + } + #[doc = "High-speed mode"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(SP_A::HIGH) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); + self.w + } +} +#[doc = "Main operation modes\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum MAIN_A { + #[doc = "0: Single-ended mode"] + SE = 0, + #[doc = "1: Differential mode"] + DIFF = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: MAIN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `MAIN` reader - Main operation modes"] +pub struct MAIN_R(crate::FieldReader); +impl MAIN_R { + pub(crate) fn new(bits: bool) -> Self { + MAIN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> MAIN_A { + match self.bits { + false => MAIN_A::SE, + true => MAIN_A::DIFF, + } + } + #[doc = "Checks if the value of the field is `SE`"] + #[inline(always)] + pub fn is_se(&self) -> bool { + **self == MAIN_A::SE + } + #[doc = "Checks if the value of the field is `DIFF`"] + #[inline(always)] + pub fn is_diff(&self) -> bool { + **self == MAIN_A::DIFF + } +} +impl core::ops::Deref for MAIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MAIN` writer - Main operation modes"] +pub struct MAIN_W<'a> { + w: &'a mut W, +} +impl<'a> MAIN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: MAIN_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Single-ended mode"] + #[inline(always)] + pub fn se(self) -> &'a mut W { + self.variant(MAIN_A::SE) + } + #[doc = "Differential mode"] + #[inline(always)] + pub fn diff(self) -> &'a mut W { + self.variant(MAIN_A::DIFF) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +impl R { + #[doc = "Bits 0:1 - Speed and power modes"] + #[inline(always)] + pub fn sp(&self) -> SP_R { + SP_R::new((self.bits & 0x03) as u8) + } + #[doc = "Bit 8 - Main operation modes"] + #[inline(always)] + pub fn main(&self) -> MAIN_R { + MAIN_R::new(((self.bits >> 8) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:1 - Speed and power modes"] + #[inline(always)] + pub fn sp(&mut self) -> SP_W { + SP_W { w: self } + } + #[doc = "Bit 8 - Main operation modes"] + #[inline(always)] + pub fn main(&mut self) -> MAIN_W { + MAIN_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Mode configuration\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mode](index.html) module"] +pub struct MODE_SPEC; +impl crate::RegisterSpec for MODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mode::R](R) reader structure"] +impl crate::Readable for MODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mode::W](W) writer structure"] +impl crate::Writable for MODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MODE to value 0"] +impl crate::Resettable for MODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/comp/psel.rs b/src/comp/psel.rs new file mode 100644 index 0000000..f019ed0 --- /dev/null +++ b/src/comp/psel.rs @@ -0,0 +1,229 @@ +#[doc = "Register `PSEL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PSEL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Analog pin select\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum PSEL_A { + #[doc = "0: AIN0 selected as analog input"] + ANALOGINPUT0 = 0, + #[doc = "1: AIN1 selected as analog input"] + ANALOGINPUT1 = 1, + #[doc = "2: AIN2 selected as analog input"] + ANALOGINPUT2 = 2, + #[doc = "3: AIN3 selected as analog input"] + ANALOGINPUT3 = 3, + #[doc = "4: AIN4 selected as analog input"] + ANALOGINPUT4 = 4, + #[doc = "5: AIN5 selected as analog input"] + ANALOGINPUT5 = 5, + #[doc = "6: AIN6 selected as analog input"] + ANALOGINPUT6 = 6, + #[doc = "7: AIN7 selected as analog input"] + ANALOGINPUT7 = 7, +} +impl From for u8 { + #[inline(always)] + fn from(variant: PSEL_A) -> Self { + variant as _ + } +} +#[doc = "Field `PSEL` reader - Analog pin select"] +pub struct PSEL_R(crate::FieldReader); +impl PSEL_R { + pub(crate) fn new(bits: u8) -> Self { + PSEL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PSEL_A { + match self.bits { + 0 => PSEL_A::ANALOGINPUT0, + 1 => PSEL_A::ANALOGINPUT1, + 2 => PSEL_A::ANALOGINPUT2, + 3 => PSEL_A::ANALOGINPUT3, + 4 => PSEL_A::ANALOGINPUT4, + 5 => PSEL_A::ANALOGINPUT5, + 6 => PSEL_A::ANALOGINPUT6, + 7 => PSEL_A::ANALOGINPUT7, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `ANALOGINPUT0`"] + #[inline(always)] + pub fn is_analog_input0(&self) -> bool { + **self == PSEL_A::ANALOGINPUT0 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT1`"] + #[inline(always)] + pub fn is_analog_input1(&self) -> bool { + **self == PSEL_A::ANALOGINPUT1 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT2`"] + #[inline(always)] + pub fn is_analog_input2(&self) -> bool { + **self == PSEL_A::ANALOGINPUT2 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT3`"] + #[inline(always)] + pub fn is_analog_input3(&self) -> bool { + **self == PSEL_A::ANALOGINPUT3 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT4`"] + #[inline(always)] + pub fn is_analog_input4(&self) -> bool { + **self == PSEL_A::ANALOGINPUT4 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT5`"] + #[inline(always)] + pub fn is_analog_input5(&self) -> bool { + **self == PSEL_A::ANALOGINPUT5 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT6`"] + #[inline(always)] + pub fn is_analog_input6(&self) -> bool { + **self == PSEL_A::ANALOGINPUT6 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT7`"] + #[inline(always)] + pub fn is_analog_input7(&self) -> bool { + **self == PSEL_A::ANALOGINPUT7 + } +} +impl core::ops::Deref for PSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PSEL` writer - Analog pin select"] +pub struct PSEL_W<'a> { + w: &'a mut W, +} +impl<'a> PSEL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PSEL_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "AIN0 selected as analog input"] + #[inline(always)] + pub fn analog_input0(self) -> &'a mut W { + self.variant(PSEL_A::ANALOGINPUT0) + } + #[doc = "AIN1 selected as analog input"] + #[inline(always)] + pub fn analog_input1(self) -> &'a mut W { + self.variant(PSEL_A::ANALOGINPUT1) + } + #[doc = "AIN2 selected as analog input"] + #[inline(always)] + pub fn analog_input2(self) -> &'a mut W { + self.variant(PSEL_A::ANALOGINPUT2) + } + #[doc = "AIN3 selected as analog input"] + #[inline(always)] + pub fn analog_input3(self) -> &'a mut W { + self.variant(PSEL_A::ANALOGINPUT3) + } + #[doc = "AIN4 selected as analog input"] + #[inline(always)] + pub fn analog_input4(self) -> &'a mut W { + self.variant(PSEL_A::ANALOGINPUT4) + } + #[doc = "AIN5 selected as analog input"] + #[inline(always)] + pub fn analog_input5(self) -> &'a mut W { + self.variant(PSEL_A::ANALOGINPUT5) + } + #[doc = "AIN6 selected as analog input"] + #[inline(always)] + pub fn analog_input6(self) -> &'a mut W { + self.variant(PSEL_A::ANALOGINPUT6) + } + #[doc = "AIN7 selected as analog input"] + #[inline(always)] + pub fn analog_input7(self) -> &'a mut W { + self.variant(PSEL_A::ANALOGINPUT7) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); + self.w + } +} +impl R { + #[doc = "Bits 0:2 - Analog pin select"] + #[inline(always)] + pub fn psel(&self) -> PSEL_R { + PSEL_R::new((self.bits & 0x07) as u8) + } +} +impl W { + #[doc = "Bits 0:2 - Analog pin select"] + #[inline(always)] + pub fn psel(&mut self) -> PSEL_W { + PSEL_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [psel](index.html) module"] +pub struct PSEL_SPEC; +impl crate::RegisterSpec for PSEL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [psel::R](R) reader structure"] +impl crate::Readable for PSEL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [psel::W](W) writer structure"] +impl crate::Writable for PSEL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PSEL to value 0"] +impl crate::Resettable for PSEL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/comp/refsel.rs b/src/comp/refsel.rs new file mode 100644 index 0000000..f79f585 --- /dev/null +++ b/src/comp/refsel.rs @@ -0,0 +1,190 @@ +#[doc = "Register `REFSEL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `REFSEL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Reference select\n\nValue on reset: 4"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum REFSEL_A { + #[doc = "0: VREF = internal 1.2 V reference (VDD >= 1.7 V)"] + INT1V2 = 0, + #[doc = "1: VREF = internal 1.8 V reference (VDD >= VREF + 0.2 V)"] + INT1V8 = 1, + #[doc = "2: VREF = internal 2.4 V reference (VDD >= VREF + 0.2 V)"] + INT2V4 = 2, + #[doc = "4: VREF = VDD"] + VDD = 4, + #[doc = "7: VREF = AREF (VDD >= VREF >= AREFMIN)"] + AREF = 7, +} +impl From for u8 { + #[inline(always)] + fn from(variant: REFSEL_A) -> Self { + variant as _ + } +} +#[doc = "Field `REFSEL` reader - Reference select"] +pub struct REFSEL_R(crate::FieldReader); +impl REFSEL_R { + pub(crate) fn new(bits: u8) -> Self { + REFSEL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(REFSEL_A::INT1V2), + 1 => Some(REFSEL_A::INT1V8), + 2 => Some(REFSEL_A::INT2V4), + 4 => Some(REFSEL_A::VDD), + 7 => Some(REFSEL_A::AREF), + _ => None, + } + } + #[doc = "Checks if the value of the field is `INT1V2`"] + #[inline(always)] + pub fn is_int1v2(&self) -> bool { + **self == REFSEL_A::INT1V2 + } + #[doc = "Checks if the value of the field is `INT1V8`"] + #[inline(always)] + pub fn is_int1v8(&self) -> bool { + **self == REFSEL_A::INT1V8 + } + #[doc = "Checks if the value of the field is `INT2V4`"] + #[inline(always)] + pub fn is_int2v4(&self) -> bool { + **self == REFSEL_A::INT2V4 + } + #[doc = "Checks if the value of the field is `VDD`"] + #[inline(always)] + pub fn is_vdd(&self) -> bool { + **self == REFSEL_A::VDD + } + #[doc = "Checks if the value of the field is `AREF`"] + #[inline(always)] + pub fn is_aref(&self) -> bool { + **self == REFSEL_A::AREF + } +} +impl core::ops::Deref for REFSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REFSEL` writer - Reference select"] +pub struct REFSEL_W<'a> { + w: &'a mut W, +} +impl<'a> REFSEL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REFSEL_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "VREF = internal 1.2 V reference (VDD >= 1.7 V)"] + #[inline(always)] + pub fn int1v2(self) -> &'a mut W { + self.variant(REFSEL_A::INT1V2) + } + #[doc = "VREF = internal 1.8 V reference (VDD >= VREF + 0.2 V)"] + #[inline(always)] + pub fn int1v8(self) -> &'a mut W { + self.variant(REFSEL_A::INT1V8) + } + #[doc = "VREF = internal 2.4 V reference (VDD >= VREF + 0.2 V)"] + #[inline(always)] + pub fn int2v4(self) -> &'a mut W { + self.variant(REFSEL_A::INT2V4) + } + #[doc = "VREF = VDD"] + #[inline(always)] + pub fn vdd(self) -> &'a mut W { + self.variant(REFSEL_A::VDD) + } + #[doc = "VREF = AREF (VDD >= VREF >= AREFMIN)"] + #[inline(always)] + pub fn aref(self) -> &'a mut W { + self.variant(REFSEL_A::AREF) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); + self.w + } +} +impl R { + #[doc = "Bits 0:2 - Reference select"] + #[inline(always)] + pub fn refsel(&self) -> REFSEL_R { + REFSEL_R::new((self.bits & 0x07) as u8) + } +} +impl W { + #[doc = "Bits 0:2 - Reference select"] + #[inline(always)] + pub fn refsel(&mut self) -> REFSEL_W { + REFSEL_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Reference source select for single-ended mode\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [refsel](index.html) module"] +pub struct REFSEL_SPEC; +impl crate::RegisterSpec for REFSEL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [refsel::R](R) reader structure"] +impl crate::Readable for REFSEL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [refsel::W](W) writer structure"] +impl crate::Writable for REFSEL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets REFSEL to value 0x04"] +impl crate::Resettable for REFSEL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x04 + } +} diff --git a/src/comp/result.rs b/src/comp/result.rs new file mode 100644 index 0000000..b863260 --- /dev/null +++ b/src/comp/result.rs @@ -0,0 +1,84 @@ +#[doc = "Register `RESULT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Result of last compare. Decision point SAMPLE task.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RESULT_A { + #[doc = "0: Input voltage is below the threshold (VIN+ < VIN-)"] + BELOW = 0, + #[doc = "1: Input voltage is above the threshold (VIN+ > VIN-)"] + ABOVE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RESULT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RESULT` reader - Result of last compare. Decision point SAMPLE task."] +pub struct RESULT_R(crate::FieldReader); +impl RESULT_R { + pub(crate) fn new(bits: bool) -> Self { + RESULT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RESULT_A { + match self.bits { + false => RESULT_A::BELOW, + true => RESULT_A::ABOVE, + } + } + #[doc = "Checks if the value of the field is `BELOW`"] + #[inline(always)] + pub fn is_below(&self) -> bool { + **self == RESULT_A::BELOW + } + #[doc = "Checks if the value of the field is `ABOVE`"] + #[inline(always)] + pub fn is_above(&self) -> bool { + **self == RESULT_A::ABOVE + } +} +impl core::ops::Deref for RESULT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bit 0 - Result of last compare. Decision point SAMPLE task."] + #[inline(always)] + pub fn result(&self) -> RESULT_R { + RESULT_R::new((self.bits & 0x01) != 0) + } +} +#[doc = "Compare result\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 [result](index.html) module"] +pub struct RESULT_SPEC; +impl crate::RegisterSpec for RESULT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [result::R](R) reader structure"] +impl crate::Readable for RESULT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets RESULT to value 0"] +impl crate::Resettable for RESULT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/comp/shorts.rs b/src/comp/shorts.rs new file mode 100644 index 0000000..c0d12c7 --- /dev/null +++ b/src/comp/shorts.rs @@ -0,0 +1,531 @@ +#[doc = "Register `SHORTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SHORTS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Shortcut between READY event and SAMPLE task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_SAMPLE_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_SAMPLE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY_SAMPLE` reader - Shortcut between READY event and SAMPLE task"] +pub struct READY_SAMPLE_R(crate::FieldReader); +impl READY_SAMPLE_R { + pub(crate) fn new(bits: bool) -> Self { + READY_SAMPLE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> READY_SAMPLE_A { + match self.bits { + false => READY_SAMPLE_A::DISABLED, + true => READY_SAMPLE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == READY_SAMPLE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == READY_SAMPLE_A::ENABLED + } +} +impl core::ops::Deref for READY_SAMPLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `READY_SAMPLE` writer - Shortcut between READY event and SAMPLE task"] +pub struct READY_SAMPLE_W<'a> { + w: &'a mut W, +} +impl<'a> READY_SAMPLE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: READY_SAMPLE_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(READY_SAMPLE_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(READY_SAMPLE_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Shortcut between READY event and STOP task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_STOP_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_STOP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY_STOP` reader - Shortcut between READY event and STOP task"] +pub struct READY_STOP_R(crate::FieldReader); +impl READY_STOP_R { + pub(crate) fn new(bits: bool) -> Self { + READY_STOP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> READY_STOP_A { + match self.bits { + false => READY_STOP_A::DISABLED, + true => READY_STOP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == READY_STOP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == READY_STOP_A::ENABLED + } +} +impl core::ops::Deref for READY_STOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `READY_STOP` writer - Shortcut between READY event and STOP task"] +pub struct READY_STOP_W<'a> { + w: &'a mut W, +} +impl<'a> READY_STOP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: READY_STOP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(READY_STOP_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(READY_STOP_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Shortcut between DOWN event and STOP task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DOWN_STOP_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DOWN_STOP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DOWN_STOP` reader - Shortcut between DOWN event and STOP task"] +pub struct DOWN_STOP_R(crate::FieldReader); +impl DOWN_STOP_R { + pub(crate) fn new(bits: bool) -> Self { + DOWN_STOP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DOWN_STOP_A { + match self.bits { + false => DOWN_STOP_A::DISABLED, + true => DOWN_STOP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DOWN_STOP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DOWN_STOP_A::ENABLED + } +} +impl core::ops::Deref for DOWN_STOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DOWN_STOP` writer - Shortcut between DOWN event and STOP task"] +pub struct DOWN_STOP_W<'a> { + w: &'a mut W, +} +impl<'a> DOWN_STOP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DOWN_STOP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(DOWN_STOP_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(DOWN_STOP_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Shortcut between UP event and STOP task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum UP_STOP_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: UP_STOP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `UP_STOP` reader - Shortcut between UP event and STOP task"] +pub struct UP_STOP_R(crate::FieldReader); +impl UP_STOP_R { + pub(crate) fn new(bits: bool) -> Self { + UP_STOP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> UP_STOP_A { + match self.bits { + false => UP_STOP_A::DISABLED, + true => UP_STOP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == UP_STOP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == UP_STOP_A::ENABLED + } +} +impl core::ops::Deref for UP_STOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `UP_STOP` writer - Shortcut between UP event and STOP task"] +pub struct UP_STOP_W<'a> { + w: &'a mut W, +} +impl<'a> UP_STOP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: UP_STOP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(UP_STOP_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(UP_STOP_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Shortcut between CROSS event and STOP task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CROSS_STOP_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CROSS_STOP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CROSS_STOP` reader - Shortcut between CROSS event and STOP task"] +pub struct CROSS_STOP_R(crate::FieldReader); +impl CROSS_STOP_R { + pub(crate) fn new(bits: bool) -> Self { + CROSS_STOP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CROSS_STOP_A { + match self.bits { + false => CROSS_STOP_A::DISABLED, + true => CROSS_STOP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CROSS_STOP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CROSS_STOP_A::ENABLED + } +} +impl core::ops::Deref for CROSS_STOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CROSS_STOP` writer - Shortcut between CROSS event and STOP task"] +pub struct CROSS_STOP_W<'a> { + w: &'a mut W, +} +impl<'a> CROSS_STOP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CROSS_STOP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CROSS_STOP_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CROSS_STOP_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +impl R { + #[doc = "Bit 0 - Shortcut between READY event and SAMPLE task"] + #[inline(always)] + pub fn ready_sample(&self) -> READY_SAMPLE_R { + READY_SAMPLE_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Shortcut between READY event and STOP task"] + #[inline(always)] + pub fn ready_stop(&self) -> READY_STOP_R { + READY_STOP_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Shortcut between DOWN event and STOP task"] + #[inline(always)] + pub fn down_stop(&self) -> DOWN_STOP_R { + DOWN_STOP_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Shortcut between UP event and STOP task"] + #[inline(always)] + pub fn up_stop(&self) -> UP_STOP_R { + UP_STOP_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Shortcut between CROSS event and STOP task"] + #[inline(always)] + pub fn cross_stop(&self) -> CROSS_STOP_R { + CROSS_STOP_R::new(((self.bits >> 4) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Shortcut between READY event and SAMPLE task"] + #[inline(always)] + pub fn ready_sample(&mut self) -> READY_SAMPLE_W { + READY_SAMPLE_W { w: self } + } + #[doc = "Bit 1 - Shortcut between READY event and STOP task"] + #[inline(always)] + pub fn ready_stop(&mut self) -> READY_STOP_W { + READY_STOP_W { w: self } + } + #[doc = "Bit 2 - Shortcut between DOWN event and STOP task"] + #[inline(always)] + pub fn down_stop(&mut self) -> DOWN_STOP_W { + DOWN_STOP_W { w: self } + } + #[doc = "Bit 3 - Shortcut between UP event and STOP task"] + #[inline(always)] + pub fn up_stop(&mut self) -> UP_STOP_W { + UP_STOP_W { w: self } + } + #[doc = "Bit 4 - Shortcut between CROSS event and STOP task"] + #[inline(always)] + pub fn cross_stop(&mut self) -> CROSS_STOP_W { + CROSS_STOP_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Shortcut register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [shorts](index.html) module"] +pub struct SHORTS_SPEC; +impl crate::RegisterSpec for SHORTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [shorts::R](R) reader structure"] +impl crate::Readable for SHORTS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [shorts::W](W) writer structure"] +impl crate::Writable for SHORTS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SHORTS to value 0"] +impl crate::Resettable for SHORTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/comp/tasks_sample.rs b/src/comp/tasks_sample.rs new file mode 100644 index 0000000..f4bef55 --- /dev/null +++ b/src/comp/tasks_sample.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_SAMPLE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Sample comparator value\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_sample](index.html) module"] +pub struct TASKS_SAMPLE_SPEC; +impl crate::RegisterSpec for TASKS_SAMPLE_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_sample::W](W) writer structure"] +impl crate::Writable for TASKS_SAMPLE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_SAMPLE to value 0"] +impl crate::Resettable for TASKS_SAMPLE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/comp/tasks_start.rs b/src/comp/tasks_start.rs new file mode 100644 index 0000000..f292fdd --- /dev/null +++ b/src/comp/tasks_start.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_START` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start comparator\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_start](index.html) module"] +pub struct TASKS_START_SPEC; +impl crate::RegisterSpec for TASKS_START_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_start::W](W) writer structure"] +impl crate::Writable for TASKS_START_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_START to value 0"] +impl crate::Resettable for TASKS_START_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/comp/tasks_stop.rs b/src/comp/tasks_stop.rs new file mode 100644 index 0000000..b701f1a --- /dev/null +++ b/src/comp/tasks_stop.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STOP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Stop comparator\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_stop](index.html) module"] +pub struct TASKS_STOP_SPEC; +impl crate::RegisterSpec for TASKS_STOP_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_stop::W](W) writer structure"] +impl crate::Writable for TASKS_STOP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STOP to value 0"] +impl crate::Resettable for TASKS_STOP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/comp/th.rs b/src/comp/th.rs new file mode 100644 index 0000000..28107b1 --- /dev/null +++ b/src/comp/th.rs @@ -0,0 +1,138 @@ +#[doc = "Register `TH` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `TH` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `THDOWN` reader - VDOWN = (THDOWN+1)/64*VREF"] +pub struct THDOWN_R(crate::FieldReader); +impl THDOWN_R { + pub(crate) fn new(bits: u8) -> Self { + THDOWN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for THDOWN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `THDOWN` writer - VDOWN = (THDOWN+1)/64*VREF"] +pub struct THDOWN_W<'a> { + w: &'a mut W, +} +impl<'a> THDOWN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x3f) | (value as u32 & 0x3f); + self.w + } +} +#[doc = "Field `THUP` reader - VUP = (THUP+1)/64*VREF"] +pub struct THUP_R(crate::FieldReader); +impl THUP_R { + pub(crate) fn new(bits: u8) -> Self { + THUP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for THUP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `THUP` writer - VUP = (THUP+1)/64*VREF"] +pub struct THUP_W<'a> { + w: &'a mut W, +} +impl<'a> THUP_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x3f << 8)) | ((value as u32 & 0x3f) << 8); + self.w + } +} +impl R { + #[doc = "Bits 0:5 - VDOWN = (THDOWN+1)/64*VREF"] + #[inline(always)] + pub fn thdown(&self) -> THDOWN_R { + THDOWN_R::new((self.bits & 0x3f) as u8) + } + #[doc = "Bits 8:13 - VUP = (THUP+1)/64*VREF"] + #[inline(always)] + pub fn thup(&self) -> THUP_R { + THUP_R::new(((self.bits >> 8) & 0x3f) as u8) + } +} +impl W { + #[doc = "Bits 0:5 - VDOWN = (THDOWN+1)/64*VREF"] + #[inline(always)] + pub fn thdown(&mut self) -> THDOWN_W { + THDOWN_W { w: self } + } + #[doc = "Bits 8:13 - VUP = (THUP+1)/64*VREF"] + #[inline(always)] + pub fn thup(&mut self) -> THUP_W { + THUP_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Threshold configuration for hysteresis unit\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [th](index.html) module"] +pub struct TH_SPEC; +impl crate::RegisterSpec for TH_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [th::R](R) reader structure"] +impl crate::Readable for TH_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [th::W](W) writer structure"] +impl crate::Writable for TH_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TH to value 0"] +impl crate::Resettable for TH_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ecb.rs b/src/ecb.rs new file mode 100644 index 0000000..f60201d --- /dev/null +++ b/src/ecb.rs @@ -0,0 +1,49 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "0x00 - Start ECB block encrypt"] + pub tasks_startecb: crate::Reg, + #[doc = "0x04 - Abort a possible executing ECB operation"] + pub tasks_stopecb: crate::Reg, + _reserved2: [u8; 0xf8], + #[doc = "0x100 - ECB block encrypt complete"] + pub events_endecb: crate::Reg, + #[doc = "0x104 - ECB block encrypt aborted because of a STOPECB task or due to an error"] + pub events_errorecb: crate::Reg, + _reserved4: [u8; 0x01fc], + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved6: [u8; 0x01f8], + #[doc = "0x504 - ECB block encrypt memory pointers"] + pub ecbdataptr: crate::Reg, +} +#[doc = "TASKS_STARTECB register accessor: an alias for `Reg`"] +pub type TASKS_STARTECB = crate::Reg; +#[doc = "Start ECB block encrypt"] +pub mod tasks_startecb; +#[doc = "TASKS_STOPECB register accessor: an alias for `Reg`"] +pub type TASKS_STOPECB = crate::Reg; +#[doc = "Abort a possible executing ECB operation"] +pub mod tasks_stopecb; +#[doc = "EVENTS_ENDECB register accessor: an alias for `Reg`"] +pub type EVENTS_ENDECB = crate::Reg; +#[doc = "ECB block encrypt complete"] +pub mod events_endecb; +#[doc = "EVENTS_ERRORECB register accessor: an alias for `Reg`"] +pub type EVENTS_ERRORECB = crate::Reg; +#[doc = "ECB block encrypt aborted because of a STOPECB task or due to an error"] +pub mod events_errorecb; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "ECBDATAPTR register accessor: an alias for `Reg`"] +pub type ECBDATAPTR = crate::Reg; +#[doc = "ECB block encrypt memory pointers"] +pub mod ecbdataptr; diff --git a/src/ecb/ecbdataptr.rs b/src/ecb/ecbdataptr.rs new file mode 100644 index 0000000..9bcc207 --- /dev/null +++ b/src/ecb/ecbdataptr.rs @@ -0,0 +1,102 @@ +#[doc = "Register `ECBDATAPTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ECBDATAPTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `ECBDATAPTR` reader - Pointer to the ECB data structure (see Table 1 ECB data structure overview)"] +pub struct ECBDATAPTR_R(crate::FieldReader); +impl ECBDATAPTR_R { + pub(crate) fn new(bits: u32) -> Self { + ECBDATAPTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ECBDATAPTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ECBDATAPTR` writer - Pointer to the ECB data structure (see Table 1 ECB data structure overview)"] +pub struct ECBDATAPTR_W<'a> { + w: &'a mut W, +} +impl<'a> ECBDATAPTR_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Pointer to the ECB data structure (see Table 1 ECB data structure overview)"] + #[inline(always)] + pub fn ecbdataptr(&self) -> ECBDATAPTR_R { + ECBDATAPTR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Pointer to the ECB data structure (see Table 1 ECB data structure overview)"] + #[inline(always)] + pub fn ecbdataptr(&mut self) -> ECBDATAPTR_W { + ECBDATAPTR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "ECB block encrypt memory pointers\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ecbdataptr](index.html) module"] +pub struct ECBDATAPTR_SPEC; +impl crate::RegisterSpec for ECBDATAPTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ecbdataptr::R](R) reader structure"] +impl crate::Readable for ECBDATAPTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ecbdataptr::W](W) writer structure"] +impl crate::Writable for ECBDATAPTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ECBDATAPTR to value 0"] +impl crate::Resettable for ECBDATAPTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ecb/events_endecb.rs b/src/ecb/events_endecb.rs new file mode 100644 index 0000000..fad4a95 --- /dev/null +++ b/src/ecb/events_endecb.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_ENDECB` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_ENDECB` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "ECB block encrypt complete\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_endecb](index.html) module"] +pub struct EVENTS_ENDECB_SPEC; +impl crate::RegisterSpec for EVENTS_ENDECB_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_endecb::R](R) reader structure"] +impl crate::Readable for EVENTS_ENDECB_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_endecb::W](W) writer structure"] +impl crate::Writable for EVENTS_ENDECB_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_ENDECB to value 0"] +impl crate::Resettable for EVENTS_ENDECB_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ecb/events_errorecb.rs b/src/ecb/events_errorecb.rs new file mode 100644 index 0000000..169ffde --- /dev/null +++ b/src/ecb/events_errorecb.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_ERRORECB` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_ERRORECB` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "ECB block encrypt aborted because of a STOPECB task or due to an error\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_errorecb](index.html) module"] +pub struct EVENTS_ERRORECB_SPEC; +impl crate::RegisterSpec for EVENTS_ERRORECB_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_errorecb::R](R) reader structure"] +impl crate::Readable for EVENTS_ERRORECB_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_errorecb::W](W) writer structure"] +impl crate::Writable for EVENTS_ERRORECB_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_ERRORECB to value 0"] +impl crate::Resettable for EVENTS_ERRORECB_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ecb/intenclr.rs b/src/ecb/intenclr.rs new file mode 100644 index 0000000..047678d --- /dev/null +++ b/src/ecb/intenclr.rs @@ -0,0 +1,266 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for ENDECB event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDECB_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDECB_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDECB` reader - Write '1' to Disable interrupt for ENDECB event"] +pub struct ENDECB_R(crate::FieldReader); +impl ENDECB_R { + pub(crate) fn new(bits: bool) -> Self { + ENDECB_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDECB_A { + match self.bits { + false => ENDECB_A::DISABLED, + true => ENDECB_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENDECB_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENDECB_A::ENABLED + } +} +impl core::ops::Deref for ENDECB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for ENDECB event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDECB_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDECB_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDECB` writer - Write '1' to Disable interrupt for ENDECB event"] +pub struct ENDECB_W<'a> { + w: &'a mut W, +} +impl<'a> ENDECB_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDECB_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(ENDECB_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for ERRORECB event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERRORECB_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERRORECB_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERRORECB` reader - Write '1' to Disable interrupt for ERRORECB event"] +pub struct ERRORECB_R(crate::FieldReader); +impl ERRORECB_R { + pub(crate) fn new(bits: bool) -> Self { + ERRORECB_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ERRORECB_A { + match self.bits { + false => ERRORECB_A::DISABLED, + true => ERRORECB_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ERRORECB_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ERRORECB_A::ENABLED + } +} +impl core::ops::Deref for ERRORECB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for ERRORECB event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERRORECB_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERRORECB_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERRORECB` writer - Write '1' to Disable interrupt for ERRORECB event"] +pub struct ERRORECB_W<'a> { + w: &'a mut W, +} +impl<'a> ERRORECB_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ERRORECB_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(ERRORECB_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Disable interrupt for ENDECB event"] + #[inline(always)] + pub fn endecb(&self) -> ENDECB_R { + ENDECB_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for ERRORECB event"] + #[inline(always)] + pub fn errorecb(&self) -> ERRORECB_R { + ERRORECB_R::new(((self.bits >> 1) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Disable interrupt for ENDECB event"] + #[inline(always)] + pub fn endecb(&mut self) -> ENDECB_W { + ENDECB_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for ERRORECB event"] + #[inline(always)] + pub fn errorecb(&mut self) -> ERRORECB_W { + ERRORECB_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ecb/intenset.rs b/src/ecb/intenset.rs new file mode 100644 index 0000000..e2e2a71 --- /dev/null +++ b/src/ecb/intenset.rs @@ -0,0 +1,266 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for ENDECB event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDECB_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDECB_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDECB` reader - Write '1' to Enable interrupt for ENDECB event"] +pub struct ENDECB_R(crate::FieldReader); +impl ENDECB_R { + pub(crate) fn new(bits: bool) -> Self { + ENDECB_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDECB_A { + match self.bits { + false => ENDECB_A::DISABLED, + true => ENDECB_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENDECB_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENDECB_A::ENABLED + } +} +impl core::ops::Deref for ENDECB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for ENDECB event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDECB_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDECB_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDECB` writer - Write '1' to Enable interrupt for ENDECB event"] +pub struct ENDECB_W<'a> { + w: &'a mut W, +} +impl<'a> ENDECB_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDECB_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(ENDECB_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for ERRORECB event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERRORECB_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERRORECB_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERRORECB` reader - Write '1' to Enable interrupt for ERRORECB event"] +pub struct ERRORECB_R(crate::FieldReader); +impl ERRORECB_R { + pub(crate) fn new(bits: bool) -> Self { + ERRORECB_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ERRORECB_A { + match self.bits { + false => ERRORECB_A::DISABLED, + true => ERRORECB_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ERRORECB_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ERRORECB_A::ENABLED + } +} +impl core::ops::Deref for ERRORECB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for ERRORECB event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERRORECB_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERRORECB_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERRORECB` writer - Write '1' to Enable interrupt for ERRORECB event"] +pub struct ERRORECB_W<'a> { + w: &'a mut W, +} +impl<'a> ERRORECB_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ERRORECB_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(ERRORECB_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Enable interrupt for ENDECB event"] + #[inline(always)] + pub fn endecb(&self) -> ENDECB_R { + ENDECB_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for ERRORECB event"] + #[inline(always)] + pub fn errorecb(&self) -> ERRORECB_R { + ERRORECB_R::new(((self.bits >> 1) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Enable interrupt for ENDECB event"] + #[inline(always)] + pub fn endecb(&mut self) -> ENDECB_W { + ENDECB_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for ERRORECB event"] + #[inline(always)] + pub fn errorecb(&mut self) -> ERRORECB_W { + ERRORECB_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ecb/tasks_startecb.rs b/src/ecb/tasks_startecb.rs new file mode 100644 index 0000000..6e10063 --- /dev/null +++ b/src/ecb/tasks_startecb.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STARTECB` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start ECB block encrypt\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_startecb](index.html) module"] +pub struct TASKS_STARTECB_SPEC; +impl crate::RegisterSpec for TASKS_STARTECB_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_startecb::W](W) writer structure"] +impl crate::Writable for TASKS_STARTECB_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STARTECB to value 0"] +impl crate::Resettable for TASKS_STARTECB_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ecb/tasks_stopecb.rs b/src/ecb/tasks_stopecb.rs new file mode 100644 index 0000000..2e64f55 --- /dev/null +++ b/src/ecb/tasks_stopecb.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STOPECB` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Abort a possible executing ECB operation\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_stopecb](index.html) module"] +pub struct TASKS_STOPECB_SPEC; +impl crate::RegisterSpec for TASKS_STOPECB_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_stopecb::W](W) writer structure"] +impl crate::Writable for TASKS_STOPECB_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STOPECB to value 0"] +impl crate::Resettable for TASKS_STOPECB_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/egu0.rs b/src/egu0.rs new file mode 100644 index 0000000..bea05ee --- /dev/null +++ b/src/egu0.rs @@ -0,0 +1,40 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "0x00..0x40 - Description collection\\[0\\]: Trigger 0 for triggering the corresponding TRIGGERED\\[0\\] +event"] + pub tasks_trigger: [crate::Reg; 16], + _reserved1: [u8; 0xc0], + #[doc = "0x100..0x140 - Description collection\\[0\\]: Event number 0 generated by triggering the corresponding TRIGGER\\[0\\] +task"] + pub events_triggered: [crate::Reg; 16], + _reserved2: [u8; 0x01c0], + #[doc = "0x300 - Enable or disable interrupt"] + pub inten: crate::Reg, + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, +} +#[doc = "TASKS_TRIGGER register accessor: an alias for `Reg`"] +pub type TASKS_TRIGGER = crate::Reg; +#[doc = "Description collection\\[0\\]: Trigger 0 for triggering the corresponding TRIGGERED\\[0\\] +event"] +pub mod tasks_trigger; +#[doc = "EVENTS_TRIGGERED register accessor: an alias for `Reg`"] +pub type EVENTS_TRIGGERED = crate::Reg; +#[doc = "Description collection\\[0\\]: Event number 0 generated by triggering the corresponding TRIGGER\\[0\\] +task"] +pub mod events_triggered; +#[doc = "INTEN register accessor: an alias for `Reg`"] +pub type INTEN = crate::Reg; +#[doc = "Enable or disable interrupt"] +pub mod inten; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; diff --git a/src/egu0/events_triggered.rs b/src/egu0/events_triggered.rs new file mode 100644 index 0000000..99fbe6c --- /dev/null +++ b/src/egu0/events_triggered.rs @@ -0,0 +1,66 @@ +#[doc = "Register `EVENTS_TRIGGERED[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_TRIGGERED[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description collection\\[0\\]: Event number 0 generated by triggering the corresponding TRIGGER\\[0\\] +task\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_triggered](index.html) module"] +pub struct EVENTS_TRIGGERED_SPEC; +impl crate::RegisterSpec for EVENTS_TRIGGERED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_triggered::R](R) reader structure"] +impl crate::Readable for EVENTS_TRIGGERED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_triggered::W](W) writer structure"] +impl crate::Writable for EVENTS_TRIGGERED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_TRIGGERED[%s] +to value 0"] +impl crate::Resettable for EVENTS_TRIGGERED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/egu0/inten.rs b/src/egu0/inten.rs new file mode 100644 index 0000000..90f181a --- /dev/null +++ b/src/egu0/inten.rs @@ -0,0 +1,1634 @@ +#[doc = "Register `INTEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable interrupt for TRIGGERED\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED0_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED0` reader - Enable or disable interrupt for TRIGGERED\\[0\\] +event"] +pub struct TRIGGERED0_R(crate::FieldReader); +impl TRIGGERED0_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED0_A { + match self.bits { + false => TRIGGERED0_A::DISABLED, + true => TRIGGERED0_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED0_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED0_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRIGGERED0` writer - Enable or disable interrupt for TRIGGERED\\[0\\] +event"] +pub struct TRIGGERED0_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED0_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(TRIGGERED0_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(TRIGGERED0_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Enable or disable interrupt for TRIGGERED\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED1_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED1` reader - Enable or disable interrupt for TRIGGERED\\[1\\] +event"] +pub struct TRIGGERED1_R(crate::FieldReader); +impl TRIGGERED1_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED1_A { + match self.bits { + false => TRIGGERED1_A::DISABLED, + true => TRIGGERED1_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED1_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED1_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRIGGERED1` writer - Enable or disable interrupt for TRIGGERED\\[1\\] +event"] +pub struct TRIGGERED1_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED1_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(TRIGGERED1_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(TRIGGERED1_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Enable or disable interrupt for TRIGGERED\\[2\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED2_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED2` reader - Enable or disable interrupt for TRIGGERED\\[2\\] +event"] +pub struct TRIGGERED2_R(crate::FieldReader); +impl TRIGGERED2_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED2_A { + match self.bits { + false => TRIGGERED2_A::DISABLED, + true => TRIGGERED2_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED2_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED2_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRIGGERED2` writer - Enable or disable interrupt for TRIGGERED\\[2\\] +event"] +pub struct TRIGGERED2_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED2_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(TRIGGERED2_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(TRIGGERED2_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Enable or disable interrupt for TRIGGERED\\[3\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED3_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED3` reader - Enable or disable interrupt for TRIGGERED\\[3\\] +event"] +pub struct TRIGGERED3_R(crate::FieldReader); +impl TRIGGERED3_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED3_A { + match self.bits { + false => TRIGGERED3_A::DISABLED, + true => TRIGGERED3_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED3_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED3_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRIGGERED3` writer - Enable or disable interrupt for TRIGGERED\\[3\\] +event"] +pub struct TRIGGERED3_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED3_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(TRIGGERED3_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(TRIGGERED3_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Enable or disable interrupt for TRIGGERED\\[4\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED4_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED4_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED4` reader - Enable or disable interrupt for TRIGGERED\\[4\\] +event"] +pub struct TRIGGERED4_R(crate::FieldReader); +impl TRIGGERED4_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED4_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED4_A { + match self.bits { + false => TRIGGERED4_A::DISABLED, + true => TRIGGERED4_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED4_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED4_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRIGGERED4` writer - Enable or disable interrupt for TRIGGERED\\[4\\] +event"] +pub struct TRIGGERED4_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED4_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED4_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(TRIGGERED4_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(TRIGGERED4_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Enable or disable interrupt for TRIGGERED\\[5\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED5_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED5_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED5` reader - Enable or disable interrupt for TRIGGERED\\[5\\] +event"] +pub struct TRIGGERED5_R(crate::FieldReader); +impl TRIGGERED5_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED5_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED5_A { + match self.bits { + false => TRIGGERED5_A::DISABLED, + true => TRIGGERED5_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED5_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED5_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRIGGERED5` writer - Enable or disable interrupt for TRIGGERED\\[5\\] +event"] +pub struct TRIGGERED5_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED5_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED5_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(TRIGGERED5_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(TRIGGERED5_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Enable or disable interrupt for TRIGGERED\\[6\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED6_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED6_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED6` reader - Enable or disable interrupt for TRIGGERED\\[6\\] +event"] +pub struct TRIGGERED6_R(crate::FieldReader); +impl TRIGGERED6_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED6_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED6_A { + match self.bits { + false => TRIGGERED6_A::DISABLED, + true => TRIGGERED6_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED6_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED6_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRIGGERED6` writer - Enable or disable interrupt for TRIGGERED\\[6\\] +event"] +pub struct TRIGGERED6_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED6_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED6_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(TRIGGERED6_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(TRIGGERED6_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Enable or disable interrupt for TRIGGERED\\[7\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED7_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED7_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED7` reader - Enable or disable interrupt for TRIGGERED\\[7\\] +event"] +pub struct TRIGGERED7_R(crate::FieldReader); +impl TRIGGERED7_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED7_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED7_A { + match self.bits { + false => TRIGGERED7_A::DISABLED, + true => TRIGGERED7_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED7_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED7_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRIGGERED7` writer - Enable or disable interrupt for TRIGGERED\\[7\\] +event"] +pub struct TRIGGERED7_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED7_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED7_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(TRIGGERED7_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(TRIGGERED7_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Enable or disable interrupt for TRIGGERED\\[8\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED8_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED8_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED8` reader - Enable or disable interrupt for TRIGGERED\\[8\\] +event"] +pub struct TRIGGERED8_R(crate::FieldReader); +impl TRIGGERED8_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED8_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED8_A { + match self.bits { + false => TRIGGERED8_A::DISABLED, + true => TRIGGERED8_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED8_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED8_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRIGGERED8` writer - Enable or disable interrupt for TRIGGERED\\[8\\] +event"] +pub struct TRIGGERED8_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED8_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED8_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(TRIGGERED8_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(TRIGGERED8_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Enable or disable interrupt for TRIGGERED\\[9\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED9_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED9_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED9` reader - Enable or disable interrupt for TRIGGERED\\[9\\] +event"] +pub struct TRIGGERED9_R(crate::FieldReader); +impl TRIGGERED9_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED9_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED9_A { + match self.bits { + false => TRIGGERED9_A::DISABLED, + true => TRIGGERED9_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED9_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED9_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRIGGERED9` writer - Enable or disable interrupt for TRIGGERED\\[9\\] +event"] +pub struct TRIGGERED9_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED9_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED9_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(TRIGGERED9_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(TRIGGERED9_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Enable or disable interrupt for TRIGGERED\\[10\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED10_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED10_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED10` reader - Enable or disable interrupt for TRIGGERED\\[10\\] +event"] +pub struct TRIGGERED10_R(crate::FieldReader); +impl TRIGGERED10_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED10_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED10_A { + match self.bits { + false => TRIGGERED10_A::DISABLED, + true => TRIGGERED10_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED10_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED10_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRIGGERED10` writer - Enable or disable interrupt for TRIGGERED\\[10\\] +event"] +pub struct TRIGGERED10_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED10_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED10_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(TRIGGERED10_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(TRIGGERED10_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Enable or disable interrupt for TRIGGERED\\[11\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED11_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED11_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED11` reader - Enable or disable interrupt for TRIGGERED\\[11\\] +event"] +pub struct TRIGGERED11_R(crate::FieldReader); +impl TRIGGERED11_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED11_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED11_A { + match self.bits { + false => TRIGGERED11_A::DISABLED, + true => TRIGGERED11_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED11_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED11_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRIGGERED11` writer - Enable or disable interrupt for TRIGGERED\\[11\\] +event"] +pub struct TRIGGERED11_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED11_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED11_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(TRIGGERED11_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(TRIGGERED11_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Enable or disable interrupt for TRIGGERED\\[12\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED12_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED12_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED12` reader - Enable or disable interrupt for TRIGGERED\\[12\\] +event"] +pub struct TRIGGERED12_R(crate::FieldReader); +impl TRIGGERED12_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED12_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED12_A { + match self.bits { + false => TRIGGERED12_A::DISABLED, + true => TRIGGERED12_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED12_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED12_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRIGGERED12` writer - Enable or disable interrupt for TRIGGERED\\[12\\] +event"] +pub struct TRIGGERED12_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED12_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED12_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(TRIGGERED12_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(TRIGGERED12_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Enable or disable interrupt for TRIGGERED\\[13\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED13_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED13_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED13` reader - Enable or disable interrupt for TRIGGERED\\[13\\] +event"] +pub struct TRIGGERED13_R(crate::FieldReader); +impl TRIGGERED13_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED13_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED13_A { + match self.bits { + false => TRIGGERED13_A::DISABLED, + true => TRIGGERED13_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED13_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED13_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRIGGERED13` writer - Enable or disable interrupt for TRIGGERED\\[13\\] +event"] +pub struct TRIGGERED13_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED13_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED13_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(TRIGGERED13_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(TRIGGERED13_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Enable or disable interrupt for TRIGGERED\\[14\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED14_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED14_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED14` reader - Enable or disable interrupt for TRIGGERED\\[14\\] +event"] +pub struct TRIGGERED14_R(crate::FieldReader); +impl TRIGGERED14_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED14_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED14_A { + match self.bits { + false => TRIGGERED14_A::DISABLED, + true => TRIGGERED14_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED14_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED14_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRIGGERED14` writer - Enable or disable interrupt for TRIGGERED\\[14\\] +event"] +pub struct TRIGGERED14_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED14_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED14_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(TRIGGERED14_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(TRIGGERED14_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Enable or disable interrupt for TRIGGERED\\[15\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED15_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED15_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED15` reader - Enable or disable interrupt for TRIGGERED\\[15\\] +event"] +pub struct TRIGGERED15_R(crate::FieldReader); +impl TRIGGERED15_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED15_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED15_A { + match self.bits { + false => TRIGGERED15_A::DISABLED, + true => TRIGGERED15_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED15_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED15_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TRIGGERED15` writer - Enable or disable interrupt for TRIGGERED\\[15\\] +event"] +pub struct TRIGGERED15_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED15_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED15_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(TRIGGERED15_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(TRIGGERED15_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable or disable interrupt for TRIGGERED\\[0\\] +event"] + #[inline(always)] + pub fn triggered0(&self) -> TRIGGERED0_R { + TRIGGERED0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Enable or disable interrupt for TRIGGERED\\[1\\] +event"] + #[inline(always)] + pub fn triggered1(&self) -> TRIGGERED1_R { + TRIGGERED1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Enable or disable interrupt for TRIGGERED\\[2\\] +event"] + #[inline(always)] + pub fn triggered2(&self) -> TRIGGERED2_R { + TRIGGERED2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Enable or disable interrupt for TRIGGERED\\[3\\] +event"] + #[inline(always)] + pub fn triggered3(&self) -> TRIGGERED3_R { + TRIGGERED3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Enable or disable interrupt for TRIGGERED\\[4\\] +event"] + #[inline(always)] + pub fn triggered4(&self) -> TRIGGERED4_R { + TRIGGERED4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Enable or disable interrupt for TRIGGERED\\[5\\] +event"] + #[inline(always)] + pub fn triggered5(&self) -> TRIGGERED5_R { + TRIGGERED5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Enable or disable interrupt for TRIGGERED\\[6\\] +event"] + #[inline(always)] + pub fn triggered6(&self) -> TRIGGERED6_R { + TRIGGERED6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Enable or disable interrupt for TRIGGERED\\[7\\] +event"] + #[inline(always)] + pub fn triggered7(&self) -> TRIGGERED7_R { + TRIGGERED7_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Enable or disable interrupt for TRIGGERED\\[8\\] +event"] + #[inline(always)] + pub fn triggered8(&self) -> TRIGGERED8_R { + TRIGGERED8_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Enable or disable interrupt for TRIGGERED\\[9\\] +event"] + #[inline(always)] + pub fn triggered9(&self) -> TRIGGERED9_R { + TRIGGERED9_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Enable or disable interrupt for TRIGGERED\\[10\\] +event"] + #[inline(always)] + pub fn triggered10(&self) -> TRIGGERED10_R { + TRIGGERED10_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Enable or disable interrupt for TRIGGERED\\[11\\] +event"] + #[inline(always)] + pub fn triggered11(&self) -> TRIGGERED11_R { + TRIGGERED11_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Enable or disable interrupt for TRIGGERED\\[12\\] +event"] + #[inline(always)] + pub fn triggered12(&self) -> TRIGGERED12_R { + TRIGGERED12_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Enable or disable interrupt for TRIGGERED\\[13\\] +event"] + #[inline(always)] + pub fn triggered13(&self) -> TRIGGERED13_R { + TRIGGERED13_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Enable or disable interrupt for TRIGGERED\\[14\\] +event"] + #[inline(always)] + pub fn triggered14(&self) -> TRIGGERED14_R { + TRIGGERED14_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Enable or disable interrupt for TRIGGERED\\[15\\] +event"] + #[inline(always)] + pub fn triggered15(&self) -> TRIGGERED15_R { + TRIGGERED15_R::new(((self.bits >> 15) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Enable or disable interrupt for TRIGGERED\\[0\\] +event"] + #[inline(always)] + pub fn triggered0(&mut self) -> TRIGGERED0_W { + TRIGGERED0_W { w: self } + } + #[doc = "Bit 1 - Enable or disable interrupt for TRIGGERED\\[1\\] +event"] + #[inline(always)] + pub fn triggered1(&mut self) -> TRIGGERED1_W { + TRIGGERED1_W { w: self } + } + #[doc = "Bit 2 - Enable or disable interrupt for TRIGGERED\\[2\\] +event"] + #[inline(always)] + pub fn triggered2(&mut self) -> TRIGGERED2_W { + TRIGGERED2_W { w: self } + } + #[doc = "Bit 3 - Enable or disable interrupt for TRIGGERED\\[3\\] +event"] + #[inline(always)] + pub fn triggered3(&mut self) -> TRIGGERED3_W { + TRIGGERED3_W { w: self } + } + #[doc = "Bit 4 - Enable or disable interrupt for TRIGGERED\\[4\\] +event"] + #[inline(always)] + pub fn triggered4(&mut self) -> TRIGGERED4_W { + TRIGGERED4_W { w: self } + } + #[doc = "Bit 5 - Enable or disable interrupt for TRIGGERED\\[5\\] +event"] + #[inline(always)] + pub fn triggered5(&mut self) -> TRIGGERED5_W { + TRIGGERED5_W { w: self } + } + #[doc = "Bit 6 - Enable or disable interrupt for TRIGGERED\\[6\\] +event"] + #[inline(always)] + pub fn triggered6(&mut self) -> TRIGGERED6_W { + TRIGGERED6_W { w: self } + } + #[doc = "Bit 7 - Enable or disable interrupt for TRIGGERED\\[7\\] +event"] + #[inline(always)] + pub fn triggered7(&mut self) -> TRIGGERED7_W { + TRIGGERED7_W { w: self } + } + #[doc = "Bit 8 - Enable or disable interrupt for TRIGGERED\\[8\\] +event"] + #[inline(always)] + pub fn triggered8(&mut self) -> TRIGGERED8_W { + TRIGGERED8_W { w: self } + } + #[doc = "Bit 9 - Enable or disable interrupt for TRIGGERED\\[9\\] +event"] + #[inline(always)] + pub fn triggered9(&mut self) -> TRIGGERED9_W { + TRIGGERED9_W { w: self } + } + #[doc = "Bit 10 - Enable or disable interrupt for TRIGGERED\\[10\\] +event"] + #[inline(always)] + pub fn triggered10(&mut self) -> TRIGGERED10_W { + TRIGGERED10_W { w: self } + } + #[doc = "Bit 11 - Enable or disable interrupt for TRIGGERED\\[11\\] +event"] + #[inline(always)] + pub fn triggered11(&mut self) -> TRIGGERED11_W { + TRIGGERED11_W { w: self } + } + #[doc = "Bit 12 - Enable or disable interrupt for TRIGGERED\\[12\\] +event"] + #[inline(always)] + pub fn triggered12(&mut self) -> TRIGGERED12_W { + TRIGGERED12_W { w: self } + } + #[doc = "Bit 13 - Enable or disable interrupt for TRIGGERED\\[13\\] +event"] + #[inline(always)] + pub fn triggered13(&mut self) -> TRIGGERED13_W { + TRIGGERED13_W { w: self } + } + #[doc = "Bit 14 - Enable or disable interrupt for TRIGGERED\\[14\\] +event"] + #[inline(always)] + pub fn triggered14(&mut self) -> TRIGGERED14_W { + TRIGGERED14_W { w: self } + } + #[doc = "Bit 15 - Enable or disable interrupt for TRIGGERED\\[15\\] +event"] + #[inline(always)] + pub fn triggered15(&mut self) -> TRIGGERED15_W { + TRIGGERED15_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable or disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [inten](index.html) module"] +pub struct INTEN_SPEC; +impl crate::RegisterSpec for INTEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [inten::R](R) reader structure"] +impl crate::Readable for INTEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [inten::W](W) writer structure"] +impl crate::Writable for INTEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTEN to value 0"] +impl crate::Resettable for INTEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/egu0/intenclr.rs b/src/egu0/intenclr.rs new file mode 100644 index 0000000..d4cae4d --- /dev/null +++ b/src/egu0/intenclr.rs @@ -0,0 +1,1762 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED0_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED0` reader - Write '1' to Disable interrupt for TRIGGERED\\[0\\] +event"] +pub struct TRIGGERED0_R(crate::FieldReader); +impl TRIGGERED0_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED0_A { + match self.bits { + false => TRIGGERED0_A::DISABLED, + true => TRIGGERED0_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED0_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED0_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED0_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED0_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED0` writer - Write '1' to Disable interrupt for TRIGGERED\\[0\\] +event"] +pub struct TRIGGERED0_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED0_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TRIGGERED0_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED1_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED1` reader - Write '1' to Disable interrupt for TRIGGERED\\[1\\] +event"] +pub struct TRIGGERED1_R(crate::FieldReader); +impl TRIGGERED1_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED1_A { + match self.bits { + false => TRIGGERED1_A::DISABLED, + true => TRIGGERED1_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED1_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED1_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED1_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED1_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED1` writer - Write '1' to Disable interrupt for TRIGGERED\\[1\\] +event"] +pub struct TRIGGERED1_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED1_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TRIGGERED1_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[2\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED2_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED2` reader - Write '1' to Disable interrupt for TRIGGERED\\[2\\] +event"] +pub struct TRIGGERED2_R(crate::FieldReader); +impl TRIGGERED2_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED2_A { + match self.bits { + false => TRIGGERED2_A::DISABLED, + true => TRIGGERED2_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED2_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED2_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[2\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED2_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED2_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED2` writer - Write '1' to Disable interrupt for TRIGGERED\\[2\\] +event"] +pub struct TRIGGERED2_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED2_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TRIGGERED2_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[3\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED3_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED3` reader - Write '1' to Disable interrupt for TRIGGERED\\[3\\] +event"] +pub struct TRIGGERED3_R(crate::FieldReader); +impl TRIGGERED3_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED3_A { + match self.bits { + false => TRIGGERED3_A::DISABLED, + true => TRIGGERED3_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED3_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED3_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[3\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED3_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED3_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED3` writer - Write '1' to Disable interrupt for TRIGGERED\\[3\\] +event"] +pub struct TRIGGERED3_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED3_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TRIGGERED3_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[4\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED4_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED4_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED4` reader - Write '1' to Disable interrupt for TRIGGERED\\[4\\] +event"] +pub struct TRIGGERED4_R(crate::FieldReader); +impl TRIGGERED4_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED4_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED4_A { + match self.bits { + false => TRIGGERED4_A::DISABLED, + true => TRIGGERED4_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED4_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED4_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[4\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED4_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED4_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED4` writer - Write '1' to Disable interrupt for TRIGGERED\\[4\\] +event"] +pub struct TRIGGERED4_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED4_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED4_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TRIGGERED4_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[5\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED5_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED5_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED5` reader - Write '1' to Disable interrupt for TRIGGERED\\[5\\] +event"] +pub struct TRIGGERED5_R(crate::FieldReader); +impl TRIGGERED5_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED5_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED5_A { + match self.bits { + false => TRIGGERED5_A::DISABLED, + true => TRIGGERED5_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED5_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED5_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[5\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED5_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED5_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED5` writer - Write '1' to Disable interrupt for TRIGGERED\\[5\\] +event"] +pub struct TRIGGERED5_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED5_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED5_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TRIGGERED5_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[6\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED6_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED6_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED6` reader - Write '1' to Disable interrupt for TRIGGERED\\[6\\] +event"] +pub struct TRIGGERED6_R(crate::FieldReader); +impl TRIGGERED6_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED6_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED6_A { + match self.bits { + false => TRIGGERED6_A::DISABLED, + true => TRIGGERED6_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED6_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED6_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[6\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED6_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED6_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED6` writer - Write '1' to Disable interrupt for TRIGGERED\\[6\\] +event"] +pub struct TRIGGERED6_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED6_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED6_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TRIGGERED6_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[7\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED7_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED7_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED7` reader - Write '1' to Disable interrupt for TRIGGERED\\[7\\] +event"] +pub struct TRIGGERED7_R(crate::FieldReader); +impl TRIGGERED7_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED7_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED7_A { + match self.bits { + false => TRIGGERED7_A::DISABLED, + true => TRIGGERED7_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED7_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED7_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[7\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED7_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED7_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED7` writer - Write '1' to Disable interrupt for TRIGGERED\\[7\\] +event"] +pub struct TRIGGERED7_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED7_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED7_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TRIGGERED7_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[8\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED8_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED8_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED8` reader - Write '1' to Disable interrupt for TRIGGERED\\[8\\] +event"] +pub struct TRIGGERED8_R(crate::FieldReader); +impl TRIGGERED8_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED8_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED8_A { + match self.bits { + false => TRIGGERED8_A::DISABLED, + true => TRIGGERED8_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED8_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED8_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[8\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED8_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED8_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED8` writer - Write '1' to Disable interrupt for TRIGGERED\\[8\\] +event"] +pub struct TRIGGERED8_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED8_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED8_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TRIGGERED8_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[9\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED9_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED9_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED9` reader - Write '1' to Disable interrupt for TRIGGERED\\[9\\] +event"] +pub struct TRIGGERED9_R(crate::FieldReader); +impl TRIGGERED9_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED9_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED9_A { + match self.bits { + false => TRIGGERED9_A::DISABLED, + true => TRIGGERED9_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED9_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED9_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[9\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED9_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED9_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED9` writer - Write '1' to Disable interrupt for TRIGGERED\\[9\\] +event"] +pub struct TRIGGERED9_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED9_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED9_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TRIGGERED9_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[10\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED10_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED10_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED10` reader - Write '1' to Disable interrupt for TRIGGERED\\[10\\] +event"] +pub struct TRIGGERED10_R(crate::FieldReader); +impl TRIGGERED10_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED10_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED10_A { + match self.bits { + false => TRIGGERED10_A::DISABLED, + true => TRIGGERED10_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED10_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED10_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[10\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED10_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED10_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED10` writer - Write '1' to Disable interrupt for TRIGGERED\\[10\\] +event"] +pub struct TRIGGERED10_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED10_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED10_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TRIGGERED10_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[11\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED11_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED11_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED11` reader - Write '1' to Disable interrupt for TRIGGERED\\[11\\] +event"] +pub struct TRIGGERED11_R(crate::FieldReader); +impl TRIGGERED11_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED11_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED11_A { + match self.bits { + false => TRIGGERED11_A::DISABLED, + true => TRIGGERED11_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED11_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED11_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[11\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED11_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED11_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED11` writer - Write '1' to Disable interrupt for TRIGGERED\\[11\\] +event"] +pub struct TRIGGERED11_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED11_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED11_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TRIGGERED11_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[12\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED12_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED12_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED12` reader - Write '1' to Disable interrupt for TRIGGERED\\[12\\] +event"] +pub struct TRIGGERED12_R(crate::FieldReader); +impl TRIGGERED12_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED12_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED12_A { + match self.bits { + false => TRIGGERED12_A::DISABLED, + true => TRIGGERED12_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED12_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED12_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[12\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED12_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED12_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED12` writer - Write '1' to Disable interrupt for TRIGGERED\\[12\\] +event"] +pub struct TRIGGERED12_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED12_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED12_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TRIGGERED12_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[13\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED13_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED13_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED13` reader - Write '1' to Disable interrupt for TRIGGERED\\[13\\] +event"] +pub struct TRIGGERED13_R(crate::FieldReader); +impl TRIGGERED13_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED13_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED13_A { + match self.bits { + false => TRIGGERED13_A::DISABLED, + true => TRIGGERED13_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED13_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED13_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[13\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED13_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED13_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED13` writer - Write '1' to Disable interrupt for TRIGGERED\\[13\\] +event"] +pub struct TRIGGERED13_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED13_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED13_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TRIGGERED13_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[14\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED14_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED14_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED14` reader - Write '1' to Disable interrupt for TRIGGERED\\[14\\] +event"] +pub struct TRIGGERED14_R(crate::FieldReader); +impl TRIGGERED14_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED14_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED14_A { + match self.bits { + false => TRIGGERED14_A::DISABLED, + true => TRIGGERED14_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED14_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED14_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[14\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED14_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED14_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED14` writer - Write '1' to Disable interrupt for TRIGGERED\\[14\\] +event"] +pub struct TRIGGERED14_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED14_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED14_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TRIGGERED14_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[15\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED15_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED15_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED15` reader - Write '1' to Disable interrupt for TRIGGERED\\[15\\] +event"] +pub struct TRIGGERED15_R(crate::FieldReader); +impl TRIGGERED15_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED15_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED15_A { + match self.bits { + false => TRIGGERED15_A::DISABLED, + true => TRIGGERED15_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED15_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED15_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TRIGGERED\\[15\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED15_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED15_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED15` writer - Write '1' to Disable interrupt for TRIGGERED\\[15\\] +event"] +pub struct TRIGGERED15_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED15_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED15_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TRIGGERED15_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Disable interrupt for TRIGGERED\\[0\\] +event"] + #[inline(always)] + pub fn triggered0(&self) -> TRIGGERED0_R { + TRIGGERED0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for TRIGGERED\\[1\\] +event"] + #[inline(always)] + pub fn triggered1(&self) -> TRIGGERED1_R { + TRIGGERED1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for TRIGGERED\\[2\\] +event"] + #[inline(always)] + pub fn triggered2(&self) -> TRIGGERED2_R { + TRIGGERED2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Write '1' to Disable interrupt for TRIGGERED\\[3\\] +event"] + #[inline(always)] + pub fn triggered3(&self) -> TRIGGERED3_R { + TRIGGERED3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Write '1' to Disable interrupt for TRIGGERED\\[4\\] +event"] + #[inline(always)] + pub fn triggered4(&self) -> TRIGGERED4_R { + TRIGGERED4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Write '1' to Disable interrupt for TRIGGERED\\[5\\] +event"] + #[inline(always)] + pub fn triggered5(&self) -> TRIGGERED5_R { + TRIGGERED5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Write '1' to Disable interrupt for TRIGGERED\\[6\\] +event"] + #[inline(always)] + pub fn triggered6(&self) -> TRIGGERED6_R { + TRIGGERED6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Write '1' to Disable interrupt for TRIGGERED\\[7\\] +event"] + #[inline(always)] + pub fn triggered7(&self) -> TRIGGERED7_R { + TRIGGERED7_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Write '1' to Disable interrupt for TRIGGERED\\[8\\] +event"] + #[inline(always)] + pub fn triggered8(&self) -> TRIGGERED8_R { + TRIGGERED8_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Write '1' to Disable interrupt for TRIGGERED\\[9\\] +event"] + #[inline(always)] + pub fn triggered9(&self) -> TRIGGERED9_R { + TRIGGERED9_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Write '1' to Disable interrupt for TRIGGERED\\[10\\] +event"] + #[inline(always)] + pub fn triggered10(&self) -> TRIGGERED10_R { + TRIGGERED10_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Write '1' to Disable interrupt for TRIGGERED\\[11\\] +event"] + #[inline(always)] + pub fn triggered11(&self) -> TRIGGERED11_R { + TRIGGERED11_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Write '1' to Disable interrupt for TRIGGERED\\[12\\] +event"] + #[inline(always)] + pub fn triggered12(&self) -> TRIGGERED12_R { + TRIGGERED12_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Write '1' to Disable interrupt for TRIGGERED\\[13\\] +event"] + #[inline(always)] + pub fn triggered13(&self) -> TRIGGERED13_R { + TRIGGERED13_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Write '1' to Disable interrupt for TRIGGERED\\[14\\] +event"] + #[inline(always)] + pub fn triggered14(&self) -> TRIGGERED14_R { + TRIGGERED14_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Write '1' to Disable interrupt for TRIGGERED\\[15\\] +event"] + #[inline(always)] + pub fn triggered15(&self) -> TRIGGERED15_R { + TRIGGERED15_R::new(((self.bits >> 15) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Disable interrupt for TRIGGERED\\[0\\] +event"] + #[inline(always)] + pub fn triggered0(&mut self) -> TRIGGERED0_W { + TRIGGERED0_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for TRIGGERED\\[1\\] +event"] + #[inline(always)] + pub fn triggered1(&mut self) -> TRIGGERED1_W { + TRIGGERED1_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for TRIGGERED\\[2\\] +event"] + #[inline(always)] + pub fn triggered2(&mut self) -> TRIGGERED2_W { + TRIGGERED2_W { w: self } + } + #[doc = "Bit 3 - Write '1' to Disable interrupt for TRIGGERED\\[3\\] +event"] + #[inline(always)] + pub fn triggered3(&mut self) -> TRIGGERED3_W { + TRIGGERED3_W { w: self } + } + #[doc = "Bit 4 - Write '1' to Disable interrupt for TRIGGERED\\[4\\] +event"] + #[inline(always)] + pub fn triggered4(&mut self) -> TRIGGERED4_W { + TRIGGERED4_W { w: self } + } + #[doc = "Bit 5 - Write '1' to Disable interrupt for TRIGGERED\\[5\\] +event"] + #[inline(always)] + pub fn triggered5(&mut self) -> TRIGGERED5_W { + TRIGGERED5_W { w: self } + } + #[doc = "Bit 6 - Write '1' to Disable interrupt for TRIGGERED\\[6\\] +event"] + #[inline(always)] + pub fn triggered6(&mut self) -> TRIGGERED6_W { + TRIGGERED6_W { w: self } + } + #[doc = "Bit 7 - Write '1' to Disable interrupt for TRIGGERED\\[7\\] +event"] + #[inline(always)] + pub fn triggered7(&mut self) -> TRIGGERED7_W { + TRIGGERED7_W { w: self } + } + #[doc = "Bit 8 - Write '1' to Disable interrupt for TRIGGERED\\[8\\] +event"] + #[inline(always)] + pub fn triggered8(&mut self) -> TRIGGERED8_W { + TRIGGERED8_W { w: self } + } + #[doc = "Bit 9 - Write '1' to Disable interrupt for TRIGGERED\\[9\\] +event"] + #[inline(always)] + pub fn triggered9(&mut self) -> TRIGGERED9_W { + TRIGGERED9_W { w: self } + } + #[doc = "Bit 10 - Write '1' to Disable interrupt for TRIGGERED\\[10\\] +event"] + #[inline(always)] + pub fn triggered10(&mut self) -> TRIGGERED10_W { + TRIGGERED10_W { w: self } + } + #[doc = "Bit 11 - Write '1' to Disable interrupt for TRIGGERED\\[11\\] +event"] + #[inline(always)] + pub fn triggered11(&mut self) -> TRIGGERED11_W { + TRIGGERED11_W { w: self } + } + #[doc = "Bit 12 - Write '1' to Disable interrupt for TRIGGERED\\[12\\] +event"] + #[inline(always)] + pub fn triggered12(&mut self) -> TRIGGERED12_W { + TRIGGERED12_W { w: self } + } + #[doc = "Bit 13 - Write '1' to Disable interrupt for TRIGGERED\\[13\\] +event"] + #[inline(always)] + pub fn triggered13(&mut self) -> TRIGGERED13_W { + TRIGGERED13_W { w: self } + } + #[doc = "Bit 14 - Write '1' to Disable interrupt for TRIGGERED\\[14\\] +event"] + #[inline(always)] + pub fn triggered14(&mut self) -> TRIGGERED14_W { + TRIGGERED14_W { w: self } + } + #[doc = "Bit 15 - Write '1' to Disable interrupt for TRIGGERED\\[15\\] +event"] + #[inline(always)] + pub fn triggered15(&mut self) -> TRIGGERED15_W { + TRIGGERED15_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/egu0/intenset.rs b/src/egu0/intenset.rs new file mode 100644 index 0000000..d272248 --- /dev/null +++ b/src/egu0/intenset.rs @@ -0,0 +1,1762 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED0_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED0` reader - Write '1' to Enable interrupt for TRIGGERED\\[0\\] +event"] +pub struct TRIGGERED0_R(crate::FieldReader); +impl TRIGGERED0_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED0_A { + match self.bits { + false => TRIGGERED0_A::DISABLED, + true => TRIGGERED0_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED0_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED0_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED0_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED0_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED0` writer - Write '1' to Enable interrupt for TRIGGERED\\[0\\] +event"] +pub struct TRIGGERED0_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED0_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TRIGGERED0_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED1_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED1` reader - Write '1' to Enable interrupt for TRIGGERED\\[1\\] +event"] +pub struct TRIGGERED1_R(crate::FieldReader); +impl TRIGGERED1_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED1_A { + match self.bits { + false => TRIGGERED1_A::DISABLED, + true => TRIGGERED1_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED1_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED1_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED1_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED1_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED1` writer - Write '1' to Enable interrupt for TRIGGERED\\[1\\] +event"] +pub struct TRIGGERED1_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED1_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TRIGGERED1_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[2\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED2_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED2` reader - Write '1' to Enable interrupt for TRIGGERED\\[2\\] +event"] +pub struct TRIGGERED2_R(crate::FieldReader); +impl TRIGGERED2_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED2_A { + match self.bits { + false => TRIGGERED2_A::DISABLED, + true => TRIGGERED2_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED2_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED2_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[2\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED2_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED2_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED2` writer - Write '1' to Enable interrupt for TRIGGERED\\[2\\] +event"] +pub struct TRIGGERED2_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED2_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TRIGGERED2_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[3\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED3_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED3` reader - Write '1' to Enable interrupt for TRIGGERED\\[3\\] +event"] +pub struct TRIGGERED3_R(crate::FieldReader); +impl TRIGGERED3_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED3_A { + match self.bits { + false => TRIGGERED3_A::DISABLED, + true => TRIGGERED3_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED3_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED3_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[3\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED3_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED3_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED3` writer - Write '1' to Enable interrupt for TRIGGERED\\[3\\] +event"] +pub struct TRIGGERED3_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED3_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TRIGGERED3_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[4\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED4_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED4_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED4` reader - Write '1' to Enable interrupt for TRIGGERED\\[4\\] +event"] +pub struct TRIGGERED4_R(crate::FieldReader); +impl TRIGGERED4_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED4_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED4_A { + match self.bits { + false => TRIGGERED4_A::DISABLED, + true => TRIGGERED4_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED4_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED4_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[4\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED4_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED4_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED4` writer - Write '1' to Enable interrupt for TRIGGERED\\[4\\] +event"] +pub struct TRIGGERED4_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED4_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED4_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TRIGGERED4_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[5\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED5_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED5_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED5` reader - Write '1' to Enable interrupt for TRIGGERED\\[5\\] +event"] +pub struct TRIGGERED5_R(crate::FieldReader); +impl TRIGGERED5_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED5_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED5_A { + match self.bits { + false => TRIGGERED5_A::DISABLED, + true => TRIGGERED5_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED5_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED5_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[5\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED5_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED5_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED5` writer - Write '1' to Enable interrupt for TRIGGERED\\[5\\] +event"] +pub struct TRIGGERED5_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED5_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED5_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TRIGGERED5_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[6\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED6_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED6_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED6` reader - Write '1' to Enable interrupt for TRIGGERED\\[6\\] +event"] +pub struct TRIGGERED6_R(crate::FieldReader); +impl TRIGGERED6_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED6_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED6_A { + match self.bits { + false => TRIGGERED6_A::DISABLED, + true => TRIGGERED6_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED6_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED6_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[6\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED6_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED6_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED6` writer - Write '1' to Enable interrupt for TRIGGERED\\[6\\] +event"] +pub struct TRIGGERED6_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED6_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED6_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TRIGGERED6_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[7\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED7_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED7_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED7` reader - Write '1' to Enable interrupt for TRIGGERED\\[7\\] +event"] +pub struct TRIGGERED7_R(crate::FieldReader); +impl TRIGGERED7_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED7_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED7_A { + match self.bits { + false => TRIGGERED7_A::DISABLED, + true => TRIGGERED7_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED7_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED7_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[7\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED7_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED7_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED7` writer - Write '1' to Enable interrupt for TRIGGERED\\[7\\] +event"] +pub struct TRIGGERED7_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED7_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED7_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TRIGGERED7_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[8\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED8_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED8_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED8` reader - Write '1' to Enable interrupt for TRIGGERED\\[8\\] +event"] +pub struct TRIGGERED8_R(crate::FieldReader); +impl TRIGGERED8_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED8_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED8_A { + match self.bits { + false => TRIGGERED8_A::DISABLED, + true => TRIGGERED8_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED8_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED8_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[8\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED8_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED8_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED8` writer - Write '1' to Enable interrupt for TRIGGERED\\[8\\] +event"] +pub struct TRIGGERED8_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED8_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED8_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TRIGGERED8_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[9\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED9_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED9_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED9` reader - Write '1' to Enable interrupt for TRIGGERED\\[9\\] +event"] +pub struct TRIGGERED9_R(crate::FieldReader); +impl TRIGGERED9_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED9_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED9_A { + match self.bits { + false => TRIGGERED9_A::DISABLED, + true => TRIGGERED9_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED9_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED9_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[9\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED9_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED9_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED9` writer - Write '1' to Enable interrupt for TRIGGERED\\[9\\] +event"] +pub struct TRIGGERED9_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED9_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED9_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TRIGGERED9_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[10\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED10_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED10_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED10` reader - Write '1' to Enable interrupt for TRIGGERED\\[10\\] +event"] +pub struct TRIGGERED10_R(crate::FieldReader); +impl TRIGGERED10_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED10_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED10_A { + match self.bits { + false => TRIGGERED10_A::DISABLED, + true => TRIGGERED10_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED10_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED10_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[10\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED10_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED10_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED10` writer - Write '1' to Enable interrupt for TRIGGERED\\[10\\] +event"] +pub struct TRIGGERED10_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED10_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED10_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TRIGGERED10_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[11\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED11_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED11_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED11` reader - Write '1' to Enable interrupt for TRIGGERED\\[11\\] +event"] +pub struct TRIGGERED11_R(crate::FieldReader); +impl TRIGGERED11_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED11_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED11_A { + match self.bits { + false => TRIGGERED11_A::DISABLED, + true => TRIGGERED11_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED11_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED11_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[11\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED11_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED11_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED11` writer - Write '1' to Enable interrupt for TRIGGERED\\[11\\] +event"] +pub struct TRIGGERED11_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED11_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED11_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TRIGGERED11_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[12\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED12_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED12_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED12` reader - Write '1' to Enable interrupt for TRIGGERED\\[12\\] +event"] +pub struct TRIGGERED12_R(crate::FieldReader); +impl TRIGGERED12_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED12_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED12_A { + match self.bits { + false => TRIGGERED12_A::DISABLED, + true => TRIGGERED12_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED12_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED12_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[12\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED12_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED12_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED12` writer - Write '1' to Enable interrupt for TRIGGERED\\[12\\] +event"] +pub struct TRIGGERED12_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED12_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED12_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TRIGGERED12_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[13\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED13_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED13_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED13` reader - Write '1' to Enable interrupt for TRIGGERED\\[13\\] +event"] +pub struct TRIGGERED13_R(crate::FieldReader); +impl TRIGGERED13_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED13_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED13_A { + match self.bits { + false => TRIGGERED13_A::DISABLED, + true => TRIGGERED13_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED13_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED13_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[13\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED13_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED13_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED13` writer - Write '1' to Enable interrupt for TRIGGERED\\[13\\] +event"] +pub struct TRIGGERED13_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED13_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED13_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TRIGGERED13_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[14\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED14_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED14_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED14` reader - Write '1' to Enable interrupt for TRIGGERED\\[14\\] +event"] +pub struct TRIGGERED14_R(crate::FieldReader); +impl TRIGGERED14_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED14_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED14_A { + match self.bits { + false => TRIGGERED14_A::DISABLED, + true => TRIGGERED14_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED14_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED14_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[14\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED14_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED14_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED14` writer - Write '1' to Enable interrupt for TRIGGERED\\[14\\] +event"] +pub struct TRIGGERED14_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED14_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED14_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TRIGGERED14_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[15\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED15_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED15_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED15` reader - Write '1' to Enable interrupt for TRIGGERED\\[15\\] +event"] +pub struct TRIGGERED15_R(crate::FieldReader); +impl TRIGGERED15_R { + pub(crate) fn new(bits: bool) -> Self { + TRIGGERED15_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TRIGGERED15_A { + match self.bits { + false => TRIGGERED15_A::DISABLED, + true => TRIGGERED15_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TRIGGERED15_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TRIGGERED15_A::ENABLED + } +} +impl core::ops::Deref for TRIGGERED15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TRIGGERED\\[15\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TRIGGERED15_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TRIGGERED15_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TRIGGERED15` writer - Write '1' to Enable interrupt for TRIGGERED\\[15\\] +event"] +pub struct TRIGGERED15_W<'a> { + w: &'a mut W, +} +impl<'a> TRIGGERED15_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TRIGGERED15_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TRIGGERED15_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Enable interrupt for TRIGGERED\\[0\\] +event"] + #[inline(always)] + pub fn triggered0(&self) -> TRIGGERED0_R { + TRIGGERED0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for TRIGGERED\\[1\\] +event"] + #[inline(always)] + pub fn triggered1(&self) -> TRIGGERED1_R { + TRIGGERED1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for TRIGGERED\\[2\\] +event"] + #[inline(always)] + pub fn triggered2(&self) -> TRIGGERED2_R { + TRIGGERED2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Write '1' to Enable interrupt for TRIGGERED\\[3\\] +event"] + #[inline(always)] + pub fn triggered3(&self) -> TRIGGERED3_R { + TRIGGERED3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Write '1' to Enable interrupt for TRIGGERED\\[4\\] +event"] + #[inline(always)] + pub fn triggered4(&self) -> TRIGGERED4_R { + TRIGGERED4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Write '1' to Enable interrupt for TRIGGERED\\[5\\] +event"] + #[inline(always)] + pub fn triggered5(&self) -> TRIGGERED5_R { + TRIGGERED5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Write '1' to Enable interrupt for TRIGGERED\\[6\\] +event"] + #[inline(always)] + pub fn triggered6(&self) -> TRIGGERED6_R { + TRIGGERED6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Write '1' to Enable interrupt for TRIGGERED\\[7\\] +event"] + #[inline(always)] + pub fn triggered7(&self) -> TRIGGERED7_R { + TRIGGERED7_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Write '1' to Enable interrupt for TRIGGERED\\[8\\] +event"] + #[inline(always)] + pub fn triggered8(&self) -> TRIGGERED8_R { + TRIGGERED8_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Write '1' to Enable interrupt for TRIGGERED\\[9\\] +event"] + #[inline(always)] + pub fn triggered9(&self) -> TRIGGERED9_R { + TRIGGERED9_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Write '1' to Enable interrupt for TRIGGERED\\[10\\] +event"] + #[inline(always)] + pub fn triggered10(&self) -> TRIGGERED10_R { + TRIGGERED10_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Write '1' to Enable interrupt for TRIGGERED\\[11\\] +event"] + #[inline(always)] + pub fn triggered11(&self) -> TRIGGERED11_R { + TRIGGERED11_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Write '1' to Enable interrupt for TRIGGERED\\[12\\] +event"] + #[inline(always)] + pub fn triggered12(&self) -> TRIGGERED12_R { + TRIGGERED12_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Write '1' to Enable interrupt for TRIGGERED\\[13\\] +event"] + #[inline(always)] + pub fn triggered13(&self) -> TRIGGERED13_R { + TRIGGERED13_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Write '1' to Enable interrupt for TRIGGERED\\[14\\] +event"] + #[inline(always)] + pub fn triggered14(&self) -> TRIGGERED14_R { + TRIGGERED14_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Write '1' to Enable interrupt for TRIGGERED\\[15\\] +event"] + #[inline(always)] + pub fn triggered15(&self) -> TRIGGERED15_R { + TRIGGERED15_R::new(((self.bits >> 15) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Enable interrupt for TRIGGERED\\[0\\] +event"] + #[inline(always)] + pub fn triggered0(&mut self) -> TRIGGERED0_W { + TRIGGERED0_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for TRIGGERED\\[1\\] +event"] + #[inline(always)] + pub fn triggered1(&mut self) -> TRIGGERED1_W { + TRIGGERED1_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for TRIGGERED\\[2\\] +event"] + #[inline(always)] + pub fn triggered2(&mut self) -> TRIGGERED2_W { + TRIGGERED2_W { w: self } + } + #[doc = "Bit 3 - Write '1' to Enable interrupt for TRIGGERED\\[3\\] +event"] + #[inline(always)] + pub fn triggered3(&mut self) -> TRIGGERED3_W { + TRIGGERED3_W { w: self } + } + #[doc = "Bit 4 - Write '1' to Enable interrupt for TRIGGERED\\[4\\] +event"] + #[inline(always)] + pub fn triggered4(&mut self) -> TRIGGERED4_W { + TRIGGERED4_W { w: self } + } + #[doc = "Bit 5 - Write '1' to Enable interrupt for TRIGGERED\\[5\\] +event"] + #[inline(always)] + pub fn triggered5(&mut self) -> TRIGGERED5_W { + TRIGGERED5_W { w: self } + } + #[doc = "Bit 6 - Write '1' to Enable interrupt for TRIGGERED\\[6\\] +event"] + #[inline(always)] + pub fn triggered6(&mut self) -> TRIGGERED6_W { + TRIGGERED6_W { w: self } + } + #[doc = "Bit 7 - Write '1' to Enable interrupt for TRIGGERED\\[7\\] +event"] + #[inline(always)] + pub fn triggered7(&mut self) -> TRIGGERED7_W { + TRIGGERED7_W { w: self } + } + #[doc = "Bit 8 - Write '1' to Enable interrupt for TRIGGERED\\[8\\] +event"] + #[inline(always)] + pub fn triggered8(&mut self) -> TRIGGERED8_W { + TRIGGERED8_W { w: self } + } + #[doc = "Bit 9 - Write '1' to Enable interrupt for TRIGGERED\\[9\\] +event"] + #[inline(always)] + pub fn triggered9(&mut self) -> TRIGGERED9_W { + TRIGGERED9_W { w: self } + } + #[doc = "Bit 10 - Write '1' to Enable interrupt for TRIGGERED\\[10\\] +event"] + #[inline(always)] + pub fn triggered10(&mut self) -> TRIGGERED10_W { + TRIGGERED10_W { w: self } + } + #[doc = "Bit 11 - Write '1' to Enable interrupt for TRIGGERED\\[11\\] +event"] + #[inline(always)] + pub fn triggered11(&mut self) -> TRIGGERED11_W { + TRIGGERED11_W { w: self } + } + #[doc = "Bit 12 - Write '1' to Enable interrupt for TRIGGERED\\[12\\] +event"] + #[inline(always)] + pub fn triggered12(&mut self) -> TRIGGERED12_W { + TRIGGERED12_W { w: self } + } + #[doc = "Bit 13 - Write '1' to Enable interrupt for TRIGGERED\\[13\\] +event"] + #[inline(always)] + pub fn triggered13(&mut self) -> TRIGGERED13_W { + TRIGGERED13_W { w: self } + } + #[doc = "Bit 14 - Write '1' to Enable interrupt for TRIGGERED\\[14\\] +event"] + #[inline(always)] + pub fn triggered14(&mut self) -> TRIGGERED14_W { + TRIGGERED14_W { w: self } + } + #[doc = "Bit 15 - Write '1' to Enable interrupt for TRIGGERED\\[15\\] +event"] + #[inline(always)] + pub fn triggered15(&mut self) -> TRIGGERED15_W { + TRIGGERED15_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/egu0/tasks_trigger.rs b/src/egu0/tasks_trigger.rs new file mode 100644 index 0000000..323124e --- /dev/null +++ b/src/egu0/tasks_trigger.rs @@ -0,0 +1,47 @@ +#[doc = "Register `TASKS_TRIGGER[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description collection\\[0\\]: Trigger 0 for triggering the corresponding TRIGGERED\\[0\\] +event\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_trigger](index.html) module"] +pub struct TASKS_TRIGGER_SPEC; +impl crate::RegisterSpec for TASKS_TRIGGER_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_trigger::W](W) writer structure"] +impl crate::Writable for TASKS_TRIGGER_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_TRIGGER[%s] +to value 0"] +impl crate::Resettable for TASKS_TRIGGER_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ficr.rs b/src/ficr.rs new file mode 100644 index 0000000..56d4cec --- /dev/null +++ b/src/ficr.rs @@ -0,0 +1,133 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + _reserved0: [u8; 0x10], + #[doc = "0x10 - Code memory page size"] + pub codepagesize: crate::Reg, + #[doc = "0x14 - Code memory size"] + pub codesize: crate::Reg, + _reserved2: [u8; 0x48], + #[doc = "0x60..0x68 - Description collection\\[0\\]: Device identifier"] + pub deviceid: [crate::Reg; 2], + _reserved3: [u8; 0x18], + #[doc = "0x80..0x90 - Description collection\\[0\\]: Encryption Root, word 0"] + pub er: [crate::Reg; 4], + #[doc = "0x90..0xa0 - Description collection\\[0\\]: Identity Root, word 0"] + pub ir: [crate::Reg; 4], + #[doc = "0xa0 - Device address type"] + pub deviceaddrtype: crate::Reg, + #[doc = "0xa4..0xac - Description collection\\[0\\]: Device address 0"] + pub deviceaddr: [crate::Reg; 2], + _reserved7: [u8; 0x54], + #[doc = "0x100..0x120 - Device info"] + pub info: INFO, + _reserved8: [u8; 0x02e4], + #[doc = "0x404..0x448 - Registers storing factory TEMP module linearization coefficients"] + pub temp: TEMP, + _reserved9: [u8; 0x08], + #[doc = "0x450..0x460 - Unspecified"] + pub nfc: NFC, +} +#[doc = r"Register block"] +#[repr(C)] +pub struct INFO { + #[doc = "0x00 - Part code"] + pub part: crate::Reg, + #[doc = "0x04 - Part Variant, Hardware version and Production configuration"] + pub variant: crate::Reg, + #[doc = "0x08 - Package option"] + pub package: crate::Reg, + #[doc = "0x0c - RAM variant"] + pub ram: crate::Reg, + #[doc = "0x10 - Flash variant"] + pub flash: crate::Reg, + #[doc = "0x14..0x20 - Description collection\\[0\\]: Unspecified"] + pub unused0: [crate::Reg; 3], +} +#[doc = r"Register block"] +#[doc = "Device info"] +pub mod info; +#[doc = r"Register block"] +#[repr(C)] +pub struct TEMP { + #[doc = "0x00 - Slope definition A0."] + pub a0: crate::Reg, + #[doc = "0x04 - Slope definition A1."] + pub a1: crate::Reg, + #[doc = "0x08 - Slope definition A2."] + pub a2: crate::Reg, + #[doc = "0x0c - Slope definition A3."] + pub a3: crate::Reg, + #[doc = "0x10 - Slope definition A4."] + pub a4: crate::Reg, + #[doc = "0x14 - Slope definition A5."] + pub a5: crate::Reg, + #[doc = "0x18 - y-intercept B0."] + pub b0: crate::Reg, + #[doc = "0x1c - y-intercept B1."] + pub b1: crate::Reg, + #[doc = "0x20 - y-intercept B2."] + pub b2: crate::Reg, + #[doc = "0x24 - y-intercept B3."] + pub b3: crate::Reg, + #[doc = "0x28 - y-intercept B4."] + pub b4: crate::Reg, + #[doc = "0x2c - y-intercept B5."] + pub b5: crate::Reg, + #[doc = "0x30 - Segment end T0."] + pub t0: crate::Reg, + #[doc = "0x34 - Segment end T1."] + pub t1: crate::Reg, + #[doc = "0x38 - Segment end T2."] + pub t2: crate::Reg, + #[doc = "0x3c - Segment end T3."] + pub t3: crate::Reg, + #[doc = "0x40 - Segment end T4."] + pub t4: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Registers storing factory TEMP module linearization coefficients"] +pub mod temp; +#[doc = r"Register block"] +#[repr(C)] +pub struct NFC { + #[doc = "0x00 - Default header for NFC Tag. Software can read these values to populate NFCID1_3RD_LAST, NFCID1_2ND_LAST and NFCID1_LAST."] + pub tagheader0: crate::Reg, + #[doc = "0x04 - Default header for NFC Tag. Software can read these values to populate NFCID1_3RD_LAST, NFCID1_2ND_LAST and NFCID1_LAST."] + pub tagheader1: crate::Reg, + #[doc = "0x08 - Default header for NFC Tag. Software can read these values to populate NFCID1_3RD_LAST, NFCID1_2ND_LAST and NFCID1_LAST."] + pub tagheader2: crate::Reg, + #[doc = "0x0c - Default header for NFC Tag. Software can read these values to populate NFCID1_3RD_LAST, NFCID1_2ND_LAST and NFCID1_LAST."] + pub tagheader3: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod nfc; +#[doc = "CODEPAGESIZE register accessor: an alias for `Reg`"] +pub type CODEPAGESIZE = crate::Reg; +#[doc = "Code memory page size"] +pub mod codepagesize; +#[doc = "CODESIZE register accessor: an alias for `Reg`"] +pub type CODESIZE = crate::Reg; +#[doc = "Code memory size"] +pub mod codesize; +#[doc = "DEVICEID register accessor: an alias for `Reg`"] +pub type DEVICEID = crate::Reg; +#[doc = "Description collection\\[0\\]: Device identifier"] +pub mod deviceid; +#[doc = "ER register accessor: an alias for `Reg`"] +pub type ER = crate::Reg; +#[doc = "Description collection\\[0\\]: Encryption Root, word 0"] +pub mod er; +#[doc = "IR register accessor: an alias for `Reg`"] +pub type IR = crate::Reg; +#[doc = "Description collection\\[0\\]: Identity Root, word 0"] +pub mod ir; +#[doc = "DEVICEADDRTYPE register accessor: an alias for `Reg`"] +pub type DEVICEADDRTYPE = crate::Reg; +#[doc = "Device address type"] +pub mod deviceaddrtype; +#[doc = "DEVICEADDR register accessor: an alias for `Reg`"] +pub type DEVICEADDR = crate::Reg; +#[doc = "Description collection\\[0\\]: Device address 0"] +pub mod deviceaddr; diff --git a/src/ficr/codepagesize.rs b/src/ficr/codepagesize.rs new file mode 100644 index 0000000..48402f1 --- /dev/null +++ b/src/ficr/codepagesize.rs @@ -0,0 +1,52 @@ +#[doc = "Register `CODEPAGESIZE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `CODEPAGESIZE` reader - Code memory page size"] +pub struct CODEPAGESIZE_R(crate::FieldReader); +impl CODEPAGESIZE_R { + pub(crate) fn new(bits: u32) -> Self { + CODEPAGESIZE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CODEPAGESIZE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:31 - Code memory page size"] + #[inline(always)] + pub fn codepagesize(&self) -> CODEPAGESIZE_R { + CODEPAGESIZE_R::new((self.bits & 0xffff_ffff) as u32) + } +} +#[doc = "Code memory page size\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 [codepagesize](index.html) module"] +pub struct CODEPAGESIZE_SPEC; +impl crate::RegisterSpec for CODEPAGESIZE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [codepagesize::R](R) reader structure"] +impl crate::Readable for CODEPAGESIZE_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets CODEPAGESIZE to value 0xffff_ffff"] +impl crate::Resettable for CODEPAGESIZE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/ficr/codesize.rs b/src/ficr/codesize.rs new file mode 100644 index 0000000..91516bb --- /dev/null +++ b/src/ficr/codesize.rs @@ -0,0 +1,52 @@ +#[doc = "Register `CODESIZE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `CODESIZE` reader - Code memory size in number of pages"] +pub struct CODESIZE_R(crate::FieldReader); +impl CODESIZE_R { + pub(crate) fn new(bits: u32) -> Self { + CODESIZE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CODESIZE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:31 - Code memory size in number of pages"] + #[inline(always)] + pub fn codesize(&self) -> CODESIZE_R { + CODESIZE_R::new((self.bits & 0xffff_ffff) as u32) + } +} +#[doc = "Code memory size\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 [codesize](index.html) module"] +pub struct CODESIZE_SPEC; +impl crate::RegisterSpec for CODESIZE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [codesize::R](R) reader structure"] +impl crate::Readable for CODESIZE_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets CODESIZE to value 0xffff_ffff"] +impl crate::Resettable for CODESIZE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/ficr/deviceaddr.rs b/src/ficr/deviceaddr.rs new file mode 100644 index 0000000..68fa027 --- /dev/null +++ b/src/ficr/deviceaddr.rs @@ -0,0 +1,53 @@ +#[doc = "Register `DEVICEADDR[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `DEVICEADDR` reader - 48 bit device address"] +pub struct DEVICEADDR_R(crate::FieldReader); +impl DEVICEADDR_R { + pub(crate) fn new(bits: u32) -> Self { + DEVICEADDR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DEVICEADDR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:31 - 48 bit device address"] + #[inline(always)] + pub fn deviceaddr(&self) -> DEVICEADDR_R { + DEVICEADDR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +#[doc = "Description collection\\[0\\]: Device address 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 [deviceaddr](index.html) module"] +pub struct DEVICEADDR_SPEC; +impl crate::RegisterSpec for DEVICEADDR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [deviceaddr::R](R) reader structure"] +impl crate::Readable for DEVICEADDR_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets DEVICEADDR[%s] +to value 0xffff_ffff"] +impl crate::Resettable for DEVICEADDR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/ficr/deviceaddrtype.rs b/src/ficr/deviceaddrtype.rs new file mode 100644 index 0000000..57bdaff --- /dev/null +++ b/src/ficr/deviceaddrtype.rs @@ -0,0 +1,84 @@ +#[doc = "Register `DEVICEADDRTYPE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Device address type\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DEVICEADDRTYPE_A { + #[doc = "0: Public address"] + PUBLIC = 0, + #[doc = "1: Random address"] + RANDOM = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DEVICEADDRTYPE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DEVICEADDRTYPE` reader - Device address type"] +pub struct DEVICEADDRTYPE_R(crate::FieldReader); +impl DEVICEADDRTYPE_R { + pub(crate) fn new(bits: bool) -> Self { + DEVICEADDRTYPE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DEVICEADDRTYPE_A { + match self.bits { + false => DEVICEADDRTYPE_A::PUBLIC, + true => DEVICEADDRTYPE_A::RANDOM, + } + } + #[doc = "Checks if the value of the field is `PUBLIC`"] + #[inline(always)] + pub fn is_public(&self) -> bool { + **self == DEVICEADDRTYPE_A::PUBLIC + } + #[doc = "Checks if the value of the field is `RANDOM`"] + #[inline(always)] + pub fn is_random(&self) -> bool { + **self == DEVICEADDRTYPE_A::RANDOM + } +} +impl core::ops::Deref for DEVICEADDRTYPE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bit 0 - Device address type"] + #[inline(always)] + pub fn deviceaddrtype(&self) -> DEVICEADDRTYPE_R { + DEVICEADDRTYPE_R::new((self.bits & 0x01) != 0) + } +} +#[doc = "Device address type\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 [deviceaddrtype](index.html) module"] +pub struct DEVICEADDRTYPE_SPEC; +impl crate::RegisterSpec for DEVICEADDRTYPE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [deviceaddrtype::R](R) reader structure"] +impl crate::Readable for DEVICEADDRTYPE_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets DEVICEADDRTYPE to value 0xffff_ffff"] +impl crate::Resettable for DEVICEADDRTYPE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/ficr/deviceid.rs b/src/ficr/deviceid.rs new file mode 100644 index 0000000..18630f8 --- /dev/null +++ b/src/ficr/deviceid.rs @@ -0,0 +1,53 @@ +#[doc = "Register `DEVICEID[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `DEVICEID` reader - 64 bit unique device identifier"] +pub struct DEVICEID_R(crate::FieldReader); +impl DEVICEID_R { + pub(crate) fn new(bits: u32) -> Self { + DEVICEID_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DEVICEID_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:31 - 64 bit unique device identifier"] + #[inline(always)] + pub fn deviceid(&self) -> DEVICEID_R { + DEVICEID_R::new((self.bits & 0xffff_ffff) as u32) + } +} +#[doc = "Description collection\\[0\\]: Device identifier\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 [deviceid](index.html) module"] +pub struct DEVICEID_SPEC; +impl crate::RegisterSpec for DEVICEID_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [deviceid::R](R) reader structure"] +impl crate::Readable for DEVICEID_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets DEVICEID[%s] +to value 0xffff_ffff"] +impl crate::Resettable for DEVICEID_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/ficr/er.rs b/src/ficr/er.rs new file mode 100644 index 0000000..6729384 --- /dev/null +++ b/src/ficr/er.rs @@ -0,0 +1,53 @@ +#[doc = "Register `ER[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `ER` reader - Encryption Root, word n"] +pub struct ER_R(crate::FieldReader); +impl ER_R { + pub(crate) fn new(bits: u32) -> Self { + ER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:31 - Encryption Root, word n"] + #[inline(always)] + pub fn er(&self) -> ER_R { + ER_R::new((self.bits & 0xffff_ffff) as u32) + } +} +#[doc = "Description collection\\[0\\]: Encryption Root, word 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 [er](index.html) module"] +pub struct ER_SPEC; +impl crate::RegisterSpec for ER_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [er::R](R) reader structure"] +impl crate::Readable for ER_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets ER[%s] +to value 0xffff_ffff"] +impl crate::Resettable for ER_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/ficr/info.rs b/src/ficr/info.rs new file mode 100644 index 0000000..029db08 --- /dev/null +++ b/src/ficr/info.rs @@ -0,0 +1,24 @@ +#[doc = "PART register accessor: an alias for `Reg`"] +pub type PART = crate::Reg; +#[doc = "Part code"] +pub mod part; +#[doc = "VARIANT register accessor: an alias for `Reg`"] +pub type VARIANT = crate::Reg; +#[doc = "Part Variant, Hardware version and Production configuration"] +pub mod variant; +#[doc = "PACKAGE register accessor: an alias for `Reg`"] +pub type PACKAGE = crate::Reg; +#[doc = "Package option"] +pub mod package; +#[doc = "RAM register accessor: an alias for `Reg`"] +pub type RAM = crate::Reg; +#[doc = "RAM variant"] +pub mod ram; +#[doc = "FLASH register accessor: an alias for `Reg`"] +pub type FLASH = crate::Reg; +#[doc = "Flash variant"] +pub mod flash; +#[doc = "UNUSED0 register accessor: an alias for `Reg`"] +pub type UNUSED0 = crate::Reg; +#[doc = "Description collection\\[0\\]: Unspecified"] +pub mod unused0; diff --git a/src/ficr/info/flash.rs b/src/ficr/info/flash.rs new file mode 100644 index 0000000..8208e5b --- /dev/null +++ b/src/ficr/info/flash.rs @@ -0,0 +1,102 @@ +#[doc = "Register `FLASH` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Flash variant\n\nValue on reset: 512"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u32)] +pub enum FLASH_A { + #[doc = "128: 128 kByte FLASH"] + K128 = 128, + #[doc = "256: 256 kByte FLASH"] + K256 = 256, + #[doc = "512: 512 kByte FLASH"] + K512 = 512, + #[doc = "4294967295: Unspecified"] + UNSPECIFIED = 4294967295, +} +impl From for u32 { + #[inline(always)] + fn from(variant: FLASH_A) -> Self { + variant as _ + } +} +#[doc = "Field `FLASH` reader - Flash variant"] +pub struct FLASH_R(crate::FieldReader); +impl FLASH_R { + pub(crate) fn new(bits: u32) -> Self { + FLASH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 128 => Some(FLASH_A::K128), + 256 => Some(FLASH_A::K256), + 512 => Some(FLASH_A::K512), + 4294967295 => Some(FLASH_A::UNSPECIFIED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `K128`"] + #[inline(always)] + pub fn is_k128(&self) -> bool { + **self == FLASH_A::K128 + } + #[doc = "Checks if the value of the field is `K256`"] + #[inline(always)] + pub fn is_k256(&self) -> bool { + **self == FLASH_A::K256 + } + #[doc = "Checks if the value of the field is `K512`"] + #[inline(always)] + pub fn is_k512(&self) -> bool { + **self == FLASH_A::K512 + } + #[doc = "Checks if the value of the field is `UNSPECIFIED`"] + #[inline(always)] + pub fn is_unspecified(&self) -> bool { + **self == FLASH_A::UNSPECIFIED + } +} +impl core::ops::Deref for FLASH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:31 - Flash variant"] + #[inline(always)] + pub fn flash(&self) -> FLASH_R { + FLASH_R::new((self.bits & 0xffff_ffff) as u32) + } +} +#[doc = "Flash variant\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 [flash](index.html) module"] +pub struct FLASH_SPEC; +impl crate::RegisterSpec for FLASH_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [flash::R](R) reader structure"] +impl crate::Readable for FLASH_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets FLASH to value 0x0200"] +impl crate::Resettable for FLASH_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0200 + } +} diff --git a/src/ficr/info/package.rs b/src/ficr/info/package.rs new file mode 100644 index 0000000..eb00ca8 --- /dev/null +++ b/src/ficr/info/package.rs @@ -0,0 +1,110 @@ +#[doc = "Register `PACKAGE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Package option\n\nValue on reset: 8192"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u32)] +pub enum PACKAGE_A { + #[doc = "8192: QFxx - 48-pin QFN"] + QF = 8192, + #[doc = "8193: CHxx - 7x8 WLCSP 56 balls"] + CH = 8193, + #[doc = "8194: CIxx - 7x8 WLCSP 56 balls"] + CI = 8194, + #[doc = "8197: CKxx - 7x8 WLCSP 56 balls with backside coating for light protection"] + CK = 8197, + #[doc = "4294967295: Unspecified"] + UNSPECIFIED = 4294967295, +} +impl From for u32 { + #[inline(always)] + fn from(variant: PACKAGE_A) -> Self { + variant as _ + } +} +#[doc = "Field `PACKAGE` reader - Package option"] +pub struct PACKAGE_R(crate::FieldReader); +impl PACKAGE_R { + pub(crate) fn new(bits: u32) -> Self { + PACKAGE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 8192 => Some(PACKAGE_A::QF), + 8193 => Some(PACKAGE_A::CH), + 8194 => Some(PACKAGE_A::CI), + 8197 => Some(PACKAGE_A::CK), + 4294967295 => Some(PACKAGE_A::UNSPECIFIED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `QF`"] + #[inline(always)] + pub fn is_qf(&self) -> bool { + **self == PACKAGE_A::QF + } + #[doc = "Checks if the value of the field is `CH`"] + #[inline(always)] + pub fn is_ch(&self) -> bool { + **self == PACKAGE_A::CH + } + #[doc = "Checks if the value of the field is `CI`"] + #[inline(always)] + pub fn is_ci(&self) -> bool { + **self == PACKAGE_A::CI + } + #[doc = "Checks if the value of the field is `CK`"] + #[inline(always)] + pub fn is_ck(&self) -> bool { + **self == PACKAGE_A::CK + } + #[doc = "Checks if the value of the field is `UNSPECIFIED`"] + #[inline(always)] + pub fn is_unspecified(&self) -> bool { + **self == PACKAGE_A::UNSPECIFIED + } +} +impl core::ops::Deref for PACKAGE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:31 - Package option"] + #[inline(always)] + pub fn package(&self) -> PACKAGE_R { + PACKAGE_R::new((self.bits & 0xffff_ffff) as u32) + } +} +#[doc = "Package option\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 [package](index.html) module"] +pub struct PACKAGE_SPEC; +impl crate::RegisterSpec for PACKAGE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [package::R](R) reader structure"] +impl crate::Readable for PACKAGE_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PACKAGE to value 0x2000"] +impl crate::Resettable for PACKAGE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x2000 + } +} diff --git a/src/ficr/info/part.rs b/src/ficr/info/part.rs new file mode 100644 index 0000000..569e49f --- /dev/null +++ b/src/ficr/info/part.rs @@ -0,0 +1,86 @@ +#[doc = "Register `PART` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Part code\n\nValue on reset: 337970"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u32)] +pub enum PART_A { + #[doc = "337970: nRF52832"] + N52832 = 337970, + #[doc = "4294967295: Unspecified"] + UNSPECIFIED = 4294967295, +} +impl From for u32 { + #[inline(always)] + fn from(variant: PART_A) -> Self { + variant as _ + } +} +#[doc = "Field `PART` reader - Part code"] +pub struct PART_R(crate::FieldReader); +impl PART_R { + pub(crate) fn new(bits: u32) -> Self { + PART_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 337970 => Some(PART_A::N52832), + 4294967295 => Some(PART_A::UNSPECIFIED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `N52832`"] + #[inline(always)] + pub fn is_n52832(&self) -> bool { + **self == PART_A::N52832 + } + #[doc = "Checks if the value of the field is `UNSPECIFIED`"] + #[inline(always)] + pub fn is_unspecified(&self) -> bool { + **self == PART_A::UNSPECIFIED + } +} +impl core::ops::Deref for PART_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:31 - Part code"] + #[inline(always)] + pub fn part(&self) -> PART_R { + PART_R::new((self.bits & 0xffff_ffff) as u32) + } +} +#[doc = "Part code\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 [part](index.html) module"] +pub struct PART_SPEC; +impl crate::RegisterSpec for PART_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [part::R](R) reader structure"] +impl crate::Readable for PART_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets PART to value 0x0005_2832"] +impl crate::Resettable for PART_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0005_2832 + } +} diff --git a/src/ficr/info/ram.rs b/src/ficr/info/ram.rs new file mode 100644 index 0000000..7a0a7a0 --- /dev/null +++ b/src/ficr/info/ram.rs @@ -0,0 +1,102 @@ +#[doc = "Register `RAM` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "RAM variant\n\nValue on reset: 64"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u32)] +pub enum RAM_A { + #[doc = "16: 16 kByte RAM"] + K16 = 16, + #[doc = "32: 32 kByte RAM"] + K32 = 32, + #[doc = "64: 64 kByte RAM"] + K64 = 64, + #[doc = "4294967295: Unspecified"] + UNSPECIFIED = 4294967295, +} +impl From for u32 { + #[inline(always)] + fn from(variant: RAM_A) -> Self { + variant as _ + } +} +#[doc = "Field `RAM` reader - RAM variant"] +pub struct RAM_R(crate::FieldReader); +impl RAM_R { + pub(crate) fn new(bits: u32) -> Self { + RAM_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 16 => Some(RAM_A::K16), + 32 => Some(RAM_A::K32), + 64 => Some(RAM_A::K64), + 4294967295 => Some(RAM_A::UNSPECIFIED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `K16`"] + #[inline(always)] + pub fn is_k16(&self) -> bool { + **self == RAM_A::K16 + } + #[doc = "Checks if the value of the field is `K32`"] + #[inline(always)] + pub fn is_k32(&self) -> bool { + **self == RAM_A::K32 + } + #[doc = "Checks if the value of the field is `K64`"] + #[inline(always)] + pub fn is_k64(&self) -> bool { + **self == RAM_A::K64 + } + #[doc = "Checks if the value of the field is `UNSPECIFIED`"] + #[inline(always)] + pub fn is_unspecified(&self) -> bool { + **self == RAM_A::UNSPECIFIED + } +} +impl core::ops::Deref for RAM_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:31 - RAM variant"] + #[inline(always)] + pub fn ram(&self) -> RAM_R { + RAM_R::new((self.bits & 0xffff_ffff) as u32) + } +} +#[doc = "RAM variant\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 [ram](index.html) module"] +pub struct RAM_SPEC; +impl crate::RegisterSpec for RAM_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ram::R](R) reader structure"] +impl crate::Readable for RAM_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets RAM to value 0x40"] +impl crate::Resettable for RAM_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x40 + } +} diff --git a/src/ficr/info/unused0.rs b/src/ficr/info/unused0.rs new file mode 100644 index 0000000..3364b73 --- /dev/null +++ b/src/ficr/info/unused0.rs @@ -0,0 +1,65 @@ +#[doc = "Register `UNUSED0[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `UNUSED0[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description collection\\[0\\]: Unspecified\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [unused0](index.html) module"] +pub struct UNUSED0_SPEC; +impl crate::RegisterSpec for UNUSED0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [unused0::R](R) reader structure"] +impl crate::Readable for UNUSED0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [unused0::W](W) writer structure"] +impl crate::Writable for UNUSED0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets UNUSED0[%s] +to value 0"] +impl crate::Resettable for UNUSED0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ficr/info/variant.rs b/src/ficr/info/variant.rs new file mode 100644 index 0000000..f7b1e9f --- /dev/null +++ b/src/ficr/info/variant.rs @@ -0,0 +1,126 @@ +#[doc = "Register `VARIANT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Part Variant, Hardware version and Production configuration, encoded as ASCII\n\nValue on reset: 1094795586"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u32)] +pub enum VARIANT_A { + #[doc = "1094795585: AAAA"] + AAAA = 1094795585, + #[doc = "1094795586: AAAB"] + AAAB = 1094795586, + #[doc = "1094795841: AABA"] + AABA = 1094795841, + #[doc = "1094795842: AABB"] + AABB = 1094795842, + #[doc = "1094795824: AAB0"] + AAB0 = 1094795824, + #[doc = "1094796592: AAE0"] + AAE0 = 1094796592, + #[doc = "4294967295: Unspecified"] + UNSPECIFIED = 4294967295, +} +impl From for u32 { + #[inline(always)] + fn from(variant: VARIANT_A) -> Self { + variant as _ + } +} +#[doc = "Field `VARIANT` reader - Part Variant, Hardware version and Production configuration, encoded as ASCII"] +pub struct VARIANT_R(crate::FieldReader); +impl VARIANT_R { + pub(crate) fn new(bits: u32) -> Self { + VARIANT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 1094795585 => Some(VARIANT_A::AAAA), + 1094795586 => Some(VARIANT_A::AAAB), + 1094795841 => Some(VARIANT_A::AABA), + 1094795842 => Some(VARIANT_A::AABB), + 1094795824 => Some(VARIANT_A::AAB0), + 1094796592 => Some(VARIANT_A::AAE0), + 4294967295 => Some(VARIANT_A::UNSPECIFIED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `AAAA`"] + #[inline(always)] + pub fn is_aaaa(&self) -> bool { + **self == VARIANT_A::AAAA + } + #[doc = "Checks if the value of the field is `AAAB`"] + #[inline(always)] + pub fn is_aaab(&self) -> bool { + **self == VARIANT_A::AAAB + } + #[doc = "Checks if the value of the field is `AABA`"] + #[inline(always)] + pub fn is_aaba(&self) -> bool { + **self == VARIANT_A::AABA + } + #[doc = "Checks if the value of the field is `AABB`"] + #[inline(always)] + pub fn is_aabb(&self) -> bool { + **self == VARIANT_A::AABB + } + #[doc = "Checks if the value of the field is `AAB0`"] + #[inline(always)] + pub fn is_aab0(&self) -> bool { + **self == VARIANT_A::AAB0 + } + #[doc = "Checks if the value of the field is `AAE0`"] + #[inline(always)] + pub fn is_aae0(&self) -> bool { + **self == VARIANT_A::AAE0 + } + #[doc = "Checks if the value of the field is `UNSPECIFIED`"] + #[inline(always)] + pub fn is_unspecified(&self) -> bool { + **self == VARIANT_A::UNSPECIFIED + } +} +impl core::ops::Deref for VARIANT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:31 - Part Variant, Hardware version and Production configuration, encoded as ASCII"] + #[inline(always)] + pub fn variant(&self) -> VARIANT_R { + VARIANT_R::new((self.bits & 0xffff_ffff) as u32) + } +} +#[doc = "Part Variant, Hardware version and Production configuration\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 [variant](index.html) module"] +pub struct VARIANT_SPEC; +impl crate::RegisterSpec for VARIANT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [variant::R](R) reader structure"] +impl crate::Readable for VARIANT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets VARIANT to value 0x4141_4142"] +impl crate::Resettable for VARIANT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x4141_4142 + } +} diff --git a/src/ficr/ir.rs b/src/ficr/ir.rs new file mode 100644 index 0000000..8710cdd --- /dev/null +++ b/src/ficr/ir.rs @@ -0,0 +1,53 @@ +#[doc = "Register `IR[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `IR` reader - Identity Root, word n"] +pub struct IR_R(crate::FieldReader); +impl IR_R { + pub(crate) fn new(bits: u32) -> Self { + IR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for IR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:31 - Identity Root, word n"] + #[inline(always)] + pub fn ir(&self) -> IR_R { + IR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +#[doc = "Description collection\\[0\\]: Identity Root, word 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 [ir](index.html) module"] +pub struct IR_SPEC; +impl crate::RegisterSpec for IR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ir::R](R) reader structure"] +impl crate::Readable for IR_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets IR[%s] +to value 0xffff_ffff"] +impl crate::Resettable for IR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/ficr/nfc.rs b/src/ficr/nfc.rs new file mode 100644 index 0000000..a3c0513 --- /dev/null +++ b/src/ficr/nfc.rs @@ -0,0 +1,16 @@ +#[doc = "TAGHEADER0 register accessor: an alias for `Reg`"] +pub type TAGHEADER0 = crate::Reg; +#[doc = "Default header for NFC Tag. Software can read these values to populate NFCID1_3RD_LAST, NFCID1_2ND_LAST and NFCID1_LAST."] +pub mod tagheader0; +#[doc = "TAGHEADER1 register accessor: an alias for `Reg`"] +pub type TAGHEADER1 = crate::Reg; +#[doc = "Default header for NFC Tag. Software can read these values to populate NFCID1_3RD_LAST, NFCID1_2ND_LAST and NFCID1_LAST."] +pub mod tagheader1; +#[doc = "TAGHEADER2 register accessor: an alias for `Reg`"] +pub type TAGHEADER2 = crate::Reg; +#[doc = "Default header for NFC Tag. Software can read these values to populate NFCID1_3RD_LAST, NFCID1_2ND_LAST and NFCID1_LAST."] +pub mod tagheader2; +#[doc = "TAGHEADER3 register accessor: an alias for `Reg`"] +pub type TAGHEADER3 = crate::Reg; +#[doc = "Default header for NFC Tag. Software can read these values to populate NFCID1_3RD_LAST, NFCID1_2ND_LAST and NFCID1_LAST."] +pub mod tagheader3; diff --git a/src/ficr/nfc/tagheader0.rs b/src/ficr/nfc/tagheader0.rs new file mode 100644 index 0000000..9c398b1 --- /dev/null +++ b/src/ficr/nfc/tagheader0.rs @@ -0,0 +1,109 @@ +#[doc = "Register `TAGHEADER0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `MFGID` reader - Default Manufacturer ID: Nordic Semiconductor ASA has ICM 0x5F"] +pub struct MFGID_R(crate::FieldReader); +impl MFGID_R { + pub(crate) fn new(bits: u8) -> Self { + MFGID_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MFGID_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `UD1` reader - Unique identifier byte 1"] +pub struct UD1_R(crate::FieldReader); +impl UD1_R { + pub(crate) fn new(bits: u8) -> Self { + UD1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for UD1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `UD2` reader - Unique identifier byte 2"] +pub struct UD2_R(crate::FieldReader); +impl UD2_R { + pub(crate) fn new(bits: u8) -> Self { + UD2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for UD2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `UD3` reader - Unique identifier byte 3"] +pub struct UD3_R(crate::FieldReader); +impl UD3_R { + pub(crate) fn new(bits: u8) -> Self { + UD3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for UD3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:7 - Default Manufacturer ID: Nordic Semiconductor ASA has ICM 0x5F"] + #[inline(always)] + pub fn mfgid(&self) -> MFGID_R { + MFGID_R::new((self.bits & 0xff) as u8) + } + #[doc = "Bits 8:15 - Unique identifier byte 1"] + #[inline(always)] + pub fn ud1(&self) -> UD1_R { + UD1_R::new(((self.bits >> 8) & 0xff) as u8) + } + #[doc = "Bits 16:23 - Unique identifier byte 2"] + #[inline(always)] + pub fn ud2(&self) -> UD2_R { + UD2_R::new(((self.bits >> 16) & 0xff) as u8) + } + #[doc = "Bits 24:31 - Unique identifier byte 3"] + #[inline(always)] + pub fn ud3(&self) -> UD3_R { + UD3_R::new(((self.bits >> 24) & 0xff) as u8) + } +} +#[doc = "Default header for NFC Tag. Software can read these values to populate NFCID1_3RD_LAST, NFCID1_2ND_LAST and NFCID1_LAST.\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 [tagheader0](index.html) module"] +pub struct TAGHEADER0_SPEC; +impl crate::RegisterSpec for TAGHEADER0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [tagheader0::R](R) reader structure"] +impl crate::Readable for TAGHEADER0_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets TAGHEADER0 to value 0xffff_ff5f"] +impl crate::Resettable for TAGHEADER0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ff5f + } +} diff --git a/src/ficr/nfc/tagheader1.rs b/src/ficr/nfc/tagheader1.rs new file mode 100644 index 0000000..e333efd --- /dev/null +++ b/src/ficr/nfc/tagheader1.rs @@ -0,0 +1,109 @@ +#[doc = "Register `TAGHEADER1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `UD4` reader - Unique identifier byte 4"] +pub struct UD4_R(crate::FieldReader); +impl UD4_R { + pub(crate) fn new(bits: u8) -> Self { + UD4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for UD4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `UD5` reader - Unique identifier byte 5"] +pub struct UD5_R(crate::FieldReader); +impl UD5_R { + pub(crate) fn new(bits: u8) -> Self { + UD5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for UD5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `UD6` reader - Unique identifier byte 6"] +pub struct UD6_R(crate::FieldReader); +impl UD6_R { + pub(crate) fn new(bits: u8) -> Self { + UD6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for UD6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `UD7` reader - Unique identifier byte 7"] +pub struct UD7_R(crate::FieldReader); +impl UD7_R { + pub(crate) fn new(bits: u8) -> Self { + UD7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for UD7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:7 - Unique identifier byte 4"] + #[inline(always)] + pub fn ud4(&self) -> UD4_R { + UD4_R::new((self.bits & 0xff) as u8) + } + #[doc = "Bits 8:15 - Unique identifier byte 5"] + #[inline(always)] + pub fn ud5(&self) -> UD5_R { + UD5_R::new(((self.bits >> 8) & 0xff) as u8) + } + #[doc = "Bits 16:23 - Unique identifier byte 6"] + #[inline(always)] + pub fn ud6(&self) -> UD6_R { + UD6_R::new(((self.bits >> 16) & 0xff) as u8) + } + #[doc = "Bits 24:31 - Unique identifier byte 7"] + #[inline(always)] + pub fn ud7(&self) -> UD7_R { + UD7_R::new(((self.bits >> 24) & 0xff) as u8) + } +} +#[doc = "Default header for NFC Tag. Software can read these values to populate NFCID1_3RD_LAST, NFCID1_2ND_LAST and NFCID1_LAST.\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 [tagheader1](index.html) module"] +pub struct TAGHEADER1_SPEC; +impl crate::RegisterSpec for TAGHEADER1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [tagheader1::R](R) reader structure"] +impl crate::Readable for TAGHEADER1_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets TAGHEADER1 to value 0xffff_ffff"] +impl crate::Resettable for TAGHEADER1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/ficr/nfc/tagheader2.rs b/src/ficr/nfc/tagheader2.rs new file mode 100644 index 0000000..653a1b7 --- /dev/null +++ b/src/ficr/nfc/tagheader2.rs @@ -0,0 +1,109 @@ +#[doc = "Register `TAGHEADER2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `UD8` reader - Unique identifier byte 8"] +pub struct UD8_R(crate::FieldReader); +impl UD8_R { + pub(crate) fn new(bits: u8) -> Self { + UD8_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for UD8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `UD9` reader - Unique identifier byte 9"] +pub struct UD9_R(crate::FieldReader); +impl UD9_R { + pub(crate) fn new(bits: u8) -> Self { + UD9_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for UD9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `UD10` reader - Unique identifier byte 10"] +pub struct UD10_R(crate::FieldReader); +impl UD10_R { + pub(crate) fn new(bits: u8) -> Self { + UD10_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for UD10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `UD11` reader - Unique identifier byte 11"] +pub struct UD11_R(crate::FieldReader); +impl UD11_R { + pub(crate) fn new(bits: u8) -> Self { + UD11_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for UD11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:7 - Unique identifier byte 8"] + #[inline(always)] + pub fn ud8(&self) -> UD8_R { + UD8_R::new((self.bits & 0xff) as u8) + } + #[doc = "Bits 8:15 - Unique identifier byte 9"] + #[inline(always)] + pub fn ud9(&self) -> UD9_R { + UD9_R::new(((self.bits >> 8) & 0xff) as u8) + } + #[doc = "Bits 16:23 - Unique identifier byte 10"] + #[inline(always)] + pub fn ud10(&self) -> UD10_R { + UD10_R::new(((self.bits >> 16) & 0xff) as u8) + } + #[doc = "Bits 24:31 - Unique identifier byte 11"] + #[inline(always)] + pub fn ud11(&self) -> UD11_R { + UD11_R::new(((self.bits >> 24) & 0xff) as u8) + } +} +#[doc = "Default header for NFC Tag. Software can read these values to populate NFCID1_3RD_LAST, NFCID1_2ND_LAST and NFCID1_LAST.\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 [tagheader2](index.html) module"] +pub struct TAGHEADER2_SPEC; +impl crate::RegisterSpec for TAGHEADER2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [tagheader2::R](R) reader structure"] +impl crate::Readable for TAGHEADER2_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets TAGHEADER2 to value 0xffff_ffff"] +impl crate::Resettable for TAGHEADER2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/ficr/nfc/tagheader3.rs b/src/ficr/nfc/tagheader3.rs new file mode 100644 index 0000000..dd43fed --- /dev/null +++ b/src/ficr/nfc/tagheader3.rs @@ -0,0 +1,109 @@ +#[doc = "Register `TAGHEADER3` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `UD12` reader - Unique identifier byte 12"] +pub struct UD12_R(crate::FieldReader); +impl UD12_R { + pub(crate) fn new(bits: u8) -> Self { + UD12_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for UD12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `UD13` reader - Unique identifier byte 13"] +pub struct UD13_R(crate::FieldReader); +impl UD13_R { + pub(crate) fn new(bits: u8) -> Self { + UD13_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for UD13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `UD14` reader - Unique identifier byte 14"] +pub struct UD14_R(crate::FieldReader); +impl UD14_R { + pub(crate) fn new(bits: u8) -> Self { + UD14_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for UD14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `UD15` reader - Unique identifier byte 15"] +pub struct UD15_R(crate::FieldReader); +impl UD15_R { + pub(crate) fn new(bits: u8) -> Self { + UD15_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for UD15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:7 - Unique identifier byte 12"] + #[inline(always)] + pub fn ud12(&self) -> UD12_R { + UD12_R::new((self.bits & 0xff) as u8) + } + #[doc = "Bits 8:15 - Unique identifier byte 13"] + #[inline(always)] + pub fn ud13(&self) -> UD13_R { + UD13_R::new(((self.bits >> 8) & 0xff) as u8) + } + #[doc = "Bits 16:23 - Unique identifier byte 14"] + #[inline(always)] + pub fn ud14(&self) -> UD14_R { + UD14_R::new(((self.bits >> 16) & 0xff) as u8) + } + #[doc = "Bits 24:31 - Unique identifier byte 15"] + #[inline(always)] + pub fn ud15(&self) -> UD15_R { + UD15_R::new(((self.bits >> 24) & 0xff) as u8) + } +} +#[doc = "Default header for NFC Tag. Software can read these values to populate NFCID1_3RD_LAST, NFCID1_2ND_LAST and NFCID1_LAST.\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 [tagheader3](index.html) module"] +pub struct TAGHEADER3_SPEC; +impl crate::RegisterSpec for TAGHEADER3_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [tagheader3::R](R) reader structure"] +impl crate::Readable for TAGHEADER3_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets TAGHEADER3 to value 0xffff_ffff"] +impl crate::Resettable for TAGHEADER3_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/ficr/temp.rs b/src/ficr/temp.rs new file mode 100644 index 0000000..58bfac2 --- /dev/null +++ b/src/ficr/temp.rs @@ -0,0 +1,68 @@ +#[doc = "A0 register accessor: an alias for `Reg`"] +pub type A0 = crate::Reg; +#[doc = "Slope definition A0."] +pub mod a0; +#[doc = "A1 register accessor: an alias for `Reg`"] +pub type A1 = crate::Reg; +#[doc = "Slope definition A1."] +pub mod a1; +#[doc = "A2 register accessor: an alias for `Reg`"] +pub type A2 = crate::Reg; +#[doc = "Slope definition A2."] +pub mod a2; +#[doc = "A3 register accessor: an alias for `Reg`"] +pub type A3 = crate::Reg; +#[doc = "Slope definition A3."] +pub mod a3; +#[doc = "A4 register accessor: an alias for `Reg`"] +pub type A4 = crate::Reg; +#[doc = "Slope definition A4."] +pub mod a4; +#[doc = "A5 register accessor: an alias for `Reg`"] +pub type A5 = crate::Reg; +#[doc = "Slope definition A5."] +pub mod a5; +#[doc = "B0 register accessor: an alias for `Reg`"] +pub type B0 = crate::Reg; +#[doc = "y-intercept B0."] +pub mod b0; +#[doc = "B1 register accessor: an alias for `Reg`"] +pub type B1 = crate::Reg; +#[doc = "y-intercept B1."] +pub mod b1; +#[doc = "B2 register accessor: an alias for `Reg`"] +pub type B2 = crate::Reg; +#[doc = "y-intercept B2."] +pub mod b2; +#[doc = "B3 register accessor: an alias for `Reg`"] +pub type B3 = crate::Reg; +#[doc = "y-intercept B3."] +pub mod b3; +#[doc = "B4 register accessor: an alias for `Reg`"] +pub type B4 = crate::Reg; +#[doc = "y-intercept B4."] +pub mod b4; +#[doc = "B5 register accessor: an alias for `Reg`"] +pub type B5 = crate::Reg; +#[doc = "y-intercept B5."] +pub mod b5; +#[doc = "T0 register accessor: an alias for `Reg`"] +pub type T0 = crate::Reg; +#[doc = "Segment end T0."] +pub mod t0; +#[doc = "T1 register accessor: an alias for `Reg`"] +pub type T1 = crate::Reg; +#[doc = "Segment end T1."] +pub mod t1; +#[doc = "T2 register accessor: an alias for `Reg`"] +pub type T2 = crate::Reg; +#[doc = "Segment end T2."] +pub mod t2; +#[doc = "T3 register accessor: an alias for `Reg`"] +pub type T3 = crate::Reg; +#[doc = "Segment end T3."] +pub mod t3; +#[doc = "T4 register accessor: an alias for `Reg`"] +pub type T4 = crate::Reg; +#[doc = "Segment end T4."] +pub mod t4; diff --git a/src/ficr/temp/a0.rs b/src/ficr/temp/a0.rs new file mode 100644 index 0000000..bc7fcf4 --- /dev/null +++ b/src/ficr/temp/a0.rs @@ -0,0 +1,52 @@ +#[doc = "Register `A0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `A` reader - A (slope definition) register."] +pub struct A_R(crate::FieldReader); +impl A_R { + pub(crate) fn new(bits: u16) -> Self { + A_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for A_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:11 - A (slope definition) register."] + #[inline(always)] + pub fn a(&self) -> A_R { + A_R::new((self.bits & 0x0fff) as u16) + } +} +#[doc = "Slope definition A0.\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 [a0](index.html) module"] +pub struct A0_SPEC; +impl crate::RegisterSpec for A0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [a0::R](R) reader structure"] +impl crate::Readable for A0_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets A0 to value 0x0320"] +impl crate::Resettable for A0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0320 + } +} diff --git a/src/ficr/temp/a1.rs b/src/ficr/temp/a1.rs new file mode 100644 index 0000000..d7b6d6b --- /dev/null +++ b/src/ficr/temp/a1.rs @@ -0,0 +1,52 @@ +#[doc = "Register `A1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `A` reader - A (slope definition) register."] +pub struct A_R(crate::FieldReader); +impl A_R { + pub(crate) fn new(bits: u16) -> Self { + A_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for A_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:11 - A (slope definition) register."] + #[inline(always)] + pub fn a(&self) -> A_R { + A_R::new((self.bits & 0x0fff) as u16) + } +} +#[doc = "Slope definition A1.\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 [a1](index.html) module"] +pub struct A1_SPEC; +impl crate::RegisterSpec for A1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [a1::R](R) reader structure"] +impl crate::Readable for A1_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets A1 to value 0x0343"] +impl crate::Resettable for A1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0343 + } +} diff --git a/src/ficr/temp/a2.rs b/src/ficr/temp/a2.rs new file mode 100644 index 0000000..37ac63c --- /dev/null +++ b/src/ficr/temp/a2.rs @@ -0,0 +1,52 @@ +#[doc = "Register `A2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `A` reader - A (slope definition) register."] +pub struct A_R(crate::FieldReader); +impl A_R { + pub(crate) fn new(bits: u16) -> Self { + A_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for A_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:11 - A (slope definition) register."] + #[inline(always)] + pub fn a(&self) -> A_R { + A_R::new((self.bits & 0x0fff) as u16) + } +} +#[doc = "Slope definition A2.\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 [a2](index.html) module"] +pub struct A2_SPEC; +impl crate::RegisterSpec for A2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [a2::R](R) reader structure"] +impl crate::Readable for A2_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets A2 to value 0x035d"] +impl crate::Resettable for A2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x035d + } +} diff --git a/src/ficr/temp/a3.rs b/src/ficr/temp/a3.rs new file mode 100644 index 0000000..8e25e38 --- /dev/null +++ b/src/ficr/temp/a3.rs @@ -0,0 +1,52 @@ +#[doc = "Register `A3` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `A` reader - A (slope definition) register."] +pub struct A_R(crate::FieldReader); +impl A_R { + pub(crate) fn new(bits: u16) -> Self { + A_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for A_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:11 - A (slope definition) register."] + #[inline(always)] + pub fn a(&self) -> A_R { + A_R::new((self.bits & 0x0fff) as u16) + } +} +#[doc = "Slope definition A3.\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 [a3](index.html) module"] +pub struct A3_SPEC; +impl crate::RegisterSpec for A3_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [a3::R](R) reader structure"] +impl crate::Readable for A3_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets A3 to value 0x0400"] +impl crate::Resettable for A3_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0400 + } +} diff --git a/src/ficr/temp/a4.rs b/src/ficr/temp/a4.rs new file mode 100644 index 0000000..cfeff8c --- /dev/null +++ b/src/ficr/temp/a4.rs @@ -0,0 +1,52 @@ +#[doc = "Register `A4` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `A` reader - A (slope definition) register."] +pub struct A_R(crate::FieldReader); +impl A_R { + pub(crate) fn new(bits: u16) -> Self { + A_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for A_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:11 - A (slope definition) register."] + #[inline(always)] + pub fn a(&self) -> A_R { + A_R::new((self.bits & 0x0fff) as u16) + } +} +#[doc = "Slope definition A4.\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 [a4](index.html) module"] +pub struct A4_SPEC; +impl crate::RegisterSpec for A4_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [a4::R](R) reader structure"] +impl crate::Readable for A4_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets A4 to value 0x0452"] +impl crate::Resettable for A4_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0452 + } +} diff --git a/src/ficr/temp/a5.rs b/src/ficr/temp/a5.rs new file mode 100644 index 0000000..8c1a754 --- /dev/null +++ b/src/ficr/temp/a5.rs @@ -0,0 +1,52 @@ +#[doc = "Register `A5` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `A` reader - A (slope definition) register."] +pub struct A_R(crate::FieldReader); +impl A_R { + pub(crate) fn new(bits: u16) -> Self { + A_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for A_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:11 - A (slope definition) register."] + #[inline(always)] + pub fn a(&self) -> A_R { + A_R::new((self.bits & 0x0fff) as u16) + } +} +#[doc = "Slope definition A5.\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 [a5](index.html) module"] +pub struct A5_SPEC; +impl crate::RegisterSpec for A5_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [a5::R](R) reader structure"] +impl crate::Readable for A5_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets A5 to value 0x037b"] +impl crate::Resettable for A5_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x037b + } +} diff --git a/src/ficr/temp/b0.rs b/src/ficr/temp/b0.rs new file mode 100644 index 0000000..3c32e5b --- /dev/null +++ b/src/ficr/temp/b0.rs @@ -0,0 +1,52 @@ +#[doc = "Register `B0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `B` reader - B (y-intercept)"] +pub struct B_R(crate::FieldReader); +impl B_R { + pub(crate) fn new(bits: u16) -> Self { + B_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for B_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:13 - B (y-intercept)"] + #[inline(always)] + pub fn b(&self) -> B_R { + B_R::new((self.bits & 0x3fff) as u16) + } +} +#[doc = "y-intercept B0.\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 [b0](index.html) module"] +pub struct B0_SPEC; +impl crate::RegisterSpec for B0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [b0::R](R) reader structure"] +impl crate::Readable for B0_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets B0 to value 0x3fcc"] +impl crate::Resettable for B0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x3fcc + } +} diff --git a/src/ficr/temp/b1.rs b/src/ficr/temp/b1.rs new file mode 100644 index 0000000..cf3fea2 --- /dev/null +++ b/src/ficr/temp/b1.rs @@ -0,0 +1,52 @@ +#[doc = "Register `B1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `B` reader - B (y-intercept)"] +pub struct B_R(crate::FieldReader); +impl B_R { + pub(crate) fn new(bits: u16) -> Self { + B_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for B_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:13 - B (y-intercept)"] + #[inline(always)] + pub fn b(&self) -> B_R { + B_R::new((self.bits & 0x3fff) as u16) + } +} +#[doc = "y-intercept B1.\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 [b1](index.html) module"] +pub struct B1_SPEC; +impl crate::RegisterSpec for B1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [b1::R](R) reader structure"] +impl crate::Readable for B1_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets B1 to value 0x3f98"] +impl crate::Resettable for B1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x3f98 + } +} diff --git a/src/ficr/temp/b2.rs b/src/ficr/temp/b2.rs new file mode 100644 index 0000000..ac517f0 --- /dev/null +++ b/src/ficr/temp/b2.rs @@ -0,0 +1,52 @@ +#[doc = "Register `B2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `B` reader - B (y-intercept)"] +pub struct B_R(crate::FieldReader); +impl B_R { + pub(crate) fn new(bits: u16) -> Self { + B_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for B_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:13 - B (y-intercept)"] + #[inline(always)] + pub fn b(&self) -> B_R { + B_R::new((self.bits & 0x3fff) as u16) + } +} +#[doc = "y-intercept B2.\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 [b2](index.html) module"] +pub struct B2_SPEC; +impl crate::RegisterSpec for B2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [b2::R](R) reader structure"] +impl crate::Readable for B2_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets B2 to value 0x3f98"] +impl crate::Resettable for B2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x3f98 + } +} diff --git a/src/ficr/temp/b3.rs b/src/ficr/temp/b3.rs new file mode 100644 index 0000000..eb2dfc9 --- /dev/null +++ b/src/ficr/temp/b3.rs @@ -0,0 +1,52 @@ +#[doc = "Register `B3` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `B` reader - B (y-intercept)"] +pub struct B_R(crate::FieldReader); +impl B_R { + pub(crate) fn new(bits: u16) -> Self { + B_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for B_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:13 - B (y-intercept)"] + #[inline(always)] + pub fn b(&self) -> B_R { + B_R::new((self.bits & 0x3fff) as u16) + } +} +#[doc = "y-intercept B3.\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 [b3](index.html) module"] +pub struct B3_SPEC; +impl crate::RegisterSpec for B3_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [b3::R](R) reader structure"] +impl crate::Readable for B3_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets B3 to value 0x12"] +impl crate::Resettable for B3_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x12 + } +} diff --git a/src/ficr/temp/b4.rs b/src/ficr/temp/b4.rs new file mode 100644 index 0000000..dfaa3cd --- /dev/null +++ b/src/ficr/temp/b4.rs @@ -0,0 +1,52 @@ +#[doc = "Register `B4` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `B` reader - B (y-intercept)"] +pub struct B_R(crate::FieldReader); +impl B_R { + pub(crate) fn new(bits: u16) -> Self { + B_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for B_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:13 - B (y-intercept)"] + #[inline(always)] + pub fn b(&self) -> B_R { + B_R::new((self.bits & 0x3fff) as u16) + } +} +#[doc = "y-intercept B4.\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 [b4](index.html) module"] +pub struct B4_SPEC; +impl crate::RegisterSpec for B4_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [b4::R](R) reader structure"] +impl crate::Readable for B4_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets B4 to value 0x4d"] +impl crate::Resettable for B4_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x4d + } +} diff --git a/src/ficr/temp/b5.rs b/src/ficr/temp/b5.rs new file mode 100644 index 0000000..ea19497 --- /dev/null +++ b/src/ficr/temp/b5.rs @@ -0,0 +1,52 @@ +#[doc = "Register `B5` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `B` reader - B (y-intercept)"] +pub struct B_R(crate::FieldReader); +impl B_R { + pub(crate) fn new(bits: u16) -> Self { + B_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for B_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:13 - B (y-intercept)"] + #[inline(always)] + pub fn b(&self) -> B_R { + B_R::new((self.bits & 0x3fff) as u16) + } +} +#[doc = "y-intercept B5.\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 [b5](index.html) module"] +pub struct B5_SPEC; +impl crate::RegisterSpec for B5_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [b5::R](R) reader structure"] +impl crate::Readable for B5_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets B5 to value 0x3e10"] +impl crate::Resettable for B5_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x3e10 + } +} diff --git a/src/ficr/temp/t0.rs b/src/ficr/temp/t0.rs new file mode 100644 index 0000000..98497d5 --- /dev/null +++ b/src/ficr/temp/t0.rs @@ -0,0 +1,52 @@ +#[doc = "Register `T0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `T` reader - T (segment end)register."] +pub struct T_R(crate::FieldReader); +impl T_R { + pub(crate) fn new(bits: u8) -> Self { + T_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for T_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:7 - T (segment end)register."] + #[inline(always)] + pub fn t(&self) -> T_R { + T_R::new((self.bits & 0xff) as u8) + } +} +#[doc = "Segment end T0.\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 [t0](index.html) module"] +pub struct T0_SPEC; +impl crate::RegisterSpec for T0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [t0::R](R) reader structure"] +impl crate::Readable for T0_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets T0 to value 0xe2"] +impl crate::Resettable for T0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xe2 + } +} diff --git a/src/ficr/temp/t1.rs b/src/ficr/temp/t1.rs new file mode 100644 index 0000000..53838cb --- /dev/null +++ b/src/ficr/temp/t1.rs @@ -0,0 +1,52 @@ +#[doc = "Register `T1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `T` reader - T (segment end)register."] +pub struct T_R(crate::FieldReader); +impl T_R { + pub(crate) fn new(bits: u8) -> Self { + T_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for T_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:7 - T (segment end)register."] + #[inline(always)] + pub fn t(&self) -> T_R { + T_R::new((self.bits & 0xff) as u8) + } +} +#[doc = "Segment end T1.\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 [t1](index.html) module"] +pub struct T1_SPEC; +impl crate::RegisterSpec for T1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [t1::R](R) reader structure"] +impl crate::Readable for T1_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets T1 to value 0"] +impl crate::Resettable for T1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ficr/temp/t2.rs b/src/ficr/temp/t2.rs new file mode 100644 index 0000000..a28ac79 --- /dev/null +++ b/src/ficr/temp/t2.rs @@ -0,0 +1,52 @@ +#[doc = "Register `T2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `T` reader - T (segment end)register."] +pub struct T_R(crate::FieldReader); +impl T_R { + pub(crate) fn new(bits: u8) -> Self { + T_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for T_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:7 - T (segment end)register."] + #[inline(always)] + pub fn t(&self) -> T_R { + T_R::new((self.bits & 0xff) as u8) + } +} +#[doc = "Segment end T2.\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 [t2](index.html) module"] +pub struct T2_SPEC; +impl crate::RegisterSpec for T2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [t2::R](R) reader structure"] +impl crate::Readable for T2_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets T2 to value 0x14"] +impl crate::Resettable for T2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x14 + } +} diff --git a/src/ficr/temp/t3.rs b/src/ficr/temp/t3.rs new file mode 100644 index 0000000..d66d955 --- /dev/null +++ b/src/ficr/temp/t3.rs @@ -0,0 +1,52 @@ +#[doc = "Register `T3` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `T` reader - T (segment end)register."] +pub struct T_R(crate::FieldReader); +impl T_R { + pub(crate) fn new(bits: u8) -> Self { + T_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for T_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:7 - T (segment end)register."] + #[inline(always)] + pub fn t(&self) -> T_R { + T_R::new((self.bits & 0xff) as u8) + } +} +#[doc = "Segment end T3.\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 [t3](index.html) module"] +pub struct T3_SPEC; +impl crate::RegisterSpec for T3_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [t3::R](R) reader structure"] +impl crate::Readable for T3_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets T3 to value 0x19"] +impl crate::Resettable for T3_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x19 + } +} diff --git a/src/ficr/temp/t4.rs b/src/ficr/temp/t4.rs new file mode 100644 index 0000000..fc94501 --- /dev/null +++ b/src/ficr/temp/t4.rs @@ -0,0 +1,52 @@ +#[doc = "Register `T4` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `T` reader - T (segment end)register."] +pub struct T_R(crate::FieldReader); +impl T_R { + pub(crate) fn new(bits: u8) -> Self { + T_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for T_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:7 - T (segment end)register."] + #[inline(always)] + pub fn t(&self) -> T_R { + T_R::new((self.bits & 0xff) as u8) + } +} +#[doc = "Segment end T4.\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 [t4](index.html) module"] +pub struct T4_SPEC; +impl crate::RegisterSpec for T4_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [t4::R](R) reader structure"] +impl crate::Readable for T4_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets T4 to value 0x50"] +impl crate::Resettable for T4_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x50 + } +} diff --git a/src/generic.rs b/src/generic.rs new file mode 100644 index 0000000..7615964 --- /dev/null +++ b/src/generic.rs @@ -0,0 +1,260 @@ +use core::marker; +#[doc = " Raw register type"] +pub trait RegisterSpec { + #[doc = " Raw register type (`u8`, `u16`, `u32`, ...)."] + type Ux: Copy; +} +#[doc = " Trait implemented by readable registers to enable the `read` method."] +#[doc = ""] +#[doc = " Registers marked with `Writable` can be also `modify`'ed."] +pub trait Readable: RegisterSpec { + #[doc = " Result from a call to `read` and argument to `modify`."] + type Reader: From> + core::ops::Deref>; +} +#[doc = " Trait implemented by writeable registers."] +#[doc = ""] +#[doc = " This enables the `write`, `write_with_zero` and `reset` methods."] +#[doc = ""] +#[doc = " Registers marked with `Readable` can be also `modify`'ed."] +pub trait Writable: RegisterSpec { + #[doc = " Writer type argument to `write`, et al."] + type Writer: From> + core::ops::DerefMut>; +} +#[doc = " Reset value of the register."] +#[doc = ""] +#[doc = " This value is the initial value for the `write` method. It can also be directly written to the"] +#[doc = " register by using the `reset` method."] +pub trait Resettable: RegisterSpec { + #[doc = " Reset value of the register."] + fn reset_value() -> Self::Ux; +} +#[doc = " This structure provides volatile access to registers."] +#[repr(transparent)] +pub struct Reg { + register: vcell::VolatileCell, + _marker: marker::PhantomData, +} +unsafe impl Send for Reg where REG::Ux: Send {} +impl Reg { + #[doc = " Returns the underlying memory address of register."] + #[doc = ""] + #[doc = " ```ignore"] + #[doc = " let reg_ptr = periph.reg.as_ptr();"] + #[doc = " ```"] + #[inline(always)] + pub fn as_ptr(&self) -> *mut REG::Ux { + self.register.as_ptr() + } +} +impl Reg { + #[doc = " Reads the contents of a `Readable` register."] + #[doc = ""] + #[doc = " You can read the raw contents of a register by using `bits`:"] + #[doc = " ```ignore"] + #[doc = " let bits = periph.reg.read().bits();"] + #[doc = " ```"] + #[doc = " or get the content of a particular field of a register:"] + #[doc = " ```ignore"] + #[doc = " let reader = periph.reg.read();"] + #[doc = " let bits = reader.field1().bits();"] + #[doc = " let flag = reader.field2().bit_is_set();"] + #[doc = " ```"] + #[inline(always)] + pub fn read(&self) -> REG::Reader { + REG::Reader::from(R { + bits: self.register.get(), + _reg: marker::PhantomData, + }) + } +} +impl Reg { + #[doc = " Writes the reset value to `Writable` register."] + #[doc = ""] + #[doc = " Resets the register to its initial state."] + #[inline(always)] + pub fn reset(&self) { + self.register.set(REG::reset_value()) + } + #[doc = " Writes bits to a `Writable` register."] + #[doc = ""] + #[doc = " You can write raw bits into a register:"] + #[doc = " ```ignore"] + #[doc = " periph.reg.write(|w| unsafe { w.bits(rawbits) });"] + #[doc = " ```"] + #[doc = " or write only the fields you need:"] + #[doc = " ```ignore"] + #[doc = " periph.reg.write(|w| w"] + #[doc = " .field1().bits(newfield1bits)"] + #[doc = " .field2().set_bit()"] + #[doc = " .field3().variant(VARIANT)"] + #[doc = " );"] + #[doc = " ```"] + #[doc = " In the latter case, other fields will be set to their reset value."] + #[inline(always)] + pub fn write(&self, f: F) + where + F: FnOnce(&mut REG::Writer) -> &mut W, + { + self.register.set( + f(&mut REG::Writer::from(W { + bits: REG::reset_value(), + _reg: marker::PhantomData, + })) + .bits, + ); + } +} +impl Reg +where + REG::Ux: Default, +{ + #[doc = " Writes 0 to a `Writable` register."] + #[doc = ""] + #[doc = " Similar to `write`, but unused bits will contain 0."] + #[inline(always)] + pub unsafe fn write_with_zero(&self, f: F) + where + F: FnOnce(&mut REG::Writer) -> &mut W, + { + self.register.set( + (*f(&mut REG::Writer::from(W { + bits: REG::Ux::default(), + _reg: marker::PhantomData, + }))) + .bits, + ); + } +} +impl Reg { + #[doc = " Modifies the contents of the register by reading and then writing it."] + #[doc = ""] + #[doc = " E.g. to do a read-modify-write sequence to change parts of a register:"] + #[doc = " ```ignore"] + #[doc = " periph.reg.modify(|r, w| unsafe { w.bits("] + #[doc = " r.bits() | 3"] + #[doc = " ) });"] + #[doc = " ```"] + #[doc = " or"] + #[doc = " ```ignore"] + #[doc = " periph.reg.modify(|_, w| w"] + #[doc = " .field1().bits(newfield1bits)"] + #[doc = " .field2().set_bit()"] + #[doc = " .field3().variant(VARIANT)"] + #[doc = " );"] + #[doc = " ```"] + #[doc = " Other fields will have the value they had before the call to `modify`."] + #[inline(always)] + pub fn modify(&self, f: F) + where + for<'w> F: FnOnce(®::Reader, &'w mut REG::Writer) -> &'w mut W, + { + let bits = self.register.get(); + self.register.set( + f( + ®::Reader::from(R { + bits, + _reg: marker::PhantomData, + }), + &mut REG::Writer::from(W { + bits, + _reg: marker::PhantomData, + }), + ) + .bits, + ); + } +} +#[doc = " Register reader."] +#[doc = ""] +#[doc = " Result of the `read` methods of registers. Also used as a closure argument in the `modify`"] +#[doc = " method."] +pub struct R { + pub(crate) bits: REG::Ux, + _reg: marker::PhantomData, +} +impl R { + #[doc = " Reads raw bits from register."] + #[inline(always)] + pub fn bits(&self) -> REG::Ux { + self.bits + } +} +impl PartialEq for R +where + REG::Ux: PartialEq, + FI: Copy + Into, +{ + #[inline(always)] + fn eq(&self, other: &FI) -> bool { + self.bits.eq(&(*other).into()) + } +} +#[doc = " Register writer."] +#[doc = ""] +#[doc = " Used as an argument to the closures in the `write` and `modify` methods of the register."] +pub struct W { + #[doc = "Writable bits"] + pub(crate) bits: REG::Ux, + _reg: marker::PhantomData, +} +impl W { + #[doc = " Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: REG::Ux) -> &mut Self { + self.bits = bits; + self + } +} +#[doc = " Field reader."] +#[doc = ""] +#[doc = " Result of the `read` methods of fields."] +pub struct FieldReader { + pub(crate) bits: U, + _reg: marker::PhantomData, +} +impl FieldReader +where + U: Copy, +{ + #[doc = " Creates a new instance of the reader."] + #[allow(unused)] + #[inline(always)] + pub(crate) fn new(bits: U) -> Self { + Self { + bits, + _reg: marker::PhantomData, + } + } + #[doc = " Reads raw bits from field."] + #[inline(always)] + pub fn bits(&self) -> U { + self.bits + } +} +impl PartialEq for FieldReader +where + U: PartialEq, + FI: Copy + Into, +{ + #[inline(always)] + fn eq(&self, other: &FI) -> bool { + self.bits.eq(&(*other).into()) + } +} +impl FieldReader { + #[doc = " Value of the field as raw bits."] + #[inline(always)] + pub fn bit(&self) -> bool { + self.bits + } + #[doc = " Returns `true` if the bit is clear (0)."] + #[inline(always)] + pub fn bit_is_clear(&self) -> bool { + !self.bit() + } + #[doc = " Returns `true` if the bit is set (1)."] + #[inline(always)] + pub fn bit_is_set(&self) -> bool { + self.bit() + } +} diff --git a/src/gpiote.rs b/src/gpiote.rs new file mode 100644 index 0000000..b4fdb1b --- /dev/null +++ b/src/gpiote.rs @@ -0,0 +1,64 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "0x00..0x20 - Description collection\\[0\\]: Task for writing to pin specified in CONFIG\\[0\\].PSEL. Action on pin is configured in CONFIG\\[0\\].POLARITY."] + pub tasks_out: [crate::Reg; 8], + _reserved1: [u8; 0x10], + #[doc = "0x30..0x50 - Description collection\\[0\\]: Task for writing to pin specified in CONFIG\\[0\\].PSEL. Action on pin is to set it high."] + pub tasks_set: [crate::Reg; 8], + _reserved2: [u8; 0x10], + #[doc = "0x60..0x80 - Description collection\\[0\\]: Task for writing to pin specified in CONFIG\\[0\\].PSEL. Action on pin is to set it low."] + pub tasks_clr: [crate::Reg; 8], + _reserved3: [u8; 0x80], + #[doc = "0x100..0x120 - Description collection\\[0\\]: Event generated from pin specified in CONFIG\\[0\\].PSEL"] + pub events_in: [crate::Reg; 8], + _reserved4: [u8; 0x5c], + #[doc = "0x17c - Event generated from multiple input GPIO pins with SENSE mechanism enabled"] + pub events_port: crate::Reg, + _reserved5: [u8; 0x0184], + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved7: [u8; 0x0204], + #[doc = "0x510..0x530 - Description collection\\[0\\]: Configuration for OUT\\[n\\], SET\\[n\\] +and CLR\\[n\\] +tasks and IN\\[n\\] +event"] + pub config: [crate::Reg; 8], +} +#[doc = "TASKS_OUT register accessor: an alias for `Reg`"] +pub type TASKS_OUT = crate::Reg; +#[doc = "Description collection\\[0\\]: Task for writing to pin specified in CONFIG\\[0\\].PSEL. Action on pin is configured in CONFIG\\[0\\].POLARITY."] +pub mod tasks_out; +#[doc = "TASKS_SET register accessor: an alias for `Reg`"] +pub type TASKS_SET = crate::Reg; +#[doc = "Description collection\\[0\\]: Task for writing to pin specified in CONFIG\\[0\\].PSEL. Action on pin is to set it high."] +pub mod tasks_set; +#[doc = "TASKS_CLR register accessor: an alias for `Reg`"] +pub type TASKS_CLR = crate::Reg; +#[doc = "Description collection\\[0\\]: Task for writing to pin specified in CONFIG\\[0\\].PSEL. Action on pin is to set it low."] +pub mod tasks_clr; +#[doc = "EVENTS_IN register accessor: an alias for `Reg`"] +pub type EVENTS_IN = crate::Reg; +#[doc = "Description collection\\[0\\]: Event generated from pin specified in CONFIG\\[0\\].PSEL"] +pub mod events_in; +#[doc = "EVENTS_PORT register accessor: an alias for `Reg`"] +pub type EVENTS_PORT = crate::Reg; +#[doc = "Event generated from multiple input GPIO pins with SENSE mechanism enabled"] +pub mod events_port; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "CONFIG register accessor: an alias for `Reg`"] +pub type CONFIG = crate::Reg; +#[doc = "Description collection\\[0\\]: Configuration for OUT\\[n\\], SET\\[n\\] +and CLR\\[n\\] +tasks and IN\\[n\\] +event"] +pub mod config; diff --git a/src/gpiote/config.rs b/src/gpiote/config.rs new file mode 100644 index 0000000..5b7d3ad --- /dev/null +++ b/src/gpiote/config.rs @@ -0,0 +1,444 @@ +#[doc = "Register `CONFIG[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CONFIG[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Mode\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum MODE_A { + #[doc = "0: Disabled. Pin specified by PSEL will not be acquired by the GPIOTE module."] + DISABLED = 0, + #[doc = "1: Event mode"] + EVENT = 1, + #[doc = "3: Task mode"] + TASK = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: MODE_A) -> Self { + variant as _ + } +} +#[doc = "Field `MODE` reader - Mode"] +pub struct MODE_R(crate::FieldReader); +impl MODE_R { + pub(crate) fn new(bits: u8) -> Self { + MODE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(MODE_A::DISABLED), + 1 => Some(MODE_A::EVENT), + 3 => Some(MODE_A::TASK), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == MODE_A::DISABLED + } + #[doc = "Checks if the value of the field is `EVENT`"] + #[inline(always)] + pub fn is_event(&self) -> bool { + **self == MODE_A::EVENT + } + #[doc = "Checks if the value of the field is `TASK`"] + #[inline(always)] + pub fn is_task(&self) -> bool { + **self == MODE_A::TASK + } +} +impl core::ops::Deref for MODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MODE` writer - Mode"] +pub struct MODE_W<'a> { + w: &'a mut W, +} +impl<'a> MODE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: MODE_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Disabled. Pin specified by PSEL will not be acquired by the GPIOTE module."] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(MODE_A::DISABLED) + } + #[doc = "Event mode"] + #[inline(always)] + pub fn event(self) -> &'a mut W { + self.variant(MODE_A::EVENT) + } + #[doc = "Task mode"] + #[inline(always)] + pub fn task(self) -> &'a mut W { + self.variant(MODE_A::TASK) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); + self.w + } +} +#[doc = "Field `PSEL` reader - GPIO number associated with SET\\[n\\], CLR\\[n\\] +and OUT\\[n\\] +tasks and IN\\[n\\] +event"] +pub struct PSEL_R(crate::FieldReader); +impl PSEL_R { + pub(crate) fn new(bits: u8) -> Self { + PSEL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PSEL` writer - GPIO number associated with SET\\[n\\], CLR\\[n\\] +and OUT\\[n\\] +tasks and IN\\[n\\] +event"] +pub struct PSEL_W<'a> { + w: &'a mut W, +} +impl<'a> PSEL_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x1f << 8)) | ((value as u32 & 0x1f) << 8); + self.w + } +} +#[doc = "When In task mode: Operation to be performed on output when OUT\\[n\\] +task is triggered. When In event mode: Operation on input that shall trigger IN\\[n\\] +event.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum POLARITY_A { + #[doc = "0: Task mode: No effect on pin from OUT\\[n\\] +task. Event mode: no IN\\[n\\] +event generated on pin activity."] + NONE = 0, + #[doc = "1: Task mode: Set pin from OUT\\[n\\] +task. Event mode: Generate IN\\[n\\] +event when rising edge on pin."] + LOTOHI = 1, + #[doc = "2: Task mode: Clear pin from OUT\\[n\\] +task. Event mode: Generate IN\\[n\\] +event when falling edge on pin."] + HITOLO = 2, + #[doc = "3: Task mode: Toggle pin from OUT\\[n\\]. Event mode: Generate IN\\[n\\] +when any change on pin."] + TOGGLE = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: POLARITY_A) -> Self { + variant as _ + } +} +#[doc = "Field `POLARITY` reader - When In task mode: Operation to be performed on output when OUT\\[n\\] +task is triggered. When In event mode: Operation on input that shall trigger IN\\[n\\] +event."] +pub struct POLARITY_R(crate::FieldReader); +impl POLARITY_R { + pub(crate) fn new(bits: u8) -> Self { + POLARITY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> POLARITY_A { + match self.bits { + 0 => POLARITY_A::NONE, + 1 => POLARITY_A::LOTOHI, + 2 => POLARITY_A::HITOLO, + 3 => POLARITY_A::TOGGLE, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `NONE`"] + #[inline(always)] + pub fn is_none(&self) -> bool { + **self == POLARITY_A::NONE + } + #[doc = "Checks if the value of the field is `LOTOHI`"] + #[inline(always)] + pub fn is_lo_to_hi(&self) -> bool { + **self == POLARITY_A::LOTOHI + } + #[doc = "Checks if the value of the field is `HITOLO`"] + #[inline(always)] + pub fn is_hi_to_lo(&self) -> bool { + **self == POLARITY_A::HITOLO + } + #[doc = "Checks if the value of the field is `TOGGLE`"] + #[inline(always)] + pub fn is_toggle(&self) -> bool { + **self == POLARITY_A::TOGGLE + } +} +impl core::ops::Deref for POLARITY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `POLARITY` writer - When In task mode: Operation to be performed on output when OUT\\[n\\] +task is triggered. When In event mode: Operation on input that shall trigger IN\\[n\\] +event."] +pub struct POLARITY_W<'a> { + w: &'a mut W, +} +impl<'a> POLARITY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: POLARITY_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "Task mode: No effect on pin from OUT\\[n\\] +task. Event mode: no IN\\[n\\] +event generated on pin activity."] + #[inline(always)] + pub fn none(self) -> &'a mut W { + self.variant(POLARITY_A::NONE) + } + #[doc = "Task mode: Set pin from OUT\\[n\\] +task. Event mode: Generate IN\\[n\\] +event when rising edge on pin."] + #[inline(always)] + pub fn lo_to_hi(self) -> &'a mut W { + self.variant(POLARITY_A::LOTOHI) + } + #[doc = "Task mode: Clear pin from OUT\\[n\\] +task. Event mode: Generate IN\\[n\\] +event when falling edge on pin."] + #[inline(always)] + pub fn hi_to_lo(self) -> &'a mut W { + self.variant(POLARITY_A::HITOLO) + } + #[doc = "Task mode: Toggle pin from OUT\\[n\\]. Event mode: Generate IN\\[n\\] +when any change on pin."] + #[inline(always)] + pub fn toggle(self) -> &'a mut W { + self.variant(POLARITY_A::TOGGLE) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x03 << 16)) | ((value as u32 & 0x03) << 16); + self.w + } +} +#[doc = "When in task mode: Initial value of the output when the GPIOTE channel is configured. When in event mode: No effect.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OUTINIT_A { + #[doc = "0: Task mode: Initial value of pin before task triggering is low"] + LOW = 0, + #[doc = "1: Task mode: Initial value of pin before task triggering is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OUTINIT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OUTINIT` reader - When in task mode: Initial value of the output when the GPIOTE channel is configured. When in event mode: No effect."] +pub struct OUTINIT_R(crate::FieldReader); +impl OUTINIT_R { + pub(crate) fn new(bits: bool) -> Self { + OUTINIT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> OUTINIT_A { + match self.bits { + false => OUTINIT_A::LOW, + true => OUTINIT_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == OUTINIT_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == OUTINIT_A::HIGH + } +} +impl core::ops::Deref for OUTINIT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OUTINIT` writer - When in task mode: Initial value of the output when the GPIOTE channel is configured. When in event mode: No effect."] +pub struct OUTINIT_W<'a> { + w: &'a mut W, +} +impl<'a> OUTINIT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: OUTINIT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Task mode: Initial value of pin before task triggering is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(OUTINIT_A::LOW) + } + #[doc = "Task mode: Initial value of pin before task triggering is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(OUTINIT_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +impl R { + #[doc = "Bits 0:1 - Mode"] + #[inline(always)] + pub fn mode(&self) -> MODE_R { + MODE_R::new((self.bits & 0x03) as u8) + } + #[doc = "Bits 8:12 - GPIO number associated with SET\\[n\\], CLR\\[n\\] +and OUT\\[n\\] +tasks and IN\\[n\\] +event"] + #[inline(always)] + pub fn psel(&self) -> PSEL_R { + PSEL_R::new(((self.bits >> 8) & 0x1f) as u8) + } + #[doc = "Bits 16:17 - When In task mode: Operation to be performed on output when OUT\\[n\\] +task is triggered. When In event mode: Operation on input that shall trigger IN\\[n\\] +event."] + #[inline(always)] + pub fn polarity(&self) -> POLARITY_R { + POLARITY_R::new(((self.bits >> 16) & 0x03) as u8) + } + #[doc = "Bit 20 - When in task mode: Initial value of the output when the GPIOTE channel is configured. When in event mode: No effect."] + #[inline(always)] + pub fn outinit(&self) -> OUTINIT_R { + OUTINIT_R::new(((self.bits >> 20) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:1 - Mode"] + #[inline(always)] + pub fn mode(&mut self) -> MODE_W { + MODE_W { w: self } + } + #[doc = "Bits 8:12 - GPIO number associated with SET\\[n\\], CLR\\[n\\] +and OUT\\[n\\] +tasks and IN\\[n\\] +event"] + #[inline(always)] + pub fn psel(&mut self) -> PSEL_W { + PSEL_W { w: self } + } + #[doc = "Bits 16:17 - When In task mode: Operation to be performed on output when OUT\\[n\\] +task is triggered. When In event mode: Operation on input that shall trigger IN\\[n\\] +event."] + #[inline(always)] + pub fn polarity(&mut self) -> POLARITY_W { + POLARITY_W { w: self } + } + #[doc = "Bit 20 - When in task mode: Initial value of the output when the GPIOTE channel is configured. When in event mode: No effect."] + #[inline(always)] + pub fn outinit(&mut self) -> OUTINIT_W { + OUTINIT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description collection\\[0\\]: Configuration for OUT\\[n\\], SET\\[n\\] +and CLR\\[n\\] +tasks and IN\\[n\\] +event\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [config](index.html) module"] +pub struct CONFIG_SPEC; +impl crate::RegisterSpec for CONFIG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [config::R](R) reader structure"] +impl crate::Readable for CONFIG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [config::W](W) writer structure"] +impl crate::Writable for CONFIG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CONFIG[%s] +to value 0"] +impl crate::Resettable for CONFIG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/gpiote/events_in.rs b/src/gpiote/events_in.rs new file mode 100644 index 0000000..b8f34d2 --- /dev/null +++ b/src/gpiote/events_in.rs @@ -0,0 +1,65 @@ +#[doc = "Register `EVENTS_IN[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_IN[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description collection\\[0\\]: Event generated from pin specified in CONFIG\\[0\\].PSEL\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_in](index.html) module"] +pub struct EVENTS_IN_SPEC; +impl crate::RegisterSpec for EVENTS_IN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_in::R](R) reader structure"] +impl crate::Readable for EVENTS_IN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_in::W](W) writer structure"] +impl crate::Writable for EVENTS_IN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_IN[%s] +to value 0"] +impl crate::Resettable for EVENTS_IN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/gpiote/events_port.rs b/src/gpiote/events_port.rs new file mode 100644 index 0000000..3a13b47 --- /dev/null +++ b/src/gpiote/events_port.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_PORT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_PORT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Event generated from multiple input GPIO pins with SENSE mechanism enabled\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_port](index.html) module"] +pub struct EVENTS_PORT_SPEC; +impl crate::RegisterSpec for EVENTS_PORT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_port::R](R) reader structure"] +impl crate::Readable for EVENTS_PORT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_port::W](W) writer structure"] +impl crate::Writable for EVENTS_PORT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_PORT to value 0"] +impl crate::Resettable for EVENTS_PORT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/gpiote/intenclr.rs b/src/gpiote/intenclr.rs new file mode 100644 index 0000000..b4f6e7e --- /dev/null +++ b/src/gpiote/intenclr.rs @@ -0,0 +1,1014 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for IN\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN0_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN0` reader - Write '1' to Disable interrupt for IN\\[0\\] +event"] +pub struct IN0_R(crate::FieldReader); +impl IN0_R { + pub(crate) fn new(bits: bool) -> Self { + IN0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> IN0_A { + match self.bits { + false => IN0_A::DISABLED, + true => IN0_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == IN0_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == IN0_A::ENABLED + } +} +impl core::ops::Deref for IN0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for IN\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN0_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN0_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN0` writer - Write '1' to Disable interrupt for IN\\[0\\] +event"] +pub struct IN0_W<'a> { + w: &'a mut W, +} +impl<'a> IN0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: IN0_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(IN0_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for IN\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN1_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN1` reader - Write '1' to Disable interrupt for IN\\[1\\] +event"] +pub struct IN1_R(crate::FieldReader); +impl IN1_R { + pub(crate) fn new(bits: bool) -> Self { + IN1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> IN1_A { + match self.bits { + false => IN1_A::DISABLED, + true => IN1_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == IN1_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == IN1_A::ENABLED + } +} +impl core::ops::Deref for IN1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for IN\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN1_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN1_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN1` writer - Write '1' to Disable interrupt for IN\\[1\\] +event"] +pub struct IN1_W<'a> { + w: &'a mut W, +} +impl<'a> IN1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: IN1_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(IN1_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for IN\\[2\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN2_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN2` reader - Write '1' to Disable interrupt for IN\\[2\\] +event"] +pub struct IN2_R(crate::FieldReader); +impl IN2_R { + pub(crate) fn new(bits: bool) -> Self { + IN2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> IN2_A { + match self.bits { + false => IN2_A::DISABLED, + true => IN2_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == IN2_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == IN2_A::ENABLED + } +} +impl core::ops::Deref for IN2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for IN\\[2\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN2_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN2_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN2` writer - Write '1' to Disable interrupt for IN\\[2\\] +event"] +pub struct IN2_W<'a> { + w: &'a mut W, +} +impl<'a> IN2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: IN2_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(IN2_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for IN\\[3\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN3_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN3` reader - Write '1' to Disable interrupt for IN\\[3\\] +event"] +pub struct IN3_R(crate::FieldReader); +impl IN3_R { + pub(crate) fn new(bits: bool) -> Self { + IN3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> IN3_A { + match self.bits { + false => IN3_A::DISABLED, + true => IN3_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == IN3_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == IN3_A::ENABLED + } +} +impl core::ops::Deref for IN3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for IN\\[3\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN3_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN3_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN3` writer - Write '1' to Disable interrupt for IN\\[3\\] +event"] +pub struct IN3_W<'a> { + w: &'a mut W, +} +impl<'a> IN3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: IN3_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(IN3_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for IN\\[4\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN4_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN4_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN4` reader - Write '1' to Disable interrupt for IN\\[4\\] +event"] +pub struct IN4_R(crate::FieldReader); +impl IN4_R { + pub(crate) fn new(bits: bool) -> Self { + IN4_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> IN4_A { + match self.bits { + false => IN4_A::DISABLED, + true => IN4_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == IN4_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == IN4_A::ENABLED + } +} +impl core::ops::Deref for IN4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for IN\\[4\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN4_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN4_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN4` writer - Write '1' to Disable interrupt for IN\\[4\\] +event"] +pub struct IN4_W<'a> { + w: &'a mut W, +} +impl<'a> IN4_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: IN4_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(IN4_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for IN\\[5\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN5_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN5_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN5` reader - Write '1' to Disable interrupt for IN\\[5\\] +event"] +pub struct IN5_R(crate::FieldReader); +impl IN5_R { + pub(crate) fn new(bits: bool) -> Self { + IN5_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> IN5_A { + match self.bits { + false => IN5_A::DISABLED, + true => IN5_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == IN5_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == IN5_A::ENABLED + } +} +impl core::ops::Deref for IN5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for IN\\[5\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN5_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN5_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN5` writer - Write '1' to Disable interrupt for IN\\[5\\] +event"] +pub struct IN5_W<'a> { + w: &'a mut W, +} +impl<'a> IN5_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: IN5_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(IN5_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for IN\\[6\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN6_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN6_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN6` reader - Write '1' to Disable interrupt for IN\\[6\\] +event"] +pub struct IN6_R(crate::FieldReader); +impl IN6_R { + pub(crate) fn new(bits: bool) -> Self { + IN6_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> IN6_A { + match self.bits { + false => IN6_A::DISABLED, + true => IN6_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == IN6_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == IN6_A::ENABLED + } +} +impl core::ops::Deref for IN6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for IN\\[6\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN6_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN6_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN6` writer - Write '1' to Disable interrupt for IN\\[6\\] +event"] +pub struct IN6_W<'a> { + w: &'a mut W, +} +impl<'a> IN6_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: IN6_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(IN6_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for IN\\[7\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN7_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN7_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN7` reader - Write '1' to Disable interrupt for IN\\[7\\] +event"] +pub struct IN7_R(crate::FieldReader); +impl IN7_R { + pub(crate) fn new(bits: bool) -> Self { + IN7_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> IN7_A { + match self.bits { + false => IN7_A::DISABLED, + true => IN7_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == IN7_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == IN7_A::ENABLED + } +} +impl core::ops::Deref for IN7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for IN\\[7\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN7_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN7_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN7` writer - Write '1' to Disable interrupt for IN\\[7\\] +event"] +pub struct IN7_W<'a> { + w: &'a mut W, +} +impl<'a> IN7_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: IN7_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(IN7_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for PORT event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PORT_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PORT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PORT` reader - Write '1' to Disable interrupt for PORT event"] +pub struct PORT_R(crate::FieldReader); +impl PORT_R { + pub(crate) fn new(bits: bool) -> Self { + PORT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PORT_A { + match self.bits { + false => PORT_A::DISABLED, + true => PORT_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PORT_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PORT_A::ENABLED + } +} +impl core::ops::Deref for PORT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for PORT event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PORT_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PORT_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PORT` writer - Write '1' to Disable interrupt for PORT event"] +pub struct PORT_W<'a> { + w: &'a mut W, +} +impl<'a> PORT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PORT_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PORT_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Disable interrupt for IN\\[0\\] +event"] + #[inline(always)] + pub fn in0(&self) -> IN0_R { + IN0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for IN\\[1\\] +event"] + #[inline(always)] + pub fn in1(&self) -> IN1_R { + IN1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for IN\\[2\\] +event"] + #[inline(always)] + pub fn in2(&self) -> IN2_R { + IN2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Write '1' to Disable interrupt for IN\\[3\\] +event"] + #[inline(always)] + pub fn in3(&self) -> IN3_R { + IN3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Write '1' to Disable interrupt for IN\\[4\\] +event"] + #[inline(always)] + pub fn in4(&self) -> IN4_R { + IN4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Write '1' to Disable interrupt for IN\\[5\\] +event"] + #[inline(always)] + pub fn in5(&self) -> IN5_R { + IN5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Write '1' to Disable interrupt for IN\\[6\\] +event"] + #[inline(always)] + pub fn in6(&self) -> IN6_R { + IN6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Write '1' to Disable interrupt for IN\\[7\\] +event"] + #[inline(always)] + pub fn in7(&self) -> IN7_R { + IN7_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 31 - Write '1' to Disable interrupt for PORT event"] + #[inline(always)] + pub fn port(&self) -> PORT_R { + PORT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Disable interrupt for IN\\[0\\] +event"] + #[inline(always)] + pub fn in0(&mut self) -> IN0_W { + IN0_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for IN\\[1\\] +event"] + #[inline(always)] + pub fn in1(&mut self) -> IN1_W { + IN1_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for IN\\[2\\] +event"] + #[inline(always)] + pub fn in2(&mut self) -> IN2_W { + IN2_W { w: self } + } + #[doc = "Bit 3 - Write '1' to Disable interrupt for IN\\[3\\] +event"] + #[inline(always)] + pub fn in3(&mut self) -> IN3_W { + IN3_W { w: self } + } + #[doc = "Bit 4 - Write '1' to Disable interrupt for IN\\[4\\] +event"] + #[inline(always)] + pub fn in4(&mut self) -> IN4_W { + IN4_W { w: self } + } + #[doc = "Bit 5 - Write '1' to Disable interrupt for IN\\[5\\] +event"] + #[inline(always)] + pub fn in5(&mut self) -> IN5_W { + IN5_W { w: self } + } + #[doc = "Bit 6 - Write '1' to Disable interrupt for IN\\[6\\] +event"] + #[inline(always)] + pub fn in6(&mut self) -> IN6_W { + IN6_W { w: self } + } + #[doc = "Bit 7 - Write '1' to Disable interrupt for IN\\[7\\] +event"] + #[inline(always)] + pub fn in7(&mut self) -> IN7_W { + IN7_W { w: self } + } + #[doc = "Bit 31 - Write '1' to Disable interrupt for PORT event"] + #[inline(always)] + pub fn port(&mut self) -> PORT_W { + PORT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/gpiote/intenset.rs b/src/gpiote/intenset.rs new file mode 100644 index 0000000..0051152 --- /dev/null +++ b/src/gpiote/intenset.rs @@ -0,0 +1,1014 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for IN\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN0_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN0` reader - Write '1' to Enable interrupt for IN\\[0\\] +event"] +pub struct IN0_R(crate::FieldReader); +impl IN0_R { + pub(crate) fn new(bits: bool) -> Self { + IN0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> IN0_A { + match self.bits { + false => IN0_A::DISABLED, + true => IN0_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == IN0_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == IN0_A::ENABLED + } +} +impl core::ops::Deref for IN0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for IN\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN0_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN0_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN0` writer - Write '1' to Enable interrupt for IN\\[0\\] +event"] +pub struct IN0_W<'a> { + w: &'a mut W, +} +impl<'a> IN0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: IN0_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(IN0_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for IN\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN1_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN1` reader - Write '1' to Enable interrupt for IN\\[1\\] +event"] +pub struct IN1_R(crate::FieldReader); +impl IN1_R { + pub(crate) fn new(bits: bool) -> Self { + IN1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> IN1_A { + match self.bits { + false => IN1_A::DISABLED, + true => IN1_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == IN1_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == IN1_A::ENABLED + } +} +impl core::ops::Deref for IN1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for IN\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN1_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN1_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN1` writer - Write '1' to Enable interrupt for IN\\[1\\] +event"] +pub struct IN1_W<'a> { + w: &'a mut W, +} +impl<'a> IN1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: IN1_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(IN1_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for IN\\[2\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN2_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN2` reader - Write '1' to Enable interrupt for IN\\[2\\] +event"] +pub struct IN2_R(crate::FieldReader); +impl IN2_R { + pub(crate) fn new(bits: bool) -> Self { + IN2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> IN2_A { + match self.bits { + false => IN2_A::DISABLED, + true => IN2_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == IN2_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == IN2_A::ENABLED + } +} +impl core::ops::Deref for IN2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for IN\\[2\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN2_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN2_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN2` writer - Write '1' to Enable interrupt for IN\\[2\\] +event"] +pub struct IN2_W<'a> { + w: &'a mut W, +} +impl<'a> IN2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: IN2_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(IN2_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for IN\\[3\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN3_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN3` reader - Write '1' to Enable interrupt for IN\\[3\\] +event"] +pub struct IN3_R(crate::FieldReader); +impl IN3_R { + pub(crate) fn new(bits: bool) -> Self { + IN3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> IN3_A { + match self.bits { + false => IN3_A::DISABLED, + true => IN3_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == IN3_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == IN3_A::ENABLED + } +} +impl core::ops::Deref for IN3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for IN\\[3\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN3_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN3_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN3` writer - Write '1' to Enable interrupt for IN\\[3\\] +event"] +pub struct IN3_W<'a> { + w: &'a mut W, +} +impl<'a> IN3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: IN3_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(IN3_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for IN\\[4\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN4_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN4_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN4` reader - Write '1' to Enable interrupt for IN\\[4\\] +event"] +pub struct IN4_R(crate::FieldReader); +impl IN4_R { + pub(crate) fn new(bits: bool) -> Self { + IN4_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> IN4_A { + match self.bits { + false => IN4_A::DISABLED, + true => IN4_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == IN4_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == IN4_A::ENABLED + } +} +impl core::ops::Deref for IN4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for IN\\[4\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN4_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN4_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN4` writer - Write '1' to Enable interrupt for IN\\[4\\] +event"] +pub struct IN4_W<'a> { + w: &'a mut W, +} +impl<'a> IN4_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: IN4_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(IN4_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for IN\\[5\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN5_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN5_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN5` reader - Write '1' to Enable interrupt for IN\\[5\\] +event"] +pub struct IN5_R(crate::FieldReader); +impl IN5_R { + pub(crate) fn new(bits: bool) -> Self { + IN5_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> IN5_A { + match self.bits { + false => IN5_A::DISABLED, + true => IN5_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == IN5_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == IN5_A::ENABLED + } +} +impl core::ops::Deref for IN5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for IN\\[5\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN5_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN5_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN5` writer - Write '1' to Enable interrupt for IN\\[5\\] +event"] +pub struct IN5_W<'a> { + w: &'a mut W, +} +impl<'a> IN5_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: IN5_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(IN5_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for IN\\[6\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN6_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN6_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN6` reader - Write '1' to Enable interrupt for IN\\[6\\] +event"] +pub struct IN6_R(crate::FieldReader); +impl IN6_R { + pub(crate) fn new(bits: bool) -> Self { + IN6_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> IN6_A { + match self.bits { + false => IN6_A::DISABLED, + true => IN6_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == IN6_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == IN6_A::ENABLED + } +} +impl core::ops::Deref for IN6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for IN\\[6\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN6_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN6_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN6` writer - Write '1' to Enable interrupt for IN\\[6\\] +event"] +pub struct IN6_W<'a> { + w: &'a mut W, +} +impl<'a> IN6_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: IN6_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(IN6_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for IN\\[7\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN7_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN7_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN7` reader - Write '1' to Enable interrupt for IN\\[7\\] +event"] +pub struct IN7_R(crate::FieldReader); +impl IN7_R { + pub(crate) fn new(bits: bool) -> Self { + IN7_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> IN7_A { + match self.bits { + false => IN7_A::DISABLED, + true => IN7_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == IN7_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == IN7_A::ENABLED + } +} +impl core::ops::Deref for IN7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for IN\\[7\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum IN7_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: IN7_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `IN7` writer - Write '1' to Enable interrupt for IN\\[7\\] +event"] +pub struct IN7_W<'a> { + w: &'a mut W, +} +impl<'a> IN7_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: IN7_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(IN7_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for PORT event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PORT_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PORT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PORT` reader - Write '1' to Enable interrupt for PORT event"] +pub struct PORT_R(crate::FieldReader); +impl PORT_R { + pub(crate) fn new(bits: bool) -> Self { + PORT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PORT_A { + match self.bits { + false => PORT_A::DISABLED, + true => PORT_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PORT_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PORT_A::ENABLED + } +} +impl core::ops::Deref for PORT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for PORT event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PORT_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PORT_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PORT` writer - Write '1' to Enable interrupt for PORT event"] +pub struct PORT_W<'a> { + w: &'a mut W, +} +impl<'a> PORT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PORT_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PORT_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Enable interrupt for IN\\[0\\] +event"] + #[inline(always)] + pub fn in0(&self) -> IN0_R { + IN0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for IN\\[1\\] +event"] + #[inline(always)] + pub fn in1(&self) -> IN1_R { + IN1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for IN\\[2\\] +event"] + #[inline(always)] + pub fn in2(&self) -> IN2_R { + IN2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Write '1' to Enable interrupt for IN\\[3\\] +event"] + #[inline(always)] + pub fn in3(&self) -> IN3_R { + IN3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Write '1' to Enable interrupt for IN\\[4\\] +event"] + #[inline(always)] + pub fn in4(&self) -> IN4_R { + IN4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Write '1' to Enable interrupt for IN\\[5\\] +event"] + #[inline(always)] + pub fn in5(&self) -> IN5_R { + IN5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Write '1' to Enable interrupt for IN\\[6\\] +event"] + #[inline(always)] + pub fn in6(&self) -> IN6_R { + IN6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Write '1' to Enable interrupt for IN\\[7\\] +event"] + #[inline(always)] + pub fn in7(&self) -> IN7_R { + IN7_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 31 - Write '1' to Enable interrupt for PORT event"] + #[inline(always)] + pub fn port(&self) -> PORT_R { + PORT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Enable interrupt for IN\\[0\\] +event"] + #[inline(always)] + pub fn in0(&mut self) -> IN0_W { + IN0_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for IN\\[1\\] +event"] + #[inline(always)] + pub fn in1(&mut self) -> IN1_W { + IN1_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for IN\\[2\\] +event"] + #[inline(always)] + pub fn in2(&mut self) -> IN2_W { + IN2_W { w: self } + } + #[doc = "Bit 3 - Write '1' to Enable interrupt for IN\\[3\\] +event"] + #[inline(always)] + pub fn in3(&mut self) -> IN3_W { + IN3_W { w: self } + } + #[doc = "Bit 4 - Write '1' to Enable interrupt for IN\\[4\\] +event"] + #[inline(always)] + pub fn in4(&mut self) -> IN4_W { + IN4_W { w: self } + } + #[doc = "Bit 5 - Write '1' to Enable interrupt for IN\\[5\\] +event"] + #[inline(always)] + pub fn in5(&mut self) -> IN5_W { + IN5_W { w: self } + } + #[doc = "Bit 6 - Write '1' to Enable interrupt for IN\\[6\\] +event"] + #[inline(always)] + pub fn in6(&mut self) -> IN6_W { + IN6_W { w: self } + } + #[doc = "Bit 7 - Write '1' to Enable interrupt for IN\\[7\\] +event"] + #[inline(always)] + pub fn in7(&mut self) -> IN7_W { + IN7_W { w: self } + } + #[doc = "Bit 31 - Write '1' to Enable interrupt for PORT event"] + #[inline(always)] + pub fn port(&mut self) -> PORT_W { + PORT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/gpiote/tasks_clr.rs b/src/gpiote/tasks_clr.rs new file mode 100644 index 0000000..c6598cb --- /dev/null +++ b/src/gpiote/tasks_clr.rs @@ -0,0 +1,46 @@ +#[doc = "Register `TASKS_CLR[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description collection\\[0\\]: Task for writing to pin specified in CONFIG\\[0\\].PSEL. Action on pin is to set it low.\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_clr](index.html) module"] +pub struct TASKS_CLR_SPEC; +impl crate::RegisterSpec for TASKS_CLR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_clr::W](W) writer structure"] +impl crate::Writable for TASKS_CLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_CLR[%s] +to value 0"] +impl crate::Resettable for TASKS_CLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/gpiote/tasks_out.rs b/src/gpiote/tasks_out.rs new file mode 100644 index 0000000..4ff12a8 --- /dev/null +++ b/src/gpiote/tasks_out.rs @@ -0,0 +1,46 @@ +#[doc = "Register `TASKS_OUT[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description collection\\[0\\]: Task for writing to pin specified in CONFIG\\[0\\].PSEL. Action on pin is configured in CONFIG\\[0\\].POLARITY.\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_out](index.html) module"] +pub struct TASKS_OUT_SPEC; +impl crate::RegisterSpec for TASKS_OUT_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_out::W](W) writer structure"] +impl crate::Writable for TASKS_OUT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_OUT[%s] +to value 0"] +impl crate::Resettable for TASKS_OUT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/gpiote/tasks_set.rs b/src/gpiote/tasks_set.rs new file mode 100644 index 0000000..05cf450 --- /dev/null +++ b/src/gpiote/tasks_set.rs @@ -0,0 +1,46 @@ +#[doc = "Register `TASKS_SET[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description collection\\[0\\]: Task for writing to pin specified in CONFIG\\[0\\].PSEL. Action on pin is to set it high.\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_set](index.html) module"] +pub struct TASKS_SET_SPEC; +impl crate::RegisterSpec for TASKS_SET_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_set::W](W) writer structure"] +impl crate::Writable for TASKS_SET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_SET[%s] +to value 0"] +impl crate::Resettable for TASKS_SET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/i2s.rs b/src/i2s.rs new file mode 100644 index 0000000..acac231 --- /dev/null +++ b/src/i2s.rs @@ -0,0 +1,147 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "0x00 - Starts continuous I2S transfer. Also starts MCK generator when this is enabled."] + pub tasks_start: crate::Reg, + #[doc = "0x04 - Stops I2S transfer. Also stops MCK generator. Triggering this task will cause the {event:STOPPED} event to be generated."] + pub tasks_stop: crate::Reg, + _reserved2: [u8; 0xfc], + #[doc = "0x104 - The RXD.PTR register has been copied to internal double-buffers. When the I2S module is started and RX is enabled, this event will be generated for every RXTXD.MAXCNT words that are received on the SDIN pin."] + pub events_rxptrupd: crate::Reg, + #[doc = "0x108 - I2S transfer stopped."] + pub events_stopped: crate::Reg, + _reserved4: [u8; 0x08], + #[doc = "0x114 - The TDX.PTR register has been copied to internal double-buffers. When the I2S module is started and TX is enabled, this event will be generated for every RXTXD.MAXCNT words that are sent on the SDOUT pin."] + pub events_txptrupd: crate::Reg, + _reserved5: [u8; 0x01e8], + #[doc = "0x300 - Enable or disable interrupt"] + pub inten: crate::Reg, + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved8: [u8; 0x01f4], + #[doc = "0x500 - Enable I2S module."] + pub enable: crate::Reg, + #[doc = "0x504..0x52c - Unspecified"] + pub config: CONFIG, + _reserved10: [u8; 0x0c], + #[doc = "0x538 - Unspecified"] + pub rxd: RXD, + _reserved11: [u8; 0x04], + #[doc = "0x540 - Unspecified"] + pub txd: TXD, + _reserved12: [u8; 0x0c], + #[doc = "0x550 - Unspecified"] + pub rxtxd: RXTXD, + _reserved13: [u8; 0x0c], + #[doc = "0x560..0x574 - Unspecified"] + pub psel: PSEL, +} +#[doc = r"Register block"] +#[repr(C)] +pub struct CONFIG { + #[doc = "0x00 - I2S mode."] + pub mode: crate::Reg, + #[doc = "0x04 - Reception (RX) enable."] + pub rxen: crate::Reg, + #[doc = "0x08 - Transmission (TX) enable."] + pub txen: crate::Reg, + #[doc = "0x0c - Master clock generator enable."] + pub mcken: crate::Reg, + #[doc = "0x10 - Master clock generator frequency."] + pub mckfreq: crate::Reg, + #[doc = "0x14 - MCK / LRCK ratio."] + pub ratio: crate::Reg, + #[doc = "0x18 - Sample width."] + pub swidth: crate::Reg, + #[doc = "0x1c - Alignment of sample within a frame."] + pub align: crate::Reg, + #[doc = "0x20 - Frame format."] + pub format: crate::Reg, + #[doc = "0x24 - Enable channels."] + pub channels: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod config; +#[doc = r"Register block"] +#[repr(C)] +pub struct RXD { + #[doc = "0x00 - Receive buffer RAM start address."] + pub ptr: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod rxd; +#[doc = r"Register block"] +#[repr(C)] +pub struct TXD { + #[doc = "0x00 - Transmit buffer RAM start address."] + pub ptr: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod txd; +#[doc = r"Register block"] +#[repr(C)] +pub struct RXTXD { + #[doc = "0x00 - Size of RXD and TXD buffers."] + pub maxcnt: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod rxtxd; +#[doc = r"Register block"] +#[repr(C)] +pub struct PSEL { + #[doc = "0x00 - Pin select for MCK signal."] + pub mck: crate::Reg, + #[doc = "0x04 - Pin select for SCK signal."] + pub sck: crate::Reg, + #[doc = "0x08 - Pin select for LRCK signal."] + pub lrck: crate::Reg, + #[doc = "0x0c - Pin select for SDIN signal."] + pub sdin: crate::Reg, + #[doc = "0x10 - Pin select for SDOUT signal."] + pub sdout: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod psel; +#[doc = "TASKS_START register accessor: an alias for `Reg`"] +pub type TASKS_START = crate::Reg; +#[doc = "Starts continuous I2S transfer. Also starts MCK generator when this is enabled."] +pub mod tasks_start; +#[doc = "TASKS_STOP register accessor: an alias for `Reg`"] +pub type TASKS_STOP = crate::Reg; +#[doc = "Stops I2S transfer. Also stops MCK generator. Triggering this task will cause the {event:STOPPED} event to be generated."] +pub mod tasks_stop; +#[doc = "EVENTS_RXPTRUPD register accessor: an alias for `Reg`"] +pub type EVENTS_RXPTRUPD = crate::Reg; +#[doc = "The RXD.PTR register has been copied to internal double-buffers. When the I2S module is started and RX is enabled, this event will be generated for every RXTXD.MAXCNT words that are received on the SDIN pin."] +pub mod events_rxptrupd; +#[doc = "EVENTS_STOPPED register accessor: an alias for `Reg`"] +pub type EVENTS_STOPPED = crate::Reg; +#[doc = "I2S transfer stopped."] +pub mod events_stopped; +#[doc = "EVENTS_TXPTRUPD register accessor: an alias for `Reg`"] +pub type EVENTS_TXPTRUPD = crate::Reg; +#[doc = "The TDX.PTR register has been copied to internal double-buffers. When the I2S module is started and TX is enabled, this event will be generated for every RXTXD.MAXCNT words that are sent on the SDOUT pin."] +pub mod events_txptrupd; +#[doc = "INTEN register accessor: an alias for `Reg`"] +pub type INTEN = crate::Reg; +#[doc = "Enable or disable interrupt"] +pub mod inten; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "ENABLE register accessor: an alias for `Reg`"] +pub type ENABLE = crate::Reg; +#[doc = "Enable I2S module."] +pub mod enable; diff --git a/src/i2s/config.rs b/src/i2s/config.rs new file mode 100644 index 0000000..b0f3ca0 --- /dev/null +++ b/src/i2s/config.rs @@ -0,0 +1,40 @@ +#[doc = "MODE register accessor: an alias for `Reg`"] +pub type MODE = crate::Reg; +#[doc = "I2S mode."] +pub mod mode; +#[doc = "RXEN register accessor: an alias for `Reg`"] +pub type RXEN = crate::Reg; +#[doc = "Reception (RX) enable."] +pub mod rxen; +#[doc = "TXEN register accessor: an alias for `Reg`"] +pub type TXEN = crate::Reg; +#[doc = "Transmission (TX) enable."] +pub mod txen; +#[doc = "MCKEN register accessor: an alias for `Reg`"] +pub type MCKEN = crate::Reg; +#[doc = "Master clock generator enable."] +pub mod mcken; +#[doc = "MCKFREQ register accessor: an alias for `Reg`"] +pub type MCKFREQ = crate::Reg; +#[doc = "Master clock generator frequency."] +pub mod mckfreq; +#[doc = "RATIO register accessor: an alias for `Reg`"] +pub type RATIO = crate::Reg; +#[doc = "MCK / LRCK ratio."] +pub mod ratio; +#[doc = "SWIDTH register accessor: an alias for `Reg`"] +pub type SWIDTH = crate::Reg; +#[doc = "Sample width."] +pub mod swidth; +#[doc = "ALIGN register accessor: an alias for `Reg`"] +pub type ALIGN = crate::Reg; +#[doc = "Alignment of sample within a frame."] +pub mod align; +#[doc = "FORMAT register accessor: an alias for `Reg`"] +pub type FORMAT = crate::Reg; +#[doc = "Frame format."] +pub mod format; +#[doc = "CHANNELS register accessor: an alias for `Reg`"] +pub type CHANNELS = crate::Reg; +#[doc = "Enable channels."] +pub mod channels; diff --git a/src/i2s/config/align.rs b/src/i2s/config/align.rs new file mode 100644 index 0000000..0d34822 --- /dev/null +++ b/src/i2s/config/align.rs @@ -0,0 +1,159 @@ +#[doc = "Register `ALIGN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ALIGN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Alignment of sample within a frame.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ALIGN_A { + #[doc = "0: Left-aligned."] + LEFT = 0, + #[doc = "1: Right-aligned."] + RIGHT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ALIGN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ALIGN` reader - Alignment of sample within a frame."] +pub struct ALIGN_R(crate::FieldReader); +impl ALIGN_R { + pub(crate) fn new(bits: bool) -> Self { + ALIGN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ALIGN_A { + match self.bits { + false => ALIGN_A::LEFT, + true => ALIGN_A::RIGHT, + } + } + #[doc = "Checks if the value of the field is `LEFT`"] + #[inline(always)] + pub fn is_left(&self) -> bool { + **self == ALIGN_A::LEFT + } + #[doc = "Checks if the value of the field is `RIGHT`"] + #[inline(always)] + pub fn is_right(&self) -> bool { + **self == ALIGN_A::RIGHT + } +} +impl core::ops::Deref for ALIGN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ALIGN` writer - Alignment of sample within a frame."] +pub struct ALIGN_W<'a> { + w: &'a mut W, +} +impl<'a> ALIGN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ALIGN_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Left-aligned."] + #[inline(always)] + pub fn left(self) -> &'a mut W { + self.variant(ALIGN_A::LEFT) + } + #[doc = "Right-aligned."] + #[inline(always)] + pub fn right(self) -> &'a mut W { + self.variant(ALIGN_A::RIGHT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Alignment of sample within a frame."] + #[inline(always)] + pub fn align(&self) -> ALIGN_R { + ALIGN_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Alignment of sample within a frame."] + #[inline(always)] + pub fn align(&mut self) -> ALIGN_W { + ALIGN_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Alignment of sample within a frame.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [align](index.html) module"] +pub struct ALIGN_SPEC; +impl crate::RegisterSpec for ALIGN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [align::R](R) reader structure"] +impl crate::Readable for ALIGN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [align::W](W) writer structure"] +impl crate::Writable for ALIGN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ALIGN to value 0"] +impl crate::Resettable for ALIGN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/i2s/config/channels.rs b/src/i2s/config/channels.rs new file mode 100644 index 0000000..bf505bf --- /dev/null +++ b/src/i2s/config/channels.rs @@ -0,0 +1,164 @@ +#[doc = "Register `CHANNELS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CHANNELS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable channels.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum CHANNELS_A { + #[doc = "0: Stereo."] + STEREO = 0, + #[doc = "1: Left only."] + LEFT = 1, + #[doc = "2: Right only."] + RIGHT = 2, +} +impl From for u8 { + #[inline(always)] + fn from(variant: CHANNELS_A) -> Self { + variant as _ + } +} +#[doc = "Field `CHANNELS` reader - Enable channels."] +pub struct CHANNELS_R(crate::FieldReader); +impl CHANNELS_R { + pub(crate) fn new(bits: u8) -> Self { + CHANNELS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(CHANNELS_A::STEREO), + 1 => Some(CHANNELS_A::LEFT), + 2 => Some(CHANNELS_A::RIGHT), + _ => None, + } + } + #[doc = "Checks if the value of the field is `STEREO`"] + #[inline(always)] + pub fn is_stereo(&self) -> bool { + **self == CHANNELS_A::STEREO + } + #[doc = "Checks if the value of the field is `LEFT`"] + #[inline(always)] + pub fn is_left(&self) -> bool { + **self == CHANNELS_A::LEFT + } + #[doc = "Checks if the value of the field is `RIGHT`"] + #[inline(always)] + pub fn is_right(&self) -> bool { + **self == CHANNELS_A::RIGHT + } +} +impl core::ops::Deref for CHANNELS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CHANNELS` writer - Enable channels."] +pub struct CHANNELS_W<'a> { + w: &'a mut W, +} +impl<'a> CHANNELS_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CHANNELS_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Stereo."] + #[inline(always)] + pub fn stereo(self) -> &'a mut W { + self.variant(CHANNELS_A::STEREO) + } + #[doc = "Left only."] + #[inline(always)] + pub fn left(self) -> &'a mut W { + self.variant(CHANNELS_A::LEFT) + } + #[doc = "Right only."] + #[inline(always)] + pub fn right(self) -> &'a mut W { + self.variant(CHANNELS_A::RIGHT) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); + self.w + } +} +impl R { + #[doc = "Bits 0:1 - Enable channels."] + #[inline(always)] + pub fn channels(&self) -> CHANNELS_R { + CHANNELS_R::new((self.bits & 0x03) as u8) + } +} +impl W { + #[doc = "Bits 0:1 - Enable channels."] + #[inline(always)] + pub fn channels(&mut self) -> CHANNELS_W { + CHANNELS_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable channels.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [channels](index.html) module"] +pub struct CHANNELS_SPEC; +impl crate::RegisterSpec for CHANNELS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [channels::R](R) reader structure"] +impl crate::Readable for CHANNELS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [channels::W](W) writer structure"] +impl crate::Writable for CHANNELS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CHANNELS to value 0"] +impl crate::Resettable for CHANNELS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/i2s/config/format.rs b/src/i2s/config/format.rs new file mode 100644 index 0000000..a005fc7 --- /dev/null +++ b/src/i2s/config/format.rs @@ -0,0 +1,159 @@ +#[doc = "Register `FORMAT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `FORMAT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Frame format.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum FORMAT_A { + #[doc = "0: Original I2S format."] + I2S = 0, + #[doc = "1: Alternate (left- or right-aligned) format."] + ALIGNED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: FORMAT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `FORMAT` reader - Frame format."] +pub struct FORMAT_R(crate::FieldReader); +impl FORMAT_R { + pub(crate) fn new(bits: bool) -> Self { + FORMAT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> FORMAT_A { + match self.bits { + false => FORMAT_A::I2S, + true => FORMAT_A::ALIGNED, + } + } + #[doc = "Checks if the value of the field is `I2S`"] + #[inline(always)] + pub fn is_i2s(&self) -> bool { + **self == FORMAT_A::I2S + } + #[doc = "Checks if the value of the field is `ALIGNED`"] + #[inline(always)] + pub fn is_aligned(&self) -> bool { + **self == FORMAT_A::ALIGNED + } +} +impl core::ops::Deref for FORMAT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FORMAT` writer - Frame format."] +pub struct FORMAT_W<'a> { + w: &'a mut W, +} +impl<'a> FORMAT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: FORMAT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Original I2S format."] + #[inline(always)] + pub fn i2s(self) -> &'a mut W { + self.variant(FORMAT_A::I2S) + } + #[doc = "Alternate (left- or right-aligned) format."] + #[inline(always)] + pub fn aligned(self) -> &'a mut W { + self.variant(FORMAT_A::ALIGNED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Frame format."] + #[inline(always)] + pub fn format(&self) -> FORMAT_R { + FORMAT_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Frame format."] + #[inline(always)] + pub fn format(&mut self) -> FORMAT_W { + FORMAT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Frame format.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [format](index.html) module"] +pub struct FORMAT_SPEC; +impl crate::RegisterSpec for FORMAT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [format::R](R) reader structure"] +impl crate::Readable for FORMAT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [format::W](W) writer structure"] +impl crate::Writable for FORMAT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets FORMAT to value 0"] +impl crate::Resettable for FORMAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/i2s/config/mcken.rs b/src/i2s/config/mcken.rs new file mode 100644 index 0000000..be8a622 --- /dev/null +++ b/src/i2s/config/mcken.rs @@ -0,0 +1,159 @@ +#[doc = "Register `MCKEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MCKEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Master clock generator enable.\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum MCKEN_A { + #[doc = "0: Master clock generator disabled and PSEL.MCK not connected(available as GPIO)."] + DISABLED = 0, + #[doc = "1: Master clock generator running and MCK output on PSEL.MCK."] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: MCKEN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `MCKEN` reader - Master clock generator enable."] +pub struct MCKEN_R(crate::FieldReader); +impl MCKEN_R { + pub(crate) fn new(bits: bool) -> Self { + MCKEN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> MCKEN_A { + match self.bits { + false => MCKEN_A::DISABLED, + true => MCKEN_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == MCKEN_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == MCKEN_A::ENABLED + } +} +impl core::ops::Deref for MCKEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MCKEN` writer - Master clock generator enable."] +pub struct MCKEN_W<'a> { + w: &'a mut W, +} +impl<'a> MCKEN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: MCKEN_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Master clock generator disabled and PSEL.MCK not connected(available as GPIO)."] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(MCKEN_A::DISABLED) + } + #[doc = "Master clock generator running and MCK output on PSEL.MCK."] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(MCKEN_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Master clock generator enable."] + #[inline(always)] + pub fn mcken(&self) -> MCKEN_R { + MCKEN_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Master clock generator enable."] + #[inline(always)] + pub fn mcken(&mut self) -> MCKEN_W { + MCKEN_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Master clock generator enable.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mcken](index.html) module"] +pub struct MCKEN_SPEC; +impl crate::RegisterSpec for MCKEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mcken::R](R) reader structure"] +impl crate::Readable for MCKEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mcken::W](W) writer structure"] +impl crate::Writable for MCKEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MCKEN to value 0x01"] +impl crate::Resettable for MCKEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x01 + } +} diff --git a/src/i2s/config/mckfreq.rs b/src/i2s/config/mckfreq.rs new file mode 100644 index 0000000..672a127 --- /dev/null +++ b/src/i2s/config/mckfreq.rs @@ -0,0 +1,359 @@ +#[doc = "Register `MCKFREQ` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MCKFREQ` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Master clock generator frequency.\n\nValue on reset: 536870912"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u32)] +pub enum MCKFREQ_A { + #[doc = "2147483648: 32 MHz / 2 = 16.0 MHz"] + _32MDIV2 = 2147483648, + #[doc = "1342177280: 32 MHz / 3 = 10.6666667 MHz"] + _32MDIV3 = 1342177280, + #[doc = "1073741824: 32 MHz / 4 = 8.0 MHz"] + _32MDIV4 = 1073741824, + #[doc = "805306368: 32 MHz / 5 = 6.4 MHz"] + _32MDIV5 = 805306368, + #[doc = "671088640: 32 MHz / 6 = 5.3333333 MHz"] + _32MDIV6 = 671088640, + #[doc = "536870912: 32 MHz / 8 = 4.0 MHz"] + _32MDIV8 = 536870912, + #[doc = "402653184: 32 MHz / 10 = 3.2 MHz"] + _32MDIV10 = 402653184, + #[doc = "369098752: 32 MHz / 11 = 2.9090909 MHz"] + _32MDIV11 = 369098752, + #[doc = "285212672: 32 MHz / 15 = 2.1333333 MHz"] + _32MDIV15 = 285212672, + #[doc = "268435456: 32 MHz / 16 = 2.0 MHz"] + _32MDIV16 = 268435456, + #[doc = "201326592: 32 MHz / 21 = 1.5238095"] + _32MDIV21 = 201326592, + #[doc = "184549376: 32 MHz / 23 = 1.3913043 MHz"] + _32MDIV23 = 184549376, + #[doc = "142606336: 32 MHz / 30 = 1.0666667 MHz"] + _32MDIV30 = 142606336, + #[doc = "138412032: 32 MHz / 31 = 1.0322581 MHz"] + _32MDIV31 = 138412032, + #[doc = "134217728: 32 MHz / 32 = 1.0 MHz"] + _32MDIV32 = 134217728, + #[doc = "100663296: 32 MHz / 42 = 0.7619048 MHz"] + _32MDIV42 = 100663296, + #[doc = "68157440: 32 MHz / 63 = 0.5079365 MHz"] + _32MDIV63 = 68157440, + #[doc = "34340864: 32 MHz / 125 = 0.256 MHz"] + _32MDIV125 = 34340864, +} +impl From for u32 { + #[inline(always)] + fn from(variant: MCKFREQ_A) -> Self { + variant as _ + } +} +#[doc = "Field `MCKFREQ` reader - Master clock generator frequency."] +pub struct MCKFREQ_R(crate::FieldReader); +impl MCKFREQ_R { + pub(crate) fn new(bits: u32) -> Self { + MCKFREQ_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 2147483648 => Some(MCKFREQ_A::_32MDIV2), + 1342177280 => Some(MCKFREQ_A::_32MDIV3), + 1073741824 => Some(MCKFREQ_A::_32MDIV4), + 805306368 => Some(MCKFREQ_A::_32MDIV5), + 671088640 => Some(MCKFREQ_A::_32MDIV6), + 536870912 => Some(MCKFREQ_A::_32MDIV8), + 402653184 => Some(MCKFREQ_A::_32MDIV10), + 369098752 => Some(MCKFREQ_A::_32MDIV11), + 285212672 => Some(MCKFREQ_A::_32MDIV15), + 268435456 => Some(MCKFREQ_A::_32MDIV16), + 201326592 => Some(MCKFREQ_A::_32MDIV21), + 184549376 => Some(MCKFREQ_A::_32MDIV23), + 142606336 => Some(MCKFREQ_A::_32MDIV30), + 138412032 => Some(MCKFREQ_A::_32MDIV31), + 134217728 => Some(MCKFREQ_A::_32MDIV32), + 100663296 => Some(MCKFREQ_A::_32MDIV42), + 68157440 => Some(MCKFREQ_A::_32MDIV63), + 34340864 => Some(MCKFREQ_A::_32MDIV125), + _ => None, + } + } + #[doc = "Checks if the value of the field is `_32MDIV2`"] + #[inline(always)] + pub fn is_32mdiv2(&self) -> bool { + **self == MCKFREQ_A::_32MDIV2 + } + #[doc = "Checks if the value of the field is `_32MDIV3`"] + #[inline(always)] + pub fn is_32mdiv3(&self) -> bool { + **self == MCKFREQ_A::_32MDIV3 + } + #[doc = "Checks if the value of the field is `_32MDIV4`"] + #[inline(always)] + pub fn is_32mdiv4(&self) -> bool { + **self == MCKFREQ_A::_32MDIV4 + } + #[doc = "Checks if the value of the field is `_32MDIV5`"] + #[inline(always)] + pub fn is_32mdiv5(&self) -> bool { + **self == MCKFREQ_A::_32MDIV5 + } + #[doc = "Checks if the value of the field is `_32MDIV6`"] + #[inline(always)] + pub fn is_32mdiv6(&self) -> bool { + **self == MCKFREQ_A::_32MDIV6 + } + #[doc = "Checks if the value of the field is `_32MDIV8`"] + #[inline(always)] + pub fn is_32mdiv8(&self) -> bool { + **self == MCKFREQ_A::_32MDIV8 + } + #[doc = "Checks if the value of the field is `_32MDIV10`"] + #[inline(always)] + pub fn is_32mdiv10(&self) -> bool { + **self == MCKFREQ_A::_32MDIV10 + } + #[doc = "Checks if the value of the field is `_32MDIV11`"] + #[inline(always)] + pub fn is_32mdiv11(&self) -> bool { + **self == MCKFREQ_A::_32MDIV11 + } + #[doc = "Checks if the value of the field is `_32MDIV15`"] + #[inline(always)] + pub fn is_32mdiv15(&self) -> bool { + **self == MCKFREQ_A::_32MDIV15 + } + #[doc = "Checks if the value of the field is `_32MDIV16`"] + #[inline(always)] + pub fn is_32mdiv16(&self) -> bool { + **self == MCKFREQ_A::_32MDIV16 + } + #[doc = "Checks if the value of the field is `_32MDIV21`"] + #[inline(always)] + pub fn is_32mdiv21(&self) -> bool { + **self == MCKFREQ_A::_32MDIV21 + } + #[doc = "Checks if the value of the field is `_32MDIV23`"] + #[inline(always)] + pub fn is_32mdiv23(&self) -> bool { + **self == MCKFREQ_A::_32MDIV23 + } + #[doc = "Checks if the value of the field is `_32MDIV30`"] + #[inline(always)] + pub fn is_32mdiv30(&self) -> bool { + **self == MCKFREQ_A::_32MDIV30 + } + #[doc = "Checks if the value of the field is `_32MDIV31`"] + #[inline(always)] + pub fn is_32mdiv31(&self) -> bool { + **self == MCKFREQ_A::_32MDIV31 + } + #[doc = "Checks if the value of the field is `_32MDIV32`"] + #[inline(always)] + pub fn is_32mdiv32(&self) -> bool { + **self == MCKFREQ_A::_32MDIV32 + } + #[doc = "Checks if the value of the field is `_32MDIV42`"] + #[inline(always)] + pub fn is_32mdiv42(&self) -> bool { + **self == MCKFREQ_A::_32MDIV42 + } + #[doc = "Checks if the value of the field is `_32MDIV63`"] + #[inline(always)] + pub fn is_32mdiv63(&self) -> bool { + **self == MCKFREQ_A::_32MDIV63 + } + #[doc = "Checks if the value of the field is `_32MDIV125`"] + #[inline(always)] + pub fn is_32mdiv125(&self) -> bool { + **self == MCKFREQ_A::_32MDIV125 + } +} +impl core::ops::Deref for MCKFREQ_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MCKFREQ` writer - Master clock generator frequency."] +pub struct MCKFREQ_W<'a> { + w: &'a mut W, +} +impl<'a> MCKFREQ_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: MCKFREQ_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "32 MHz / 2 = 16.0 MHz"] + #[inline(always)] + pub fn _32mdiv2(self) -> &'a mut W { + self.variant(MCKFREQ_A::_32MDIV2) + } + #[doc = "32 MHz / 3 = 10.6666667 MHz"] + #[inline(always)] + pub fn _32mdiv3(self) -> &'a mut W { + self.variant(MCKFREQ_A::_32MDIV3) + } + #[doc = "32 MHz / 4 = 8.0 MHz"] + #[inline(always)] + pub fn _32mdiv4(self) -> &'a mut W { + self.variant(MCKFREQ_A::_32MDIV4) + } + #[doc = "32 MHz / 5 = 6.4 MHz"] + #[inline(always)] + pub fn _32mdiv5(self) -> &'a mut W { + self.variant(MCKFREQ_A::_32MDIV5) + } + #[doc = "32 MHz / 6 = 5.3333333 MHz"] + #[inline(always)] + pub fn _32mdiv6(self) -> &'a mut W { + self.variant(MCKFREQ_A::_32MDIV6) + } + #[doc = "32 MHz / 8 = 4.0 MHz"] + #[inline(always)] + pub fn _32mdiv8(self) -> &'a mut W { + self.variant(MCKFREQ_A::_32MDIV8) + } + #[doc = "32 MHz / 10 = 3.2 MHz"] + #[inline(always)] + pub fn _32mdiv10(self) -> &'a mut W { + self.variant(MCKFREQ_A::_32MDIV10) + } + #[doc = "32 MHz / 11 = 2.9090909 MHz"] + #[inline(always)] + pub fn _32mdiv11(self) -> &'a mut W { + self.variant(MCKFREQ_A::_32MDIV11) + } + #[doc = "32 MHz / 15 = 2.1333333 MHz"] + #[inline(always)] + pub fn _32mdiv15(self) -> &'a mut W { + self.variant(MCKFREQ_A::_32MDIV15) + } + #[doc = "32 MHz / 16 = 2.0 MHz"] + #[inline(always)] + pub fn _32mdiv16(self) -> &'a mut W { + self.variant(MCKFREQ_A::_32MDIV16) + } + #[doc = "32 MHz / 21 = 1.5238095"] + #[inline(always)] + pub fn _32mdiv21(self) -> &'a mut W { + self.variant(MCKFREQ_A::_32MDIV21) + } + #[doc = "32 MHz / 23 = 1.3913043 MHz"] + #[inline(always)] + pub fn _32mdiv23(self) -> &'a mut W { + self.variant(MCKFREQ_A::_32MDIV23) + } + #[doc = "32 MHz / 30 = 1.0666667 MHz"] + #[inline(always)] + pub fn _32mdiv30(self) -> &'a mut W { + self.variant(MCKFREQ_A::_32MDIV30) + } + #[doc = "32 MHz / 31 = 1.0322581 MHz"] + #[inline(always)] + pub fn _32mdiv31(self) -> &'a mut W { + self.variant(MCKFREQ_A::_32MDIV31) + } + #[doc = "32 MHz / 32 = 1.0 MHz"] + #[inline(always)] + pub fn _32mdiv32(self) -> &'a mut W { + self.variant(MCKFREQ_A::_32MDIV32) + } + #[doc = "32 MHz / 42 = 0.7619048 MHz"] + #[inline(always)] + pub fn _32mdiv42(self) -> &'a mut W { + self.variant(MCKFREQ_A::_32MDIV42) + } + #[doc = "32 MHz / 63 = 0.5079365 MHz"] + #[inline(always)] + pub fn _32mdiv63(self) -> &'a mut W { + self.variant(MCKFREQ_A::_32MDIV63) + } + #[doc = "32 MHz / 125 = 0.256 MHz"] + #[inline(always)] + pub fn _32mdiv125(self) -> &'a mut W { + self.variant(MCKFREQ_A::_32MDIV125) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Master clock generator frequency."] + #[inline(always)] + pub fn mckfreq(&self) -> MCKFREQ_R { + MCKFREQ_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Master clock generator frequency."] + #[inline(always)] + pub fn mckfreq(&mut self) -> MCKFREQ_W { + MCKFREQ_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Master clock generator frequency.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mckfreq](index.html) module"] +pub struct MCKFREQ_SPEC; +impl crate::RegisterSpec for MCKFREQ_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mckfreq::R](R) reader structure"] +impl crate::Readable for MCKFREQ_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mckfreq::W](W) writer structure"] +impl crate::Writable for MCKFREQ_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MCKFREQ to value 0x2000_0000"] +impl crate::Resettable for MCKFREQ_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x2000_0000 + } +} diff --git a/src/i2s/config/mode.rs b/src/i2s/config/mode.rs new file mode 100644 index 0000000..a0e694b --- /dev/null +++ b/src/i2s/config/mode.rs @@ -0,0 +1,159 @@ +#[doc = "Register `MODE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MODE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "I2S mode.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum MODE_A { + #[doc = "0: Master mode. SCK and LRCK generated from internal master clcok (MCK) and output on pins defined by PSEL.xxx."] + MASTER = 0, + #[doc = "1: Slave mode. SCK and LRCK generated by external master and received on pins defined by PSEL.xxx"] + SLAVE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: MODE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `MODE` reader - I2S mode."] +pub struct MODE_R(crate::FieldReader); +impl MODE_R { + pub(crate) fn new(bits: bool) -> Self { + MODE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> MODE_A { + match self.bits { + false => MODE_A::MASTER, + true => MODE_A::SLAVE, + } + } + #[doc = "Checks if the value of the field is `MASTER`"] + #[inline(always)] + pub fn is_master(&self) -> bool { + **self == MODE_A::MASTER + } + #[doc = "Checks if the value of the field is `SLAVE`"] + #[inline(always)] + pub fn is_slave(&self) -> bool { + **self == MODE_A::SLAVE + } +} +impl core::ops::Deref for MODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MODE` writer - I2S mode."] +pub struct MODE_W<'a> { + w: &'a mut W, +} +impl<'a> MODE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: MODE_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Master mode. SCK and LRCK generated from internal master clcok (MCK) and output on pins defined by PSEL.xxx."] + #[inline(always)] + pub fn master(self) -> &'a mut W { + self.variant(MODE_A::MASTER) + } + #[doc = "Slave mode. SCK and LRCK generated by external master and received on pins defined by PSEL.xxx"] + #[inline(always)] + pub fn slave(self) -> &'a mut W { + self.variant(MODE_A::SLAVE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - I2S mode."] + #[inline(always)] + pub fn mode(&self) -> MODE_R { + MODE_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - I2S mode."] + #[inline(always)] + pub fn mode(&mut self) -> MODE_W { + MODE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "I2S mode.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mode](index.html) module"] +pub struct MODE_SPEC; +impl crate::RegisterSpec for MODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mode::R](R) reader structure"] +impl crate::Readable for MODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mode::W](W) writer structure"] +impl crate::Writable for MODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MODE to value 0"] +impl crate::Resettable for MODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/i2s/config/ratio.rs b/src/i2s/config/ratio.rs new file mode 100644 index 0000000..a849342 --- /dev/null +++ b/src/i2s/config/ratio.rs @@ -0,0 +1,242 @@ +#[doc = "Register `RATIO` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `RATIO` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "MCK / LRCK ratio.\n\nValue on reset: 6"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum RATIO_A { + #[doc = "0: LRCK = MCK / 32"] + _32X = 0, + #[doc = "1: LRCK = MCK / 48"] + _48X = 1, + #[doc = "2: LRCK = MCK / 64"] + _64X = 2, + #[doc = "3: LRCK = MCK / 96"] + _96X = 3, + #[doc = "4: LRCK = MCK / 128"] + _128X = 4, + #[doc = "5: LRCK = MCK / 192"] + _192X = 5, + #[doc = "6: LRCK = MCK / 256"] + _256X = 6, + #[doc = "7: LRCK = MCK / 384"] + _384X = 7, + #[doc = "8: LRCK = MCK / 512"] + _512X = 8, +} +impl From for u8 { + #[inline(always)] + fn from(variant: RATIO_A) -> Self { + variant as _ + } +} +#[doc = "Field `RATIO` reader - MCK / LRCK ratio."] +pub struct RATIO_R(crate::FieldReader); +impl RATIO_R { + pub(crate) fn new(bits: u8) -> Self { + RATIO_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(RATIO_A::_32X), + 1 => Some(RATIO_A::_48X), + 2 => Some(RATIO_A::_64X), + 3 => Some(RATIO_A::_96X), + 4 => Some(RATIO_A::_128X), + 5 => Some(RATIO_A::_192X), + 6 => Some(RATIO_A::_256X), + 7 => Some(RATIO_A::_384X), + 8 => Some(RATIO_A::_512X), + _ => None, + } + } + #[doc = "Checks if the value of the field is `_32X`"] + #[inline(always)] + pub fn is_32x(&self) -> bool { + **self == RATIO_A::_32X + } + #[doc = "Checks if the value of the field is `_48X`"] + #[inline(always)] + pub fn is_48x(&self) -> bool { + **self == RATIO_A::_48X + } + #[doc = "Checks if the value of the field is `_64X`"] + #[inline(always)] + pub fn is_64x(&self) -> bool { + **self == RATIO_A::_64X + } + #[doc = "Checks if the value of the field is `_96X`"] + #[inline(always)] + pub fn is_96x(&self) -> bool { + **self == RATIO_A::_96X + } + #[doc = "Checks if the value of the field is `_128X`"] + #[inline(always)] + pub fn is_128x(&self) -> bool { + **self == RATIO_A::_128X + } + #[doc = "Checks if the value of the field is `_192X`"] + #[inline(always)] + pub fn is_192x(&self) -> bool { + **self == RATIO_A::_192X + } + #[doc = "Checks if the value of the field is `_256X`"] + #[inline(always)] + pub fn is_256x(&self) -> bool { + **self == RATIO_A::_256X + } + #[doc = "Checks if the value of the field is `_384X`"] + #[inline(always)] + pub fn is_384x(&self) -> bool { + **self == RATIO_A::_384X + } + #[doc = "Checks if the value of the field is `_512X`"] + #[inline(always)] + pub fn is_512x(&self) -> bool { + **self == RATIO_A::_512X + } +} +impl core::ops::Deref for RATIO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RATIO` writer - MCK / LRCK ratio."] +pub struct RATIO_W<'a> { + w: &'a mut W, +} +impl<'a> RATIO_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RATIO_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "LRCK = MCK / 32"] + #[inline(always)] + pub fn _32x(self) -> &'a mut W { + self.variant(RATIO_A::_32X) + } + #[doc = "LRCK = MCK / 48"] + #[inline(always)] + pub fn _48x(self) -> &'a mut W { + self.variant(RATIO_A::_48X) + } + #[doc = "LRCK = MCK / 64"] + #[inline(always)] + pub fn _64x(self) -> &'a mut W { + self.variant(RATIO_A::_64X) + } + #[doc = "LRCK = MCK / 96"] + #[inline(always)] + pub fn _96x(self) -> &'a mut W { + self.variant(RATIO_A::_96X) + } + #[doc = "LRCK = MCK / 128"] + #[inline(always)] + pub fn _128x(self) -> &'a mut W { + self.variant(RATIO_A::_128X) + } + #[doc = "LRCK = MCK / 192"] + #[inline(always)] + pub fn _192x(self) -> &'a mut W { + self.variant(RATIO_A::_192X) + } + #[doc = "LRCK = MCK / 256"] + #[inline(always)] + pub fn _256x(self) -> &'a mut W { + self.variant(RATIO_A::_256X) + } + #[doc = "LRCK = MCK / 384"] + #[inline(always)] + pub fn _384x(self) -> &'a mut W { + self.variant(RATIO_A::_384X) + } + #[doc = "LRCK = MCK / 512"] + #[inline(always)] + pub fn _512x(self) -> &'a mut W { + self.variant(RATIO_A::_512X) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); + self.w + } +} +impl R { + #[doc = "Bits 0:3 - MCK / LRCK ratio."] + #[inline(always)] + pub fn ratio(&self) -> RATIO_R { + RATIO_R::new((self.bits & 0x0f) as u8) + } +} +impl W { + #[doc = "Bits 0:3 - MCK / LRCK ratio."] + #[inline(always)] + pub fn ratio(&mut self) -> RATIO_W { + RATIO_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "MCK / LRCK ratio.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ratio](index.html) module"] +pub struct RATIO_SPEC; +impl crate::RegisterSpec for RATIO_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ratio::R](R) reader structure"] +impl crate::Readable for RATIO_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ratio::W](W) writer structure"] +impl crate::Writable for RATIO_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets RATIO to value 0x06"] +impl crate::Resettable for RATIO_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x06 + } +} diff --git a/src/i2s/config/rxen.rs b/src/i2s/config/rxen.rs new file mode 100644 index 0000000..93f4581 --- /dev/null +++ b/src/i2s/config/rxen.rs @@ -0,0 +1,159 @@ +#[doc = "Register `RXEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `RXEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Reception (RX) enable.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXEN_A { + #[doc = "0: Reception disabled and now data will be written to the RXD.PTR address."] + DISABLED = 0, + #[doc = "1: Reception enabled."] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXEN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXEN` reader - Reception (RX) enable."] +pub struct RXEN_R(crate::FieldReader); +impl RXEN_R { + pub(crate) fn new(bits: bool) -> Self { + RXEN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXEN_A { + match self.bits { + false => RXEN_A::DISABLED, + true => RXEN_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXEN_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXEN_A::ENABLED + } +} +impl core::ops::Deref for RXEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RXEN` writer - Reception (RX) enable."] +pub struct RXEN_W<'a> { + w: &'a mut W, +} +impl<'a> RXEN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXEN_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Reception disabled and now data will be written to the RXD.PTR address."] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(RXEN_A::DISABLED) + } + #[doc = "Reception enabled."] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(RXEN_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Reception (RX) enable."] + #[inline(always)] + pub fn rxen(&self) -> RXEN_R { + RXEN_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Reception (RX) enable."] + #[inline(always)] + pub fn rxen(&mut self) -> RXEN_W { + RXEN_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Reception (RX) enable.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rxen](index.html) module"] +pub struct RXEN_SPEC; +impl crate::RegisterSpec for RXEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rxen::R](R) reader structure"] +impl crate::Readable for RXEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [rxen::W](W) writer structure"] +impl crate::Writable for RXEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets RXEN to value 0"] +impl crate::Resettable for RXEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/i2s/config/swidth.rs b/src/i2s/config/swidth.rs new file mode 100644 index 0000000..2e599f6 --- /dev/null +++ b/src/i2s/config/swidth.rs @@ -0,0 +1,164 @@ +#[doc = "Register `SWIDTH` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SWIDTH` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Sample width.\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum SWIDTH_A { + #[doc = "0: 8 bit."] + _8BIT = 0, + #[doc = "1: 16 bit."] + _16BIT = 1, + #[doc = "2: 24 bit."] + _24BIT = 2, +} +impl From for u8 { + #[inline(always)] + fn from(variant: SWIDTH_A) -> Self { + variant as _ + } +} +#[doc = "Field `SWIDTH` reader - Sample width."] +pub struct SWIDTH_R(crate::FieldReader); +impl SWIDTH_R { + pub(crate) fn new(bits: u8) -> Self { + SWIDTH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(SWIDTH_A::_8BIT), + 1 => Some(SWIDTH_A::_16BIT), + 2 => Some(SWIDTH_A::_24BIT), + _ => None, + } + } + #[doc = "Checks if the value of the field is `_8BIT`"] + #[inline(always)] + pub fn is_8bit(&self) -> bool { + **self == SWIDTH_A::_8BIT + } + #[doc = "Checks if the value of the field is `_16BIT`"] + #[inline(always)] + pub fn is_16bit(&self) -> bool { + **self == SWIDTH_A::_16BIT + } + #[doc = "Checks if the value of the field is `_24BIT`"] + #[inline(always)] + pub fn is_24bit(&self) -> bool { + **self == SWIDTH_A::_24BIT + } +} +impl core::ops::Deref for SWIDTH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SWIDTH` writer - Sample width."] +pub struct SWIDTH_W<'a> { + w: &'a mut W, +} +impl<'a> SWIDTH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SWIDTH_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "8 bit."] + #[inline(always)] + pub fn _8bit(self) -> &'a mut W { + self.variant(SWIDTH_A::_8BIT) + } + #[doc = "16 bit."] + #[inline(always)] + pub fn _16bit(self) -> &'a mut W { + self.variant(SWIDTH_A::_16BIT) + } + #[doc = "24 bit."] + #[inline(always)] + pub fn _24bit(self) -> &'a mut W { + self.variant(SWIDTH_A::_24BIT) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); + self.w + } +} +impl R { + #[doc = "Bits 0:1 - Sample width."] + #[inline(always)] + pub fn swidth(&self) -> SWIDTH_R { + SWIDTH_R::new((self.bits & 0x03) as u8) + } +} +impl W { + #[doc = "Bits 0:1 - Sample width."] + #[inline(always)] + pub fn swidth(&mut self) -> SWIDTH_W { + SWIDTH_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Sample width.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [swidth](index.html) module"] +pub struct SWIDTH_SPEC; +impl crate::RegisterSpec for SWIDTH_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [swidth::R](R) reader structure"] +impl crate::Readable for SWIDTH_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [swidth::W](W) writer structure"] +impl crate::Writable for SWIDTH_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SWIDTH to value 0x01"] +impl crate::Resettable for SWIDTH_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x01 + } +} diff --git a/src/i2s/config/txen.rs b/src/i2s/config/txen.rs new file mode 100644 index 0000000..6ce1ac4 --- /dev/null +++ b/src/i2s/config/txen.rs @@ -0,0 +1,159 @@ +#[doc = "Register `TXEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `TXEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Transmission (TX) enable.\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXEN_A { + #[doc = "0: Transmission disabled and now data will be read from the RXD.TXD address."] + DISABLED = 0, + #[doc = "1: Transmission enabled."] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXEN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXEN` reader - Transmission (TX) enable."] +pub struct TXEN_R(crate::FieldReader); +impl TXEN_R { + pub(crate) fn new(bits: bool) -> Self { + TXEN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXEN_A { + match self.bits { + false => TXEN_A::DISABLED, + true => TXEN_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXEN_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXEN_A::ENABLED + } +} +impl core::ops::Deref for TXEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TXEN` writer - Transmission (TX) enable."] +pub struct TXEN_W<'a> { + w: &'a mut W, +} +impl<'a> TXEN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXEN_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Transmission disabled and now data will be read from the RXD.TXD address."] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(TXEN_A::DISABLED) + } + #[doc = "Transmission enabled."] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(TXEN_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Transmission (TX) enable."] + #[inline(always)] + pub fn txen(&self) -> TXEN_R { + TXEN_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Transmission (TX) enable."] + #[inline(always)] + pub fn txen(&mut self) -> TXEN_W { + TXEN_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Transmission (TX) enable.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [txen](index.html) module"] +pub struct TXEN_SPEC; +impl crate::RegisterSpec for TXEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [txen::R](R) reader structure"] +impl crate::Readable for TXEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [txen::W](W) writer structure"] +impl crate::Writable for TXEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TXEN to value 0x01"] +impl crate::Resettable for TXEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x01 + } +} diff --git a/src/i2s/enable.rs b/src/i2s/enable.rs new file mode 100644 index 0000000..a91a02b --- /dev/null +++ b/src/i2s/enable.rs @@ -0,0 +1,159 @@ +#[doc = "Register `ENABLE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ENABLE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable I2S module.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENABLE_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENABLE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENABLE` reader - Enable I2S module."] +pub struct ENABLE_R(crate::FieldReader); +impl ENABLE_R { + pub(crate) fn new(bits: bool) -> Self { + ENABLE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENABLE_A { + match self.bits { + false => ENABLE_A::DISABLED, + true => ENABLE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENABLE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENABLE_A::ENABLED + } +} +impl core::ops::Deref for ENABLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENABLE` writer - Enable I2S module."] +pub struct ENABLE_W<'a> { + w: &'a mut W, +} +impl<'a> ENABLE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENABLE_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENABLE_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENABLE_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable I2S module."] + #[inline(always)] + pub fn enable(&self) -> ENABLE_R { + ENABLE_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Enable I2S module."] + #[inline(always)] + pub fn enable(&mut self) -> ENABLE_W { + ENABLE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable I2S module.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [enable](index.html) module"] +pub struct ENABLE_SPEC; +impl crate::RegisterSpec for ENABLE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [enable::R](R) reader structure"] +impl crate::Readable for ENABLE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [enable::W](W) writer structure"] +impl crate::Writable for ENABLE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ENABLE to value 0"] +impl crate::Resettable for ENABLE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/i2s/events_rxptrupd.rs b/src/i2s/events_rxptrupd.rs new file mode 100644 index 0000000..b6d95ac --- /dev/null +++ b/src/i2s/events_rxptrupd.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_RXPTRUPD` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_RXPTRUPD` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "The RXD.PTR register has been copied to internal double-buffers. When the I2S module is started and RX is enabled, this event will be generated for every RXTXD.MAXCNT words that are received on the SDIN pin.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_rxptrupd](index.html) module"] +pub struct EVENTS_RXPTRUPD_SPEC; +impl crate::RegisterSpec for EVENTS_RXPTRUPD_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_rxptrupd::R](R) reader structure"] +impl crate::Readable for EVENTS_RXPTRUPD_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_rxptrupd::W](W) writer structure"] +impl crate::Writable for EVENTS_RXPTRUPD_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_RXPTRUPD to value 0"] +impl crate::Resettable for EVENTS_RXPTRUPD_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/i2s/events_stopped.rs b/src/i2s/events_stopped.rs new file mode 100644 index 0000000..7a53ed5 --- /dev/null +++ b/src/i2s/events_stopped.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_STOPPED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_STOPPED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "I2S transfer stopped.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_stopped](index.html) module"] +pub struct EVENTS_STOPPED_SPEC; +impl crate::RegisterSpec for EVENTS_STOPPED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_stopped::R](R) reader structure"] +impl crate::Readable for EVENTS_STOPPED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_stopped::W](W) writer structure"] +impl crate::Writable for EVENTS_STOPPED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_STOPPED to value 0"] +impl crate::Resettable for EVENTS_STOPPED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/i2s/events_txptrupd.rs b/src/i2s/events_txptrupd.rs new file mode 100644 index 0000000..421786a --- /dev/null +++ b/src/i2s/events_txptrupd.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_TXPTRUPD` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_TXPTRUPD` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "The TDX.PTR register has been copied to internal double-buffers. When the I2S module is started and TX is enabled, this event will be generated for every RXTXD.MAXCNT words that are sent on the SDOUT pin.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_txptrupd](index.html) module"] +pub struct EVENTS_TXPTRUPD_SPEC; +impl crate::RegisterSpec for EVENTS_TXPTRUPD_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_txptrupd::R](R) reader structure"] +impl crate::Readable for EVENTS_TXPTRUPD_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_txptrupd::W](W) writer structure"] +impl crate::Writable for EVENTS_TXPTRUPD_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_TXPTRUPD to value 0"] +impl crate::Resettable for EVENTS_TXPTRUPD_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/i2s/inten.rs b/src/i2s/inten.rs new file mode 100644 index 0000000..3c93648 --- /dev/null +++ b/src/i2s/inten.rs @@ -0,0 +1,345 @@ +#[doc = "Register `INTEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable interrupt for RXPTRUPD event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXPTRUPD_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXPTRUPD_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXPTRUPD` reader - Enable or disable interrupt for RXPTRUPD event"] +pub struct RXPTRUPD_R(crate::FieldReader); +impl RXPTRUPD_R { + pub(crate) fn new(bits: bool) -> Self { + RXPTRUPD_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXPTRUPD_A { + match self.bits { + false => RXPTRUPD_A::DISABLED, + true => RXPTRUPD_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXPTRUPD_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXPTRUPD_A::ENABLED + } +} +impl core::ops::Deref for RXPTRUPD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RXPTRUPD` writer - Enable or disable interrupt for RXPTRUPD event"] +pub struct RXPTRUPD_W<'a> { + w: &'a mut W, +} +impl<'a> RXPTRUPD_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXPTRUPD_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(RXPTRUPD_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(RXPTRUPD_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Enable or disable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` reader - Enable or disable interrupt for STOPPED event"] +pub struct STOPPED_R(crate::FieldReader); +impl STOPPED_R { + pub(crate) fn new(bits: bool) -> Self { + STOPPED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STOPPED_A { + match self.bits { + false => STOPPED_A::DISABLED, + true => STOPPED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STOPPED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STOPPED_A::ENABLED + } +} +impl core::ops::Deref for STOPPED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STOPPED` writer - Enable or disable interrupt for STOPPED event"] +pub struct STOPPED_W<'a> { + w: &'a mut W, +} +impl<'a> STOPPED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STOPPED_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(STOPPED_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(STOPPED_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Enable or disable interrupt for TXPTRUPD event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXPTRUPD_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXPTRUPD_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXPTRUPD` reader - Enable or disable interrupt for TXPTRUPD event"] +pub struct TXPTRUPD_R(crate::FieldReader); +impl TXPTRUPD_R { + pub(crate) fn new(bits: bool) -> Self { + TXPTRUPD_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXPTRUPD_A { + match self.bits { + false => TXPTRUPD_A::DISABLED, + true => TXPTRUPD_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXPTRUPD_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXPTRUPD_A::ENABLED + } +} +impl core::ops::Deref for TXPTRUPD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TXPTRUPD` writer - Enable or disable interrupt for TXPTRUPD event"] +pub struct TXPTRUPD_W<'a> { + w: &'a mut W, +} +impl<'a> TXPTRUPD_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXPTRUPD_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(TXPTRUPD_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(TXPTRUPD_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +impl R { + #[doc = "Bit 1 - Enable or disable interrupt for RXPTRUPD event"] + #[inline(always)] + pub fn rxptrupd(&self) -> RXPTRUPD_R { + RXPTRUPD_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Enable or disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&self) -> STOPPED_R { + STOPPED_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 5 - Enable or disable interrupt for TXPTRUPD event"] + #[inline(always)] + pub fn txptrupd(&self) -> TXPTRUPD_R { + TXPTRUPD_R::new(((self.bits >> 5) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 1 - Enable or disable interrupt for RXPTRUPD event"] + #[inline(always)] + pub fn rxptrupd(&mut self) -> RXPTRUPD_W { + RXPTRUPD_W { w: self } + } + #[doc = "Bit 2 - Enable or disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&mut self) -> STOPPED_W { + STOPPED_W { w: self } + } + #[doc = "Bit 5 - Enable or disable interrupt for TXPTRUPD event"] + #[inline(always)] + pub fn txptrupd(&mut self) -> TXPTRUPD_W { + TXPTRUPD_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable or disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [inten](index.html) module"] +pub struct INTEN_SPEC; +impl crate::RegisterSpec for INTEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [inten::R](R) reader structure"] +impl crate::Readable for INTEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [inten::W](W) writer structure"] +impl crate::Writable for INTEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTEN to value 0"] +impl crate::Resettable for INTEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/i2s/intenclr.rs b/src/i2s/intenclr.rs new file mode 100644 index 0000000..c2424c7 --- /dev/null +++ b/src/i2s/intenclr.rs @@ -0,0 +1,366 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for RXPTRUPD event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXPTRUPD_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXPTRUPD_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXPTRUPD` reader - Write '1' to Disable interrupt for RXPTRUPD event"] +pub struct RXPTRUPD_R(crate::FieldReader); +impl RXPTRUPD_R { + pub(crate) fn new(bits: bool) -> Self { + RXPTRUPD_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXPTRUPD_A { + match self.bits { + false => RXPTRUPD_A::DISABLED, + true => RXPTRUPD_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXPTRUPD_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXPTRUPD_A::ENABLED + } +} +impl core::ops::Deref for RXPTRUPD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for RXPTRUPD event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXPTRUPD_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXPTRUPD_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXPTRUPD` writer - Write '1' to Disable interrupt for RXPTRUPD event"] +pub struct RXPTRUPD_W<'a> { + w: &'a mut W, +} +impl<'a> RXPTRUPD_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXPTRUPD_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(RXPTRUPD_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` reader - Write '1' to Disable interrupt for STOPPED event"] +pub struct STOPPED_R(crate::FieldReader); +impl STOPPED_R { + pub(crate) fn new(bits: bool) -> Self { + STOPPED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STOPPED_A { + match self.bits { + false => STOPPED_A::DISABLED, + true => STOPPED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STOPPED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STOPPED_A::ENABLED + } +} +impl core::ops::Deref for STOPPED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` writer - Write '1' to Disable interrupt for STOPPED event"] +pub struct STOPPED_W<'a> { + w: &'a mut W, +} +impl<'a> STOPPED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STOPPED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(STOPPED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for TXPTRUPD event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXPTRUPD_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXPTRUPD_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXPTRUPD` reader - Write '1' to Disable interrupt for TXPTRUPD event"] +pub struct TXPTRUPD_R(crate::FieldReader); +impl TXPTRUPD_R { + pub(crate) fn new(bits: bool) -> Self { + TXPTRUPD_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXPTRUPD_A { + match self.bits { + false => TXPTRUPD_A::DISABLED, + true => TXPTRUPD_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXPTRUPD_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXPTRUPD_A::ENABLED + } +} +impl core::ops::Deref for TXPTRUPD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TXPTRUPD event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXPTRUPD_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXPTRUPD_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXPTRUPD` writer - Write '1' to Disable interrupt for TXPTRUPD event"] +pub struct TXPTRUPD_W<'a> { + w: &'a mut W, +} +impl<'a> TXPTRUPD_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXPTRUPD_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TXPTRUPD_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +impl R { + #[doc = "Bit 1 - Write '1' to Disable interrupt for RXPTRUPD event"] + #[inline(always)] + pub fn rxptrupd(&self) -> RXPTRUPD_R { + RXPTRUPD_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&self) -> STOPPED_R { + STOPPED_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 5 - Write '1' to Disable interrupt for TXPTRUPD event"] + #[inline(always)] + pub fn txptrupd(&self) -> TXPTRUPD_R { + TXPTRUPD_R::new(((self.bits >> 5) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 1 - Write '1' to Disable interrupt for RXPTRUPD event"] + #[inline(always)] + pub fn rxptrupd(&mut self) -> RXPTRUPD_W { + RXPTRUPD_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&mut self) -> STOPPED_W { + STOPPED_W { w: self } + } + #[doc = "Bit 5 - Write '1' to Disable interrupt for TXPTRUPD event"] + #[inline(always)] + pub fn txptrupd(&mut self) -> TXPTRUPD_W { + TXPTRUPD_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/i2s/intenset.rs b/src/i2s/intenset.rs new file mode 100644 index 0000000..8dee9d3 --- /dev/null +++ b/src/i2s/intenset.rs @@ -0,0 +1,366 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for RXPTRUPD event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXPTRUPD_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXPTRUPD_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXPTRUPD` reader - Write '1' to Enable interrupt for RXPTRUPD event"] +pub struct RXPTRUPD_R(crate::FieldReader); +impl RXPTRUPD_R { + pub(crate) fn new(bits: bool) -> Self { + RXPTRUPD_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXPTRUPD_A { + match self.bits { + false => RXPTRUPD_A::DISABLED, + true => RXPTRUPD_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXPTRUPD_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXPTRUPD_A::ENABLED + } +} +impl core::ops::Deref for RXPTRUPD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for RXPTRUPD event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXPTRUPD_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXPTRUPD_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXPTRUPD` writer - Write '1' to Enable interrupt for RXPTRUPD event"] +pub struct RXPTRUPD_W<'a> { + w: &'a mut W, +} +impl<'a> RXPTRUPD_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXPTRUPD_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(RXPTRUPD_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` reader - Write '1' to Enable interrupt for STOPPED event"] +pub struct STOPPED_R(crate::FieldReader); +impl STOPPED_R { + pub(crate) fn new(bits: bool) -> Self { + STOPPED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STOPPED_A { + match self.bits { + false => STOPPED_A::DISABLED, + true => STOPPED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STOPPED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STOPPED_A::ENABLED + } +} +impl core::ops::Deref for STOPPED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` writer - Write '1' to Enable interrupt for STOPPED event"] +pub struct STOPPED_W<'a> { + w: &'a mut W, +} +impl<'a> STOPPED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STOPPED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(STOPPED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for TXPTRUPD event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXPTRUPD_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXPTRUPD_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXPTRUPD` reader - Write '1' to Enable interrupt for TXPTRUPD event"] +pub struct TXPTRUPD_R(crate::FieldReader); +impl TXPTRUPD_R { + pub(crate) fn new(bits: bool) -> Self { + TXPTRUPD_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXPTRUPD_A { + match self.bits { + false => TXPTRUPD_A::DISABLED, + true => TXPTRUPD_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXPTRUPD_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXPTRUPD_A::ENABLED + } +} +impl core::ops::Deref for TXPTRUPD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TXPTRUPD event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXPTRUPD_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXPTRUPD_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXPTRUPD` writer - Write '1' to Enable interrupt for TXPTRUPD event"] +pub struct TXPTRUPD_W<'a> { + w: &'a mut W, +} +impl<'a> TXPTRUPD_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXPTRUPD_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TXPTRUPD_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +impl R { + #[doc = "Bit 1 - Write '1' to Enable interrupt for RXPTRUPD event"] + #[inline(always)] + pub fn rxptrupd(&self) -> RXPTRUPD_R { + RXPTRUPD_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&self) -> STOPPED_R { + STOPPED_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 5 - Write '1' to Enable interrupt for TXPTRUPD event"] + #[inline(always)] + pub fn txptrupd(&self) -> TXPTRUPD_R { + TXPTRUPD_R::new(((self.bits >> 5) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 1 - Write '1' to Enable interrupt for RXPTRUPD event"] + #[inline(always)] + pub fn rxptrupd(&mut self) -> RXPTRUPD_W { + RXPTRUPD_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&mut self) -> STOPPED_W { + STOPPED_W { w: self } + } + #[doc = "Bit 5 - Write '1' to Enable interrupt for TXPTRUPD event"] + #[inline(always)] + pub fn txptrupd(&mut self) -> TXPTRUPD_W { + TXPTRUPD_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/i2s/psel.rs b/src/i2s/psel.rs new file mode 100644 index 0000000..62ac588 --- /dev/null +++ b/src/i2s/psel.rs @@ -0,0 +1,20 @@ +#[doc = "MCK register accessor: an alias for `Reg`"] +pub type MCK = crate::Reg; +#[doc = "Pin select for MCK signal."] +pub mod mck; +#[doc = "SCK register accessor: an alias for `Reg`"] +pub type SCK = crate::Reg; +#[doc = "Pin select for SCK signal."] +pub mod sck; +#[doc = "LRCK register accessor: an alias for `Reg`"] +pub type LRCK = crate::Reg; +#[doc = "Pin select for LRCK signal."] +pub mod lrck; +#[doc = "SDIN register accessor: an alias for `Reg`"] +pub type SDIN = crate::Reg; +#[doc = "Pin select for SDIN signal."] +pub mod sdin; +#[doc = "SDOUT register accessor: an alias for `Reg`"] +pub type SDOUT = crate::Reg; +#[doc = "Pin select for SDOUT signal."] +pub mod sdout; diff --git a/src/i2s/psel/lrck.rs b/src/i2s/psel/lrck.rs new file mode 100644 index 0000000..11d6f18 --- /dev/null +++ b/src/i2s/psel/lrck.rs @@ -0,0 +1,195 @@ +#[doc = "Register `LRCK` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `LRCK` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PIN` reader - Pin number"] +pub struct PIN_R(crate::FieldReader); +impl PIN_R { + pub(crate) fn new(bits: u8) -> Self { + PIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN` writer - Pin number"] +pub struct PIN_W<'a> { + w: &'a mut W, +} +impl<'a> PIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Connection\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CONNECT_A { + #[doc = "1: Disconnect"] + DISCONNECTED = 1, + #[doc = "0: Connect"] + CONNECTED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: CONNECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CONNECT` reader - Connection"] +pub struct CONNECT_R(crate::FieldReader); +impl CONNECT_R { + pub(crate) fn new(bits: bool) -> Self { + CONNECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CONNECT_A { + match self.bits { + true => CONNECT_A::DISCONNECTED, + false => CONNECT_A::CONNECTED, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == CONNECT_A::DISCONNECTED + } + #[doc = "Checks if the value of the field is `CONNECTED`"] + #[inline(always)] + pub fn is_connected(&self) -> bool { + **self == CONNECT_A::CONNECTED + } +} +impl core::ops::Deref for CONNECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONNECT` writer - Connection"] +pub struct CONNECT_W<'a> { + w: &'a mut W, +} +impl<'a> CONNECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CONNECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(CONNECT_A::DISCONNECTED) + } + #[doc = "Connect"] + #[inline(always)] + pub fn connected(self) -> &'a mut W { + self.variant(CONNECT_A::CONNECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&self) -> PIN_R { + PIN_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&self) -> CONNECT_R { + CONNECT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&mut self) -> PIN_W { + PIN_W { w: self } + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&mut self) -> CONNECT_W { + CONNECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for LRCK signal.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [lrck](index.html) module"] +pub struct LRCK_SPEC; +impl crate::RegisterSpec for LRCK_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [lrck::R](R) reader structure"] +impl crate::Readable for LRCK_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [lrck::W](W) writer structure"] +impl crate::Writable for LRCK_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LRCK to value 0xffff_ffff"] +impl crate::Resettable for LRCK_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/i2s/psel/mck.rs b/src/i2s/psel/mck.rs new file mode 100644 index 0000000..65b2345 --- /dev/null +++ b/src/i2s/psel/mck.rs @@ -0,0 +1,195 @@ +#[doc = "Register `MCK` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MCK` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PIN` reader - Pin number"] +pub struct PIN_R(crate::FieldReader); +impl PIN_R { + pub(crate) fn new(bits: u8) -> Self { + PIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN` writer - Pin number"] +pub struct PIN_W<'a> { + w: &'a mut W, +} +impl<'a> PIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Connection\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CONNECT_A { + #[doc = "1: Disconnect"] + DISCONNECTED = 1, + #[doc = "0: Connect"] + CONNECTED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: CONNECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CONNECT` reader - Connection"] +pub struct CONNECT_R(crate::FieldReader); +impl CONNECT_R { + pub(crate) fn new(bits: bool) -> Self { + CONNECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CONNECT_A { + match self.bits { + true => CONNECT_A::DISCONNECTED, + false => CONNECT_A::CONNECTED, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == CONNECT_A::DISCONNECTED + } + #[doc = "Checks if the value of the field is `CONNECTED`"] + #[inline(always)] + pub fn is_connected(&self) -> bool { + **self == CONNECT_A::CONNECTED + } +} +impl core::ops::Deref for CONNECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONNECT` writer - Connection"] +pub struct CONNECT_W<'a> { + w: &'a mut W, +} +impl<'a> CONNECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CONNECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(CONNECT_A::DISCONNECTED) + } + #[doc = "Connect"] + #[inline(always)] + pub fn connected(self) -> &'a mut W { + self.variant(CONNECT_A::CONNECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&self) -> PIN_R { + PIN_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&self) -> CONNECT_R { + CONNECT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&mut self) -> PIN_W { + PIN_W { w: self } + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&mut self) -> CONNECT_W { + CONNECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for MCK signal.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mck](index.html) module"] +pub struct MCK_SPEC; +impl crate::RegisterSpec for MCK_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mck::R](R) reader structure"] +impl crate::Readable for MCK_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mck::W](W) writer structure"] +impl crate::Writable for MCK_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MCK to value 0xffff_ffff"] +impl crate::Resettable for MCK_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/i2s/psel/sck.rs b/src/i2s/psel/sck.rs new file mode 100644 index 0000000..a749467 --- /dev/null +++ b/src/i2s/psel/sck.rs @@ -0,0 +1,195 @@ +#[doc = "Register `SCK` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SCK` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PIN` reader - Pin number"] +pub struct PIN_R(crate::FieldReader); +impl PIN_R { + pub(crate) fn new(bits: u8) -> Self { + PIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN` writer - Pin number"] +pub struct PIN_W<'a> { + w: &'a mut W, +} +impl<'a> PIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Connection\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CONNECT_A { + #[doc = "1: Disconnect"] + DISCONNECTED = 1, + #[doc = "0: Connect"] + CONNECTED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: CONNECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CONNECT` reader - Connection"] +pub struct CONNECT_R(crate::FieldReader); +impl CONNECT_R { + pub(crate) fn new(bits: bool) -> Self { + CONNECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CONNECT_A { + match self.bits { + true => CONNECT_A::DISCONNECTED, + false => CONNECT_A::CONNECTED, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == CONNECT_A::DISCONNECTED + } + #[doc = "Checks if the value of the field is `CONNECTED`"] + #[inline(always)] + pub fn is_connected(&self) -> bool { + **self == CONNECT_A::CONNECTED + } +} +impl core::ops::Deref for CONNECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONNECT` writer - Connection"] +pub struct CONNECT_W<'a> { + w: &'a mut W, +} +impl<'a> CONNECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CONNECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(CONNECT_A::DISCONNECTED) + } + #[doc = "Connect"] + #[inline(always)] + pub fn connected(self) -> &'a mut W { + self.variant(CONNECT_A::CONNECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&self) -> PIN_R { + PIN_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&self) -> CONNECT_R { + CONNECT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&mut self) -> PIN_W { + PIN_W { w: self } + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&mut self) -> CONNECT_W { + CONNECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for SCK signal.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sck](index.html) module"] +pub struct SCK_SPEC; +impl crate::RegisterSpec for SCK_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sck::R](R) reader structure"] +impl crate::Readable for SCK_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sck::W](W) writer structure"] +impl crate::Writable for SCK_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SCK to value 0xffff_ffff"] +impl crate::Resettable for SCK_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/i2s/psel/sdin.rs b/src/i2s/psel/sdin.rs new file mode 100644 index 0000000..386b2f0 --- /dev/null +++ b/src/i2s/psel/sdin.rs @@ -0,0 +1,195 @@ +#[doc = "Register `SDIN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SDIN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PIN` reader - Pin number"] +pub struct PIN_R(crate::FieldReader); +impl PIN_R { + pub(crate) fn new(bits: u8) -> Self { + PIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN` writer - Pin number"] +pub struct PIN_W<'a> { + w: &'a mut W, +} +impl<'a> PIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Connection\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CONNECT_A { + #[doc = "1: Disconnect"] + DISCONNECTED = 1, + #[doc = "0: Connect"] + CONNECTED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: CONNECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CONNECT` reader - Connection"] +pub struct CONNECT_R(crate::FieldReader); +impl CONNECT_R { + pub(crate) fn new(bits: bool) -> Self { + CONNECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CONNECT_A { + match self.bits { + true => CONNECT_A::DISCONNECTED, + false => CONNECT_A::CONNECTED, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == CONNECT_A::DISCONNECTED + } + #[doc = "Checks if the value of the field is `CONNECTED`"] + #[inline(always)] + pub fn is_connected(&self) -> bool { + **self == CONNECT_A::CONNECTED + } +} +impl core::ops::Deref for CONNECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONNECT` writer - Connection"] +pub struct CONNECT_W<'a> { + w: &'a mut W, +} +impl<'a> CONNECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CONNECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(CONNECT_A::DISCONNECTED) + } + #[doc = "Connect"] + #[inline(always)] + pub fn connected(self) -> &'a mut W { + self.variant(CONNECT_A::CONNECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&self) -> PIN_R { + PIN_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&self) -> CONNECT_R { + CONNECT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&mut self) -> PIN_W { + PIN_W { w: self } + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&mut self) -> CONNECT_W { + CONNECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for SDIN signal.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sdin](index.html) module"] +pub struct SDIN_SPEC; +impl crate::RegisterSpec for SDIN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sdin::R](R) reader structure"] +impl crate::Readable for SDIN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sdin::W](W) writer structure"] +impl crate::Writable for SDIN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SDIN to value 0xffff_ffff"] +impl crate::Resettable for SDIN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/i2s/psel/sdout.rs b/src/i2s/psel/sdout.rs new file mode 100644 index 0000000..8464c73 --- /dev/null +++ b/src/i2s/psel/sdout.rs @@ -0,0 +1,195 @@ +#[doc = "Register `SDOUT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SDOUT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PIN` reader - Pin number"] +pub struct PIN_R(crate::FieldReader); +impl PIN_R { + pub(crate) fn new(bits: u8) -> Self { + PIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN` writer - Pin number"] +pub struct PIN_W<'a> { + w: &'a mut W, +} +impl<'a> PIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Connection\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CONNECT_A { + #[doc = "1: Disconnect"] + DISCONNECTED = 1, + #[doc = "0: Connect"] + CONNECTED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: CONNECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CONNECT` reader - Connection"] +pub struct CONNECT_R(crate::FieldReader); +impl CONNECT_R { + pub(crate) fn new(bits: bool) -> Self { + CONNECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CONNECT_A { + match self.bits { + true => CONNECT_A::DISCONNECTED, + false => CONNECT_A::CONNECTED, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == CONNECT_A::DISCONNECTED + } + #[doc = "Checks if the value of the field is `CONNECTED`"] + #[inline(always)] + pub fn is_connected(&self) -> bool { + **self == CONNECT_A::CONNECTED + } +} +impl core::ops::Deref for CONNECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONNECT` writer - Connection"] +pub struct CONNECT_W<'a> { + w: &'a mut W, +} +impl<'a> CONNECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CONNECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(CONNECT_A::DISCONNECTED) + } + #[doc = "Connect"] + #[inline(always)] + pub fn connected(self) -> &'a mut W { + self.variant(CONNECT_A::CONNECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&self) -> PIN_R { + PIN_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&self) -> CONNECT_R { + CONNECT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&mut self) -> PIN_W { + PIN_W { w: self } + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&mut self) -> CONNECT_W { + CONNECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for SDOUT signal.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sdout](index.html) module"] +pub struct SDOUT_SPEC; +impl crate::RegisterSpec for SDOUT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sdout::R](R) reader structure"] +impl crate::Readable for SDOUT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sdout::W](W) writer structure"] +impl crate::Writable for SDOUT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SDOUT to value 0xffff_ffff"] +impl crate::Resettable for SDOUT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/i2s/rxd.rs b/src/i2s/rxd.rs new file mode 100644 index 0000000..750f78b --- /dev/null +++ b/src/i2s/rxd.rs @@ -0,0 +1,4 @@ +#[doc = "PTR register accessor: an alias for `Reg`"] +pub type PTR = crate::Reg; +#[doc = "Receive buffer RAM start address."] +pub mod ptr; diff --git a/src/i2s/rxd/ptr.rs b/src/i2s/rxd/ptr.rs new file mode 100644 index 0000000..c6eb37d --- /dev/null +++ b/src/i2s/rxd/ptr.rs @@ -0,0 +1,102 @@ +#[doc = "Register `PTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PTR` reader - Receive buffer Data RAM start address. When receiving, words containing samples will be written to this address. This address is a word aligned Data RAM address."] +pub struct PTR_R(crate::FieldReader); +impl PTR_R { + pub(crate) fn new(bits: u32) -> Self { + PTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PTR` writer - Receive buffer Data RAM start address. When receiving, words containing samples will be written to this address. This address is a word aligned Data RAM address."] +pub struct PTR_W<'a> { + w: &'a mut W, +} +impl<'a> PTR_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Receive buffer Data RAM start address. When receiving, words containing samples will be written to this address. This address is a word aligned Data RAM address."] + #[inline(always)] + pub fn ptr(&self) -> PTR_R { + PTR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Receive buffer Data RAM start address. When receiving, words containing samples will be written to this address. This address is a word aligned Data RAM address."] + #[inline(always)] + pub fn ptr(&mut self) -> PTR_W { + PTR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Receive buffer RAM start address.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ptr](index.html) module"] +pub struct PTR_SPEC; +impl crate::RegisterSpec for PTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ptr::R](R) reader structure"] +impl crate::Readable for PTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ptr::W](W) writer structure"] +impl crate::Writable for PTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PTR to value 0"] +impl crate::Resettable for PTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/i2s/rxtxd.rs b/src/i2s/rxtxd.rs new file mode 100644 index 0000000..c8145f0 --- /dev/null +++ b/src/i2s/rxtxd.rs @@ -0,0 +1,4 @@ +#[doc = "MAXCNT register accessor: an alias for `Reg`"] +pub type MAXCNT = crate::Reg; +#[doc = "Size of RXD and TXD buffers."] +pub mod maxcnt; diff --git a/src/i2s/rxtxd/maxcnt.rs b/src/i2s/rxtxd/maxcnt.rs new file mode 100644 index 0000000..b2cb834 --- /dev/null +++ b/src/i2s/rxtxd/maxcnt.rs @@ -0,0 +1,102 @@ +#[doc = "Register `MAXCNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MAXCNT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `MAXCNT` reader - Size of RXD and TXD buffers in number of 32 bit words."] +pub struct MAXCNT_R(crate::FieldReader); +impl MAXCNT_R { + pub(crate) fn new(bits: u16) -> Self { + MAXCNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MAXCNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MAXCNT` writer - Size of RXD and TXD buffers in number of 32 bit words."] +pub struct MAXCNT_W<'a> { + w: &'a mut W, +} +impl<'a> MAXCNT_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !0x3fff) | (value as u32 & 0x3fff); + self.w + } +} +impl R { + #[doc = "Bits 0:13 - Size of RXD and TXD buffers in number of 32 bit words."] + #[inline(always)] + pub fn maxcnt(&self) -> MAXCNT_R { + MAXCNT_R::new((self.bits & 0x3fff) as u16) + } +} +impl W { + #[doc = "Bits 0:13 - Size of RXD and TXD buffers in number of 32 bit words."] + #[inline(always)] + pub fn maxcnt(&mut self) -> MAXCNT_W { + MAXCNT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Size of RXD and TXD buffers.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [maxcnt](index.html) module"] +pub struct MAXCNT_SPEC; +impl crate::RegisterSpec for MAXCNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [maxcnt::R](R) reader structure"] +impl crate::Readable for MAXCNT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [maxcnt::W](W) writer structure"] +impl crate::Writable for MAXCNT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MAXCNT to value 0"] +impl crate::Resettable for MAXCNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/i2s/tasks_start.rs b/src/i2s/tasks_start.rs new file mode 100644 index 0000000..841d9a2 --- /dev/null +++ b/src/i2s/tasks_start.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_START` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Starts continuous I2S transfer. Also starts MCK generator when this is enabled.\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_start](index.html) module"] +pub struct TASKS_START_SPEC; +impl crate::RegisterSpec for TASKS_START_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_start::W](W) writer structure"] +impl crate::Writable for TASKS_START_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_START to value 0"] +impl crate::Resettable for TASKS_START_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/i2s/tasks_stop.rs b/src/i2s/tasks_stop.rs new file mode 100644 index 0000000..ca79e15 --- /dev/null +++ b/src/i2s/tasks_stop.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STOP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Stops I2S transfer. Also stops MCK generator. Triggering this task will cause the {event:STOPPED} event to be generated.\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_stop](index.html) module"] +pub struct TASKS_STOP_SPEC; +impl crate::RegisterSpec for TASKS_STOP_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_stop::W](W) writer structure"] +impl crate::Writable for TASKS_STOP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STOP to value 0"] +impl crate::Resettable for TASKS_STOP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/i2s/txd.rs b/src/i2s/txd.rs new file mode 100644 index 0000000..c643b5b --- /dev/null +++ b/src/i2s/txd.rs @@ -0,0 +1,4 @@ +#[doc = "PTR register accessor: an alias for `Reg`"] +pub type PTR = crate::Reg; +#[doc = "Transmit buffer RAM start address."] +pub mod ptr; diff --git a/src/i2s/txd/ptr.rs b/src/i2s/txd/ptr.rs new file mode 100644 index 0000000..beea6f0 --- /dev/null +++ b/src/i2s/txd/ptr.rs @@ -0,0 +1,102 @@ +#[doc = "Register `PTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PTR` reader - Transmit buffer Data RAM start address. When transmitting, words containing samples will be fetched from this address. This address is a word aligned Data RAM address."] +pub struct PTR_R(crate::FieldReader); +impl PTR_R { + pub(crate) fn new(bits: u32) -> Self { + PTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PTR` writer - Transmit buffer Data RAM start address. When transmitting, words containing samples will be fetched from this address. This address is a word aligned Data RAM address."] +pub struct PTR_W<'a> { + w: &'a mut W, +} +impl<'a> PTR_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Transmit buffer Data RAM start address. When transmitting, words containing samples will be fetched from this address. This address is a word aligned Data RAM address."] + #[inline(always)] + pub fn ptr(&self) -> PTR_R { + PTR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Transmit buffer Data RAM start address. When transmitting, words containing samples will be fetched from this address. This address is a word aligned Data RAM address."] + #[inline(always)] + pub fn ptr(&mut self) -> PTR_W { + PTR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Transmit buffer RAM start address.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ptr](index.html) module"] +pub struct PTR_SPEC; +impl crate::RegisterSpec for PTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ptr::R](R) reader structure"] +impl crate::Readable for PTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ptr::W](W) writer structure"] +impl crate::Writable for PTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PTR to value 0"] +impl crate::Resettable for PTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..eeae937 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,2350 @@ +#![doc = "Peripheral access API for NRF52 microcontrollers (generated using svd2rust v0.19.0 ( ))\n\nYou can find an overview of the generated API [here].\n\nAPI features to be included in the [next] +svd2rust release can be generated by cloning the svd2rust [repository], checking out the above commit, and running `cargo doc --open`.\n\n[here]: https://docs.rs/svd2rust/0.19.0/svd2rust/#peripheral-api\n[next]: https://github.com/rust-embedded/svd2rust/blob/master/CHANGELOG.md#unreleased\n[repository]: https://github.com/rust-embedded/svd2rust"] +#![deny(const_err)] +#![deny(dead_code)] +#![deny(improper_ctypes)] +#![deny(missing_docs)] +#![deny(no_mangle_generic_items)] +#![deny(non_shorthand_field_patterns)] +#![deny(overflowing_literals)] +#![deny(path_statements)] +#![deny(patterns_in_fns_without_body)] +#![deny(private_in_public)] +#![deny(unconditional_recursion)] +#![deny(unused_allocation)] +#![deny(unused_comparisons)] +#![deny(unused_parens)] +#![deny(while_true)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![no_std] +use core::marker::PhantomData; +use core::ops::Deref; +#[doc = r"Number available in the NVIC for configuring priority"] +pub const NVIC_PRIO_BITS: u8 = 3; +#[cfg(feature = "rt")] +pub use self::Interrupt as interrupt; +pub use cortex_m::peripheral::Peripherals as CorePeripherals; +pub use cortex_m::peripheral::{CBP, CPUID, DCB, DWT, FPB, FPU, ITM, MPU, NVIC, SCB, SYST, TPIU}; +#[cfg(feature = "rt")] +pub use cortex_m_rt::interrupt; +#[allow(unused_imports)] +use generic::*; +#[doc = r"Common register and bit access and modify traits"] +pub mod generic; +#[cfg(feature = "rt")] +extern "C" { + fn POWER_CLOCK(); + fn RADIO(); + fn UARTE0_UART0(); + fn SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0(); + fn SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1(); + fn NFCT(); + fn GPIOTE(); + fn SAADC(); + fn TIMER0(); + fn TIMER1(); + fn TIMER2(); + fn RTC0(); + fn TEMP(); + fn RNG(); + fn ECB(); + fn CCM_AAR(); + fn WDT(); + fn RTC1(); + fn QDEC(); + fn COMP_LPCOMP(); + fn SWI0_EGU0(); + fn SWI1_EGU1(); + fn SWI2_EGU2(); + fn SWI3_EGU3(); + fn SWI4_EGU4(); + fn SWI5_EGU5(); + fn TIMER3(); + fn TIMER4(); + fn PWM0(); + fn PDM(); + fn MWU(); + fn PWM1(); + fn PWM2(); + fn SPIM2_SPIS2_SPI2(); + fn RTC2(); + fn I2S(); + fn FPU(); +} +#[doc(hidden)] +pub union Vector { + _handler: unsafe extern "C" fn(), + _reserved: u32, +} +#[cfg(feature = "rt")] +#[doc(hidden)] +#[link_section = ".vector_table.interrupts"] +#[no_mangle] +pub static __INTERRUPTS: [Vector; 39] = [ + Vector { + _handler: POWER_CLOCK, + }, + Vector { _handler: RADIO }, + Vector { + _handler: UARTE0_UART0, + }, + Vector { + _handler: SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0, + }, + Vector { + _handler: SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1, + }, + Vector { _handler: NFCT }, + Vector { _handler: GPIOTE }, + Vector { _handler: SAADC }, + Vector { _handler: TIMER0 }, + Vector { _handler: TIMER1 }, + Vector { _handler: TIMER2 }, + Vector { _handler: RTC0 }, + Vector { _handler: TEMP }, + Vector { _handler: RNG }, + Vector { _handler: ECB }, + Vector { _handler: CCM_AAR }, + Vector { _handler: WDT }, + Vector { _handler: RTC1 }, + Vector { _handler: QDEC }, + Vector { + _handler: COMP_LPCOMP, + }, + Vector { + _handler: SWI0_EGU0, + }, + Vector { + _handler: SWI1_EGU1, + }, + Vector { + _handler: SWI2_EGU2, + }, + Vector { + _handler: SWI3_EGU3, + }, + Vector { + _handler: SWI4_EGU4, + }, + Vector { + _handler: SWI5_EGU5, + }, + Vector { _handler: TIMER3 }, + Vector { _handler: TIMER4 }, + Vector { _handler: PWM0 }, + Vector { _handler: PDM }, + Vector { _reserved: 0 }, + Vector { _reserved: 0 }, + Vector { _handler: MWU }, + Vector { _handler: PWM1 }, + Vector { _handler: PWM2 }, + Vector { + _handler: SPIM2_SPIS2_SPI2, + }, + Vector { _handler: RTC2 }, + Vector { _handler: I2S }, + Vector { _handler: FPU }, +]; +#[doc = r"Enumeration of all the interrupts."] +#[derive(Copy, Clone, Debug, PartialEq, Eq)] +#[repr(u16)] +pub enum Interrupt { + #[doc = "0 - POWER_CLOCK"] + POWER_CLOCK = 0, + #[doc = "1 - RADIO"] + RADIO = 1, + #[doc = "2 - UARTE0_UART0"] + UARTE0_UART0 = 2, + #[doc = "3 - SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0"] + SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0 = 3, + #[doc = "4 - SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1"] + SPIM1_SPIS1_TWIM1_TWIS1_SPI1_TWI1 = 4, + #[doc = "5 - NFCT"] + NFCT = 5, + #[doc = "6 - GPIOTE"] + GPIOTE = 6, + #[doc = "7 - SAADC"] + SAADC = 7, + #[doc = "8 - TIMER0"] + TIMER0 = 8, + #[doc = "9 - TIMER1"] + TIMER1 = 9, + #[doc = "10 - TIMER2"] + TIMER2 = 10, + #[doc = "11 - RTC0"] + RTC0 = 11, + #[doc = "12 - TEMP"] + TEMP = 12, + #[doc = "13 - RNG"] + RNG = 13, + #[doc = "14 - ECB"] + ECB = 14, + #[doc = "15 - CCM_AAR"] + CCM_AAR = 15, + #[doc = "16 - WDT"] + WDT = 16, + #[doc = "17 - RTC1"] + RTC1 = 17, + #[doc = "18 - QDEC"] + QDEC = 18, + #[doc = "19 - COMP_LPCOMP"] + COMP_LPCOMP = 19, + #[doc = "20 - SWI0_EGU0"] + SWI0_EGU0 = 20, + #[doc = "21 - SWI1_EGU1"] + SWI1_EGU1 = 21, + #[doc = "22 - SWI2_EGU2"] + SWI2_EGU2 = 22, + #[doc = "23 - SWI3_EGU3"] + SWI3_EGU3 = 23, + #[doc = "24 - SWI4_EGU4"] + SWI4_EGU4 = 24, + #[doc = "25 - SWI5_EGU5"] + SWI5_EGU5 = 25, + #[doc = "26 - TIMER3"] + TIMER3 = 26, + #[doc = "27 - TIMER4"] + TIMER4 = 27, + #[doc = "28 - PWM0"] + PWM0 = 28, + #[doc = "29 - PDM"] + PDM = 29, + #[doc = "32 - MWU"] + MWU = 32, + #[doc = "33 - PWM1"] + PWM1 = 33, + #[doc = "34 - PWM2"] + PWM2 = 34, + #[doc = "35 - SPIM2_SPIS2_SPI2"] + SPIM2_SPIS2_SPI2 = 35, + #[doc = "36 - RTC2"] + RTC2 = 36, + #[doc = "37 - I2S"] + I2S = 37, + #[doc = "38 - FPU"] + FPU = 38, +} +unsafe impl cortex_m::interrupt::InterruptNumber for Interrupt { + #[inline(always)] + fn number(self) -> u16 { + self as u16 + } +} +#[doc = "Factory Information Configuration Registers"] +pub struct FICR { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for FICR {} +impl FICR { + #[doc = r"Pointer to the register block"] + pub const PTR: *const ficr::RegisterBlock = 0x1000_0000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const ficr::RegisterBlock { + Self::PTR + } +} +impl Deref for FICR { + type Target = ficr::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for FICR { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("FICR").finish() + } +} +#[doc = "Factory Information Configuration Registers"] +pub mod ficr; +#[doc = "User Information Configuration Registers"] +pub struct UICR { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for UICR {} +impl UICR { + #[doc = r"Pointer to the register block"] + pub const PTR: *const uicr::RegisterBlock = 0x1000_1000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const uicr::RegisterBlock { + Self::PTR + } +} +impl Deref for UICR { + type Target = uicr::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for UICR { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("UICR").finish() + } +} +#[doc = "User Information Configuration Registers"] +pub mod uicr; +#[doc = "Access Port Protection"] +pub struct APPROTECT { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for APPROTECT {} +impl APPROTECT { + #[doc = r"Pointer to the register block"] + pub const PTR: *const approtect::RegisterBlock = 0x4000_0000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const approtect::RegisterBlock { + Self::PTR + } +} +impl Deref for APPROTECT { + type Target = approtect::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for APPROTECT { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("APPROTECT").finish() + } +} +#[doc = "Access Port Protection"] +pub mod approtect; +#[doc = "Block Protect"] +pub struct BPROT { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for BPROT {} +impl BPROT { + #[doc = r"Pointer to the register block"] + pub const PTR: *const bprot::RegisterBlock = 0x4000_0000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const bprot::RegisterBlock { + Self::PTR + } +} +impl Deref for BPROT { + type Target = bprot::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for BPROT { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("BPROT").finish() + } +} +#[doc = "Block Protect"] +pub mod bprot; +#[doc = "Power control"] +pub struct POWER { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for POWER {} +impl POWER { + #[doc = r"Pointer to the register block"] + pub const PTR: *const power::RegisterBlock = 0x4000_0000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const power::RegisterBlock { + Self::PTR + } +} +impl Deref for POWER { + type Target = power::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for POWER { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("POWER").finish() + } +} +#[doc = "Power control"] +pub mod power; +#[doc = "Clock control"] +pub struct CLOCK { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for CLOCK {} +impl CLOCK { + #[doc = r"Pointer to the register block"] + pub const PTR: *const clock::RegisterBlock = 0x4000_0000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const clock::RegisterBlock { + Self::PTR + } +} +impl Deref for CLOCK { + type Target = clock::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CLOCK { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CLOCK").finish() + } +} +#[doc = "Clock control"] +pub mod clock; +#[doc = "2.4 GHz Radio"] +pub struct RADIO { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for RADIO {} +impl RADIO { + #[doc = r"Pointer to the register block"] + pub const PTR: *const radio::RegisterBlock = 0x4000_1000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const radio::RegisterBlock { + Self::PTR + } +} +impl Deref for RADIO { + type Target = radio::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for RADIO { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("RADIO").finish() + } +} +#[doc = "2.4 GHz Radio"] +pub mod radio; +#[doc = "UART with EasyDMA"] +pub struct UARTE0 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for UARTE0 {} +impl UARTE0 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const uarte0::RegisterBlock = 0x4000_2000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const uarte0::RegisterBlock { + Self::PTR + } +} +impl Deref for UARTE0 { + type Target = uarte0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for UARTE0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("UARTE0").finish() + } +} +#[doc = "UART with EasyDMA"] +pub mod uarte0; +#[doc = "Universal Asynchronous Receiver/Transmitter"] +pub struct UART0 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for UART0 {} +impl UART0 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const uart0::RegisterBlock = 0x4000_2000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const uart0::RegisterBlock { + Self::PTR + } +} +impl Deref for UART0 { + type Target = uart0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for UART0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("UART0").finish() + } +} +#[doc = "Universal Asynchronous Receiver/Transmitter"] +pub mod uart0; +#[doc = "Serial Peripheral Interface Master with EasyDMA 0"] +pub struct SPIM0 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for SPIM0 {} +impl SPIM0 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const spim0::RegisterBlock = 0x4000_3000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const spim0::RegisterBlock { + Self::PTR + } +} +impl Deref for SPIM0 { + type Target = spim0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for SPIM0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("SPIM0").finish() + } +} +#[doc = "Serial Peripheral Interface Master with EasyDMA 0"] +pub mod spim0; +#[doc = "SPI Slave 0"] +pub struct SPIS0 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for SPIS0 {} +impl SPIS0 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const spis0::RegisterBlock = 0x4000_3000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const spis0::RegisterBlock { + Self::PTR + } +} +impl Deref for SPIS0 { + type Target = spis0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for SPIS0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("SPIS0").finish() + } +} +#[doc = "SPI Slave 0"] +pub mod spis0; +#[doc = "I2C compatible Two-Wire Master Interface with EasyDMA 0"] +pub struct TWIM0 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for TWIM0 {} +impl TWIM0 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const twim0::RegisterBlock = 0x4000_3000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const twim0::RegisterBlock { + Self::PTR + } +} +impl Deref for TWIM0 { + type Target = twim0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for TWIM0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("TWIM0").finish() + } +} +#[doc = "I2C compatible Two-Wire Master Interface with EasyDMA 0"] +pub mod twim0; +#[doc = "I2C compatible Two-Wire Slave Interface with EasyDMA 0"] +pub struct TWIS0 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for TWIS0 {} +impl TWIS0 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const twis0::RegisterBlock = 0x4000_3000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const twis0::RegisterBlock { + Self::PTR + } +} +impl Deref for TWIS0 { + type Target = twis0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for TWIS0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("TWIS0").finish() + } +} +#[doc = "I2C compatible Two-Wire Slave Interface with EasyDMA 0"] +pub mod twis0; +#[doc = "Serial Peripheral Interface 0"] +pub struct SPI0 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for SPI0 {} +impl SPI0 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const spi0::RegisterBlock = 0x4000_3000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const spi0::RegisterBlock { + Self::PTR + } +} +impl Deref for SPI0 { + type Target = spi0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for SPI0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("SPI0").finish() + } +} +#[doc = "Serial Peripheral Interface 0"] +pub mod spi0; +#[doc = "I2C compatible Two-Wire Interface 0"] +pub struct TWI0 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for TWI0 {} +impl TWI0 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const twi0::RegisterBlock = 0x4000_3000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const twi0::RegisterBlock { + Self::PTR + } +} +impl Deref for TWI0 { + type Target = twi0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for TWI0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("TWI0").finish() + } +} +#[doc = "I2C compatible Two-Wire Interface 0"] +pub mod twi0; +#[doc = "Serial Peripheral Interface Master with EasyDMA 1"] +pub struct SPIM1 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for SPIM1 {} +impl SPIM1 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const spim0::RegisterBlock = 0x4000_4000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const spim0::RegisterBlock { + Self::PTR + } +} +impl Deref for SPIM1 { + type Target = spim0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for SPIM1 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("SPIM1").finish() + } +} +#[doc = "SPI Slave 1"] +pub struct SPIS1 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for SPIS1 {} +impl SPIS1 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const spis0::RegisterBlock = 0x4000_4000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const spis0::RegisterBlock { + Self::PTR + } +} +impl Deref for SPIS1 { + type Target = spis0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for SPIS1 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("SPIS1").finish() + } +} +#[doc = "I2C compatible Two-Wire Master Interface with EasyDMA 1"] +pub struct TWIM1 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for TWIM1 {} +impl TWIM1 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const twim0::RegisterBlock = 0x4000_4000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const twim0::RegisterBlock { + Self::PTR + } +} +impl Deref for TWIM1 { + type Target = twim0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for TWIM1 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("TWIM1").finish() + } +} +#[doc = "I2C compatible Two-Wire Slave Interface with EasyDMA 1"] +pub struct TWIS1 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for TWIS1 {} +impl TWIS1 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const twis0::RegisterBlock = 0x4000_4000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const twis0::RegisterBlock { + Self::PTR + } +} +impl Deref for TWIS1 { + type Target = twis0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for TWIS1 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("TWIS1").finish() + } +} +#[doc = "Serial Peripheral Interface 1"] +pub struct SPI1 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for SPI1 {} +impl SPI1 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const spi0::RegisterBlock = 0x4000_4000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const spi0::RegisterBlock { + Self::PTR + } +} +impl Deref for SPI1 { + type Target = spi0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for SPI1 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("SPI1").finish() + } +} +#[doc = "I2C compatible Two-Wire Interface 1"] +pub struct TWI1 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for TWI1 {} +impl TWI1 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const twi0::RegisterBlock = 0x4000_4000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const twi0::RegisterBlock { + Self::PTR + } +} +impl Deref for TWI1 { + type Target = twi0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for TWI1 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("TWI1").finish() + } +} +#[doc = "NFC-A compatible radio"] +pub struct NFCT { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for NFCT {} +impl NFCT { + #[doc = r"Pointer to the register block"] + pub const PTR: *const nfct::RegisterBlock = 0x4000_5000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const nfct::RegisterBlock { + Self::PTR + } +} +impl Deref for NFCT { + type Target = nfct::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for NFCT { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("NFCT").finish() + } +} +#[doc = "NFC-A compatible radio"] +pub mod nfct; +#[doc = "GPIO Tasks and Events"] +pub struct GPIOTE { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for GPIOTE {} +impl GPIOTE { + #[doc = r"Pointer to the register block"] + pub const PTR: *const gpiote::RegisterBlock = 0x4000_6000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const gpiote::RegisterBlock { + Self::PTR + } +} +impl Deref for GPIOTE { + type Target = gpiote::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for GPIOTE { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("GPIOTE").finish() + } +} +#[doc = "GPIO Tasks and Events"] +pub mod gpiote; +#[doc = "Analog to Digital Converter"] +pub struct SAADC { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for SAADC {} +impl SAADC { + #[doc = r"Pointer to the register block"] + pub const PTR: *const saadc::RegisterBlock = 0x4000_7000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const saadc::RegisterBlock { + Self::PTR + } +} +impl Deref for SAADC { + type Target = saadc::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for SAADC { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("SAADC").finish() + } +} +#[doc = "Analog to Digital Converter"] +pub mod saadc; +#[doc = "Timer/Counter 0"] +pub struct TIMER0 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for TIMER0 {} +impl TIMER0 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const timer0::RegisterBlock = 0x4000_8000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const timer0::RegisterBlock { + Self::PTR + } +} +impl Deref for TIMER0 { + type Target = timer0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for TIMER0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("TIMER0").finish() + } +} +#[doc = "Timer/Counter 0"] +pub mod timer0; +#[doc = "Timer/Counter 1"] +pub struct TIMER1 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for TIMER1 {} +impl TIMER1 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const timer0::RegisterBlock = 0x4000_9000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const timer0::RegisterBlock { + Self::PTR + } +} +impl Deref for TIMER1 { + type Target = timer0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for TIMER1 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("TIMER1").finish() + } +} +#[doc = "Timer/Counter 2"] +pub struct TIMER2 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for TIMER2 {} +impl TIMER2 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const timer0::RegisterBlock = 0x4000_a000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const timer0::RegisterBlock { + Self::PTR + } +} +impl Deref for TIMER2 { + type Target = timer0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for TIMER2 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("TIMER2").finish() + } +} +#[doc = "Real time counter 0"] +pub struct RTC0 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for RTC0 {} +impl RTC0 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const rtc0::RegisterBlock = 0x4000_b000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const rtc0::RegisterBlock { + Self::PTR + } +} +impl Deref for RTC0 { + type Target = rtc0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for RTC0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("RTC0").finish() + } +} +#[doc = "Real time counter 0"] +pub mod rtc0; +#[doc = "Temperature Sensor"] +pub struct TEMP { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for TEMP {} +impl TEMP { + #[doc = r"Pointer to the register block"] + pub const PTR: *const temp::RegisterBlock = 0x4000_c000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const temp::RegisterBlock { + Self::PTR + } +} +impl Deref for TEMP { + type Target = temp::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for TEMP { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("TEMP").finish() + } +} +#[doc = "Temperature Sensor"] +pub mod temp; +#[doc = "Random Number Generator"] +pub struct RNG { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for RNG {} +impl RNG { + #[doc = r"Pointer to the register block"] + pub const PTR: *const rng::RegisterBlock = 0x4000_d000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const rng::RegisterBlock { + Self::PTR + } +} +impl Deref for RNG { + type Target = rng::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for RNG { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("RNG").finish() + } +} +#[doc = "Random Number Generator"] +pub mod rng; +#[doc = "AES ECB Mode Encryption"] +pub struct ECB { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for ECB {} +impl ECB { + #[doc = r"Pointer to the register block"] + pub const PTR: *const ecb::RegisterBlock = 0x4000_e000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const ecb::RegisterBlock { + Self::PTR + } +} +impl Deref for ECB { + type Target = ecb::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for ECB { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("ECB").finish() + } +} +#[doc = "AES ECB Mode Encryption"] +pub mod ecb; +#[doc = "AES CCM Mode Encryption"] +pub struct CCM { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for CCM {} +impl CCM { + #[doc = r"Pointer to the register block"] + pub const PTR: *const ccm::RegisterBlock = 0x4000_f000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const ccm::RegisterBlock { + Self::PTR + } +} +impl Deref for CCM { + type Target = ccm::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for CCM { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("CCM").finish() + } +} +#[doc = "AES CCM Mode Encryption"] +pub mod ccm; +#[doc = "Accelerated Address Resolver"] +pub struct AAR { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for AAR {} +impl AAR { + #[doc = r"Pointer to the register block"] + pub const PTR: *const aar::RegisterBlock = 0x4000_f000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const aar::RegisterBlock { + Self::PTR + } +} +impl Deref for AAR { + type Target = aar::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for AAR { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("AAR").finish() + } +} +#[doc = "Accelerated Address Resolver"] +pub mod aar; +#[doc = "Watchdog Timer"] +pub struct WDT { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for WDT {} +impl WDT { + #[doc = r"Pointer to the register block"] + pub const PTR: *const wdt::RegisterBlock = 0x4001_0000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const wdt::RegisterBlock { + Self::PTR + } +} +impl Deref for WDT { + type Target = wdt::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for WDT { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("WDT").finish() + } +} +#[doc = "Watchdog Timer"] +pub mod wdt; +#[doc = "Real time counter 1"] +pub struct RTC1 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for RTC1 {} +impl RTC1 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const rtc0::RegisterBlock = 0x4001_1000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const rtc0::RegisterBlock { + Self::PTR + } +} +impl Deref for RTC1 { + type Target = rtc0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for RTC1 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("RTC1").finish() + } +} +#[doc = "Quadrature Decoder"] +pub struct QDEC { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for QDEC {} +impl QDEC { + #[doc = r"Pointer to the register block"] + pub const PTR: *const qdec::RegisterBlock = 0x4001_2000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const qdec::RegisterBlock { + Self::PTR + } +} +impl Deref for QDEC { + type Target = qdec::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for QDEC { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("QDEC").finish() + } +} +#[doc = "Quadrature Decoder"] +pub mod qdec; +#[doc = "Comparator"] +pub struct COMP { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for COMP {} +impl COMP { + #[doc = r"Pointer to the register block"] + pub const PTR: *const comp::RegisterBlock = 0x4001_3000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const comp::RegisterBlock { + Self::PTR + } +} +impl Deref for COMP { + type Target = comp::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for COMP { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("COMP").finish() + } +} +#[doc = "Comparator"] +pub mod comp; +#[doc = "Low Power Comparator"] +pub struct LPCOMP { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for LPCOMP {} +impl LPCOMP { + #[doc = r"Pointer to the register block"] + pub const PTR: *const lpcomp::RegisterBlock = 0x4001_3000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const lpcomp::RegisterBlock { + Self::PTR + } +} +impl Deref for LPCOMP { + type Target = lpcomp::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for LPCOMP { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("LPCOMP").finish() + } +} +#[doc = "Low Power Comparator"] +pub mod lpcomp; +#[doc = "Software interrupt 0"] +pub struct SWI0 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for SWI0 {} +impl SWI0 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const swi0::RegisterBlock = 0x4001_4000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const swi0::RegisterBlock { + Self::PTR + } +} +impl Deref for SWI0 { + type Target = swi0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for SWI0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("SWI0").finish() + } +} +#[doc = "Software interrupt 0"] +pub mod swi0; +#[doc = "Event Generator Unit 0"] +pub struct EGU0 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for EGU0 {} +impl EGU0 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const egu0::RegisterBlock = 0x4001_4000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const egu0::RegisterBlock { + Self::PTR + } +} +impl Deref for EGU0 { + type Target = egu0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for EGU0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("EGU0").finish() + } +} +#[doc = "Event Generator Unit 0"] +pub mod egu0; +#[doc = "Software interrupt 1"] +pub struct SWI1 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for SWI1 {} +impl SWI1 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const swi0::RegisterBlock = 0x4001_5000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const swi0::RegisterBlock { + Self::PTR + } +} +impl Deref for SWI1 { + type Target = swi0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for SWI1 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("SWI1").finish() + } +} +#[doc = "Event Generator Unit 1"] +pub struct EGU1 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for EGU1 {} +impl EGU1 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const egu0::RegisterBlock = 0x4001_5000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const egu0::RegisterBlock { + Self::PTR + } +} +impl Deref for EGU1 { + type Target = egu0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for EGU1 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("EGU1").finish() + } +} +#[doc = "Software interrupt 2"] +pub struct SWI2 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for SWI2 {} +impl SWI2 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const swi0::RegisterBlock = 0x4001_6000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const swi0::RegisterBlock { + Self::PTR + } +} +impl Deref for SWI2 { + type Target = swi0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for SWI2 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("SWI2").finish() + } +} +#[doc = "Event Generator Unit 2"] +pub struct EGU2 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for EGU2 {} +impl EGU2 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const egu0::RegisterBlock = 0x4001_6000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const egu0::RegisterBlock { + Self::PTR + } +} +impl Deref for EGU2 { + type Target = egu0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for EGU2 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("EGU2").finish() + } +} +#[doc = "Software interrupt 3"] +pub struct SWI3 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for SWI3 {} +impl SWI3 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const swi0::RegisterBlock = 0x4001_7000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const swi0::RegisterBlock { + Self::PTR + } +} +impl Deref for SWI3 { + type Target = swi0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for SWI3 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("SWI3").finish() + } +} +#[doc = "Event Generator Unit 3"] +pub struct EGU3 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for EGU3 {} +impl EGU3 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const egu0::RegisterBlock = 0x4001_7000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const egu0::RegisterBlock { + Self::PTR + } +} +impl Deref for EGU3 { + type Target = egu0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for EGU3 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("EGU3").finish() + } +} +#[doc = "Software interrupt 4"] +pub struct SWI4 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for SWI4 {} +impl SWI4 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const swi0::RegisterBlock = 0x4001_8000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const swi0::RegisterBlock { + Self::PTR + } +} +impl Deref for SWI4 { + type Target = swi0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for SWI4 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("SWI4").finish() + } +} +#[doc = "Event Generator Unit 4"] +pub struct EGU4 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for EGU4 {} +impl EGU4 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const egu0::RegisterBlock = 0x4001_8000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const egu0::RegisterBlock { + Self::PTR + } +} +impl Deref for EGU4 { + type Target = egu0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for EGU4 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("EGU4").finish() + } +} +#[doc = "Software interrupt 5"] +pub struct SWI5 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for SWI5 {} +impl SWI5 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const swi0::RegisterBlock = 0x4001_9000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const swi0::RegisterBlock { + Self::PTR + } +} +impl Deref for SWI5 { + type Target = swi0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for SWI5 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("SWI5").finish() + } +} +#[doc = "Event Generator Unit 5"] +pub struct EGU5 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for EGU5 {} +impl EGU5 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const egu0::RegisterBlock = 0x4001_9000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const egu0::RegisterBlock { + Self::PTR + } +} +impl Deref for EGU5 { + type Target = egu0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for EGU5 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("EGU5").finish() + } +} +#[doc = "Timer/Counter 3"] +pub struct TIMER3 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for TIMER3 {} +impl TIMER3 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const timer0::RegisterBlock = 0x4001_a000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const timer0::RegisterBlock { + Self::PTR + } +} +impl Deref for TIMER3 { + type Target = timer0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for TIMER3 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("TIMER3").finish() + } +} +#[doc = "Timer/Counter 4"] +pub struct TIMER4 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for TIMER4 {} +impl TIMER4 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const timer0::RegisterBlock = 0x4001_b000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const timer0::RegisterBlock { + Self::PTR + } +} +impl Deref for TIMER4 { + type Target = timer0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for TIMER4 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("TIMER4").finish() + } +} +#[doc = "Pulse Width Modulation Unit 0"] +pub struct PWM0 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for PWM0 {} +impl PWM0 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const pwm0::RegisterBlock = 0x4001_c000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const pwm0::RegisterBlock { + Self::PTR + } +} +impl Deref for PWM0 { + type Target = pwm0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for PWM0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("PWM0").finish() + } +} +#[doc = "Pulse Width Modulation Unit 0"] +pub mod pwm0; +#[doc = "Pulse Density Modulation (Digital Microphone) Interface"] +pub struct PDM { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for PDM {} +impl PDM { + #[doc = r"Pointer to the register block"] + pub const PTR: *const pdm::RegisterBlock = 0x4001_d000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const pdm::RegisterBlock { + Self::PTR + } +} +impl Deref for PDM { + type Target = pdm::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for PDM { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("PDM").finish() + } +} +#[doc = "Pulse Density Modulation (Digital Microphone) Interface"] +pub mod pdm; +#[doc = "Non Volatile Memory Controller"] +pub struct NVMC { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for NVMC {} +impl NVMC { + #[doc = r"Pointer to the register block"] + pub const PTR: *const nvmc::RegisterBlock = 0x4001_e000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const nvmc::RegisterBlock { + Self::PTR + } +} +impl Deref for NVMC { + type Target = nvmc::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for NVMC { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("NVMC").finish() + } +} +#[doc = "Non Volatile Memory Controller"] +pub mod nvmc; +#[doc = "Programmable Peripheral Interconnect"] +pub struct PPI { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for PPI {} +impl PPI { + #[doc = r"Pointer to the register block"] + pub const PTR: *const ppi::RegisterBlock = 0x4001_f000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const ppi::RegisterBlock { + Self::PTR + } +} +impl Deref for PPI { + type Target = ppi::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for PPI { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("PPI").finish() + } +} +#[doc = "Programmable Peripheral Interconnect"] +pub mod ppi; +#[doc = "Memory Watch Unit"] +pub struct MWU { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for MWU {} +impl MWU { + #[doc = r"Pointer to the register block"] + pub const PTR: *const mwu::RegisterBlock = 0x4002_0000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const mwu::RegisterBlock { + Self::PTR + } +} +impl Deref for MWU { + type Target = mwu::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for MWU { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("MWU").finish() + } +} +#[doc = "Memory Watch Unit"] +pub mod mwu; +#[doc = "Pulse Width Modulation Unit 1"] +pub struct PWM1 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for PWM1 {} +impl PWM1 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const pwm0::RegisterBlock = 0x4002_1000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const pwm0::RegisterBlock { + Self::PTR + } +} +impl Deref for PWM1 { + type Target = pwm0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for PWM1 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("PWM1").finish() + } +} +#[doc = "Pulse Width Modulation Unit 2"] +pub struct PWM2 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for PWM2 {} +impl PWM2 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const pwm0::RegisterBlock = 0x4002_2000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const pwm0::RegisterBlock { + Self::PTR + } +} +impl Deref for PWM2 { + type Target = pwm0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for PWM2 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("PWM2").finish() + } +} +#[doc = "Serial Peripheral Interface Master with EasyDMA 2"] +pub struct SPIM2 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for SPIM2 {} +impl SPIM2 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const spim0::RegisterBlock = 0x4002_3000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const spim0::RegisterBlock { + Self::PTR + } +} +impl Deref for SPIM2 { + type Target = spim0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for SPIM2 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("SPIM2").finish() + } +} +#[doc = "SPI Slave 2"] +pub struct SPIS2 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for SPIS2 {} +impl SPIS2 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const spis0::RegisterBlock = 0x4002_3000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const spis0::RegisterBlock { + Self::PTR + } +} +impl Deref for SPIS2 { + type Target = spis0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for SPIS2 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("SPIS2").finish() + } +} +#[doc = "Serial Peripheral Interface 2"] +pub struct SPI2 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for SPI2 {} +impl SPI2 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const spi0::RegisterBlock = 0x4002_3000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const spi0::RegisterBlock { + Self::PTR + } +} +impl Deref for SPI2 { + type Target = spi0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for SPI2 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("SPI2").finish() + } +} +#[doc = "Real time counter 2"] +pub struct RTC2 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for RTC2 {} +impl RTC2 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const rtc0::RegisterBlock = 0x4002_4000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const rtc0::RegisterBlock { + Self::PTR + } +} +impl Deref for RTC2 { + type Target = rtc0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for RTC2 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("RTC2").finish() + } +} +#[doc = "Inter-IC Sound"] +pub struct I2S { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for I2S {} +impl I2S { + #[doc = r"Pointer to the register block"] + pub const PTR: *const i2s::RegisterBlock = 0x4002_5000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const i2s::RegisterBlock { + Self::PTR + } +} +impl Deref for I2S { + type Target = i2s::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for I2S { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("I2S").finish() + } +} +#[doc = "Inter-IC Sound"] +pub mod i2s; +#[doc = "GPIO Port 1"] +pub struct P0 { + _marker: PhantomData<*const ()>, +} +unsafe impl Send for P0 {} +impl P0 { + #[doc = r"Pointer to the register block"] + pub const PTR: *const p0::RegisterBlock = 0x5000_0000 as *const _; + #[doc = r"Return the pointer to the register block"] + #[inline(always)] + pub const fn ptr() -> *const p0::RegisterBlock { + Self::PTR + } +} +impl Deref for P0 { + type Target = p0::RegisterBlock; + #[inline(always)] + fn deref(&self) -> &Self::Target { + unsafe { &*Self::PTR } + } +} +impl core::fmt::Debug for P0 { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + f.debug_struct("P0").finish() + } +} +#[doc = "GPIO Port 1"] +pub mod p0; +#[no_mangle] +static mut DEVICE_PERIPHERALS: bool = false; +#[doc = r"All the peripherals"] +#[allow(non_snake_case)] +pub struct Peripherals { + #[doc = "FICR"] + pub FICR: FICR, + #[doc = "UICR"] + pub UICR: UICR, + #[doc = "APPROTECT"] + pub APPROTECT: APPROTECT, + #[doc = "BPROT"] + pub BPROT: BPROT, + #[doc = "POWER"] + pub POWER: POWER, + #[doc = "CLOCK"] + pub CLOCK: CLOCK, + #[doc = "RADIO"] + pub RADIO: RADIO, + #[doc = "UARTE0"] + pub UARTE0: UARTE0, + #[doc = "UART0"] + pub UART0: UART0, + #[doc = "SPIM0"] + pub SPIM0: SPIM0, + #[doc = "SPIS0"] + pub SPIS0: SPIS0, + #[doc = "TWIM0"] + pub TWIM0: TWIM0, + #[doc = "TWIS0"] + pub TWIS0: TWIS0, + #[doc = "SPI0"] + pub SPI0: SPI0, + #[doc = "TWI0"] + pub TWI0: TWI0, + #[doc = "SPIM1"] + pub SPIM1: SPIM1, + #[doc = "SPIS1"] + pub SPIS1: SPIS1, + #[doc = "TWIM1"] + pub TWIM1: TWIM1, + #[doc = "TWIS1"] + pub TWIS1: TWIS1, + #[doc = "SPI1"] + pub SPI1: SPI1, + #[doc = "TWI1"] + pub TWI1: TWI1, + #[doc = "NFCT"] + pub NFCT: NFCT, + #[doc = "GPIOTE"] + pub GPIOTE: GPIOTE, + #[doc = "SAADC"] + pub SAADC: SAADC, + #[doc = "TIMER0"] + pub TIMER0: TIMER0, + #[doc = "TIMER1"] + pub TIMER1: TIMER1, + #[doc = "TIMER2"] + pub TIMER2: TIMER2, + #[doc = "RTC0"] + pub RTC0: RTC0, + #[doc = "TEMP"] + pub TEMP: TEMP, + #[doc = "RNG"] + pub RNG: RNG, + #[doc = "ECB"] + pub ECB: ECB, + #[doc = "CCM"] + pub CCM: CCM, + #[doc = "AAR"] + pub AAR: AAR, + #[doc = "WDT"] + pub WDT: WDT, + #[doc = "RTC1"] + pub RTC1: RTC1, + #[doc = "QDEC"] + pub QDEC: QDEC, + #[doc = "COMP"] + pub COMP: COMP, + #[doc = "LPCOMP"] + pub LPCOMP: LPCOMP, + #[doc = "SWI0"] + pub SWI0: SWI0, + #[doc = "EGU0"] + pub EGU0: EGU0, + #[doc = "SWI1"] + pub SWI1: SWI1, + #[doc = "EGU1"] + pub EGU1: EGU1, + #[doc = "SWI2"] + pub SWI2: SWI2, + #[doc = "EGU2"] + pub EGU2: EGU2, + #[doc = "SWI3"] + pub SWI3: SWI3, + #[doc = "EGU3"] + pub EGU3: EGU3, + #[doc = "SWI4"] + pub SWI4: SWI4, + #[doc = "EGU4"] + pub EGU4: EGU4, + #[doc = "SWI5"] + pub SWI5: SWI5, + #[doc = "EGU5"] + pub EGU5: EGU5, + #[doc = "TIMER3"] + pub TIMER3: TIMER3, + #[doc = "TIMER4"] + pub TIMER4: TIMER4, + #[doc = "PWM0"] + pub PWM0: PWM0, + #[doc = "PDM"] + pub PDM: PDM, + #[doc = "NVMC"] + pub NVMC: NVMC, + #[doc = "PPI"] + pub PPI: PPI, + #[doc = "MWU"] + pub MWU: MWU, + #[doc = "PWM1"] + pub PWM1: PWM1, + #[doc = "PWM2"] + pub PWM2: PWM2, + #[doc = "SPIM2"] + pub SPIM2: SPIM2, + #[doc = "SPIS2"] + pub SPIS2: SPIS2, + #[doc = "SPI2"] + pub SPI2: SPI2, + #[doc = "RTC2"] + pub RTC2: RTC2, + #[doc = "I2S"] + pub I2S: I2S, + #[doc = "P0"] + pub P0: P0, +} +impl Peripherals { + #[doc = r"Returns all the peripherals *once*"] + #[inline] + pub fn take() -> Option { + cortex_m::interrupt::free(|_| { + if unsafe { DEVICE_PERIPHERALS } { + None + } else { + Some(unsafe { Peripherals::steal() }) + } + }) + } + #[doc = r"Unchecked version of `Peripherals::take`"] + #[inline] + pub unsafe fn steal() -> Self { + DEVICE_PERIPHERALS = true; + Peripherals { + FICR: FICR { + _marker: PhantomData, + }, + UICR: UICR { + _marker: PhantomData, + }, + APPROTECT: APPROTECT { + _marker: PhantomData, + }, + BPROT: BPROT { + _marker: PhantomData, + }, + POWER: POWER { + _marker: PhantomData, + }, + CLOCK: CLOCK { + _marker: PhantomData, + }, + RADIO: RADIO { + _marker: PhantomData, + }, + UARTE0: UARTE0 { + _marker: PhantomData, + }, + UART0: UART0 { + _marker: PhantomData, + }, + SPIM0: SPIM0 { + _marker: PhantomData, + }, + SPIS0: SPIS0 { + _marker: PhantomData, + }, + TWIM0: TWIM0 { + _marker: PhantomData, + }, + TWIS0: TWIS0 { + _marker: PhantomData, + }, + SPI0: SPI0 { + _marker: PhantomData, + }, + TWI0: TWI0 { + _marker: PhantomData, + }, + SPIM1: SPIM1 { + _marker: PhantomData, + }, + SPIS1: SPIS1 { + _marker: PhantomData, + }, + TWIM1: TWIM1 { + _marker: PhantomData, + }, + TWIS1: TWIS1 { + _marker: PhantomData, + }, + SPI1: SPI1 { + _marker: PhantomData, + }, + TWI1: TWI1 { + _marker: PhantomData, + }, + NFCT: NFCT { + _marker: PhantomData, + }, + GPIOTE: GPIOTE { + _marker: PhantomData, + }, + SAADC: SAADC { + _marker: PhantomData, + }, + TIMER0: TIMER0 { + _marker: PhantomData, + }, + TIMER1: TIMER1 { + _marker: PhantomData, + }, + TIMER2: TIMER2 { + _marker: PhantomData, + }, + RTC0: RTC0 { + _marker: PhantomData, + }, + TEMP: TEMP { + _marker: PhantomData, + }, + RNG: RNG { + _marker: PhantomData, + }, + ECB: ECB { + _marker: PhantomData, + }, + CCM: CCM { + _marker: PhantomData, + }, + AAR: AAR { + _marker: PhantomData, + }, + WDT: WDT { + _marker: PhantomData, + }, + RTC1: RTC1 { + _marker: PhantomData, + }, + QDEC: QDEC { + _marker: PhantomData, + }, + COMP: COMP { + _marker: PhantomData, + }, + LPCOMP: LPCOMP { + _marker: PhantomData, + }, + SWI0: SWI0 { + _marker: PhantomData, + }, + EGU0: EGU0 { + _marker: PhantomData, + }, + SWI1: SWI1 { + _marker: PhantomData, + }, + EGU1: EGU1 { + _marker: PhantomData, + }, + SWI2: SWI2 { + _marker: PhantomData, + }, + EGU2: EGU2 { + _marker: PhantomData, + }, + SWI3: SWI3 { + _marker: PhantomData, + }, + EGU3: EGU3 { + _marker: PhantomData, + }, + SWI4: SWI4 { + _marker: PhantomData, + }, + EGU4: EGU4 { + _marker: PhantomData, + }, + SWI5: SWI5 { + _marker: PhantomData, + }, + EGU5: EGU5 { + _marker: PhantomData, + }, + TIMER3: TIMER3 { + _marker: PhantomData, + }, + TIMER4: TIMER4 { + _marker: PhantomData, + }, + PWM0: PWM0 { + _marker: PhantomData, + }, + PDM: PDM { + _marker: PhantomData, + }, + NVMC: NVMC { + _marker: PhantomData, + }, + PPI: PPI { + _marker: PhantomData, + }, + MWU: MWU { + _marker: PhantomData, + }, + PWM1: PWM1 { + _marker: PhantomData, + }, + PWM2: PWM2 { + _marker: PhantomData, + }, + SPIM2: SPIM2 { + _marker: PhantomData, + }, + SPIS2: SPIS2 { + _marker: PhantomData, + }, + SPI2: SPI2 { + _marker: PhantomData, + }, + RTC2: RTC2 { + _marker: PhantomData, + }, + I2S: I2S { + _marker: PhantomData, + }, + P0: P0 { + _marker: PhantomData, + }, + } + } +} diff --git a/src/lpcomp.rs b/src/lpcomp.rs new file mode 100644 index 0000000..bab5177 --- /dev/null +++ b/src/lpcomp.rs @@ -0,0 +1,113 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "0x00 - Start comparator"] + pub tasks_start: crate::Reg, + #[doc = "0x04 - Stop comparator"] + pub tasks_stop: crate::Reg, + #[doc = "0x08 - Sample comparator value"] + pub tasks_sample: crate::Reg, + _reserved3: [u8; 0xf4], + #[doc = "0x100 - LPCOMP is ready and output is valid"] + pub events_ready: crate::Reg, + #[doc = "0x104 - Downward crossing"] + pub events_down: crate::Reg, + #[doc = "0x108 - Upward crossing"] + pub events_up: crate::Reg, + #[doc = "0x10c - Downward or upward crossing"] + pub events_cross: crate::Reg, + _reserved7: [u8; 0xf0], + #[doc = "0x200 - Shortcut register"] + pub shorts: crate::Reg, + _reserved8: [u8; 0x0100], + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved10: [u8; 0xf4], + #[doc = "0x400 - Compare result"] + pub result: crate::Reg, + _reserved11: [u8; 0xfc], + #[doc = "0x500 - Enable LPCOMP"] + pub enable: crate::Reg, + #[doc = "0x504 - Input pin select"] + pub psel: crate::Reg, + #[doc = "0x508 - Reference select"] + pub refsel: crate::Reg, + #[doc = "0x50c - External reference select"] + pub extrefsel: crate::Reg, + _reserved15: [u8; 0x10], + #[doc = "0x520 - Analog detect configuration"] + pub anadetect: crate::Reg, + _reserved16: [u8; 0x14], + #[doc = "0x538 - Comparator hysteresis enable"] + pub hyst: crate::Reg, +} +#[doc = "TASKS_START register accessor: an alias for `Reg`"] +pub type TASKS_START = crate::Reg; +#[doc = "Start comparator"] +pub mod tasks_start; +#[doc = "TASKS_STOP register accessor: an alias for `Reg`"] +pub type TASKS_STOP = crate::Reg; +#[doc = "Stop comparator"] +pub mod tasks_stop; +#[doc = "TASKS_SAMPLE register accessor: an alias for `Reg`"] +pub type TASKS_SAMPLE = crate::Reg; +#[doc = "Sample comparator value"] +pub mod tasks_sample; +#[doc = "EVENTS_READY register accessor: an alias for `Reg`"] +pub type EVENTS_READY = crate::Reg; +#[doc = "LPCOMP is ready and output is valid"] +pub mod events_ready; +#[doc = "EVENTS_DOWN register accessor: an alias for `Reg`"] +pub type EVENTS_DOWN = crate::Reg; +#[doc = "Downward crossing"] +pub mod events_down; +#[doc = "EVENTS_UP register accessor: an alias for `Reg`"] +pub type EVENTS_UP = crate::Reg; +#[doc = "Upward crossing"] +pub mod events_up; +#[doc = "EVENTS_CROSS register accessor: an alias for `Reg`"] +pub type EVENTS_CROSS = crate::Reg; +#[doc = "Downward or upward crossing"] +pub mod events_cross; +#[doc = "SHORTS register accessor: an alias for `Reg`"] +pub type SHORTS = crate::Reg; +#[doc = "Shortcut register"] +pub mod shorts; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "RESULT register accessor: an alias for `Reg`"] +pub type RESULT = crate::Reg; +#[doc = "Compare result"] +pub mod result; +#[doc = "ENABLE register accessor: an alias for `Reg`"] +pub type ENABLE = crate::Reg; +#[doc = "Enable LPCOMP"] +pub mod enable; +#[doc = "PSEL register accessor: an alias for `Reg`"] +pub type PSEL = crate::Reg; +#[doc = "Input pin select"] +pub mod psel; +#[doc = "REFSEL register accessor: an alias for `Reg`"] +pub type REFSEL = crate::Reg; +#[doc = "Reference select"] +pub mod refsel; +#[doc = "EXTREFSEL register accessor: an alias for `Reg`"] +pub type EXTREFSEL = crate::Reg; +#[doc = "External reference select"] +pub mod extrefsel; +#[doc = "ANADETECT register accessor: an alias for `Reg`"] +pub type ANADETECT = crate::Reg; +#[doc = "Analog detect configuration"] +pub mod anadetect; +#[doc = "HYST register accessor: an alias for `Reg`"] +pub type HYST = crate::Reg; +#[doc = "Comparator hysteresis enable"] +pub mod hyst; diff --git a/src/lpcomp/anadetect.rs b/src/lpcomp/anadetect.rs new file mode 100644 index 0000000..d8dc849 --- /dev/null +++ b/src/lpcomp/anadetect.rs @@ -0,0 +1,164 @@ +#[doc = "Register `ANADETECT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ANADETECT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Analog detect configuration\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum ANADETECT_A { + #[doc = "0: Generate ANADETECT on crossing, both upward crossing and downward crossing"] + CROSS = 0, + #[doc = "1: Generate ANADETECT on upward crossing only"] + UP = 1, + #[doc = "2: Generate ANADETECT on downward crossing only"] + DOWN = 2, +} +impl From for u8 { + #[inline(always)] + fn from(variant: ANADETECT_A) -> Self { + variant as _ + } +} +#[doc = "Field `ANADETECT` reader - Analog detect configuration"] +pub struct ANADETECT_R(crate::FieldReader); +impl ANADETECT_R { + pub(crate) fn new(bits: u8) -> Self { + ANADETECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(ANADETECT_A::CROSS), + 1 => Some(ANADETECT_A::UP), + 2 => Some(ANADETECT_A::DOWN), + _ => None, + } + } + #[doc = "Checks if the value of the field is `CROSS`"] + #[inline(always)] + pub fn is_cross(&self) -> bool { + **self == ANADETECT_A::CROSS + } + #[doc = "Checks if the value of the field is `UP`"] + #[inline(always)] + pub fn is_up(&self) -> bool { + **self == ANADETECT_A::UP + } + #[doc = "Checks if the value of the field is `DOWN`"] + #[inline(always)] + pub fn is_down(&self) -> bool { + **self == ANADETECT_A::DOWN + } +} +impl core::ops::Deref for ANADETECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ANADETECT` writer - Analog detect configuration"] +pub struct ANADETECT_W<'a> { + w: &'a mut W, +} +impl<'a> ANADETECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ANADETECT_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Generate ANADETECT on crossing, both upward crossing and downward crossing"] + #[inline(always)] + pub fn cross(self) -> &'a mut W { + self.variant(ANADETECT_A::CROSS) + } + #[doc = "Generate ANADETECT on upward crossing only"] + #[inline(always)] + pub fn up(self) -> &'a mut W { + self.variant(ANADETECT_A::UP) + } + #[doc = "Generate ANADETECT on downward crossing only"] + #[inline(always)] + pub fn down(self) -> &'a mut W { + self.variant(ANADETECT_A::DOWN) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); + self.w + } +} +impl R { + #[doc = "Bits 0:1 - Analog detect configuration"] + #[inline(always)] + pub fn anadetect(&self) -> ANADETECT_R { + ANADETECT_R::new((self.bits & 0x03) as u8) + } +} +impl W { + #[doc = "Bits 0:1 - Analog detect configuration"] + #[inline(always)] + pub fn anadetect(&mut self) -> ANADETECT_W { + ANADETECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Analog detect configuration\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [anadetect](index.html) module"] +pub struct ANADETECT_SPEC; +impl crate::RegisterSpec for ANADETECT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [anadetect::R](R) reader structure"] +impl crate::Readable for ANADETECT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [anadetect::W](W) writer structure"] +impl crate::Writable for ANADETECT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ANADETECT to value 0"] +impl crate::Resettable for ANADETECT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/lpcomp/enable.rs b/src/lpcomp/enable.rs new file mode 100644 index 0000000..b237cc2 --- /dev/null +++ b/src/lpcomp/enable.rs @@ -0,0 +1,151 @@ +#[doc = "Register `ENABLE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ENABLE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable LPCOMP\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum ENABLE_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for u8 { + #[inline(always)] + fn from(variant: ENABLE_A) -> Self { + variant as _ + } +} +#[doc = "Field `ENABLE` reader - Enable or disable LPCOMP"] +pub struct ENABLE_R(crate::FieldReader); +impl ENABLE_R { + pub(crate) fn new(bits: u8) -> Self { + ENABLE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(ENABLE_A::DISABLED), + 1 => Some(ENABLE_A::ENABLED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENABLE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENABLE_A::ENABLED + } +} +impl core::ops::Deref for ENABLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENABLE` writer - Enable or disable LPCOMP"] +pub struct ENABLE_W<'a> { + w: &'a mut W, +} +impl<'a> ENABLE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENABLE_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENABLE_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENABLE_A::ENABLED) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); + self.w + } +} +impl R { + #[doc = "Bits 0:1 - Enable or disable LPCOMP"] + #[inline(always)] + pub fn enable(&self) -> ENABLE_R { + ENABLE_R::new((self.bits & 0x03) as u8) + } +} +impl W { + #[doc = "Bits 0:1 - Enable or disable LPCOMP"] + #[inline(always)] + pub fn enable(&mut self) -> ENABLE_W { + ENABLE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable LPCOMP\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [enable](index.html) module"] +pub struct ENABLE_SPEC; +impl crate::RegisterSpec for ENABLE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [enable::R](R) reader structure"] +impl crate::Readable for ENABLE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [enable::W](W) writer structure"] +impl crate::Writable for ENABLE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ENABLE to value 0"] +impl crate::Resettable for ENABLE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/lpcomp/events_cross.rs b/src/lpcomp/events_cross.rs new file mode 100644 index 0000000..9670e7c --- /dev/null +++ b/src/lpcomp/events_cross.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_CROSS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_CROSS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Downward or upward crossing\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_cross](index.html) module"] +pub struct EVENTS_CROSS_SPEC; +impl crate::RegisterSpec for EVENTS_CROSS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_cross::R](R) reader structure"] +impl crate::Readable for EVENTS_CROSS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_cross::W](W) writer structure"] +impl crate::Writable for EVENTS_CROSS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_CROSS to value 0"] +impl crate::Resettable for EVENTS_CROSS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/lpcomp/events_down.rs b/src/lpcomp/events_down.rs new file mode 100644 index 0000000..5cd2bf0 --- /dev/null +++ b/src/lpcomp/events_down.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_DOWN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_DOWN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Downward crossing\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_down](index.html) module"] +pub struct EVENTS_DOWN_SPEC; +impl crate::RegisterSpec for EVENTS_DOWN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_down::R](R) reader structure"] +impl crate::Readable for EVENTS_DOWN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_down::W](W) writer structure"] +impl crate::Writable for EVENTS_DOWN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_DOWN to value 0"] +impl crate::Resettable for EVENTS_DOWN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/lpcomp/events_ready.rs b/src/lpcomp/events_ready.rs new file mode 100644 index 0000000..39a2ae5 --- /dev/null +++ b/src/lpcomp/events_ready.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_READY` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_READY` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "LPCOMP is ready and output is valid\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_ready](index.html) module"] +pub struct EVENTS_READY_SPEC; +impl crate::RegisterSpec for EVENTS_READY_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_ready::R](R) reader structure"] +impl crate::Readable for EVENTS_READY_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_ready::W](W) writer structure"] +impl crate::Writable for EVENTS_READY_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_READY to value 0"] +impl crate::Resettable for EVENTS_READY_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/lpcomp/events_up.rs b/src/lpcomp/events_up.rs new file mode 100644 index 0000000..6592e6b --- /dev/null +++ b/src/lpcomp/events_up.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_UP` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_UP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Upward crossing\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_up](index.html) module"] +pub struct EVENTS_UP_SPEC; +impl crate::RegisterSpec for EVENTS_UP_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_up::R](R) reader structure"] +impl crate::Readable for EVENTS_UP_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_up::W](W) writer structure"] +impl crate::Writable for EVENTS_UP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_UP to value 0"] +impl crate::Resettable for EVENTS_UP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/lpcomp/extrefsel.rs b/src/lpcomp/extrefsel.rs new file mode 100644 index 0000000..56f57e2 --- /dev/null +++ b/src/lpcomp/extrefsel.rs @@ -0,0 +1,159 @@ +#[doc = "Register `EXTREFSEL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EXTREFSEL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "External analog reference select\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum EXTREFSEL_A { + #[doc = "0: Use AIN0 as external analog reference"] + ANALOGREFERENCE0 = 0, + #[doc = "1: Use AIN1 as external analog reference"] + ANALOGREFERENCE1 = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: EXTREFSEL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `EXTREFSEL` reader - External analog reference select"] +pub struct EXTREFSEL_R(crate::FieldReader); +impl EXTREFSEL_R { + pub(crate) fn new(bits: bool) -> Self { + EXTREFSEL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> EXTREFSEL_A { + match self.bits { + false => EXTREFSEL_A::ANALOGREFERENCE0, + true => EXTREFSEL_A::ANALOGREFERENCE1, + } + } + #[doc = "Checks if the value of the field is `ANALOGREFERENCE0`"] + #[inline(always)] + pub fn is_analog_reference0(&self) -> bool { + **self == EXTREFSEL_A::ANALOGREFERENCE0 + } + #[doc = "Checks if the value of the field is `ANALOGREFERENCE1`"] + #[inline(always)] + pub fn is_analog_reference1(&self) -> bool { + **self == EXTREFSEL_A::ANALOGREFERENCE1 + } +} +impl core::ops::Deref for EXTREFSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EXTREFSEL` writer - External analog reference select"] +pub struct EXTREFSEL_W<'a> { + w: &'a mut W, +} +impl<'a> EXTREFSEL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: EXTREFSEL_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Use AIN0 as external analog reference"] + #[inline(always)] + pub fn analog_reference0(self) -> &'a mut W { + self.variant(EXTREFSEL_A::ANALOGREFERENCE0) + } + #[doc = "Use AIN1 as external analog reference"] + #[inline(always)] + pub fn analog_reference1(self) -> &'a mut W { + self.variant(EXTREFSEL_A::ANALOGREFERENCE1) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - External analog reference select"] + #[inline(always)] + pub fn extrefsel(&self) -> EXTREFSEL_R { + EXTREFSEL_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - External analog reference select"] + #[inline(always)] + pub fn extrefsel(&mut self) -> EXTREFSEL_W { + EXTREFSEL_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "External reference select\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [extrefsel](index.html) module"] +pub struct EXTREFSEL_SPEC; +impl crate::RegisterSpec for EXTREFSEL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [extrefsel::R](R) reader structure"] +impl crate::Readable for EXTREFSEL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [extrefsel::W](W) writer structure"] +impl crate::Writable for EXTREFSEL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EXTREFSEL to value 0"] +impl crate::Resettable for EXTREFSEL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/lpcomp/hyst.rs b/src/lpcomp/hyst.rs new file mode 100644 index 0000000..402438c --- /dev/null +++ b/src/lpcomp/hyst.rs @@ -0,0 +1,159 @@ +#[doc = "Register `HYST` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `HYST` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Comparator hysteresis enable\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum HYST_A { + #[doc = "0: Comparator hysteresis disabled"] + NOHYST = 0, + #[doc = "1: Comparator hysteresis disabled (typ. 50 mV)"] + HYST50MV = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: HYST_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `HYST` reader - Comparator hysteresis enable"] +pub struct HYST_R(crate::FieldReader); +impl HYST_R { + pub(crate) fn new(bits: bool) -> Self { + HYST_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> HYST_A { + match self.bits { + false => HYST_A::NOHYST, + true => HYST_A::HYST50MV, + } + } + #[doc = "Checks if the value of the field is `NOHYST`"] + #[inline(always)] + pub fn is_no_hyst(&self) -> bool { + **self == HYST_A::NOHYST + } + #[doc = "Checks if the value of the field is `HYST50MV`"] + #[inline(always)] + pub fn is_hyst50m_v(&self) -> bool { + **self == HYST_A::HYST50MV + } +} +impl core::ops::Deref for HYST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HYST` writer - Comparator hysteresis enable"] +pub struct HYST_W<'a> { + w: &'a mut W, +} +impl<'a> HYST_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: HYST_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Comparator hysteresis disabled"] + #[inline(always)] + pub fn no_hyst(self) -> &'a mut W { + self.variant(HYST_A::NOHYST) + } + #[doc = "Comparator hysteresis disabled (typ. 50 mV)"] + #[inline(always)] + pub fn hyst50m_v(self) -> &'a mut W { + self.variant(HYST_A::HYST50MV) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Comparator hysteresis enable"] + #[inline(always)] + pub fn hyst(&self) -> HYST_R { + HYST_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Comparator hysteresis enable"] + #[inline(always)] + pub fn hyst(&mut self) -> HYST_W { + HYST_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Comparator hysteresis enable\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hyst](index.html) module"] +pub struct HYST_SPEC; +impl crate::RegisterSpec for HYST_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [hyst::R](R) reader structure"] +impl crate::Readable for HYST_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [hyst::W](W) writer structure"] +impl crate::Writable for HYST_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets HYST to value 0"] +impl crate::Resettable for HYST_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/lpcomp/intenclr.rs b/src/lpcomp/intenclr.rs new file mode 100644 index 0000000..66acb1d --- /dev/null +++ b/src/lpcomp/intenclr.rs @@ -0,0 +1,466 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for READY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY` reader - Write '1' to Disable interrupt for READY event"] +pub struct READY_R(crate::FieldReader); +impl READY_R { + pub(crate) fn new(bits: bool) -> Self { + READY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> READY_A { + match self.bits { + false => READY_A::DISABLED, + true => READY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == READY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == READY_A::ENABLED + } +} +impl core::ops::Deref for READY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for READY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY` writer - Write '1' to Disable interrupt for READY event"] +pub struct READY_W<'a> { + w: &'a mut W, +} +impl<'a> READY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: READY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(READY_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for DOWN event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DOWN_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DOWN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DOWN` reader - Write '1' to Disable interrupt for DOWN event"] +pub struct DOWN_R(crate::FieldReader); +impl DOWN_R { + pub(crate) fn new(bits: bool) -> Self { + DOWN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DOWN_A { + match self.bits { + false => DOWN_A::DISABLED, + true => DOWN_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DOWN_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DOWN_A::ENABLED + } +} +impl core::ops::Deref for DOWN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for DOWN event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DOWN_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DOWN_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DOWN` writer - Write '1' to Disable interrupt for DOWN event"] +pub struct DOWN_W<'a> { + w: &'a mut W, +} +impl<'a> DOWN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DOWN_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(DOWN_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for UP event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum UP_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: UP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `UP` reader - Write '1' to Disable interrupt for UP event"] +pub struct UP_R(crate::FieldReader); +impl UP_R { + pub(crate) fn new(bits: bool) -> Self { + UP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> UP_A { + match self.bits { + false => UP_A::DISABLED, + true => UP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == UP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == UP_A::ENABLED + } +} +impl core::ops::Deref for UP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for UP event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum UP_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: UP_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `UP` writer - Write '1' to Disable interrupt for UP event"] +pub struct UP_W<'a> { + w: &'a mut W, +} +impl<'a> UP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: UP_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(UP_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for CROSS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CROSS_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CROSS_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CROSS` reader - Write '1' to Disable interrupt for CROSS event"] +pub struct CROSS_R(crate::FieldReader); +impl CROSS_R { + pub(crate) fn new(bits: bool) -> Self { + CROSS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CROSS_A { + match self.bits { + false => CROSS_A::DISABLED, + true => CROSS_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CROSS_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CROSS_A::ENABLED + } +} +impl core::ops::Deref for CROSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for CROSS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CROSS_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CROSS_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CROSS` writer - Write '1' to Disable interrupt for CROSS event"] +pub struct CROSS_W<'a> { + w: &'a mut W, +} +impl<'a> CROSS_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CROSS_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CROSS_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Disable interrupt for READY event"] + #[inline(always)] + pub fn ready(&self) -> READY_R { + READY_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for DOWN event"] + #[inline(always)] + pub fn down(&self) -> DOWN_R { + DOWN_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for UP event"] + #[inline(always)] + pub fn up(&self) -> UP_R { + UP_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Write '1' to Disable interrupt for CROSS event"] + #[inline(always)] + pub fn cross(&self) -> CROSS_R { + CROSS_R::new(((self.bits >> 3) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Disable interrupt for READY event"] + #[inline(always)] + pub fn ready(&mut self) -> READY_W { + READY_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for DOWN event"] + #[inline(always)] + pub fn down(&mut self) -> DOWN_W { + DOWN_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for UP event"] + #[inline(always)] + pub fn up(&mut self) -> UP_W { + UP_W { w: self } + } + #[doc = "Bit 3 - Write '1' to Disable interrupt for CROSS event"] + #[inline(always)] + pub fn cross(&mut self) -> CROSS_W { + CROSS_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/lpcomp/intenset.rs b/src/lpcomp/intenset.rs new file mode 100644 index 0000000..1c41dd3 --- /dev/null +++ b/src/lpcomp/intenset.rs @@ -0,0 +1,466 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for READY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY` reader - Write '1' to Enable interrupt for READY event"] +pub struct READY_R(crate::FieldReader); +impl READY_R { + pub(crate) fn new(bits: bool) -> Self { + READY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> READY_A { + match self.bits { + false => READY_A::DISABLED, + true => READY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == READY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == READY_A::ENABLED + } +} +impl core::ops::Deref for READY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for READY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY` writer - Write '1' to Enable interrupt for READY event"] +pub struct READY_W<'a> { + w: &'a mut W, +} +impl<'a> READY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: READY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(READY_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for DOWN event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DOWN_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DOWN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DOWN` reader - Write '1' to Enable interrupt for DOWN event"] +pub struct DOWN_R(crate::FieldReader); +impl DOWN_R { + pub(crate) fn new(bits: bool) -> Self { + DOWN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DOWN_A { + match self.bits { + false => DOWN_A::DISABLED, + true => DOWN_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DOWN_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DOWN_A::ENABLED + } +} +impl core::ops::Deref for DOWN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for DOWN event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DOWN_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DOWN_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DOWN` writer - Write '1' to Enable interrupt for DOWN event"] +pub struct DOWN_W<'a> { + w: &'a mut W, +} +impl<'a> DOWN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DOWN_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(DOWN_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for UP event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum UP_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: UP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `UP` reader - Write '1' to Enable interrupt for UP event"] +pub struct UP_R(crate::FieldReader); +impl UP_R { + pub(crate) fn new(bits: bool) -> Self { + UP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> UP_A { + match self.bits { + false => UP_A::DISABLED, + true => UP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == UP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == UP_A::ENABLED + } +} +impl core::ops::Deref for UP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for UP event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum UP_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: UP_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `UP` writer - Write '1' to Enable interrupt for UP event"] +pub struct UP_W<'a> { + w: &'a mut W, +} +impl<'a> UP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: UP_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(UP_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for CROSS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CROSS_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CROSS_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CROSS` reader - Write '1' to Enable interrupt for CROSS event"] +pub struct CROSS_R(crate::FieldReader); +impl CROSS_R { + pub(crate) fn new(bits: bool) -> Self { + CROSS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CROSS_A { + match self.bits { + false => CROSS_A::DISABLED, + true => CROSS_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CROSS_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CROSS_A::ENABLED + } +} +impl core::ops::Deref for CROSS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for CROSS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CROSS_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CROSS_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CROSS` writer - Write '1' to Enable interrupt for CROSS event"] +pub struct CROSS_W<'a> { + w: &'a mut W, +} +impl<'a> CROSS_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CROSS_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CROSS_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Enable interrupt for READY event"] + #[inline(always)] + pub fn ready(&self) -> READY_R { + READY_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for DOWN event"] + #[inline(always)] + pub fn down(&self) -> DOWN_R { + DOWN_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for UP event"] + #[inline(always)] + pub fn up(&self) -> UP_R { + UP_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Write '1' to Enable interrupt for CROSS event"] + #[inline(always)] + pub fn cross(&self) -> CROSS_R { + CROSS_R::new(((self.bits >> 3) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Enable interrupt for READY event"] + #[inline(always)] + pub fn ready(&mut self) -> READY_W { + READY_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for DOWN event"] + #[inline(always)] + pub fn down(&mut self) -> DOWN_W { + DOWN_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for UP event"] + #[inline(always)] + pub fn up(&mut self) -> UP_W { + UP_W { w: self } + } + #[doc = "Bit 3 - Write '1' to Enable interrupt for CROSS event"] + #[inline(always)] + pub fn cross(&mut self) -> CROSS_W { + CROSS_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/lpcomp/psel.rs b/src/lpcomp/psel.rs new file mode 100644 index 0000000..aab05e8 --- /dev/null +++ b/src/lpcomp/psel.rs @@ -0,0 +1,229 @@ +#[doc = "Register `PSEL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PSEL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Analog pin select\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum PSEL_A { + #[doc = "0: AIN0 selected as analog input"] + ANALOGINPUT0 = 0, + #[doc = "1: AIN1 selected as analog input"] + ANALOGINPUT1 = 1, + #[doc = "2: AIN2 selected as analog input"] + ANALOGINPUT2 = 2, + #[doc = "3: AIN3 selected as analog input"] + ANALOGINPUT3 = 3, + #[doc = "4: AIN4 selected as analog input"] + ANALOGINPUT4 = 4, + #[doc = "5: AIN5 selected as analog input"] + ANALOGINPUT5 = 5, + #[doc = "6: AIN6 selected as analog input"] + ANALOGINPUT6 = 6, + #[doc = "7: AIN7 selected as analog input"] + ANALOGINPUT7 = 7, +} +impl From for u8 { + #[inline(always)] + fn from(variant: PSEL_A) -> Self { + variant as _ + } +} +#[doc = "Field `PSEL` reader - Analog pin select"] +pub struct PSEL_R(crate::FieldReader); +impl PSEL_R { + pub(crate) fn new(bits: u8) -> Self { + PSEL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PSEL_A { + match self.bits { + 0 => PSEL_A::ANALOGINPUT0, + 1 => PSEL_A::ANALOGINPUT1, + 2 => PSEL_A::ANALOGINPUT2, + 3 => PSEL_A::ANALOGINPUT3, + 4 => PSEL_A::ANALOGINPUT4, + 5 => PSEL_A::ANALOGINPUT5, + 6 => PSEL_A::ANALOGINPUT6, + 7 => PSEL_A::ANALOGINPUT7, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `ANALOGINPUT0`"] + #[inline(always)] + pub fn is_analog_input0(&self) -> bool { + **self == PSEL_A::ANALOGINPUT0 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT1`"] + #[inline(always)] + pub fn is_analog_input1(&self) -> bool { + **self == PSEL_A::ANALOGINPUT1 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT2`"] + #[inline(always)] + pub fn is_analog_input2(&self) -> bool { + **self == PSEL_A::ANALOGINPUT2 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT3`"] + #[inline(always)] + pub fn is_analog_input3(&self) -> bool { + **self == PSEL_A::ANALOGINPUT3 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT4`"] + #[inline(always)] + pub fn is_analog_input4(&self) -> bool { + **self == PSEL_A::ANALOGINPUT4 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT5`"] + #[inline(always)] + pub fn is_analog_input5(&self) -> bool { + **self == PSEL_A::ANALOGINPUT5 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT6`"] + #[inline(always)] + pub fn is_analog_input6(&self) -> bool { + **self == PSEL_A::ANALOGINPUT6 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT7`"] + #[inline(always)] + pub fn is_analog_input7(&self) -> bool { + **self == PSEL_A::ANALOGINPUT7 + } +} +impl core::ops::Deref for PSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PSEL` writer - Analog pin select"] +pub struct PSEL_W<'a> { + w: &'a mut W, +} +impl<'a> PSEL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PSEL_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "AIN0 selected as analog input"] + #[inline(always)] + pub fn analog_input0(self) -> &'a mut W { + self.variant(PSEL_A::ANALOGINPUT0) + } + #[doc = "AIN1 selected as analog input"] + #[inline(always)] + pub fn analog_input1(self) -> &'a mut W { + self.variant(PSEL_A::ANALOGINPUT1) + } + #[doc = "AIN2 selected as analog input"] + #[inline(always)] + pub fn analog_input2(self) -> &'a mut W { + self.variant(PSEL_A::ANALOGINPUT2) + } + #[doc = "AIN3 selected as analog input"] + #[inline(always)] + pub fn analog_input3(self) -> &'a mut W { + self.variant(PSEL_A::ANALOGINPUT3) + } + #[doc = "AIN4 selected as analog input"] + #[inline(always)] + pub fn analog_input4(self) -> &'a mut W { + self.variant(PSEL_A::ANALOGINPUT4) + } + #[doc = "AIN5 selected as analog input"] + #[inline(always)] + pub fn analog_input5(self) -> &'a mut W { + self.variant(PSEL_A::ANALOGINPUT5) + } + #[doc = "AIN6 selected as analog input"] + #[inline(always)] + pub fn analog_input6(self) -> &'a mut W { + self.variant(PSEL_A::ANALOGINPUT6) + } + #[doc = "AIN7 selected as analog input"] + #[inline(always)] + pub fn analog_input7(self) -> &'a mut W { + self.variant(PSEL_A::ANALOGINPUT7) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); + self.w + } +} +impl R { + #[doc = "Bits 0:2 - Analog pin select"] + #[inline(always)] + pub fn psel(&self) -> PSEL_R { + PSEL_R::new((self.bits & 0x07) as u8) + } +} +impl W { + #[doc = "Bits 0:2 - Analog pin select"] + #[inline(always)] + pub fn psel(&mut self) -> PSEL_W { + PSEL_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Input pin select\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [psel](index.html) module"] +pub struct PSEL_SPEC; +impl crate::RegisterSpec for PSEL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [psel::R](R) reader structure"] +impl crate::Readable for PSEL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [psel::W](W) writer structure"] +impl crate::Writable for PSEL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PSEL to value 0"] +impl crate::Resettable for PSEL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/lpcomp/refsel.rs b/src/lpcomp/refsel.rs new file mode 100644 index 0000000..6a81007 --- /dev/null +++ b/src/lpcomp/refsel.rs @@ -0,0 +1,333 @@ +#[doc = "Register `REFSEL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `REFSEL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Reference select\n\nValue on reset: 4"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum REFSEL_A { + #[doc = "0: VDD * 1/8 selected as reference"] + REF1_8VDD = 0, + #[doc = "1: VDD * 2/8 selected as reference"] + REF2_8VDD = 1, + #[doc = "2: VDD * 3/8 selected as reference"] + REF3_8VDD = 2, + #[doc = "3: VDD * 4/8 selected as reference"] + REF4_8VDD = 3, + #[doc = "4: VDD * 5/8 selected as reference"] + REF5_8VDD = 4, + #[doc = "5: VDD * 6/8 selected as reference"] + REF6_8VDD = 5, + #[doc = "6: VDD * 7/8 selected as reference"] + REF7_8VDD = 6, + #[doc = "7: External analog reference selected"] + AREF = 7, + #[doc = "8: VDD * 1/16 selected as reference"] + REF1_16VDD = 8, + #[doc = "9: VDD * 3/16 selected as reference"] + REF3_16VDD = 9, + #[doc = "10: VDD * 5/16 selected as reference"] + REF5_16VDD = 10, + #[doc = "11: VDD * 7/16 selected as reference"] + REF7_16VDD = 11, + #[doc = "12: VDD * 9/16 selected as reference"] + REF9_16VDD = 12, + #[doc = "13: VDD * 11/16 selected as reference"] + REF11_16VDD = 13, + #[doc = "14: VDD * 13/16 selected as reference"] + REF13_16VDD = 14, + #[doc = "15: VDD * 15/16 selected as reference"] + REF15_16VDD = 15, +} +impl From for u8 { + #[inline(always)] + fn from(variant: REFSEL_A) -> Self { + variant as _ + } +} +#[doc = "Field `REFSEL` reader - Reference select"] +pub struct REFSEL_R(crate::FieldReader); +impl REFSEL_R { + pub(crate) fn new(bits: u8) -> Self { + REFSEL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REFSEL_A { + match self.bits { + 0 => REFSEL_A::REF1_8VDD, + 1 => REFSEL_A::REF2_8VDD, + 2 => REFSEL_A::REF3_8VDD, + 3 => REFSEL_A::REF4_8VDD, + 4 => REFSEL_A::REF5_8VDD, + 5 => REFSEL_A::REF6_8VDD, + 6 => REFSEL_A::REF7_8VDD, + 7 => REFSEL_A::AREF, + 8 => REFSEL_A::REF1_16VDD, + 9 => REFSEL_A::REF3_16VDD, + 10 => REFSEL_A::REF5_16VDD, + 11 => REFSEL_A::REF7_16VDD, + 12 => REFSEL_A::REF9_16VDD, + 13 => REFSEL_A::REF11_16VDD, + 14 => REFSEL_A::REF13_16VDD, + 15 => REFSEL_A::REF15_16VDD, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `REF1_8VDD`"] + #[inline(always)] + pub fn is_ref1_8vdd(&self) -> bool { + **self == REFSEL_A::REF1_8VDD + } + #[doc = "Checks if the value of the field is `REF2_8VDD`"] + #[inline(always)] + pub fn is_ref2_8vdd(&self) -> bool { + **self == REFSEL_A::REF2_8VDD + } + #[doc = "Checks if the value of the field is `REF3_8VDD`"] + #[inline(always)] + pub fn is_ref3_8vdd(&self) -> bool { + **self == REFSEL_A::REF3_8VDD + } + #[doc = "Checks if the value of the field is `REF4_8VDD`"] + #[inline(always)] + pub fn is_ref4_8vdd(&self) -> bool { + **self == REFSEL_A::REF4_8VDD + } + #[doc = "Checks if the value of the field is `REF5_8VDD`"] + #[inline(always)] + pub fn is_ref5_8vdd(&self) -> bool { + **self == REFSEL_A::REF5_8VDD + } + #[doc = "Checks if the value of the field is `REF6_8VDD`"] + #[inline(always)] + pub fn is_ref6_8vdd(&self) -> bool { + **self == REFSEL_A::REF6_8VDD + } + #[doc = "Checks if the value of the field is `REF7_8VDD`"] + #[inline(always)] + pub fn is_ref7_8vdd(&self) -> bool { + **self == REFSEL_A::REF7_8VDD + } + #[doc = "Checks if the value of the field is `AREF`"] + #[inline(always)] + pub fn is_aref(&self) -> bool { + **self == REFSEL_A::AREF + } + #[doc = "Checks if the value of the field is `REF1_16VDD`"] + #[inline(always)] + pub fn is_ref1_16vdd(&self) -> bool { + **self == REFSEL_A::REF1_16VDD + } + #[doc = "Checks if the value of the field is `REF3_16VDD`"] + #[inline(always)] + pub fn is_ref3_16vdd(&self) -> bool { + **self == REFSEL_A::REF3_16VDD + } + #[doc = "Checks if the value of the field is `REF5_16VDD`"] + #[inline(always)] + pub fn is_ref5_16vdd(&self) -> bool { + **self == REFSEL_A::REF5_16VDD + } + #[doc = "Checks if the value of the field is `REF7_16VDD`"] + #[inline(always)] + pub fn is_ref7_16vdd(&self) -> bool { + **self == REFSEL_A::REF7_16VDD + } + #[doc = "Checks if the value of the field is `REF9_16VDD`"] + #[inline(always)] + pub fn is_ref9_16vdd(&self) -> bool { + **self == REFSEL_A::REF9_16VDD + } + #[doc = "Checks if the value of the field is `REF11_16VDD`"] + #[inline(always)] + pub fn is_ref11_16vdd(&self) -> bool { + **self == REFSEL_A::REF11_16VDD + } + #[doc = "Checks if the value of the field is `REF13_16VDD`"] + #[inline(always)] + pub fn is_ref13_16vdd(&self) -> bool { + **self == REFSEL_A::REF13_16VDD + } + #[doc = "Checks if the value of the field is `REF15_16VDD`"] + #[inline(always)] + pub fn is_ref15_16vdd(&self) -> bool { + **self == REFSEL_A::REF15_16VDD + } +} +impl core::ops::Deref for REFSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REFSEL` writer - Reference select"] +pub struct REFSEL_W<'a> { + w: &'a mut W, +} +impl<'a> REFSEL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REFSEL_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "VDD * 1/8 selected as reference"] + #[inline(always)] + pub fn ref1_8vdd(self) -> &'a mut W { + self.variant(REFSEL_A::REF1_8VDD) + } + #[doc = "VDD * 2/8 selected as reference"] + #[inline(always)] + pub fn ref2_8vdd(self) -> &'a mut W { + self.variant(REFSEL_A::REF2_8VDD) + } + #[doc = "VDD * 3/8 selected as reference"] + #[inline(always)] + pub fn ref3_8vdd(self) -> &'a mut W { + self.variant(REFSEL_A::REF3_8VDD) + } + #[doc = "VDD * 4/8 selected as reference"] + #[inline(always)] + pub fn ref4_8vdd(self) -> &'a mut W { + self.variant(REFSEL_A::REF4_8VDD) + } + #[doc = "VDD * 5/8 selected as reference"] + #[inline(always)] + pub fn ref5_8vdd(self) -> &'a mut W { + self.variant(REFSEL_A::REF5_8VDD) + } + #[doc = "VDD * 6/8 selected as reference"] + #[inline(always)] + pub fn ref6_8vdd(self) -> &'a mut W { + self.variant(REFSEL_A::REF6_8VDD) + } + #[doc = "VDD * 7/8 selected as reference"] + #[inline(always)] + pub fn ref7_8vdd(self) -> &'a mut W { + self.variant(REFSEL_A::REF7_8VDD) + } + #[doc = "External analog reference selected"] + #[inline(always)] + pub fn aref(self) -> &'a mut W { + self.variant(REFSEL_A::AREF) + } + #[doc = "VDD * 1/16 selected as reference"] + #[inline(always)] + pub fn ref1_16vdd(self) -> &'a mut W { + self.variant(REFSEL_A::REF1_16VDD) + } + #[doc = "VDD * 3/16 selected as reference"] + #[inline(always)] + pub fn ref3_16vdd(self) -> &'a mut W { + self.variant(REFSEL_A::REF3_16VDD) + } + #[doc = "VDD * 5/16 selected as reference"] + #[inline(always)] + pub fn ref5_16vdd(self) -> &'a mut W { + self.variant(REFSEL_A::REF5_16VDD) + } + #[doc = "VDD * 7/16 selected as reference"] + #[inline(always)] + pub fn ref7_16vdd(self) -> &'a mut W { + self.variant(REFSEL_A::REF7_16VDD) + } + #[doc = "VDD * 9/16 selected as reference"] + #[inline(always)] + pub fn ref9_16vdd(self) -> &'a mut W { + self.variant(REFSEL_A::REF9_16VDD) + } + #[doc = "VDD * 11/16 selected as reference"] + #[inline(always)] + pub fn ref11_16vdd(self) -> &'a mut W { + self.variant(REFSEL_A::REF11_16VDD) + } + #[doc = "VDD * 13/16 selected as reference"] + #[inline(always)] + pub fn ref13_16vdd(self) -> &'a mut W { + self.variant(REFSEL_A::REF13_16VDD) + } + #[doc = "VDD * 15/16 selected as reference"] + #[inline(always)] + pub fn ref15_16vdd(self) -> &'a mut W { + self.variant(REFSEL_A::REF15_16VDD) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); + self.w + } +} +impl R { + #[doc = "Bits 0:3 - Reference select"] + #[inline(always)] + pub fn refsel(&self) -> REFSEL_R { + REFSEL_R::new((self.bits & 0x0f) as u8) + } +} +impl W { + #[doc = "Bits 0:3 - Reference select"] + #[inline(always)] + pub fn refsel(&mut self) -> REFSEL_W { + REFSEL_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Reference select\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [refsel](index.html) module"] +pub struct REFSEL_SPEC; +impl crate::RegisterSpec for REFSEL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [refsel::R](R) reader structure"] +impl crate::Readable for REFSEL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [refsel::W](W) writer structure"] +impl crate::Writable for REFSEL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets REFSEL to value 0x04"] +impl crate::Resettable for REFSEL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x04 + } +} diff --git a/src/lpcomp/result.rs b/src/lpcomp/result.rs new file mode 100644 index 0000000..aa2d146 --- /dev/null +++ b/src/lpcomp/result.rs @@ -0,0 +1,84 @@ +#[doc = "Register `RESULT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Result of last compare. Decision point SAMPLE task.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RESULT_A { + #[doc = "0: Input voltage is below the reference threshold (VIN+ < VIN-)."] + BELOW = 0, + #[doc = "1: Input voltage is above the reference threshold (VIN+ > VIN-)."] + ABOVE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RESULT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RESULT` reader - Result of last compare. Decision point SAMPLE task."] +pub struct RESULT_R(crate::FieldReader); +impl RESULT_R { + pub(crate) fn new(bits: bool) -> Self { + RESULT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RESULT_A { + match self.bits { + false => RESULT_A::BELOW, + true => RESULT_A::ABOVE, + } + } + #[doc = "Checks if the value of the field is `BELOW`"] + #[inline(always)] + pub fn is_below(&self) -> bool { + **self == RESULT_A::BELOW + } + #[doc = "Checks if the value of the field is `ABOVE`"] + #[inline(always)] + pub fn is_above(&self) -> bool { + **self == RESULT_A::ABOVE + } +} +impl core::ops::Deref for RESULT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bit 0 - Result of last compare. Decision point SAMPLE task."] + #[inline(always)] + pub fn result(&self) -> RESULT_R { + RESULT_R::new((self.bits & 0x01) != 0) + } +} +#[doc = "Compare result\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 [result](index.html) module"] +pub struct RESULT_SPEC; +impl crate::RegisterSpec for RESULT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [result::R](R) reader structure"] +impl crate::Readable for RESULT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets RESULT to value 0"] +impl crate::Resettable for RESULT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/lpcomp/shorts.rs b/src/lpcomp/shorts.rs new file mode 100644 index 0000000..c0d12c7 --- /dev/null +++ b/src/lpcomp/shorts.rs @@ -0,0 +1,531 @@ +#[doc = "Register `SHORTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SHORTS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Shortcut between READY event and SAMPLE task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_SAMPLE_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_SAMPLE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY_SAMPLE` reader - Shortcut between READY event and SAMPLE task"] +pub struct READY_SAMPLE_R(crate::FieldReader); +impl READY_SAMPLE_R { + pub(crate) fn new(bits: bool) -> Self { + READY_SAMPLE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> READY_SAMPLE_A { + match self.bits { + false => READY_SAMPLE_A::DISABLED, + true => READY_SAMPLE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == READY_SAMPLE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == READY_SAMPLE_A::ENABLED + } +} +impl core::ops::Deref for READY_SAMPLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `READY_SAMPLE` writer - Shortcut between READY event and SAMPLE task"] +pub struct READY_SAMPLE_W<'a> { + w: &'a mut W, +} +impl<'a> READY_SAMPLE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: READY_SAMPLE_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(READY_SAMPLE_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(READY_SAMPLE_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Shortcut between READY event and STOP task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_STOP_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_STOP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY_STOP` reader - Shortcut between READY event and STOP task"] +pub struct READY_STOP_R(crate::FieldReader); +impl READY_STOP_R { + pub(crate) fn new(bits: bool) -> Self { + READY_STOP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> READY_STOP_A { + match self.bits { + false => READY_STOP_A::DISABLED, + true => READY_STOP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == READY_STOP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == READY_STOP_A::ENABLED + } +} +impl core::ops::Deref for READY_STOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `READY_STOP` writer - Shortcut between READY event and STOP task"] +pub struct READY_STOP_W<'a> { + w: &'a mut W, +} +impl<'a> READY_STOP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: READY_STOP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(READY_STOP_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(READY_STOP_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Shortcut between DOWN event and STOP task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DOWN_STOP_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DOWN_STOP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DOWN_STOP` reader - Shortcut between DOWN event and STOP task"] +pub struct DOWN_STOP_R(crate::FieldReader); +impl DOWN_STOP_R { + pub(crate) fn new(bits: bool) -> Self { + DOWN_STOP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DOWN_STOP_A { + match self.bits { + false => DOWN_STOP_A::DISABLED, + true => DOWN_STOP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DOWN_STOP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DOWN_STOP_A::ENABLED + } +} +impl core::ops::Deref for DOWN_STOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DOWN_STOP` writer - Shortcut between DOWN event and STOP task"] +pub struct DOWN_STOP_W<'a> { + w: &'a mut W, +} +impl<'a> DOWN_STOP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DOWN_STOP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(DOWN_STOP_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(DOWN_STOP_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Shortcut between UP event and STOP task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum UP_STOP_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: UP_STOP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `UP_STOP` reader - Shortcut between UP event and STOP task"] +pub struct UP_STOP_R(crate::FieldReader); +impl UP_STOP_R { + pub(crate) fn new(bits: bool) -> Self { + UP_STOP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> UP_STOP_A { + match self.bits { + false => UP_STOP_A::DISABLED, + true => UP_STOP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == UP_STOP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == UP_STOP_A::ENABLED + } +} +impl core::ops::Deref for UP_STOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `UP_STOP` writer - Shortcut between UP event and STOP task"] +pub struct UP_STOP_W<'a> { + w: &'a mut W, +} +impl<'a> UP_STOP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: UP_STOP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(UP_STOP_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(UP_STOP_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Shortcut between CROSS event and STOP task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CROSS_STOP_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CROSS_STOP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CROSS_STOP` reader - Shortcut between CROSS event and STOP task"] +pub struct CROSS_STOP_R(crate::FieldReader); +impl CROSS_STOP_R { + pub(crate) fn new(bits: bool) -> Self { + CROSS_STOP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CROSS_STOP_A { + match self.bits { + false => CROSS_STOP_A::DISABLED, + true => CROSS_STOP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CROSS_STOP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CROSS_STOP_A::ENABLED + } +} +impl core::ops::Deref for CROSS_STOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CROSS_STOP` writer - Shortcut between CROSS event and STOP task"] +pub struct CROSS_STOP_W<'a> { + w: &'a mut W, +} +impl<'a> CROSS_STOP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CROSS_STOP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CROSS_STOP_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CROSS_STOP_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +impl R { + #[doc = "Bit 0 - Shortcut between READY event and SAMPLE task"] + #[inline(always)] + pub fn ready_sample(&self) -> READY_SAMPLE_R { + READY_SAMPLE_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Shortcut between READY event and STOP task"] + #[inline(always)] + pub fn ready_stop(&self) -> READY_STOP_R { + READY_STOP_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Shortcut between DOWN event and STOP task"] + #[inline(always)] + pub fn down_stop(&self) -> DOWN_STOP_R { + DOWN_STOP_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Shortcut between UP event and STOP task"] + #[inline(always)] + pub fn up_stop(&self) -> UP_STOP_R { + UP_STOP_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Shortcut between CROSS event and STOP task"] + #[inline(always)] + pub fn cross_stop(&self) -> CROSS_STOP_R { + CROSS_STOP_R::new(((self.bits >> 4) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Shortcut between READY event and SAMPLE task"] + #[inline(always)] + pub fn ready_sample(&mut self) -> READY_SAMPLE_W { + READY_SAMPLE_W { w: self } + } + #[doc = "Bit 1 - Shortcut between READY event and STOP task"] + #[inline(always)] + pub fn ready_stop(&mut self) -> READY_STOP_W { + READY_STOP_W { w: self } + } + #[doc = "Bit 2 - Shortcut between DOWN event and STOP task"] + #[inline(always)] + pub fn down_stop(&mut self) -> DOWN_STOP_W { + DOWN_STOP_W { w: self } + } + #[doc = "Bit 3 - Shortcut between UP event and STOP task"] + #[inline(always)] + pub fn up_stop(&mut self) -> UP_STOP_W { + UP_STOP_W { w: self } + } + #[doc = "Bit 4 - Shortcut between CROSS event and STOP task"] + #[inline(always)] + pub fn cross_stop(&mut self) -> CROSS_STOP_W { + CROSS_STOP_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Shortcut register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [shorts](index.html) module"] +pub struct SHORTS_SPEC; +impl crate::RegisterSpec for SHORTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [shorts::R](R) reader structure"] +impl crate::Readable for SHORTS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [shorts::W](W) writer structure"] +impl crate::Writable for SHORTS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SHORTS to value 0"] +impl crate::Resettable for SHORTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/lpcomp/tasks_sample.rs b/src/lpcomp/tasks_sample.rs new file mode 100644 index 0000000..f4bef55 --- /dev/null +++ b/src/lpcomp/tasks_sample.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_SAMPLE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Sample comparator value\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_sample](index.html) module"] +pub struct TASKS_SAMPLE_SPEC; +impl crate::RegisterSpec for TASKS_SAMPLE_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_sample::W](W) writer structure"] +impl crate::Writable for TASKS_SAMPLE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_SAMPLE to value 0"] +impl crate::Resettable for TASKS_SAMPLE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/lpcomp/tasks_start.rs b/src/lpcomp/tasks_start.rs new file mode 100644 index 0000000..f292fdd --- /dev/null +++ b/src/lpcomp/tasks_start.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_START` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start comparator\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_start](index.html) module"] +pub struct TASKS_START_SPEC; +impl crate::RegisterSpec for TASKS_START_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_start::W](W) writer structure"] +impl crate::Writable for TASKS_START_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_START to value 0"] +impl crate::Resettable for TASKS_START_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/lpcomp/tasks_stop.rs b/src/lpcomp/tasks_stop.rs new file mode 100644 index 0000000..b701f1a --- /dev/null +++ b/src/lpcomp/tasks_stop.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STOP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Stop comparator\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_stop](index.html) module"] +pub struct TASKS_STOP_SPEC; +impl crate::RegisterSpec for TASKS_STOP_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_stop::W](W) writer structure"] +impl crate::Writable for TASKS_STOP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STOP to value 0"] +impl crate::Resettable for TASKS_STOP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mwu.rs b/src/mwu.rs new file mode 100644 index 0000000..7c594c8 --- /dev/null +++ b/src/mwu.rs @@ -0,0 +1,145 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + _reserved0: [u8; 0x0100], + #[doc = "0x100..0x120 - Unspecified"] + pub events_region: [EVENTS_REGION; 4], + _reserved1: [u8; 0x40], + #[doc = "0x160..0x170 - Unspecified"] + pub events_pregion: [EVENTS_PREGION; 2], + _reserved2: [u8; 0x0190], + #[doc = "0x300 - Enable or disable interrupt"] + pub inten: crate::Reg, + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved5: [u8; 0x14], + #[doc = "0x320 - Enable or disable non-maskable interrupt"] + pub nmien: crate::Reg, + #[doc = "0x324 - Enable non-maskable interrupt"] + pub nmienset: crate::Reg, + #[doc = "0x328 - Disable non-maskable interrupt"] + pub nmienclr: crate::Reg, + _reserved8: [u8; 0xd4], + #[doc = "0x400..0x410 - Unspecified"] + pub perregion: [PERREGION; 2], + _reserved9: [u8; 0x0100], + #[doc = "0x510 - Enable/disable regions watch"] + pub regionen: crate::Reg, + #[doc = "0x514 - Enable regions watch"] + pub regionenset: crate::Reg, + #[doc = "0x518 - Disable regions watch"] + pub regionenclr: crate::Reg, + _reserved12: [u8; 0xe4], + #[doc = "0x600..0x608 - Unspecified"] + pub region0: REGION, + _reserved13: [u8; 0x08], + #[doc = "0x610..0x618 - Unspecified"] + pub region1: REGION, + _reserved14: [u8; 0x08], + #[doc = "0x620..0x628 - Unspecified"] + pub region2: REGION, + _reserved15: [u8; 0x08], + #[doc = "0x630..0x638 - Unspecified"] + pub region3: REGION, + _reserved16: [u8; 0x88], + #[doc = "0x6c0..0x6cc - Unspecified"] + pub pregion0: PREGION, + _reserved17: [u8; 0x04], + #[doc = "0x6d0..0x6dc - Unspecified"] + pub pregion1: PREGION, +} +#[doc = r"Register block"] +#[repr(C)] +pub struct EVENTS_REGION { + #[doc = "0x00 - Description cluster\\[0\\]: Write access to region 0 detected"] + pub wa: crate::Reg, + #[doc = "0x04 - Description cluster\\[0\\]: Read access to region 0 detected"] + pub ra: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod events_region; +#[doc = r"Register block"] +#[repr(C)] +pub struct EVENTS_PREGION { + #[doc = "0x00 - Description cluster\\[0\\]: Write access to peripheral region 0 detected"] + pub wa: crate::Reg, + #[doc = "0x04 - Description cluster\\[0\\]: Read access to peripheral region 0 detected"] + pub ra: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod events_pregion; +#[doc = r"Register block"] +#[repr(C)] +pub struct PERREGION { + #[doc = "0x00 - Description cluster\\[0\\]: Source of event/interrupt in region 0, write access detected while corresponding subregion was enabled for watching"] + pub substatwa: crate::Reg, + #[doc = "0x04 - Description cluster\\[0\\]: Source of event/interrupt in region 0, read access detected while corresponding subregion was enabled for watching"] + pub substatra: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod perregion; +#[doc = r"Register block"] +#[repr(C)] +pub struct REGION { + #[doc = "0x00 - Description cluster\\[0\\]: Start address for region 0"] + pub start: crate::Reg, + #[doc = "0x04 - Description cluster\\[0\\]: End address of region 0"] + pub end: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod region; +#[doc = r"Register block"] +#[repr(C)] +pub struct PREGION { + #[doc = "0x00 - Description cluster\\[0\\]: Reserved for future use"] + pub start: crate::Reg, + #[doc = "0x04 - Description cluster\\[0\\]: Reserved for future use"] + pub end: crate::Reg, + #[doc = "0x08 - Description cluster\\[0\\]: Subregions of region 0"] + pub subs: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod pregion; +#[doc = "INTEN register accessor: an alias for `Reg`"] +pub type INTEN = crate::Reg; +#[doc = "Enable or disable interrupt"] +pub mod inten; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "NMIEN register accessor: an alias for `Reg`"] +pub type NMIEN = crate::Reg; +#[doc = "Enable or disable non-maskable interrupt"] +pub mod nmien; +#[doc = "NMIENSET register accessor: an alias for `Reg`"] +pub type NMIENSET = crate::Reg; +#[doc = "Enable non-maskable interrupt"] +pub mod nmienset; +#[doc = "NMIENCLR register accessor: an alias for `Reg`"] +pub type NMIENCLR = crate::Reg; +#[doc = "Disable non-maskable interrupt"] +pub mod nmienclr; +#[doc = "REGIONEN register accessor: an alias for `Reg`"] +pub type REGIONEN = crate::Reg; +#[doc = "Enable/disable regions watch"] +pub mod regionen; +#[doc = "REGIONENSET register accessor: an alias for `Reg`"] +pub type REGIONENSET = crate::Reg; +#[doc = "Enable regions watch"] +pub mod regionenset; +#[doc = "REGIONENCLR register accessor: an alias for `Reg`"] +pub type REGIONENCLR = crate::Reg; +#[doc = "Disable regions watch"] +pub mod regionenclr; diff --git a/src/mwu/events_pregion.rs b/src/mwu/events_pregion.rs new file mode 100644 index 0000000..5bcaab9 --- /dev/null +++ b/src/mwu/events_pregion.rs @@ -0,0 +1,8 @@ +#[doc = "WA register accessor: an alias for `Reg`"] +pub type WA = crate::Reg; +#[doc = "Description cluster\\[0\\]: Write access to peripheral region 0 detected"] +pub mod wa; +#[doc = "RA register accessor: an alias for `Reg`"] +pub type RA = crate::Reg; +#[doc = "Description cluster\\[0\\]: Read access to peripheral region 0 detected"] +pub mod ra; diff --git a/src/mwu/events_pregion/ra.rs b/src/mwu/events_pregion/ra.rs new file mode 100644 index 0000000..d4eda43 --- /dev/null +++ b/src/mwu/events_pregion/ra.rs @@ -0,0 +1,64 @@ +#[doc = "Register `RA` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `RA` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description cluster\\[0\\]: Read access to peripheral region 0 detected\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ra](index.html) module"] +pub struct RA_SPEC; +impl crate::RegisterSpec for RA_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ra::R](R) reader structure"] +impl crate::Readable for RA_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ra::W](W) writer structure"] +impl crate::Writable for RA_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets RA to value 0"] +impl crate::Resettable for RA_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mwu/events_pregion/wa.rs b/src/mwu/events_pregion/wa.rs new file mode 100644 index 0000000..25267ba --- /dev/null +++ b/src/mwu/events_pregion/wa.rs @@ -0,0 +1,64 @@ +#[doc = "Register `WA` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `WA` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description cluster\\[0\\]: Write access to peripheral region 0 detected\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [wa](index.html) module"] +pub struct WA_SPEC; +impl crate::RegisterSpec for WA_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [wa::R](R) reader structure"] +impl crate::Readable for WA_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [wa::W](W) writer structure"] +impl crate::Writable for WA_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets WA to value 0"] +impl crate::Resettable for WA_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mwu/events_region.rs b/src/mwu/events_region.rs new file mode 100644 index 0000000..f782d44 --- /dev/null +++ b/src/mwu/events_region.rs @@ -0,0 +1,8 @@ +#[doc = "WA register accessor: an alias for `Reg`"] +pub type WA = crate::Reg; +#[doc = "Description cluster\\[0\\]: Write access to region 0 detected"] +pub mod wa; +#[doc = "RA register accessor: an alias for `Reg`"] +pub type RA = crate::Reg; +#[doc = "Description cluster\\[0\\]: Read access to region 0 detected"] +pub mod ra; diff --git a/src/mwu/events_region/ra.rs b/src/mwu/events_region/ra.rs new file mode 100644 index 0000000..8e21fc4 --- /dev/null +++ b/src/mwu/events_region/ra.rs @@ -0,0 +1,64 @@ +#[doc = "Register `RA` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `RA` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description cluster\\[0\\]: Read access to region 0 detected\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ra](index.html) module"] +pub struct RA_SPEC; +impl crate::RegisterSpec for RA_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ra::R](R) reader structure"] +impl crate::Readable for RA_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ra::W](W) writer structure"] +impl crate::Writable for RA_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets RA to value 0"] +impl crate::Resettable for RA_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mwu/events_region/wa.rs b/src/mwu/events_region/wa.rs new file mode 100644 index 0000000..a798784 --- /dev/null +++ b/src/mwu/events_region/wa.rs @@ -0,0 +1,64 @@ +#[doc = "Register `WA` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `WA` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description cluster\\[0\\]: Write access to region 0 detected\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [wa](index.html) module"] +pub struct WA_SPEC; +impl crate::RegisterSpec for WA_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [wa::R](R) reader structure"] +impl crate::Readable for WA_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [wa::W](W) writer structure"] +impl crate::Writable for WA_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets WA to value 0"] +impl crate::Resettable for WA_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mwu/inten.rs b/src/mwu/inten.rs new file mode 100644 index 0000000..b7c282e --- /dev/null +++ b/src/mwu/inten.rs @@ -0,0 +1,1182 @@ +#[doc = "Register `INTEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable interrupt for REGION\\[0\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION0WA_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION0WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION0WA` reader - Enable or disable interrupt for REGION\\[0\\].WA event"] +pub struct REGION0WA_R(crate::FieldReader); +impl REGION0WA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION0WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION0WA_A { + match self.bits { + false => REGION0WA_A::DISABLED, + true => REGION0WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION0WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION0WA_A::ENABLED + } +} +impl core::ops::Deref for REGION0WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION0WA` writer - Enable or disable interrupt for REGION\\[0\\].WA event"] +pub struct REGION0WA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION0WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION0WA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION0WA_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION0WA_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Enable or disable interrupt for REGION\\[0\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION0RA_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION0RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION0RA` reader - Enable or disable interrupt for REGION\\[0\\].RA event"] +pub struct REGION0RA_R(crate::FieldReader); +impl REGION0RA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION0RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION0RA_A { + match self.bits { + false => REGION0RA_A::DISABLED, + true => REGION0RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION0RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION0RA_A::ENABLED + } +} +impl core::ops::Deref for REGION0RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION0RA` writer - Enable or disable interrupt for REGION\\[0\\].RA event"] +pub struct REGION0RA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION0RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION0RA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION0RA_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION0RA_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Enable or disable interrupt for REGION\\[1\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION1WA_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION1WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION1WA` reader - Enable or disable interrupt for REGION\\[1\\].WA event"] +pub struct REGION1WA_R(crate::FieldReader); +impl REGION1WA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION1WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION1WA_A { + match self.bits { + false => REGION1WA_A::DISABLED, + true => REGION1WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION1WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION1WA_A::ENABLED + } +} +impl core::ops::Deref for REGION1WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION1WA` writer - Enable or disable interrupt for REGION\\[1\\].WA event"] +pub struct REGION1WA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION1WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION1WA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION1WA_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION1WA_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Enable or disable interrupt for REGION\\[1\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION1RA_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION1RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION1RA` reader - Enable or disable interrupt for REGION\\[1\\].RA event"] +pub struct REGION1RA_R(crate::FieldReader); +impl REGION1RA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION1RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION1RA_A { + match self.bits { + false => REGION1RA_A::DISABLED, + true => REGION1RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION1RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION1RA_A::ENABLED + } +} +impl core::ops::Deref for REGION1RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION1RA` writer - Enable or disable interrupt for REGION\\[1\\].RA event"] +pub struct REGION1RA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION1RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION1RA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION1RA_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION1RA_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Enable or disable interrupt for REGION\\[2\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION2WA_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION2WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION2WA` reader - Enable or disable interrupt for REGION\\[2\\].WA event"] +pub struct REGION2WA_R(crate::FieldReader); +impl REGION2WA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION2WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION2WA_A { + match self.bits { + false => REGION2WA_A::DISABLED, + true => REGION2WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION2WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION2WA_A::ENABLED + } +} +impl core::ops::Deref for REGION2WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION2WA` writer - Enable or disable interrupt for REGION\\[2\\].WA event"] +pub struct REGION2WA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION2WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION2WA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION2WA_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION2WA_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Enable or disable interrupt for REGION\\[2\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION2RA_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION2RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION2RA` reader - Enable or disable interrupt for REGION\\[2\\].RA event"] +pub struct REGION2RA_R(crate::FieldReader); +impl REGION2RA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION2RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION2RA_A { + match self.bits { + false => REGION2RA_A::DISABLED, + true => REGION2RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION2RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION2RA_A::ENABLED + } +} +impl core::ops::Deref for REGION2RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION2RA` writer - Enable or disable interrupt for REGION\\[2\\].RA event"] +pub struct REGION2RA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION2RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION2RA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION2RA_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION2RA_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Enable or disable interrupt for REGION\\[3\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION3WA_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION3WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION3WA` reader - Enable or disable interrupt for REGION\\[3\\].WA event"] +pub struct REGION3WA_R(crate::FieldReader); +impl REGION3WA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION3WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION3WA_A { + match self.bits { + false => REGION3WA_A::DISABLED, + true => REGION3WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION3WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION3WA_A::ENABLED + } +} +impl core::ops::Deref for REGION3WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION3WA` writer - Enable or disable interrupt for REGION\\[3\\].WA event"] +pub struct REGION3WA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION3WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION3WA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION3WA_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION3WA_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Enable or disable interrupt for REGION\\[3\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION3RA_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION3RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION3RA` reader - Enable or disable interrupt for REGION\\[3\\].RA event"] +pub struct REGION3RA_R(crate::FieldReader); +impl REGION3RA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION3RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION3RA_A { + match self.bits { + false => REGION3RA_A::DISABLED, + true => REGION3RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION3RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION3RA_A::ENABLED + } +} +impl core::ops::Deref for REGION3RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION3RA` writer - Enable or disable interrupt for REGION\\[3\\].RA event"] +pub struct REGION3RA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION3RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION3RA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION3RA_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION3RA_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Enable or disable interrupt for PREGION\\[0\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION0WA_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION0WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION0WA` reader - Enable or disable interrupt for PREGION\\[0\\].WA event"] +pub struct PREGION0WA_R(crate::FieldReader); +impl PREGION0WA_R { + pub(crate) fn new(bits: bool) -> Self { + PREGION0WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PREGION0WA_A { + match self.bits { + false => PREGION0WA_A::DISABLED, + true => PREGION0WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PREGION0WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PREGION0WA_A::ENABLED + } +} +impl core::ops::Deref for PREGION0WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PREGION0WA` writer - Enable or disable interrupt for PREGION\\[0\\].WA event"] +pub struct PREGION0WA_W<'a> { + w: &'a mut W, +} +impl<'a> PREGION0WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PREGION0WA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(PREGION0WA_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(PREGION0WA_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Enable or disable interrupt for PREGION\\[0\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION0RA_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION0RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION0RA` reader - Enable or disable interrupt for PREGION\\[0\\].RA event"] +pub struct PREGION0RA_R(crate::FieldReader); +impl PREGION0RA_R { + pub(crate) fn new(bits: bool) -> Self { + PREGION0RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PREGION0RA_A { + match self.bits { + false => PREGION0RA_A::DISABLED, + true => PREGION0RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PREGION0RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PREGION0RA_A::ENABLED + } +} +impl core::ops::Deref for PREGION0RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PREGION0RA` writer - Enable or disable interrupt for PREGION\\[0\\].RA event"] +pub struct PREGION0RA_W<'a> { + w: &'a mut W, +} +impl<'a> PREGION0RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PREGION0RA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(PREGION0RA_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(PREGION0RA_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Enable or disable interrupt for PREGION\\[1\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION1WA_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION1WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION1WA` reader - Enable or disable interrupt for PREGION\\[1\\].WA event"] +pub struct PREGION1WA_R(crate::FieldReader); +impl PREGION1WA_R { + pub(crate) fn new(bits: bool) -> Self { + PREGION1WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PREGION1WA_A { + match self.bits { + false => PREGION1WA_A::DISABLED, + true => PREGION1WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PREGION1WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PREGION1WA_A::ENABLED + } +} +impl core::ops::Deref for PREGION1WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PREGION1WA` writer - Enable or disable interrupt for PREGION\\[1\\].WA event"] +pub struct PREGION1WA_W<'a> { + w: &'a mut W, +} +impl<'a> PREGION1WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PREGION1WA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(PREGION1WA_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(PREGION1WA_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Enable or disable interrupt for PREGION\\[1\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION1RA_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION1RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION1RA` reader - Enable or disable interrupt for PREGION\\[1\\].RA event"] +pub struct PREGION1RA_R(crate::FieldReader); +impl PREGION1RA_R { + pub(crate) fn new(bits: bool) -> Self { + PREGION1RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PREGION1RA_A { + match self.bits { + false => PREGION1RA_A::DISABLED, + true => PREGION1RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PREGION1RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PREGION1RA_A::ENABLED + } +} +impl core::ops::Deref for PREGION1RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PREGION1RA` writer - Enable or disable interrupt for PREGION\\[1\\].RA event"] +pub struct PREGION1RA_W<'a> { + w: &'a mut W, +} +impl<'a> PREGION1RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PREGION1RA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(PREGION1RA_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(PREGION1RA_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable or disable interrupt for REGION\\[0\\].WA event"] + #[inline(always)] + pub fn region0wa(&self) -> REGION0WA_R { + REGION0WA_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Enable or disable interrupt for REGION\\[0\\].RA event"] + #[inline(always)] + pub fn region0ra(&self) -> REGION0RA_R { + REGION0RA_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Enable or disable interrupt for REGION\\[1\\].WA event"] + #[inline(always)] + pub fn region1wa(&self) -> REGION1WA_R { + REGION1WA_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Enable or disable interrupt for REGION\\[1\\].RA event"] + #[inline(always)] + pub fn region1ra(&self) -> REGION1RA_R { + REGION1RA_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Enable or disable interrupt for REGION\\[2\\].WA event"] + #[inline(always)] + pub fn region2wa(&self) -> REGION2WA_R { + REGION2WA_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Enable or disable interrupt for REGION\\[2\\].RA event"] + #[inline(always)] + pub fn region2ra(&self) -> REGION2RA_R { + REGION2RA_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Enable or disable interrupt for REGION\\[3\\].WA event"] + #[inline(always)] + pub fn region3wa(&self) -> REGION3WA_R { + REGION3WA_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Enable or disable interrupt for REGION\\[3\\].RA event"] + #[inline(always)] + pub fn region3ra(&self) -> REGION3RA_R { + REGION3RA_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 24 - Enable or disable interrupt for PREGION\\[0\\].WA event"] + #[inline(always)] + pub fn pregion0wa(&self) -> PREGION0WA_R { + PREGION0WA_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Enable or disable interrupt for PREGION\\[0\\].RA event"] + #[inline(always)] + pub fn pregion0ra(&self) -> PREGION0RA_R { + PREGION0RA_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Enable or disable interrupt for PREGION\\[1\\].WA event"] + #[inline(always)] + pub fn pregion1wa(&self) -> PREGION1WA_R { + PREGION1WA_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Enable or disable interrupt for PREGION\\[1\\].RA event"] + #[inline(always)] + pub fn pregion1ra(&self) -> PREGION1RA_R { + PREGION1RA_R::new(((self.bits >> 27) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Enable or disable interrupt for REGION\\[0\\].WA event"] + #[inline(always)] + pub fn region0wa(&mut self) -> REGION0WA_W { + REGION0WA_W { w: self } + } + #[doc = "Bit 1 - Enable or disable interrupt for REGION\\[0\\].RA event"] + #[inline(always)] + pub fn region0ra(&mut self) -> REGION0RA_W { + REGION0RA_W { w: self } + } + #[doc = "Bit 2 - Enable or disable interrupt for REGION\\[1\\].WA event"] + #[inline(always)] + pub fn region1wa(&mut self) -> REGION1WA_W { + REGION1WA_W { w: self } + } + #[doc = "Bit 3 - Enable or disable interrupt for REGION\\[1\\].RA event"] + #[inline(always)] + pub fn region1ra(&mut self) -> REGION1RA_W { + REGION1RA_W { w: self } + } + #[doc = "Bit 4 - Enable or disable interrupt for REGION\\[2\\].WA event"] + #[inline(always)] + pub fn region2wa(&mut self) -> REGION2WA_W { + REGION2WA_W { w: self } + } + #[doc = "Bit 5 - Enable or disable interrupt for REGION\\[2\\].RA event"] + #[inline(always)] + pub fn region2ra(&mut self) -> REGION2RA_W { + REGION2RA_W { w: self } + } + #[doc = "Bit 6 - Enable or disable interrupt for REGION\\[3\\].WA event"] + #[inline(always)] + pub fn region3wa(&mut self) -> REGION3WA_W { + REGION3WA_W { w: self } + } + #[doc = "Bit 7 - Enable or disable interrupt for REGION\\[3\\].RA event"] + #[inline(always)] + pub fn region3ra(&mut self) -> REGION3RA_W { + REGION3RA_W { w: self } + } + #[doc = "Bit 24 - Enable or disable interrupt for PREGION\\[0\\].WA event"] + #[inline(always)] + pub fn pregion0wa(&mut self) -> PREGION0WA_W { + PREGION0WA_W { w: self } + } + #[doc = "Bit 25 - Enable or disable interrupt for PREGION\\[0\\].RA event"] + #[inline(always)] + pub fn pregion0ra(&mut self) -> PREGION0RA_W { + PREGION0RA_W { w: self } + } + #[doc = "Bit 26 - Enable or disable interrupt for PREGION\\[1\\].WA event"] + #[inline(always)] + pub fn pregion1wa(&mut self) -> PREGION1WA_W { + PREGION1WA_W { w: self } + } + #[doc = "Bit 27 - Enable or disable interrupt for PREGION\\[1\\].RA event"] + #[inline(always)] + pub fn pregion1ra(&mut self) -> PREGION1RA_W { + PREGION1RA_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable or disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [inten](index.html) module"] +pub struct INTEN_SPEC; +impl crate::RegisterSpec for INTEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [inten::R](R) reader structure"] +impl crate::Readable for INTEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [inten::W](W) writer structure"] +impl crate::Writable for INTEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTEN to value 0"] +impl crate::Resettable for INTEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mwu/intenclr.rs b/src/mwu/intenclr.rs new file mode 100644 index 0000000..fae4c49 --- /dev/null +++ b/src/mwu/intenclr.rs @@ -0,0 +1,1266 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for REGION\\[0\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION0WA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION0WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION0WA` reader - Write '1' to Disable interrupt for REGION\\[0\\].WA event"] +pub struct REGION0WA_R(crate::FieldReader); +impl REGION0WA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION0WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION0WA_A { + match self.bits { + false => REGION0WA_A::DISABLED, + true => REGION0WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION0WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION0WA_A::ENABLED + } +} +impl core::ops::Deref for REGION0WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for REGION\\[0\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION0WA_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION0WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION0WA` writer - Write '1' to Disable interrupt for REGION\\[0\\].WA event"] +pub struct REGION0WA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION0WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION0WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(REGION0WA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for REGION\\[0\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION0RA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION0RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION0RA` reader - Write '1' to Disable interrupt for REGION\\[0\\].RA event"] +pub struct REGION0RA_R(crate::FieldReader); +impl REGION0RA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION0RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION0RA_A { + match self.bits { + false => REGION0RA_A::DISABLED, + true => REGION0RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION0RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION0RA_A::ENABLED + } +} +impl core::ops::Deref for REGION0RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for REGION\\[0\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION0RA_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION0RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION0RA` writer - Write '1' to Disable interrupt for REGION\\[0\\].RA event"] +pub struct REGION0RA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION0RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION0RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(REGION0RA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for REGION\\[1\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION1WA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION1WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION1WA` reader - Write '1' to Disable interrupt for REGION\\[1\\].WA event"] +pub struct REGION1WA_R(crate::FieldReader); +impl REGION1WA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION1WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION1WA_A { + match self.bits { + false => REGION1WA_A::DISABLED, + true => REGION1WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION1WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION1WA_A::ENABLED + } +} +impl core::ops::Deref for REGION1WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for REGION\\[1\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION1WA_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION1WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION1WA` writer - Write '1' to Disable interrupt for REGION\\[1\\].WA event"] +pub struct REGION1WA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION1WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION1WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(REGION1WA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for REGION\\[1\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION1RA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION1RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION1RA` reader - Write '1' to Disable interrupt for REGION\\[1\\].RA event"] +pub struct REGION1RA_R(crate::FieldReader); +impl REGION1RA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION1RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION1RA_A { + match self.bits { + false => REGION1RA_A::DISABLED, + true => REGION1RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION1RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION1RA_A::ENABLED + } +} +impl core::ops::Deref for REGION1RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for REGION\\[1\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION1RA_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION1RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION1RA` writer - Write '1' to Disable interrupt for REGION\\[1\\].RA event"] +pub struct REGION1RA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION1RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION1RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(REGION1RA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for REGION\\[2\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION2WA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION2WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION2WA` reader - Write '1' to Disable interrupt for REGION\\[2\\].WA event"] +pub struct REGION2WA_R(crate::FieldReader); +impl REGION2WA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION2WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION2WA_A { + match self.bits { + false => REGION2WA_A::DISABLED, + true => REGION2WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION2WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION2WA_A::ENABLED + } +} +impl core::ops::Deref for REGION2WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for REGION\\[2\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION2WA_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION2WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION2WA` writer - Write '1' to Disable interrupt for REGION\\[2\\].WA event"] +pub struct REGION2WA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION2WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION2WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(REGION2WA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for REGION\\[2\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION2RA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION2RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION2RA` reader - Write '1' to Disable interrupt for REGION\\[2\\].RA event"] +pub struct REGION2RA_R(crate::FieldReader); +impl REGION2RA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION2RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION2RA_A { + match self.bits { + false => REGION2RA_A::DISABLED, + true => REGION2RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION2RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION2RA_A::ENABLED + } +} +impl core::ops::Deref for REGION2RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for REGION\\[2\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION2RA_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION2RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION2RA` writer - Write '1' to Disable interrupt for REGION\\[2\\].RA event"] +pub struct REGION2RA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION2RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION2RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(REGION2RA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for REGION\\[3\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION3WA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION3WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION3WA` reader - Write '1' to Disable interrupt for REGION\\[3\\].WA event"] +pub struct REGION3WA_R(crate::FieldReader); +impl REGION3WA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION3WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION3WA_A { + match self.bits { + false => REGION3WA_A::DISABLED, + true => REGION3WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION3WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION3WA_A::ENABLED + } +} +impl core::ops::Deref for REGION3WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for REGION\\[3\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION3WA_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION3WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION3WA` writer - Write '1' to Disable interrupt for REGION\\[3\\].WA event"] +pub struct REGION3WA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION3WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION3WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(REGION3WA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for REGION\\[3\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION3RA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION3RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION3RA` reader - Write '1' to Disable interrupt for REGION\\[3\\].RA event"] +pub struct REGION3RA_R(crate::FieldReader); +impl REGION3RA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION3RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION3RA_A { + match self.bits { + false => REGION3RA_A::DISABLED, + true => REGION3RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION3RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION3RA_A::ENABLED + } +} +impl core::ops::Deref for REGION3RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for REGION\\[3\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION3RA_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION3RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION3RA` writer - Write '1' to Disable interrupt for REGION\\[3\\].RA event"] +pub struct REGION3RA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION3RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION3RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(REGION3RA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for PREGION\\[0\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION0WA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION0WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION0WA` reader - Write '1' to Disable interrupt for PREGION\\[0\\].WA event"] +pub struct PREGION0WA_R(crate::FieldReader); +impl PREGION0WA_R { + pub(crate) fn new(bits: bool) -> Self { + PREGION0WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PREGION0WA_A { + match self.bits { + false => PREGION0WA_A::DISABLED, + true => PREGION0WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PREGION0WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PREGION0WA_A::ENABLED + } +} +impl core::ops::Deref for PREGION0WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for PREGION\\[0\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION0WA_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION0WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION0WA` writer - Write '1' to Disable interrupt for PREGION\\[0\\].WA event"] +pub struct PREGION0WA_W<'a> { + w: &'a mut W, +} +impl<'a> PREGION0WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PREGION0WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PREGION0WA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for PREGION\\[0\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION0RA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION0RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION0RA` reader - Write '1' to Disable interrupt for PREGION\\[0\\].RA event"] +pub struct PREGION0RA_R(crate::FieldReader); +impl PREGION0RA_R { + pub(crate) fn new(bits: bool) -> Self { + PREGION0RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PREGION0RA_A { + match self.bits { + false => PREGION0RA_A::DISABLED, + true => PREGION0RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PREGION0RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PREGION0RA_A::ENABLED + } +} +impl core::ops::Deref for PREGION0RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for PREGION\\[0\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION0RA_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION0RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION0RA` writer - Write '1' to Disable interrupt for PREGION\\[0\\].RA event"] +pub struct PREGION0RA_W<'a> { + w: &'a mut W, +} +impl<'a> PREGION0RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PREGION0RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PREGION0RA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for PREGION\\[1\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION1WA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION1WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION1WA` reader - Write '1' to Disable interrupt for PREGION\\[1\\].WA event"] +pub struct PREGION1WA_R(crate::FieldReader); +impl PREGION1WA_R { + pub(crate) fn new(bits: bool) -> Self { + PREGION1WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PREGION1WA_A { + match self.bits { + false => PREGION1WA_A::DISABLED, + true => PREGION1WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PREGION1WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PREGION1WA_A::ENABLED + } +} +impl core::ops::Deref for PREGION1WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for PREGION\\[1\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION1WA_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION1WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION1WA` writer - Write '1' to Disable interrupt for PREGION\\[1\\].WA event"] +pub struct PREGION1WA_W<'a> { + w: &'a mut W, +} +impl<'a> PREGION1WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PREGION1WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PREGION1WA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for PREGION\\[1\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION1RA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION1RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION1RA` reader - Write '1' to Disable interrupt for PREGION\\[1\\].RA event"] +pub struct PREGION1RA_R(crate::FieldReader); +impl PREGION1RA_R { + pub(crate) fn new(bits: bool) -> Self { + PREGION1RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PREGION1RA_A { + match self.bits { + false => PREGION1RA_A::DISABLED, + true => PREGION1RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PREGION1RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PREGION1RA_A::ENABLED + } +} +impl core::ops::Deref for PREGION1RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for PREGION\\[1\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION1RA_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION1RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION1RA` writer - Write '1' to Disable interrupt for PREGION\\[1\\].RA event"] +pub struct PREGION1RA_W<'a> { + w: &'a mut W, +} +impl<'a> PREGION1RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PREGION1RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PREGION1RA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Disable interrupt for REGION\\[0\\].WA event"] + #[inline(always)] + pub fn region0wa(&self) -> REGION0WA_R { + REGION0WA_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for REGION\\[0\\].RA event"] + #[inline(always)] + pub fn region0ra(&self) -> REGION0RA_R { + REGION0RA_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for REGION\\[1\\].WA event"] + #[inline(always)] + pub fn region1wa(&self) -> REGION1WA_R { + REGION1WA_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Write '1' to Disable interrupt for REGION\\[1\\].RA event"] + #[inline(always)] + pub fn region1ra(&self) -> REGION1RA_R { + REGION1RA_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Write '1' to Disable interrupt for REGION\\[2\\].WA event"] + #[inline(always)] + pub fn region2wa(&self) -> REGION2WA_R { + REGION2WA_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Write '1' to Disable interrupt for REGION\\[2\\].RA event"] + #[inline(always)] + pub fn region2ra(&self) -> REGION2RA_R { + REGION2RA_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Write '1' to Disable interrupt for REGION\\[3\\].WA event"] + #[inline(always)] + pub fn region3wa(&self) -> REGION3WA_R { + REGION3WA_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Write '1' to Disable interrupt for REGION\\[3\\].RA event"] + #[inline(always)] + pub fn region3ra(&self) -> REGION3RA_R { + REGION3RA_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 24 - Write '1' to Disable interrupt for PREGION\\[0\\].WA event"] + #[inline(always)] + pub fn pregion0wa(&self) -> PREGION0WA_R { + PREGION0WA_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Write '1' to Disable interrupt for PREGION\\[0\\].RA event"] + #[inline(always)] + pub fn pregion0ra(&self) -> PREGION0RA_R { + PREGION0RA_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Write '1' to Disable interrupt for PREGION\\[1\\].WA event"] + #[inline(always)] + pub fn pregion1wa(&self) -> PREGION1WA_R { + PREGION1WA_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Write '1' to Disable interrupt for PREGION\\[1\\].RA event"] + #[inline(always)] + pub fn pregion1ra(&self) -> PREGION1RA_R { + PREGION1RA_R::new(((self.bits >> 27) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Disable interrupt for REGION\\[0\\].WA event"] + #[inline(always)] + pub fn region0wa(&mut self) -> REGION0WA_W { + REGION0WA_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for REGION\\[0\\].RA event"] + #[inline(always)] + pub fn region0ra(&mut self) -> REGION0RA_W { + REGION0RA_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for REGION\\[1\\].WA event"] + #[inline(always)] + pub fn region1wa(&mut self) -> REGION1WA_W { + REGION1WA_W { w: self } + } + #[doc = "Bit 3 - Write '1' to Disable interrupt for REGION\\[1\\].RA event"] + #[inline(always)] + pub fn region1ra(&mut self) -> REGION1RA_W { + REGION1RA_W { w: self } + } + #[doc = "Bit 4 - Write '1' to Disable interrupt for REGION\\[2\\].WA event"] + #[inline(always)] + pub fn region2wa(&mut self) -> REGION2WA_W { + REGION2WA_W { w: self } + } + #[doc = "Bit 5 - Write '1' to Disable interrupt for REGION\\[2\\].RA event"] + #[inline(always)] + pub fn region2ra(&mut self) -> REGION2RA_W { + REGION2RA_W { w: self } + } + #[doc = "Bit 6 - Write '1' to Disable interrupt for REGION\\[3\\].WA event"] + #[inline(always)] + pub fn region3wa(&mut self) -> REGION3WA_W { + REGION3WA_W { w: self } + } + #[doc = "Bit 7 - Write '1' to Disable interrupt for REGION\\[3\\].RA event"] + #[inline(always)] + pub fn region3ra(&mut self) -> REGION3RA_W { + REGION3RA_W { w: self } + } + #[doc = "Bit 24 - Write '1' to Disable interrupt for PREGION\\[0\\].WA event"] + #[inline(always)] + pub fn pregion0wa(&mut self) -> PREGION0WA_W { + PREGION0WA_W { w: self } + } + #[doc = "Bit 25 - Write '1' to Disable interrupt for PREGION\\[0\\].RA event"] + #[inline(always)] + pub fn pregion0ra(&mut self) -> PREGION0RA_W { + PREGION0RA_W { w: self } + } + #[doc = "Bit 26 - Write '1' to Disable interrupt for PREGION\\[1\\].WA event"] + #[inline(always)] + pub fn pregion1wa(&mut self) -> PREGION1WA_W { + PREGION1WA_W { w: self } + } + #[doc = "Bit 27 - Write '1' to Disable interrupt for PREGION\\[1\\].RA event"] + #[inline(always)] + pub fn pregion1ra(&mut self) -> PREGION1RA_W { + PREGION1RA_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mwu/intenset.rs b/src/mwu/intenset.rs new file mode 100644 index 0000000..cc8cdd7 --- /dev/null +++ b/src/mwu/intenset.rs @@ -0,0 +1,1266 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for REGION\\[0\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION0WA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION0WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION0WA` reader - Write '1' to Enable interrupt for REGION\\[0\\].WA event"] +pub struct REGION0WA_R(crate::FieldReader); +impl REGION0WA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION0WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION0WA_A { + match self.bits { + false => REGION0WA_A::DISABLED, + true => REGION0WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION0WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION0WA_A::ENABLED + } +} +impl core::ops::Deref for REGION0WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for REGION\\[0\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION0WA_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION0WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION0WA` writer - Write '1' to Enable interrupt for REGION\\[0\\].WA event"] +pub struct REGION0WA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION0WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION0WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(REGION0WA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for REGION\\[0\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION0RA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION0RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION0RA` reader - Write '1' to Enable interrupt for REGION\\[0\\].RA event"] +pub struct REGION0RA_R(crate::FieldReader); +impl REGION0RA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION0RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION0RA_A { + match self.bits { + false => REGION0RA_A::DISABLED, + true => REGION0RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION0RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION0RA_A::ENABLED + } +} +impl core::ops::Deref for REGION0RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for REGION\\[0\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION0RA_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION0RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION0RA` writer - Write '1' to Enable interrupt for REGION\\[0\\].RA event"] +pub struct REGION0RA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION0RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION0RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(REGION0RA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for REGION\\[1\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION1WA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION1WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION1WA` reader - Write '1' to Enable interrupt for REGION\\[1\\].WA event"] +pub struct REGION1WA_R(crate::FieldReader); +impl REGION1WA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION1WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION1WA_A { + match self.bits { + false => REGION1WA_A::DISABLED, + true => REGION1WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION1WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION1WA_A::ENABLED + } +} +impl core::ops::Deref for REGION1WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for REGION\\[1\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION1WA_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION1WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION1WA` writer - Write '1' to Enable interrupt for REGION\\[1\\].WA event"] +pub struct REGION1WA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION1WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION1WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(REGION1WA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for REGION\\[1\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION1RA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION1RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION1RA` reader - Write '1' to Enable interrupt for REGION\\[1\\].RA event"] +pub struct REGION1RA_R(crate::FieldReader); +impl REGION1RA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION1RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION1RA_A { + match self.bits { + false => REGION1RA_A::DISABLED, + true => REGION1RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION1RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION1RA_A::ENABLED + } +} +impl core::ops::Deref for REGION1RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for REGION\\[1\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION1RA_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION1RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION1RA` writer - Write '1' to Enable interrupt for REGION\\[1\\].RA event"] +pub struct REGION1RA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION1RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION1RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(REGION1RA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for REGION\\[2\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION2WA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION2WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION2WA` reader - Write '1' to Enable interrupt for REGION\\[2\\].WA event"] +pub struct REGION2WA_R(crate::FieldReader); +impl REGION2WA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION2WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION2WA_A { + match self.bits { + false => REGION2WA_A::DISABLED, + true => REGION2WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION2WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION2WA_A::ENABLED + } +} +impl core::ops::Deref for REGION2WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for REGION\\[2\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION2WA_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION2WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION2WA` writer - Write '1' to Enable interrupt for REGION\\[2\\].WA event"] +pub struct REGION2WA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION2WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION2WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(REGION2WA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for REGION\\[2\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION2RA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION2RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION2RA` reader - Write '1' to Enable interrupt for REGION\\[2\\].RA event"] +pub struct REGION2RA_R(crate::FieldReader); +impl REGION2RA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION2RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION2RA_A { + match self.bits { + false => REGION2RA_A::DISABLED, + true => REGION2RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION2RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION2RA_A::ENABLED + } +} +impl core::ops::Deref for REGION2RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for REGION\\[2\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION2RA_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION2RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION2RA` writer - Write '1' to Enable interrupt for REGION\\[2\\].RA event"] +pub struct REGION2RA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION2RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION2RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(REGION2RA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for REGION\\[3\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION3WA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION3WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION3WA` reader - Write '1' to Enable interrupt for REGION\\[3\\].WA event"] +pub struct REGION3WA_R(crate::FieldReader); +impl REGION3WA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION3WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION3WA_A { + match self.bits { + false => REGION3WA_A::DISABLED, + true => REGION3WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION3WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION3WA_A::ENABLED + } +} +impl core::ops::Deref for REGION3WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for REGION\\[3\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION3WA_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION3WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION3WA` writer - Write '1' to Enable interrupt for REGION\\[3\\].WA event"] +pub struct REGION3WA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION3WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION3WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(REGION3WA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for REGION\\[3\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION3RA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION3RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION3RA` reader - Write '1' to Enable interrupt for REGION\\[3\\].RA event"] +pub struct REGION3RA_R(crate::FieldReader); +impl REGION3RA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION3RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION3RA_A { + match self.bits { + false => REGION3RA_A::DISABLED, + true => REGION3RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION3RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION3RA_A::ENABLED + } +} +impl core::ops::Deref for REGION3RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for REGION\\[3\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION3RA_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION3RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION3RA` writer - Write '1' to Enable interrupt for REGION\\[3\\].RA event"] +pub struct REGION3RA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION3RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION3RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(REGION3RA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for PREGION\\[0\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION0WA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION0WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION0WA` reader - Write '1' to Enable interrupt for PREGION\\[0\\].WA event"] +pub struct PREGION0WA_R(crate::FieldReader); +impl PREGION0WA_R { + pub(crate) fn new(bits: bool) -> Self { + PREGION0WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PREGION0WA_A { + match self.bits { + false => PREGION0WA_A::DISABLED, + true => PREGION0WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PREGION0WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PREGION0WA_A::ENABLED + } +} +impl core::ops::Deref for PREGION0WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for PREGION\\[0\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION0WA_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION0WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION0WA` writer - Write '1' to Enable interrupt for PREGION\\[0\\].WA event"] +pub struct PREGION0WA_W<'a> { + w: &'a mut W, +} +impl<'a> PREGION0WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PREGION0WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PREGION0WA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for PREGION\\[0\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION0RA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION0RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION0RA` reader - Write '1' to Enable interrupt for PREGION\\[0\\].RA event"] +pub struct PREGION0RA_R(crate::FieldReader); +impl PREGION0RA_R { + pub(crate) fn new(bits: bool) -> Self { + PREGION0RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PREGION0RA_A { + match self.bits { + false => PREGION0RA_A::DISABLED, + true => PREGION0RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PREGION0RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PREGION0RA_A::ENABLED + } +} +impl core::ops::Deref for PREGION0RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for PREGION\\[0\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION0RA_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION0RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION0RA` writer - Write '1' to Enable interrupt for PREGION\\[0\\].RA event"] +pub struct PREGION0RA_W<'a> { + w: &'a mut W, +} +impl<'a> PREGION0RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PREGION0RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PREGION0RA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for PREGION\\[1\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION1WA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION1WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION1WA` reader - Write '1' to Enable interrupt for PREGION\\[1\\].WA event"] +pub struct PREGION1WA_R(crate::FieldReader); +impl PREGION1WA_R { + pub(crate) fn new(bits: bool) -> Self { + PREGION1WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PREGION1WA_A { + match self.bits { + false => PREGION1WA_A::DISABLED, + true => PREGION1WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PREGION1WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PREGION1WA_A::ENABLED + } +} +impl core::ops::Deref for PREGION1WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for PREGION\\[1\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION1WA_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION1WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION1WA` writer - Write '1' to Enable interrupt for PREGION\\[1\\].WA event"] +pub struct PREGION1WA_W<'a> { + w: &'a mut W, +} +impl<'a> PREGION1WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PREGION1WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PREGION1WA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for PREGION\\[1\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION1RA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION1RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION1RA` reader - Write '1' to Enable interrupt for PREGION\\[1\\].RA event"] +pub struct PREGION1RA_R(crate::FieldReader); +impl PREGION1RA_R { + pub(crate) fn new(bits: bool) -> Self { + PREGION1RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PREGION1RA_A { + match self.bits { + false => PREGION1RA_A::DISABLED, + true => PREGION1RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PREGION1RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PREGION1RA_A::ENABLED + } +} +impl core::ops::Deref for PREGION1RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for PREGION\\[1\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION1RA_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION1RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION1RA` writer - Write '1' to Enable interrupt for PREGION\\[1\\].RA event"] +pub struct PREGION1RA_W<'a> { + w: &'a mut W, +} +impl<'a> PREGION1RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PREGION1RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PREGION1RA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Enable interrupt for REGION\\[0\\].WA event"] + #[inline(always)] + pub fn region0wa(&self) -> REGION0WA_R { + REGION0WA_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for REGION\\[0\\].RA event"] + #[inline(always)] + pub fn region0ra(&self) -> REGION0RA_R { + REGION0RA_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for REGION\\[1\\].WA event"] + #[inline(always)] + pub fn region1wa(&self) -> REGION1WA_R { + REGION1WA_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Write '1' to Enable interrupt for REGION\\[1\\].RA event"] + #[inline(always)] + pub fn region1ra(&self) -> REGION1RA_R { + REGION1RA_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Write '1' to Enable interrupt for REGION\\[2\\].WA event"] + #[inline(always)] + pub fn region2wa(&self) -> REGION2WA_R { + REGION2WA_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Write '1' to Enable interrupt for REGION\\[2\\].RA event"] + #[inline(always)] + pub fn region2ra(&self) -> REGION2RA_R { + REGION2RA_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Write '1' to Enable interrupt for REGION\\[3\\].WA event"] + #[inline(always)] + pub fn region3wa(&self) -> REGION3WA_R { + REGION3WA_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Write '1' to Enable interrupt for REGION\\[3\\].RA event"] + #[inline(always)] + pub fn region3ra(&self) -> REGION3RA_R { + REGION3RA_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 24 - Write '1' to Enable interrupt for PREGION\\[0\\].WA event"] + #[inline(always)] + pub fn pregion0wa(&self) -> PREGION0WA_R { + PREGION0WA_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Write '1' to Enable interrupt for PREGION\\[0\\].RA event"] + #[inline(always)] + pub fn pregion0ra(&self) -> PREGION0RA_R { + PREGION0RA_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Write '1' to Enable interrupt for PREGION\\[1\\].WA event"] + #[inline(always)] + pub fn pregion1wa(&self) -> PREGION1WA_R { + PREGION1WA_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Write '1' to Enable interrupt for PREGION\\[1\\].RA event"] + #[inline(always)] + pub fn pregion1ra(&self) -> PREGION1RA_R { + PREGION1RA_R::new(((self.bits >> 27) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Enable interrupt for REGION\\[0\\].WA event"] + #[inline(always)] + pub fn region0wa(&mut self) -> REGION0WA_W { + REGION0WA_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for REGION\\[0\\].RA event"] + #[inline(always)] + pub fn region0ra(&mut self) -> REGION0RA_W { + REGION0RA_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for REGION\\[1\\].WA event"] + #[inline(always)] + pub fn region1wa(&mut self) -> REGION1WA_W { + REGION1WA_W { w: self } + } + #[doc = "Bit 3 - Write '1' to Enable interrupt for REGION\\[1\\].RA event"] + #[inline(always)] + pub fn region1ra(&mut self) -> REGION1RA_W { + REGION1RA_W { w: self } + } + #[doc = "Bit 4 - Write '1' to Enable interrupt for REGION\\[2\\].WA event"] + #[inline(always)] + pub fn region2wa(&mut self) -> REGION2WA_W { + REGION2WA_W { w: self } + } + #[doc = "Bit 5 - Write '1' to Enable interrupt for REGION\\[2\\].RA event"] + #[inline(always)] + pub fn region2ra(&mut self) -> REGION2RA_W { + REGION2RA_W { w: self } + } + #[doc = "Bit 6 - Write '1' to Enable interrupt for REGION\\[3\\].WA event"] + #[inline(always)] + pub fn region3wa(&mut self) -> REGION3WA_W { + REGION3WA_W { w: self } + } + #[doc = "Bit 7 - Write '1' to Enable interrupt for REGION\\[3\\].RA event"] + #[inline(always)] + pub fn region3ra(&mut self) -> REGION3RA_W { + REGION3RA_W { w: self } + } + #[doc = "Bit 24 - Write '1' to Enable interrupt for PREGION\\[0\\].WA event"] + #[inline(always)] + pub fn pregion0wa(&mut self) -> PREGION0WA_W { + PREGION0WA_W { w: self } + } + #[doc = "Bit 25 - Write '1' to Enable interrupt for PREGION\\[0\\].RA event"] + #[inline(always)] + pub fn pregion0ra(&mut self) -> PREGION0RA_W { + PREGION0RA_W { w: self } + } + #[doc = "Bit 26 - Write '1' to Enable interrupt for PREGION\\[1\\].WA event"] + #[inline(always)] + pub fn pregion1wa(&mut self) -> PREGION1WA_W { + PREGION1WA_W { w: self } + } + #[doc = "Bit 27 - Write '1' to Enable interrupt for PREGION\\[1\\].RA event"] + #[inline(always)] + pub fn pregion1ra(&mut self) -> PREGION1RA_W { + PREGION1RA_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mwu/nmien.rs b/src/mwu/nmien.rs new file mode 100644 index 0000000..268a3f9 --- /dev/null +++ b/src/mwu/nmien.rs @@ -0,0 +1,1182 @@ +#[doc = "Register `NMIEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NMIEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable non-maskable interrupt for REGION\\[0\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION0WA_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION0WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION0WA` reader - Enable or disable non-maskable interrupt for REGION\\[0\\].WA event"] +pub struct REGION0WA_R(crate::FieldReader); +impl REGION0WA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION0WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION0WA_A { + match self.bits { + false => REGION0WA_A::DISABLED, + true => REGION0WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION0WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION0WA_A::ENABLED + } +} +impl core::ops::Deref for REGION0WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION0WA` writer - Enable or disable non-maskable interrupt for REGION\\[0\\].WA event"] +pub struct REGION0WA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION0WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION0WA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION0WA_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION0WA_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Enable or disable non-maskable interrupt for REGION\\[0\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION0RA_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION0RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION0RA` reader - Enable or disable non-maskable interrupt for REGION\\[0\\].RA event"] +pub struct REGION0RA_R(crate::FieldReader); +impl REGION0RA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION0RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION0RA_A { + match self.bits { + false => REGION0RA_A::DISABLED, + true => REGION0RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION0RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION0RA_A::ENABLED + } +} +impl core::ops::Deref for REGION0RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION0RA` writer - Enable or disable non-maskable interrupt for REGION\\[0\\].RA event"] +pub struct REGION0RA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION0RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION0RA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION0RA_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION0RA_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Enable or disable non-maskable interrupt for REGION\\[1\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION1WA_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION1WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION1WA` reader - Enable or disable non-maskable interrupt for REGION\\[1\\].WA event"] +pub struct REGION1WA_R(crate::FieldReader); +impl REGION1WA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION1WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION1WA_A { + match self.bits { + false => REGION1WA_A::DISABLED, + true => REGION1WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION1WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION1WA_A::ENABLED + } +} +impl core::ops::Deref for REGION1WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION1WA` writer - Enable or disable non-maskable interrupt for REGION\\[1\\].WA event"] +pub struct REGION1WA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION1WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION1WA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION1WA_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION1WA_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Enable or disable non-maskable interrupt for REGION\\[1\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION1RA_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION1RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION1RA` reader - Enable or disable non-maskable interrupt for REGION\\[1\\].RA event"] +pub struct REGION1RA_R(crate::FieldReader); +impl REGION1RA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION1RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION1RA_A { + match self.bits { + false => REGION1RA_A::DISABLED, + true => REGION1RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION1RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION1RA_A::ENABLED + } +} +impl core::ops::Deref for REGION1RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION1RA` writer - Enable or disable non-maskable interrupt for REGION\\[1\\].RA event"] +pub struct REGION1RA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION1RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION1RA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION1RA_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION1RA_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Enable or disable non-maskable interrupt for REGION\\[2\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION2WA_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION2WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION2WA` reader - Enable or disable non-maskable interrupt for REGION\\[2\\].WA event"] +pub struct REGION2WA_R(crate::FieldReader); +impl REGION2WA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION2WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION2WA_A { + match self.bits { + false => REGION2WA_A::DISABLED, + true => REGION2WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION2WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION2WA_A::ENABLED + } +} +impl core::ops::Deref for REGION2WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION2WA` writer - Enable or disable non-maskable interrupt for REGION\\[2\\].WA event"] +pub struct REGION2WA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION2WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION2WA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION2WA_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION2WA_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Enable or disable non-maskable interrupt for REGION\\[2\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION2RA_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION2RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION2RA` reader - Enable or disable non-maskable interrupt for REGION\\[2\\].RA event"] +pub struct REGION2RA_R(crate::FieldReader); +impl REGION2RA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION2RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION2RA_A { + match self.bits { + false => REGION2RA_A::DISABLED, + true => REGION2RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION2RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION2RA_A::ENABLED + } +} +impl core::ops::Deref for REGION2RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION2RA` writer - Enable or disable non-maskable interrupt for REGION\\[2\\].RA event"] +pub struct REGION2RA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION2RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION2RA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION2RA_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION2RA_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Enable or disable non-maskable interrupt for REGION\\[3\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION3WA_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION3WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION3WA` reader - Enable or disable non-maskable interrupt for REGION\\[3\\].WA event"] +pub struct REGION3WA_R(crate::FieldReader); +impl REGION3WA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION3WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION3WA_A { + match self.bits { + false => REGION3WA_A::DISABLED, + true => REGION3WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION3WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION3WA_A::ENABLED + } +} +impl core::ops::Deref for REGION3WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION3WA` writer - Enable or disable non-maskable interrupt for REGION\\[3\\].WA event"] +pub struct REGION3WA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION3WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION3WA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION3WA_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION3WA_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Enable or disable non-maskable interrupt for REGION\\[3\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION3RA_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION3RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION3RA` reader - Enable or disable non-maskable interrupt for REGION\\[3\\].RA event"] +pub struct REGION3RA_R(crate::FieldReader); +impl REGION3RA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION3RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION3RA_A { + match self.bits { + false => REGION3RA_A::DISABLED, + true => REGION3RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION3RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION3RA_A::ENABLED + } +} +impl core::ops::Deref for REGION3RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REGION3RA` writer - Enable or disable non-maskable interrupt for REGION\\[3\\].RA event"] +pub struct REGION3RA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION3RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION3RA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REGION3RA_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REGION3RA_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Enable or disable non-maskable interrupt for PREGION\\[0\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION0WA_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION0WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION0WA` reader - Enable or disable non-maskable interrupt for PREGION\\[0\\].WA event"] +pub struct PREGION0WA_R(crate::FieldReader); +impl PREGION0WA_R { + pub(crate) fn new(bits: bool) -> Self { + PREGION0WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PREGION0WA_A { + match self.bits { + false => PREGION0WA_A::DISABLED, + true => PREGION0WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PREGION0WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PREGION0WA_A::ENABLED + } +} +impl core::ops::Deref for PREGION0WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PREGION0WA` writer - Enable or disable non-maskable interrupt for PREGION\\[0\\].WA event"] +pub struct PREGION0WA_W<'a> { + w: &'a mut W, +} +impl<'a> PREGION0WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PREGION0WA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(PREGION0WA_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(PREGION0WA_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Enable or disable non-maskable interrupt for PREGION\\[0\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION0RA_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION0RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION0RA` reader - Enable or disable non-maskable interrupt for PREGION\\[0\\].RA event"] +pub struct PREGION0RA_R(crate::FieldReader); +impl PREGION0RA_R { + pub(crate) fn new(bits: bool) -> Self { + PREGION0RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PREGION0RA_A { + match self.bits { + false => PREGION0RA_A::DISABLED, + true => PREGION0RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PREGION0RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PREGION0RA_A::ENABLED + } +} +impl core::ops::Deref for PREGION0RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PREGION0RA` writer - Enable or disable non-maskable interrupt for PREGION\\[0\\].RA event"] +pub struct PREGION0RA_W<'a> { + w: &'a mut W, +} +impl<'a> PREGION0RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PREGION0RA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(PREGION0RA_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(PREGION0RA_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Enable or disable non-maskable interrupt for PREGION\\[1\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION1WA_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION1WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION1WA` reader - Enable or disable non-maskable interrupt for PREGION\\[1\\].WA event"] +pub struct PREGION1WA_R(crate::FieldReader); +impl PREGION1WA_R { + pub(crate) fn new(bits: bool) -> Self { + PREGION1WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PREGION1WA_A { + match self.bits { + false => PREGION1WA_A::DISABLED, + true => PREGION1WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PREGION1WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PREGION1WA_A::ENABLED + } +} +impl core::ops::Deref for PREGION1WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PREGION1WA` writer - Enable or disable non-maskable interrupt for PREGION\\[1\\].WA event"] +pub struct PREGION1WA_W<'a> { + w: &'a mut W, +} +impl<'a> PREGION1WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PREGION1WA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(PREGION1WA_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(PREGION1WA_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Enable or disable non-maskable interrupt for PREGION\\[1\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION1RA_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION1RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION1RA` reader - Enable or disable non-maskable interrupt for PREGION\\[1\\].RA event"] +pub struct PREGION1RA_R(crate::FieldReader); +impl PREGION1RA_R { + pub(crate) fn new(bits: bool) -> Self { + PREGION1RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PREGION1RA_A { + match self.bits { + false => PREGION1RA_A::DISABLED, + true => PREGION1RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PREGION1RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PREGION1RA_A::ENABLED + } +} +impl core::ops::Deref for PREGION1RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PREGION1RA` writer - Enable or disable non-maskable interrupt for PREGION\\[1\\].RA event"] +pub struct PREGION1RA_W<'a> { + w: &'a mut W, +} +impl<'a> PREGION1RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PREGION1RA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(PREGION1RA_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(PREGION1RA_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable or disable non-maskable interrupt for REGION\\[0\\].WA event"] + #[inline(always)] + pub fn region0wa(&self) -> REGION0WA_R { + REGION0WA_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Enable or disable non-maskable interrupt for REGION\\[0\\].RA event"] + #[inline(always)] + pub fn region0ra(&self) -> REGION0RA_R { + REGION0RA_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Enable or disable non-maskable interrupt for REGION\\[1\\].WA event"] + #[inline(always)] + pub fn region1wa(&self) -> REGION1WA_R { + REGION1WA_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Enable or disable non-maskable interrupt for REGION\\[1\\].RA event"] + #[inline(always)] + pub fn region1ra(&self) -> REGION1RA_R { + REGION1RA_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Enable or disable non-maskable interrupt for REGION\\[2\\].WA event"] + #[inline(always)] + pub fn region2wa(&self) -> REGION2WA_R { + REGION2WA_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Enable or disable non-maskable interrupt for REGION\\[2\\].RA event"] + #[inline(always)] + pub fn region2ra(&self) -> REGION2RA_R { + REGION2RA_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Enable or disable non-maskable interrupt for REGION\\[3\\].WA event"] + #[inline(always)] + pub fn region3wa(&self) -> REGION3WA_R { + REGION3WA_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Enable or disable non-maskable interrupt for REGION\\[3\\].RA event"] + #[inline(always)] + pub fn region3ra(&self) -> REGION3RA_R { + REGION3RA_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 24 - Enable or disable non-maskable interrupt for PREGION\\[0\\].WA event"] + #[inline(always)] + pub fn pregion0wa(&self) -> PREGION0WA_R { + PREGION0WA_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Enable or disable non-maskable interrupt for PREGION\\[0\\].RA event"] + #[inline(always)] + pub fn pregion0ra(&self) -> PREGION0RA_R { + PREGION0RA_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Enable or disable non-maskable interrupt for PREGION\\[1\\].WA event"] + #[inline(always)] + pub fn pregion1wa(&self) -> PREGION1WA_R { + PREGION1WA_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Enable or disable non-maskable interrupt for PREGION\\[1\\].RA event"] + #[inline(always)] + pub fn pregion1ra(&self) -> PREGION1RA_R { + PREGION1RA_R::new(((self.bits >> 27) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Enable or disable non-maskable interrupt for REGION\\[0\\].WA event"] + #[inline(always)] + pub fn region0wa(&mut self) -> REGION0WA_W { + REGION0WA_W { w: self } + } + #[doc = "Bit 1 - Enable or disable non-maskable interrupt for REGION\\[0\\].RA event"] + #[inline(always)] + pub fn region0ra(&mut self) -> REGION0RA_W { + REGION0RA_W { w: self } + } + #[doc = "Bit 2 - Enable or disable non-maskable interrupt for REGION\\[1\\].WA event"] + #[inline(always)] + pub fn region1wa(&mut self) -> REGION1WA_W { + REGION1WA_W { w: self } + } + #[doc = "Bit 3 - Enable or disable non-maskable interrupt for REGION\\[1\\].RA event"] + #[inline(always)] + pub fn region1ra(&mut self) -> REGION1RA_W { + REGION1RA_W { w: self } + } + #[doc = "Bit 4 - Enable or disable non-maskable interrupt for REGION\\[2\\].WA event"] + #[inline(always)] + pub fn region2wa(&mut self) -> REGION2WA_W { + REGION2WA_W { w: self } + } + #[doc = "Bit 5 - Enable or disable non-maskable interrupt for REGION\\[2\\].RA event"] + #[inline(always)] + pub fn region2ra(&mut self) -> REGION2RA_W { + REGION2RA_W { w: self } + } + #[doc = "Bit 6 - Enable or disable non-maskable interrupt for REGION\\[3\\].WA event"] + #[inline(always)] + pub fn region3wa(&mut self) -> REGION3WA_W { + REGION3WA_W { w: self } + } + #[doc = "Bit 7 - Enable or disable non-maskable interrupt for REGION\\[3\\].RA event"] + #[inline(always)] + pub fn region3ra(&mut self) -> REGION3RA_W { + REGION3RA_W { w: self } + } + #[doc = "Bit 24 - Enable or disable non-maskable interrupt for PREGION\\[0\\].WA event"] + #[inline(always)] + pub fn pregion0wa(&mut self) -> PREGION0WA_W { + PREGION0WA_W { w: self } + } + #[doc = "Bit 25 - Enable or disable non-maskable interrupt for PREGION\\[0\\].RA event"] + #[inline(always)] + pub fn pregion0ra(&mut self) -> PREGION0RA_W { + PREGION0RA_W { w: self } + } + #[doc = "Bit 26 - Enable or disable non-maskable interrupt for PREGION\\[1\\].WA event"] + #[inline(always)] + pub fn pregion1wa(&mut self) -> PREGION1WA_W { + PREGION1WA_W { w: self } + } + #[doc = "Bit 27 - Enable or disable non-maskable interrupt for PREGION\\[1\\].RA event"] + #[inline(always)] + pub fn pregion1ra(&mut self) -> PREGION1RA_W { + PREGION1RA_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable or disable non-maskable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nmien](index.html) module"] +pub struct NMIEN_SPEC; +impl crate::RegisterSpec for NMIEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nmien::R](R) reader structure"] +impl crate::Readable for NMIEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nmien::W](W) writer structure"] +impl crate::Writable for NMIEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NMIEN to value 0"] +impl crate::Resettable for NMIEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mwu/nmienclr.rs b/src/mwu/nmienclr.rs new file mode 100644 index 0000000..ad8a83d --- /dev/null +++ b/src/mwu/nmienclr.rs @@ -0,0 +1,1266 @@ +#[doc = "Register `NMIENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NMIENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable non-maskable interrupt for REGION\\[0\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION0WA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION0WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION0WA` reader - Write '1' to Disable non-maskable interrupt for REGION\\[0\\].WA event"] +pub struct REGION0WA_R(crate::FieldReader); +impl REGION0WA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION0WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION0WA_A { + match self.bits { + false => REGION0WA_A::DISABLED, + true => REGION0WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION0WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION0WA_A::ENABLED + } +} +impl core::ops::Deref for REGION0WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable non-maskable interrupt for REGION\\[0\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION0WA_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION0WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION0WA` writer - Write '1' to Disable non-maskable interrupt for REGION\\[0\\].WA event"] +pub struct REGION0WA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION0WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION0WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(REGION0WA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Disable non-maskable interrupt for REGION\\[0\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION0RA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION0RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION0RA` reader - Write '1' to Disable non-maskable interrupt for REGION\\[0\\].RA event"] +pub struct REGION0RA_R(crate::FieldReader); +impl REGION0RA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION0RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION0RA_A { + match self.bits { + false => REGION0RA_A::DISABLED, + true => REGION0RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION0RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION0RA_A::ENABLED + } +} +impl core::ops::Deref for REGION0RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable non-maskable interrupt for REGION\\[0\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION0RA_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION0RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION0RA` writer - Write '1' to Disable non-maskable interrupt for REGION\\[0\\].RA event"] +pub struct REGION0RA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION0RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION0RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(REGION0RA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Disable non-maskable interrupt for REGION\\[1\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION1WA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION1WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION1WA` reader - Write '1' to Disable non-maskable interrupt for REGION\\[1\\].WA event"] +pub struct REGION1WA_R(crate::FieldReader); +impl REGION1WA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION1WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION1WA_A { + match self.bits { + false => REGION1WA_A::DISABLED, + true => REGION1WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION1WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION1WA_A::ENABLED + } +} +impl core::ops::Deref for REGION1WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable non-maskable interrupt for REGION\\[1\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION1WA_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION1WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION1WA` writer - Write '1' to Disable non-maskable interrupt for REGION\\[1\\].WA event"] +pub struct REGION1WA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION1WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION1WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(REGION1WA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Disable non-maskable interrupt for REGION\\[1\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION1RA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION1RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION1RA` reader - Write '1' to Disable non-maskable interrupt for REGION\\[1\\].RA event"] +pub struct REGION1RA_R(crate::FieldReader); +impl REGION1RA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION1RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION1RA_A { + match self.bits { + false => REGION1RA_A::DISABLED, + true => REGION1RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION1RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION1RA_A::ENABLED + } +} +impl core::ops::Deref for REGION1RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable non-maskable interrupt for REGION\\[1\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION1RA_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION1RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION1RA` writer - Write '1' to Disable non-maskable interrupt for REGION\\[1\\].RA event"] +pub struct REGION1RA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION1RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION1RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(REGION1RA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Write '1' to Disable non-maskable interrupt for REGION\\[2\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION2WA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION2WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION2WA` reader - Write '1' to Disable non-maskable interrupt for REGION\\[2\\].WA event"] +pub struct REGION2WA_R(crate::FieldReader); +impl REGION2WA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION2WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION2WA_A { + match self.bits { + false => REGION2WA_A::DISABLED, + true => REGION2WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION2WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION2WA_A::ENABLED + } +} +impl core::ops::Deref for REGION2WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable non-maskable interrupt for REGION\\[2\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION2WA_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION2WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION2WA` writer - Write '1' to Disable non-maskable interrupt for REGION\\[2\\].WA event"] +pub struct REGION2WA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION2WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION2WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(REGION2WA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Write '1' to Disable non-maskable interrupt for REGION\\[2\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION2RA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION2RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION2RA` reader - Write '1' to Disable non-maskable interrupt for REGION\\[2\\].RA event"] +pub struct REGION2RA_R(crate::FieldReader); +impl REGION2RA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION2RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION2RA_A { + match self.bits { + false => REGION2RA_A::DISABLED, + true => REGION2RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION2RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION2RA_A::ENABLED + } +} +impl core::ops::Deref for REGION2RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable non-maskable interrupt for REGION\\[2\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION2RA_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION2RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION2RA` writer - Write '1' to Disable non-maskable interrupt for REGION\\[2\\].RA event"] +pub struct REGION2RA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION2RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION2RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(REGION2RA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Write '1' to Disable non-maskable interrupt for REGION\\[3\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION3WA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION3WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION3WA` reader - Write '1' to Disable non-maskable interrupt for REGION\\[3\\].WA event"] +pub struct REGION3WA_R(crate::FieldReader); +impl REGION3WA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION3WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION3WA_A { + match self.bits { + false => REGION3WA_A::DISABLED, + true => REGION3WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION3WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION3WA_A::ENABLED + } +} +impl core::ops::Deref for REGION3WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable non-maskable interrupt for REGION\\[3\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION3WA_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION3WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION3WA` writer - Write '1' to Disable non-maskable interrupt for REGION\\[3\\].WA event"] +pub struct REGION3WA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION3WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION3WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(REGION3WA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Write '1' to Disable non-maskable interrupt for REGION\\[3\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION3RA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION3RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION3RA` reader - Write '1' to Disable non-maskable interrupt for REGION\\[3\\].RA event"] +pub struct REGION3RA_R(crate::FieldReader); +impl REGION3RA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION3RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION3RA_A { + match self.bits { + false => REGION3RA_A::DISABLED, + true => REGION3RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION3RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION3RA_A::ENABLED + } +} +impl core::ops::Deref for REGION3RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable non-maskable interrupt for REGION\\[3\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION3RA_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION3RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION3RA` writer - Write '1' to Disable non-maskable interrupt for REGION\\[3\\].RA event"] +pub struct REGION3RA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION3RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION3RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(REGION3RA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Write '1' to Disable non-maskable interrupt for PREGION\\[0\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION0WA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION0WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION0WA` reader - Write '1' to Disable non-maskable interrupt for PREGION\\[0\\].WA event"] +pub struct PREGION0WA_R(crate::FieldReader); +impl PREGION0WA_R { + pub(crate) fn new(bits: bool) -> Self { + PREGION0WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PREGION0WA_A { + match self.bits { + false => PREGION0WA_A::DISABLED, + true => PREGION0WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PREGION0WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PREGION0WA_A::ENABLED + } +} +impl core::ops::Deref for PREGION0WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable non-maskable interrupt for PREGION\\[0\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION0WA_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION0WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION0WA` writer - Write '1' to Disable non-maskable interrupt for PREGION\\[0\\].WA event"] +pub struct PREGION0WA_W<'a> { + w: &'a mut W, +} +impl<'a> PREGION0WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PREGION0WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PREGION0WA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Write '1' to Disable non-maskable interrupt for PREGION\\[0\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION0RA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION0RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION0RA` reader - Write '1' to Disable non-maskable interrupt for PREGION\\[0\\].RA event"] +pub struct PREGION0RA_R(crate::FieldReader); +impl PREGION0RA_R { + pub(crate) fn new(bits: bool) -> Self { + PREGION0RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PREGION0RA_A { + match self.bits { + false => PREGION0RA_A::DISABLED, + true => PREGION0RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PREGION0RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PREGION0RA_A::ENABLED + } +} +impl core::ops::Deref for PREGION0RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable non-maskable interrupt for PREGION\\[0\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION0RA_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION0RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION0RA` writer - Write '1' to Disable non-maskable interrupt for PREGION\\[0\\].RA event"] +pub struct PREGION0RA_W<'a> { + w: &'a mut W, +} +impl<'a> PREGION0RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PREGION0RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PREGION0RA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Write '1' to Disable non-maskable interrupt for PREGION\\[1\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION1WA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION1WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION1WA` reader - Write '1' to Disable non-maskable interrupt for PREGION\\[1\\].WA event"] +pub struct PREGION1WA_R(crate::FieldReader); +impl PREGION1WA_R { + pub(crate) fn new(bits: bool) -> Self { + PREGION1WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PREGION1WA_A { + match self.bits { + false => PREGION1WA_A::DISABLED, + true => PREGION1WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PREGION1WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PREGION1WA_A::ENABLED + } +} +impl core::ops::Deref for PREGION1WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable non-maskable interrupt for PREGION\\[1\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION1WA_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION1WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION1WA` writer - Write '1' to Disable non-maskable interrupt for PREGION\\[1\\].WA event"] +pub struct PREGION1WA_W<'a> { + w: &'a mut W, +} +impl<'a> PREGION1WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PREGION1WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PREGION1WA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Write '1' to Disable non-maskable interrupt for PREGION\\[1\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION1RA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION1RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION1RA` reader - Write '1' to Disable non-maskable interrupt for PREGION\\[1\\].RA event"] +pub struct PREGION1RA_R(crate::FieldReader); +impl PREGION1RA_R { + pub(crate) fn new(bits: bool) -> Self { + PREGION1RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PREGION1RA_A { + match self.bits { + false => PREGION1RA_A::DISABLED, + true => PREGION1RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PREGION1RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PREGION1RA_A::ENABLED + } +} +impl core::ops::Deref for PREGION1RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable non-maskable interrupt for PREGION\\[1\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION1RA_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION1RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION1RA` writer - Write '1' to Disable non-maskable interrupt for PREGION\\[1\\].RA event"] +pub struct PREGION1RA_W<'a> { + w: &'a mut W, +} +impl<'a> PREGION1RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PREGION1RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PREGION1RA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Disable non-maskable interrupt for REGION\\[0\\].WA event"] + #[inline(always)] + pub fn region0wa(&self) -> REGION0WA_R { + REGION0WA_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Disable non-maskable interrupt for REGION\\[0\\].RA event"] + #[inline(always)] + pub fn region0ra(&self) -> REGION0RA_R { + REGION0RA_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Disable non-maskable interrupt for REGION\\[1\\].WA event"] + #[inline(always)] + pub fn region1wa(&self) -> REGION1WA_R { + REGION1WA_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Write '1' to Disable non-maskable interrupt for REGION\\[1\\].RA event"] + #[inline(always)] + pub fn region1ra(&self) -> REGION1RA_R { + REGION1RA_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Write '1' to Disable non-maskable interrupt for REGION\\[2\\].WA event"] + #[inline(always)] + pub fn region2wa(&self) -> REGION2WA_R { + REGION2WA_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Write '1' to Disable non-maskable interrupt for REGION\\[2\\].RA event"] + #[inline(always)] + pub fn region2ra(&self) -> REGION2RA_R { + REGION2RA_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Write '1' to Disable non-maskable interrupt for REGION\\[3\\].WA event"] + #[inline(always)] + pub fn region3wa(&self) -> REGION3WA_R { + REGION3WA_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Write '1' to Disable non-maskable interrupt for REGION\\[3\\].RA event"] + #[inline(always)] + pub fn region3ra(&self) -> REGION3RA_R { + REGION3RA_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 24 - Write '1' to Disable non-maskable interrupt for PREGION\\[0\\].WA event"] + #[inline(always)] + pub fn pregion0wa(&self) -> PREGION0WA_R { + PREGION0WA_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Write '1' to Disable non-maskable interrupt for PREGION\\[0\\].RA event"] + #[inline(always)] + pub fn pregion0ra(&self) -> PREGION0RA_R { + PREGION0RA_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Write '1' to Disable non-maskable interrupt for PREGION\\[1\\].WA event"] + #[inline(always)] + pub fn pregion1wa(&self) -> PREGION1WA_R { + PREGION1WA_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Write '1' to Disable non-maskable interrupt for PREGION\\[1\\].RA event"] + #[inline(always)] + pub fn pregion1ra(&self) -> PREGION1RA_R { + PREGION1RA_R::new(((self.bits >> 27) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Disable non-maskable interrupt for REGION\\[0\\].WA event"] + #[inline(always)] + pub fn region0wa(&mut self) -> REGION0WA_W { + REGION0WA_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Disable non-maskable interrupt for REGION\\[0\\].RA event"] + #[inline(always)] + pub fn region0ra(&mut self) -> REGION0RA_W { + REGION0RA_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Disable non-maskable interrupt for REGION\\[1\\].WA event"] + #[inline(always)] + pub fn region1wa(&mut self) -> REGION1WA_W { + REGION1WA_W { w: self } + } + #[doc = "Bit 3 - Write '1' to Disable non-maskable interrupt for REGION\\[1\\].RA event"] + #[inline(always)] + pub fn region1ra(&mut self) -> REGION1RA_W { + REGION1RA_W { w: self } + } + #[doc = "Bit 4 - Write '1' to Disable non-maskable interrupt for REGION\\[2\\].WA event"] + #[inline(always)] + pub fn region2wa(&mut self) -> REGION2WA_W { + REGION2WA_W { w: self } + } + #[doc = "Bit 5 - Write '1' to Disable non-maskable interrupt for REGION\\[2\\].RA event"] + #[inline(always)] + pub fn region2ra(&mut self) -> REGION2RA_W { + REGION2RA_W { w: self } + } + #[doc = "Bit 6 - Write '1' to Disable non-maskable interrupt for REGION\\[3\\].WA event"] + #[inline(always)] + pub fn region3wa(&mut self) -> REGION3WA_W { + REGION3WA_W { w: self } + } + #[doc = "Bit 7 - Write '1' to Disable non-maskable interrupt for REGION\\[3\\].RA event"] + #[inline(always)] + pub fn region3ra(&mut self) -> REGION3RA_W { + REGION3RA_W { w: self } + } + #[doc = "Bit 24 - Write '1' to Disable non-maskable interrupt for PREGION\\[0\\].WA event"] + #[inline(always)] + pub fn pregion0wa(&mut self) -> PREGION0WA_W { + PREGION0WA_W { w: self } + } + #[doc = "Bit 25 - Write '1' to Disable non-maskable interrupt for PREGION\\[0\\].RA event"] + #[inline(always)] + pub fn pregion0ra(&mut self) -> PREGION0RA_W { + PREGION0RA_W { w: self } + } + #[doc = "Bit 26 - Write '1' to Disable non-maskable interrupt for PREGION\\[1\\].WA event"] + #[inline(always)] + pub fn pregion1wa(&mut self) -> PREGION1WA_W { + PREGION1WA_W { w: self } + } + #[doc = "Bit 27 - Write '1' to Disable non-maskable interrupt for PREGION\\[1\\].RA event"] + #[inline(always)] + pub fn pregion1ra(&mut self) -> PREGION1RA_W { + PREGION1RA_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable non-maskable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nmienclr](index.html) module"] +pub struct NMIENCLR_SPEC; +impl crate::RegisterSpec for NMIENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nmienclr::R](R) reader structure"] +impl crate::Readable for NMIENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nmienclr::W](W) writer structure"] +impl crate::Writable for NMIENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NMIENCLR to value 0"] +impl crate::Resettable for NMIENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mwu/nmienset.rs b/src/mwu/nmienset.rs new file mode 100644 index 0000000..fbfeb4a --- /dev/null +++ b/src/mwu/nmienset.rs @@ -0,0 +1,1266 @@ +#[doc = "Register `NMIENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NMIENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable non-maskable interrupt for REGION\\[0\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION0WA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION0WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION0WA` reader - Write '1' to Enable non-maskable interrupt for REGION\\[0\\].WA event"] +pub struct REGION0WA_R(crate::FieldReader); +impl REGION0WA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION0WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION0WA_A { + match self.bits { + false => REGION0WA_A::DISABLED, + true => REGION0WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION0WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION0WA_A::ENABLED + } +} +impl core::ops::Deref for REGION0WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable non-maskable interrupt for REGION\\[0\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION0WA_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION0WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION0WA` writer - Write '1' to Enable non-maskable interrupt for REGION\\[0\\].WA event"] +pub struct REGION0WA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION0WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION0WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(REGION0WA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Enable non-maskable interrupt for REGION\\[0\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION0RA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION0RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION0RA` reader - Write '1' to Enable non-maskable interrupt for REGION\\[0\\].RA event"] +pub struct REGION0RA_R(crate::FieldReader); +impl REGION0RA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION0RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION0RA_A { + match self.bits { + false => REGION0RA_A::DISABLED, + true => REGION0RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION0RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION0RA_A::ENABLED + } +} +impl core::ops::Deref for REGION0RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable non-maskable interrupt for REGION\\[0\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION0RA_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION0RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION0RA` writer - Write '1' to Enable non-maskable interrupt for REGION\\[0\\].RA event"] +pub struct REGION0RA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION0RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION0RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(REGION0RA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Enable non-maskable interrupt for REGION\\[1\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION1WA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION1WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION1WA` reader - Write '1' to Enable non-maskable interrupt for REGION\\[1\\].WA event"] +pub struct REGION1WA_R(crate::FieldReader); +impl REGION1WA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION1WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION1WA_A { + match self.bits { + false => REGION1WA_A::DISABLED, + true => REGION1WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION1WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION1WA_A::ENABLED + } +} +impl core::ops::Deref for REGION1WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable non-maskable interrupt for REGION\\[1\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION1WA_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION1WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION1WA` writer - Write '1' to Enable non-maskable interrupt for REGION\\[1\\].WA event"] +pub struct REGION1WA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION1WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION1WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(REGION1WA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Enable non-maskable interrupt for REGION\\[1\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION1RA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION1RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION1RA` reader - Write '1' to Enable non-maskable interrupt for REGION\\[1\\].RA event"] +pub struct REGION1RA_R(crate::FieldReader); +impl REGION1RA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION1RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION1RA_A { + match self.bits { + false => REGION1RA_A::DISABLED, + true => REGION1RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION1RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION1RA_A::ENABLED + } +} +impl core::ops::Deref for REGION1RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable non-maskable interrupt for REGION\\[1\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION1RA_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION1RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION1RA` writer - Write '1' to Enable non-maskable interrupt for REGION\\[1\\].RA event"] +pub struct REGION1RA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION1RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION1RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(REGION1RA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Write '1' to Enable non-maskable interrupt for REGION\\[2\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION2WA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION2WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION2WA` reader - Write '1' to Enable non-maskable interrupt for REGION\\[2\\].WA event"] +pub struct REGION2WA_R(crate::FieldReader); +impl REGION2WA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION2WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION2WA_A { + match self.bits { + false => REGION2WA_A::DISABLED, + true => REGION2WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION2WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION2WA_A::ENABLED + } +} +impl core::ops::Deref for REGION2WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable non-maskable interrupt for REGION\\[2\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION2WA_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION2WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION2WA` writer - Write '1' to Enable non-maskable interrupt for REGION\\[2\\].WA event"] +pub struct REGION2WA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION2WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION2WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(REGION2WA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Write '1' to Enable non-maskable interrupt for REGION\\[2\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION2RA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION2RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION2RA` reader - Write '1' to Enable non-maskable interrupt for REGION\\[2\\].RA event"] +pub struct REGION2RA_R(crate::FieldReader); +impl REGION2RA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION2RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION2RA_A { + match self.bits { + false => REGION2RA_A::DISABLED, + true => REGION2RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION2RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION2RA_A::ENABLED + } +} +impl core::ops::Deref for REGION2RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable non-maskable interrupt for REGION\\[2\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION2RA_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION2RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION2RA` writer - Write '1' to Enable non-maskable interrupt for REGION\\[2\\].RA event"] +pub struct REGION2RA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION2RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION2RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(REGION2RA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Write '1' to Enable non-maskable interrupt for REGION\\[3\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION3WA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION3WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION3WA` reader - Write '1' to Enable non-maskable interrupt for REGION\\[3\\].WA event"] +pub struct REGION3WA_R(crate::FieldReader); +impl REGION3WA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION3WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION3WA_A { + match self.bits { + false => REGION3WA_A::DISABLED, + true => REGION3WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION3WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION3WA_A::ENABLED + } +} +impl core::ops::Deref for REGION3WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable non-maskable interrupt for REGION\\[3\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION3WA_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION3WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION3WA` writer - Write '1' to Enable non-maskable interrupt for REGION\\[3\\].WA event"] +pub struct REGION3WA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION3WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION3WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(REGION3WA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Write '1' to Enable non-maskable interrupt for REGION\\[3\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION3RA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION3RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION3RA` reader - Write '1' to Enable non-maskable interrupt for REGION\\[3\\].RA event"] +pub struct REGION3RA_R(crate::FieldReader); +impl REGION3RA_R { + pub(crate) fn new(bits: bool) -> Self { + REGION3RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REGION3RA_A { + match self.bits { + false => REGION3RA_A::DISABLED, + true => REGION3RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REGION3RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REGION3RA_A::ENABLED + } +} +impl core::ops::Deref for REGION3RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable non-maskable interrupt for REGION\\[3\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REGION3RA_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REGION3RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REGION3RA` writer - Write '1' to Enable non-maskable interrupt for REGION\\[3\\].RA event"] +pub struct REGION3RA_W<'a> { + w: &'a mut W, +} +impl<'a> REGION3RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REGION3RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(REGION3RA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Write '1' to Enable non-maskable interrupt for PREGION\\[0\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION0WA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION0WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION0WA` reader - Write '1' to Enable non-maskable interrupt for PREGION\\[0\\].WA event"] +pub struct PREGION0WA_R(crate::FieldReader); +impl PREGION0WA_R { + pub(crate) fn new(bits: bool) -> Self { + PREGION0WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PREGION0WA_A { + match self.bits { + false => PREGION0WA_A::DISABLED, + true => PREGION0WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PREGION0WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PREGION0WA_A::ENABLED + } +} +impl core::ops::Deref for PREGION0WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable non-maskable interrupt for PREGION\\[0\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION0WA_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION0WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION0WA` writer - Write '1' to Enable non-maskable interrupt for PREGION\\[0\\].WA event"] +pub struct PREGION0WA_W<'a> { + w: &'a mut W, +} +impl<'a> PREGION0WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PREGION0WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PREGION0WA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Write '1' to Enable non-maskable interrupt for PREGION\\[0\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION0RA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION0RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION0RA` reader - Write '1' to Enable non-maskable interrupt for PREGION\\[0\\].RA event"] +pub struct PREGION0RA_R(crate::FieldReader); +impl PREGION0RA_R { + pub(crate) fn new(bits: bool) -> Self { + PREGION0RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PREGION0RA_A { + match self.bits { + false => PREGION0RA_A::DISABLED, + true => PREGION0RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PREGION0RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PREGION0RA_A::ENABLED + } +} +impl core::ops::Deref for PREGION0RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable non-maskable interrupt for PREGION\\[0\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION0RA_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION0RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION0RA` writer - Write '1' to Enable non-maskable interrupt for PREGION\\[0\\].RA event"] +pub struct PREGION0RA_W<'a> { + w: &'a mut W, +} +impl<'a> PREGION0RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PREGION0RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PREGION0RA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Write '1' to Enable non-maskable interrupt for PREGION\\[1\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION1WA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION1WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION1WA` reader - Write '1' to Enable non-maskable interrupt for PREGION\\[1\\].WA event"] +pub struct PREGION1WA_R(crate::FieldReader); +impl PREGION1WA_R { + pub(crate) fn new(bits: bool) -> Self { + PREGION1WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PREGION1WA_A { + match self.bits { + false => PREGION1WA_A::DISABLED, + true => PREGION1WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PREGION1WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PREGION1WA_A::ENABLED + } +} +impl core::ops::Deref for PREGION1WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable non-maskable interrupt for PREGION\\[1\\].WA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION1WA_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION1WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION1WA` writer - Write '1' to Enable non-maskable interrupt for PREGION\\[1\\].WA event"] +pub struct PREGION1WA_W<'a> { + w: &'a mut W, +} +impl<'a> PREGION1WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PREGION1WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PREGION1WA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Write '1' to Enable non-maskable interrupt for PREGION\\[1\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION1RA_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION1RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION1RA` reader - Write '1' to Enable non-maskable interrupt for PREGION\\[1\\].RA event"] +pub struct PREGION1RA_R(crate::FieldReader); +impl PREGION1RA_R { + pub(crate) fn new(bits: bool) -> Self { + PREGION1RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PREGION1RA_A { + match self.bits { + false => PREGION1RA_A::DISABLED, + true => PREGION1RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PREGION1RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PREGION1RA_A::ENABLED + } +} +impl core::ops::Deref for PREGION1RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable non-maskable interrupt for PREGION\\[1\\].RA event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PREGION1RA_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PREGION1RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PREGION1RA` writer - Write '1' to Enable non-maskable interrupt for PREGION\\[1\\].RA event"] +pub struct PREGION1RA_W<'a> { + w: &'a mut W, +} +impl<'a> PREGION1RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PREGION1RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PREGION1RA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Enable non-maskable interrupt for REGION\\[0\\].WA event"] + #[inline(always)] + pub fn region0wa(&self) -> REGION0WA_R { + REGION0WA_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Enable non-maskable interrupt for REGION\\[0\\].RA event"] + #[inline(always)] + pub fn region0ra(&self) -> REGION0RA_R { + REGION0RA_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Enable non-maskable interrupt for REGION\\[1\\].WA event"] + #[inline(always)] + pub fn region1wa(&self) -> REGION1WA_R { + REGION1WA_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Write '1' to Enable non-maskable interrupt for REGION\\[1\\].RA event"] + #[inline(always)] + pub fn region1ra(&self) -> REGION1RA_R { + REGION1RA_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Write '1' to Enable non-maskable interrupt for REGION\\[2\\].WA event"] + #[inline(always)] + pub fn region2wa(&self) -> REGION2WA_R { + REGION2WA_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Write '1' to Enable non-maskable interrupt for REGION\\[2\\].RA event"] + #[inline(always)] + pub fn region2ra(&self) -> REGION2RA_R { + REGION2RA_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Write '1' to Enable non-maskable interrupt for REGION\\[3\\].WA event"] + #[inline(always)] + pub fn region3wa(&self) -> REGION3WA_R { + REGION3WA_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Write '1' to Enable non-maskable interrupt for REGION\\[3\\].RA event"] + #[inline(always)] + pub fn region3ra(&self) -> REGION3RA_R { + REGION3RA_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 24 - Write '1' to Enable non-maskable interrupt for PREGION\\[0\\].WA event"] + #[inline(always)] + pub fn pregion0wa(&self) -> PREGION0WA_R { + PREGION0WA_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Write '1' to Enable non-maskable interrupt for PREGION\\[0\\].RA event"] + #[inline(always)] + pub fn pregion0ra(&self) -> PREGION0RA_R { + PREGION0RA_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Write '1' to Enable non-maskable interrupt for PREGION\\[1\\].WA event"] + #[inline(always)] + pub fn pregion1wa(&self) -> PREGION1WA_R { + PREGION1WA_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Write '1' to Enable non-maskable interrupt for PREGION\\[1\\].RA event"] + #[inline(always)] + pub fn pregion1ra(&self) -> PREGION1RA_R { + PREGION1RA_R::new(((self.bits >> 27) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Enable non-maskable interrupt for REGION\\[0\\].WA event"] + #[inline(always)] + pub fn region0wa(&mut self) -> REGION0WA_W { + REGION0WA_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Enable non-maskable interrupt for REGION\\[0\\].RA event"] + #[inline(always)] + pub fn region0ra(&mut self) -> REGION0RA_W { + REGION0RA_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Enable non-maskable interrupt for REGION\\[1\\].WA event"] + #[inline(always)] + pub fn region1wa(&mut self) -> REGION1WA_W { + REGION1WA_W { w: self } + } + #[doc = "Bit 3 - Write '1' to Enable non-maskable interrupt for REGION\\[1\\].RA event"] + #[inline(always)] + pub fn region1ra(&mut self) -> REGION1RA_W { + REGION1RA_W { w: self } + } + #[doc = "Bit 4 - Write '1' to Enable non-maskable interrupt for REGION\\[2\\].WA event"] + #[inline(always)] + pub fn region2wa(&mut self) -> REGION2WA_W { + REGION2WA_W { w: self } + } + #[doc = "Bit 5 - Write '1' to Enable non-maskable interrupt for REGION\\[2\\].RA event"] + #[inline(always)] + pub fn region2ra(&mut self) -> REGION2RA_W { + REGION2RA_W { w: self } + } + #[doc = "Bit 6 - Write '1' to Enable non-maskable interrupt for REGION\\[3\\].WA event"] + #[inline(always)] + pub fn region3wa(&mut self) -> REGION3WA_W { + REGION3WA_W { w: self } + } + #[doc = "Bit 7 - Write '1' to Enable non-maskable interrupt for REGION\\[3\\].RA event"] + #[inline(always)] + pub fn region3ra(&mut self) -> REGION3RA_W { + REGION3RA_W { w: self } + } + #[doc = "Bit 24 - Write '1' to Enable non-maskable interrupt for PREGION\\[0\\].WA event"] + #[inline(always)] + pub fn pregion0wa(&mut self) -> PREGION0WA_W { + PREGION0WA_W { w: self } + } + #[doc = "Bit 25 - Write '1' to Enable non-maskable interrupt for PREGION\\[0\\].RA event"] + #[inline(always)] + pub fn pregion0ra(&mut self) -> PREGION0RA_W { + PREGION0RA_W { w: self } + } + #[doc = "Bit 26 - Write '1' to Enable non-maskable interrupt for PREGION\\[1\\].WA event"] + #[inline(always)] + pub fn pregion1wa(&mut self) -> PREGION1WA_W { + PREGION1WA_W { w: self } + } + #[doc = "Bit 27 - Write '1' to Enable non-maskable interrupt for PREGION\\[1\\].RA event"] + #[inline(always)] + pub fn pregion1ra(&mut self) -> PREGION1RA_W { + PREGION1RA_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable non-maskable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nmienset](index.html) module"] +pub struct NMIENSET_SPEC; +impl crate::RegisterSpec for NMIENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nmienset::R](R) reader structure"] +impl crate::Readable for NMIENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nmienset::W](W) writer structure"] +impl crate::Writable for NMIENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NMIENSET to value 0"] +impl crate::Resettable for NMIENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mwu/perregion.rs b/src/mwu/perregion.rs new file mode 100644 index 0000000..fc5b11c --- /dev/null +++ b/src/mwu/perregion.rs @@ -0,0 +1,8 @@ +#[doc = "SUBSTATWA register accessor: an alias for `Reg`"] +pub type SUBSTATWA = crate::Reg; +#[doc = "Description cluster\\[0\\]: Source of event/interrupt in region 0, write access detected while corresponding subregion was enabled for watching"] +pub mod substatwa; +#[doc = "SUBSTATRA register accessor: an alias for `Reg`"] +pub type SUBSTATRA = crate::Reg; +#[doc = "Description cluster\\[0\\]: Source of event/interrupt in region 0, read access detected while corresponding subregion was enabled for watching"] +pub mod substatra; diff --git a/src/mwu/perregion/substatra.rs b/src/mwu/perregion/substatra.rs new file mode 100644 index 0000000..73e69ab --- /dev/null +++ b/src/mwu/perregion/substatra.rs @@ -0,0 +1,3042 @@ +#[doc = "Register `SUBSTATRA` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SUBSTATRA` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Subregion 0 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR0_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR0` reader - Subregion 0 in region 0 (write '1' to clear)"] +pub struct SR0_R(crate::FieldReader); +impl SR0_R { + pub(crate) fn new(bits: bool) -> Self { + SR0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR0_A { + match self.bits { + false => SR0_A::NOACCESS, + true => SR0_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR0_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR0_A::ACCESS + } +} +impl core::ops::Deref for SR0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR0` writer - Subregion 0 in region 0 (write '1' to clear)"] +pub struct SR0_W<'a> { + w: &'a mut W, +} +impl<'a> SR0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR0_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR0_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR0_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Subregion 1 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR1_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR1` reader - Subregion 1 in region 0 (write '1' to clear)"] +pub struct SR1_R(crate::FieldReader); +impl SR1_R { + pub(crate) fn new(bits: bool) -> Self { + SR1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR1_A { + match self.bits { + false => SR1_A::NOACCESS, + true => SR1_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR1_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR1_A::ACCESS + } +} +impl core::ops::Deref for SR1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR1` writer - Subregion 1 in region 0 (write '1' to clear)"] +pub struct SR1_W<'a> { + w: &'a mut W, +} +impl<'a> SR1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR1_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR1_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR1_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Subregion 2 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR2_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR2` reader - Subregion 2 in region 0 (write '1' to clear)"] +pub struct SR2_R(crate::FieldReader); +impl SR2_R { + pub(crate) fn new(bits: bool) -> Self { + SR2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR2_A { + match self.bits { + false => SR2_A::NOACCESS, + true => SR2_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR2_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR2_A::ACCESS + } +} +impl core::ops::Deref for SR2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR2` writer - Subregion 2 in region 0 (write '1' to clear)"] +pub struct SR2_W<'a> { + w: &'a mut W, +} +impl<'a> SR2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR2_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR2_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR2_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Subregion 3 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR3_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR3` reader - Subregion 3 in region 0 (write '1' to clear)"] +pub struct SR3_R(crate::FieldReader); +impl SR3_R { + pub(crate) fn new(bits: bool) -> Self { + SR3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR3_A { + match self.bits { + false => SR3_A::NOACCESS, + true => SR3_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR3_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR3_A::ACCESS + } +} +impl core::ops::Deref for SR3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR3` writer - Subregion 3 in region 0 (write '1' to clear)"] +pub struct SR3_W<'a> { + w: &'a mut W, +} +impl<'a> SR3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR3_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR3_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR3_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Subregion 4 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR4_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR4_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR4` reader - Subregion 4 in region 0 (write '1' to clear)"] +pub struct SR4_R(crate::FieldReader); +impl SR4_R { + pub(crate) fn new(bits: bool) -> Self { + SR4_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR4_A { + match self.bits { + false => SR4_A::NOACCESS, + true => SR4_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR4_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR4_A::ACCESS + } +} +impl core::ops::Deref for SR4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR4` writer - Subregion 4 in region 0 (write '1' to clear)"] +pub struct SR4_W<'a> { + w: &'a mut W, +} +impl<'a> SR4_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR4_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR4_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR4_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Subregion 5 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR5_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR5_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR5` reader - Subregion 5 in region 0 (write '1' to clear)"] +pub struct SR5_R(crate::FieldReader); +impl SR5_R { + pub(crate) fn new(bits: bool) -> Self { + SR5_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR5_A { + match self.bits { + false => SR5_A::NOACCESS, + true => SR5_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR5_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR5_A::ACCESS + } +} +impl core::ops::Deref for SR5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR5` writer - Subregion 5 in region 0 (write '1' to clear)"] +pub struct SR5_W<'a> { + w: &'a mut W, +} +impl<'a> SR5_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR5_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR5_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR5_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Subregion 6 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR6_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR6_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR6` reader - Subregion 6 in region 0 (write '1' to clear)"] +pub struct SR6_R(crate::FieldReader); +impl SR6_R { + pub(crate) fn new(bits: bool) -> Self { + SR6_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR6_A { + match self.bits { + false => SR6_A::NOACCESS, + true => SR6_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR6_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR6_A::ACCESS + } +} +impl core::ops::Deref for SR6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR6` writer - Subregion 6 in region 0 (write '1' to clear)"] +pub struct SR6_W<'a> { + w: &'a mut W, +} +impl<'a> SR6_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR6_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR6_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR6_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Subregion 7 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR7_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR7_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR7` reader - Subregion 7 in region 0 (write '1' to clear)"] +pub struct SR7_R(crate::FieldReader); +impl SR7_R { + pub(crate) fn new(bits: bool) -> Self { + SR7_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR7_A { + match self.bits { + false => SR7_A::NOACCESS, + true => SR7_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR7_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR7_A::ACCESS + } +} +impl core::ops::Deref for SR7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR7` writer - Subregion 7 in region 0 (write '1' to clear)"] +pub struct SR7_W<'a> { + w: &'a mut W, +} +impl<'a> SR7_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR7_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR7_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR7_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Subregion 8 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR8_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR8_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR8` reader - Subregion 8 in region 0 (write '1' to clear)"] +pub struct SR8_R(crate::FieldReader); +impl SR8_R { + pub(crate) fn new(bits: bool) -> Self { + SR8_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR8_A { + match self.bits { + false => SR8_A::NOACCESS, + true => SR8_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR8_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR8_A::ACCESS + } +} +impl core::ops::Deref for SR8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR8` writer - Subregion 8 in region 0 (write '1' to clear)"] +pub struct SR8_W<'a> { + w: &'a mut W, +} +impl<'a> SR8_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR8_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR8_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR8_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Subregion 9 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR9_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR9_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR9` reader - Subregion 9 in region 0 (write '1' to clear)"] +pub struct SR9_R(crate::FieldReader); +impl SR9_R { + pub(crate) fn new(bits: bool) -> Self { + SR9_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR9_A { + match self.bits { + false => SR9_A::NOACCESS, + true => SR9_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR9_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR9_A::ACCESS + } +} +impl core::ops::Deref for SR9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR9` writer - Subregion 9 in region 0 (write '1' to clear)"] +pub struct SR9_W<'a> { + w: &'a mut W, +} +impl<'a> SR9_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR9_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR9_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR9_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Subregion 10 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR10_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR10_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR10` reader - Subregion 10 in region 0 (write '1' to clear)"] +pub struct SR10_R(crate::FieldReader); +impl SR10_R { + pub(crate) fn new(bits: bool) -> Self { + SR10_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR10_A { + match self.bits { + false => SR10_A::NOACCESS, + true => SR10_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR10_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR10_A::ACCESS + } +} +impl core::ops::Deref for SR10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR10` writer - Subregion 10 in region 0 (write '1' to clear)"] +pub struct SR10_W<'a> { + w: &'a mut W, +} +impl<'a> SR10_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR10_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR10_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR10_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Subregion 11 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR11_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR11_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR11` reader - Subregion 11 in region 0 (write '1' to clear)"] +pub struct SR11_R(crate::FieldReader); +impl SR11_R { + pub(crate) fn new(bits: bool) -> Self { + SR11_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR11_A { + match self.bits { + false => SR11_A::NOACCESS, + true => SR11_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR11_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR11_A::ACCESS + } +} +impl core::ops::Deref for SR11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR11` writer - Subregion 11 in region 0 (write '1' to clear)"] +pub struct SR11_W<'a> { + w: &'a mut W, +} +impl<'a> SR11_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR11_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR11_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR11_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Subregion 12 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR12_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR12_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR12` reader - Subregion 12 in region 0 (write '1' to clear)"] +pub struct SR12_R(crate::FieldReader); +impl SR12_R { + pub(crate) fn new(bits: bool) -> Self { + SR12_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR12_A { + match self.bits { + false => SR12_A::NOACCESS, + true => SR12_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR12_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR12_A::ACCESS + } +} +impl core::ops::Deref for SR12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR12` writer - Subregion 12 in region 0 (write '1' to clear)"] +pub struct SR12_W<'a> { + w: &'a mut W, +} +impl<'a> SR12_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR12_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR12_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR12_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Subregion 13 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR13_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR13_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR13` reader - Subregion 13 in region 0 (write '1' to clear)"] +pub struct SR13_R(crate::FieldReader); +impl SR13_R { + pub(crate) fn new(bits: bool) -> Self { + SR13_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR13_A { + match self.bits { + false => SR13_A::NOACCESS, + true => SR13_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR13_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR13_A::ACCESS + } +} +impl core::ops::Deref for SR13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR13` writer - Subregion 13 in region 0 (write '1' to clear)"] +pub struct SR13_W<'a> { + w: &'a mut W, +} +impl<'a> SR13_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR13_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR13_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR13_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Subregion 14 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR14_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR14_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR14` reader - Subregion 14 in region 0 (write '1' to clear)"] +pub struct SR14_R(crate::FieldReader); +impl SR14_R { + pub(crate) fn new(bits: bool) -> Self { + SR14_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR14_A { + match self.bits { + false => SR14_A::NOACCESS, + true => SR14_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR14_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR14_A::ACCESS + } +} +impl core::ops::Deref for SR14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR14` writer - Subregion 14 in region 0 (write '1' to clear)"] +pub struct SR14_W<'a> { + w: &'a mut W, +} +impl<'a> SR14_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR14_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR14_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR14_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Subregion 15 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR15_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR15_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR15` reader - Subregion 15 in region 0 (write '1' to clear)"] +pub struct SR15_R(crate::FieldReader); +impl SR15_R { + pub(crate) fn new(bits: bool) -> Self { + SR15_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR15_A { + match self.bits { + false => SR15_A::NOACCESS, + true => SR15_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR15_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR15_A::ACCESS + } +} +impl core::ops::Deref for SR15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR15` writer - Subregion 15 in region 0 (write '1' to clear)"] +pub struct SR15_W<'a> { + w: &'a mut W, +} +impl<'a> SR15_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR15_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR15_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR15_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Subregion 16 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR16_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR16_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR16` reader - Subregion 16 in region 0 (write '1' to clear)"] +pub struct SR16_R(crate::FieldReader); +impl SR16_R { + pub(crate) fn new(bits: bool) -> Self { + SR16_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR16_A { + match self.bits { + false => SR16_A::NOACCESS, + true => SR16_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR16_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR16_A::ACCESS + } +} +impl core::ops::Deref for SR16_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR16` writer - Subregion 16 in region 0 (write '1' to clear)"] +pub struct SR16_W<'a> { + w: &'a mut W, +} +impl<'a> SR16_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR16_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR16_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR16_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Subregion 17 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR17_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR17_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR17` reader - Subregion 17 in region 0 (write '1' to clear)"] +pub struct SR17_R(crate::FieldReader); +impl SR17_R { + pub(crate) fn new(bits: bool) -> Self { + SR17_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR17_A { + match self.bits { + false => SR17_A::NOACCESS, + true => SR17_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR17_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR17_A::ACCESS + } +} +impl core::ops::Deref for SR17_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR17` writer - Subregion 17 in region 0 (write '1' to clear)"] +pub struct SR17_W<'a> { + w: &'a mut W, +} +impl<'a> SR17_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR17_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR17_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR17_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Subregion 18 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR18_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR18_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR18` reader - Subregion 18 in region 0 (write '1' to clear)"] +pub struct SR18_R(crate::FieldReader); +impl SR18_R { + pub(crate) fn new(bits: bool) -> Self { + SR18_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR18_A { + match self.bits { + false => SR18_A::NOACCESS, + true => SR18_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR18_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR18_A::ACCESS + } +} +impl core::ops::Deref for SR18_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR18` writer - Subregion 18 in region 0 (write '1' to clear)"] +pub struct SR18_W<'a> { + w: &'a mut W, +} +impl<'a> SR18_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR18_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR18_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR18_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Subregion 19 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR19_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR19_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR19` reader - Subregion 19 in region 0 (write '1' to clear)"] +pub struct SR19_R(crate::FieldReader); +impl SR19_R { + pub(crate) fn new(bits: bool) -> Self { + SR19_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR19_A { + match self.bits { + false => SR19_A::NOACCESS, + true => SR19_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR19_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR19_A::ACCESS + } +} +impl core::ops::Deref for SR19_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR19` writer - Subregion 19 in region 0 (write '1' to clear)"] +pub struct SR19_W<'a> { + w: &'a mut W, +} +impl<'a> SR19_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR19_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR19_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR19_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Subregion 20 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR20_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR20_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR20` reader - Subregion 20 in region 0 (write '1' to clear)"] +pub struct SR20_R(crate::FieldReader); +impl SR20_R { + pub(crate) fn new(bits: bool) -> Self { + SR20_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR20_A { + match self.bits { + false => SR20_A::NOACCESS, + true => SR20_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR20_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR20_A::ACCESS + } +} +impl core::ops::Deref for SR20_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR20` writer - Subregion 20 in region 0 (write '1' to clear)"] +pub struct SR20_W<'a> { + w: &'a mut W, +} +impl<'a> SR20_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR20_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR20_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR20_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Subregion 21 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR21_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR21_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR21` reader - Subregion 21 in region 0 (write '1' to clear)"] +pub struct SR21_R(crate::FieldReader); +impl SR21_R { + pub(crate) fn new(bits: bool) -> Self { + SR21_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR21_A { + match self.bits { + false => SR21_A::NOACCESS, + true => SR21_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR21_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR21_A::ACCESS + } +} +impl core::ops::Deref for SR21_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR21` writer - Subregion 21 in region 0 (write '1' to clear)"] +pub struct SR21_W<'a> { + w: &'a mut W, +} +impl<'a> SR21_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR21_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR21_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR21_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); + self.w + } +} +#[doc = "Subregion 22 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR22_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR22_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR22` reader - Subregion 22 in region 0 (write '1' to clear)"] +pub struct SR22_R(crate::FieldReader); +impl SR22_R { + pub(crate) fn new(bits: bool) -> Self { + SR22_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR22_A { + match self.bits { + false => SR22_A::NOACCESS, + true => SR22_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR22_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR22_A::ACCESS + } +} +impl core::ops::Deref for SR22_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR22` writer - Subregion 22 in region 0 (write '1' to clear)"] +pub struct SR22_W<'a> { + w: &'a mut W, +} +impl<'a> SR22_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR22_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR22_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR22_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); + self.w + } +} +#[doc = "Subregion 23 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR23_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR23_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR23` reader - Subregion 23 in region 0 (write '1' to clear)"] +pub struct SR23_R(crate::FieldReader); +impl SR23_R { + pub(crate) fn new(bits: bool) -> Self { + SR23_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR23_A { + match self.bits { + false => SR23_A::NOACCESS, + true => SR23_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR23_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR23_A::ACCESS + } +} +impl core::ops::Deref for SR23_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR23` writer - Subregion 23 in region 0 (write '1' to clear)"] +pub struct SR23_W<'a> { + w: &'a mut W, +} +impl<'a> SR23_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR23_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR23_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR23_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); + self.w + } +} +#[doc = "Subregion 24 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR24_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR24_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR24` reader - Subregion 24 in region 0 (write '1' to clear)"] +pub struct SR24_R(crate::FieldReader); +impl SR24_R { + pub(crate) fn new(bits: bool) -> Self { + SR24_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR24_A { + match self.bits { + false => SR24_A::NOACCESS, + true => SR24_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR24_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR24_A::ACCESS + } +} +impl core::ops::Deref for SR24_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR24` writer - Subregion 24 in region 0 (write '1' to clear)"] +pub struct SR24_W<'a> { + w: &'a mut W, +} +impl<'a> SR24_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR24_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR24_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR24_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Subregion 25 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR25_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR25_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR25` reader - Subregion 25 in region 0 (write '1' to clear)"] +pub struct SR25_R(crate::FieldReader); +impl SR25_R { + pub(crate) fn new(bits: bool) -> Self { + SR25_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR25_A { + match self.bits { + false => SR25_A::NOACCESS, + true => SR25_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR25_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR25_A::ACCESS + } +} +impl core::ops::Deref for SR25_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR25` writer - Subregion 25 in region 0 (write '1' to clear)"] +pub struct SR25_W<'a> { + w: &'a mut W, +} +impl<'a> SR25_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR25_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR25_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR25_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Subregion 26 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR26_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR26_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR26` reader - Subregion 26 in region 0 (write '1' to clear)"] +pub struct SR26_R(crate::FieldReader); +impl SR26_R { + pub(crate) fn new(bits: bool) -> Self { + SR26_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR26_A { + match self.bits { + false => SR26_A::NOACCESS, + true => SR26_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR26_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR26_A::ACCESS + } +} +impl core::ops::Deref for SR26_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR26` writer - Subregion 26 in region 0 (write '1' to clear)"] +pub struct SR26_W<'a> { + w: &'a mut W, +} +impl<'a> SR26_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR26_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR26_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR26_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Subregion 27 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR27_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR27_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR27` reader - Subregion 27 in region 0 (write '1' to clear)"] +pub struct SR27_R(crate::FieldReader); +impl SR27_R { + pub(crate) fn new(bits: bool) -> Self { + SR27_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR27_A { + match self.bits { + false => SR27_A::NOACCESS, + true => SR27_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR27_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR27_A::ACCESS + } +} +impl core::ops::Deref for SR27_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR27` writer - Subregion 27 in region 0 (write '1' to clear)"] +pub struct SR27_W<'a> { + w: &'a mut W, +} +impl<'a> SR27_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR27_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR27_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR27_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +#[doc = "Subregion 28 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR28_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR28_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR28` reader - Subregion 28 in region 0 (write '1' to clear)"] +pub struct SR28_R(crate::FieldReader); +impl SR28_R { + pub(crate) fn new(bits: bool) -> Self { + SR28_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR28_A { + match self.bits { + false => SR28_A::NOACCESS, + true => SR28_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR28_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR28_A::ACCESS + } +} +impl core::ops::Deref for SR28_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR28` writer - Subregion 28 in region 0 (write '1' to clear)"] +pub struct SR28_W<'a> { + w: &'a mut W, +} +impl<'a> SR28_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR28_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR28_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR28_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); + self.w + } +} +#[doc = "Subregion 29 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR29_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR29_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR29` reader - Subregion 29 in region 0 (write '1' to clear)"] +pub struct SR29_R(crate::FieldReader); +impl SR29_R { + pub(crate) fn new(bits: bool) -> Self { + SR29_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR29_A { + match self.bits { + false => SR29_A::NOACCESS, + true => SR29_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR29_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR29_A::ACCESS + } +} +impl core::ops::Deref for SR29_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR29` writer - Subregion 29 in region 0 (write '1' to clear)"] +pub struct SR29_W<'a> { + w: &'a mut W, +} +impl<'a> SR29_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR29_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR29_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR29_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); + self.w + } +} +#[doc = "Subregion 30 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR30_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR30_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR30` reader - Subregion 30 in region 0 (write '1' to clear)"] +pub struct SR30_R(crate::FieldReader); +impl SR30_R { + pub(crate) fn new(bits: bool) -> Self { + SR30_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR30_A { + match self.bits { + false => SR30_A::NOACCESS, + true => SR30_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR30_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR30_A::ACCESS + } +} +impl core::ops::Deref for SR30_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR30` writer - Subregion 30 in region 0 (write '1' to clear)"] +pub struct SR30_W<'a> { + w: &'a mut W, +} +impl<'a> SR30_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR30_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR30_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR30_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); + self.w + } +} +#[doc = "Subregion 31 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR31_A { + #[doc = "0: No read access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Read access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR31_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR31` reader - Subregion 31 in region 0 (write '1' to clear)"] +pub struct SR31_R(crate::FieldReader); +impl SR31_R { + pub(crate) fn new(bits: bool) -> Self { + SR31_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR31_A { + match self.bits { + false => SR31_A::NOACCESS, + true => SR31_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR31_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR31_A::ACCESS + } +} +impl core::ops::Deref for SR31_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR31` writer - Subregion 31 in region 0 (write '1' to clear)"] +pub struct SR31_W<'a> { + w: &'a mut W, +} +impl<'a> SR31_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR31_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No read access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR31_A::NOACCESS) + } + #[doc = "Read access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR31_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bit 0 - Subregion 0 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr0(&self) -> SR0_R { + SR0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Subregion 1 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr1(&self) -> SR1_R { + SR1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Subregion 2 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr2(&self) -> SR2_R { + SR2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Subregion 3 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr3(&self) -> SR3_R { + SR3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Subregion 4 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr4(&self) -> SR4_R { + SR4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Subregion 5 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr5(&self) -> SR5_R { + SR5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Subregion 6 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr6(&self) -> SR6_R { + SR6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Subregion 7 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr7(&self) -> SR7_R { + SR7_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Subregion 8 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr8(&self) -> SR8_R { + SR8_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Subregion 9 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr9(&self) -> SR9_R { + SR9_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Subregion 10 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr10(&self) -> SR10_R { + SR10_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Subregion 11 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr11(&self) -> SR11_R { + SR11_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Subregion 12 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr12(&self) -> SR12_R { + SR12_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Subregion 13 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr13(&self) -> SR13_R { + SR13_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Subregion 14 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr14(&self) -> SR14_R { + SR14_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Subregion 15 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr15(&self) -> SR15_R { + SR15_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Subregion 16 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr16(&self) -> SR16_R { + SR16_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Subregion 17 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr17(&self) -> SR17_R { + SR17_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Subregion 18 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr18(&self) -> SR18_R { + SR18_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Subregion 19 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr19(&self) -> SR19_R { + SR19_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Subregion 20 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr20(&self) -> SR20_R { + SR20_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 21 - Subregion 21 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr21(&self) -> SR21_R { + SR21_R::new(((self.bits >> 21) & 0x01) != 0) + } + #[doc = "Bit 22 - Subregion 22 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr22(&self) -> SR22_R { + SR22_R::new(((self.bits >> 22) & 0x01) != 0) + } + #[doc = "Bit 23 - Subregion 23 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr23(&self) -> SR23_R { + SR23_R::new(((self.bits >> 23) & 0x01) != 0) + } + #[doc = "Bit 24 - Subregion 24 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr24(&self) -> SR24_R { + SR24_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Subregion 25 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr25(&self) -> SR25_R { + SR25_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Subregion 26 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr26(&self) -> SR26_R { + SR26_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Subregion 27 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr27(&self) -> SR27_R { + SR27_R::new(((self.bits >> 27) & 0x01) != 0) + } + #[doc = "Bit 28 - Subregion 28 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr28(&self) -> SR28_R { + SR28_R::new(((self.bits >> 28) & 0x01) != 0) + } + #[doc = "Bit 29 - Subregion 29 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr29(&self) -> SR29_R { + SR29_R::new(((self.bits >> 29) & 0x01) != 0) + } + #[doc = "Bit 30 - Subregion 30 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr30(&self) -> SR30_R { + SR30_R::new(((self.bits >> 30) & 0x01) != 0) + } + #[doc = "Bit 31 - Subregion 31 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr31(&self) -> SR31_R { + SR31_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Subregion 0 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr0(&mut self) -> SR0_W { + SR0_W { w: self } + } + #[doc = "Bit 1 - Subregion 1 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr1(&mut self) -> SR1_W { + SR1_W { w: self } + } + #[doc = "Bit 2 - Subregion 2 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr2(&mut self) -> SR2_W { + SR2_W { w: self } + } + #[doc = "Bit 3 - Subregion 3 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr3(&mut self) -> SR3_W { + SR3_W { w: self } + } + #[doc = "Bit 4 - Subregion 4 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr4(&mut self) -> SR4_W { + SR4_W { w: self } + } + #[doc = "Bit 5 - Subregion 5 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr5(&mut self) -> SR5_W { + SR5_W { w: self } + } + #[doc = "Bit 6 - Subregion 6 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr6(&mut self) -> SR6_W { + SR6_W { w: self } + } + #[doc = "Bit 7 - Subregion 7 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr7(&mut self) -> SR7_W { + SR7_W { w: self } + } + #[doc = "Bit 8 - Subregion 8 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr8(&mut self) -> SR8_W { + SR8_W { w: self } + } + #[doc = "Bit 9 - Subregion 9 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr9(&mut self) -> SR9_W { + SR9_W { w: self } + } + #[doc = "Bit 10 - Subregion 10 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr10(&mut self) -> SR10_W { + SR10_W { w: self } + } + #[doc = "Bit 11 - Subregion 11 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr11(&mut self) -> SR11_W { + SR11_W { w: self } + } + #[doc = "Bit 12 - Subregion 12 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr12(&mut self) -> SR12_W { + SR12_W { w: self } + } + #[doc = "Bit 13 - Subregion 13 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr13(&mut self) -> SR13_W { + SR13_W { w: self } + } + #[doc = "Bit 14 - Subregion 14 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr14(&mut self) -> SR14_W { + SR14_W { w: self } + } + #[doc = "Bit 15 - Subregion 15 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr15(&mut self) -> SR15_W { + SR15_W { w: self } + } + #[doc = "Bit 16 - Subregion 16 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr16(&mut self) -> SR16_W { + SR16_W { w: self } + } + #[doc = "Bit 17 - Subregion 17 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr17(&mut self) -> SR17_W { + SR17_W { w: self } + } + #[doc = "Bit 18 - Subregion 18 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr18(&mut self) -> SR18_W { + SR18_W { w: self } + } + #[doc = "Bit 19 - Subregion 19 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr19(&mut self) -> SR19_W { + SR19_W { w: self } + } + #[doc = "Bit 20 - Subregion 20 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr20(&mut self) -> SR20_W { + SR20_W { w: self } + } + #[doc = "Bit 21 - Subregion 21 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr21(&mut self) -> SR21_W { + SR21_W { w: self } + } + #[doc = "Bit 22 - Subregion 22 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr22(&mut self) -> SR22_W { + SR22_W { w: self } + } + #[doc = "Bit 23 - Subregion 23 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr23(&mut self) -> SR23_W { + SR23_W { w: self } + } + #[doc = "Bit 24 - Subregion 24 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr24(&mut self) -> SR24_W { + SR24_W { w: self } + } + #[doc = "Bit 25 - Subregion 25 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr25(&mut self) -> SR25_W { + SR25_W { w: self } + } + #[doc = "Bit 26 - Subregion 26 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr26(&mut self) -> SR26_W { + SR26_W { w: self } + } + #[doc = "Bit 27 - Subregion 27 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr27(&mut self) -> SR27_W { + SR27_W { w: self } + } + #[doc = "Bit 28 - Subregion 28 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr28(&mut self) -> SR28_W { + SR28_W { w: self } + } + #[doc = "Bit 29 - Subregion 29 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr29(&mut self) -> SR29_W { + SR29_W { w: self } + } + #[doc = "Bit 30 - Subregion 30 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr30(&mut self) -> SR30_W { + SR30_W { w: self } + } + #[doc = "Bit 31 - Subregion 31 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr31(&mut self) -> SR31_W { + SR31_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description cluster\\[0\\]: Source of event/interrupt in region 0, read access detected while corresponding subregion was enabled for watching\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [substatra](index.html) module"] +pub struct SUBSTATRA_SPEC; +impl crate::RegisterSpec for SUBSTATRA_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [substatra::R](R) reader structure"] +impl crate::Readable for SUBSTATRA_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [substatra::W](W) writer structure"] +impl crate::Writable for SUBSTATRA_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SUBSTATRA to value 0"] +impl crate::Resettable for SUBSTATRA_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mwu/perregion/substatwa.rs b/src/mwu/perregion/substatwa.rs new file mode 100644 index 0000000..d84b08e --- /dev/null +++ b/src/mwu/perregion/substatwa.rs @@ -0,0 +1,3042 @@ +#[doc = "Register `SUBSTATWA` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SUBSTATWA` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Subregion 0 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR0_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR0` reader - Subregion 0 in region 0 (write '1' to clear)"] +pub struct SR0_R(crate::FieldReader); +impl SR0_R { + pub(crate) fn new(bits: bool) -> Self { + SR0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR0_A { + match self.bits { + false => SR0_A::NOACCESS, + true => SR0_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR0_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR0_A::ACCESS + } +} +impl core::ops::Deref for SR0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR0` writer - Subregion 0 in region 0 (write '1' to clear)"] +pub struct SR0_W<'a> { + w: &'a mut W, +} +impl<'a> SR0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR0_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR0_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR0_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Subregion 1 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR1_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR1` reader - Subregion 1 in region 0 (write '1' to clear)"] +pub struct SR1_R(crate::FieldReader); +impl SR1_R { + pub(crate) fn new(bits: bool) -> Self { + SR1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR1_A { + match self.bits { + false => SR1_A::NOACCESS, + true => SR1_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR1_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR1_A::ACCESS + } +} +impl core::ops::Deref for SR1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR1` writer - Subregion 1 in region 0 (write '1' to clear)"] +pub struct SR1_W<'a> { + w: &'a mut W, +} +impl<'a> SR1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR1_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR1_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR1_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Subregion 2 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR2_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR2` reader - Subregion 2 in region 0 (write '1' to clear)"] +pub struct SR2_R(crate::FieldReader); +impl SR2_R { + pub(crate) fn new(bits: bool) -> Self { + SR2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR2_A { + match self.bits { + false => SR2_A::NOACCESS, + true => SR2_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR2_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR2_A::ACCESS + } +} +impl core::ops::Deref for SR2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR2` writer - Subregion 2 in region 0 (write '1' to clear)"] +pub struct SR2_W<'a> { + w: &'a mut W, +} +impl<'a> SR2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR2_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR2_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR2_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Subregion 3 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR3_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR3` reader - Subregion 3 in region 0 (write '1' to clear)"] +pub struct SR3_R(crate::FieldReader); +impl SR3_R { + pub(crate) fn new(bits: bool) -> Self { + SR3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR3_A { + match self.bits { + false => SR3_A::NOACCESS, + true => SR3_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR3_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR3_A::ACCESS + } +} +impl core::ops::Deref for SR3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR3` writer - Subregion 3 in region 0 (write '1' to clear)"] +pub struct SR3_W<'a> { + w: &'a mut W, +} +impl<'a> SR3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR3_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR3_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR3_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Subregion 4 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR4_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR4_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR4` reader - Subregion 4 in region 0 (write '1' to clear)"] +pub struct SR4_R(crate::FieldReader); +impl SR4_R { + pub(crate) fn new(bits: bool) -> Self { + SR4_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR4_A { + match self.bits { + false => SR4_A::NOACCESS, + true => SR4_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR4_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR4_A::ACCESS + } +} +impl core::ops::Deref for SR4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR4` writer - Subregion 4 in region 0 (write '1' to clear)"] +pub struct SR4_W<'a> { + w: &'a mut W, +} +impl<'a> SR4_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR4_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR4_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR4_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Subregion 5 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR5_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR5_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR5` reader - Subregion 5 in region 0 (write '1' to clear)"] +pub struct SR5_R(crate::FieldReader); +impl SR5_R { + pub(crate) fn new(bits: bool) -> Self { + SR5_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR5_A { + match self.bits { + false => SR5_A::NOACCESS, + true => SR5_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR5_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR5_A::ACCESS + } +} +impl core::ops::Deref for SR5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR5` writer - Subregion 5 in region 0 (write '1' to clear)"] +pub struct SR5_W<'a> { + w: &'a mut W, +} +impl<'a> SR5_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR5_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR5_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR5_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Subregion 6 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR6_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR6_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR6` reader - Subregion 6 in region 0 (write '1' to clear)"] +pub struct SR6_R(crate::FieldReader); +impl SR6_R { + pub(crate) fn new(bits: bool) -> Self { + SR6_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR6_A { + match self.bits { + false => SR6_A::NOACCESS, + true => SR6_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR6_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR6_A::ACCESS + } +} +impl core::ops::Deref for SR6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR6` writer - Subregion 6 in region 0 (write '1' to clear)"] +pub struct SR6_W<'a> { + w: &'a mut W, +} +impl<'a> SR6_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR6_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR6_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR6_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Subregion 7 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR7_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR7_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR7` reader - Subregion 7 in region 0 (write '1' to clear)"] +pub struct SR7_R(crate::FieldReader); +impl SR7_R { + pub(crate) fn new(bits: bool) -> Self { + SR7_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR7_A { + match self.bits { + false => SR7_A::NOACCESS, + true => SR7_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR7_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR7_A::ACCESS + } +} +impl core::ops::Deref for SR7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR7` writer - Subregion 7 in region 0 (write '1' to clear)"] +pub struct SR7_W<'a> { + w: &'a mut W, +} +impl<'a> SR7_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR7_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR7_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR7_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Subregion 8 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR8_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR8_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR8` reader - Subregion 8 in region 0 (write '1' to clear)"] +pub struct SR8_R(crate::FieldReader); +impl SR8_R { + pub(crate) fn new(bits: bool) -> Self { + SR8_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR8_A { + match self.bits { + false => SR8_A::NOACCESS, + true => SR8_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR8_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR8_A::ACCESS + } +} +impl core::ops::Deref for SR8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR8` writer - Subregion 8 in region 0 (write '1' to clear)"] +pub struct SR8_W<'a> { + w: &'a mut W, +} +impl<'a> SR8_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR8_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR8_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR8_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Subregion 9 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR9_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR9_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR9` reader - Subregion 9 in region 0 (write '1' to clear)"] +pub struct SR9_R(crate::FieldReader); +impl SR9_R { + pub(crate) fn new(bits: bool) -> Self { + SR9_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR9_A { + match self.bits { + false => SR9_A::NOACCESS, + true => SR9_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR9_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR9_A::ACCESS + } +} +impl core::ops::Deref for SR9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR9` writer - Subregion 9 in region 0 (write '1' to clear)"] +pub struct SR9_W<'a> { + w: &'a mut W, +} +impl<'a> SR9_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR9_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR9_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR9_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Subregion 10 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR10_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR10_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR10` reader - Subregion 10 in region 0 (write '1' to clear)"] +pub struct SR10_R(crate::FieldReader); +impl SR10_R { + pub(crate) fn new(bits: bool) -> Self { + SR10_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR10_A { + match self.bits { + false => SR10_A::NOACCESS, + true => SR10_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR10_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR10_A::ACCESS + } +} +impl core::ops::Deref for SR10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR10` writer - Subregion 10 in region 0 (write '1' to clear)"] +pub struct SR10_W<'a> { + w: &'a mut W, +} +impl<'a> SR10_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR10_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR10_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR10_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Subregion 11 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR11_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR11_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR11` reader - Subregion 11 in region 0 (write '1' to clear)"] +pub struct SR11_R(crate::FieldReader); +impl SR11_R { + pub(crate) fn new(bits: bool) -> Self { + SR11_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR11_A { + match self.bits { + false => SR11_A::NOACCESS, + true => SR11_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR11_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR11_A::ACCESS + } +} +impl core::ops::Deref for SR11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR11` writer - Subregion 11 in region 0 (write '1' to clear)"] +pub struct SR11_W<'a> { + w: &'a mut W, +} +impl<'a> SR11_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR11_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR11_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR11_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Subregion 12 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR12_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR12_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR12` reader - Subregion 12 in region 0 (write '1' to clear)"] +pub struct SR12_R(crate::FieldReader); +impl SR12_R { + pub(crate) fn new(bits: bool) -> Self { + SR12_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR12_A { + match self.bits { + false => SR12_A::NOACCESS, + true => SR12_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR12_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR12_A::ACCESS + } +} +impl core::ops::Deref for SR12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR12` writer - Subregion 12 in region 0 (write '1' to clear)"] +pub struct SR12_W<'a> { + w: &'a mut W, +} +impl<'a> SR12_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR12_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR12_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR12_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Subregion 13 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR13_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR13_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR13` reader - Subregion 13 in region 0 (write '1' to clear)"] +pub struct SR13_R(crate::FieldReader); +impl SR13_R { + pub(crate) fn new(bits: bool) -> Self { + SR13_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR13_A { + match self.bits { + false => SR13_A::NOACCESS, + true => SR13_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR13_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR13_A::ACCESS + } +} +impl core::ops::Deref for SR13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR13` writer - Subregion 13 in region 0 (write '1' to clear)"] +pub struct SR13_W<'a> { + w: &'a mut W, +} +impl<'a> SR13_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR13_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR13_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR13_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Subregion 14 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR14_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR14_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR14` reader - Subregion 14 in region 0 (write '1' to clear)"] +pub struct SR14_R(crate::FieldReader); +impl SR14_R { + pub(crate) fn new(bits: bool) -> Self { + SR14_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR14_A { + match self.bits { + false => SR14_A::NOACCESS, + true => SR14_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR14_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR14_A::ACCESS + } +} +impl core::ops::Deref for SR14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR14` writer - Subregion 14 in region 0 (write '1' to clear)"] +pub struct SR14_W<'a> { + w: &'a mut W, +} +impl<'a> SR14_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR14_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR14_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR14_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Subregion 15 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR15_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR15_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR15` reader - Subregion 15 in region 0 (write '1' to clear)"] +pub struct SR15_R(crate::FieldReader); +impl SR15_R { + pub(crate) fn new(bits: bool) -> Self { + SR15_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR15_A { + match self.bits { + false => SR15_A::NOACCESS, + true => SR15_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR15_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR15_A::ACCESS + } +} +impl core::ops::Deref for SR15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR15` writer - Subregion 15 in region 0 (write '1' to clear)"] +pub struct SR15_W<'a> { + w: &'a mut W, +} +impl<'a> SR15_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR15_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR15_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR15_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Subregion 16 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR16_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR16_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR16` reader - Subregion 16 in region 0 (write '1' to clear)"] +pub struct SR16_R(crate::FieldReader); +impl SR16_R { + pub(crate) fn new(bits: bool) -> Self { + SR16_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR16_A { + match self.bits { + false => SR16_A::NOACCESS, + true => SR16_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR16_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR16_A::ACCESS + } +} +impl core::ops::Deref for SR16_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR16` writer - Subregion 16 in region 0 (write '1' to clear)"] +pub struct SR16_W<'a> { + w: &'a mut W, +} +impl<'a> SR16_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR16_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR16_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR16_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Subregion 17 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR17_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR17_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR17` reader - Subregion 17 in region 0 (write '1' to clear)"] +pub struct SR17_R(crate::FieldReader); +impl SR17_R { + pub(crate) fn new(bits: bool) -> Self { + SR17_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR17_A { + match self.bits { + false => SR17_A::NOACCESS, + true => SR17_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR17_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR17_A::ACCESS + } +} +impl core::ops::Deref for SR17_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR17` writer - Subregion 17 in region 0 (write '1' to clear)"] +pub struct SR17_W<'a> { + w: &'a mut W, +} +impl<'a> SR17_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR17_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR17_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR17_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Subregion 18 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR18_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR18_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR18` reader - Subregion 18 in region 0 (write '1' to clear)"] +pub struct SR18_R(crate::FieldReader); +impl SR18_R { + pub(crate) fn new(bits: bool) -> Self { + SR18_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR18_A { + match self.bits { + false => SR18_A::NOACCESS, + true => SR18_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR18_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR18_A::ACCESS + } +} +impl core::ops::Deref for SR18_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR18` writer - Subregion 18 in region 0 (write '1' to clear)"] +pub struct SR18_W<'a> { + w: &'a mut W, +} +impl<'a> SR18_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR18_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR18_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR18_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Subregion 19 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR19_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR19_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR19` reader - Subregion 19 in region 0 (write '1' to clear)"] +pub struct SR19_R(crate::FieldReader); +impl SR19_R { + pub(crate) fn new(bits: bool) -> Self { + SR19_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR19_A { + match self.bits { + false => SR19_A::NOACCESS, + true => SR19_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR19_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR19_A::ACCESS + } +} +impl core::ops::Deref for SR19_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR19` writer - Subregion 19 in region 0 (write '1' to clear)"] +pub struct SR19_W<'a> { + w: &'a mut W, +} +impl<'a> SR19_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR19_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR19_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR19_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Subregion 20 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR20_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR20_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR20` reader - Subregion 20 in region 0 (write '1' to clear)"] +pub struct SR20_R(crate::FieldReader); +impl SR20_R { + pub(crate) fn new(bits: bool) -> Self { + SR20_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR20_A { + match self.bits { + false => SR20_A::NOACCESS, + true => SR20_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR20_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR20_A::ACCESS + } +} +impl core::ops::Deref for SR20_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR20` writer - Subregion 20 in region 0 (write '1' to clear)"] +pub struct SR20_W<'a> { + w: &'a mut W, +} +impl<'a> SR20_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR20_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR20_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR20_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Subregion 21 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR21_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR21_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR21` reader - Subregion 21 in region 0 (write '1' to clear)"] +pub struct SR21_R(crate::FieldReader); +impl SR21_R { + pub(crate) fn new(bits: bool) -> Self { + SR21_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR21_A { + match self.bits { + false => SR21_A::NOACCESS, + true => SR21_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR21_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR21_A::ACCESS + } +} +impl core::ops::Deref for SR21_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR21` writer - Subregion 21 in region 0 (write '1' to clear)"] +pub struct SR21_W<'a> { + w: &'a mut W, +} +impl<'a> SR21_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR21_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR21_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR21_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); + self.w + } +} +#[doc = "Subregion 22 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR22_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR22_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR22` reader - Subregion 22 in region 0 (write '1' to clear)"] +pub struct SR22_R(crate::FieldReader); +impl SR22_R { + pub(crate) fn new(bits: bool) -> Self { + SR22_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR22_A { + match self.bits { + false => SR22_A::NOACCESS, + true => SR22_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR22_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR22_A::ACCESS + } +} +impl core::ops::Deref for SR22_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR22` writer - Subregion 22 in region 0 (write '1' to clear)"] +pub struct SR22_W<'a> { + w: &'a mut W, +} +impl<'a> SR22_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR22_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR22_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR22_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); + self.w + } +} +#[doc = "Subregion 23 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR23_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR23_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR23` reader - Subregion 23 in region 0 (write '1' to clear)"] +pub struct SR23_R(crate::FieldReader); +impl SR23_R { + pub(crate) fn new(bits: bool) -> Self { + SR23_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR23_A { + match self.bits { + false => SR23_A::NOACCESS, + true => SR23_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR23_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR23_A::ACCESS + } +} +impl core::ops::Deref for SR23_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR23` writer - Subregion 23 in region 0 (write '1' to clear)"] +pub struct SR23_W<'a> { + w: &'a mut W, +} +impl<'a> SR23_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR23_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR23_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR23_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); + self.w + } +} +#[doc = "Subregion 24 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR24_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR24_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR24` reader - Subregion 24 in region 0 (write '1' to clear)"] +pub struct SR24_R(crate::FieldReader); +impl SR24_R { + pub(crate) fn new(bits: bool) -> Self { + SR24_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR24_A { + match self.bits { + false => SR24_A::NOACCESS, + true => SR24_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR24_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR24_A::ACCESS + } +} +impl core::ops::Deref for SR24_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR24` writer - Subregion 24 in region 0 (write '1' to clear)"] +pub struct SR24_W<'a> { + w: &'a mut W, +} +impl<'a> SR24_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR24_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR24_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR24_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Subregion 25 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR25_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR25_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR25` reader - Subregion 25 in region 0 (write '1' to clear)"] +pub struct SR25_R(crate::FieldReader); +impl SR25_R { + pub(crate) fn new(bits: bool) -> Self { + SR25_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR25_A { + match self.bits { + false => SR25_A::NOACCESS, + true => SR25_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR25_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR25_A::ACCESS + } +} +impl core::ops::Deref for SR25_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR25` writer - Subregion 25 in region 0 (write '1' to clear)"] +pub struct SR25_W<'a> { + w: &'a mut W, +} +impl<'a> SR25_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR25_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR25_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR25_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Subregion 26 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR26_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR26_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR26` reader - Subregion 26 in region 0 (write '1' to clear)"] +pub struct SR26_R(crate::FieldReader); +impl SR26_R { + pub(crate) fn new(bits: bool) -> Self { + SR26_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR26_A { + match self.bits { + false => SR26_A::NOACCESS, + true => SR26_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR26_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR26_A::ACCESS + } +} +impl core::ops::Deref for SR26_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR26` writer - Subregion 26 in region 0 (write '1' to clear)"] +pub struct SR26_W<'a> { + w: &'a mut W, +} +impl<'a> SR26_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR26_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR26_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR26_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Subregion 27 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR27_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR27_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR27` reader - Subregion 27 in region 0 (write '1' to clear)"] +pub struct SR27_R(crate::FieldReader); +impl SR27_R { + pub(crate) fn new(bits: bool) -> Self { + SR27_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR27_A { + match self.bits { + false => SR27_A::NOACCESS, + true => SR27_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR27_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR27_A::ACCESS + } +} +impl core::ops::Deref for SR27_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR27` writer - Subregion 27 in region 0 (write '1' to clear)"] +pub struct SR27_W<'a> { + w: &'a mut W, +} +impl<'a> SR27_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR27_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR27_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR27_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +#[doc = "Subregion 28 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR28_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR28_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR28` reader - Subregion 28 in region 0 (write '1' to clear)"] +pub struct SR28_R(crate::FieldReader); +impl SR28_R { + pub(crate) fn new(bits: bool) -> Self { + SR28_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR28_A { + match self.bits { + false => SR28_A::NOACCESS, + true => SR28_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR28_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR28_A::ACCESS + } +} +impl core::ops::Deref for SR28_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR28` writer - Subregion 28 in region 0 (write '1' to clear)"] +pub struct SR28_W<'a> { + w: &'a mut W, +} +impl<'a> SR28_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR28_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR28_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR28_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); + self.w + } +} +#[doc = "Subregion 29 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR29_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR29_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR29` reader - Subregion 29 in region 0 (write '1' to clear)"] +pub struct SR29_R(crate::FieldReader); +impl SR29_R { + pub(crate) fn new(bits: bool) -> Self { + SR29_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR29_A { + match self.bits { + false => SR29_A::NOACCESS, + true => SR29_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR29_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR29_A::ACCESS + } +} +impl core::ops::Deref for SR29_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR29` writer - Subregion 29 in region 0 (write '1' to clear)"] +pub struct SR29_W<'a> { + w: &'a mut W, +} +impl<'a> SR29_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR29_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR29_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR29_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); + self.w + } +} +#[doc = "Subregion 30 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR30_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR30_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR30` reader - Subregion 30 in region 0 (write '1' to clear)"] +pub struct SR30_R(crate::FieldReader); +impl SR30_R { + pub(crate) fn new(bits: bool) -> Self { + SR30_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR30_A { + match self.bits { + false => SR30_A::NOACCESS, + true => SR30_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR30_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR30_A::ACCESS + } +} +impl core::ops::Deref for SR30_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR30` writer - Subregion 30 in region 0 (write '1' to clear)"] +pub struct SR30_W<'a> { + w: &'a mut W, +} +impl<'a> SR30_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR30_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR30_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR30_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); + self.w + } +} +#[doc = "Subregion 31 in region 0 (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR31_A { + #[doc = "0: No write access occurred in this subregion"] + NOACCESS = 0, + #[doc = "1: Write access(es) occurred in this subregion"] + ACCESS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR31_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR31` reader - Subregion 31 in region 0 (write '1' to clear)"] +pub struct SR31_R(crate::FieldReader); +impl SR31_R { + pub(crate) fn new(bits: bool) -> Self { + SR31_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR31_A { + match self.bits { + false => SR31_A::NOACCESS, + true => SR31_A::ACCESS, + } + } + #[doc = "Checks if the value of the field is `NOACCESS`"] + #[inline(always)] + pub fn is_no_access(&self) -> bool { + **self == SR31_A::NOACCESS + } + #[doc = "Checks if the value of the field is `ACCESS`"] + #[inline(always)] + pub fn is_access(&self) -> bool { + **self == SR31_A::ACCESS + } +} +impl core::ops::Deref for SR31_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR31` writer - Subregion 31 in region 0 (write '1' to clear)"] +pub struct SR31_W<'a> { + w: &'a mut W, +} +impl<'a> SR31_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR31_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No write access occurred in this subregion"] + #[inline(always)] + pub fn no_access(self) -> &'a mut W { + self.variant(SR31_A::NOACCESS) + } + #[doc = "Write access(es) occurred in this subregion"] + #[inline(always)] + pub fn access(self) -> &'a mut W { + self.variant(SR31_A::ACCESS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bit 0 - Subregion 0 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr0(&self) -> SR0_R { + SR0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Subregion 1 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr1(&self) -> SR1_R { + SR1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Subregion 2 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr2(&self) -> SR2_R { + SR2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Subregion 3 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr3(&self) -> SR3_R { + SR3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Subregion 4 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr4(&self) -> SR4_R { + SR4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Subregion 5 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr5(&self) -> SR5_R { + SR5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Subregion 6 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr6(&self) -> SR6_R { + SR6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Subregion 7 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr7(&self) -> SR7_R { + SR7_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Subregion 8 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr8(&self) -> SR8_R { + SR8_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Subregion 9 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr9(&self) -> SR9_R { + SR9_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Subregion 10 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr10(&self) -> SR10_R { + SR10_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Subregion 11 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr11(&self) -> SR11_R { + SR11_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Subregion 12 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr12(&self) -> SR12_R { + SR12_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Subregion 13 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr13(&self) -> SR13_R { + SR13_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Subregion 14 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr14(&self) -> SR14_R { + SR14_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Subregion 15 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr15(&self) -> SR15_R { + SR15_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Subregion 16 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr16(&self) -> SR16_R { + SR16_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Subregion 17 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr17(&self) -> SR17_R { + SR17_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Subregion 18 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr18(&self) -> SR18_R { + SR18_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Subregion 19 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr19(&self) -> SR19_R { + SR19_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Subregion 20 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr20(&self) -> SR20_R { + SR20_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 21 - Subregion 21 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr21(&self) -> SR21_R { + SR21_R::new(((self.bits >> 21) & 0x01) != 0) + } + #[doc = "Bit 22 - Subregion 22 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr22(&self) -> SR22_R { + SR22_R::new(((self.bits >> 22) & 0x01) != 0) + } + #[doc = "Bit 23 - Subregion 23 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr23(&self) -> SR23_R { + SR23_R::new(((self.bits >> 23) & 0x01) != 0) + } + #[doc = "Bit 24 - Subregion 24 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr24(&self) -> SR24_R { + SR24_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Subregion 25 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr25(&self) -> SR25_R { + SR25_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Subregion 26 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr26(&self) -> SR26_R { + SR26_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Subregion 27 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr27(&self) -> SR27_R { + SR27_R::new(((self.bits >> 27) & 0x01) != 0) + } + #[doc = "Bit 28 - Subregion 28 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr28(&self) -> SR28_R { + SR28_R::new(((self.bits >> 28) & 0x01) != 0) + } + #[doc = "Bit 29 - Subregion 29 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr29(&self) -> SR29_R { + SR29_R::new(((self.bits >> 29) & 0x01) != 0) + } + #[doc = "Bit 30 - Subregion 30 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr30(&self) -> SR30_R { + SR30_R::new(((self.bits >> 30) & 0x01) != 0) + } + #[doc = "Bit 31 - Subregion 31 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr31(&self) -> SR31_R { + SR31_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Subregion 0 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr0(&mut self) -> SR0_W { + SR0_W { w: self } + } + #[doc = "Bit 1 - Subregion 1 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr1(&mut self) -> SR1_W { + SR1_W { w: self } + } + #[doc = "Bit 2 - Subregion 2 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr2(&mut self) -> SR2_W { + SR2_W { w: self } + } + #[doc = "Bit 3 - Subregion 3 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr3(&mut self) -> SR3_W { + SR3_W { w: self } + } + #[doc = "Bit 4 - Subregion 4 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr4(&mut self) -> SR4_W { + SR4_W { w: self } + } + #[doc = "Bit 5 - Subregion 5 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr5(&mut self) -> SR5_W { + SR5_W { w: self } + } + #[doc = "Bit 6 - Subregion 6 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr6(&mut self) -> SR6_W { + SR6_W { w: self } + } + #[doc = "Bit 7 - Subregion 7 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr7(&mut self) -> SR7_W { + SR7_W { w: self } + } + #[doc = "Bit 8 - Subregion 8 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr8(&mut self) -> SR8_W { + SR8_W { w: self } + } + #[doc = "Bit 9 - Subregion 9 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr9(&mut self) -> SR9_W { + SR9_W { w: self } + } + #[doc = "Bit 10 - Subregion 10 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr10(&mut self) -> SR10_W { + SR10_W { w: self } + } + #[doc = "Bit 11 - Subregion 11 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr11(&mut self) -> SR11_W { + SR11_W { w: self } + } + #[doc = "Bit 12 - Subregion 12 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr12(&mut self) -> SR12_W { + SR12_W { w: self } + } + #[doc = "Bit 13 - Subregion 13 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr13(&mut self) -> SR13_W { + SR13_W { w: self } + } + #[doc = "Bit 14 - Subregion 14 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr14(&mut self) -> SR14_W { + SR14_W { w: self } + } + #[doc = "Bit 15 - Subregion 15 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr15(&mut self) -> SR15_W { + SR15_W { w: self } + } + #[doc = "Bit 16 - Subregion 16 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr16(&mut self) -> SR16_W { + SR16_W { w: self } + } + #[doc = "Bit 17 - Subregion 17 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr17(&mut self) -> SR17_W { + SR17_W { w: self } + } + #[doc = "Bit 18 - Subregion 18 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr18(&mut self) -> SR18_W { + SR18_W { w: self } + } + #[doc = "Bit 19 - Subregion 19 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr19(&mut self) -> SR19_W { + SR19_W { w: self } + } + #[doc = "Bit 20 - Subregion 20 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr20(&mut self) -> SR20_W { + SR20_W { w: self } + } + #[doc = "Bit 21 - Subregion 21 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr21(&mut self) -> SR21_W { + SR21_W { w: self } + } + #[doc = "Bit 22 - Subregion 22 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr22(&mut self) -> SR22_W { + SR22_W { w: self } + } + #[doc = "Bit 23 - Subregion 23 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr23(&mut self) -> SR23_W { + SR23_W { w: self } + } + #[doc = "Bit 24 - Subregion 24 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr24(&mut self) -> SR24_W { + SR24_W { w: self } + } + #[doc = "Bit 25 - Subregion 25 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr25(&mut self) -> SR25_W { + SR25_W { w: self } + } + #[doc = "Bit 26 - Subregion 26 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr26(&mut self) -> SR26_W { + SR26_W { w: self } + } + #[doc = "Bit 27 - Subregion 27 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr27(&mut self) -> SR27_W { + SR27_W { w: self } + } + #[doc = "Bit 28 - Subregion 28 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr28(&mut self) -> SR28_W { + SR28_W { w: self } + } + #[doc = "Bit 29 - Subregion 29 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr29(&mut self) -> SR29_W { + SR29_W { w: self } + } + #[doc = "Bit 30 - Subregion 30 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr30(&mut self) -> SR30_W { + SR30_W { w: self } + } + #[doc = "Bit 31 - Subregion 31 in region 0 (write '1' to clear)"] + #[inline(always)] + pub fn sr31(&mut self) -> SR31_W { + SR31_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description cluster\\[0\\]: Source of event/interrupt in region 0, write access detected while corresponding subregion was enabled for watching\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [substatwa](index.html) module"] +pub struct SUBSTATWA_SPEC; +impl crate::RegisterSpec for SUBSTATWA_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [substatwa::R](R) reader structure"] +impl crate::Readable for SUBSTATWA_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [substatwa::W](W) writer structure"] +impl crate::Writable for SUBSTATWA_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SUBSTATWA to value 0"] +impl crate::Resettable for SUBSTATWA_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mwu/pregion.rs b/src/mwu/pregion.rs new file mode 100644 index 0000000..d6a30e1 --- /dev/null +++ b/src/mwu/pregion.rs @@ -0,0 +1,12 @@ +#[doc = "START register accessor: an alias for `Reg`"] +pub type START = crate::Reg; +#[doc = "Description cluster\\[0\\]: Reserved for future use"] +pub mod start; +#[doc = "END register accessor: an alias for `Reg`"] +pub type END = crate::Reg; +#[doc = "Description cluster\\[0\\]: Reserved for future use"] +pub mod end; +#[doc = "SUBS register accessor: an alias for `Reg`"] +pub type SUBS = crate::Reg; +#[doc = "Description cluster\\[0\\]: Subregions of region 0"] +pub mod subs; diff --git a/src/mwu/pregion/end.rs b/src/mwu/pregion/end.rs new file mode 100644 index 0000000..06860bf --- /dev/null +++ b/src/mwu/pregion/end.rs @@ -0,0 +1,52 @@ +#[doc = "Register `END` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `END` reader - Reserved for future use"] +pub struct END_R(crate::FieldReader); +impl END_R { + pub(crate) fn new(bits: u32) -> Self { + END_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for END_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:31 - Reserved for future use"] + #[inline(always)] + pub fn end(&self) -> END_R { + END_R::new((self.bits & 0xffff_ffff) as u32) + } +} +#[doc = "Description cluster\\[0\\]: Reserved for future use\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 [end](index.html) module"] +pub struct END_SPEC; +impl crate::RegisterSpec for END_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [end::R](R) reader structure"] +impl crate::Readable for END_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets END to value 0"] +impl crate::Resettable for END_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mwu/pregion/start.rs b/src/mwu/pregion/start.rs new file mode 100644 index 0000000..ae1e1b0 --- /dev/null +++ b/src/mwu/pregion/start.rs @@ -0,0 +1,52 @@ +#[doc = "Register `START` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `START` reader - Reserved for future use"] +pub struct START_R(crate::FieldReader); +impl START_R { + pub(crate) fn new(bits: u32) -> Self { + START_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for START_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:31 - Reserved for future use"] + #[inline(always)] + pub fn start(&self) -> START_R { + START_R::new((self.bits & 0xffff_ffff) as u32) + } +} +#[doc = "Description cluster\\[0\\]: Reserved for future use\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 [start](index.html) module"] +pub struct START_SPEC; +impl crate::RegisterSpec for START_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [start::R](R) reader structure"] +impl crate::Readable for START_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets START to value 0"] +impl crate::Resettable for START_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mwu/pregion/subs.rs b/src/mwu/pregion/subs.rs new file mode 100644 index 0000000..063276d --- /dev/null +++ b/src/mwu/pregion/subs.rs @@ -0,0 +1,3042 @@ +#[doc = "Register `SUBS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SUBS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Include or exclude subregion 0 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR0_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR0` reader - Include or exclude subregion 0 in region"] +pub struct SR0_R(crate::FieldReader); +impl SR0_R { + pub(crate) fn new(bits: bool) -> Self { + SR0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR0_A { + match self.bits { + false => SR0_A::EXCLUDE, + true => SR0_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR0_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR0_A::INCLUDE + } +} +impl core::ops::Deref for SR0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR0` writer - Include or exclude subregion 0 in region"] +pub struct SR0_W<'a> { + w: &'a mut W, +} +impl<'a> SR0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR0_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR0_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR0_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Include or exclude subregion 1 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR1_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR1` reader - Include or exclude subregion 1 in region"] +pub struct SR1_R(crate::FieldReader); +impl SR1_R { + pub(crate) fn new(bits: bool) -> Self { + SR1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR1_A { + match self.bits { + false => SR1_A::EXCLUDE, + true => SR1_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR1_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR1_A::INCLUDE + } +} +impl core::ops::Deref for SR1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR1` writer - Include or exclude subregion 1 in region"] +pub struct SR1_W<'a> { + w: &'a mut W, +} +impl<'a> SR1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR1_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR1_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR1_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Include or exclude subregion 2 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR2_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR2` reader - Include or exclude subregion 2 in region"] +pub struct SR2_R(crate::FieldReader); +impl SR2_R { + pub(crate) fn new(bits: bool) -> Self { + SR2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR2_A { + match self.bits { + false => SR2_A::EXCLUDE, + true => SR2_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR2_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR2_A::INCLUDE + } +} +impl core::ops::Deref for SR2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR2` writer - Include or exclude subregion 2 in region"] +pub struct SR2_W<'a> { + w: &'a mut W, +} +impl<'a> SR2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR2_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR2_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR2_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Include or exclude subregion 3 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR3_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR3` reader - Include or exclude subregion 3 in region"] +pub struct SR3_R(crate::FieldReader); +impl SR3_R { + pub(crate) fn new(bits: bool) -> Self { + SR3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR3_A { + match self.bits { + false => SR3_A::EXCLUDE, + true => SR3_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR3_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR3_A::INCLUDE + } +} +impl core::ops::Deref for SR3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR3` writer - Include or exclude subregion 3 in region"] +pub struct SR3_W<'a> { + w: &'a mut W, +} +impl<'a> SR3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR3_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR3_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR3_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Include or exclude subregion 4 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR4_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR4_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR4` reader - Include or exclude subregion 4 in region"] +pub struct SR4_R(crate::FieldReader); +impl SR4_R { + pub(crate) fn new(bits: bool) -> Self { + SR4_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR4_A { + match self.bits { + false => SR4_A::EXCLUDE, + true => SR4_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR4_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR4_A::INCLUDE + } +} +impl core::ops::Deref for SR4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR4` writer - Include or exclude subregion 4 in region"] +pub struct SR4_W<'a> { + w: &'a mut W, +} +impl<'a> SR4_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR4_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR4_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR4_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Include or exclude subregion 5 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR5_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR5_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR5` reader - Include or exclude subregion 5 in region"] +pub struct SR5_R(crate::FieldReader); +impl SR5_R { + pub(crate) fn new(bits: bool) -> Self { + SR5_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR5_A { + match self.bits { + false => SR5_A::EXCLUDE, + true => SR5_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR5_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR5_A::INCLUDE + } +} +impl core::ops::Deref for SR5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR5` writer - Include or exclude subregion 5 in region"] +pub struct SR5_W<'a> { + w: &'a mut W, +} +impl<'a> SR5_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR5_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR5_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR5_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Include or exclude subregion 6 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR6_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR6_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR6` reader - Include or exclude subregion 6 in region"] +pub struct SR6_R(crate::FieldReader); +impl SR6_R { + pub(crate) fn new(bits: bool) -> Self { + SR6_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR6_A { + match self.bits { + false => SR6_A::EXCLUDE, + true => SR6_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR6_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR6_A::INCLUDE + } +} +impl core::ops::Deref for SR6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR6` writer - Include or exclude subregion 6 in region"] +pub struct SR6_W<'a> { + w: &'a mut W, +} +impl<'a> SR6_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR6_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR6_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR6_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Include or exclude subregion 7 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR7_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR7_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR7` reader - Include or exclude subregion 7 in region"] +pub struct SR7_R(crate::FieldReader); +impl SR7_R { + pub(crate) fn new(bits: bool) -> Self { + SR7_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR7_A { + match self.bits { + false => SR7_A::EXCLUDE, + true => SR7_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR7_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR7_A::INCLUDE + } +} +impl core::ops::Deref for SR7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR7` writer - Include or exclude subregion 7 in region"] +pub struct SR7_W<'a> { + w: &'a mut W, +} +impl<'a> SR7_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR7_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR7_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR7_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Include or exclude subregion 8 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR8_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR8_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR8` reader - Include or exclude subregion 8 in region"] +pub struct SR8_R(crate::FieldReader); +impl SR8_R { + pub(crate) fn new(bits: bool) -> Self { + SR8_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR8_A { + match self.bits { + false => SR8_A::EXCLUDE, + true => SR8_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR8_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR8_A::INCLUDE + } +} +impl core::ops::Deref for SR8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR8` writer - Include or exclude subregion 8 in region"] +pub struct SR8_W<'a> { + w: &'a mut W, +} +impl<'a> SR8_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR8_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR8_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR8_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Include or exclude subregion 9 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR9_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR9_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR9` reader - Include or exclude subregion 9 in region"] +pub struct SR9_R(crate::FieldReader); +impl SR9_R { + pub(crate) fn new(bits: bool) -> Self { + SR9_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR9_A { + match self.bits { + false => SR9_A::EXCLUDE, + true => SR9_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR9_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR9_A::INCLUDE + } +} +impl core::ops::Deref for SR9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR9` writer - Include or exclude subregion 9 in region"] +pub struct SR9_W<'a> { + w: &'a mut W, +} +impl<'a> SR9_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR9_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR9_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR9_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Include or exclude subregion 10 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR10_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR10_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR10` reader - Include or exclude subregion 10 in region"] +pub struct SR10_R(crate::FieldReader); +impl SR10_R { + pub(crate) fn new(bits: bool) -> Self { + SR10_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR10_A { + match self.bits { + false => SR10_A::EXCLUDE, + true => SR10_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR10_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR10_A::INCLUDE + } +} +impl core::ops::Deref for SR10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR10` writer - Include or exclude subregion 10 in region"] +pub struct SR10_W<'a> { + w: &'a mut W, +} +impl<'a> SR10_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR10_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR10_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR10_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Include or exclude subregion 11 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR11_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR11_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR11` reader - Include or exclude subregion 11 in region"] +pub struct SR11_R(crate::FieldReader); +impl SR11_R { + pub(crate) fn new(bits: bool) -> Self { + SR11_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR11_A { + match self.bits { + false => SR11_A::EXCLUDE, + true => SR11_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR11_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR11_A::INCLUDE + } +} +impl core::ops::Deref for SR11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR11` writer - Include or exclude subregion 11 in region"] +pub struct SR11_W<'a> { + w: &'a mut W, +} +impl<'a> SR11_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR11_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR11_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR11_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Include or exclude subregion 12 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR12_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR12_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR12` reader - Include or exclude subregion 12 in region"] +pub struct SR12_R(crate::FieldReader); +impl SR12_R { + pub(crate) fn new(bits: bool) -> Self { + SR12_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR12_A { + match self.bits { + false => SR12_A::EXCLUDE, + true => SR12_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR12_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR12_A::INCLUDE + } +} +impl core::ops::Deref for SR12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR12` writer - Include or exclude subregion 12 in region"] +pub struct SR12_W<'a> { + w: &'a mut W, +} +impl<'a> SR12_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR12_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR12_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR12_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Include or exclude subregion 13 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR13_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR13_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR13` reader - Include or exclude subregion 13 in region"] +pub struct SR13_R(crate::FieldReader); +impl SR13_R { + pub(crate) fn new(bits: bool) -> Self { + SR13_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR13_A { + match self.bits { + false => SR13_A::EXCLUDE, + true => SR13_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR13_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR13_A::INCLUDE + } +} +impl core::ops::Deref for SR13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR13` writer - Include or exclude subregion 13 in region"] +pub struct SR13_W<'a> { + w: &'a mut W, +} +impl<'a> SR13_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR13_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR13_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR13_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Include or exclude subregion 14 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR14_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR14_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR14` reader - Include or exclude subregion 14 in region"] +pub struct SR14_R(crate::FieldReader); +impl SR14_R { + pub(crate) fn new(bits: bool) -> Self { + SR14_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR14_A { + match self.bits { + false => SR14_A::EXCLUDE, + true => SR14_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR14_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR14_A::INCLUDE + } +} +impl core::ops::Deref for SR14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR14` writer - Include or exclude subregion 14 in region"] +pub struct SR14_W<'a> { + w: &'a mut W, +} +impl<'a> SR14_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR14_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR14_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR14_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Include or exclude subregion 15 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR15_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR15_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR15` reader - Include or exclude subregion 15 in region"] +pub struct SR15_R(crate::FieldReader); +impl SR15_R { + pub(crate) fn new(bits: bool) -> Self { + SR15_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR15_A { + match self.bits { + false => SR15_A::EXCLUDE, + true => SR15_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR15_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR15_A::INCLUDE + } +} +impl core::ops::Deref for SR15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR15` writer - Include or exclude subregion 15 in region"] +pub struct SR15_W<'a> { + w: &'a mut W, +} +impl<'a> SR15_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR15_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR15_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR15_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Include or exclude subregion 16 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR16_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR16_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR16` reader - Include or exclude subregion 16 in region"] +pub struct SR16_R(crate::FieldReader); +impl SR16_R { + pub(crate) fn new(bits: bool) -> Self { + SR16_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR16_A { + match self.bits { + false => SR16_A::EXCLUDE, + true => SR16_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR16_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR16_A::INCLUDE + } +} +impl core::ops::Deref for SR16_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR16` writer - Include or exclude subregion 16 in region"] +pub struct SR16_W<'a> { + w: &'a mut W, +} +impl<'a> SR16_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR16_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR16_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR16_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Include or exclude subregion 17 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR17_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR17_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR17` reader - Include or exclude subregion 17 in region"] +pub struct SR17_R(crate::FieldReader); +impl SR17_R { + pub(crate) fn new(bits: bool) -> Self { + SR17_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR17_A { + match self.bits { + false => SR17_A::EXCLUDE, + true => SR17_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR17_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR17_A::INCLUDE + } +} +impl core::ops::Deref for SR17_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR17` writer - Include or exclude subregion 17 in region"] +pub struct SR17_W<'a> { + w: &'a mut W, +} +impl<'a> SR17_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR17_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR17_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR17_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Include or exclude subregion 18 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR18_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR18_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR18` reader - Include or exclude subregion 18 in region"] +pub struct SR18_R(crate::FieldReader); +impl SR18_R { + pub(crate) fn new(bits: bool) -> Self { + SR18_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR18_A { + match self.bits { + false => SR18_A::EXCLUDE, + true => SR18_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR18_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR18_A::INCLUDE + } +} +impl core::ops::Deref for SR18_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR18` writer - Include or exclude subregion 18 in region"] +pub struct SR18_W<'a> { + w: &'a mut W, +} +impl<'a> SR18_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR18_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR18_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR18_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Include or exclude subregion 19 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR19_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR19_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR19` reader - Include or exclude subregion 19 in region"] +pub struct SR19_R(crate::FieldReader); +impl SR19_R { + pub(crate) fn new(bits: bool) -> Self { + SR19_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR19_A { + match self.bits { + false => SR19_A::EXCLUDE, + true => SR19_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR19_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR19_A::INCLUDE + } +} +impl core::ops::Deref for SR19_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR19` writer - Include or exclude subregion 19 in region"] +pub struct SR19_W<'a> { + w: &'a mut W, +} +impl<'a> SR19_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR19_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR19_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR19_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Include or exclude subregion 20 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR20_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR20_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR20` reader - Include or exclude subregion 20 in region"] +pub struct SR20_R(crate::FieldReader); +impl SR20_R { + pub(crate) fn new(bits: bool) -> Self { + SR20_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR20_A { + match self.bits { + false => SR20_A::EXCLUDE, + true => SR20_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR20_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR20_A::INCLUDE + } +} +impl core::ops::Deref for SR20_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR20` writer - Include or exclude subregion 20 in region"] +pub struct SR20_W<'a> { + w: &'a mut W, +} +impl<'a> SR20_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR20_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR20_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR20_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Include or exclude subregion 21 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR21_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR21_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR21` reader - Include or exclude subregion 21 in region"] +pub struct SR21_R(crate::FieldReader); +impl SR21_R { + pub(crate) fn new(bits: bool) -> Self { + SR21_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR21_A { + match self.bits { + false => SR21_A::EXCLUDE, + true => SR21_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR21_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR21_A::INCLUDE + } +} +impl core::ops::Deref for SR21_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR21` writer - Include or exclude subregion 21 in region"] +pub struct SR21_W<'a> { + w: &'a mut W, +} +impl<'a> SR21_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR21_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR21_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR21_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); + self.w + } +} +#[doc = "Include or exclude subregion 22 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR22_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR22_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR22` reader - Include or exclude subregion 22 in region"] +pub struct SR22_R(crate::FieldReader); +impl SR22_R { + pub(crate) fn new(bits: bool) -> Self { + SR22_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR22_A { + match self.bits { + false => SR22_A::EXCLUDE, + true => SR22_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR22_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR22_A::INCLUDE + } +} +impl core::ops::Deref for SR22_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR22` writer - Include or exclude subregion 22 in region"] +pub struct SR22_W<'a> { + w: &'a mut W, +} +impl<'a> SR22_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR22_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR22_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR22_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); + self.w + } +} +#[doc = "Include or exclude subregion 23 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR23_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR23_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR23` reader - Include or exclude subregion 23 in region"] +pub struct SR23_R(crate::FieldReader); +impl SR23_R { + pub(crate) fn new(bits: bool) -> Self { + SR23_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR23_A { + match self.bits { + false => SR23_A::EXCLUDE, + true => SR23_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR23_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR23_A::INCLUDE + } +} +impl core::ops::Deref for SR23_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR23` writer - Include or exclude subregion 23 in region"] +pub struct SR23_W<'a> { + w: &'a mut W, +} +impl<'a> SR23_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR23_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR23_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR23_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); + self.w + } +} +#[doc = "Include or exclude subregion 24 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR24_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR24_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR24` reader - Include or exclude subregion 24 in region"] +pub struct SR24_R(crate::FieldReader); +impl SR24_R { + pub(crate) fn new(bits: bool) -> Self { + SR24_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR24_A { + match self.bits { + false => SR24_A::EXCLUDE, + true => SR24_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR24_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR24_A::INCLUDE + } +} +impl core::ops::Deref for SR24_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR24` writer - Include or exclude subregion 24 in region"] +pub struct SR24_W<'a> { + w: &'a mut W, +} +impl<'a> SR24_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR24_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR24_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR24_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Include or exclude subregion 25 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR25_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR25_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR25` reader - Include or exclude subregion 25 in region"] +pub struct SR25_R(crate::FieldReader); +impl SR25_R { + pub(crate) fn new(bits: bool) -> Self { + SR25_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR25_A { + match self.bits { + false => SR25_A::EXCLUDE, + true => SR25_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR25_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR25_A::INCLUDE + } +} +impl core::ops::Deref for SR25_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR25` writer - Include or exclude subregion 25 in region"] +pub struct SR25_W<'a> { + w: &'a mut W, +} +impl<'a> SR25_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR25_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR25_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR25_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Include or exclude subregion 26 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR26_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR26_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR26` reader - Include or exclude subregion 26 in region"] +pub struct SR26_R(crate::FieldReader); +impl SR26_R { + pub(crate) fn new(bits: bool) -> Self { + SR26_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR26_A { + match self.bits { + false => SR26_A::EXCLUDE, + true => SR26_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR26_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR26_A::INCLUDE + } +} +impl core::ops::Deref for SR26_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR26` writer - Include or exclude subregion 26 in region"] +pub struct SR26_W<'a> { + w: &'a mut W, +} +impl<'a> SR26_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR26_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR26_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR26_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Include or exclude subregion 27 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR27_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR27_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR27` reader - Include or exclude subregion 27 in region"] +pub struct SR27_R(crate::FieldReader); +impl SR27_R { + pub(crate) fn new(bits: bool) -> Self { + SR27_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR27_A { + match self.bits { + false => SR27_A::EXCLUDE, + true => SR27_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR27_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR27_A::INCLUDE + } +} +impl core::ops::Deref for SR27_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR27` writer - Include or exclude subregion 27 in region"] +pub struct SR27_W<'a> { + w: &'a mut W, +} +impl<'a> SR27_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR27_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR27_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR27_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +#[doc = "Include or exclude subregion 28 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR28_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR28_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR28` reader - Include or exclude subregion 28 in region"] +pub struct SR28_R(crate::FieldReader); +impl SR28_R { + pub(crate) fn new(bits: bool) -> Self { + SR28_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR28_A { + match self.bits { + false => SR28_A::EXCLUDE, + true => SR28_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR28_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR28_A::INCLUDE + } +} +impl core::ops::Deref for SR28_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR28` writer - Include or exclude subregion 28 in region"] +pub struct SR28_W<'a> { + w: &'a mut W, +} +impl<'a> SR28_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR28_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR28_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR28_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); + self.w + } +} +#[doc = "Include or exclude subregion 29 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR29_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR29_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR29` reader - Include or exclude subregion 29 in region"] +pub struct SR29_R(crate::FieldReader); +impl SR29_R { + pub(crate) fn new(bits: bool) -> Self { + SR29_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR29_A { + match self.bits { + false => SR29_A::EXCLUDE, + true => SR29_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR29_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR29_A::INCLUDE + } +} +impl core::ops::Deref for SR29_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR29` writer - Include or exclude subregion 29 in region"] +pub struct SR29_W<'a> { + w: &'a mut W, +} +impl<'a> SR29_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR29_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR29_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR29_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); + self.w + } +} +#[doc = "Include or exclude subregion 30 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR30_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR30_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR30` reader - Include or exclude subregion 30 in region"] +pub struct SR30_R(crate::FieldReader); +impl SR30_R { + pub(crate) fn new(bits: bool) -> Self { + SR30_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR30_A { + match self.bits { + false => SR30_A::EXCLUDE, + true => SR30_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR30_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR30_A::INCLUDE + } +} +impl core::ops::Deref for SR30_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR30` writer - Include or exclude subregion 30 in region"] +pub struct SR30_W<'a> { + w: &'a mut W, +} +impl<'a> SR30_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR30_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR30_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR30_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); + self.w + } +} +#[doc = "Include or exclude subregion 31 in region\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SR31_A { + #[doc = "0: Exclude"] + EXCLUDE = 0, + #[doc = "1: Include"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SR31_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SR31` reader - Include or exclude subregion 31 in region"] +pub struct SR31_R(crate::FieldReader); +impl SR31_R { + pub(crate) fn new(bits: bool) -> Self { + SR31_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SR31_A { + match self.bits { + false => SR31_A::EXCLUDE, + true => SR31_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `EXCLUDE`"] + #[inline(always)] + pub fn is_exclude(&self) -> bool { + **self == SR31_A::EXCLUDE + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SR31_A::INCLUDE + } +} +impl core::ops::Deref for SR31_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SR31` writer - Include or exclude subregion 31 in region"] +pub struct SR31_W<'a> { + w: &'a mut W, +} +impl<'a> SR31_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SR31_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn exclude(self) -> &'a mut W { + self.variant(SR31_A::EXCLUDE) + } + #[doc = "Include"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SR31_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bit 0 - Include or exclude subregion 0 in region"] + #[inline(always)] + pub fn sr0(&self) -> SR0_R { + SR0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Include or exclude subregion 1 in region"] + #[inline(always)] + pub fn sr1(&self) -> SR1_R { + SR1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Include or exclude subregion 2 in region"] + #[inline(always)] + pub fn sr2(&self) -> SR2_R { + SR2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Include or exclude subregion 3 in region"] + #[inline(always)] + pub fn sr3(&self) -> SR3_R { + SR3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Include or exclude subregion 4 in region"] + #[inline(always)] + pub fn sr4(&self) -> SR4_R { + SR4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Include or exclude subregion 5 in region"] + #[inline(always)] + pub fn sr5(&self) -> SR5_R { + SR5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Include or exclude subregion 6 in region"] + #[inline(always)] + pub fn sr6(&self) -> SR6_R { + SR6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Include or exclude subregion 7 in region"] + #[inline(always)] + pub fn sr7(&self) -> SR7_R { + SR7_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Include or exclude subregion 8 in region"] + #[inline(always)] + pub fn sr8(&self) -> SR8_R { + SR8_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Include or exclude subregion 9 in region"] + #[inline(always)] + pub fn sr9(&self) -> SR9_R { + SR9_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Include or exclude subregion 10 in region"] + #[inline(always)] + pub fn sr10(&self) -> SR10_R { + SR10_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Include or exclude subregion 11 in region"] + #[inline(always)] + pub fn sr11(&self) -> SR11_R { + SR11_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Include or exclude subregion 12 in region"] + #[inline(always)] + pub fn sr12(&self) -> SR12_R { + SR12_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Include or exclude subregion 13 in region"] + #[inline(always)] + pub fn sr13(&self) -> SR13_R { + SR13_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Include or exclude subregion 14 in region"] + #[inline(always)] + pub fn sr14(&self) -> SR14_R { + SR14_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Include or exclude subregion 15 in region"] + #[inline(always)] + pub fn sr15(&self) -> SR15_R { + SR15_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Include or exclude subregion 16 in region"] + #[inline(always)] + pub fn sr16(&self) -> SR16_R { + SR16_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Include or exclude subregion 17 in region"] + #[inline(always)] + pub fn sr17(&self) -> SR17_R { + SR17_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Include or exclude subregion 18 in region"] + #[inline(always)] + pub fn sr18(&self) -> SR18_R { + SR18_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Include or exclude subregion 19 in region"] + #[inline(always)] + pub fn sr19(&self) -> SR19_R { + SR19_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Include or exclude subregion 20 in region"] + #[inline(always)] + pub fn sr20(&self) -> SR20_R { + SR20_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 21 - Include or exclude subregion 21 in region"] + #[inline(always)] + pub fn sr21(&self) -> SR21_R { + SR21_R::new(((self.bits >> 21) & 0x01) != 0) + } + #[doc = "Bit 22 - Include or exclude subregion 22 in region"] + #[inline(always)] + pub fn sr22(&self) -> SR22_R { + SR22_R::new(((self.bits >> 22) & 0x01) != 0) + } + #[doc = "Bit 23 - Include or exclude subregion 23 in region"] + #[inline(always)] + pub fn sr23(&self) -> SR23_R { + SR23_R::new(((self.bits >> 23) & 0x01) != 0) + } + #[doc = "Bit 24 - Include or exclude subregion 24 in region"] + #[inline(always)] + pub fn sr24(&self) -> SR24_R { + SR24_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Include or exclude subregion 25 in region"] + #[inline(always)] + pub fn sr25(&self) -> SR25_R { + SR25_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Include or exclude subregion 26 in region"] + #[inline(always)] + pub fn sr26(&self) -> SR26_R { + SR26_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Include or exclude subregion 27 in region"] + #[inline(always)] + pub fn sr27(&self) -> SR27_R { + SR27_R::new(((self.bits >> 27) & 0x01) != 0) + } + #[doc = "Bit 28 - Include or exclude subregion 28 in region"] + #[inline(always)] + pub fn sr28(&self) -> SR28_R { + SR28_R::new(((self.bits >> 28) & 0x01) != 0) + } + #[doc = "Bit 29 - Include or exclude subregion 29 in region"] + #[inline(always)] + pub fn sr29(&self) -> SR29_R { + SR29_R::new(((self.bits >> 29) & 0x01) != 0) + } + #[doc = "Bit 30 - Include or exclude subregion 30 in region"] + #[inline(always)] + pub fn sr30(&self) -> SR30_R { + SR30_R::new(((self.bits >> 30) & 0x01) != 0) + } + #[doc = "Bit 31 - Include or exclude subregion 31 in region"] + #[inline(always)] + pub fn sr31(&self) -> SR31_R { + SR31_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Include or exclude subregion 0 in region"] + #[inline(always)] + pub fn sr0(&mut self) -> SR0_W { + SR0_W { w: self } + } + #[doc = "Bit 1 - Include or exclude subregion 1 in region"] + #[inline(always)] + pub fn sr1(&mut self) -> SR1_W { + SR1_W { w: self } + } + #[doc = "Bit 2 - Include or exclude subregion 2 in region"] + #[inline(always)] + pub fn sr2(&mut self) -> SR2_W { + SR2_W { w: self } + } + #[doc = "Bit 3 - Include or exclude subregion 3 in region"] + #[inline(always)] + pub fn sr3(&mut self) -> SR3_W { + SR3_W { w: self } + } + #[doc = "Bit 4 - Include or exclude subregion 4 in region"] + #[inline(always)] + pub fn sr4(&mut self) -> SR4_W { + SR4_W { w: self } + } + #[doc = "Bit 5 - Include or exclude subregion 5 in region"] + #[inline(always)] + pub fn sr5(&mut self) -> SR5_W { + SR5_W { w: self } + } + #[doc = "Bit 6 - Include or exclude subregion 6 in region"] + #[inline(always)] + pub fn sr6(&mut self) -> SR6_W { + SR6_W { w: self } + } + #[doc = "Bit 7 - Include or exclude subregion 7 in region"] + #[inline(always)] + pub fn sr7(&mut self) -> SR7_W { + SR7_W { w: self } + } + #[doc = "Bit 8 - Include or exclude subregion 8 in region"] + #[inline(always)] + pub fn sr8(&mut self) -> SR8_W { + SR8_W { w: self } + } + #[doc = "Bit 9 - Include or exclude subregion 9 in region"] + #[inline(always)] + pub fn sr9(&mut self) -> SR9_W { + SR9_W { w: self } + } + #[doc = "Bit 10 - Include or exclude subregion 10 in region"] + #[inline(always)] + pub fn sr10(&mut self) -> SR10_W { + SR10_W { w: self } + } + #[doc = "Bit 11 - Include or exclude subregion 11 in region"] + #[inline(always)] + pub fn sr11(&mut self) -> SR11_W { + SR11_W { w: self } + } + #[doc = "Bit 12 - Include or exclude subregion 12 in region"] + #[inline(always)] + pub fn sr12(&mut self) -> SR12_W { + SR12_W { w: self } + } + #[doc = "Bit 13 - Include or exclude subregion 13 in region"] + #[inline(always)] + pub fn sr13(&mut self) -> SR13_W { + SR13_W { w: self } + } + #[doc = "Bit 14 - Include or exclude subregion 14 in region"] + #[inline(always)] + pub fn sr14(&mut self) -> SR14_W { + SR14_W { w: self } + } + #[doc = "Bit 15 - Include or exclude subregion 15 in region"] + #[inline(always)] + pub fn sr15(&mut self) -> SR15_W { + SR15_W { w: self } + } + #[doc = "Bit 16 - Include or exclude subregion 16 in region"] + #[inline(always)] + pub fn sr16(&mut self) -> SR16_W { + SR16_W { w: self } + } + #[doc = "Bit 17 - Include or exclude subregion 17 in region"] + #[inline(always)] + pub fn sr17(&mut self) -> SR17_W { + SR17_W { w: self } + } + #[doc = "Bit 18 - Include or exclude subregion 18 in region"] + #[inline(always)] + pub fn sr18(&mut self) -> SR18_W { + SR18_W { w: self } + } + #[doc = "Bit 19 - Include or exclude subregion 19 in region"] + #[inline(always)] + pub fn sr19(&mut self) -> SR19_W { + SR19_W { w: self } + } + #[doc = "Bit 20 - Include or exclude subregion 20 in region"] + #[inline(always)] + pub fn sr20(&mut self) -> SR20_W { + SR20_W { w: self } + } + #[doc = "Bit 21 - Include or exclude subregion 21 in region"] + #[inline(always)] + pub fn sr21(&mut self) -> SR21_W { + SR21_W { w: self } + } + #[doc = "Bit 22 - Include or exclude subregion 22 in region"] + #[inline(always)] + pub fn sr22(&mut self) -> SR22_W { + SR22_W { w: self } + } + #[doc = "Bit 23 - Include or exclude subregion 23 in region"] + #[inline(always)] + pub fn sr23(&mut self) -> SR23_W { + SR23_W { w: self } + } + #[doc = "Bit 24 - Include or exclude subregion 24 in region"] + #[inline(always)] + pub fn sr24(&mut self) -> SR24_W { + SR24_W { w: self } + } + #[doc = "Bit 25 - Include or exclude subregion 25 in region"] + #[inline(always)] + pub fn sr25(&mut self) -> SR25_W { + SR25_W { w: self } + } + #[doc = "Bit 26 - Include or exclude subregion 26 in region"] + #[inline(always)] + pub fn sr26(&mut self) -> SR26_W { + SR26_W { w: self } + } + #[doc = "Bit 27 - Include or exclude subregion 27 in region"] + #[inline(always)] + pub fn sr27(&mut self) -> SR27_W { + SR27_W { w: self } + } + #[doc = "Bit 28 - Include or exclude subregion 28 in region"] + #[inline(always)] + pub fn sr28(&mut self) -> SR28_W { + SR28_W { w: self } + } + #[doc = "Bit 29 - Include or exclude subregion 29 in region"] + #[inline(always)] + pub fn sr29(&mut self) -> SR29_W { + SR29_W { w: self } + } + #[doc = "Bit 30 - Include or exclude subregion 30 in region"] + #[inline(always)] + pub fn sr30(&mut self) -> SR30_W { + SR30_W { w: self } + } + #[doc = "Bit 31 - Include or exclude subregion 31 in region"] + #[inline(always)] + pub fn sr31(&mut self) -> SR31_W { + SR31_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description cluster\\[0\\]: Subregions of region 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [subs](index.html) module"] +pub struct SUBS_SPEC; +impl crate::RegisterSpec for SUBS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [subs::R](R) reader structure"] +impl crate::Readable for SUBS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [subs::W](W) writer structure"] +impl crate::Writable for SUBS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SUBS to value 0"] +impl crate::Resettable for SUBS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mwu/region.rs b/src/mwu/region.rs new file mode 100644 index 0000000..6db1ce2 --- /dev/null +++ b/src/mwu/region.rs @@ -0,0 +1,8 @@ +#[doc = "START register accessor: an alias for `Reg`"] +pub type START = crate::Reg; +#[doc = "Description cluster\\[0\\]: Start address for region 0"] +pub mod start; +#[doc = "END register accessor: an alias for `Reg`"] +pub type END = crate::Reg; +#[doc = "Description cluster\\[0\\]: End address of region 0"] +pub mod end; diff --git a/src/mwu/region/end.rs b/src/mwu/region/end.rs new file mode 100644 index 0000000..895a887 --- /dev/null +++ b/src/mwu/region/end.rs @@ -0,0 +1,102 @@ +#[doc = "Register `END` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `END` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `END` reader - End address of region."] +pub struct END_R(crate::FieldReader); +impl END_R { + pub(crate) fn new(bits: u32) -> Self { + END_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for END_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `END` writer - End address of region."] +pub struct END_W<'a> { + w: &'a mut W, +} +impl<'a> END_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - End address of region."] + #[inline(always)] + pub fn end(&self) -> END_R { + END_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - End address of region."] + #[inline(always)] + pub fn end(&mut self) -> END_W { + END_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description cluster\\[0\\]: End address of region 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [end](index.html) module"] +pub struct END_SPEC; +impl crate::RegisterSpec for END_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [end::R](R) reader structure"] +impl crate::Readable for END_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [end::W](W) writer structure"] +impl crate::Writable for END_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets END to value 0"] +impl crate::Resettable for END_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mwu/region/start.rs b/src/mwu/region/start.rs new file mode 100644 index 0000000..96d1d0c --- /dev/null +++ b/src/mwu/region/start.rs @@ -0,0 +1,102 @@ +#[doc = "Register `START` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `START` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `START` reader - Start address for region"] +pub struct START_R(crate::FieldReader); +impl START_R { + pub(crate) fn new(bits: u32) -> Self { + START_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for START_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `START` writer - Start address for region"] +pub struct START_W<'a> { + w: &'a mut W, +} +impl<'a> START_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Start address for region"] + #[inline(always)] + pub fn start(&self) -> START_R { + START_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Start address for region"] + #[inline(always)] + pub fn start(&mut self) -> START_W { + START_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description cluster\\[0\\]: Start address for region 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [start](index.html) module"] +pub struct START_SPEC; +impl crate::RegisterSpec for START_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [start::R](R) reader structure"] +impl crate::Readable for START_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [start::W](W) writer structure"] +impl crate::Writable for START_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets START to value 0"] +impl crate::Resettable for START_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mwu/regionen.rs b/src/mwu/regionen.rs new file mode 100644 index 0000000..6e4fb7c --- /dev/null +++ b/src/mwu/regionen.rs @@ -0,0 +1,1182 @@ +#[doc = "Register `REGIONEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `REGIONEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable/disable write access watch in region\\[0\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN0WA_A { + #[doc = "0: Disable write access watch in this region"] + DISABLE = 0, + #[doc = "1: Enable write access watch in this region"] + ENABLE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN0WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN0WA` reader - Enable/disable write access watch in region\\[0\\]"] +pub struct RGN0WA_R(crate::FieldReader); +impl RGN0WA_R { + pub(crate) fn new(bits: bool) -> Self { + RGN0WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RGN0WA_A { + match self.bits { + false => RGN0WA_A::DISABLE, + true => RGN0WA_A::ENABLE, + } + } + #[doc = "Checks if the value of the field is `DISABLE`"] + #[inline(always)] + pub fn is_disable(&self) -> bool { + **self == RGN0WA_A::DISABLE + } + #[doc = "Checks if the value of the field is `ENABLE`"] + #[inline(always)] + pub fn is_enable(&self) -> bool { + **self == RGN0WA_A::ENABLE + } +} +impl core::ops::Deref for RGN0WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RGN0WA` writer - Enable/disable write access watch in region\\[0\\]"] +pub struct RGN0WA_W<'a> { + w: &'a mut W, +} +impl<'a> RGN0WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RGN0WA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable write access watch in this region"] + #[inline(always)] + pub fn disable(self) -> &'a mut W { + self.variant(RGN0WA_A::DISABLE) + } + #[doc = "Enable write access watch in this region"] + #[inline(always)] + pub fn enable(self) -> &'a mut W { + self.variant(RGN0WA_A::ENABLE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Enable/disable read access watch in region\\[0\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN0RA_A { + #[doc = "0: Disable read access watch in this region"] + DISABLE = 0, + #[doc = "1: Enable read access watch in this region"] + ENABLE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN0RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN0RA` reader - Enable/disable read access watch in region\\[0\\]"] +pub struct RGN0RA_R(crate::FieldReader); +impl RGN0RA_R { + pub(crate) fn new(bits: bool) -> Self { + RGN0RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RGN0RA_A { + match self.bits { + false => RGN0RA_A::DISABLE, + true => RGN0RA_A::ENABLE, + } + } + #[doc = "Checks if the value of the field is `DISABLE`"] + #[inline(always)] + pub fn is_disable(&self) -> bool { + **self == RGN0RA_A::DISABLE + } + #[doc = "Checks if the value of the field is `ENABLE`"] + #[inline(always)] + pub fn is_enable(&self) -> bool { + **self == RGN0RA_A::ENABLE + } +} +impl core::ops::Deref for RGN0RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RGN0RA` writer - Enable/disable read access watch in region\\[0\\]"] +pub struct RGN0RA_W<'a> { + w: &'a mut W, +} +impl<'a> RGN0RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RGN0RA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable read access watch in this region"] + #[inline(always)] + pub fn disable(self) -> &'a mut W { + self.variant(RGN0RA_A::DISABLE) + } + #[doc = "Enable read access watch in this region"] + #[inline(always)] + pub fn enable(self) -> &'a mut W { + self.variant(RGN0RA_A::ENABLE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Enable/disable write access watch in region\\[1\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN1WA_A { + #[doc = "0: Disable write access watch in this region"] + DISABLE = 0, + #[doc = "1: Enable write access watch in this region"] + ENABLE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN1WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN1WA` reader - Enable/disable write access watch in region\\[1\\]"] +pub struct RGN1WA_R(crate::FieldReader); +impl RGN1WA_R { + pub(crate) fn new(bits: bool) -> Self { + RGN1WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RGN1WA_A { + match self.bits { + false => RGN1WA_A::DISABLE, + true => RGN1WA_A::ENABLE, + } + } + #[doc = "Checks if the value of the field is `DISABLE`"] + #[inline(always)] + pub fn is_disable(&self) -> bool { + **self == RGN1WA_A::DISABLE + } + #[doc = "Checks if the value of the field is `ENABLE`"] + #[inline(always)] + pub fn is_enable(&self) -> bool { + **self == RGN1WA_A::ENABLE + } +} +impl core::ops::Deref for RGN1WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RGN1WA` writer - Enable/disable write access watch in region\\[1\\]"] +pub struct RGN1WA_W<'a> { + w: &'a mut W, +} +impl<'a> RGN1WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RGN1WA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable write access watch in this region"] + #[inline(always)] + pub fn disable(self) -> &'a mut W { + self.variant(RGN1WA_A::DISABLE) + } + #[doc = "Enable write access watch in this region"] + #[inline(always)] + pub fn enable(self) -> &'a mut W { + self.variant(RGN1WA_A::ENABLE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Enable/disable read access watch in region\\[1\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN1RA_A { + #[doc = "0: Disable read access watch in this region"] + DISABLE = 0, + #[doc = "1: Enable read access watch in this region"] + ENABLE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN1RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN1RA` reader - Enable/disable read access watch in region\\[1\\]"] +pub struct RGN1RA_R(crate::FieldReader); +impl RGN1RA_R { + pub(crate) fn new(bits: bool) -> Self { + RGN1RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RGN1RA_A { + match self.bits { + false => RGN1RA_A::DISABLE, + true => RGN1RA_A::ENABLE, + } + } + #[doc = "Checks if the value of the field is `DISABLE`"] + #[inline(always)] + pub fn is_disable(&self) -> bool { + **self == RGN1RA_A::DISABLE + } + #[doc = "Checks if the value of the field is `ENABLE`"] + #[inline(always)] + pub fn is_enable(&self) -> bool { + **self == RGN1RA_A::ENABLE + } +} +impl core::ops::Deref for RGN1RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RGN1RA` writer - Enable/disable read access watch in region\\[1\\]"] +pub struct RGN1RA_W<'a> { + w: &'a mut W, +} +impl<'a> RGN1RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RGN1RA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable read access watch in this region"] + #[inline(always)] + pub fn disable(self) -> &'a mut W { + self.variant(RGN1RA_A::DISABLE) + } + #[doc = "Enable read access watch in this region"] + #[inline(always)] + pub fn enable(self) -> &'a mut W { + self.variant(RGN1RA_A::ENABLE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Enable/disable write access watch in region\\[2\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN2WA_A { + #[doc = "0: Disable write access watch in this region"] + DISABLE = 0, + #[doc = "1: Enable write access watch in this region"] + ENABLE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN2WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN2WA` reader - Enable/disable write access watch in region\\[2\\]"] +pub struct RGN2WA_R(crate::FieldReader); +impl RGN2WA_R { + pub(crate) fn new(bits: bool) -> Self { + RGN2WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RGN2WA_A { + match self.bits { + false => RGN2WA_A::DISABLE, + true => RGN2WA_A::ENABLE, + } + } + #[doc = "Checks if the value of the field is `DISABLE`"] + #[inline(always)] + pub fn is_disable(&self) -> bool { + **self == RGN2WA_A::DISABLE + } + #[doc = "Checks if the value of the field is `ENABLE`"] + #[inline(always)] + pub fn is_enable(&self) -> bool { + **self == RGN2WA_A::ENABLE + } +} +impl core::ops::Deref for RGN2WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RGN2WA` writer - Enable/disable write access watch in region\\[2\\]"] +pub struct RGN2WA_W<'a> { + w: &'a mut W, +} +impl<'a> RGN2WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RGN2WA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable write access watch in this region"] + #[inline(always)] + pub fn disable(self) -> &'a mut W { + self.variant(RGN2WA_A::DISABLE) + } + #[doc = "Enable write access watch in this region"] + #[inline(always)] + pub fn enable(self) -> &'a mut W { + self.variant(RGN2WA_A::ENABLE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Enable/disable read access watch in region\\[2\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN2RA_A { + #[doc = "0: Disable read access watch in this region"] + DISABLE = 0, + #[doc = "1: Enable read access watch in this region"] + ENABLE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN2RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN2RA` reader - Enable/disable read access watch in region\\[2\\]"] +pub struct RGN2RA_R(crate::FieldReader); +impl RGN2RA_R { + pub(crate) fn new(bits: bool) -> Self { + RGN2RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RGN2RA_A { + match self.bits { + false => RGN2RA_A::DISABLE, + true => RGN2RA_A::ENABLE, + } + } + #[doc = "Checks if the value of the field is `DISABLE`"] + #[inline(always)] + pub fn is_disable(&self) -> bool { + **self == RGN2RA_A::DISABLE + } + #[doc = "Checks if the value of the field is `ENABLE`"] + #[inline(always)] + pub fn is_enable(&self) -> bool { + **self == RGN2RA_A::ENABLE + } +} +impl core::ops::Deref for RGN2RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RGN2RA` writer - Enable/disable read access watch in region\\[2\\]"] +pub struct RGN2RA_W<'a> { + w: &'a mut W, +} +impl<'a> RGN2RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RGN2RA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable read access watch in this region"] + #[inline(always)] + pub fn disable(self) -> &'a mut W { + self.variant(RGN2RA_A::DISABLE) + } + #[doc = "Enable read access watch in this region"] + #[inline(always)] + pub fn enable(self) -> &'a mut W { + self.variant(RGN2RA_A::ENABLE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Enable/disable write access watch in region\\[3\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN3WA_A { + #[doc = "0: Disable write access watch in this region"] + DISABLE = 0, + #[doc = "1: Enable write access watch in this region"] + ENABLE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN3WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN3WA` reader - Enable/disable write access watch in region\\[3\\]"] +pub struct RGN3WA_R(crate::FieldReader); +impl RGN3WA_R { + pub(crate) fn new(bits: bool) -> Self { + RGN3WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RGN3WA_A { + match self.bits { + false => RGN3WA_A::DISABLE, + true => RGN3WA_A::ENABLE, + } + } + #[doc = "Checks if the value of the field is `DISABLE`"] + #[inline(always)] + pub fn is_disable(&self) -> bool { + **self == RGN3WA_A::DISABLE + } + #[doc = "Checks if the value of the field is `ENABLE`"] + #[inline(always)] + pub fn is_enable(&self) -> bool { + **self == RGN3WA_A::ENABLE + } +} +impl core::ops::Deref for RGN3WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RGN3WA` writer - Enable/disable write access watch in region\\[3\\]"] +pub struct RGN3WA_W<'a> { + w: &'a mut W, +} +impl<'a> RGN3WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RGN3WA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable write access watch in this region"] + #[inline(always)] + pub fn disable(self) -> &'a mut W { + self.variant(RGN3WA_A::DISABLE) + } + #[doc = "Enable write access watch in this region"] + #[inline(always)] + pub fn enable(self) -> &'a mut W { + self.variant(RGN3WA_A::ENABLE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Enable/disable read access watch in region\\[3\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN3RA_A { + #[doc = "0: Disable read access watch in this region"] + DISABLE = 0, + #[doc = "1: Enable read access watch in this region"] + ENABLE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN3RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN3RA` reader - Enable/disable read access watch in region\\[3\\]"] +pub struct RGN3RA_R(crate::FieldReader); +impl RGN3RA_R { + pub(crate) fn new(bits: bool) -> Self { + RGN3RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RGN3RA_A { + match self.bits { + false => RGN3RA_A::DISABLE, + true => RGN3RA_A::ENABLE, + } + } + #[doc = "Checks if the value of the field is `DISABLE`"] + #[inline(always)] + pub fn is_disable(&self) -> bool { + **self == RGN3RA_A::DISABLE + } + #[doc = "Checks if the value of the field is `ENABLE`"] + #[inline(always)] + pub fn is_enable(&self) -> bool { + **self == RGN3RA_A::ENABLE + } +} +impl core::ops::Deref for RGN3RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RGN3RA` writer - Enable/disable read access watch in region\\[3\\]"] +pub struct RGN3RA_W<'a> { + w: &'a mut W, +} +impl<'a> RGN3RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RGN3RA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable read access watch in this region"] + #[inline(always)] + pub fn disable(self) -> &'a mut W { + self.variant(RGN3RA_A::DISABLE) + } + #[doc = "Enable read access watch in this region"] + #[inline(always)] + pub fn enable(self) -> &'a mut W { + self.variant(RGN3RA_A::ENABLE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Enable/disable write access watch in PREGION\\[0\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PRGN0WA_A { + #[doc = "0: Disable write access watch in this PREGION"] + DISABLE = 0, + #[doc = "1: Enable write access watch in this PREGION"] + ENABLE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PRGN0WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PRGN0WA` reader - Enable/disable write access watch in PREGION\\[0\\]"] +pub struct PRGN0WA_R(crate::FieldReader); +impl PRGN0WA_R { + pub(crate) fn new(bits: bool) -> Self { + PRGN0WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PRGN0WA_A { + match self.bits { + false => PRGN0WA_A::DISABLE, + true => PRGN0WA_A::ENABLE, + } + } + #[doc = "Checks if the value of the field is `DISABLE`"] + #[inline(always)] + pub fn is_disable(&self) -> bool { + **self == PRGN0WA_A::DISABLE + } + #[doc = "Checks if the value of the field is `ENABLE`"] + #[inline(always)] + pub fn is_enable(&self) -> bool { + **self == PRGN0WA_A::ENABLE + } +} +impl core::ops::Deref for PRGN0WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRGN0WA` writer - Enable/disable write access watch in PREGION\\[0\\]"] +pub struct PRGN0WA_W<'a> { + w: &'a mut W, +} +impl<'a> PRGN0WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PRGN0WA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable write access watch in this PREGION"] + #[inline(always)] + pub fn disable(self) -> &'a mut W { + self.variant(PRGN0WA_A::DISABLE) + } + #[doc = "Enable write access watch in this PREGION"] + #[inline(always)] + pub fn enable(self) -> &'a mut W { + self.variant(PRGN0WA_A::ENABLE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Enable/disable read access watch in PREGION\\[0\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PRGN0RA_A { + #[doc = "0: Disable read access watch in this PREGION"] + DISABLE = 0, + #[doc = "1: Enable read access watch in this PREGION"] + ENABLE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PRGN0RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PRGN0RA` reader - Enable/disable read access watch in PREGION\\[0\\]"] +pub struct PRGN0RA_R(crate::FieldReader); +impl PRGN0RA_R { + pub(crate) fn new(bits: bool) -> Self { + PRGN0RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PRGN0RA_A { + match self.bits { + false => PRGN0RA_A::DISABLE, + true => PRGN0RA_A::ENABLE, + } + } + #[doc = "Checks if the value of the field is `DISABLE`"] + #[inline(always)] + pub fn is_disable(&self) -> bool { + **self == PRGN0RA_A::DISABLE + } + #[doc = "Checks if the value of the field is `ENABLE`"] + #[inline(always)] + pub fn is_enable(&self) -> bool { + **self == PRGN0RA_A::ENABLE + } +} +impl core::ops::Deref for PRGN0RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRGN0RA` writer - Enable/disable read access watch in PREGION\\[0\\]"] +pub struct PRGN0RA_W<'a> { + w: &'a mut W, +} +impl<'a> PRGN0RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PRGN0RA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable read access watch in this PREGION"] + #[inline(always)] + pub fn disable(self) -> &'a mut W { + self.variant(PRGN0RA_A::DISABLE) + } + #[doc = "Enable read access watch in this PREGION"] + #[inline(always)] + pub fn enable(self) -> &'a mut W { + self.variant(PRGN0RA_A::ENABLE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Enable/disable write access watch in PREGION\\[1\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PRGN1WA_A { + #[doc = "0: Disable write access watch in this PREGION"] + DISABLE = 0, + #[doc = "1: Enable write access watch in this PREGION"] + ENABLE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PRGN1WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PRGN1WA` reader - Enable/disable write access watch in PREGION\\[1\\]"] +pub struct PRGN1WA_R(crate::FieldReader); +impl PRGN1WA_R { + pub(crate) fn new(bits: bool) -> Self { + PRGN1WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PRGN1WA_A { + match self.bits { + false => PRGN1WA_A::DISABLE, + true => PRGN1WA_A::ENABLE, + } + } + #[doc = "Checks if the value of the field is `DISABLE`"] + #[inline(always)] + pub fn is_disable(&self) -> bool { + **self == PRGN1WA_A::DISABLE + } + #[doc = "Checks if the value of the field is `ENABLE`"] + #[inline(always)] + pub fn is_enable(&self) -> bool { + **self == PRGN1WA_A::ENABLE + } +} +impl core::ops::Deref for PRGN1WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRGN1WA` writer - Enable/disable write access watch in PREGION\\[1\\]"] +pub struct PRGN1WA_W<'a> { + w: &'a mut W, +} +impl<'a> PRGN1WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PRGN1WA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable write access watch in this PREGION"] + #[inline(always)] + pub fn disable(self) -> &'a mut W { + self.variant(PRGN1WA_A::DISABLE) + } + #[doc = "Enable write access watch in this PREGION"] + #[inline(always)] + pub fn enable(self) -> &'a mut W { + self.variant(PRGN1WA_A::ENABLE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Enable/disable read access watch in PREGION\\[1\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PRGN1RA_A { + #[doc = "0: Disable read access watch in this PREGION"] + DISABLE = 0, + #[doc = "1: Enable read access watch in this PREGION"] + ENABLE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PRGN1RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PRGN1RA` reader - Enable/disable read access watch in PREGION\\[1\\]"] +pub struct PRGN1RA_R(crate::FieldReader); +impl PRGN1RA_R { + pub(crate) fn new(bits: bool) -> Self { + PRGN1RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PRGN1RA_A { + match self.bits { + false => PRGN1RA_A::DISABLE, + true => PRGN1RA_A::ENABLE, + } + } + #[doc = "Checks if the value of the field is `DISABLE`"] + #[inline(always)] + pub fn is_disable(&self) -> bool { + **self == PRGN1RA_A::DISABLE + } + #[doc = "Checks if the value of the field is `ENABLE`"] + #[inline(always)] + pub fn is_enable(&self) -> bool { + **self == PRGN1RA_A::ENABLE + } +} +impl core::ops::Deref for PRGN1RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRGN1RA` writer - Enable/disable read access watch in PREGION\\[1\\]"] +pub struct PRGN1RA_W<'a> { + w: &'a mut W, +} +impl<'a> PRGN1RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PRGN1RA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable read access watch in this PREGION"] + #[inline(always)] + pub fn disable(self) -> &'a mut W { + self.variant(PRGN1RA_A::DISABLE) + } + #[doc = "Enable read access watch in this PREGION"] + #[inline(always)] + pub fn enable(self) -> &'a mut W { + self.variant(PRGN1RA_A::ENABLE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable/disable write access watch in region\\[0\\]"] + #[inline(always)] + pub fn rgn0wa(&self) -> RGN0WA_R { + RGN0WA_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Enable/disable read access watch in region\\[0\\]"] + #[inline(always)] + pub fn rgn0ra(&self) -> RGN0RA_R { + RGN0RA_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Enable/disable write access watch in region\\[1\\]"] + #[inline(always)] + pub fn rgn1wa(&self) -> RGN1WA_R { + RGN1WA_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Enable/disable read access watch in region\\[1\\]"] + #[inline(always)] + pub fn rgn1ra(&self) -> RGN1RA_R { + RGN1RA_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Enable/disable write access watch in region\\[2\\]"] + #[inline(always)] + pub fn rgn2wa(&self) -> RGN2WA_R { + RGN2WA_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Enable/disable read access watch in region\\[2\\]"] + #[inline(always)] + pub fn rgn2ra(&self) -> RGN2RA_R { + RGN2RA_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Enable/disable write access watch in region\\[3\\]"] + #[inline(always)] + pub fn rgn3wa(&self) -> RGN3WA_R { + RGN3WA_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Enable/disable read access watch in region\\[3\\]"] + #[inline(always)] + pub fn rgn3ra(&self) -> RGN3RA_R { + RGN3RA_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 24 - Enable/disable write access watch in PREGION\\[0\\]"] + #[inline(always)] + pub fn prgn0wa(&self) -> PRGN0WA_R { + PRGN0WA_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Enable/disable read access watch in PREGION\\[0\\]"] + #[inline(always)] + pub fn prgn0ra(&self) -> PRGN0RA_R { + PRGN0RA_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Enable/disable write access watch in PREGION\\[1\\]"] + #[inline(always)] + pub fn prgn1wa(&self) -> PRGN1WA_R { + PRGN1WA_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Enable/disable read access watch in PREGION\\[1\\]"] + #[inline(always)] + pub fn prgn1ra(&self) -> PRGN1RA_R { + PRGN1RA_R::new(((self.bits >> 27) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Enable/disable write access watch in region\\[0\\]"] + #[inline(always)] + pub fn rgn0wa(&mut self) -> RGN0WA_W { + RGN0WA_W { w: self } + } + #[doc = "Bit 1 - Enable/disable read access watch in region\\[0\\]"] + #[inline(always)] + pub fn rgn0ra(&mut self) -> RGN0RA_W { + RGN0RA_W { w: self } + } + #[doc = "Bit 2 - Enable/disable write access watch in region\\[1\\]"] + #[inline(always)] + pub fn rgn1wa(&mut self) -> RGN1WA_W { + RGN1WA_W { w: self } + } + #[doc = "Bit 3 - Enable/disable read access watch in region\\[1\\]"] + #[inline(always)] + pub fn rgn1ra(&mut self) -> RGN1RA_W { + RGN1RA_W { w: self } + } + #[doc = "Bit 4 - Enable/disable write access watch in region\\[2\\]"] + #[inline(always)] + pub fn rgn2wa(&mut self) -> RGN2WA_W { + RGN2WA_W { w: self } + } + #[doc = "Bit 5 - Enable/disable read access watch in region\\[2\\]"] + #[inline(always)] + pub fn rgn2ra(&mut self) -> RGN2RA_W { + RGN2RA_W { w: self } + } + #[doc = "Bit 6 - Enable/disable write access watch in region\\[3\\]"] + #[inline(always)] + pub fn rgn3wa(&mut self) -> RGN3WA_W { + RGN3WA_W { w: self } + } + #[doc = "Bit 7 - Enable/disable read access watch in region\\[3\\]"] + #[inline(always)] + pub fn rgn3ra(&mut self) -> RGN3RA_W { + RGN3RA_W { w: self } + } + #[doc = "Bit 24 - Enable/disable write access watch in PREGION\\[0\\]"] + #[inline(always)] + pub fn prgn0wa(&mut self) -> PRGN0WA_W { + PRGN0WA_W { w: self } + } + #[doc = "Bit 25 - Enable/disable read access watch in PREGION\\[0\\]"] + #[inline(always)] + pub fn prgn0ra(&mut self) -> PRGN0RA_W { + PRGN0RA_W { w: self } + } + #[doc = "Bit 26 - Enable/disable write access watch in PREGION\\[1\\]"] + #[inline(always)] + pub fn prgn1wa(&mut self) -> PRGN1WA_W { + PRGN1WA_W { w: self } + } + #[doc = "Bit 27 - Enable/disable read access watch in PREGION\\[1\\]"] + #[inline(always)] + pub fn prgn1ra(&mut self) -> PRGN1RA_W { + PRGN1RA_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable/disable regions watch\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [regionen](index.html) module"] +pub struct REGIONEN_SPEC; +impl crate::RegisterSpec for REGIONEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [regionen::R](R) reader structure"] +impl crate::Readable for REGIONEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [regionen::W](W) writer structure"] +impl crate::Writable for REGIONEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets REGIONEN to value 0"] +impl crate::Resettable for REGIONEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mwu/regionenclr.rs b/src/mwu/regionenclr.rs new file mode 100644 index 0000000..c0f9120 --- /dev/null +++ b/src/mwu/regionenclr.rs @@ -0,0 +1,1266 @@ +#[doc = "Register `REGIONENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `REGIONENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Disable write access watch in region\\[0\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN0WA_A { + #[doc = "0: Write access watch in this region is disabled"] + DISABLED = 0, + #[doc = "1: Write access watch in this region is enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN0WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN0WA` reader - Disable write access watch in region\\[0\\]"] +pub struct RGN0WA_R(crate::FieldReader); +impl RGN0WA_R { + pub(crate) fn new(bits: bool) -> Self { + RGN0WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RGN0WA_A { + match self.bits { + false => RGN0WA_A::DISABLED, + true => RGN0WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RGN0WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RGN0WA_A::ENABLED + } +} +impl core::ops::Deref for RGN0WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Disable write access watch in region\\[0\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN0WA_AW { + #[doc = "1: Disable write access watch in this region"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN0WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN0WA` writer - Disable write access watch in region\\[0\\]"] +pub struct RGN0WA_W<'a> { + w: &'a mut W, +} +impl<'a> RGN0WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RGN0WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable write access watch in this region"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(RGN0WA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Disable read access watch in region\\[0\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN0RA_A { + #[doc = "0: Read access watch in this region is disabled"] + DISABLED = 0, + #[doc = "1: Read access watch in this region is enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN0RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN0RA` reader - Disable read access watch in region\\[0\\]"] +pub struct RGN0RA_R(crate::FieldReader); +impl RGN0RA_R { + pub(crate) fn new(bits: bool) -> Self { + RGN0RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RGN0RA_A { + match self.bits { + false => RGN0RA_A::DISABLED, + true => RGN0RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RGN0RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RGN0RA_A::ENABLED + } +} +impl core::ops::Deref for RGN0RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Disable read access watch in region\\[0\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN0RA_AW { + #[doc = "1: Disable read access watch in this region"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN0RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN0RA` writer - Disable read access watch in region\\[0\\]"] +pub struct RGN0RA_W<'a> { + w: &'a mut W, +} +impl<'a> RGN0RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RGN0RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable read access watch in this region"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(RGN0RA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Disable write access watch in region\\[1\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN1WA_A { + #[doc = "0: Write access watch in this region is disabled"] + DISABLED = 0, + #[doc = "1: Write access watch in this region is enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN1WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN1WA` reader - Disable write access watch in region\\[1\\]"] +pub struct RGN1WA_R(crate::FieldReader); +impl RGN1WA_R { + pub(crate) fn new(bits: bool) -> Self { + RGN1WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RGN1WA_A { + match self.bits { + false => RGN1WA_A::DISABLED, + true => RGN1WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RGN1WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RGN1WA_A::ENABLED + } +} +impl core::ops::Deref for RGN1WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Disable write access watch in region\\[1\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN1WA_AW { + #[doc = "1: Disable write access watch in this region"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN1WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN1WA` writer - Disable write access watch in region\\[1\\]"] +pub struct RGN1WA_W<'a> { + w: &'a mut W, +} +impl<'a> RGN1WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RGN1WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable write access watch in this region"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(RGN1WA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Disable read access watch in region\\[1\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN1RA_A { + #[doc = "0: Read access watch in this region is disabled"] + DISABLED = 0, + #[doc = "1: Read access watch in this region is enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN1RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN1RA` reader - Disable read access watch in region\\[1\\]"] +pub struct RGN1RA_R(crate::FieldReader); +impl RGN1RA_R { + pub(crate) fn new(bits: bool) -> Self { + RGN1RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RGN1RA_A { + match self.bits { + false => RGN1RA_A::DISABLED, + true => RGN1RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RGN1RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RGN1RA_A::ENABLED + } +} +impl core::ops::Deref for RGN1RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Disable read access watch in region\\[1\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN1RA_AW { + #[doc = "1: Disable read access watch in this region"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN1RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN1RA` writer - Disable read access watch in region\\[1\\]"] +pub struct RGN1RA_W<'a> { + w: &'a mut W, +} +impl<'a> RGN1RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RGN1RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable read access watch in this region"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(RGN1RA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Disable write access watch in region\\[2\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN2WA_A { + #[doc = "0: Write access watch in this region is disabled"] + DISABLED = 0, + #[doc = "1: Write access watch in this region is enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN2WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN2WA` reader - Disable write access watch in region\\[2\\]"] +pub struct RGN2WA_R(crate::FieldReader); +impl RGN2WA_R { + pub(crate) fn new(bits: bool) -> Self { + RGN2WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RGN2WA_A { + match self.bits { + false => RGN2WA_A::DISABLED, + true => RGN2WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RGN2WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RGN2WA_A::ENABLED + } +} +impl core::ops::Deref for RGN2WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Disable write access watch in region\\[2\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN2WA_AW { + #[doc = "1: Disable write access watch in this region"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN2WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN2WA` writer - Disable write access watch in region\\[2\\]"] +pub struct RGN2WA_W<'a> { + w: &'a mut W, +} +impl<'a> RGN2WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RGN2WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable write access watch in this region"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(RGN2WA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Disable read access watch in region\\[2\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN2RA_A { + #[doc = "0: Read access watch in this region is disabled"] + DISABLED = 0, + #[doc = "1: Read access watch in this region is enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN2RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN2RA` reader - Disable read access watch in region\\[2\\]"] +pub struct RGN2RA_R(crate::FieldReader); +impl RGN2RA_R { + pub(crate) fn new(bits: bool) -> Self { + RGN2RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RGN2RA_A { + match self.bits { + false => RGN2RA_A::DISABLED, + true => RGN2RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RGN2RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RGN2RA_A::ENABLED + } +} +impl core::ops::Deref for RGN2RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Disable read access watch in region\\[2\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN2RA_AW { + #[doc = "1: Disable read access watch in this region"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN2RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN2RA` writer - Disable read access watch in region\\[2\\]"] +pub struct RGN2RA_W<'a> { + w: &'a mut W, +} +impl<'a> RGN2RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RGN2RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable read access watch in this region"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(RGN2RA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Disable write access watch in region\\[3\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN3WA_A { + #[doc = "0: Write access watch in this region is disabled"] + DISABLED = 0, + #[doc = "1: Write access watch in this region is enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN3WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN3WA` reader - Disable write access watch in region\\[3\\]"] +pub struct RGN3WA_R(crate::FieldReader); +impl RGN3WA_R { + pub(crate) fn new(bits: bool) -> Self { + RGN3WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RGN3WA_A { + match self.bits { + false => RGN3WA_A::DISABLED, + true => RGN3WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RGN3WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RGN3WA_A::ENABLED + } +} +impl core::ops::Deref for RGN3WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Disable write access watch in region\\[3\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN3WA_AW { + #[doc = "1: Disable write access watch in this region"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN3WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN3WA` writer - Disable write access watch in region\\[3\\]"] +pub struct RGN3WA_W<'a> { + w: &'a mut W, +} +impl<'a> RGN3WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RGN3WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable write access watch in this region"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(RGN3WA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Disable read access watch in region\\[3\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN3RA_A { + #[doc = "0: Read access watch in this region is disabled"] + DISABLED = 0, + #[doc = "1: Read access watch in this region is enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN3RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN3RA` reader - Disable read access watch in region\\[3\\]"] +pub struct RGN3RA_R(crate::FieldReader); +impl RGN3RA_R { + pub(crate) fn new(bits: bool) -> Self { + RGN3RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RGN3RA_A { + match self.bits { + false => RGN3RA_A::DISABLED, + true => RGN3RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RGN3RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RGN3RA_A::ENABLED + } +} +impl core::ops::Deref for RGN3RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Disable read access watch in region\\[3\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN3RA_AW { + #[doc = "1: Disable read access watch in this region"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN3RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN3RA` writer - Disable read access watch in region\\[3\\]"] +pub struct RGN3RA_W<'a> { + w: &'a mut W, +} +impl<'a> RGN3RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RGN3RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable read access watch in this region"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(RGN3RA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Disable write access watch in PREGION\\[0\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PRGN0WA_A { + #[doc = "0: Write access watch in this PREGION is disabled"] + DISABLED = 0, + #[doc = "1: Write access watch in this PREGION is enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PRGN0WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PRGN0WA` reader - Disable write access watch in PREGION\\[0\\]"] +pub struct PRGN0WA_R(crate::FieldReader); +impl PRGN0WA_R { + pub(crate) fn new(bits: bool) -> Self { + PRGN0WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PRGN0WA_A { + match self.bits { + false => PRGN0WA_A::DISABLED, + true => PRGN0WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PRGN0WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PRGN0WA_A::ENABLED + } +} +impl core::ops::Deref for PRGN0WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Disable write access watch in PREGION\\[0\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PRGN0WA_AW { + #[doc = "1: Disable write access watch in this PREGION"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PRGN0WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PRGN0WA` writer - Disable write access watch in PREGION\\[0\\]"] +pub struct PRGN0WA_W<'a> { + w: &'a mut W, +} +impl<'a> PRGN0WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PRGN0WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable write access watch in this PREGION"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PRGN0WA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Disable read access watch in PREGION\\[0\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PRGN0RA_A { + #[doc = "0: Read access watch in this PREGION is disabled"] + DISABLED = 0, + #[doc = "1: Read access watch in this PREGION is enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PRGN0RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PRGN0RA` reader - Disable read access watch in PREGION\\[0\\]"] +pub struct PRGN0RA_R(crate::FieldReader); +impl PRGN0RA_R { + pub(crate) fn new(bits: bool) -> Self { + PRGN0RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PRGN0RA_A { + match self.bits { + false => PRGN0RA_A::DISABLED, + true => PRGN0RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PRGN0RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PRGN0RA_A::ENABLED + } +} +impl core::ops::Deref for PRGN0RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Disable read access watch in PREGION\\[0\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PRGN0RA_AW { + #[doc = "1: Disable read access watch in this PREGION"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PRGN0RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PRGN0RA` writer - Disable read access watch in PREGION\\[0\\]"] +pub struct PRGN0RA_W<'a> { + w: &'a mut W, +} +impl<'a> PRGN0RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PRGN0RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable read access watch in this PREGION"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PRGN0RA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Disable write access watch in PREGION\\[1\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PRGN1WA_A { + #[doc = "0: Write access watch in this PREGION is disabled"] + DISABLED = 0, + #[doc = "1: Write access watch in this PREGION is enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PRGN1WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PRGN1WA` reader - Disable write access watch in PREGION\\[1\\]"] +pub struct PRGN1WA_R(crate::FieldReader); +impl PRGN1WA_R { + pub(crate) fn new(bits: bool) -> Self { + PRGN1WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PRGN1WA_A { + match self.bits { + false => PRGN1WA_A::DISABLED, + true => PRGN1WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PRGN1WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PRGN1WA_A::ENABLED + } +} +impl core::ops::Deref for PRGN1WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Disable write access watch in PREGION\\[1\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PRGN1WA_AW { + #[doc = "1: Disable write access watch in this PREGION"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PRGN1WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PRGN1WA` writer - Disable write access watch in PREGION\\[1\\]"] +pub struct PRGN1WA_W<'a> { + w: &'a mut W, +} +impl<'a> PRGN1WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PRGN1WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable write access watch in this PREGION"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PRGN1WA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Disable read access watch in PREGION\\[1\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PRGN1RA_A { + #[doc = "0: Read access watch in this PREGION is disabled"] + DISABLED = 0, + #[doc = "1: Read access watch in this PREGION is enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PRGN1RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PRGN1RA` reader - Disable read access watch in PREGION\\[1\\]"] +pub struct PRGN1RA_R(crate::FieldReader); +impl PRGN1RA_R { + pub(crate) fn new(bits: bool) -> Self { + PRGN1RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PRGN1RA_A { + match self.bits { + false => PRGN1RA_A::DISABLED, + true => PRGN1RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PRGN1RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PRGN1RA_A::ENABLED + } +} +impl core::ops::Deref for PRGN1RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Disable read access watch in PREGION\\[1\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PRGN1RA_AW { + #[doc = "1: Disable read access watch in this PREGION"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PRGN1RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PRGN1RA` writer - Disable read access watch in PREGION\\[1\\]"] +pub struct PRGN1RA_W<'a> { + w: &'a mut W, +} +impl<'a> PRGN1RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PRGN1RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable read access watch in this PREGION"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PRGN1RA_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +impl R { + #[doc = "Bit 0 - Disable write access watch in region\\[0\\]"] + #[inline(always)] + pub fn rgn0wa(&self) -> RGN0WA_R { + RGN0WA_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Disable read access watch in region\\[0\\]"] + #[inline(always)] + pub fn rgn0ra(&self) -> RGN0RA_R { + RGN0RA_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Disable write access watch in region\\[1\\]"] + #[inline(always)] + pub fn rgn1wa(&self) -> RGN1WA_R { + RGN1WA_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Disable read access watch in region\\[1\\]"] + #[inline(always)] + pub fn rgn1ra(&self) -> RGN1RA_R { + RGN1RA_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Disable write access watch in region\\[2\\]"] + #[inline(always)] + pub fn rgn2wa(&self) -> RGN2WA_R { + RGN2WA_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Disable read access watch in region\\[2\\]"] + #[inline(always)] + pub fn rgn2ra(&self) -> RGN2RA_R { + RGN2RA_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Disable write access watch in region\\[3\\]"] + #[inline(always)] + pub fn rgn3wa(&self) -> RGN3WA_R { + RGN3WA_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Disable read access watch in region\\[3\\]"] + #[inline(always)] + pub fn rgn3ra(&self) -> RGN3RA_R { + RGN3RA_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 24 - Disable write access watch in PREGION\\[0\\]"] + #[inline(always)] + pub fn prgn0wa(&self) -> PRGN0WA_R { + PRGN0WA_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Disable read access watch in PREGION\\[0\\]"] + #[inline(always)] + pub fn prgn0ra(&self) -> PRGN0RA_R { + PRGN0RA_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Disable write access watch in PREGION\\[1\\]"] + #[inline(always)] + pub fn prgn1wa(&self) -> PRGN1WA_R { + PRGN1WA_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Disable read access watch in PREGION\\[1\\]"] + #[inline(always)] + pub fn prgn1ra(&self) -> PRGN1RA_R { + PRGN1RA_R::new(((self.bits >> 27) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Disable write access watch in region\\[0\\]"] + #[inline(always)] + pub fn rgn0wa(&mut self) -> RGN0WA_W { + RGN0WA_W { w: self } + } + #[doc = "Bit 1 - Disable read access watch in region\\[0\\]"] + #[inline(always)] + pub fn rgn0ra(&mut self) -> RGN0RA_W { + RGN0RA_W { w: self } + } + #[doc = "Bit 2 - Disable write access watch in region\\[1\\]"] + #[inline(always)] + pub fn rgn1wa(&mut self) -> RGN1WA_W { + RGN1WA_W { w: self } + } + #[doc = "Bit 3 - Disable read access watch in region\\[1\\]"] + #[inline(always)] + pub fn rgn1ra(&mut self) -> RGN1RA_W { + RGN1RA_W { w: self } + } + #[doc = "Bit 4 - Disable write access watch in region\\[2\\]"] + #[inline(always)] + pub fn rgn2wa(&mut self) -> RGN2WA_W { + RGN2WA_W { w: self } + } + #[doc = "Bit 5 - Disable read access watch in region\\[2\\]"] + #[inline(always)] + pub fn rgn2ra(&mut self) -> RGN2RA_W { + RGN2RA_W { w: self } + } + #[doc = "Bit 6 - Disable write access watch in region\\[3\\]"] + #[inline(always)] + pub fn rgn3wa(&mut self) -> RGN3WA_W { + RGN3WA_W { w: self } + } + #[doc = "Bit 7 - Disable read access watch in region\\[3\\]"] + #[inline(always)] + pub fn rgn3ra(&mut self) -> RGN3RA_W { + RGN3RA_W { w: self } + } + #[doc = "Bit 24 - Disable write access watch in PREGION\\[0\\]"] + #[inline(always)] + pub fn prgn0wa(&mut self) -> PRGN0WA_W { + PRGN0WA_W { w: self } + } + #[doc = "Bit 25 - Disable read access watch in PREGION\\[0\\]"] + #[inline(always)] + pub fn prgn0ra(&mut self) -> PRGN0RA_W { + PRGN0RA_W { w: self } + } + #[doc = "Bit 26 - Disable write access watch in PREGION\\[1\\]"] + #[inline(always)] + pub fn prgn1wa(&mut self) -> PRGN1WA_W { + PRGN1WA_W { w: self } + } + #[doc = "Bit 27 - Disable read access watch in PREGION\\[1\\]"] + #[inline(always)] + pub fn prgn1ra(&mut self) -> PRGN1RA_W { + PRGN1RA_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable regions watch\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [regionenclr](index.html) module"] +pub struct REGIONENCLR_SPEC; +impl crate::RegisterSpec for REGIONENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [regionenclr::R](R) reader structure"] +impl crate::Readable for REGIONENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [regionenclr::W](W) writer structure"] +impl crate::Writable for REGIONENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets REGIONENCLR to value 0"] +impl crate::Resettable for REGIONENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/mwu/regionenset.rs b/src/mwu/regionenset.rs new file mode 100644 index 0000000..4cdb9f8 --- /dev/null +++ b/src/mwu/regionenset.rs @@ -0,0 +1,1266 @@ +#[doc = "Register `REGIONENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `REGIONENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable write access watch in region\\[0\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN0WA_A { + #[doc = "0: Write access watch in this region is disabled"] + DISABLED = 0, + #[doc = "1: Write access watch in this region is enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN0WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN0WA` reader - Enable write access watch in region\\[0\\]"] +pub struct RGN0WA_R(crate::FieldReader); +impl RGN0WA_R { + pub(crate) fn new(bits: bool) -> Self { + RGN0WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RGN0WA_A { + match self.bits { + false => RGN0WA_A::DISABLED, + true => RGN0WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RGN0WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RGN0WA_A::ENABLED + } +} +impl core::ops::Deref for RGN0WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Enable write access watch in region\\[0\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN0WA_AW { + #[doc = "1: Enable write access watch in this region"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN0WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN0WA` writer - Enable write access watch in region\\[0\\]"] +pub struct RGN0WA_W<'a> { + w: &'a mut W, +} +impl<'a> RGN0WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RGN0WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable write access watch in this region"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(RGN0WA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Enable read access watch in region\\[0\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN0RA_A { + #[doc = "0: Read access watch in this region is disabled"] + DISABLED = 0, + #[doc = "1: Read access watch in this region is enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN0RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN0RA` reader - Enable read access watch in region\\[0\\]"] +pub struct RGN0RA_R(crate::FieldReader); +impl RGN0RA_R { + pub(crate) fn new(bits: bool) -> Self { + RGN0RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RGN0RA_A { + match self.bits { + false => RGN0RA_A::DISABLED, + true => RGN0RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RGN0RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RGN0RA_A::ENABLED + } +} +impl core::ops::Deref for RGN0RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Enable read access watch in region\\[0\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN0RA_AW { + #[doc = "1: Enable read access watch in this region"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN0RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN0RA` writer - Enable read access watch in region\\[0\\]"] +pub struct RGN0RA_W<'a> { + w: &'a mut W, +} +impl<'a> RGN0RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RGN0RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable read access watch in this region"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(RGN0RA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Enable write access watch in region\\[1\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN1WA_A { + #[doc = "0: Write access watch in this region is disabled"] + DISABLED = 0, + #[doc = "1: Write access watch in this region is enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN1WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN1WA` reader - Enable write access watch in region\\[1\\]"] +pub struct RGN1WA_R(crate::FieldReader); +impl RGN1WA_R { + pub(crate) fn new(bits: bool) -> Self { + RGN1WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RGN1WA_A { + match self.bits { + false => RGN1WA_A::DISABLED, + true => RGN1WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RGN1WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RGN1WA_A::ENABLED + } +} +impl core::ops::Deref for RGN1WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Enable write access watch in region\\[1\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN1WA_AW { + #[doc = "1: Enable write access watch in this region"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN1WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN1WA` writer - Enable write access watch in region\\[1\\]"] +pub struct RGN1WA_W<'a> { + w: &'a mut W, +} +impl<'a> RGN1WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RGN1WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable write access watch in this region"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(RGN1WA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Enable read access watch in region\\[1\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN1RA_A { + #[doc = "0: Read access watch in this region is disabled"] + DISABLED = 0, + #[doc = "1: Read access watch in this region is enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN1RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN1RA` reader - Enable read access watch in region\\[1\\]"] +pub struct RGN1RA_R(crate::FieldReader); +impl RGN1RA_R { + pub(crate) fn new(bits: bool) -> Self { + RGN1RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RGN1RA_A { + match self.bits { + false => RGN1RA_A::DISABLED, + true => RGN1RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RGN1RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RGN1RA_A::ENABLED + } +} +impl core::ops::Deref for RGN1RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Enable read access watch in region\\[1\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN1RA_AW { + #[doc = "1: Enable read access watch in this region"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN1RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN1RA` writer - Enable read access watch in region\\[1\\]"] +pub struct RGN1RA_W<'a> { + w: &'a mut W, +} +impl<'a> RGN1RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RGN1RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable read access watch in this region"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(RGN1RA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Enable write access watch in region\\[2\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN2WA_A { + #[doc = "0: Write access watch in this region is disabled"] + DISABLED = 0, + #[doc = "1: Write access watch in this region is enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN2WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN2WA` reader - Enable write access watch in region\\[2\\]"] +pub struct RGN2WA_R(crate::FieldReader); +impl RGN2WA_R { + pub(crate) fn new(bits: bool) -> Self { + RGN2WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RGN2WA_A { + match self.bits { + false => RGN2WA_A::DISABLED, + true => RGN2WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RGN2WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RGN2WA_A::ENABLED + } +} +impl core::ops::Deref for RGN2WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Enable write access watch in region\\[2\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN2WA_AW { + #[doc = "1: Enable write access watch in this region"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN2WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN2WA` writer - Enable write access watch in region\\[2\\]"] +pub struct RGN2WA_W<'a> { + w: &'a mut W, +} +impl<'a> RGN2WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RGN2WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable write access watch in this region"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(RGN2WA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Enable read access watch in region\\[2\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN2RA_A { + #[doc = "0: Read access watch in this region is disabled"] + DISABLED = 0, + #[doc = "1: Read access watch in this region is enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN2RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN2RA` reader - Enable read access watch in region\\[2\\]"] +pub struct RGN2RA_R(crate::FieldReader); +impl RGN2RA_R { + pub(crate) fn new(bits: bool) -> Self { + RGN2RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RGN2RA_A { + match self.bits { + false => RGN2RA_A::DISABLED, + true => RGN2RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RGN2RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RGN2RA_A::ENABLED + } +} +impl core::ops::Deref for RGN2RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Enable read access watch in region\\[2\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN2RA_AW { + #[doc = "1: Enable read access watch in this region"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN2RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN2RA` writer - Enable read access watch in region\\[2\\]"] +pub struct RGN2RA_W<'a> { + w: &'a mut W, +} +impl<'a> RGN2RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RGN2RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable read access watch in this region"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(RGN2RA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Enable write access watch in region\\[3\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN3WA_A { + #[doc = "0: Write access watch in this region is disabled"] + DISABLED = 0, + #[doc = "1: Write access watch in this region is enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN3WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN3WA` reader - Enable write access watch in region\\[3\\]"] +pub struct RGN3WA_R(crate::FieldReader); +impl RGN3WA_R { + pub(crate) fn new(bits: bool) -> Self { + RGN3WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RGN3WA_A { + match self.bits { + false => RGN3WA_A::DISABLED, + true => RGN3WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RGN3WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RGN3WA_A::ENABLED + } +} +impl core::ops::Deref for RGN3WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Enable write access watch in region\\[3\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN3WA_AW { + #[doc = "1: Enable write access watch in this region"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN3WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN3WA` writer - Enable write access watch in region\\[3\\]"] +pub struct RGN3WA_W<'a> { + w: &'a mut W, +} +impl<'a> RGN3WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RGN3WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable write access watch in this region"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(RGN3WA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Enable read access watch in region\\[3\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN3RA_A { + #[doc = "0: Read access watch in this region is disabled"] + DISABLED = 0, + #[doc = "1: Read access watch in this region is enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN3RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN3RA` reader - Enable read access watch in region\\[3\\]"] +pub struct RGN3RA_R(crate::FieldReader); +impl RGN3RA_R { + pub(crate) fn new(bits: bool) -> Self { + RGN3RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RGN3RA_A { + match self.bits { + false => RGN3RA_A::DISABLED, + true => RGN3RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RGN3RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RGN3RA_A::ENABLED + } +} +impl core::ops::Deref for RGN3RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Enable read access watch in region\\[3\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RGN3RA_AW { + #[doc = "1: Enable read access watch in this region"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RGN3RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RGN3RA` writer - Enable read access watch in region\\[3\\]"] +pub struct RGN3RA_W<'a> { + w: &'a mut W, +} +impl<'a> RGN3RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RGN3RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable read access watch in this region"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(RGN3RA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Enable write access watch in PREGION\\[0\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PRGN0WA_A { + #[doc = "0: Write access watch in this PREGION is disabled"] + DISABLED = 0, + #[doc = "1: Write access watch in this PREGION is enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PRGN0WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PRGN0WA` reader - Enable write access watch in PREGION\\[0\\]"] +pub struct PRGN0WA_R(crate::FieldReader); +impl PRGN0WA_R { + pub(crate) fn new(bits: bool) -> Self { + PRGN0WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PRGN0WA_A { + match self.bits { + false => PRGN0WA_A::DISABLED, + true => PRGN0WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PRGN0WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PRGN0WA_A::ENABLED + } +} +impl core::ops::Deref for PRGN0WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Enable write access watch in PREGION\\[0\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PRGN0WA_AW { + #[doc = "1: Enable write access watch in this PREGION"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PRGN0WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PRGN0WA` writer - Enable write access watch in PREGION\\[0\\]"] +pub struct PRGN0WA_W<'a> { + w: &'a mut W, +} +impl<'a> PRGN0WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PRGN0WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable write access watch in this PREGION"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PRGN0WA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Enable read access watch in PREGION\\[0\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PRGN0RA_A { + #[doc = "0: Read access watch in this PREGION is disabled"] + DISABLED = 0, + #[doc = "1: Read access watch in this PREGION is enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PRGN0RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PRGN0RA` reader - Enable read access watch in PREGION\\[0\\]"] +pub struct PRGN0RA_R(crate::FieldReader); +impl PRGN0RA_R { + pub(crate) fn new(bits: bool) -> Self { + PRGN0RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PRGN0RA_A { + match self.bits { + false => PRGN0RA_A::DISABLED, + true => PRGN0RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PRGN0RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PRGN0RA_A::ENABLED + } +} +impl core::ops::Deref for PRGN0RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Enable read access watch in PREGION\\[0\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PRGN0RA_AW { + #[doc = "1: Enable read access watch in this PREGION"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PRGN0RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PRGN0RA` writer - Enable read access watch in PREGION\\[0\\]"] +pub struct PRGN0RA_W<'a> { + w: &'a mut W, +} +impl<'a> PRGN0RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PRGN0RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable read access watch in this PREGION"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PRGN0RA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Enable write access watch in PREGION\\[1\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PRGN1WA_A { + #[doc = "0: Write access watch in this PREGION is disabled"] + DISABLED = 0, + #[doc = "1: Write access watch in this PREGION is enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PRGN1WA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PRGN1WA` reader - Enable write access watch in PREGION\\[1\\]"] +pub struct PRGN1WA_R(crate::FieldReader); +impl PRGN1WA_R { + pub(crate) fn new(bits: bool) -> Self { + PRGN1WA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PRGN1WA_A { + match self.bits { + false => PRGN1WA_A::DISABLED, + true => PRGN1WA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PRGN1WA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PRGN1WA_A::ENABLED + } +} +impl core::ops::Deref for PRGN1WA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Enable write access watch in PREGION\\[1\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PRGN1WA_AW { + #[doc = "1: Enable write access watch in this PREGION"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PRGN1WA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PRGN1WA` writer - Enable write access watch in PREGION\\[1\\]"] +pub struct PRGN1WA_W<'a> { + w: &'a mut W, +} +impl<'a> PRGN1WA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PRGN1WA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable write access watch in this PREGION"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PRGN1WA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Enable read access watch in PREGION\\[1\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PRGN1RA_A { + #[doc = "0: Read access watch in this PREGION is disabled"] + DISABLED = 0, + #[doc = "1: Read access watch in this PREGION is enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PRGN1RA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PRGN1RA` reader - Enable read access watch in PREGION\\[1\\]"] +pub struct PRGN1RA_R(crate::FieldReader); +impl PRGN1RA_R { + pub(crate) fn new(bits: bool) -> Self { + PRGN1RA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PRGN1RA_A { + match self.bits { + false => PRGN1RA_A::DISABLED, + true => PRGN1RA_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PRGN1RA_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PRGN1RA_A::ENABLED + } +} +impl core::ops::Deref for PRGN1RA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Enable read access watch in PREGION\\[1\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PRGN1RA_AW { + #[doc = "1: Enable read access watch in this PREGION"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PRGN1RA_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PRGN1RA` writer - Enable read access watch in PREGION\\[1\\]"] +pub struct PRGN1RA_W<'a> { + w: &'a mut W, +} +impl<'a> PRGN1RA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PRGN1RA_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable read access watch in this PREGION"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PRGN1RA_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable write access watch in region\\[0\\]"] + #[inline(always)] + pub fn rgn0wa(&self) -> RGN0WA_R { + RGN0WA_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Enable read access watch in region\\[0\\]"] + #[inline(always)] + pub fn rgn0ra(&self) -> RGN0RA_R { + RGN0RA_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Enable write access watch in region\\[1\\]"] + #[inline(always)] + pub fn rgn1wa(&self) -> RGN1WA_R { + RGN1WA_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Enable read access watch in region\\[1\\]"] + #[inline(always)] + pub fn rgn1ra(&self) -> RGN1RA_R { + RGN1RA_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Enable write access watch in region\\[2\\]"] + #[inline(always)] + pub fn rgn2wa(&self) -> RGN2WA_R { + RGN2WA_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Enable read access watch in region\\[2\\]"] + #[inline(always)] + pub fn rgn2ra(&self) -> RGN2RA_R { + RGN2RA_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Enable write access watch in region\\[3\\]"] + #[inline(always)] + pub fn rgn3wa(&self) -> RGN3WA_R { + RGN3WA_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Enable read access watch in region\\[3\\]"] + #[inline(always)] + pub fn rgn3ra(&self) -> RGN3RA_R { + RGN3RA_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 24 - Enable write access watch in PREGION\\[0\\]"] + #[inline(always)] + pub fn prgn0wa(&self) -> PRGN0WA_R { + PRGN0WA_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Enable read access watch in PREGION\\[0\\]"] + #[inline(always)] + pub fn prgn0ra(&self) -> PRGN0RA_R { + PRGN0RA_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Enable write access watch in PREGION\\[1\\]"] + #[inline(always)] + pub fn prgn1wa(&self) -> PRGN1WA_R { + PRGN1WA_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Enable read access watch in PREGION\\[1\\]"] + #[inline(always)] + pub fn prgn1ra(&self) -> PRGN1RA_R { + PRGN1RA_R::new(((self.bits >> 27) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Enable write access watch in region\\[0\\]"] + #[inline(always)] + pub fn rgn0wa(&mut self) -> RGN0WA_W { + RGN0WA_W { w: self } + } + #[doc = "Bit 1 - Enable read access watch in region\\[0\\]"] + #[inline(always)] + pub fn rgn0ra(&mut self) -> RGN0RA_W { + RGN0RA_W { w: self } + } + #[doc = "Bit 2 - Enable write access watch in region\\[1\\]"] + #[inline(always)] + pub fn rgn1wa(&mut self) -> RGN1WA_W { + RGN1WA_W { w: self } + } + #[doc = "Bit 3 - Enable read access watch in region\\[1\\]"] + #[inline(always)] + pub fn rgn1ra(&mut self) -> RGN1RA_W { + RGN1RA_W { w: self } + } + #[doc = "Bit 4 - Enable write access watch in region\\[2\\]"] + #[inline(always)] + pub fn rgn2wa(&mut self) -> RGN2WA_W { + RGN2WA_W { w: self } + } + #[doc = "Bit 5 - Enable read access watch in region\\[2\\]"] + #[inline(always)] + pub fn rgn2ra(&mut self) -> RGN2RA_W { + RGN2RA_W { w: self } + } + #[doc = "Bit 6 - Enable write access watch in region\\[3\\]"] + #[inline(always)] + pub fn rgn3wa(&mut self) -> RGN3WA_W { + RGN3WA_W { w: self } + } + #[doc = "Bit 7 - Enable read access watch in region\\[3\\]"] + #[inline(always)] + pub fn rgn3ra(&mut self) -> RGN3RA_W { + RGN3RA_W { w: self } + } + #[doc = "Bit 24 - Enable write access watch in PREGION\\[0\\]"] + #[inline(always)] + pub fn prgn0wa(&mut self) -> PRGN0WA_W { + PRGN0WA_W { w: self } + } + #[doc = "Bit 25 - Enable read access watch in PREGION\\[0\\]"] + #[inline(always)] + pub fn prgn0ra(&mut self) -> PRGN0RA_W { + PRGN0RA_W { w: self } + } + #[doc = "Bit 26 - Enable write access watch in PREGION\\[1\\]"] + #[inline(always)] + pub fn prgn1wa(&mut self) -> PRGN1WA_W { + PRGN1WA_W { w: self } + } + #[doc = "Bit 27 - Enable read access watch in PREGION\\[1\\]"] + #[inline(always)] + pub fn prgn1ra(&mut self) -> PRGN1RA_W { + PRGN1RA_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable regions watch\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [regionenset](index.html) module"] +pub struct REGIONENSET_SPEC; +impl crate::RegisterSpec for REGIONENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [regionenset::R](R) reader structure"] +impl crate::Readable for REGIONENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [regionenset::W](W) writer structure"] +impl crate::Writable for REGIONENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets REGIONENSET to value 0"] +impl crate::Resettable for REGIONENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct.rs b/src/nfct.rs new file mode 100644 index 0000000..1445000 --- /dev/null +++ b/src/nfct.rs @@ -0,0 +1,292 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "0x00 - Activate NFC peripheral for incoming and outgoing frames, change state to activated"] + pub tasks_activate: crate::Reg, + #[doc = "0x04 - Disable NFC peripheral"] + pub tasks_disable: crate::Reg, + #[doc = "0x08 - Enable NFC sense field mode, change state to sense mode"] + pub tasks_sense: crate::Reg, + #[doc = "0x0c - Start transmission of a outgoing frame, change state to transmit"] + pub tasks_starttx: crate::Reg, + _reserved4: [u8; 0x0c], + #[doc = "0x1c - Initializes the EasyDMA for receive."] + pub tasks_enablerxdata: crate::Reg, + _reserved5: [u8; 0x04], + #[doc = "0x24 - Force state machine to IDLE state"] + pub tasks_goidle: crate::Reg, + #[doc = "0x28 - Force state machine to SLEEP_A state"] + pub tasks_gosleep: crate::Reg, + _reserved7: [u8; 0xd4], + #[doc = "0x100 - The NFC peripheral is ready to receive and send frames"] + pub events_ready: crate::Reg, + #[doc = "0x104 - Remote NFC field detected"] + pub events_fielddetected: crate::Reg, + #[doc = "0x108 - Remote NFC field lost"] + pub events_fieldlost: crate::Reg, + #[doc = "0x10c - Marks the start of the first symbol of a transmitted frame"] + pub events_txframestart: crate::Reg, + #[doc = "0x110 - Marks the end of the last transmitted on-air symbol of a frame"] + pub events_txframeend: crate::Reg, + #[doc = "0x114 - Marks the end of the first symbol of a received frame"] + pub events_rxframestart: crate::Reg, + #[doc = "0x118 - Received data have been checked (CRC, parity) and transferred to RAM, and EasyDMA has ended accessing the RX buffer"] + pub events_rxframeend: crate::Reg, + #[doc = "0x11c - NFC error reported. The ERRORSTATUS register contains details on the source of the error."] + pub events_error: crate::Reg, + _reserved15: [u8; 0x08], + #[doc = "0x128 - NFC RX frame error reported. The FRAMESTATUS.RX register contains details on the source of the error."] + pub events_rxerror: crate::Reg, + #[doc = "0x12c - RX buffer (as defined by PACKETPTR and MAXLEN) in Data RAM full."] + pub events_endrx: crate::Reg, + #[doc = "0x130 - Transmission of data in RAM has ended, and EasyDMA has ended accessing the TX buffer"] + pub events_endtx: crate::Reg, + _reserved18: [u8; 0x04], + #[doc = "0x138 - Auto collision resolution process has started"] + pub events_autocolresstarted: + crate::Reg, + _reserved19: [u8; 0x0c], + #[doc = "0x148 - NFC Auto collision resolution error reported."] + pub events_collision: crate::Reg, + #[doc = "0x14c - NFC Auto collision resolution successfully completed"] + pub events_selected: crate::Reg, + #[doc = "0x150 - EasyDMA is ready to receive or send frames."] + pub events_started: crate::Reg, + _reserved22: [u8; 0xac], + #[doc = "0x200 - Shortcut register"] + pub shorts: crate::Reg, + _reserved23: [u8; 0xfc], + #[doc = "0x300 - Enable or disable interrupt"] + pub inten: crate::Reg, + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved26: [u8; 0xf8], + #[doc = "0x404 - NFC Error Status register"] + pub errorstatus: crate::Reg, + _reserved27: [u8; 0x04], + #[doc = "0x40c - Unspecified"] + pub framestatus: FRAMESTATUS, + _reserved28: [u8; 0x20], + #[doc = "0x430 - Current value driven to the NFC Load Control"] + pub currentloadctrl: crate::Reg, + _reserved29: [u8; 0x08], + #[doc = "0x43c - Indicates the presence or not of a valid field"] + pub fieldpresent: crate::Reg, + _reserved30: [u8; 0xc4], + #[doc = "0x504 - Minimum frame delay"] + pub framedelaymin: crate::Reg, + #[doc = "0x508 - Maximum frame delay"] + pub framedelaymax: crate::Reg, + #[doc = "0x50c - Configuration register for the Frame Delay Timer"] + pub framedelaymode: crate::Reg, + #[doc = "0x510 - Packet pointer for TXD and RXD data storage in Data RAM"] + pub packetptr: crate::Reg, + #[doc = "0x514 - Size of allocated for TXD and RXD data storage buffer in Data RAM"] + pub maxlen: crate::Reg, + #[doc = "0x518..0x520 - Unspecified"] + pub txd: TXD, + #[doc = "0x520..0x528 - Unspecified"] + pub rxd: RXD, + _reserved37: [u8; 0x68], + #[doc = "0x590 - Last NFCID1 part (4, 7 or 10 bytes ID)"] + pub nfcid1_last: crate::Reg, + #[doc = "0x594 - Second last NFCID1 part (7 or 10 bytes ID)"] + pub nfcid1_2nd_last: crate::Reg, + #[doc = "0x598 - Third last NFCID1 part (10 bytes ID)"] + pub nfcid1_3rd_last: crate::Reg, + _reserved40: [u8; 0x04], + #[doc = "0x5a0 - NFC-A SENS_RES auto-response settings"] + pub sensres: crate::Reg, + #[doc = "0x5a4 - NFC-A SEL_RES auto-response settings"] + pub selres: crate::Reg, +} +#[doc = r"Register block"] +#[repr(C)] +pub struct FRAMESTATUS { + #[doc = "0x00 - Result of last incoming frames"] + pub rx: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod framestatus; +#[doc = r"Register block"] +#[repr(C)] +pub struct TXD { + #[doc = "0x00 - Configuration of outgoing frames"] + pub frameconfig: crate::Reg, + #[doc = "0x04 - Size of outgoing frame"] + pub amount: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod txd; +#[doc = r"Register block"] +#[repr(C)] +pub struct RXD { + #[doc = "0x00 - Configuration of incoming frames"] + pub frameconfig: crate::Reg, + #[doc = "0x04 - Size of last incoming frame"] + pub amount: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod rxd; +#[doc = "TASKS_ACTIVATE register accessor: an alias for `Reg`"] +pub type TASKS_ACTIVATE = crate::Reg; +#[doc = "Activate NFC peripheral for incoming and outgoing frames, change state to activated"] +pub mod tasks_activate; +#[doc = "TASKS_DISABLE register accessor: an alias for `Reg`"] +pub type TASKS_DISABLE = crate::Reg; +#[doc = "Disable NFC peripheral"] +pub mod tasks_disable; +#[doc = "TASKS_SENSE register accessor: an alias for `Reg`"] +pub type TASKS_SENSE = crate::Reg; +#[doc = "Enable NFC sense field mode, change state to sense mode"] +pub mod tasks_sense; +#[doc = "TASKS_STARTTX register accessor: an alias for `Reg`"] +pub type TASKS_STARTTX = crate::Reg; +#[doc = "Start transmission of a outgoing frame, change state to transmit"] +pub mod tasks_starttx; +#[doc = "TASKS_ENABLERXDATA register accessor: an alias for `Reg`"] +pub type TASKS_ENABLERXDATA = crate::Reg; +#[doc = "Initializes the EasyDMA for receive."] +pub mod tasks_enablerxdata; +#[doc = "TASKS_GOIDLE register accessor: an alias for `Reg`"] +pub type TASKS_GOIDLE = crate::Reg; +#[doc = "Force state machine to IDLE state"] +pub mod tasks_goidle; +#[doc = "TASKS_GOSLEEP register accessor: an alias for `Reg`"] +pub type TASKS_GOSLEEP = crate::Reg; +#[doc = "Force state machine to SLEEP_A state"] +pub mod tasks_gosleep; +#[doc = "EVENTS_READY register accessor: an alias for `Reg`"] +pub type EVENTS_READY = crate::Reg; +#[doc = "The NFC peripheral is ready to receive and send frames"] +pub mod events_ready; +#[doc = "EVENTS_FIELDDETECTED register accessor: an alias for `Reg`"] +pub type EVENTS_FIELDDETECTED = crate::Reg; +#[doc = "Remote NFC field detected"] +pub mod events_fielddetected; +#[doc = "EVENTS_FIELDLOST register accessor: an alias for `Reg`"] +pub type EVENTS_FIELDLOST = crate::Reg; +#[doc = "Remote NFC field lost"] +pub mod events_fieldlost; +#[doc = "EVENTS_TXFRAMESTART register accessor: an alias for `Reg`"] +pub type EVENTS_TXFRAMESTART = crate::Reg; +#[doc = "Marks the start of the first symbol of a transmitted frame"] +pub mod events_txframestart; +#[doc = "EVENTS_TXFRAMEEND register accessor: an alias for `Reg`"] +pub type EVENTS_TXFRAMEEND = crate::Reg; +#[doc = "Marks the end of the last transmitted on-air symbol of a frame"] +pub mod events_txframeend; +#[doc = "EVENTS_RXFRAMESTART register accessor: an alias for `Reg`"] +pub type EVENTS_RXFRAMESTART = crate::Reg; +#[doc = "Marks the end of the first symbol of a received frame"] +pub mod events_rxframestart; +#[doc = "EVENTS_RXFRAMEEND register accessor: an alias for `Reg`"] +pub type EVENTS_RXFRAMEEND = crate::Reg; +#[doc = "Received data have been checked (CRC, parity) and transferred to RAM, and EasyDMA has ended accessing the RX buffer"] +pub mod events_rxframeend; +#[doc = "EVENTS_ERROR register accessor: an alias for `Reg`"] +pub type EVENTS_ERROR = crate::Reg; +#[doc = "NFC error reported. The ERRORSTATUS register contains details on the source of the error."] +pub mod events_error; +#[doc = "EVENTS_RXERROR register accessor: an alias for `Reg`"] +pub type EVENTS_RXERROR = crate::Reg; +#[doc = "NFC RX frame error reported. The FRAMESTATUS.RX register contains details on the source of the error."] +pub mod events_rxerror; +#[doc = "EVENTS_ENDRX register accessor: an alias for `Reg`"] +pub type EVENTS_ENDRX = crate::Reg; +#[doc = "RX buffer (as defined by PACKETPTR and MAXLEN) in Data RAM full."] +pub mod events_endrx; +#[doc = "EVENTS_ENDTX register accessor: an alias for `Reg`"] +pub type EVENTS_ENDTX = crate::Reg; +#[doc = "Transmission of data in RAM has ended, and EasyDMA has ended accessing the TX buffer"] +pub mod events_endtx; +#[doc = "EVENTS_AUTOCOLRESSTARTED register accessor: an alias for `Reg`"] +pub type EVENTS_AUTOCOLRESSTARTED = + crate::Reg; +#[doc = "Auto collision resolution process has started"] +pub mod events_autocolresstarted; +#[doc = "EVENTS_COLLISION register accessor: an alias for `Reg`"] +pub type EVENTS_COLLISION = crate::Reg; +#[doc = "NFC Auto collision resolution error reported."] +pub mod events_collision; +#[doc = "EVENTS_SELECTED register accessor: an alias for `Reg`"] +pub type EVENTS_SELECTED = crate::Reg; +#[doc = "NFC Auto collision resolution successfully completed"] +pub mod events_selected; +#[doc = "EVENTS_STARTED register accessor: an alias for `Reg`"] +pub type EVENTS_STARTED = crate::Reg; +#[doc = "EasyDMA is ready to receive or send frames."] +pub mod events_started; +#[doc = "SHORTS register accessor: an alias for `Reg`"] +pub type SHORTS = crate::Reg; +#[doc = "Shortcut register"] +pub mod shorts; +#[doc = "INTEN register accessor: an alias for `Reg`"] +pub type INTEN = crate::Reg; +#[doc = "Enable or disable interrupt"] +pub mod inten; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "ERRORSTATUS register accessor: an alias for `Reg`"] +pub type ERRORSTATUS = crate::Reg; +#[doc = "NFC Error Status register"] +pub mod errorstatus; +#[doc = "CURRENTLOADCTRL register accessor: an alias for `Reg`"] +pub type CURRENTLOADCTRL = crate::Reg; +#[doc = "Current value driven to the NFC Load Control"] +pub mod currentloadctrl; +#[doc = "FIELDPRESENT register accessor: an alias for `Reg`"] +pub type FIELDPRESENT = crate::Reg; +#[doc = "Indicates the presence or not of a valid field"] +pub mod fieldpresent; +#[doc = "FRAMEDELAYMIN register accessor: an alias for `Reg`"] +pub type FRAMEDELAYMIN = crate::Reg; +#[doc = "Minimum frame delay"] +pub mod framedelaymin; +#[doc = "FRAMEDELAYMAX register accessor: an alias for `Reg`"] +pub type FRAMEDELAYMAX = crate::Reg; +#[doc = "Maximum frame delay"] +pub mod framedelaymax; +#[doc = "FRAMEDELAYMODE register accessor: an alias for `Reg`"] +pub type FRAMEDELAYMODE = crate::Reg; +#[doc = "Configuration register for the Frame Delay Timer"] +pub mod framedelaymode; +#[doc = "PACKETPTR register accessor: an alias for `Reg`"] +pub type PACKETPTR = crate::Reg; +#[doc = "Packet pointer for TXD and RXD data storage in Data RAM"] +pub mod packetptr; +#[doc = "MAXLEN register accessor: an alias for `Reg`"] +pub type MAXLEN = crate::Reg; +#[doc = "Size of allocated for TXD and RXD data storage buffer in Data RAM"] +pub mod maxlen; +#[doc = "NFCID1_LAST register accessor: an alias for `Reg`"] +pub type NFCID1_LAST = crate::Reg; +#[doc = "Last NFCID1 part (4, 7 or 10 bytes ID)"] +pub mod nfcid1_last; +#[doc = "NFCID1_2ND_LAST register accessor: an alias for `Reg`"] +pub type NFCID1_2ND_LAST = crate::Reg; +#[doc = "Second last NFCID1 part (7 or 10 bytes ID)"] +pub mod nfcid1_2nd_last; +#[doc = "NFCID1_3RD_LAST register accessor: an alias for `Reg`"] +pub type NFCID1_3RD_LAST = crate::Reg; +#[doc = "Third last NFCID1 part (10 bytes ID)"] +pub mod nfcid1_3rd_last; +#[doc = "SENSRES register accessor: an alias for `Reg`"] +pub type SENSRES = crate::Reg; +#[doc = "NFC-A SENS_RES auto-response settings"] +pub mod sensres; +#[doc = "SELRES register accessor: an alias for `Reg`"] +pub type SELRES = crate::Reg; +#[doc = "NFC-A SEL_RES auto-response settings"] +pub mod selres; diff --git a/src/nfct/currentloadctrl.rs b/src/nfct/currentloadctrl.rs new file mode 100644 index 0000000..88ab368 --- /dev/null +++ b/src/nfct/currentloadctrl.rs @@ -0,0 +1,52 @@ +#[doc = "Register `CURRENTLOADCTRL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `CURRENTLOADCTRL` reader - Current value driven to the NFC Load Control"] +pub struct CURRENTLOADCTRL_R(crate::FieldReader); +impl CURRENTLOADCTRL_R { + pub(crate) fn new(bits: u8) -> Self { + CURRENTLOADCTRL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CURRENTLOADCTRL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:5 - Current value driven to the NFC Load Control"] + #[inline(always)] + pub fn currentloadctrl(&self) -> CURRENTLOADCTRL_R { + CURRENTLOADCTRL_R::new((self.bits & 0x3f) as u8) + } +} +#[doc = "Current value driven to the NFC Load Control\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 [currentloadctrl](index.html) module"] +pub struct CURRENTLOADCTRL_SPEC; +impl crate::RegisterSpec for CURRENTLOADCTRL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [currentloadctrl::R](R) reader structure"] +impl crate::Readable for CURRENTLOADCTRL_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets CURRENTLOADCTRL to value 0"] +impl crate::Resettable for CURRENTLOADCTRL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/errorstatus.rs b/src/nfct/errorstatus.rs new file mode 100644 index 0000000..1694ac0 --- /dev/null +++ b/src/nfct/errorstatus.rs @@ -0,0 +1,204 @@ +#[doc = "Register `ERRORSTATUS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ERRORSTATUS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `FRAMEDELAYTIMEOUT` reader - No STARTTX task triggered before expiration of the time set in FRAMEDELAYMAX"] +pub struct FRAMEDELAYTIMEOUT_R(crate::FieldReader); +impl FRAMEDELAYTIMEOUT_R { + pub(crate) fn new(bits: bool) -> Self { + FRAMEDELAYTIMEOUT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FRAMEDELAYTIMEOUT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FRAMEDELAYTIMEOUT` writer - No STARTTX task triggered before expiration of the time set in FRAMEDELAYMAX"] +pub struct FRAMEDELAYTIMEOUT_W<'a> { + w: &'a mut W, +} +impl<'a> FRAMEDELAYTIMEOUT_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Field `NFCFIELDTOOSTRONG` reader - Field level is too high at max load resistance"] +pub struct NFCFIELDTOOSTRONG_R(crate::FieldReader); +impl NFCFIELDTOOSTRONG_R { + pub(crate) fn new(bits: bool) -> Self { + NFCFIELDTOOSTRONG_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NFCFIELDTOOSTRONG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NFCFIELDTOOSTRONG` writer - Field level is too high at max load resistance"] +pub struct NFCFIELDTOOSTRONG_W<'a> { + w: &'a mut W, +} +impl<'a> NFCFIELDTOOSTRONG_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Field `NFCFIELDTOOWEAK` reader - Field level is too low at min load resistance"] +pub struct NFCFIELDTOOWEAK_R(crate::FieldReader); +impl NFCFIELDTOOWEAK_R { + pub(crate) fn new(bits: bool) -> Self { + NFCFIELDTOOWEAK_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NFCFIELDTOOWEAK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NFCFIELDTOOWEAK` writer - Field level is too low at min load resistance"] +pub struct NFCFIELDTOOWEAK_W<'a> { + w: &'a mut W, +} +impl<'a> NFCFIELDTOOWEAK_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +impl R { + #[doc = "Bit 0 - No STARTTX task triggered before expiration of the time set in FRAMEDELAYMAX"] + #[inline(always)] + pub fn framedelaytimeout(&self) -> FRAMEDELAYTIMEOUT_R { + FRAMEDELAYTIMEOUT_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 2 - Field level is too high at max load resistance"] + #[inline(always)] + pub fn nfcfieldtoostrong(&self) -> NFCFIELDTOOSTRONG_R { + NFCFIELDTOOSTRONG_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Field level is too low at min load resistance"] + #[inline(always)] + pub fn nfcfieldtooweak(&self) -> NFCFIELDTOOWEAK_R { + NFCFIELDTOOWEAK_R::new(((self.bits >> 3) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - No STARTTX task triggered before expiration of the time set in FRAMEDELAYMAX"] + #[inline(always)] + pub fn framedelaytimeout(&mut self) -> FRAMEDELAYTIMEOUT_W { + FRAMEDELAYTIMEOUT_W { w: self } + } + #[doc = "Bit 2 - Field level is too high at max load resistance"] + #[inline(always)] + pub fn nfcfieldtoostrong(&mut self) -> NFCFIELDTOOSTRONG_W { + NFCFIELDTOOSTRONG_W { w: self } + } + #[doc = "Bit 3 - Field level is too low at min load resistance"] + #[inline(always)] + pub fn nfcfieldtooweak(&mut self) -> NFCFIELDTOOWEAK_W { + NFCFIELDTOOWEAK_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "NFC Error Status register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [errorstatus](index.html) module"] +pub struct ERRORSTATUS_SPEC; +impl crate::RegisterSpec for ERRORSTATUS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [errorstatus::R](R) reader structure"] +impl crate::Readable for ERRORSTATUS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [errorstatus::W](W) writer structure"] +impl crate::Writable for ERRORSTATUS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ERRORSTATUS to value 0"] +impl crate::Resettable for ERRORSTATUS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/events_autocolresstarted.rs b/src/nfct/events_autocolresstarted.rs new file mode 100644 index 0000000..53cb8d3 --- /dev/null +++ b/src/nfct/events_autocolresstarted.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_AUTOCOLRESSTARTED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_AUTOCOLRESSTARTED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Auto collision resolution process has started\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_autocolresstarted](index.html) module"] +pub struct EVENTS_AUTOCOLRESSTARTED_SPEC; +impl crate::RegisterSpec for EVENTS_AUTOCOLRESSTARTED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_autocolresstarted::R](R) reader structure"] +impl crate::Readable for EVENTS_AUTOCOLRESSTARTED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_autocolresstarted::W](W) writer structure"] +impl crate::Writable for EVENTS_AUTOCOLRESSTARTED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_AUTOCOLRESSTARTED to value 0"] +impl crate::Resettable for EVENTS_AUTOCOLRESSTARTED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/events_collision.rs b/src/nfct/events_collision.rs new file mode 100644 index 0000000..0e81f4d --- /dev/null +++ b/src/nfct/events_collision.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_COLLISION` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_COLLISION` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "NFC Auto collision resolution error reported.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_collision](index.html) module"] +pub struct EVENTS_COLLISION_SPEC; +impl crate::RegisterSpec for EVENTS_COLLISION_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_collision::R](R) reader structure"] +impl crate::Readable for EVENTS_COLLISION_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_collision::W](W) writer structure"] +impl crate::Writable for EVENTS_COLLISION_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_COLLISION to value 0"] +impl crate::Resettable for EVENTS_COLLISION_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/events_endrx.rs b/src/nfct/events_endrx.rs new file mode 100644 index 0000000..ac32163 --- /dev/null +++ b/src/nfct/events_endrx.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_ENDRX` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_ENDRX` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "RX buffer (as defined by PACKETPTR and MAXLEN) in Data RAM full.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_endrx](index.html) module"] +pub struct EVENTS_ENDRX_SPEC; +impl crate::RegisterSpec for EVENTS_ENDRX_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_endrx::R](R) reader structure"] +impl crate::Readable for EVENTS_ENDRX_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_endrx::W](W) writer structure"] +impl crate::Writable for EVENTS_ENDRX_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_ENDRX to value 0"] +impl crate::Resettable for EVENTS_ENDRX_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/events_endtx.rs b/src/nfct/events_endtx.rs new file mode 100644 index 0000000..a357b96 --- /dev/null +++ b/src/nfct/events_endtx.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_ENDTX` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_ENDTX` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Transmission of data in RAM has ended, and EasyDMA has ended accessing the TX buffer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_endtx](index.html) module"] +pub struct EVENTS_ENDTX_SPEC; +impl crate::RegisterSpec for EVENTS_ENDTX_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_endtx::R](R) reader structure"] +impl crate::Readable for EVENTS_ENDTX_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_endtx::W](W) writer structure"] +impl crate::Writable for EVENTS_ENDTX_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_ENDTX to value 0"] +impl crate::Resettable for EVENTS_ENDTX_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/events_error.rs b/src/nfct/events_error.rs new file mode 100644 index 0000000..b6edebc --- /dev/null +++ b/src/nfct/events_error.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_ERROR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_ERROR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "NFC error reported. The ERRORSTATUS register contains details on the source of the error.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_error](index.html) module"] +pub struct EVENTS_ERROR_SPEC; +impl crate::RegisterSpec for EVENTS_ERROR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_error::R](R) reader structure"] +impl crate::Readable for EVENTS_ERROR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_error::W](W) writer structure"] +impl crate::Writable for EVENTS_ERROR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_ERROR to value 0"] +impl crate::Resettable for EVENTS_ERROR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/events_fielddetected.rs b/src/nfct/events_fielddetected.rs new file mode 100644 index 0000000..b3725d4 --- /dev/null +++ b/src/nfct/events_fielddetected.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_FIELDDETECTED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_FIELDDETECTED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Remote NFC field detected\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_fielddetected](index.html) module"] +pub struct EVENTS_FIELDDETECTED_SPEC; +impl crate::RegisterSpec for EVENTS_FIELDDETECTED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_fielddetected::R](R) reader structure"] +impl crate::Readable for EVENTS_FIELDDETECTED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_fielddetected::W](W) writer structure"] +impl crate::Writable for EVENTS_FIELDDETECTED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_FIELDDETECTED to value 0"] +impl crate::Resettable for EVENTS_FIELDDETECTED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/events_fieldlost.rs b/src/nfct/events_fieldlost.rs new file mode 100644 index 0000000..29e2f18 --- /dev/null +++ b/src/nfct/events_fieldlost.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_FIELDLOST` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_FIELDLOST` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Remote NFC field lost\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_fieldlost](index.html) module"] +pub struct EVENTS_FIELDLOST_SPEC; +impl crate::RegisterSpec for EVENTS_FIELDLOST_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_fieldlost::R](R) reader structure"] +impl crate::Readable for EVENTS_FIELDLOST_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_fieldlost::W](W) writer structure"] +impl crate::Writable for EVENTS_FIELDLOST_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_FIELDLOST to value 0"] +impl crate::Resettable for EVENTS_FIELDLOST_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/events_ready.rs b/src/nfct/events_ready.rs new file mode 100644 index 0000000..17d69c8 --- /dev/null +++ b/src/nfct/events_ready.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_READY` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_READY` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "The NFC peripheral is ready to receive and send frames\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_ready](index.html) module"] +pub struct EVENTS_READY_SPEC; +impl crate::RegisterSpec for EVENTS_READY_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_ready::R](R) reader structure"] +impl crate::Readable for EVENTS_READY_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_ready::W](W) writer structure"] +impl crate::Writable for EVENTS_READY_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_READY to value 0"] +impl crate::Resettable for EVENTS_READY_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/events_rxerror.rs b/src/nfct/events_rxerror.rs new file mode 100644 index 0000000..50cca9f --- /dev/null +++ b/src/nfct/events_rxerror.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_RXERROR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_RXERROR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "NFC RX frame error reported. The FRAMESTATUS.RX register contains details on the source of the error.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_rxerror](index.html) module"] +pub struct EVENTS_RXERROR_SPEC; +impl crate::RegisterSpec for EVENTS_RXERROR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_rxerror::R](R) reader structure"] +impl crate::Readable for EVENTS_RXERROR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_rxerror::W](W) writer structure"] +impl crate::Writable for EVENTS_RXERROR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_RXERROR to value 0"] +impl crate::Resettable for EVENTS_RXERROR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/events_rxframeend.rs b/src/nfct/events_rxframeend.rs new file mode 100644 index 0000000..16a92fd --- /dev/null +++ b/src/nfct/events_rxframeend.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_RXFRAMEEND` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_RXFRAMEEND` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Received data have been checked (CRC, parity) and transferred to RAM, and EasyDMA has ended accessing the RX buffer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_rxframeend](index.html) module"] +pub struct EVENTS_RXFRAMEEND_SPEC; +impl crate::RegisterSpec for EVENTS_RXFRAMEEND_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_rxframeend::R](R) reader structure"] +impl crate::Readable for EVENTS_RXFRAMEEND_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_rxframeend::W](W) writer structure"] +impl crate::Writable for EVENTS_RXFRAMEEND_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_RXFRAMEEND to value 0"] +impl crate::Resettable for EVENTS_RXFRAMEEND_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/events_rxframestart.rs b/src/nfct/events_rxframestart.rs new file mode 100644 index 0000000..d872279 --- /dev/null +++ b/src/nfct/events_rxframestart.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_RXFRAMESTART` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_RXFRAMESTART` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Marks the end of the first symbol of a received frame\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_rxframestart](index.html) module"] +pub struct EVENTS_RXFRAMESTART_SPEC; +impl crate::RegisterSpec for EVENTS_RXFRAMESTART_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_rxframestart::R](R) reader structure"] +impl crate::Readable for EVENTS_RXFRAMESTART_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_rxframestart::W](W) writer structure"] +impl crate::Writable for EVENTS_RXFRAMESTART_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_RXFRAMESTART to value 0"] +impl crate::Resettable for EVENTS_RXFRAMESTART_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/events_selected.rs b/src/nfct/events_selected.rs new file mode 100644 index 0000000..4f5fd21 --- /dev/null +++ b/src/nfct/events_selected.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_SELECTED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_SELECTED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "NFC Auto collision resolution successfully completed\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_selected](index.html) module"] +pub struct EVENTS_SELECTED_SPEC; +impl crate::RegisterSpec for EVENTS_SELECTED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_selected::R](R) reader structure"] +impl crate::Readable for EVENTS_SELECTED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_selected::W](W) writer structure"] +impl crate::Writable for EVENTS_SELECTED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_SELECTED to value 0"] +impl crate::Resettable for EVENTS_SELECTED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/events_started.rs b/src/nfct/events_started.rs new file mode 100644 index 0000000..89aee72 --- /dev/null +++ b/src/nfct/events_started.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_STARTED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_STARTED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "EasyDMA is ready to receive or send frames.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_started](index.html) module"] +pub struct EVENTS_STARTED_SPEC; +impl crate::RegisterSpec for EVENTS_STARTED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_started::R](R) reader structure"] +impl crate::Readable for EVENTS_STARTED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_started::W](W) writer structure"] +impl crate::Writable for EVENTS_STARTED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_STARTED to value 0"] +impl crate::Resettable for EVENTS_STARTED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/events_txframeend.rs b/src/nfct/events_txframeend.rs new file mode 100644 index 0000000..445d367 --- /dev/null +++ b/src/nfct/events_txframeend.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_TXFRAMEEND` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_TXFRAMEEND` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Marks the end of the last transmitted on-air symbol of a frame\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_txframeend](index.html) module"] +pub struct EVENTS_TXFRAMEEND_SPEC; +impl crate::RegisterSpec for EVENTS_TXFRAMEEND_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_txframeend::R](R) reader structure"] +impl crate::Readable for EVENTS_TXFRAMEEND_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_txframeend::W](W) writer structure"] +impl crate::Writable for EVENTS_TXFRAMEEND_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_TXFRAMEEND to value 0"] +impl crate::Resettable for EVENTS_TXFRAMEEND_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/events_txframestart.rs b/src/nfct/events_txframestart.rs new file mode 100644 index 0000000..658448b --- /dev/null +++ b/src/nfct/events_txframestart.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_TXFRAMESTART` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_TXFRAMESTART` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Marks the start of the first symbol of a transmitted frame\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_txframestart](index.html) module"] +pub struct EVENTS_TXFRAMESTART_SPEC; +impl crate::RegisterSpec for EVENTS_TXFRAMESTART_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_txframestart::R](R) reader structure"] +impl crate::Readable for EVENTS_TXFRAMESTART_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_txframestart::W](W) writer structure"] +impl crate::Writable for EVENTS_TXFRAMESTART_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_TXFRAMESTART to value 0"] +impl crate::Resettable for EVENTS_TXFRAMESTART_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/fieldpresent.rs b/src/nfct/fieldpresent.rs new file mode 100644 index 0000000..cd9cccc --- /dev/null +++ b/src/nfct/fieldpresent.rs @@ -0,0 +1,135 @@ +#[doc = "Register `FIELDPRESENT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Indicates the presence or not of a valid field. Available only in the activated state.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum FIELDPRESENT_A { + #[doc = "0: No valid field detected"] + NOFIELD = 0, + #[doc = "1: Valid field detected"] + FIELDPRESENT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: FIELDPRESENT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `FIELDPRESENT` reader - Indicates the presence or not of a valid field. Available only in the activated state."] +pub struct FIELDPRESENT_R(crate::FieldReader); +impl FIELDPRESENT_R { + pub(crate) fn new(bits: bool) -> Self { + FIELDPRESENT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> FIELDPRESENT_A { + match self.bits { + false => FIELDPRESENT_A::NOFIELD, + true => FIELDPRESENT_A::FIELDPRESENT, + } + } + #[doc = "Checks if the value of the field is `NOFIELD`"] + #[inline(always)] + pub fn is_no_field(&self) -> bool { + **self == FIELDPRESENT_A::NOFIELD + } + #[doc = "Checks if the value of the field is `FIELDPRESENT`"] + #[inline(always)] + pub fn is_field_present(&self) -> bool { + **self == FIELDPRESENT_A::FIELDPRESENT + } +} +impl core::ops::Deref for FIELDPRESENT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Indicates if the low level has locked to the field\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LOCKDETECT_A { + #[doc = "0: Not locked to field"] + NOTLOCKED = 0, + #[doc = "1: Locked to field"] + LOCKED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LOCKDETECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LOCKDETECT` reader - Indicates if the low level has locked to the field"] +pub struct LOCKDETECT_R(crate::FieldReader); +impl LOCKDETECT_R { + pub(crate) fn new(bits: bool) -> Self { + LOCKDETECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> LOCKDETECT_A { + match self.bits { + false => LOCKDETECT_A::NOTLOCKED, + true => LOCKDETECT_A::LOCKED, + } + } + #[doc = "Checks if the value of the field is `NOTLOCKED`"] + #[inline(always)] + pub fn is_not_locked(&self) -> bool { + **self == LOCKDETECT_A::NOTLOCKED + } + #[doc = "Checks if the value of the field is `LOCKED`"] + #[inline(always)] + pub fn is_locked(&self) -> bool { + **self == LOCKDETECT_A::LOCKED + } +} +impl core::ops::Deref for LOCKDETECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bit 0 - Indicates the presence or not of a valid field. Available only in the activated state."] + #[inline(always)] + pub fn fieldpresent(&self) -> FIELDPRESENT_R { + FIELDPRESENT_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Indicates if the low level has locked to the field"] + #[inline(always)] + pub fn lockdetect(&self) -> LOCKDETECT_R { + LOCKDETECT_R::new(((self.bits >> 1) & 0x01) != 0) + } +} +#[doc = "Indicates the presence or not of a valid field\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 [fieldpresent](index.html) module"] +pub struct FIELDPRESENT_SPEC; +impl crate::RegisterSpec for FIELDPRESENT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [fieldpresent::R](R) reader structure"] +impl crate::Readable for FIELDPRESENT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets FIELDPRESENT to value 0"] +impl crate::Resettable for FIELDPRESENT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/framedelaymax.rs b/src/nfct/framedelaymax.rs new file mode 100644 index 0000000..1d43157 --- /dev/null +++ b/src/nfct/framedelaymax.rs @@ -0,0 +1,102 @@ +#[doc = "Register `FRAMEDELAYMAX` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `FRAMEDELAYMAX` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `FRAMEDELAYMAX` reader - Maximum frame delay in number of 13.56 MHz clocks"] +pub struct FRAMEDELAYMAX_R(crate::FieldReader); +impl FRAMEDELAYMAX_R { + pub(crate) fn new(bits: u16) -> Self { + FRAMEDELAYMAX_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FRAMEDELAYMAX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FRAMEDELAYMAX` writer - Maximum frame delay in number of 13.56 MHz clocks"] +pub struct FRAMEDELAYMAX_W<'a> { + w: &'a mut W, +} +impl<'a> FRAMEDELAYMAX_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); + self.w + } +} +impl R { + #[doc = "Bits 0:15 - Maximum frame delay in number of 13.56 MHz clocks"] + #[inline(always)] + pub fn framedelaymax(&self) -> FRAMEDELAYMAX_R { + FRAMEDELAYMAX_R::new((self.bits & 0xffff) as u16) + } +} +impl W { + #[doc = "Bits 0:15 - Maximum frame delay in number of 13.56 MHz clocks"] + #[inline(always)] + pub fn framedelaymax(&mut self) -> FRAMEDELAYMAX_W { + FRAMEDELAYMAX_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Maximum frame delay\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [framedelaymax](index.html) module"] +pub struct FRAMEDELAYMAX_SPEC; +impl crate::RegisterSpec for FRAMEDELAYMAX_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [framedelaymax::R](R) reader structure"] +impl crate::Readable for FRAMEDELAYMAX_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [framedelaymax::W](W) writer structure"] +impl crate::Writable for FRAMEDELAYMAX_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets FRAMEDELAYMAX to value 0x1000"] +impl crate::Resettable for FRAMEDELAYMAX_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x1000 + } +} diff --git a/src/nfct/framedelaymin.rs b/src/nfct/framedelaymin.rs new file mode 100644 index 0000000..e171deb --- /dev/null +++ b/src/nfct/framedelaymin.rs @@ -0,0 +1,102 @@ +#[doc = "Register `FRAMEDELAYMIN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `FRAMEDELAYMIN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `FRAMEDELAYMIN` reader - Minimum frame delay in number of 13.56 MHz clocks"] +pub struct FRAMEDELAYMIN_R(crate::FieldReader); +impl FRAMEDELAYMIN_R { + pub(crate) fn new(bits: u16) -> Self { + FRAMEDELAYMIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FRAMEDELAYMIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FRAMEDELAYMIN` writer - Minimum frame delay in number of 13.56 MHz clocks"] +pub struct FRAMEDELAYMIN_W<'a> { + w: &'a mut W, +} +impl<'a> FRAMEDELAYMIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); + self.w + } +} +impl R { + #[doc = "Bits 0:15 - Minimum frame delay in number of 13.56 MHz clocks"] + #[inline(always)] + pub fn framedelaymin(&self) -> FRAMEDELAYMIN_R { + FRAMEDELAYMIN_R::new((self.bits & 0xffff) as u16) + } +} +impl W { + #[doc = "Bits 0:15 - Minimum frame delay in number of 13.56 MHz clocks"] + #[inline(always)] + pub fn framedelaymin(&mut self) -> FRAMEDELAYMIN_W { + FRAMEDELAYMIN_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Minimum frame delay\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [framedelaymin](index.html) module"] +pub struct FRAMEDELAYMIN_SPEC; +impl crate::RegisterSpec for FRAMEDELAYMIN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [framedelaymin::R](R) reader structure"] +impl crate::Readable for FRAMEDELAYMIN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [framedelaymin::W](W) writer structure"] +impl crate::Writable for FRAMEDELAYMIN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets FRAMEDELAYMIN to value 0x0480"] +impl crate::Resettable for FRAMEDELAYMIN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0480 + } +} diff --git a/src/nfct/framedelaymode.rs b/src/nfct/framedelaymode.rs new file mode 100644 index 0000000..d613963 --- /dev/null +++ b/src/nfct/framedelaymode.rs @@ -0,0 +1,177 @@ +#[doc = "Register `FRAMEDELAYMODE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `FRAMEDELAYMODE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Configuration register for the Frame Delay Timer\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum FRAMEDELAYMODE_A { + #[doc = "0: Transmission is independent of frame timer and will start when the STARTTX task is triggered. No timeout."] + FREERUN = 0, + #[doc = "1: Frame is transmitted between FRAMEDELAYMIN and FRAMEDELAYMAX"] + WINDOW = 1, + #[doc = "2: Frame is transmitted exactly at FRAMEDELAYMAX"] + EXACTVAL = 2, + #[doc = "3: Frame is transmitted on a bit grid between FRAMEDELAYMIN and FRAMEDELAYMAX"] + WINDOWGRID = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: FRAMEDELAYMODE_A) -> Self { + variant as _ + } +} +#[doc = "Field `FRAMEDELAYMODE` reader - Configuration register for the Frame Delay Timer"] +pub struct FRAMEDELAYMODE_R(crate::FieldReader); +impl FRAMEDELAYMODE_R { + pub(crate) fn new(bits: u8) -> Self { + FRAMEDELAYMODE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> FRAMEDELAYMODE_A { + match self.bits { + 0 => FRAMEDELAYMODE_A::FREERUN, + 1 => FRAMEDELAYMODE_A::WINDOW, + 2 => FRAMEDELAYMODE_A::EXACTVAL, + 3 => FRAMEDELAYMODE_A::WINDOWGRID, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `FREERUN`"] + #[inline(always)] + pub fn is_free_run(&self) -> bool { + **self == FRAMEDELAYMODE_A::FREERUN + } + #[doc = "Checks if the value of the field is `WINDOW`"] + #[inline(always)] + pub fn is_window(&self) -> bool { + **self == FRAMEDELAYMODE_A::WINDOW + } + #[doc = "Checks if the value of the field is `EXACTVAL`"] + #[inline(always)] + pub fn is_exact_val(&self) -> bool { + **self == FRAMEDELAYMODE_A::EXACTVAL + } + #[doc = "Checks if the value of the field is `WINDOWGRID`"] + #[inline(always)] + pub fn is_window_grid(&self) -> bool { + **self == FRAMEDELAYMODE_A::WINDOWGRID + } +} +impl core::ops::Deref for FRAMEDELAYMODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FRAMEDELAYMODE` writer - Configuration register for the Frame Delay Timer"] +pub struct FRAMEDELAYMODE_W<'a> { + w: &'a mut W, +} +impl<'a> FRAMEDELAYMODE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: FRAMEDELAYMODE_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "Transmission is independent of frame timer and will start when the STARTTX task is triggered. No timeout."] + #[inline(always)] + pub fn free_run(self) -> &'a mut W { + self.variant(FRAMEDELAYMODE_A::FREERUN) + } + #[doc = "Frame is transmitted between FRAMEDELAYMIN and FRAMEDELAYMAX"] + #[inline(always)] + pub fn window(self) -> &'a mut W { + self.variant(FRAMEDELAYMODE_A::WINDOW) + } + #[doc = "Frame is transmitted exactly at FRAMEDELAYMAX"] + #[inline(always)] + pub fn exact_val(self) -> &'a mut W { + self.variant(FRAMEDELAYMODE_A::EXACTVAL) + } + #[doc = "Frame is transmitted on a bit grid between FRAMEDELAYMIN and FRAMEDELAYMAX"] + #[inline(always)] + pub fn window_grid(self) -> &'a mut W { + self.variant(FRAMEDELAYMODE_A::WINDOWGRID) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); + self.w + } +} +impl R { + #[doc = "Bits 0:1 - Configuration register for the Frame Delay Timer"] + #[inline(always)] + pub fn framedelaymode(&self) -> FRAMEDELAYMODE_R { + FRAMEDELAYMODE_R::new((self.bits & 0x03) as u8) + } +} +impl W { + #[doc = "Bits 0:1 - Configuration register for the Frame Delay Timer"] + #[inline(always)] + pub fn framedelaymode(&mut self) -> FRAMEDELAYMODE_W { + FRAMEDELAYMODE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Configuration register for the Frame Delay Timer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [framedelaymode](index.html) module"] +pub struct FRAMEDELAYMODE_SPEC; +impl crate::RegisterSpec for FRAMEDELAYMODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [framedelaymode::R](R) reader structure"] +impl crate::Readable for FRAMEDELAYMODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [framedelaymode::W](W) writer structure"] +impl crate::Writable for FRAMEDELAYMODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets FRAMEDELAYMODE to value 0x01"] +impl crate::Resettable for FRAMEDELAYMODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x01 + } +} diff --git a/src/nfct/framestatus.rs b/src/nfct/framestatus.rs new file mode 100644 index 0000000..3aa7c90 --- /dev/null +++ b/src/nfct/framestatus.rs @@ -0,0 +1,4 @@ +#[doc = "RX register accessor: an alias for `Reg`"] +pub type RX = crate::Reg; +#[doc = "Result of last incoming frames"] +pub mod rx; diff --git a/src/nfct/framestatus/rx.rs b/src/nfct/framestatus/rx.rs new file mode 100644 index 0000000..855f23f --- /dev/null +++ b/src/nfct/framestatus/rx.rs @@ -0,0 +1,345 @@ +#[doc = "Register `RX` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `RX` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "No valid End of Frame detected\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CRCERROR_A { + #[doc = "0: Valid CRC detected"] + CRCCORRECT = 0, + #[doc = "1: CRC received does not match local check"] + CRCERROR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CRCERROR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CRCERROR` reader - No valid End of Frame detected"] +pub struct CRCERROR_R(crate::FieldReader); +impl CRCERROR_R { + pub(crate) fn new(bits: bool) -> Self { + CRCERROR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CRCERROR_A { + match self.bits { + false => CRCERROR_A::CRCCORRECT, + true => CRCERROR_A::CRCERROR, + } + } + #[doc = "Checks if the value of the field is `CRCCORRECT`"] + #[inline(always)] + pub fn is_crccorrect(&self) -> bool { + **self == CRCERROR_A::CRCCORRECT + } + #[doc = "Checks if the value of the field is `CRCERROR`"] + #[inline(always)] + pub fn is_crcerror(&self) -> bool { + **self == CRCERROR_A::CRCERROR + } +} +impl core::ops::Deref for CRCERROR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CRCERROR` writer - No valid End of Frame detected"] +pub struct CRCERROR_W<'a> { + w: &'a mut W, +} +impl<'a> CRCERROR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CRCERROR_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Valid CRC detected"] + #[inline(always)] + pub fn crccorrect(self) -> &'a mut W { + self.variant(CRCERROR_A::CRCCORRECT) + } + #[doc = "CRC received does not match local check"] + #[inline(always)] + pub fn crcerror(self) -> &'a mut W { + self.variant(CRCERROR_A::CRCERROR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Parity status of received frame\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PARITYSTATUS_A { + #[doc = "0: Frame received with parity OK"] + PARITYOK = 0, + #[doc = "1: Frame received with parity error"] + PARITYERROR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PARITYSTATUS_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PARITYSTATUS` reader - Parity status of received frame"] +pub struct PARITYSTATUS_R(crate::FieldReader); +impl PARITYSTATUS_R { + pub(crate) fn new(bits: bool) -> Self { + PARITYSTATUS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PARITYSTATUS_A { + match self.bits { + false => PARITYSTATUS_A::PARITYOK, + true => PARITYSTATUS_A::PARITYERROR, + } + } + #[doc = "Checks if the value of the field is `PARITYOK`"] + #[inline(always)] + pub fn is_parity_ok(&self) -> bool { + **self == PARITYSTATUS_A::PARITYOK + } + #[doc = "Checks if the value of the field is `PARITYERROR`"] + #[inline(always)] + pub fn is_parity_error(&self) -> bool { + **self == PARITYSTATUS_A::PARITYERROR + } +} +impl core::ops::Deref for PARITYSTATUS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PARITYSTATUS` writer - Parity status of received frame"] +pub struct PARITYSTATUS_W<'a> { + w: &'a mut W, +} +impl<'a> PARITYSTATUS_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PARITYSTATUS_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Frame received with parity OK"] + #[inline(always)] + pub fn parity_ok(self) -> &'a mut W { + self.variant(PARITYSTATUS_A::PARITYOK) + } + #[doc = "Frame received with parity error"] + #[inline(always)] + pub fn parity_error(self) -> &'a mut W { + self.variant(PARITYSTATUS_A::PARITYERROR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Overrun detected\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OVERRUN_A { + #[doc = "0: No overrun detected"] + NOOVERRUN = 0, + #[doc = "1: Overrun error"] + OVERRUN = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OVERRUN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OVERRUN` reader - Overrun detected"] +pub struct OVERRUN_R(crate::FieldReader); +impl OVERRUN_R { + pub(crate) fn new(bits: bool) -> Self { + OVERRUN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> OVERRUN_A { + match self.bits { + false => OVERRUN_A::NOOVERRUN, + true => OVERRUN_A::OVERRUN, + } + } + #[doc = "Checks if the value of the field is `NOOVERRUN`"] + #[inline(always)] + pub fn is_no_overrun(&self) -> bool { + **self == OVERRUN_A::NOOVERRUN + } + #[doc = "Checks if the value of the field is `OVERRUN`"] + #[inline(always)] + pub fn is_overrun(&self) -> bool { + **self == OVERRUN_A::OVERRUN + } +} +impl core::ops::Deref for OVERRUN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OVERRUN` writer - Overrun detected"] +pub struct OVERRUN_W<'a> { + w: &'a mut W, +} +impl<'a> OVERRUN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: OVERRUN_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No overrun detected"] + #[inline(always)] + pub fn no_overrun(self) -> &'a mut W { + self.variant(OVERRUN_A::NOOVERRUN) + } + #[doc = "Overrun error"] + #[inline(always)] + pub fn overrun(self) -> &'a mut W { + self.variant(OVERRUN_A::OVERRUN) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +impl R { + #[doc = "Bit 0 - No valid End of Frame detected"] + #[inline(always)] + pub fn crcerror(&self) -> CRCERROR_R { + CRCERROR_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 2 - Parity status of received frame"] + #[inline(always)] + pub fn paritystatus(&self) -> PARITYSTATUS_R { + PARITYSTATUS_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Overrun detected"] + #[inline(always)] + pub fn overrun(&self) -> OVERRUN_R { + OVERRUN_R::new(((self.bits >> 3) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - No valid End of Frame detected"] + #[inline(always)] + pub fn crcerror(&mut self) -> CRCERROR_W { + CRCERROR_W { w: self } + } + #[doc = "Bit 2 - Parity status of received frame"] + #[inline(always)] + pub fn paritystatus(&mut self) -> PARITYSTATUS_W { + PARITYSTATUS_W { w: self } + } + #[doc = "Bit 3 - Overrun detected"] + #[inline(always)] + pub fn overrun(&mut self) -> OVERRUN_W { + OVERRUN_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Result of last incoming frames\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rx](index.html) module"] +pub struct RX_SPEC; +impl crate::RegisterSpec for RX_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rx::R](R) reader structure"] +impl crate::Readable for RX_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [rx::W](W) writer structure"] +impl crate::Writable for RX_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets RX to value 0"] +impl crate::Resettable for RX_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/inten.rs b/src/nfct/inten.rs new file mode 100644 index 0000000..e1e6547 --- /dev/null +++ b/src/nfct/inten.rs @@ -0,0 +1,1461 @@ +#[doc = "Register `INTEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable interrupt for READY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY` reader - Enable or disable interrupt for READY event"] +pub struct READY_R(crate::FieldReader); +impl READY_R { + pub(crate) fn new(bits: bool) -> Self { + READY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> READY_A { + match self.bits { + false => READY_A::DISABLED, + true => READY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == READY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == READY_A::ENABLED + } +} +impl core::ops::Deref for READY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `READY` writer - Enable or disable interrupt for READY event"] +pub struct READY_W<'a> { + w: &'a mut W, +} +impl<'a> READY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: READY_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(READY_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(READY_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Enable or disable interrupt for FIELDDETECTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum FIELDDETECTED_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: FIELDDETECTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `FIELDDETECTED` reader - Enable or disable interrupt for FIELDDETECTED event"] +pub struct FIELDDETECTED_R(crate::FieldReader); +impl FIELDDETECTED_R { + pub(crate) fn new(bits: bool) -> Self { + FIELDDETECTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> FIELDDETECTED_A { + match self.bits { + false => FIELDDETECTED_A::DISABLED, + true => FIELDDETECTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == FIELDDETECTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == FIELDDETECTED_A::ENABLED + } +} +impl core::ops::Deref for FIELDDETECTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FIELDDETECTED` writer - Enable or disable interrupt for FIELDDETECTED event"] +pub struct FIELDDETECTED_W<'a> { + w: &'a mut W, +} +impl<'a> FIELDDETECTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: FIELDDETECTED_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(FIELDDETECTED_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(FIELDDETECTED_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Enable or disable interrupt for FIELDLOST event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum FIELDLOST_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: FIELDLOST_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `FIELDLOST` reader - Enable or disable interrupt for FIELDLOST event"] +pub struct FIELDLOST_R(crate::FieldReader); +impl FIELDLOST_R { + pub(crate) fn new(bits: bool) -> Self { + FIELDLOST_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> FIELDLOST_A { + match self.bits { + false => FIELDLOST_A::DISABLED, + true => FIELDLOST_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == FIELDLOST_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == FIELDLOST_A::ENABLED + } +} +impl core::ops::Deref for FIELDLOST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FIELDLOST` writer - Enable or disable interrupt for FIELDLOST event"] +pub struct FIELDLOST_W<'a> { + w: &'a mut W, +} +impl<'a> FIELDLOST_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: FIELDLOST_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(FIELDLOST_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(FIELDLOST_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Enable or disable interrupt for TXFRAMESTART event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXFRAMESTART_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXFRAMESTART_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXFRAMESTART` reader - Enable or disable interrupt for TXFRAMESTART event"] +pub struct TXFRAMESTART_R(crate::FieldReader); +impl TXFRAMESTART_R { + pub(crate) fn new(bits: bool) -> Self { + TXFRAMESTART_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXFRAMESTART_A { + match self.bits { + false => TXFRAMESTART_A::DISABLED, + true => TXFRAMESTART_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXFRAMESTART_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXFRAMESTART_A::ENABLED + } +} +impl core::ops::Deref for TXFRAMESTART_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TXFRAMESTART` writer - Enable or disable interrupt for TXFRAMESTART event"] +pub struct TXFRAMESTART_W<'a> { + w: &'a mut W, +} +impl<'a> TXFRAMESTART_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXFRAMESTART_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(TXFRAMESTART_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(TXFRAMESTART_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Enable or disable interrupt for TXFRAMEEND event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXFRAMEEND_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXFRAMEEND_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXFRAMEEND` reader - Enable or disable interrupt for TXFRAMEEND event"] +pub struct TXFRAMEEND_R(crate::FieldReader); +impl TXFRAMEEND_R { + pub(crate) fn new(bits: bool) -> Self { + TXFRAMEEND_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXFRAMEEND_A { + match self.bits { + false => TXFRAMEEND_A::DISABLED, + true => TXFRAMEEND_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXFRAMEEND_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXFRAMEEND_A::ENABLED + } +} +impl core::ops::Deref for TXFRAMEEND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TXFRAMEEND` writer - Enable or disable interrupt for TXFRAMEEND event"] +pub struct TXFRAMEEND_W<'a> { + w: &'a mut W, +} +impl<'a> TXFRAMEEND_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXFRAMEEND_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(TXFRAMEEND_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(TXFRAMEEND_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Enable or disable interrupt for RXFRAMESTART event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXFRAMESTART_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXFRAMESTART_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXFRAMESTART` reader - Enable or disable interrupt for RXFRAMESTART event"] +pub struct RXFRAMESTART_R(crate::FieldReader); +impl RXFRAMESTART_R { + pub(crate) fn new(bits: bool) -> Self { + RXFRAMESTART_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXFRAMESTART_A { + match self.bits { + false => RXFRAMESTART_A::DISABLED, + true => RXFRAMESTART_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXFRAMESTART_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXFRAMESTART_A::ENABLED + } +} +impl core::ops::Deref for RXFRAMESTART_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RXFRAMESTART` writer - Enable or disable interrupt for RXFRAMESTART event"] +pub struct RXFRAMESTART_W<'a> { + w: &'a mut W, +} +impl<'a> RXFRAMESTART_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXFRAMESTART_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(RXFRAMESTART_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(RXFRAMESTART_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Enable or disable interrupt for RXFRAMEEND event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXFRAMEEND_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXFRAMEEND_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXFRAMEEND` reader - Enable or disable interrupt for RXFRAMEEND event"] +pub struct RXFRAMEEND_R(crate::FieldReader); +impl RXFRAMEEND_R { + pub(crate) fn new(bits: bool) -> Self { + RXFRAMEEND_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXFRAMEEND_A { + match self.bits { + false => RXFRAMEEND_A::DISABLED, + true => RXFRAMEEND_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXFRAMEEND_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXFRAMEEND_A::ENABLED + } +} +impl core::ops::Deref for RXFRAMEEND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RXFRAMEEND` writer - Enable or disable interrupt for RXFRAMEEND event"] +pub struct RXFRAMEEND_W<'a> { + w: &'a mut W, +} +impl<'a> RXFRAMEEND_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXFRAMEEND_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(RXFRAMEEND_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(RXFRAMEEND_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Enable or disable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` reader - Enable or disable interrupt for ERROR event"] +pub struct ERROR_R(crate::FieldReader); +impl ERROR_R { + pub(crate) fn new(bits: bool) -> Self { + ERROR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ERROR_A { + match self.bits { + false => ERROR_A::DISABLED, + true => ERROR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ERROR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ERROR_A::ENABLED + } +} +impl core::ops::Deref for ERROR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ERROR` writer - Enable or disable interrupt for ERROR event"] +pub struct ERROR_W<'a> { + w: &'a mut W, +} +impl<'a> ERROR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ERROR_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ERROR_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ERROR_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Enable or disable interrupt for RXERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXERROR_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXERROR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXERROR` reader - Enable or disable interrupt for RXERROR event"] +pub struct RXERROR_R(crate::FieldReader); +impl RXERROR_R { + pub(crate) fn new(bits: bool) -> Self { + RXERROR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXERROR_A { + match self.bits { + false => RXERROR_A::DISABLED, + true => RXERROR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXERROR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXERROR_A::ENABLED + } +} +impl core::ops::Deref for RXERROR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RXERROR` writer - Enable or disable interrupt for RXERROR event"] +pub struct RXERROR_W<'a> { + w: &'a mut W, +} +impl<'a> RXERROR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXERROR_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(RXERROR_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(RXERROR_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Enable or disable interrupt for ENDRX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDRX_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDRX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDRX` reader - Enable or disable interrupt for ENDRX event"] +pub struct ENDRX_R(crate::FieldReader); +impl ENDRX_R { + pub(crate) fn new(bits: bool) -> Self { + ENDRX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDRX_A { + match self.bits { + false => ENDRX_A::DISABLED, + true => ENDRX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENDRX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENDRX_A::ENABLED + } +} +impl core::ops::Deref for ENDRX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENDRX` writer - Enable or disable interrupt for ENDRX event"] +pub struct ENDRX_W<'a> { + w: &'a mut W, +} +impl<'a> ENDRX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDRX_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENDRX_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENDRX_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Enable or disable interrupt for ENDTX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDTX_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDTX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDTX` reader - Enable or disable interrupt for ENDTX event"] +pub struct ENDTX_R(crate::FieldReader); +impl ENDTX_R { + pub(crate) fn new(bits: bool) -> Self { + ENDTX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDTX_A { + match self.bits { + false => ENDTX_A::DISABLED, + true => ENDTX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENDTX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENDTX_A::ENABLED + } +} +impl core::ops::Deref for ENDTX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENDTX` writer - Enable or disable interrupt for ENDTX event"] +pub struct ENDTX_W<'a> { + w: &'a mut W, +} +impl<'a> ENDTX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDTX_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENDTX_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENDTX_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Enable or disable interrupt for AUTOCOLRESSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum AUTOCOLRESSTARTED_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: AUTOCOLRESSTARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `AUTOCOLRESSTARTED` reader - Enable or disable interrupt for AUTOCOLRESSTARTED event"] +pub struct AUTOCOLRESSTARTED_R(crate::FieldReader); +impl AUTOCOLRESSTARTED_R { + pub(crate) fn new(bits: bool) -> Self { + AUTOCOLRESSTARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> AUTOCOLRESSTARTED_A { + match self.bits { + false => AUTOCOLRESSTARTED_A::DISABLED, + true => AUTOCOLRESSTARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == AUTOCOLRESSTARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == AUTOCOLRESSTARTED_A::ENABLED + } +} +impl core::ops::Deref for AUTOCOLRESSTARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AUTOCOLRESSTARTED` writer - Enable or disable interrupt for AUTOCOLRESSTARTED event"] +pub struct AUTOCOLRESSTARTED_W<'a> { + w: &'a mut W, +} +impl<'a> AUTOCOLRESSTARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: AUTOCOLRESSTARTED_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(AUTOCOLRESSTARTED_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(AUTOCOLRESSTARTED_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Enable or disable interrupt for COLLISION event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COLLISION_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COLLISION_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COLLISION` reader - Enable or disable interrupt for COLLISION event"] +pub struct COLLISION_R(crate::FieldReader); +impl COLLISION_R { + pub(crate) fn new(bits: bool) -> Self { + COLLISION_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COLLISION_A { + match self.bits { + false => COLLISION_A::DISABLED, + true => COLLISION_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COLLISION_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COLLISION_A::ENABLED + } +} +impl core::ops::Deref for COLLISION_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `COLLISION` writer - Enable or disable interrupt for COLLISION event"] +pub struct COLLISION_W<'a> { + w: &'a mut W, +} +impl<'a> COLLISION_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COLLISION_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(COLLISION_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(COLLISION_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Enable or disable interrupt for SELECTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SELECTED_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SELECTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SELECTED` reader - Enable or disable interrupt for SELECTED event"] +pub struct SELECTED_R(crate::FieldReader); +impl SELECTED_R { + pub(crate) fn new(bits: bool) -> Self { + SELECTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SELECTED_A { + match self.bits { + false => SELECTED_A::DISABLED, + true => SELECTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SELECTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SELECTED_A::ENABLED + } +} +impl core::ops::Deref for SELECTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SELECTED` writer - Enable or disable interrupt for SELECTED event"] +pub struct SELECTED_W<'a> { + w: &'a mut W, +} +impl<'a> SELECTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SELECTED_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(SELECTED_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(SELECTED_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Enable or disable interrupt for STARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STARTED_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STARTED` reader - Enable or disable interrupt for STARTED event"] +pub struct STARTED_R(crate::FieldReader); +impl STARTED_R { + pub(crate) fn new(bits: bool) -> Self { + STARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STARTED_A { + match self.bits { + false => STARTED_A::DISABLED, + true => STARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STARTED_A::ENABLED + } +} +impl core::ops::Deref for STARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STARTED` writer - Enable or disable interrupt for STARTED event"] +pub struct STARTED_W<'a> { + w: &'a mut W, +} +impl<'a> STARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STARTED_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(STARTED_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(STARTED_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable or disable interrupt for READY event"] + #[inline(always)] + pub fn ready(&self) -> READY_R { + READY_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Enable or disable interrupt for FIELDDETECTED event"] + #[inline(always)] + pub fn fielddetected(&self) -> FIELDDETECTED_R { + FIELDDETECTED_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Enable or disable interrupt for FIELDLOST event"] + #[inline(always)] + pub fn fieldlost(&self) -> FIELDLOST_R { + FIELDLOST_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Enable or disable interrupt for TXFRAMESTART event"] + #[inline(always)] + pub fn txframestart(&self) -> TXFRAMESTART_R { + TXFRAMESTART_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Enable or disable interrupt for TXFRAMEEND event"] + #[inline(always)] + pub fn txframeend(&self) -> TXFRAMEEND_R { + TXFRAMEEND_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Enable or disable interrupt for RXFRAMESTART event"] + #[inline(always)] + pub fn rxframestart(&self) -> RXFRAMESTART_R { + RXFRAMESTART_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Enable or disable interrupt for RXFRAMEEND event"] + #[inline(always)] + pub fn rxframeend(&self) -> RXFRAMEEND_R { + RXFRAMEEND_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Enable or disable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&self) -> ERROR_R { + ERROR_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 10 - Enable or disable interrupt for RXERROR event"] + #[inline(always)] + pub fn rxerror(&self) -> RXERROR_R { + RXERROR_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Enable or disable interrupt for ENDRX event"] + #[inline(always)] + pub fn endrx(&self) -> ENDRX_R { + ENDRX_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Enable or disable interrupt for ENDTX event"] + #[inline(always)] + pub fn endtx(&self) -> ENDTX_R { + ENDTX_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 14 - Enable or disable interrupt for AUTOCOLRESSTARTED event"] + #[inline(always)] + pub fn autocolresstarted(&self) -> AUTOCOLRESSTARTED_R { + AUTOCOLRESSTARTED_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 18 - Enable or disable interrupt for COLLISION event"] + #[inline(always)] + pub fn collision(&self) -> COLLISION_R { + COLLISION_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Enable or disable interrupt for SELECTED event"] + #[inline(always)] + pub fn selected(&self) -> SELECTED_R { + SELECTED_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Enable or disable interrupt for STARTED event"] + #[inline(always)] + pub fn started(&self) -> STARTED_R { + STARTED_R::new(((self.bits >> 20) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Enable or disable interrupt for READY event"] + #[inline(always)] + pub fn ready(&mut self) -> READY_W { + READY_W { w: self } + } + #[doc = "Bit 1 - Enable or disable interrupt for FIELDDETECTED event"] + #[inline(always)] + pub fn fielddetected(&mut self) -> FIELDDETECTED_W { + FIELDDETECTED_W { w: self } + } + #[doc = "Bit 2 - Enable or disable interrupt for FIELDLOST event"] + #[inline(always)] + pub fn fieldlost(&mut self) -> FIELDLOST_W { + FIELDLOST_W { w: self } + } + #[doc = "Bit 3 - Enable or disable interrupt for TXFRAMESTART event"] + #[inline(always)] + pub fn txframestart(&mut self) -> TXFRAMESTART_W { + TXFRAMESTART_W { w: self } + } + #[doc = "Bit 4 - Enable or disable interrupt for TXFRAMEEND event"] + #[inline(always)] + pub fn txframeend(&mut self) -> TXFRAMEEND_W { + TXFRAMEEND_W { w: self } + } + #[doc = "Bit 5 - Enable or disable interrupt for RXFRAMESTART event"] + #[inline(always)] + pub fn rxframestart(&mut self) -> RXFRAMESTART_W { + RXFRAMESTART_W { w: self } + } + #[doc = "Bit 6 - Enable or disable interrupt for RXFRAMEEND event"] + #[inline(always)] + pub fn rxframeend(&mut self) -> RXFRAMEEND_W { + RXFRAMEEND_W { w: self } + } + #[doc = "Bit 7 - Enable or disable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&mut self) -> ERROR_W { + ERROR_W { w: self } + } + #[doc = "Bit 10 - Enable or disable interrupt for RXERROR event"] + #[inline(always)] + pub fn rxerror(&mut self) -> RXERROR_W { + RXERROR_W { w: self } + } + #[doc = "Bit 11 - Enable or disable interrupt for ENDRX event"] + #[inline(always)] + pub fn endrx(&mut self) -> ENDRX_W { + ENDRX_W { w: self } + } + #[doc = "Bit 12 - Enable or disable interrupt for ENDTX event"] + #[inline(always)] + pub fn endtx(&mut self) -> ENDTX_W { + ENDTX_W { w: self } + } + #[doc = "Bit 14 - Enable or disable interrupt for AUTOCOLRESSTARTED event"] + #[inline(always)] + pub fn autocolresstarted(&mut self) -> AUTOCOLRESSTARTED_W { + AUTOCOLRESSTARTED_W { w: self } + } + #[doc = "Bit 18 - Enable or disable interrupt for COLLISION event"] + #[inline(always)] + pub fn collision(&mut self) -> COLLISION_W { + COLLISION_W { w: self } + } + #[doc = "Bit 19 - Enable or disable interrupt for SELECTED event"] + #[inline(always)] + pub fn selected(&mut self) -> SELECTED_W { + SELECTED_W { w: self } + } + #[doc = "Bit 20 - Enable or disable interrupt for STARTED event"] + #[inline(always)] + pub fn started(&mut self) -> STARTED_W { + STARTED_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable or disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [inten](index.html) module"] +pub struct INTEN_SPEC; +impl crate::RegisterSpec for INTEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [inten::R](R) reader structure"] +impl crate::Readable for INTEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [inten::W](W) writer structure"] +impl crate::Writable for INTEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTEN to value 0"] +impl crate::Resettable for INTEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/intenclr.rs b/src/nfct/intenclr.rs new file mode 100644 index 0000000..fc059d6 --- /dev/null +++ b/src/nfct/intenclr.rs @@ -0,0 +1,1566 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for READY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY` reader - Write '1' to Disable interrupt for READY event"] +pub struct READY_R(crate::FieldReader); +impl READY_R { + pub(crate) fn new(bits: bool) -> Self { + READY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> READY_A { + match self.bits { + false => READY_A::DISABLED, + true => READY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == READY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == READY_A::ENABLED + } +} +impl core::ops::Deref for READY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for READY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY` writer - Write '1' to Disable interrupt for READY event"] +pub struct READY_W<'a> { + w: &'a mut W, +} +impl<'a> READY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: READY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(READY_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for FIELDDETECTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum FIELDDETECTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: FIELDDETECTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `FIELDDETECTED` reader - Write '1' to Disable interrupt for FIELDDETECTED event"] +pub struct FIELDDETECTED_R(crate::FieldReader); +impl FIELDDETECTED_R { + pub(crate) fn new(bits: bool) -> Self { + FIELDDETECTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> FIELDDETECTED_A { + match self.bits { + false => FIELDDETECTED_A::DISABLED, + true => FIELDDETECTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == FIELDDETECTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == FIELDDETECTED_A::ENABLED + } +} +impl core::ops::Deref for FIELDDETECTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for FIELDDETECTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum FIELDDETECTED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: FIELDDETECTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `FIELDDETECTED` writer - Write '1' to Disable interrupt for FIELDDETECTED event"] +pub struct FIELDDETECTED_W<'a> { + w: &'a mut W, +} +impl<'a> FIELDDETECTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: FIELDDETECTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(FIELDDETECTED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for FIELDLOST event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum FIELDLOST_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: FIELDLOST_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `FIELDLOST` reader - Write '1' to Disable interrupt for FIELDLOST event"] +pub struct FIELDLOST_R(crate::FieldReader); +impl FIELDLOST_R { + pub(crate) fn new(bits: bool) -> Self { + FIELDLOST_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> FIELDLOST_A { + match self.bits { + false => FIELDLOST_A::DISABLED, + true => FIELDLOST_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == FIELDLOST_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == FIELDLOST_A::ENABLED + } +} +impl core::ops::Deref for FIELDLOST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for FIELDLOST event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum FIELDLOST_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: FIELDLOST_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `FIELDLOST` writer - Write '1' to Disable interrupt for FIELDLOST event"] +pub struct FIELDLOST_W<'a> { + w: &'a mut W, +} +impl<'a> FIELDLOST_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: FIELDLOST_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(FIELDLOST_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for TXFRAMESTART event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXFRAMESTART_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXFRAMESTART_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXFRAMESTART` reader - Write '1' to Disable interrupt for TXFRAMESTART event"] +pub struct TXFRAMESTART_R(crate::FieldReader); +impl TXFRAMESTART_R { + pub(crate) fn new(bits: bool) -> Self { + TXFRAMESTART_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXFRAMESTART_A { + match self.bits { + false => TXFRAMESTART_A::DISABLED, + true => TXFRAMESTART_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXFRAMESTART_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXFRAMESTART_A::ENABLED + } +} +impl core::ops::Deref for TXFRAMESTART_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TXFRAMESTART event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXFRAMESTART_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXFRAMESTART_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXFRAMESTART` writer - Write '1' to Disable interrupt for TXFRAMESTART event"] +pub struct TXFRAMESTART_W<'a> { + w: &'a mut W, +} +impl<'a> TXFRAMESTART_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXFRAMESTART_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TXFRAMESTART_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for TXFRAMEEND event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXFRAMEEND_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXFRAMEEND_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXFRAMEEND` reader - Write '1' to Disable interrupt for TXFRAMEEND event"] +pub struct TXFRAMEEND_R(crate::FieldReader); +impl TXFRAMEEND_R { + pub(crate) fn new(bits: bool) -> Self { + TXFRAMEEND_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXFRAMEEND_A { + match self.bits { + false => TXFRAMEEND_A::DISABLED, + true => TXFRAMEEND_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXFRAMEEND_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXFRAMEEND_A::ENABLED + } +} +impl core::ops::Deref for TXFRAMEEND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TXFRAMEEND event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXFRAMEEND_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXFRAMEEND_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXFRAMEEND` writer - Write '1' to Disable interrupt for TXFRAMEEND event"] +pub struct TXFRAMEEND_W<'a> { + w: &'a mut W, +} +impl<'a> TXFRAMEEND_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXFRAMEEND_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TXFRAMEEND_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for RXFRAMESTART event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXFRAMESTART_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXFRAMESTART_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXFRAMESTART` reader - Write '1' to Disable interrupt for RXFRAMESTART event"] +pub struct RXFRAMESTART_R(crate::FieldReader); +impl RXFRAMESTART_R { + pub(crate) fn new(bits: bool) -> Self { + RXFRAMESTART_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXFRAMESTART_A { + match self.bits { + false => RXFRAMESTART_A::DISABLED, + true => RXFRAMESTART_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXFRAMESTART_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXFRAMESTART_A::ENABLED + } +} +impl core::ops::Deref for RXFRAMESTART_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for RXFRAMESTART event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXFRAMESTART_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXFRAMESTART_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXFRAMESTART` writer - Write '1' to Disable interrupt for RXFRAMESTART event"] +pub struct RXFRAMESTART_W<'a> { + w: &'a mut W, +} +impl<'a> RXFRAMESTART_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXFRAMESTART_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(RXFRAMESTART_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for RXFRAMEEND event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXFRAMEEND_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXFRAMEEND_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXFRAMEEND` reader - Write '1' to Disable interrupt for RXFRAMEEND event"] +pub struct RXFRAMEEND_R(crate::FieldReader); +impl RXFRAMEEND_R { + pub(crate) fn new(bits: bool) -> Self { + RXFRAMEEND_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXFRAMEEND_A { + match self.bits { + false => RXFRAMEEND_A::DISABLED, + true => RXFRAMEEND_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXFRAMEEND_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXFRAMEEND_A::ENABLED + } +} +impl core::ops::Deref for RXFRAMEEND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for RXFRAMEEND event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXFRAMEEND_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXFRAMEEND_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXFRAMEEND` writer - Write '1' to Disable interrupt for RXFRAMEEND event"] +pub struct RXFRAMEEND_W<'a> { + w: &'a mut W, +} +impl<'a> RXFRAMEEND_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXFRAMEEND_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(RXFRAMEEND_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` reader - Write '1' to Disable interrupt for ERROR event"] +pub struct ERROR_R(crate::FieldReader); +impl ERROR_R { + pub(crate) fn new(bits: bool) -> Self { + ERROR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ERROR_A { + match self.bits { + false => ERROR_A::DISABLED, + true => ERROR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ERROR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ERROR_A::ENABLED + } +} +impl core::ops::Deref for ERROR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` writer - Write '1' to Disable interrupt for ERROR event"] +pub struct ERROR_W<'a> { + w: &'a mut W, +} +impl<'a> ERROR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ERROR_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(ERROR_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for RXERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXERROR_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXERROR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXERROR` reader - Write '1' to Disable interrupt for RXERROR event"] +pub struct RXERROR_R(crate::FieldReader); +impl RXERROR_R { + pub(crate) fn new(bits: bool) -> Self { + RXERROR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXERROR_A { + match self.bits { + false => RXERROR_A::DISABLED, + true => RXERROR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXERROR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXERROR_A::ENABLED + } +} +impl core::ops::Deref for RXERROR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for RXERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXERROR_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXERROR_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXERROR` writer - Write '1' to Disable interrupt for RXERROR event"] +pub struct RXERROR_W<'a> { + w: &'a mut W, +} +impl<'a> RXERROR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXERROR_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(RXERROR_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for ENDRX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDRX_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDRX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDRX` reader - Write '1' to Disable interrupt for ENDRX event"] +pub struct ENDRX_R(crate::FieldReader); +impl ENDRX_R { + pub(crate) fn new(bits: bool) -> Self { + ENDRX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDRX_A { + match self.bits { + false => ENDRX_A::DISABLED, + true => ENDRX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENDRX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENDRX_A::ENABLED + } +} +impl core::ops::Deref for ENDRX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for ENDRX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDRX_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDRX_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDRX` writer - Write '1' to Disable interrupt for ENDRX event"] +pub struct ENDRX_W<'a> { + w: &'a mut W, +} +impl<'a> ENDRX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDRX_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(ENDRX_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for ENDTX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDTX_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDTX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDTX` reader - Write '1' to Disable interrupt for ENDTX event"] +pub struct ENDTX_R(crate::FieldReader); +impl ENDTX_R { + pub(crate) fn new(bits: bool) -> Self { + ENDTX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDTX_A { + match self.bits { + false => ENDTX_A::DISABLED, + true => ENDTX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENDTX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENDTX_A::ENABLED + } +} +impl core::ops::Deref for ENDTX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for ENDTX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDTX_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDTX_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDTX` writer - Write '1' to Disable interrupt for ENDTX event"] +pub struct ENDTX_W<'a> { + w: &'a mut W, +} +impl<'a> ENDTX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDTX_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(ENDTX_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for AUTOCOLRESSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum AUTOCOLRESSTARTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: AUTOCOLRESSTARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `AUTOCOLRESSTARTED` reader - Write '1' to Disable interrupt for AUTOCOLRESSTARTED event"] +pub struct AUTOCOLRESSTARTED_R(crate::FieldReader); +impl AUTOCOLRESSTARTED_R { + pub(crate) fn new(bits: bool) -> Self { + AUTOCOLRESSTARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> AUTOCOLRESSTARTED_A { + match self.bits { + false => AUTOCOLRESSTARTED_A::DISABLED, + true => AUTOCOLRESSTARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == AUTOCOLRESSTARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == AUTOCOLRESSTARTED_A::ENABLED + } +} +impl core::ops::Deref for AUTOCOLRESSTARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for AUTOCOLRESSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum AUTOCOLRESSTARTED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: AUTOCOLRESSTARTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `AUTOCOLRESSTARTED` writer - Write '1' to Disable interrupt for AUTOCOLRESSTARTED event"] +pub struct AUTOCOLRESSTARTED_W<'a> { + w: &'a mut W, +} +impl<'a> AUTOCOLRESSTARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: AUTOCOLRESSTARTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(AUTOCOLRESSTARTED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for COLLISION event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COLLISION_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COLLISION_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COLLISION` reader - Write '1' to Disable interrupt for COLLISION event"] +pub struct COLLISION_R(crate::FieldReader); +impl COLLISION_R { + pub(crate) fn new(bits: bool) -> Self { + COLLISION_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COLLISION_A { + match self.bits { + false => COLLISION_A::DISABLED, + true => COLLISION_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COLLISION_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COLLISION_A::ENABLED + } +} +impl core::ops::Deref for COLLISION_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for COLLISION event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COLLISION_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COLLISION_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COLLISION` writer - Write '1' to Disable interrupt for COLLISION event"] +pub struct COLLISION_W<'a> { + w: &'a mut W, +} +impl<'a> COLLISION_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COLLISION_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(COLLISION_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for SELECTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SELECTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SELECTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SELECTED` reader - Write '1' to Disable interrupt for SELECTED event"] +pub struct SELECTED_R(crate::FieldReader); +impl SELECTED_R { + pub(crate) fn new(bits: bool) -> Self { + SELECTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SELECTED_A { + match self.bits { + false => SELECTED_A::DISABLED, + true => SELECTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SELECTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SELECTED_A::ENABLED + } +} +impl core::ops::Deref for SELECTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for SELECTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SELECTED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SELECTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SELECTED` writer - Write '1' to Disable interrupt for SELECTED event"] +pub struct SELECTED_W<'a> { + w: &'a mut W, +} +impl<'a> SELECTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SELECTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(SELECTED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for STARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STARTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STARTED` reader - Write '1' to Disable interrupt for STARTED event"] +pub struct STARTED_R(crate::FieldReader); +impl STARTED_R { + pub(crate) fn new(bits: bool) -> Self { + STARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STARTED_A { + match self.bits { + false => STARTED_A::DISABLED, + true => STARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STARTED_A::ENABLED + } +} +impl core::ops::Deref for STARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for STARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STARTED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STARTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STARTED` writer - Write '1' to Disable interrupt for STARTED event"] +pub struct STARTED_W<'a> { + w: &'a mut W, +} +impl<'a> STARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STARTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(STARTED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Disable interrupt for READY event"] + #[inline(always)] + pub fn ready(&self) -> READY_R { + READY_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for FIELDDETECTED event"] + #[inline(always)] + pub fn fielddetected(&self) -> FIELDDETECTED_R { + FIELDDETECTED_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for FIELDLOST event"] + #[inline(always)] + pub fn fieldlost(&self) -> FIELDLOST_R { + FIELDLOST_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Write '1' to Disable interrupt for TXFRAMESTART event"] + #[inline(always)] + pub fn txframestart(&self) -> TXFRAMESTART_R { + TXFRAMESTART_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Write '1' to Disable interrupt for TXFRAMEEND event"] + #[inline(always)] + pub fn txframeend(&self) -> TXFRAMEEND_R { + TXFRAMEEND_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Write '1' to Disable interrupt for RXFRAMESTART event"] + #[inline(always)] + pub fn rxframestart(&self) -> RXFRAMESTART_R { + RXFRAMESTART_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Write '1' to Disable interrupt for RXFRAMEEND event"] + #[inline(always)] + pub fn rxframeend(&self) -> RXFRAMEEND_R { + RXFRAMEEND_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Write '1' to Disable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&self) -> ERROR_R { + ERROR_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 10 - Write '1' to Disable interrupt for RXERROR event"] + #[inline(always)] + pub fn rxerror(&self) -> RXERROR_R { + RXERROR_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Write '1' to Disable interrupt for ENDRX event"] + #[inline(always)] + pub fn endrx(&self) -> ENDRX_R { + ENDRX_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Write '1' to Disable interrupt for ENDTX event"] + #[inline(always)] + pub fn endtx(&self) -> ENDTX_R { + ENDTX_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 14 - Write '1' to Disable interrupt for AUTOCOLRESSTARTED event"] + #[inline(always)] + pub fn autocolresstarted(&self) -> AUTOCOLRESSTARTED_R { + AUTOCOLRESSTARTED_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 18 - Write '1' to Disable interrupt for COLLISION event"] + #[inline(always)] + pub fn collision(&self) -> COLLISION_R { + COLLISION_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Write '1' to Disable interrupt for SELECTED event"] + #[inline(always)] + pub fn selected(&self) -> SELECTED_R { + SELECTED_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Write '1' to Disable interrupt for STARTED event"] + #[inline(always)] + pub fn started(&self) -> STARTED_R { + STARTED_R::new(((self.bits >> 20) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Disable interrupt for READY event"] + #[inline(always)] + pub fn ready(&mut self) -> READY_W { + READY_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for FIELDDETECTED event"] + #[inline(always)] + pub fn fielddetected(&mut self) -> FIELDDETECTED_W { + FIELDDETECTED_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for FIELDLOST event"] + #[inline(always)] + pub fn fieldlost(&mut self) -> FIELDLOST_W { + FIELDLOST_W { w: self } + } + #[doc = "Bit 3 - Write '1' to Disable interrupt for TXFRAMESTART event"] + #[inline(always)] + pub fn txframestart(&mut self) -> TXFRAMESTART_W { + TXFRAMESTART_W { w: self } + } + #[doc = "Bit 4 - Write '1' to Disable interrupt for TXFRAMEEND event"] + #[inline(always)] + pub fn txframeend(&mut self) -> TXFRAMEEND_W { + TXFRAMEEND_W { w: self } + } + #[doc = "Bit 5 - Write '1' to Disable interrupt for RXFRAMESTART event"] + #[inline(always)] + pub fn rxframestart(&mut self) -> RXFRAMESTART_W { + RXFRAMESTART_W { w: self } + } + #[doc = "Bit 6 - Write '1' to Disable interrupt for RXFRAMEEND event"] + #[inline(always)] + pub fn rxframeend(&mut self) -> RXFRAMEEND_W { + RXFRAMEEND_W { w: self } + } + #[doc = "Bit 7 - Write '1' to Disable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&mut self) -> ERROR_W { + ERROR_W { w: self } + } + #[doc = "Bit 10 - Write '1' to Disable interrupt for RXERROR event"] + #[inline(always)] + pub fn rxerror(&mut self) -> RXERROR_W { + RXERROR_W { w: self } + } + #[doc = "Bit 11 - Write '1' to Disable interrupt for ENDRX event"] + #[inline(always)] + pub fn endrx(&mut self) -> ENDRX_W { + ENDRX_W { w: self } + } + #[doc = "Bit 12 - Write '1' to Disable interrupt for ENDTX event"] + #[inline(always)] + pub fn endtx(&mut self) -> ENDTX_W { + ENDTX_W { w: self } + } + #[doc = "Bit 14 - Write '1' to Disable interrupt for AUTOCOLRESSTARTED event"] + #[inline(always)] + pub fn autocolresstarted(&mut self) -> AUTOCOLRESSTARTED_W { + AUTOCOLRESSTARTED_W { w: self } + } + #[doc = "Bit 18 - Write '1' to Disable interrupt for COLLISION event"] + #[inline(always)] + pub fn collision(&mut self) -> COLLISION_W { + COLLISION_W { w: self } + } + #[doc = "Bit 19 - Write '1' to Disable interrupt for SELECTED event"] + #[inline(always)] + pub fn selected(&mut self) -> SELECTED_W { + SELECTED_W { w: self } + } + #[doc = "Bit 20 - Write '1' to Disable interrupt for STARTED event"] + #[inline(always)] + pub fn started(&mut self) -> STARTED_W { + STARTED_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/intenset.rs b/src/nfct/intenset.rs new file mode 100644 index 0000000..171c827 --- /dev/null +++ b/src/nfct/intenset.rs @@ -0,0 +1,1566 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for READY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY` reader - Write '1' to Enable interrupt for READY event"] +pub struct READY_R(crate::FieldReader); +impl READY_R { + pub(crate) fn new(bits: bool) -> Self { + READY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> READY_A { + match self.bits { + false => READY_A::DISABLED, + true => READY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == READY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == READY_A::ENABLED + } +} +impl core::ops::Deref for READY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for READY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY` writer - Write '1' to Enable interrupt for READY event"] +pub struct READY_W<'a> { + w: &'a mut W, +} +impl<'a> READY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: READY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(READY_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for FIELDDETECTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum FIELDDETECTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: FIELDDETECTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `FIELDDETECTED` reader - Write '1' to Enable interrupt for FIELDDETECTED event"] +pub struct FIELDDETECTED_R(crate::FieldReader); +impl FIELDDETECTED_R { + pub(crate) fn new(bits: bool) -> Self { + FIELDDETECTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> FIELDDETECTED_A { + match self.bits { + false => FIELDDETECTED_A::DISABLED, + true => FIELDDETECTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == FIELDDETECTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == FIELDDETECTED_A::ENABLED + } +} +impl core::ops::Deref for FIELDDETECTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for FIELDDETECTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum FIELDDETECTED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: FIELDDETECTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `FIELDDETECTED` writer - Write '1' to Enable interrupt for FIELDDETECTED event"] +pub struct FIELDDETECTED_W<'a> { + w: &'a mut W, +} +impl<'a> FIELDDETECTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: FIELDDETECTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(FIELDDETECTED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for FIELDLOST event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum FIELDLOST_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: FIELDLOST_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `FIELDLOST` reader - Write '1' to Enable interrupt for FIELDLOST event"] +pub struct FIELDLOST_R(crate::FieldReader); +impl FIELDLOST_R { + pub(crate) fn new(bits: bool) -> Self { + FIELDLOST_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> FIELDLOST_A { + match self.bits { + false => FIELDLOST_A::DISABLED, + true => FIELDLOST_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == FIELDLOST_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == FIELDLOST_A::ENABLED + } +} +impl core::ops::Deref for FIELDLOST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for FIELDLOST event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum FIELDLOST_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: FIELDLOST_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `FIELDLOST` writer - Write '1' to Enable interrupt for FIELDLOST event"] +pub struct FIELDLOST_W<'a> { + w: &'a mut W, +} +impl<'a> FIELDLOST_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: FIELDLOST_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(FIELDLOST_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for TXFRAMESTART event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXFRAMESTART_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXFRAMESTART_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXFRAMESTART` reader - Write '1' to Enable interrupt for TXFRAMESTART event"] +pub struct TXFRAMESTART_R(crate::FieldReader); +impl TXFRAMESTART_R { + pub(crate) fn new(bits: bool) -> Self { + TXFRAMESTART_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXFRAMESTART_A { + match self.bits { + false => TXFRAMESTART_A::DISABLED, + true => TXFRAMESTART_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXFRAMESTART_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXFRAMESTART_A::ENABLED + } +} +impl core::ops::Deref for TXFRAMESTART_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TXFRAMESTART event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXFRAMESTART_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXFRAMESTART_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXFRAMESTART` writer - Write '1' to Enable interrupt for TXFRAMESTART event"] +pub struct TXFRAMESTART_W<'a> { + w: &'a mut W, +} +impl<'a> TXFRAMESTART_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXFRAMESTART_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TXFRAMESTART_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for TXFRAMEEND event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXFRAMEEND_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXFRAMEEND_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXFRAMEEND` reader - Write '1' to Enable interrupt for TXFRAMEEND event"] +pub struct TXFRAMEEND_R(crate::FieldReader); +impl TXFRAMEEND_R { + pub(crate) fn new(bits: bool) -> Self { + TXFRAMEEND_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXFRAMEEND_A { + match self.bits { + false => TXFRAMEEND_A::DISABLED, + true => TXFRAMEEND_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXFRAMEEND_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXFRAMEEND_A::ENABLED + } +} +impl core::ops::Deref for TXFRAMEEND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TXFRAMEEND event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXFRAMEEND_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXFRAMEEND_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXFRAMEEND` writer - Write '1' to Enable interrupt for TXFRAMEEND event"] +pub struct TXFRAMEEND_W<'a> { + w: &'a mut W, +} +impl<'a> TXFRAMEEND_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXFRAMEEND_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TXFRAMEEND_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for RXFRAMESTART event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXFRAMESTART_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXFRAMESTART_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXFRAMESTART` reader - Write '1' to Enable interrupt for RXFRAMESTART event"] +pub struct RXFRAMESTART_R(crate::FieldReader); +impl RXFRAMESTART_R { + pub(crate) fn new(bits: bool) -> Self { + RXFRAMESTART_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXFRAMESTART_A { + match self.bits { + false => RXFRAMESTART_A::DISABLED, + true => RXFRAMESTART_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXFRAMESTART_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXFRAMESTART_A::ENABLED + } +} +impl core::ops::Deref for RXFRAMESTART_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for RXFRAMESTART event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXFRAMESTART_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXFRAMESTART_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXFRAMESTART` writer - Write '1' to Enable interrupt for RXFRAMESTART event"] +pub struct RXFRAMESTART_W<'a> { + w: &'a mut W, +} +impl<'a> RXFRAMESTART_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXFRAMESTART_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(RXFRAMESTART_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for RXFRAMEEND event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXFRAMEEND_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXFRAMEEND_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXFRAMEEND` reader - Write '1' to Enable interrupt for RXFRAMEEND event"] +pub struct RXFRAMEEND_R(crate::FieldReader); +impl RXFRAMEEND_R { + pub(crate) fn new(bits: bool) -> Self { + RXFRAMEEND_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXFRAMEEND_A { + match self.bits { + false => RXFRAMEEND_A::DISABLED, + true => RXFRAMEEND_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXFRAMEEND_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXFRAMEEND_A::ENABLED + } +} +impl core::ops::Deref for RXFRAMEEND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for RXFRAMEEND event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXFRAMEEND_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXFRAMEEND_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXFRAMEEND` writer - Write '1' to Enable interrupt for RXFRAMEEND event"] +pub struct RXFRAMEEND_W<'a> { + w: &'a mut W, +} +impl<'a> RXFRAMEEND_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXFRAMEEND_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(RXFRAMEEND_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` reader - Write '1' to Enable interrupt for ERROR event"] +pub struct ERROR_R(crate::FieldReader); +impl ERROR_R { + pub(crate) fn new(bits: bool) -> Self { + ERROR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ERROR_A { + match self.bits { + false => ERROR_A::DISABLED, + true => ERROR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ERROR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ERROR_A::ENABLED + } +} +impl core::ops::Deref for ERROR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` writer - Write '1' to Enable interrupt for ERROR event"] +pub struct ERROR_W<'a> { + w: &'a mut W, +} +impl<'a> ERROR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ERROR_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(ERROR_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for RXERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXERROR_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXERROR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXERROR` reader - Write '1' to Enable interrupt for RXERROR event"] +pub struct RXERROR_R(crate::FieldReader); +impl RXERROR_R { + pub(crate) fn new(bits: bool) -> Self { + RXERROR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXERROR_A { + match self.bits { + false => RXERROR_A::DISABLED, + true => RXERROR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXERROR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXERROR_A::ENABLED + } +} +impl core::ops::Deref for RXERROR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for RXERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXERROR_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXERROR_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXERROR` writer - Write '1' to Enable interrupt for RXERROR event"] +pub struct RXERROR_W<'a> { + w: &'a mut W, +} +impl<'a> RXERROR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXERROR_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(RXERROR_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for ENDRX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDRX_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDRX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDRX` reader - Write '1' to Enable interrupt for ENDRX event"] +pub struct ENDRX_R(crate::FieldReader); +impl ENDRX_R { + pub(crate) fn new(bits: bool) -> Self { + ENDRX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDRX_A { + match self.bits { + false => ENDRX_A::DISABLED, + true => ENDRX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENDRX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENDRX_A::ENABLED + } +} +impl core::ops::Deref for ENDRX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for ENDRX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDRX_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDRX_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDRX` writer - Write '1' to Enable interrupt for ENDRX event"] +pub struct ENDRX_W<'a> { + w: &'a mut W, +} +impl<'a> ENDRX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDRX_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(ENDRX_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for ENDTX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDTX_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDTX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDTX` reader - Write '1' to Enable interrupt for ENDTX event"] +pub struct ENDTX_R(crate::FieldReader); +impl ENDTX_R { + pub(crate) fn new(bits: bool) -> Self { + ENDTX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDTX_A { + match self.bits { + false => ENDTX_A::DISABLED, + true => ENDTX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENDTX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENDTX_A::ENABLED + } +} +impl core::ops::Deref for ENDTX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for ENDTX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDTX_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDTX_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDTX` writer - Write '1' to Enable interrupt for ENDTX event"] +pub struct ENDTX_W<'a> { + w: &'a mut W, +} +impl<'a> ENDTX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDTX_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(ENDTX_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for AUTOCOLRESSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum AUTOCOLRESSTARTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: AUTOCOLRESSTARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `AUTOCOLRESSTARTED` reader - Write '1' to Enable interrupt for AUTOCOLRESSTARTED event"] +pub struct AUTOCOLRESSTARTED_R(crate::FieldReader); +impl AUTOCOLRESSTARTED_R { + pub(crate) fn new(bits: bool) -> Self { + AUTOCOLRESSTARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> AUTOCOLRESSTARTED_A { + match self.bits { + false => AUTOCOLRESSTARTED_A::DISABLED, + true => AUTOCOLRESSTARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == AUTOCOLRESSTARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == AUTOCOLRESSTARTED_A::ENABLED + } +} +impl core::ops::Deref for AUTOCOLRESSTARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for AUTOCOLRESSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum AUTOCOLRESSTARTED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: AUTOCOLRESSTARTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `AUTOCOLRESSTARTED` writer - Write '1' to Enable interrupt for AUTOCOLRESSTARTED event"] +pub struct AUTOCOLRESSTARTED_W<'a> { + w: &'a mut W, +} +impl<'a> AUTOCOLRESSTARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: AUTOCOLRESSTARTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(AUTOCOLRESSTARTED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for COLLISION event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COLLISION_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COLLISION_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COLLISION` reader - Write '1' to Enable interrupt for COLLISION event"] +pub struct COLLISION_R(crate::FieldReader); +impl COLLISION_R { + pub(crate) fn new(bits: bool) -> Self { + COLLISION_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COLLISION_A { + match self.bits { + false => COLLISION_A::DISABLED, + true => COLLISION_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COLLISION_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COLLISION_A::ENABLED + } +} +impl core::ops::Deref for COLLISION_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for COLLISION event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COLLISION_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COLLISION_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COLLISION` writer - Write '1' to Enable interrupt for COLLISION event"] +pub struct COLLISION_W<'a> { + w: &'a mut W, +} +impl<'a> COLLISION_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COLLISION_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(COLLISION_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for SELECTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SELECTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SELECTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SELECTED` reader - Write '1' to Enable interrupt for SELECTED event"] +pub struct SELECTED_R(crate::FieldReader); +impl SELECTED_R { + pub(crate) fn new(bits: bool) -> Self { + SELECTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SELECTED_A { + match self.bits { + false => SELECTED_A::DISABLED, + true => SELECTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SELECTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SELECTED_A::ENABLED + } +} +impl core::ops::Deref for SELECTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for SELECTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SELECTED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SELECTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SELECTED` writer - Write '1' to Enable interrupt for SELECTED event"] +pub struct SELECTED_W<'a> { + w: &'a mut W, +} +impl<'a> SELECTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SELECTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(SELECTED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for STARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STARTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STARTED` reader - Write '1' to Enable interrupt for STARTED event"] +pub struct STARTED_R(crate::FieldReader); +impl STARTED_R { + pub(crate) fn new(bits: bool) -> Self { + STARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STARTED_A { + match self.bits { + false => STARTED_A::DISABLED, + true => STARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STARTED_A::ENABLED + } +} +impl core::ops::Deref for STARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for STARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STARTED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STARTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STARTED` writer - Write '1' to Enable interrupt for STARTED event"] +pub struct STARTED_W<'a> { + w: &'a mut W, +} +impl<'a> STARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STARTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(STARTED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Enable interrupt for READY event"] + #[inline(always)] + pub fn ready(&self) -> READY_R { + READY_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for FIELDDETECTED event"] + #[inline(always)] + pub fn fielddetected(&self) -> FIELDDETECTED_R { + FIELDDETECTED_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for FIELDLOST event"] + #[inline(always)] + pub fn fieldlost(&self) -> FIELDLOST_R { + FIELDLOST_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Write '1' to Enable interrupt for TXFRAMESTART event"] + #[inline(always)] + pub fn txframestart(&self) -> TXFRAMESTART_R { + TXFRAMESTART_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Write '1' to Enable interrupt for TXFRAMEEND event"] + #[inline(always)] + pub fn txframeend(&self) -> TXFRAMEEND_R { + TXFRAMEEND_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Write '1' to Enable interrupt for RXFRAMESTART event"] + #[inline(always)] + pub fn rxframestart(&self) -> RXFRAMESTART_R { + RXFRAMESTART_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Write '1' to Enable interrupt for RXFRAMEEND event"] + #[inline(always)] + pub fn rxframeend(&self) -> RXFRAMEEND_R { + RXFRAMEEND_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Write '1' to Enable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&self) -> ERROR_R { + ERROR_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 10 - Write '1' to Enable interrupt for RXERROR event"] + #[inline(always)] + pub fn rxerror(&self) -> RXERROR_R { + RXERROR_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Write '1' to Enable interrupt for ENDRX event"] + #[inline(always)] + pub fn endrx(&self) -> ENDRX_R { + ENDRX_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Write '1' to Enable interrupt for ENDTX event"] + #[inline(always)] + pub fn endtx(&self) -> ENDTX_R { + ENDTX_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 14 - Write '1' to Enable interrupt for AUTOCOLRESSTARTED event"] + #[inline(always)] + pub fn autocolresstarted(&self) -> AUTOCOLRESSTARTED_R { + AUTOCOLRESSTARTED_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 18 - Write '1' to Enable interrupt for COLLISION event"] + #[inline(always)] + pub fn collision(&self) -> COLLISION_R { + COLLISION_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Write '1' to Enable interrupt for SELECTED event"] + #[inline(always)] + pub fn selected(&self) -> SELECTED_R { + SELECTED_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Write '1' to Enable interrupt for STARTED event"] + #[inline(always)] + pub fn started(&self) -> STARTED_R { + STARTED_R::new(((self.bits >> 20) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Enable interrupt for READY event"] + #[inline(always)] + pub fn ready(&mut self) -> READY_W { + READY_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for FIELDDETECTED event"] + #[inline(always)] + pub fn fielddetected(&mut self) -> FIELDDETECTED_W { + FIELDDETECTED_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for FIELDLOST event"] + #[inline(always)] + pub fn fieldlost(&mut self) -> FIELDLOST_W { + FIELDLOST_W { w: self } + } + #[doc = "Bit 3 - Write '1' to Enable interrupt for TXFRAMESTART event"] + #[inline(always)] + pub fn txframestart(&mut self) -> TXFRAMESTART_W { + TXFRAMESTART_W { w: self } + } + #[doc = "Bit 4 - Write '1' to Enable interrupt for TXFRAMEEND event"] + #[inline(always)] + pub fn txframeend(&mut self) -> TXFRAMEEND_W { + TXFRAMEEND_W { w: self } + } + #[doc = "Bit 5 - Write '1' to Enable interrupt for RXFRAMESTART event"] + #[inline(always)] + pub fn rxframestart(&mut self) -> RXFRAMESTART_W { + RXFRAMESTART_W { w: self } + } + #[doc = "Bit 6 - Write '1' to Enable interrupt for RXFRAMEEND event"] + #[inline(always)] + pub fn rxframeend(&mut self) -> RXFRAMEEND_W { + RXFRAMEEND_W { w: self } + } + #[doc = "Bit 7 - Write '1' to Enable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&mut self) -> ERROR_W { + ERROR_W { w: self } + } + #[doc = "Bit 10 - Write '1' to Enable interrupt for RXERROR event"] + #[inline(always)] + pub fn rxerror(&mut self) -> RXERROR_W { + RXERROR_W { w: self } + } + #[doc = "Bit 11 - Write '1' to Enable interrupt for ENDRX event"] + #[inline(always)] + pub fn endrx(&mut self) -> ENDRX_W { + ENDRX_W { w: self } + } + #[doc = "Bit 12 - Write '1' to Enable interrupt for ENDTX event"] + #[inline(always)] + pub fn endtx(&mut self) -> ENDTX_W { + ENDTX_W { w: self } + } + #[doc = "Bit 14 - Write '1' to Enable interrupt for AUTOCOLRESSTARTED event"] + #[inline(always)] + pub fn autocolresstarted(&mut self) -> AUTOCOLRESSTARTED_W { + AUTOCOLRESSTARTED_W { w: self } + } + #[doc = "Bit 18 - Write '1' to Enable interrupt for COLLISION event"] + #[inline(always)] + pub fn collision(&mut self) -> COLLISION_W { + COLLISION_W { w: self } + } + #[doc = "Bit 19 - Write '1' to Enable interrupt for SELECTED event"] + #[inline(always)] + pub fn selected(&mut self) -> SELECTED_W { + SELECTED_W { w: self } + } + #[doc = "Bit 20 - Write '1' to Enable interrupt for STARTED event"] + #[inline(always)] + pub fn started(&mut self) -> STARTED_W { + STARTED_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/maxlen.rs b/src/nfct/maxlen.rs new file mode 100644 index 0000000..43f6c4c --- /dev/null +++ b/src/nfct/maxlen.rs @@ -0,0 +1,102 @@ +#[doc = "Register `MAXLEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MAXLEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `MAXLEN` reader - Size of allocated for TXD and RXD data storage buffer in Data RAM"] +pub struct MAXLEN_R(crate::FieldReader); +impl MAXLEN_R { + pub(crate) fn new(bits: u16) -> Self { + MAXLEN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MAXLEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MAXLEN` writer - Size of allocated for TXD and RXD data storage buffer in Data RAM"] +pub struct MAXLEN_W<'a> { + w: &'a mut W, +} +impl<'a> MAXLEN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01ff) | (value as u32 & 0x01ff); + self.w + } +} +impl R { + #[doc = "Bits 0:8 - Size of allocated for TXD and RXD data storage buffer in Data RAM"] + #[inline(always)] + pub fn maxlen(&self) -> MAXLEN_R { + MAXLEN_R::new((self.bits & 0x01ff) as u16) + } +} +impl W { + #[doc = "Bits 0:8 - Size of allocated for TXD and RXD data storage buffer in Data RAM"] + #[inline(always)] + pub fn maxlen(&mut self) -> MAXLEN_W { + MAXLEN_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Size of allocated for TXD and RXD data storage buffer in Data RAM\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [maxlen](index.html) module"] +pub struct MAXLEN_SPEC; +impl crate::RegisterSpec for MAXLEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [maxlen::R](R) reader structure"] +impl crate::Readable for MAXLEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [maxlen::W](W) writer structure"] +impl crate::Writable for MAXLEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MAXLEN to value 0"] +impl crate::Resettable for MAXLEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/nfcid1_2nd_last.rs b/src/nfct/nfcid1_2nd_last.rs new file mode 100644 index 0000000..008c55b --- /dev/null +++ b/src/nfct/nfcid1_2nd_last.rs @@ -0,0 +1,174 @@ +#[doc = "Register `NFCID1_2ND_LAST` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NFCID1_2ND_LAST` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `NFCID1_V` reader - NFCID1 byte V"] +pub struct NFCID1_V_R(crate::FieldReader); +impl NFCID1_V_R { + pub(crate) fn new(bits: u8) -> Self { + NFCID1_V_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NFCID1_V_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NFCID1_V` writer - NFCID1 byte V"] +pub struct NFCID1_V_W<'a> { + w: &'a mut W, +} +impl<'a> NFCID1_V_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +#[doc = "Field `NFCID1_U` reader - NFCID1 byte U"] +pub struct NFCID1_U_R(crate::FieldReader); +impl NFCID1_U_R { + pub(crate) fn new(bits: u8) -> Self { + NFCID1_U_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NFCID1_U_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NFCID1_U` writer - NFCID1 byte U"] +pub struct NFCID1_U_W<'a> { + w: &'a mut W, +} +impl<'a> NFCID1_U_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); + self.w + } +} +#[doc = "Field `NFCID1_T` reader - NFCID1 byte T"] +pub struct NFCID1_T_R(crate::FieldReader); +impl NFCID1_T_R { + pub(crate) fn new(bits: u8) -> Self { + NFCID1_T_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NFCID1_T_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NFCID1_T` writer - NFCID1 byte T"] +pub struct NFCID1_T_W<'a> { + w: &'a mut W, +} +impl<'a> NFCID1_T_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - NFCID1 byte V"] + #[inline(always)] + pub fn nfcid1_v(&self) -> NFCID1_V_R { + NFCID1_V_R::new((self.bits & 0xff) as u8) + } + #[doc = "Bits 8:15 - NFCID1 byte U"] + #[inline(always)] + pub fn nfcid1_u(&self) -> NFCID1_U_R { + NFCID1_U_R::new(((self.bits >> 8) & 0xff) as u8) + } + #[doc = "Bits 16:23 - NFCID1 byte T"] + #[inline(always)] + pub fn nfcid1_t(&self) -> NFCID1_T_R { + NFCID1_T_R::new(((self.bits >> 16) & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - NFCID1 byte V"] + #[inline(always)] + pub fn nfcid1_v(&mut self) -> NFCID1_V_W { + NFCID1_V_W { w: self } + } + #[doc = "Bits 8:15 - NFCID1 byte U"] + #[inline(always)] + pub fn nfcid1_u(&mut self) -> NFCID1_U_W { + NFCID1_U_W { w: self } + } + #[doc = "Bits 16:23 - NFCID1 byte T"] + #[inline(always)] + pub fn nfcid1_t(&mut self) -> NFCID1_T_W { + NFCID1_T_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Second last NFCID1 part (7 or 10 bytes ID)\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nfcid1_2nd_last](index.html) module"] +pub struct NFCID1_2ND_LAST_SPEC; +impl crate::RegisterSpec for NFCID1_2ND_LAST_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nfcid1_2nd_last::R](R) reader structure"] +impl crate::Readable for NFCID1_2ND_LAST_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nfcid1_2nd_last::W](W) writer structure"] +impl crate::Writable for NFCID1_2ND_LAST_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NFCID1_2ND_LAST to value 0"] +impl crate::Resettable for NFCID1_2ND_LAST_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/nfcid1_3rd_last.rs b/src/nfct/nfcid1_3rd_last.rs new file mode 100644 index 0000000..9a13655 --- /dev/null +++ b/src/nfct/nfcid1_3rd_last.rs @@ -0,0 +1,174 @@ +#[doc = "Register `NFCID1_3RD_LAST` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NFCID1_3RD_LAST` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `NFCID1_S` reader - NFCID1 byte S"] +pub struct NFCID1_S_R(crate::FieldReader); +impl NFCID1_S_R { + pub(crate) fn new(bits: u8) -> Self { + NFCID1_S_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NFCID1_S_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NFCID1_S` writer - NFCID1 byte S"] +pub struct NFCID1_S_W<'a> { + w: &'a mut W, +} +impl<'a> NFCID1_S_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +#[doc = "Field `NFCID1_R` reader - NFCID1 byte R"] +pub struct NFCID1_R_R(crate::FieldReader); +impl NFCID1_R_R { + pub(crate) fn new(bits: u8) -> Self { + NFCID1_R_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NFCID1_R_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NFCID1_R` writer - NFCID1 byte R"] +pub struct NFCID1_R_W<'a> { + w: &'a mut W, +} +impl<'a> NFCID1_R_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); + self.w + } +} +#[doc = "Field `NFCID1_Q` reader - NFCID1 byte Q"] +pub struct NFCID1_Q_R(crate::FieldReader); +impl NFCID1_Q_R { + pub(crate) fn new(bits: u8) -> Self { + NFCID1_Q_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NFCID1_Q_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NFCID1_Q` writer - NFCID1 byte Q"] +pub struct NFCID1_Q_W<'a> { + w: &'a mut W, +} +impl<'a> NFCID1_Q_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - NFCID1 byte S"] + #[inline(always)] + pub fn nfcid1_s(&self) -> NFCID1_S_R { + NFCID1_S_R::new((self.bits & 0xff) as u8) + } + #[doc = "Bits 8:15 - NFCID1 byte R"] + #[inline(always)] + pub fn nfcid1_r(&self) -> NFCID1_R_R { + NFCID1_R_R::new(((self.bits >> 8) & 0xff) as u8) + } + #[doc = "Bits 16:23 - NFCID1 byte Q"] + #[inline(always)] + pub fn nfcid1_q(&self) -> NFCID1_Q_R { + NFCID1_Q_R::new(((self.bits >> 16) & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - NFCID1 byte S"] + #[inline(always)] + pub fn nfcid1_s(&mut self) -> NFCID1_S_W { + NFCID1_S_W { w: self } + } + #[doc = "Bits 8:15 - NFCID1 byte R"] + #[inline(always)] + pub fn nfcid1_r(&mut self) -> NFCID1_R_W { + NFCID1_R_W { w: self } + } + #[doc = "Bits 16:23 - NFCID1 byte Q"] + #[inline(always)] + pub fn nfcid1_q(&mut self) -> NFCID1_Q_W { + NFCID1_Q_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Third last NFCID1 part (10 bytes ID)\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nfcid1_3rd_last](index.html) module"] +pub struct NFCID1_3RD_LAST_SPEC; +impl crate::RegisterSpec for NFCID1_3RD_LAST_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nfcid1_3rd_last::R](R) reader structure"] +impl crate::Readable for NFCID1_3RD_LAST_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nfcid1_3rd_last::W](W) writer structure"] +impl crate::Writable for NFCID1_3RD_LAST_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NFCID1_3RD_LAST to value 0"] +impl crate::Resettable for NFCID1_3RD_LAST_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/nfcid1_last.rs b/src/nfct/nfcid1_last.rs new file mode 100644 index 0000000..ca4906b --- /dev/null +++ b/src/nfct/nfcid1_last.rs @@ -0,0 +1,210 @@ +#[doc = "Register `NFCID1_LAST` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NFCID1_LAST` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `NFCID1_Z` reader - NFCID1 byte Z (very last byte sent)"] +pub struct NFCID1_Z_R(crate::FieldReader); +impl NFCID1_Z_R { + pub(crate) fn new(bits: u8) -> Self { + NFCID1_Z_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NFCID1_Z_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NFCID1_Z` writer - NFCID1 byte Z (very last byte sent)"] +pub struct NFCID1_Z_W<'a> { + w: &'a mut W, +} +impl<'a> NFCID1_Z_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +#[doc = "Field `NFCID1_Y` reader - NFCID1 byte Y"] +pub struct NFCID1_Y_R(crate::FieldReader); +impl NFCID1_Y_R { + pub(crate) fn new(bits: u8) -> Self { + NFCID1_Y_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NFCID1_Y_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NFCID1_Y` writer - NFCID1 byte Y"] +pub struct NFCID1_Y_W<'a> { + w: &'a mut W, +} +impl<'a> NFCID1_Y_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); + self.w + } +} +#[doc = "Field `NFCID1_X` reader - NFCID1 byte X"] +pub struct NFCID1_X_R(crate::FieldReader); +impl NFCID1_X_R { + pub(crate) fn new(bits: u8) -> Self { + NFCID1_X_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NFCID1_X_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NFCID1_X` writer - NFCID1 byte X"] +pub struct NFCID1_X_W<'a> { + w: &'a mut W, +} +impl<'a> NFCID1_X_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); + self.w + } +} +#[doc = "Field `NFCID1_W` reader - NFCID1 byte W"] +pub struct NFCID1_W_R(crate::FieldReader); +impl NFCID1_W_R { + pub(crate) fn new(bits: u8) -> Self { + NFCID1_W_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NFCID1_W_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NFCID1_W` writer - NFCID1 byte W"] +pub struct NFCID1_W_W<'a> { + w: &'a mut W, +} +impl<'a> NFCID1_W_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - NFCID1 byte Z (very last byte sent)"] + #[inline(always)] + pub fn nfcid1_z(&self) -> NFCID1_Z_R { + NFCID1_Z_R::new((self.bits & 0xff) as u8) + } + #[doc = "Bits 8:15 - NFCID1 byte Y"] + #[inline(always)] + pub fn nfcid1_y(&self) -> NFCID1_Y_R { + NFCID1_Y_R::new(((self.bits >> 8) & 0xff) as u8) + } + #[doc = "Bits 16:23 - NFCID1 byte X"] + #[inline(always)] + pub fn nfcid1_x(&self) -> NFCID1_X_R { + NFCID1_X_R::new(((self.bits >> 16) & 0xff) as u8) + } + #[doc = "Bits 24:31 - NFCID1 byte W"] + #[inline(always)] + pub fn nfcid1_w(&self) -> NFCID1_W_R { + NFCID1_W_R::new(((self.bits >> 24) & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - NFCID1 byte Z (very last byte sent)"] + #[inline(always)] + pub fn nfcid1_z(&mut self) -> NFCID1_Z_W { + NFCID1_Z_W { w: self } + } + #[doc = "Bits 8:15 - NFCID1 byte Y"] + #[inline(always)] + pub fn nfcid1_y(&mut self) -> NFCID1_Y_W { + NFCID1_Y_W { w: self } + } + #[doc = "Bits 16:23 - NFCID1 byte X"] + #[inline(always)] + pub fn nfcid1_x(&mut self) -> NFCID1_X_W { + NFCID1_X_W { w: self } + } + #[doc = "Bits 24:31 - NFCID1 byte W"] + #[inline(always)] + pub fn nfcid1_w(&mut self) -> NFCID1_W_W { + NFCID1_W_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Last NFCID1 part (4, 7 or 10 bytes ID)\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nfcid1_last](index.html) module"] +pub struct NFCID1_LAST_SPEC; +impl crate::RegisterSpec for NFCID1_LAST_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nfcid1_last::R](R) reader structure"] +impl crate::Readable for NFCID1_LAST_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nfcid1_last::W](W) writer structure"] +impl crate::Writable for NFCID1_LAST_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NFCID1_LAST to value 0x6363"] +impl crate::Resettable for NFCID1_LAST_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x6363 + } +} diff --git a/src/nfct/packetptr.rs b/src/nfct/packetptr.rs new file mode 100644 index 0000000..ac6e48f --- /dev/null +++ b/src/nfct/packetptr.rs @@ -0,0 +1,102 @@ +#[doc = "Register `PACKETPTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PACKETPTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PTR` reader - Packet pointer for TXD and RXD data storage in Data RAM. This address is a byte aligned RAM address."] +pub struct PTR_R(crate::FieldReader); +impl PTR_R { + pub(crate) fn new(bits: u32) -> Self { + PTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PTR` writer - Packet pointer for TXD and RXD data storage in Data RAM. This address is a byte aligned RAM address."] +pub struct PTR_W<'a> { + w: &'a mut W, +} +impl<'a> PTR_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Packet pointer for TXD and RXD data storage in Data RAM. This address is a byte aligned RAM address."] + #[inline(always)] + pub fn ptr(&self) -> PTR_R { + PTR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Packet pointer for TXD and RXD data storage in Data RAM. This address is a byte aligned RAM address."] + #[inline(always)] + pub fn ptr(&mut self) -> PTR_W { + PTR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Packet pointer for TXD and RXD data storage in Data RAM\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [packetptr](index.html) module"] +pub struct PACKETPTR_SPEC; +impl crate::RegisterSpec for PACKETPTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [packetptr::R](R) reader structure"] +impl crate::Readable for PACKETPTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [packetptr::W](W) writer structure"] +impl crate::Writable for PACKETPTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PACKETPTR to value 0"] +impl crate::Resettable for PACKETPTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/rxd.rs b/src/nfct/rxd.rs new file mode 100644 index 0000000..93c2e68 --- /dev/null +++ b/src/nfct/rxd.rs @@ -0,0 +1,8 @@ +#[doc = "FRAMECONFIG register accessor: an alias for `Reg`"] +pub type FRAMECONFIG = crate::Reg; +#[doc = "Configuration of incoming frames"] +pub mod frameconfig; +#[doc = "AMOUNT register accessor: an alias for `Reg`"] +pub type AMOUNT = crate::Reg; +#[doc = "Size of last incoming frame"] +pub mod amount; diff --git a/src/nfct/rxd/amount.rs b/src/nfct/rxd/amount.rs new file mode 100644 index 0000000..b8dea46 --- /dev/null +++ b/src/nfct/rxd/amount.rs @@ -0,0 +1,71 @@ +#[doc = "Register `AMOUNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `RXDATABITS` reader - Number of bits in the last byte in the frame, if less than 8 (including CRC, but excluding parity and SoF/EoF framing)."] +pub struct RXDATABITS_R(crate::FieldReader); +impl RXDATABITS_R { + pub(crate) fn new(bits: u8) -> Self { + RXDATABITS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RXDATABITS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RXDATABYTES` reader - Number of complete bytes received in the frame (including CRC, but excluding parity and SoF/EoF framing)"] +pub struct RXDATABYTES_R(crate::FieldReader); +impl RXDATABYTES_R { + pub(crate) fn new(bits: u16) -> Self { + RXDATABYTES_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RXDATABYTES_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:2 - Number of bits in the last byte in the frame, if less than 8 (including CRC, but excluding parity and SoF/EoF framing)."] + #[inline(always)] + pub fn rxdatabits(&self) -> RXDATABITS_R { + RXDATABITS_R::new((self.bits & 0x07) as u8) + } + #[doc = "Bits 3:11 - Number of complete bytes received in the frame (including CRC, but excluding parity and SoF/EoF framing)"] + #[inline(always)] + pub fn rxdatabytes(&self) -> RXDATABYTES_R { + RXDATABYTES_R::new(((self.bits >> 3) & 0x01ff) as u16) + } +} +#[doc = "Size of last incoming frame\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 [amount](index.html) module"] +pub struct AMOUNT_SPEC; +impl crate::RegisterSpec for AMOUNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [amount::R](R) reader structure"] +impl crate::Readable for AMOUNT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets AMOUNT to value 0"] +impl crate::Resettable for AMOUNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/rxd/frameconfig.rs b/src/nfct/rxd/frameconfig.rs new file mode 100644 index 0000000..0ed8da8 --- /dev/null +++ b/src/nfct/rxd/frameconfig.rs @@ -0,0 +1,345 @@ +#[doc = "Register `FRAMECONFIG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `FRAMECONFIG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Parity expected or not in RX frame\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PARITY_A { + #[doc = "0: Parity is not expected in RX frames"] + NOPARITY = 0, + #[doc = "1: Parity is expected in RX frames"] + PARITY = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PARITY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PARITY` reader - Parity expected or not in RX frame"] +pub struct PARITY_R(crate::FieldReader); +impl PARITY_R { + pub(crate) fn new(bits: bool) -> Self { + PARITY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PARITY_A { + match self.bits { + false => PARITY_A::NOPARITY, + true => PARITY_A::PARITY, + } + } + #[doc = "Checks if the value of the field is `NOPARITY`"] + #[inline(always)] + pub fn is_no_parity(&self) -> bool { + **self == PARITY_A::NOPARITY + } + #[doc = "Checks if the value of the field is `PARITY`"] + #[inline(always)] + pub fn is_parity(&self) -> bool { + **self == PARITY_A::PARITY + } +} +impl core::ops::Deref for PARITY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PARITY` writer - Parity expected or not in RX frame"] +pub struct PARITY_W<'a> { + w: &'a mut W, +} +impl<'a> PARITY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PARITY_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Parity is not expected in RX frames"] + #[inline(always)] + pub fn no_parity(self) -> &'a mut W { + self.variant(PARITY_A::NOPARITY) + } + #[doc = "Parity is expected in RX frames"] + #[inline(always)] + pub fn parity(self) -> &'a mut W { + self.variant(PARITY_A::PARITY) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "SoF expected or not in RX frames\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SOF_A { + #[doc = "0: Start of Frame symbol is not expected in RX frames"] + NOSOF = 0, + #[doc = "1: Start of Frame symbol is expected in RX frames"] + SOF = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SOF_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SOF` reader - SoF expected or not in RX frames"] +pub struct SOF_R(crate::FieldReader); +impl SOF_R { + pub(crate) fn new(bits: bool) -> Self { + SOF_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SOF_A { + match self.bits { + false => SOF_A::NOSOF, + true => SOF_A::SOF, + } + } + #[doc = "Checks if the value of the field is `NOSOF`"] + #[inline(always)] + pub fn is_no_so_f(&self) -> bool { + **self == SOF_A::NOSOF + } + #[doc = "Checks if the value of the field is `SOF`"] + #[inline(always)] + pub fn is_so_f(&self) -> bool { + **self == SOF_A::SOF + } +} +impl core::ops::Deref for SOF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SOF` writer - SoF expected or not in RX frames"] +pub struct SOF_W<'a> { + w: &'a mut W, +} +impl<'a> SOF_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SOF_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Start of Frame symbol is not expected in RX frames"] + #[inline(always)] + pub fn no_so_f(self) -> &'a mut W { + self.variant(SOF_A::NOSOF) + } + #[doc = "Start of Frame symbol is expected in RX frames"] + #[inline(always)] + pub fn so_f(self) -> &'a mut W { + self.variant(SOF_A::SOF) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "CRC mode for incoming frames\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CRCMODERX_A { + #[doc = "0: CRC is not expected in RX frames"] + NOCRCRX = 0, + #[doc = "1: Last 16 bits in RX frame is CRC, CRC is checked and CRCSTATUS updated"] + CRC16RX = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CRCMODERX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CRCMODERX` reader - CRC mode for incoming frames"] +pub struct CRCMODERX_R(crate::FieldReader); +impl CRCMODERX_R { + pub(crate) fn new(bits: bool) -> Self { + CRCMODERX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CRCMODERX_A { + match self.bits { + false => CRCMODERX_A::NOCRCRX, + true => CRCMODERX_A::CRC16RX, + } + } + #[doc = "Checks if the value of the field is `NOCRCRX`"] + #[inline(always)] + pub fn is_no_crcrx(&self) -> bool { + **self == CRCMODERX_A::NOCRCRX + } + #[doc = "Checks if the value of the field is `CRC16RX`"] + #[inline(always)] + pub fn is_crc16rx(&self) -> bool { + **self == CRCMODERX_A::CRC16RX + } +} +impl core::ops::Deref for CRCMODERX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CRCMODERX` writer - CRC mode for incoming frames"] +pub struct CRCMODERX_W<'a> { + w: &'a mut W, +} +impl<'a> CRCMODERX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CRCMODERX_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "CRC is not expected in RX frames"] + #[inline(always)] + pub fn no_crcrx(self) -> &'a mut W { + self.variant(CRCMODERX_A::NOCRCRX) + } + #[doc = "Last 16 bits in RX frame is CRC, CRC is checked and CRCSTATUS updated"] + #[inline(always)] + pub fn crc16rx(self) -> &'a mut W { + self.variant(CRCMODERX_A::CRC16RX) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +impl R { + #[doc = "Bit 0 - Parity expected or not in RX frame"] + #[inline(always)] + pub fn parity(&self) -> PARITY_R { + PARITY_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 2 - SoF expected or not in RX frames"] + #[inline(always)] + pub fn sof(&self) -> SOF_R { + SOF_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 4 - CRC mode for incoming frames"] + #[inline(always)] + pub fn crcmoderx(&self) -> CRCMODERX_R { + CRCMODERX_R::new(((self.bits >> 4) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Parity expected or not in RX frame"] + #[inline(always)] + pub fn parity(&mut self) -> PARITY_W { + PARITY_W { w: self } + } + #[doc = "Bit 2 - SoF expected or not in RX frames"] + #[inline(always)] + pub fn sof(&mut self) -> SOF_W { + SOF_W { w: self } + } + #[doc = "Bit 4 - CRC mode for incoming frames"] + #[inline(always)] + pub fn crcmoderx(&mut self) -> CRCMODERX_W { + CRCMODERX_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Configuration of incoming frames\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [frameconfig](index.html) module"] +pub struct FRAMECONFIG_SPEC; +impl crate::RegisterSpec for FRAMECONFIG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [frameconfig::R](R) reader structure"] +impl crate::Readable for FRAMECONFIG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [frameconfig::W](W) writer structure"] +impl crate::Writable for FRAMECONFIG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets FRAMECONFIG to value 0x15"] +impl crate::Resettable for FRAMECONFIG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x15 + } +} diff --git a/src/nfct/selres.rs b/src/nfct/selres.rs new file mode 100644 index 0000000..e9b9319 --- /dev/null +++ b/src/nfct/selres.rs @@ -0,0 +1,313 @@ +#[doc = "Register `SELRES` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SELRES` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `RFU10` reader - Reserved for future use. Shall be 0."] +pub struct RFU10_R(crate::FieldReader); +impl RFU10_R { + pub(crate) fn new(bits: u8) -> Self { + RFU10_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RFU10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RFU10` writer - Reserved for future use. Shall be 0."] +pub struct RFU10_W<'a> { + w: &'a mut W, +} +impl<'a> RFU10_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); + self.w + } +} +#[doc = "Cascade bit (controlled by hardware, write has no effect)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CASCADE_A { + #[doc = "0: NFCID1 complete"] + COMPLETE = 0, + #[doc = "1: NFCID1 not complete"] + NOTCOMPLETE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CASCADE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CASCADE` reader - Cascade bit (controlled by hardware, write has no effect)"] +pub struct CASCADE_R(crate::FieldReader); +impl CASCADE_R { + pub(crate) fn new(bits: bool) -> Self { + CASCADE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CASCADE_A { + match self.bits { + false => CASCADE_A::COMPLETE, + true => CASCADE_A::NOTCOMPLETE, + } + } + #[doc = "Checks if the value of the field is `COMPLETE`"] + #[inline(always)] + pub fn is_complete(&self) -> bool { + **self == CASCADE_A::COMPLETE + } + #[doc = "Checks if the value of the field is `NOTCOMPLETE`"] + #[inline(always)] + pub fn is_not_complete(&self) -> bool { + **self == CASCADE_A::NOTCOMPLETE + } +} +impl core::ops::Deref for CASCADE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CASCADE` writer - Cascade bit (controlled by hardware, write has no effect)"] +pub struct CASCADE_W<'a> { + w: &'a mut W, +} +impl<'a> CASCADE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CASCADE_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "NFCID1 complete"] + #[inline(always)] + pub fn complete(self) -> &'a mut W { + self.variant(CASCADE_A::COMPLETE) + } + #[doc = "NFCID1 not complete"] + #[inline(always)] + pub fn not_complete(self) -> &'a mut W { + self.variant(CASCADE_A::NOTCOMPLETE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Field `RFU43` reader - Reserved for future use. Shall be 0."] +pub struct RFU43_R(crate::FieldReader); +impl RFU43_R { + pub(crate) fn new(bits: u8) -> Self { + RFU43_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RFU43_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RFU43` writer - Reserved for future use. Shall be 0."] +pub struct RFU43_W<'a> { + w: &'a mut W, +} +impl<'a> RFU43_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x03 << 3)) | ((value as u32 & 0x03) << 3); + self.w + } +} +#[doc = "Field `PROTOCOL` reader - Protocol as defined by the b7:b6 of SEL_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"] +pub struct PROTOCOL_R(crate::FieldReader); +impl PROTOCOL_R { + pub(crate) fn new(bits: u8) -> Self { + PROTOCOL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PROTOCOL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PROTOCOL` writer - Protocol as defined by the b7:b6 of SEL_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"] +pub struct PROTOCOL_W<'a> { + w: &'a mut W, +} +impl<'a> PROTOCOL_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x03 << 5)) | ((value as u32 & 0x03) << 5); + self.w + } +} +#[doc = "Field `RFU7` reader - Reserved for future use. Shall be 0."] +pub struct RFU7_R(crate::FieldReader); +impl RFU7_R { + pub(crate) fn new(bits: bool) -> Self { + RFU7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RFU7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RFU7` writer - Reserved for future use. Shall be 0."] +pub struct RFU7_W<'a> { + w: &'a mut W, +} +impl<'a> RFU7_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +impl R { + #[doc = "Bits 0:1 - Reserved for future use. Shall be 0."] + #[inline(always)] + pub fn rfu10(&self) -> RFU10_R { + RFU10_R::new((self.bits & 0x03) as u8) + } + #[doc = "Bit 2 - Cascade bit (controlled by hardware, write has no effect)"] + #[inline(always)] + pub fn cascade(&self) -> CASCADE_R { + CASCADE_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bits 3:4 - Reserved for future use. Shall be 0."] + #[inline(always)] + pub fn rfu43(&self) -> RFU43_R { + RFU43_R::new(((self.bits >> 3) & 0x03) as u8) + } + #[doc = "Bits 5:6 - Protocol as defined by the b7:b6 of SEL_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"] + #[inline(always)] + pub fn protocol(&self) -> PROTOCOL_R { + PROTOCOL_R::new(((self.bits >> 5) & 0x03) as u8) + } + #[doc = "Bit 7 - Reserved for future use. Shall be 0."] + #[inline(always)] + pub fn rfu7(&self) -> RFU7_R { + RFU7_R::new(((self.bits >> 7) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:1 - Reserved for future use. Shall be 0."] + #[inline(always)] + pub fn rfu10(&mut self) -> RFU10_W { + RFU10_W { w: self } + } + #[doc = "Bit 2 - Cascade bit (controlled by hardware, write has no effect)"] + #[inline(always)] + pub fn cascade(&mut self) -> CASCADE_W { + CASCADE_W { w: self } + } + #[doc = "Bits 3:4 - Reserved for future use. Shall be 0."] + #[inline(always)] + pub fn rfu43(&mut self) -> RFU43_W { + RFU43_W { w: self } + } + #[doc = "Bits 5:6 - Protocol as defined by the b7:b6 of SEL_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"] + #[inline(always)] + pub fn protocol(&mut self) -> PROTOCOL_W { + PROTOCOL_W { w: self } + } + #[doc = "Bit 7 - Reserved for future use. Shall be 0."] + #[inline(always)] + pub fn rfu7(&mut self) -> RFU7_W { + RFU7_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "NFC-A SEL_RES auto-response settings\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [selres](index.html) module"] +pub struct SELRES_SPEC; +impl crate::RegisterSpec for SELRES_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [selres::R](R) reader structure"] +impl crate::Readable for SELRES_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [selres::W](W) writer structure"] +impl crate::Writable for SELRES_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SELRES to value 0"] +impl crate::Resettable for SELRES_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/sensres.rs b/src/nfct/sensres.rs new file mode 100644 index 0000000..3e36c75 --- /dev/null +++ b/src/nfct/sensres.rs @@ -0,0 +1,419 @@ +#[doc = "Register `SENSRES` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SENSRES` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Bit frame SDD as defined by the b5:b1 of byte 1 in SENS_RES response in the NFC Forum, NFC Digital Protocol Technical Specification\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum BITFRAMESDD_A { + #[doc = "0: SDD pattern 00000"] + SDD00000 = 0, + #[doc = "1: SDD pattern 00001"] + SDD00001 = 1, + #[doc = "2: SDD pattern 00010"] + SDD00010 = 2, + #[doc = "4: SDD pattern 00100"] + SDD00100 = 4, + #[doc = "8: SDD pattern 01000"] + SDD01000 = 8, + #[doc = "16: SDD pattern 10000"] + SDD10000 = 16, +} +impl From for u8 { + #[inline(always)] + fn from(variant: BITFRAMESDD_A) -> Self { + variant as _ + } +} +#[doc = "Field `BITFRAMESDD` reader - Bit frame SDD as defined by the b5:b1 of byte 1 in SENS_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"] +pub struct BITFRAMESDD_R(crate::FieldReader); +impl BITFRAMESDD_R { + pub(crate) fn new(bits: u8) -> Self { + BITFRAMESDD_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(BITFRAMESDD_A::SDD00000), + 1 => Some(BITFRAMESDD_A::SDD00001), + 2 => Some(BITFRAMESDD_A::SDD00010), + 4 => Some(BITFRAMESDD_A::SDD00100), + 8 => Some(BITFRAMESDD_A::SDD01000), + 16 => Some(BITFRAMESDD_A::SDD10000), + _ => None, + } + } + #[doc = "Checks if the value of the field is `SDD00000`"] + #[inline(always)] + pub fn is_sdd00000(&self) -> bool { + **self == BITFRAMESDD_A::SDD00000 + } + #[doc = "Checks if the value of the field is `SDD00001`"] + #[inline(always)] + pub fn is_sdd00001(&self) -> bool { + **self == BITFRAMESDD_A::SDD00001 + } + #[doc = "Checks if the value of the field is `SDD00010`"] + #[inline(always)] + pub fn is_sdd00010(&self) -> bool { + **self == BITFRAMESDD_A::SDD00010 + } + #[doc = "Checks if the value of the field is `SDD00100`"] + #[inline(always)] + pub fn is_sdd00100(&self) -> bool { + **self == BITFRAMESDD_A::SDD00100 + } + #[doc = "Checks if the value of the field is `SDD01000`"] + #[inline(always)] + pub fn is_sdd01000(&self) -> bool { + **self == BITFRAMESDD_A::SDD01000 + } + #[doc = "Checks if the value of the field is `SDD10000`"] + #[inline(always)] + pub fn is_sdd10000(&self) -> bool { + **self == BITFRAMESDD_A::SDD10000 + } +} +impl core::ops::Deref for BITFRAMESDD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BITFRAMESDD` writer - Bit frame SDD as defined by the b5:b1 of byte 1 in SENS_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"] +pub struct BITFRAMESDD_W<'a> { + w: &'a mut W, +} +impl<'a> BITFRAMESDD_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: BITFRAMESDD_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "SDD pattern 00000"] + #[inline(always)] + pub fn sdd00000(self) -> &'a mut W { + self.variant(BITFRAMESDD_A::SDD00000) + } + #[doc = "SDD pattern 00001"] + #[inline(always)] + pub fn sdd00001(self) -> &'a mut W { + self.variant(BITFRAMESDD_A::SDD00001) + } + #[doc = "SDD pattern 00010"] + #[inline(always)] + pub fn sdd00010(self) -> &'a mut W { + self.variant(BITFRAMESDD_A::SDD00010) + } + #[doc = "SDD pattern 00100"] + #[inline(always)] + pub fn sdd00100(self) -> &'a mut W { + self.variant(BITFRAMESDD_A::SDD00100) + } + #[doc = "SDD pattern 01000"] + #[inline(always)] + pub fn sdd01000(self) -> &'a mut W { + self.variant(BITFRAMESDD_A::SDD01000) + } + #[doc = "SDD pattern 10000"] + #[inline(always)] + pub fn sdd10000(self) -> &'a mut W { + self.variant(BITFRAMESDD_A::SDD10000) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Field `RFU5` reader - Reserved for future use. Shall be 0."] +pub struct RFU5_R(crate::FieldReader); +impl RFU5_R { + pub(crate) fn new(bits: bool) -> Self { + RFU5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RFU5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RFU5` writer - Reserved for future use. Shall be 0."] +pub struct RFU5_W<'a> { + w: &'a mut W, +} +impl<'a> RFU5_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "NFCID1 size. This value is used by the Auto collision resolution engine.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum NFCIDSIZE_A { + #[doc = "0: NFCID1 size: single (4 bytes)"] + NFCID1SINGLE = 0, + #[doc = "1: NFCID1 size: double (7 bytes)"] + NFCID1DOUBLE = 1, + #[doc = "2: NFCID1 size: triple (10 bytes)"] + NFCID1TRIPLE = 2, +} +impl From for u8 { + #[inline(always)] + fn from(variant: NFCIDSIZE_A) -> Self { + variant as _ + } +} +#[doc = "Field `NFCIDSIZE` reader - NFCID1 size. This value is used by the Auto collision resolution engine."] +pub struct NFCIDSIZE_R(crate::FieldReader); +impl NFCIDSIZE_R { + pub(crate) fn new(bits: u8) -> Self { + NFCIDSIZE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(NFCIDSIZE_A::NFCID1SINGLE), + 1 => Some(NFCIDSIZE_A::NFCID1DOUBLE), + 2 => Some(NFCIDSIZE_A::NFCID1TRIPLE), + _ => None, + } + } + #[doc = "Checks if the value of the field is `NFCID1SINGLE`"] + #[inline(always)] + pub fn is_nfcid1single(&self) -> bool { + **self == NFCIDSIZE_A::NFCID1SINGLE + } + #[doc = "Checks if the value of the field is `NFCID1DOUBLE`"] + #[inline(always)] + pub fn is_nfcid1double(&self) -> bool { + **self == NFCIDSIZE_A::NFCID1DOUBLE + } + #[doc = "Checks if the value of the field is `NFCID1TRIPLE`"] + #[inline(always)] + pub fn is_nfcid1triple(&self) -> bool { + **self == NFCIDSIZE_A::NFCID1TRIPLE + } +} +impl core::ops::Deref for NFCIDSIZE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NFCIDSIZE` writer - NFCID1 size. This value is used by the Auto collision resolution engine."] +pub struct NFCIDSIZE_W<'a> { + w: &'a mut W, +} +impl<'a> NFCIDSIZE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: NFCIDSIZE_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "NFCID1 size: single (4 bytes)"] + #[inline(always)] + pub fn nfcid1single(self) -> &'a mut W { + self.variant(NFCIDSIZE_A::NFCID1SINGLE) + } + #[doc = "NFCID1 size: double (7 bytes)"] + #[inline(always)] + pub fn nfcid1double(self) -> &'a mut W { + self.variant(NFCIDSIZE_A::NFCID1DOUBLE) + } + #[doc = "NFCID1 size: triple (10 bytes)"] + #[inline(always)] + pub fn nfcid1triple(self) -> &'a mut W { + self.variant(NFCIDSIZE_A::NFCID1TRIPLE) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x03 << 6)) | ((value as u32 & 0x03) << 6); + self.w + } +} +#[doc = "Field `PLATFCONFIG` reader - Tag platform configuration as defined by the b4:b1 of byte 2 in SENS_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"] +pub struct PLATFCONFIG_R(crate::FieldReader); +impl PLATFCONFIG_R { + pub(crate) fn new(bits: u8) -> Self { + PLATFCONFIG_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PLATFCONFIG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PLATFCONFIG` writer - Tag platform configuration as defined by the b4:b1 of byte 2 in SENS_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"] +pub struct PLATFCONFIG_W<'a> { + w: &'a mut W, +} +impl<'a> PLATFCONFIG_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x0f << 8)) | ((value as u32 & 0x0f) << 8); + self.w + } +} +#[doc = "Field `RFU74` reader - Reserved for future use. Shall be 0."] +pub struct RFU74_R(crate::FieldReader); +impl RFU74_R { + pub(crate) fn new(bits: u8) -> Self { + RFU74_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RFU74_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RFU74` writer - Reserved for future use. Shall be 0."] +pub struct RFU74_W<'a> { + w: &'a mut W, +} +impl<'a> RFU74_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x0f << 12)) | ((value as u32 & 0x0f) << 12); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Bit frame SDD as defined by the b5:b1 of byte 1 in SENS_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"] + #[inline(always)] + pub fn bitframesdd(&self) -> BITFRAMESDD_R { + BITFRAMESDD_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 5 - Reserved for future use. Shall be 0."] + #[inline(always)] + pub fn rfu5(&self) -> RFU5_R { + RFU5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bits 6:7 - NFCID1 size. This value is used by the Auto collision resolution engine."] + #[inline(always)] + pub fn nfcidsize(&self) -> NFCIDSIZE_R { + NFCIDSIZE_R::new(((self.bits >> 6) & 0x03) as u8) + } + #[doc = "Bits 8:11 - Tag platform configuration as defined by the b4:b1 of byte 2 in SENS_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"] + #[inline(always)] + pub fn platfconfig(&self) -> PLATFCONFIG_R { + PLATFCONFIG_R::new(((self.bits >> 8) & 0x0f) as u8) + } + #[doc = "Bits 12:15 - Reserved for future use. Shall be 0."] + #[inline(always)] + pub fn rfu74(&self) -> RFU74_R { + RFU74_R::new(((self.bits >> 12) & 0x0f) as u8) + } +} +impl W { + #[doc = "Bits 0:4 - Bit frame SDD as defined by the b5:b1 of byte 1 in SENS_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"] + #[inline(always)] + pub fn bitframesdd(&mut self) -> BITFRAMESDD_W { + BITFRAMESDD_W { w: self } + } + #[doc = "Bit 5 - Reserved for future use. Shall be 0."] + #[inline(always)] + pub fn rfu5(&mut self) -> RFU5_W { + RFU5_W { w: self } + } + #[doc = "Bits 6:7 - NFCID1 size. This value is used by the Auto collision resolution engine."] + #[inline(always)] + pub fn nfcidsize(&mut self) -> NFCIDSIZE_W { + NFCIDSIZE_W { w: self } + } + #[doc = "Bits 8:11 - Tag platform configuration as defined by the b4:b1 of byte 2 in SENS_RES response in the NFC Forum, NFC Digital Protocol Technical Specification"] + #[inline(always)] + pub fn platfconfig(&mut self) -> PLATFCONFIG_W { + PLATFCONFIG_W { w: self } + } + #[doc = "Bits 12:15 - Reserved for future use. Shall be 0."] + #[inline(always)] + pub fn rfu74(&mut self) -> RFU74_W { + RFU74_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "NFC-A SENS_RES auto-response settings\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sensres](index.html) module"] +pub struct SENSRES_SPEC; +impl crate::RegisterSpec for SENSRES_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sensres::R](R) reader structure"] +impl crate::Readable for SENSRES_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sensres::W](W) writer structure"] +impl crate::Writable for SENSRES_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SENSRES to value 0x01"] +impl crate::Resettable for SENSRES_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x01 + } +} diff --git a/src/nfct/shorts.rs b/src/nfct/shorts.rs new file mode 100644 index 0000000..ab3108b --- /dev/null +++ b/src/nfct/shorts.rs @@ -0,0 +1,252 @@ +#[doc = "Register `SHORTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SHORTS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Shortcut between FIELDDETECTED event and ACTIVATE task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum FIELDDETECTED_ACTIVATE_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: FIELDDETECTED_ACTIVATE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `FIELDDETECTED_ACTIVATE` reader - Shortcut between FIELDDETECTED event and ACTIVATE task"] +pub struct FIELDDETECTED_ACTIVATE_R(crate::FieldReader); +impl FIELDDETECTED_ACTIVATE_R { + pub(crate) fn new(bits: bool) -> Self { + FIELDDETECTED_ACTIVATE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> FIELDDETECTED_ACTIVATE_A { + match self.bits { + false => FIELDDETECTED_ACTIVATE_A::DISABLED, + true => FIELDDETECTED_ACTIVATE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == FIELDDETECTED_ACTIVATE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == FIELDDETECTED_ACTIVATE_A::ENABLED + } +} +impl core::ops::Deref for FIELDDETECTED_ACTIVATE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FIELDDETECTED_ACTIVATE` writer - Shortcut between FIELDDETECTED event and ACTIVATE task"] +pub struct FIELDDETECTED_ACTIVATE_W<'a> { + w: &'a mut W, +} +impl<'a> FIELDDETECTED_ACTIVATE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: FIELDDETECTED_ACTIVATE_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(FIELDDETECTED_ACTIVATE_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(FIELDDETECTED_ACTIVATE_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Shortcut between FIELDLOST event and SENSE task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum FIELDLOST_SENSE_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: FIELDLOST_SENSE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `FIELDLOST_SENSE` reader - Shortcut between FIELDLOST event and SENSE task"] +pub struct FIELDLOST_SENSE_R(crate::FieldReader); +impl FIELDLOST_SENSE_R { + pub(crate) fn new(bits: bool) -> Self { + FIELDLOST_SENSE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> FIELDLOST_SENSE_A { + match self.bits { + false => FIELDLOST_SENSE_A::DISABLED, + true => FIELDLOST_SENSE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == FIELDLOST_SENSE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == FIELDLOST_SENSE_A::ENABLED + } +} +impl core::ops::Deref for FIELDLOST_SENSE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FIELDLOST_SENSE` writer - Shortcut between FIELDLOST event and SENSE task"] +pub struct FIELDLOST_SENSE_W<'a> { + w: &'a mut W, +} +impl<'a> FIELDLOST_SENSE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: FIELDLOST_SENSE_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(FIELDLOST_SENSE_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(FIELDLOST_SENSE_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +impl R { + #[doc = "Bit 0 - Shortcut between FIELDDETECTED event and ACTIVATE task"] + #[inline(always)] + pub fn fielddetected_activate(&self) -> FIELDDETECTED_ACTIVATE_R { + FIELDDETECTED_ACTIVATE_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Shortcut between FIELDLOST event and SENSE task"] + #[inline(always)] + pub fn fieldlost_sense(&self) -> FIELDLOST_SENSE_R { + FIELDLOST_SENSE_R::new(((self.bits >> 1) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Shortcut between FIELDDETECTED event and ACTIVATE task"] + #[inline(always)] + pub fn fielddetected_activate(&mut self) -> FIELDDETECTED_ACTIVATE_W { + FIELDDETECTED_ACTIVATE_W { w: self } + } + #[doc = "Bit 1 - Shortcut between FIELDLOST event and SENSE task"] + #[inline(always)] + pub fn fieldlost_sense(&mut self) -> FIELDLOST_SENSE_W { + FIELDLOST_SENSE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Shortcut register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [shorts](index.html) module"] +pub struct SHORTS_SPEC; +impl crate::RegisterSpec for SHORTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [shorts::R](R) reader structure"] +impl crate::Readable for SHORTS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [shorts::W](W) writer structure"] +impl crate::Writable for SHORTS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SHORTS to value 0"] +impl crate::Resettable for SHORTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/tasks_activate.rs b/src/nfct/tasks_activate.rs new file mode 100644 index 0000000..c7974ac --- /dev/null +++ b/src/nfct/tasks_activate.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_ACTIVATE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Activate NFC peripheral for incoming and outgoing frames, change state to activated\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_activate](index.html) module"] +pub struct TASKS_ACTIVATE_SPEC; +impl crate::RegisterSpec for TASKS_ACTIVATE_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_activate::W](W) writer structure"] +impl crate::Writable for TASKS_ACTIVATE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_ACTIVATE to value 0"] +impl crate::Resettable for TASKS_ACTIVATE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/tasks_disable.rs b/src/nfct/tasks_disable.rs new file mode 100644 index 0000000..00be611 --- /dev/null +++ b/src/nfct/tasks_disable.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_DISABLE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable NFC peripheral\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_disable](index.html) module"] +pub struct TASKS_DISABLE_SPEC; +impl crate::RegisterSpec for TASKS_DISABLE_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_disable::W](W) writer structure"] +impl crate::Writable for TASKS_DISABLE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_DISABLE to value 0"] +impl crate::Resettable for TASKS_DISABLE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/tasks_enablerxdata.rs b/src/nfct/tasks_enablerxdata.rs new file mode 100644 index 0000000..f4e41ce --- /dev/null +++ b/src/nfct/tasks_enablerxdata.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_ENABLERXDATA` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Initializes the EasyDMA for receive.\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_enablerxdata](index.html) module"] +pub struct TASKS_ENABLERXDATA_SPEC; +impl crate::RegisterSpec for TASKS_ENABLERXDATA_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_enablerxdata::W](W) writer structure"] +impl crate::Writable for TASKS_ENABLERXDATA_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_ENABLERXDATA to value 0"] +impl crate::Resettable for TASKS_ENABLERXDATA_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/tasks_goidle.rs b/src/nfct/tasks_goidle.rs new file mode 100644 index 0000000..1cdc498 --- /dev/null +++ b/src/nfct/tasks_goidle.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_GOIDLE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Force state machine to IDLE state\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_goidle](index.html) module"] +pub struct TASKS_GOIDLE_SPEC; +impl crate::RegisterSpec for TASKS_GOIDLE_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_goidle::W](W) writer structure"] +impl crate::Writable for TASKS_GOIDLE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_GOIDLE to value 0"] +impl crate::Resettable for TASKS_GOIDLE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/tasks_gosleep.rs b/src/nfct/tasks_gosleep.rs new file mode 100644 index 0000000..92b2ffa --- /dev/null +++ b/src/nfct/tasks_gosleep.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_GOSLEEP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Force state machine to SLEEP_A state\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_gosleep](index.html) module"] +pub struct TASKS_GOSLEEP_SPEC; +impl crate::RegisterSpec for TASKS_GOSLEEP_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_gosleep::W](W) writer structure"] +impl crate::Writable for TASKS_GOSLEEP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_GOSLEEP to value 0"] +impl crate::Resettable for TASKS_GOSLEEP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/tasks_sense.rs b/src/nfct/tasks_sense.rs new file mode 100644 index 0000000..604e997 --- /dev/null +++ b/src/nfct/tasks_sense.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_SENSE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable NFC sense field mode, change state to sense mode\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_sense](index.html) module"] +pub struct TASKS_SENSE_SPEC; +impl crate::RegisterSpec for TASKS_SENSE_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_sense::W](W) writer structure"] +impl crate::Writable for TASKS_SENSE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_SENSE to value 0"] +impl crate::Resettable for TASKS_SENSE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/tasks_starttx.rs b/src/nfct/tasks_starttx.rs new file mode 100644 index 0000000..e77b009 --- /dev/null +++ b/src/nfct/tasks_starttx.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STARTTX` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start transmission of a outgoing frame, change state to transmit\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_starttx](index.html) module"] +pub struct TASKS_STARTTX_SPEC; +impl crate::RegisterSpec for TASKS_STARTTX_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_starttx::W](W) writer structure"] +impl crate::Writable for TASKS_STARTTX_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STARTTX to value 0"] +impl crate::Resettable for TASKS_STARTTX_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/txd.rs b/src/nfct/txd.rs new file mode 100644 index 0000000..2185b37 --- /dev/null +++ b/src/nfct/txd.rs @@ -0,0 +1,8 @@ +#[doc = "FRAMECONFIG register accessor: an alias for `Reg`"] +pub type FRAMECONFIG = crate::Reg; +#[doc = "Configuration of outgoing frames"] +pub mod frameconfig; +#[doc = "AMOUNT register accessor: an alias for `Reg`"] +pub type AMOUNT = crate::Reg; +#[doc = "Size of outgoing frame"] +pub mod amount; diff --git a/src/nfct/txd/amount.rs b/src/nfct/txd/amount.rs new file mode 100644 index 0000000..7a40715 --- /dev/null +++ b/src/nfct/txd/amount.rs @@ -0,0 +1,138 @@ +#[doc = "Register `AMOUNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `AMOUNT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `TXDATABITS` reader - Number of bits in the last or first byte read from RAM that shall be included in the frame (excluding parity bit)."] +pub struct TXDATABITS_R(crate::FieldReader); +impl TXDATABITS_R { + pub(crate) fn new(bits: u8) -> Self { + TXDATABITS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TXDATABITS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TXDATABITS` writer - Number of bits in the last or first byte read from RAM that shall be included in the frame (excluding parity bit)."] +pub struct TXDATABITS_W<'a> { + w: &'a mut W, +} +impl<'a> TXDATABITS_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); + self.w + } +} +#[doc = "Field `TXDATABYTES` reader - Number of complete bytes that shall be included in the frame, excluding CRC, parity and framing"] +pub struct TXDATABYTES_R(crate::FieldReader); +impl TXDATABYTES_R { + pub(crate) fn new(bits: u16) -> Self { + TXDATABYTES_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TXDATABYTES_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TXDATABYTES` writer - Number of complete bytes that shall be included in the frame, excluding CRC, parity and framing"] +pub struct TXDATABYTES_W<'a> { + w: &'a mut W, +} +impl<'a> TXDATABYTES_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01ff << 3)) | ((value as u32 & 0x01ff) << 3); + self.w + } +} +impl R { + #[doc = "Bits 0:2 - Number of bits in the last or first byte read from RAM that shall be included in the frame (excluding parity bit)."] + #[inline(always)] + pub fn txdatabits(&self) -> TXDATABITS_R { + TXDATABITS_R::new((self.bits & 0x07) as u8) + } + #[doc = "Bits 3:11 - Number of complete bytes that shall be included in the frame, excluding CRC, parity and framing"] + #[inline(always)] + pub fn txdatabytes(&self) -> TXDATABYTES_R { + TXDATABYTES_R::new(((self.bits >> 3) & 0x01ff) as u16) + } +} +impl W { + #[doc = "Bits 0:2 - Number of bits in the last or first byte read from RAM that shall be included in the frame (excluding parity bit)."] + #[inline(always)] + pub fn txdatabits(&mut self) -> TXDATABITS_W { + TXDATABITS_W { w: self } + } + #[doc = "Bits 3:11 - Number of complete bytes that shall be included in the frame, excluding CRC, parity and framing"] + #[inline(always)] + pub fn txdatabytes(&mut self) -> TXDATABYTES_W { + TXDATABYTES_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Size of outgoing frame\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [amount](index.html) module"] +pub struct AMOUNT_SPEC; +impl crate::RegisterSpec for AMOUNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [amount::R](R) reader structure"] +impl crate::Readable for AMOUNT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [amount::W](W) writer structure"] +impl crate::Writable for AMOUNT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets AMOUNT to value 0"] +impl crate::Resettable for AMOUNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nfct/txd/frameconfig.rs b/src/nfct/txd/frameconfig.rs new file mode 100644 index 0000000..41d1105 --- /dev/null +++ b/src/nfct/txd/frameconfig.rs @@ -0,0 +1,438 @@ +#[doc = "Register `FRAMECONFIG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `FRAMECONFIG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Adding parity or not in the frame\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PARITY_A { + #[doc = "0: Parity is not added in TX frames"] + NOPARITY = 0, + #[doc = "1: Parity is added TX frames"] + PARITY = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PARITY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PARITY` reader - Adding parity or not in the frame"] +pub struct PARITY_R(crate::FieldReader); +impl PARITY_R { + pub(crate) fn new(bits: bool) -> Self { + PARITY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PARITY_A { + match self.bits { + false => PARITY_A::NOPARITY, + true => PARITY_A::PARITY, + } + } + #[doc = "Checks if the value of the field is `NOPARITY`"] + #[inline(always)] + pub fn is_no_parity(&self) -> bool { + **self == PARITY_A::NOPARITY + } + #[doc = "Checks if the value of the field is `PARITY`"] + #[inline(always)] + pub fn is_parity(&self) -> bool { + **self == PARITY_A::PARITY + } +} +impl core::ops::Deref for PARITY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PARITY` writer - Adding parity or not in the frame"] +pub struct PARITY_W<'a> { + w: &'a mut W, +} +impl<'a> PARITY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PARITY_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Parity is not added in TX frames"] + #[inline(always)] + pub fn no_parity(self) -> &'a mut W { + self.variant(PARITY_A::NOPARITY) + } + #[doc = "Parity is added TX frames"] + #[inline(always)] + pub fn parity(self) -> &'a mut W { + self.variant(PARITY_A::PARITY) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Discarding unused bits in start or at end of a Frame\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DISCARDMODE_A { + #[doc = "0: Unused bits is discarded at end of frame"] + DISCARDEND = 0, + #[doc = "1: Unused bits is discarded at start of frame"] + DISCARDSTART = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DISCARDMODE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DISCARDMODE` reader - Discarding unused bits in start or at end of a Frame"] +pub struct DISCARDMODE_R(crate::FieldReader); +impl DISCARDMODE_R { + pub(crate) fn new(bits: bool) -> Self { + DISCARDMODE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DISCARDMODE_A { + match self.bits { + false => DISCARDMODE_A::DISCARDEND, + true => DISCARDMODE_A::DISCARDSTART, + } + } + #[doc = "Checks if the value of the field is `DISCARDEND`"] + #[inline(always)] + pub fn is_discard_end(&self) -> bool { + **self == DISCARDMODE_A::DISCARDEND + } + #[doc = "Checks if the value of the field is `DISCARDSTART`"] + #[inline(always)] + pub fn is_discard_start(&self) -> bool { + **self == DISCARDMODE_A::DISCARDSTART + } +} +impl core::ops::Deref for DISCARDMODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DISCARDMODE` writer - Discarding unused bits in start or at end of a Frame"] +pub struct DISCARDMODE_W<'a> { + w: &'a mut W, +} +impl<'a> DISCARDMODE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DISCARDMODE_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Unused bits is discarded at end of frame"] + #[inline(always)] + pub fn discard_end(self) -> &'a mut W { + self.variant(DISCARDMODE_A::DISCARDEND) + } + #[doc = "Unused bits is discarded at start of frame"] + #[inline(always)] + pub fn discard_start(self) -> &'a mut W { + self.variant(DISCARDMODE_A::DISCARDSTART) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Adding SoF or not in TX frames\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SOF_A { + #[doc = "0: Start of Frame symbol not added"] + NOSOF = 0, + #[doc = "1: Start of Frame symbol added"] + SOF = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SOF_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SOF` reader - Adding SoF or not in TX frames"] +pub struct SOF_R(crate::FieldReader); +impl SOF_R { + pub(crate) fn new(bits: bool) -> Self { + SOF_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SOF_A { + match self.bits { + false => SOF_A::NOSOF, + true => SOF_A::SOF, + } + } + #[doc = "Checks if the value of the field is `NOSOF`"] + #[inline(always)] + pub fn is_no_so_f(&self) -> bool { + **self == SOF_A::NOSOF + } + #[doc = "Checks if the value of the field is `SOF`"] + #[inline(always)] + pub fn is_so_f(&self) -> bool { + **self == SOF_A::SOF + } +} +impl core::ops::Deref for SOF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SOF` writer - Adding SoF or not in TX frames"] +pub struct SOF_W<'a> { + w: &'a mut W, +} +impl<'a> SOF_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SOF_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Start of Frame symbol not added"] + #[inline(always)] + pub fn no_so_f(self) -> &'a mut W { + self.variant(SOF_A::NOSOF) + } + #[doc = "Start of Frame symbol added"] + #[inline(always)] + pub fn so_f(self) -> &'a mut W { + self.variant(SOF_A::SOF) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "CRC mode for outgoing frames\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CRCMODETX_A { + #[doc = "0: CRC is not added to the frame"] + NOCRCTX = 0, + #[doc = "1: 16 bit CRC added to the frame based on all the data read from RAM that is used in the frame"] + CRC16TX = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CRCMODETX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CRCMODETX` reader - CRC mode for outgoing frames"] +pub struct CRCMODETX_R(crate::FieldReader); +impl CRCMODETX_R { + pub(crate) fn new(bits: bool) -> Self { + CRCMODETX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CRCMODETX_A { + match self.bits { + false => CRCMODETX_A::NOCRCTX, + true => CRCMODETX_A::CRC16TX, + } + } + #[doc = "Checks if the value of the field is `NOCRCTX`"] + #[inline(always)] + pub fn is_no_crctx(&self) -> bool { + **self == CRCMODETX_A::NOCRCTX + } + #[doc = "Checks if the value of the field is `CRC16TX`"] + #[inline(always)] + pub fn is_crc16tx(&self) -> bool { + **self == CRCMODETX_A::CRC16TX + } +} +impl core::ops::Deref for CRCMODETX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CRCMODETX` writer - CRC mode for outgoing frames"] +pub struct CRCMODETX_W<'a> { + w: &'a mut W, +} +impl<'a> CRCMODETX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CRCMODETX_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "CRC is not added to the frame"] + #[inline(always)] + pub fn no_crctx(self) -> &'a mut W { + self.variant(CRCMODETX_A::NOCRCTX) + } + #[doc = "16 bit CRC added to the frame based on all the data read from RAM that is used in the frame"] + #[inline(always)] + pub fn crc16tx(self) -> &'a mut W { + self.variant(CRCMODETX_A::CRC16TX) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +impl R { + #[doc = "Bit 0 - Adding parity or not in the frame"] + #[inline(always)] + pub fn parity(&self) -> PARITY_R { + PARITY_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Discarding unused bits in start or at end of a Frame"] + #[inline(always)] + pub fn discardmode(&self) -> DISCARDMODE_R { + DISCARDMODE_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Adding SoF or not in TX frames"] + #[inline(always)] + pub fn sof(&self) -> SOF_R { + SOF_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 4 - CRC mode for outgoing frames"] + #[inline(always)] + pub fn crcmodetx(&self) -> CRCMODETX_R { + CRCMODETX_R::new(((self.bits >> 4) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Adding parity or not in the frame"] + #[inline(always)] + pub fn parity(&mut self) -> PARITY_W { + PARITY_W { w: self } + } + #[doc = "Bit 1 - Discarding unused bits in start or at end of a Frame"] + #[inline(always)] + pub fn discardmode(&mut self) -> DISCARDMODE_W { + DISCARDMODE_W { w: self } + } + #[doc = "Bit 2 - Adding SoF or not in TX frames"] + #[inline(always)] + pub fn sof(&mut self) -> SOF_W { + SOF_W { w: self } + } + #[doc = "Bit 4 - CRC mode for outgoing frames"] + #[inline(always)] + pub fn crcmodetx(&mut self) -> CRCMODETX_W { + CRCMODETX_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Configuration of outgoing frames\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [frameconfig](index.html) module"] +pub struct FRAMECONFIG_SPEC; +impl crate::RegisterSpec for FRAMECONFIG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [frameconfig::R](R) reader structure"] +impl crate::Readable for FRAMECONFIG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [frameconfig::W](W) writer structure"] +impl crate::Writable for FRAMECONFIG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets FRAMECONFIG to value 0x17"] +impl crate::Resettable for FRAMECONFIG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x17 + } +} diff --git a/src/nvmc.rs b/src/nvmc.rs new file mode 100644 index 0000000..edfee54 --- /dev/null +++ b/src/nvmc.rs @@ -0,0 +1,83 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + _reserved0: [u8; 0x0400], + #[doc = "0x400 - Ready flag"] + pub ready: crate::Reg, + _reserved1: [u8; 0x0100], + #[doc = "0x504 - Configuration register"] + pub config: crate::Reg, + _reserved_2_erasepage: [u8; 0x04], + #[doc = "0x50c - Register for erasing all non-volatile user memory"] + pub eraseall: crate::Reg, + #[doc = "0x510 - Deprecated register - Register for erasing a page in Code area. Equivalent to ERASEPAGE."] + pub erasepcr0: crate::Reg, + #[doc = "0x514 - Register for erasing User Information Configuration Registers"] + pub eraseuicr: crate::Reg, + _reserved6: [u8; 0x28], + #[doc = "0x540 - I-Code cache configuration register."] + pub icachecnf: crate::Reg, + _reserved7: [u8; 0x04], + #[doc = "0x548 - I-Code cache hit counter."] + pub ihit: crate::Reg, + #[doc = "0x54c - I-Code cache miss counter."] + pub imiss: crate::Reg, +} +impl RegisterBlock { + #[doc = "0x508 - Deprecated register - Register for erasing a page in Code area. Equivalent to ERASEPAGE."] + #[inline(always)] + pub fn erasepcr1(&self) -> &crate::Reg { + unsafe { + &*(((self as *const Self) as *const u8).add(1288usize) + as *const crate::Reg) + } + } + #[doc = "0x508 - Register for erasing a page in Code area"] + #[inline(always)] + pub fn erasepage(&self) -> &crate::Reg { + unsafe { + &*(((self as *const Self) as *const u8).add(1288usize) + as *const crate::Reg) + } + } +} +#[doc = "READY register accessor: an alias for `Reg`"] +pub type READY = crate::Reg; +#[doc = "Ready flag"] +pub mod ready; +#[doc = "CONFIG register accessor: an alias for `Reg`"] +pub type CONFIG = crate::Reg; +#[doc = "Configuration register"] +pub mod config; +#[doc = "ERASEPAGE register accessor: an alias for `Reg`"] +pub type ERASEPAGE = crate::Reg; +#[doc = "Register for erasing a page in Code area"] +pub mod erasepage; +#[doc = "ERASEPCR1 register accessor: an alias for `Reg`"] +pub type ERASEPCR1 = crate::Reg; +#[doc = "Deprecated register - Register for erasing a page in Code area. Equivalent to ERASEPAGE."] +pub mod erasepcr1; +#[doc = "ERASEALL register accessor: an alias for `Reg`"] +pub type ERASEALL = crate::Reg; +#[doc = "Register for erasing all non-volatile user memory"] +pub mod eraseall; +#[doc = "ERASEPCR0 register accessor: an alias for `Reg`"] +pub type ERASEPCR0 = crate::Reg; +#[doc = "Deprecated register - Register for erasing a page in Code area. Equivalent to ERASEPAGE."] +pub mod erasepcr0; +#[doc = "ERASEUICR register accessor: an alias for `Reg`"] +pub type ERASEUICR = crate::Reg; +#[doc = "Register for erasing User Information Configuration Registers"] +pub mod eraseuicr; +#[doc = "ICACHECNF register accessor: an alias for `Reg`"] +pub type ICACHECNF = crate::Reg; +#[doc = "I-Code cache configuration register."] +pub mod icachecnf; +#[doc = "IHIT register accessor: an alias for `Reg`"] +pub type IHIT = crate::Reg; +#[doc = "I-Code cache hit counter."] +pub mod ihit; +#[doc = "IMISS register accessor: an alias for `Reg`"] +pub type IMISS = crate::Reg; +#[doc = "I-Code cache miss counter."] +pub mod imiss; diff --git a/src/nvmc/config.rs b/src/nvmc/config.rs new file mode 100644 index 0000000..3ce7a16 --- /dev/null +++ b/src/nvmc/config.rs @@ -0,0 +1,164 @@ +#[doc = "Register `CONFIG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CONFIG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Program memory access mode. It is strongly recommended to only activate erase and write modes when they are actively used. Enabling write or erase will invalidate the cache and keep it invalidated.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum WEN_A { + #[doc = "0: Read only access"] + REN = 0, + #[doc = "1: Write Enabled"] + WEN = 1, + #[doc = "2: Erase enabled"] + EEN = 2, +} +impl From for u8 { + #[inline(always)] + fn from(variant: WEN_A) -> Self { + variant as _ + } +} +#[doc = "Field `WEN` reader - Program memory access mode. It is strongly recommended to only activate erase and write modes when they are actively used. Enabling write or erase will invalidate the cache and keep it invalidated."] +pub struct WEN_R(crate::FieldReader); +impl WEN_R { + pub(crate) fn new(bits: u8) -> Self { + WEN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(WEN_A::REN), + 1 => Some(WEN_A::WEN), + 2 => Some(WEN_A::EEN), + _ => None, + } + } + #[doc = "Checks if the value of the field is `REN`"] + #[inline(always)] + pub fn is_ren(&self) -> bool { + **self == WEN_A::REN + } + #[doc = "Checks if the value of the field is `WEN`"] + #[inline(always)] + pub fn is_wen(&self) -> bool { + **self == WEN_A::WEN + } + #[doc = "Checks if the value of the field is `EEN`"] + #[inline(always)] + pub fn is_een(&self) -> bool { + **self == WEN_A::EEN + } +} +impl core::ops::Deref for WEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `WEN` writer - Program memory access mode. It is strongly recommended to only activate erase and write modes when they are actively used. Enabling write or erase will invalidate the cache and keep it invalidated."] +pub struct WEN_W<'a> { + w: &'a mut W, +} +impl<'a> WEN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: WEN_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Read only access"] + #[inline(always)] + pub fn ren(self) -> &'a mut W { + self.variant(WEN_A::REN) + } + #[doc = "Write Enabled"] + #[inline(always)] + pub fn wen(self) -> &'a mut W { + self.variant(WEN_A::WEN) + } + #[doc = "Erase enabled"] + #[inline(always)] + pub fn een(self) -> &'a mut W { + self.variant(WEN_A::EEN) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); + self.w + } +} +impl R { + #[doc = "Bits 0:1 - Program memory access mode. It is strongly recommended to only activate erase and write modes when they are actively used. Enabling write or erase will invalidate the cache and keep it invalidated."] + #[inline(always)] + pub fn wen(&self) -> WEN_R { + WEN_R::new((self.bits & 0x03) as u8) + } +} +impl W { + #[doc = "Bits 0:1 - Program memory access mode. It is strongly recommended to only activate erase and write modes when they are actively used. Enabling write or erase will invalidate the cache and keep it invalidated."] + #[inline(always)] + pub fn wen(&mut self) -> WEN_W { + WEN_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Configuration register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [config](index.html) module"] +pub struct CONFIG_SPEC; +impl crate::RegisterSpec for CONFIG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [config::R](R) reader structure"] +impl crate::Readable for CONFIG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [config::W](W) writer structure"] +impl crate::Writable for CONFIG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CONFIG to value 0"] +impl crate::Resettable for CONFIG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nvmc/eraseall.rs b/src/nvmc/eraseall.rs new file mode 100644 index 0000000..df5a34b --- /dev/null +++ b/src/nvmc/eraseall.rs @@ -0,0 +1,159 @@ +#[doc = "Register `ERASEALL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ERASEALL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Erase all non-volatile memory including UICR registers. Note that code erase has to be enabled by CONFIG.EEN before the UICR can be erased.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERASEALL_A { + #[doc = "0: No operation"] + NOOPERATION = 0, + #[doc = "1: Start chip erase"] + ERASE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERASEALL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERASEALL` reader - Erase all non-volatile memory including UICR registers. Note that code erase has to be enabled by CONFIG.EEN before the UICR can be erased."] +pub struct ERASEALL_R(crate::FieldReader); +impl ERASEALL_R { + pub(crate) fn new(bits: bool) -> Self { + ERASEALL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ERASEALL_A { + match self.bits { + false => ERASEALL_A::NOOPERATION, + true => ERASEALL_A::ERASE, + } + } + #[doc = "Checks if the value of the field is `NOOPERATION`"] + #[inline(always)] + pub fn is_no_operation(&self) -> bool { + **self == ERASEALL_A::NOOPERATION + } + #[doc = "Checks if the value of the field is `ERASE`"] + #[inline(always)] + pub fn is_erase(&self) -> bool { + **self == ERASEALL_A::ERASE + } +} +impl core::ops::Deref for ERASEALL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ERASEALL` writer - Erase all non-volatile memory including UICR registers. Note that code erase has to be enabled by CONFIG.EEN before the UICR can be erased."] +pub struct ERASEALL_W<'a> { + w: &'a mut W, +} +impl<'a> ERASEALL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ERASEALL_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No operation"] + #[inline(always)] + pub fn no_operation(self) -> &'a mut W { + self.variant(ERASEALL_A::NOOPERATION) + } + #[doc = "Start chip erase"] + #[inline(always)] + pub fn erase(self) -> &'a mut W { + self.variant(ERASEALL_A::ERASE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Erase all non-volatile memory including UICR registers. Note that code erase has to be enabled by CONFIG.EEN before the UICR can be erased."] + #[inline(always)] + pub fn eraseall(&self) -> ERASEALL_R { + ERASEALL_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Erase all non-volatile memory including UICR registers. Note that code erase has to be enabled by CONFIG.EEN before the UICR can be erased."] + #[inline(always)] + pub fn eraseall(&mut self) -> ERASEALL_W { + ERASEALL_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Register for erasing all non-volatile user memory\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [eraseall](index.html) module"] +pub struct ERASEALL_SPEC; +impl crate::RegisterSpec for ERASEALL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [eraseall::R](R) reader structure"] +impl crate::Readable for ERASEALL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [eraseall::W](W) writer structure"] +impl crate::Writable for ERASEALL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ERASEALL to value 0"] +impl crate::Resettable for ERASEALL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nvmc/erasepage.rs b/src/nvmc/erasepage.rs new file mode 100644 index 0000000..5a27028 --- /dev/null +++ b/src/nvmc/erasepage.rs @@ -0,0 +1,102 @@ +#[doc = "Register `ERASEPAGE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ERASEPAGE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `ERASEPAGE` reader - Register for starting erase of a page in Code area"] +pub struct ERASEPAGE_R(crate::FieldReader); +impl ERASEPAGE_R { + pub(crate) fn new(bits: u32) -> Self { + ERASEPAGE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ERASEPAGE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ERASEPAGE` writer - Register for starting erase of a page in Code area"] +pub struct ERASEPAGE_W<'a> { + w: &'a mut W, +} +impl<'a> ERASEPAGE_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Register for starting erase of a page in Code area"] + #[inline(always)] + pub fn erasepage(&self) -> ERASEPAGE_R { + ERASEPAGE_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Register for starting erase of a page in Code area"] + #[inline(always)] + pub fn erasepage(&mut self) -> ERASEPAGE_W { + ERASEPAGE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Register for erasing a page in Code area\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [erasepage](index.html) module"] +pub struct ERASEPAGE_SPEC; +impl crate::RegisterSpec for ERASEPAGE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [erasepage::R](R) reader structure"] +impl crate::Readable for ERASEPAGE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [erasepage::W](W) writer structure"] +impl crate::Writable for ERASEPAGE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ERASEPAGE to value 0"] +impl crate::Resettable for ERASEPAGE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nvmc/erasepcr0.rs b/src/nvmc/erasepcr0.rs new file mode 100644 index 0000000..cdfc888 --- /dev/null +++ b/src/nvmc/erasepcr0.rs @@ -0,0 +1,102 @@ +#[doc = "Register `ERASEPCR0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ERASEPCR0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `ERASEPCR0` reader - Register for starting erase of a page in Code area. Equivalent to ERASEPAGE."] +pub struct ERASEPCR0_R(crate::FieldReader); +impl ERASEPCR0_R { + pub(crate) fn new(bits: u32) -> Self { + ERASEPCR0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ERASEPCR0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ERASEPCR0` writer - Register for starting erase of a page in Code area. Equivalent to ERASEPAGE."] +pub struct ERASEPCR0_W<'a> { + w: &'a mut W, +} +impl<'a> ERASEPCR0_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Register for starting erase of a page in Code area. Equivalent to ERASEPAGE."] + #[inline(always)] + pub fn erasepcr0(&self) -> ERASEPCR0_R { + ERASEPCR0_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Register for starting erase of a page in Code area. Equivalent to ERASEPAGE."] + #[inline(always)] + pub fn erasepcr0(&mut self) -> ERASEPCR0_W { + ERASEPCR0_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Deprecated register - Register for erasing a page in Code area. Equivalent to ERASEPAGE.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [erasepcr0](index.html) module"] +pub struct ERASEPCR0_SPEC; +impl crate::RegisterSpec for ERASEPCR0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [erasepcr0::R](R) reader structure"] +impl crate::Readable for ERASEPCR0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [erasepcr0::W](W) writer structure"] +impl crate::Writable for ERASEPCR0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ERASEPCR0 to value 0"] +impl crate::Resettable for ERASEPCR0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nvmc/erasepcr1.rs b/src/nvmc/erasepcr1.rs new file mode 100644 index 0000000..878f3ce --- /dev/null +++ b/src/nvmc/erasepcr1.rs @@ -0,0 +1,102 @@ +#[doc = "Register `ERASEPCR1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ERASEPCR1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `ERASEPCR1` reader - Register for erasing a page in Code area. Equivalent to ERASEPAGE."] +pub struct ERASEPCR1_R(crate::FieldReader); +impl ERASEPCR1_R { + pub(crate) fn new(bits: u32) -> Self { + ERASEPCR1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ERASEPCR1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ERASEPCR1` writer - Register for erasing a page in Code area. Equivalent to ERASEPAGE."] +pub struct ERASEPCR1_W<'a> { + w: &'a mut W, +} +impl<'a> ERASEPCR1_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Register for erasing a page in Code area. Equivalent to ERASEPAGE."] + #[inline(always)] + pub fn erasepcr1(&self) -> ERASEPCR1_R { + ERASEPCR1_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Register for erasing a page in Code area. Equivalent to ERASEPAGE."] + #[inline(always)] + pub fn erasepcr1(&mut self) -> ERASEPCR1_W { + ERASEPCR1_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Deprecated register - Register for erasing a page in Code area. Equivalent to ERASEPAGE.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [erasepcr1](index.html) module"] +pub struct ERASEPCR1_SPEC; +impl crate::RegisterSpec for ERASEPCR1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [erasepcr1::R](R) reader structure"] +impl crate::Readable for ERASEPCR1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [erasepcr1::W](W) writer structure"] +impl crate::Writable for ERASEPCR1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ERASEPCR1 to value 0"] +impl crate::Resettable for ERASEPCR1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nvmc/eraseuicr.rs b/src/nvmc/eraseuicr.rs new file mode 100644 index 0000000..dfb8f08 --- /dev/null +++ b/src/nvmc/eraseuicr.rs @@ -0,0 +1,159 @@ +#[doc = "Register `ERASEUICR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ERASEUICR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Register starting erase of all User Information Configuration Registers. Note that code erase has to be enabled by CONFIG.EEN before the UICR can be erased.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERASEUICR_A { + #[doc = "0: No operation"] + NOOPERATION = 0, + #[doc = "1: Start erase of UICR"] + ERASE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERASEUICR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERASEUICR` reader - Register starting erase of all User Information Configuration Registers. Note that code erase has to be enabled by CONFIG.EEN before the UICR can be erased."] +pub struct ERASEUICR_R(crate::FieldReader); +impl ERASEUICR_R { + pub(crate) fn new(bits: bool) -> Self { + ERASEUICR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ERASEUICR_A { + match self.bits { + false => ERASEUICR_A::NOOPERATION, + true => ERASEUICR_A::ERASE, + } + } + #[doc = "Checks if the value of the field is `NOOPERATION`"] + #[inline(always)] + pub fn is_no_operation(&self) -> bool { + **self == ERASEUICR_A::NOOPERATION + } + #[doc = "Checks if the value of the field is `ERASE`"] + #[inline(always)] + pub fn is_erase(&self) -> bool { + **self == ERASEUICR_A::ERASE + } +} +impl core::ops::Deref for ERASEUICR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ERASEUICR` writer - Register starting erase of all User Information Configuration Registers. Note that code erase has to be enabled by CONFIG.EEN before the UICR can be erased."] +pub struct ERASEUICR_W<'a> { + w: &'a mut W, +} +impl<'a> ERASEUICR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ERASEUICR_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "No operation"] + #[inline(always)] + pub fn no_operation(self) -> &'a mut W { + self.variant(ERASEUICR_A::NOOPERATION) + } + #[doc = "Start erase of UICR"] + #[inline(always)] + pub fn erase(self) -> &'a mut W { + self.variant(ERASEUICR_A::ERASE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Register starting erase of all User Information Configuration Registers. Note that code erase has to be enabled by CONFIG.EEN before the UICR can be erased."] + #[inline(always)] + pub fn eraseuicr(&self) -> ERASEUICR_R { + ERASEUICR_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Register starting erase of all User Information Configuration Registers. Note that code erase has to be enabled by CONFIG.EEN before the UICR can be erased."] + #[inline(always)] + pub fn eraseuicr(&mut self) -> ERASEUICR_W { + ERASEUICR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Register for erasing User Information Configuration Registers\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [eraseuicr](index.html) module"] +pub struct ERASEUICR_SPEC; +impl crate::RegisterSpec for ERASEUICR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [eraseuicr::R](R) reader structure"] +impl crate::Readable for ERASEUICR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [eraseuicr::W](W) writer structure"] +impl crate::Writable for ERASEUICR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ERASEUICR to value 0"] +impl crate::Resettable for ERASEUICR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nvmc/icachecnf.rs b/src/nvmc/icachecnf.rs new file mode 100644 index 0000000..2522062 --- /dev/null +++ b/src/nvmc/icachecnf.rs @@ -0,0 +1,252 @@ +#[doc = "Register `ICACHECNF` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ICACHECNF` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Cache enable\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CACHEEN_A { + #[doc = "0: Disable cache. Invalidates all cache entries."] + DISABLED = 0, + #[doc = "1: Enable cache"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CACHEEN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CACHEEN` reader - Cache enable"] +pub struct CACHEEN_R(crate::FieldReader); +impl CACHEEN_R { + pub(crate) fn new(bits: bool) -> Self { + CACHEEN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CACHEEN_A { + match self.bits { + false => CACHEEN_A::DISABLED, + true => CACHEEN_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CACHEEN_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CACHEEN_A::ENABLED + } +} +impl core::ops::Deref for CACHEEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CACHEEN` writer - Cache enable"] +pub struct CACHEEN_W<'a> { + w: &'a mut W, +} +impl<'a> CACHEEN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CACHEEN_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable cache. Invalidates all cache entries."] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CACHEEN_A::DISABLED) + } + #[doc = "Enable cache"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CACHEEN_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Cache profiling enable\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CACHEPROFEN_A { + #[doc = "0: Disable cache profiling"] + DISABLED = 0, + #[doc = "1: Enable cache profiling"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CACHEPROFEN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CACHEPROFEN` reader - Cache profiling enable"] +pub struct CACHEPROFEN_R(crate::FieldReader); +impl CACHEPROFEN_R { + pub(crate) fn new(bits: bool) -> Self { + CACHEPROFEN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CACHEPROFEN_A { + match self.bits { + false => CACHEPROFEN_A::DISABLED, + true => CACHEPROFEN_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CACHEPROFEN_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CACHEPROFEN_A::ENABLED + } +} +impl core::ops::Deref for CACHEPROFEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CACHEPROFEN` writer - Cache profiling enable"] +pub struct CACHEPROFEN_W<'a> { + w: &'a mut W, +} +impl<'a> CACHEPROFEN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CACHEPROFEN_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable cache profiling"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CACHEPROFEN_A::DISABLED) + } + #[doc = "Enable cache profiling"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CACHEPROFEN_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +impl R { + #[doc = "Bit 0 - Cache enable"] + #[inline(always)] + pub fn cacheen(&self) -> CACHEEN_R { + CACHEEN_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 8 - Cache profiling enable"] + #[inline(always)] + pub fn cacheprofen(&self) -> CACHEPROFEN_R { + CACHEPROFEN_R::new(((self.bits >> 8) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Cache enable"] + #[inline(always)] + pub fn cacheen(&mut self) -> CACHEEN_W { + CACHEEN_W { w: self } + } + #[doc = "Bit 8 - Cache profiling enable"] + #[inline(always)] + pub fn cacheprofen(&mut self) -> CACHEPROFEN_W { + CACHEPROFEN_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "I-Code cache configuration register.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [icachecnf](index.html) module"] +pub struct ICACHECNF_SPEC; +impl crate::RegisterSpec for ICACHECNF_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [icachecnf::R](R) reader structure"] +impl crate::Readable for ICACHECNF_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [icachecnf::W](W) writer structure"] +impl crate::Writable for ICACHECNF_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ICACHECNF to value 0"] +impl crate::Resettable for ICACHECNF_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nvmc/ihit.rs b/src/nvmc/ihit.rs new file mode 100644 index 0000000..5572aca --- /dev/null +++ b/src/nvmc/ihit.rs @@ -0,0 +1,102 @@ +#[doc = "Register `IHIT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `IHIT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `HITS` reader - Number of cache hits"] +pub struct HITS_R(crate::FieldReader); +impl HITS_R { + pub(crate) fn new(bits: u32) -> Self { + HITS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for HITS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HITS` writer - Number of cache hits"] +pub struct HITS_W<'a> { + w: &'a mut W, +} +impl<'a> HITS_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Number of cache hits"] + #[inline(always)] + pub fn hits(&self) -> HITS_R { + HITS_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Number of cache hits"] + #[inline(always)] + pub fn hits(&mut self) -> HITS_W { + HITS_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "I-Code cache hit counter.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ihit](index.html) module"] +pub struct IHIT_SPEC; +impl crate::RegisterSpec for IHIT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ihit::R](R) reader structure"] +impl crate::Readable for IHIT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ihit::W](W) writer structure"] +impl crate::Writable for IHIT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets IHIT to value 0"] +impl crate::Resettable for IHIT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nvmc/imiss.rs b/src/nvmc/imiss.rs new file mode 100644 index 0000000..7515bd7 --- /dev/null +++ b/src/nvmc/imiss.rs @@ -0,0 +1,102 @@ +#[doc = "Register `IMISS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `IMISS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `MISSES` reader - Number of cache misses"] +pub struct MISSES_R(crate::FieldReader); +impl MISSES_R { + pub(crate) fn new(bits: u32) -> Self { + MISSES_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MISSES_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MISSES` writer - Number of cache misses"] +pub struct MISSES_W<'a> { + w: &'a mut W, +} +impl<'a> MISSES_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Number of cache misses"] + #[inline(always)] + pub fn misses(&self) -> MISSES_R { + MISSES_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Number of cache misses"] + #[inline(always)] + pub fn misses(&mut self) -> MISSES_W { + MISSES_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "I-Code cache miss counter.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [imiss](index.html) module"] +pub struct IMISS_SPEC; +impl crate::RegisterSpec for IMISS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [imiss::R](R) reader structure"] +impl crate::Readable for IMISS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [imiss::W](W) writer structure"] +impl crate::Writable for IMISS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets IMISS to value 0"] +impl crate::Resettable for IMISS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/nvmc/ready.rs b/src/nvmc/ready.rs new file mode 100644 index 0000000..ec922b8 --- /dev/null +++ b/src/nvmc/ready.rs @@ -0,0 +1,84 @@ +#[doc = "Register `READY` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "NVMC is ready or busy\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_A { + #[doc = "0: NVMC is busy (on-going write or erase operation)"] + BUSY = 0, + #[doc = "1: NVMC is ready"] + READY = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY` reader - NVMC is ready or busy"] +pub struct READY_R(crate::FieldReader); +impl READY_R { + pub(crate) fn new(bits: bool) -> Self { + READY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> READY_A { + match self.bits { + false => READY_A::BUSY, + true => READY_A::READY, + } + } + #[doc = "Checks if the value of the field is `BUSY`"] + #[inline(always)] + pub fn is_busy(&self) -> bool { + **self == READY_A::BUSY + } + #[doc = "Checks if the value of the field is `READY`"] + #[inline(always)] + pub fn is_ready(&self) -> bool { + **self == READY_A::READY + } +} +impl core::ops::Deref for READY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bit 0 - NVMC is ready or busy"] + #[inline(always)] + pub fn ready(&self) -> READY_R { + READY_R::new((self.bits & 0x01) != 0) + } +} +#[doc = "Ready flag\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 [ready](index.html) module"] +pub struct READY_SPEC; +impl crate::RegisterSpec for READY_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ready::R](R) reader structure"] +impl crate::Readable for READY_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets READY to value 0"] +impl crate::Resettable for READY_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/p0.rs b/src/p0.rs new file mode 100644 index 0000000..f9c5718 --- /dev/null +++ b/src/p0.rs @@ -0,0 +1,66 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + _reserved0: [u8; 0x0504], + #[doc = "0x504 - Write GPIO port"] + pub out: crate::Reg, + #[doc = "0x508 - Set individual bits in GPIO port"] + pub outset: crate::Reg, + #[doc = "0x50c - Clear individual bits in GPIO port"] + pub outclr: crate::Reg, + #[doc = "0x510 - Read GPIO port"] + pub in_: crate::Reg, + #[doc = "0x514 - Direction of GPIO pins"] + pub dir: crate::Reg, + #[doc = "0x518 - DIR set register"] + pub dirset: crate::Reg, + #[doc = "0x51c - DIR clear register"] + pub dirclr: crate::Reg, + #[doc = "0x520 - Latch register indicating what GPIO pins that have met the criteria set in the PIN_CNF\\[n\\].SENSE registers"] + pub latch: crate::Reg, + #[doc = "0x524 - Select between default DETECT signal behaviour and LDETECT mode"] + pub detectmode: crate::Reg, + _reserved9: [u8; 0x01d8], + #[doc = "0x700..0x780 - Description collection\\[0\\]: Configuration of GPIO pins"] + pub pin_cnf: [crate::Reg; 32], +} +#[doc = "OUT register accessor: an alias for `Reg`"] +pub type OUT = crate::Reg; +#[doc = "Write GPIO port"] +pub mod out; +#[doc = "OUTSET register accessor: an alias for `Reg`"] +pub type OUTSET = crate::Reg; +#[doc = "Set individual bits in GPIO port"] +pub mod outset; +#[doc = "OUTCLR register accessor: an alias for `Reg`"] +pub type OUTCLR = crate::Reg; +#[doc = "Clear individual bits in GPIO port"] +pub mod outclr; +#[doc = "IN register accessor: an alias for `Reg`"] +pub type IN = crate::Reg; +#[doc = "Read GPIO port"] +pub mod in_; +#[doc = "DIR register accessor: an alias for `Reg`"] +pub type DIR = crate::Reg; +#[doc = "Direction of GPIO pins"] +pub mod dir; +#[doc = "DIRSET register accessor: an alias for `Reg`"] +pub type DIRSET = crate::Reg; +#[doc = "DIR set register"] +pub mod dirset; +#[doc = "DIRCLR register accessor: an alias for `Reg`"] +pub type DIRCLR = crate::Reg; +#[doc = "DIR clear register"] +pub mod dirclr; +#[doc = "LATCH register accessor: an alias for `Reg`"] +pub type LATCH = crate::Reg; +#[doc = "Latch register indicating what GPIO pins that have met the criteria set in the PIN_CNF\\[n\\].SENSE registers"] +pub mod latch; +#[doc = "DETECTMODE register accessor: an alias for `Reg`"] +pub type DETECTMODE = crate::Reg; +#[doc = "Select between default DETECT signal behaviour and LDETECT mode"] +pub mod detectmode; +#[doc = "PIN_CNF register accessor: an alias for `Reg`"] +pub type PIN_CNF = crate::Reg; +#[doc = "Description collection\\[0\\]: Configuration of GPIO pins"] +pub mod pin_cnf; diff --git a/src/p0/detectmode.rs b/src/p0/detectmode.rs new file mode 100644 index 0000000..60f6229 --- /dev/null +++ b/src/p0/detectmode.rs @@ -0,0 +1,159 @@ +#[doc = "Register `DETECTMODE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DETECTMODE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Select between default DETECT signal behaviour and LDETECT mode\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DETECTMODE_A { + #[doc = "0: DETECT directly connected to PIN DETECT signals"] + DEFAULT = 0, + #[doc = "1: Use the latched LDETECT behaviour"] + LDETECT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DETECTMODE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DETECTMODE` reader - Select between default DETECT signal behaviour and LDETECT mode"] +pub struct DETECTMODE_R(crate::FieldReader); +impl DETECTMODE_R { + pub(crate) fn new(bits: bool) -> Self { + DETECTMODE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DETECTMODE_A { + match self.bits { + false => DETECTMODE_A::DEFAULT, + true => DETECTMODE_A::LDETECT, + } + } + #[doc = "Checks if the value of the field is `DEFAULT`"] + #[inline(always)] + pub fn is_default(&self) -> bool { + **self == DETECTMODE_A::DEFAULT + } + #[doc = "Checks if the value of the field is `LDETECT`"] + #[inline(always)] + pub fn is_ldetect(&self) -> bool { + **self == DETECTMODE_A::LDETECT + } +} +impl core::ops::Deref for DETECTMODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DETECTMODE` writer - Select between default DETECT signal behaviour and LDETECT mode"] +pub struct DETECTMODE_W<'a> { + w: &'a mut W, +} +impl<'a> DETECTMODE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DETECTMODE_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "DETECT directly connected to PIN DETECT signals"] + #[inline(always)] + pub fn default(self) -> &'a mut W { + self.variant(DETECTMODE_A::DEFAULT) + } + #[doc = "Use the latched LDETECT behaviour"] + #[inline(always)] + pub fn ldetect(self) -> &'a mut W { + self.variant(DETECTMODE_A::LDETECT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Select between default DETECT signal behaviour and LDETECT mode"] + #[inline(always)] + pub fn detectmode(&self) -> DETECTMODE_R { + DETECTMODE_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Select between default DETECT signal behaviour and LDETECT mode"] + #[inline(always)] + pub fn detectmode(&mut self) -> DETECTMODE_W { + DETECTMODE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Select between default DETECT signal behaviour and LDETECT mode\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [detectmode](index.html) module"] +pub struct DETECTMODE_SPEC; +impl crate::RegisterSpec for DETECTMODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [detectmode::R](R) reader structure"] +impl crate::Readable for DETECTMODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [detectmode::W](W) writer structure"] +impl crate::Writable for DETECTMODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DETECTMODE to value 0"] +impl crate::Resettable for DETECTMODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/p0/dir.rs b/src/p0/dir.rs new file mode 100644 index 0000000..aac203c --- /dev/null +++ b/src/p0/dir.rs @@ -0,0 +1,3042 @@ +#[doc = "Register `DIR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DIR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Pin 0\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN0_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN0` reader - Pin 0"] +pub struct PIN0_R(crate::FieldReader); +impl PIN0_R { + pub(crate) fn new(bits: bool) -> Self { + PIN0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN0_A { + match self.bits { + false => PIN0_A::INPUT, + true => PIN0_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN0_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN0_A::OUTPUT + } +} +impl core::ops::Deref for PIN0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN0` writer - Pin 0"] +pub struct PIN0_W<'a> { + w: &'a mut W, +} +impl<'a> PIN0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN0_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN0_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN0_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Pin 1\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN1_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN1` reader - Pin 1"] +pub struct PIN1_R(crate::FieldReader); +impl PIN1_R { + pub(crate) fn new(bits: bool) -> Self { + PIN1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN1_A { + match self.bits { + false => PIN1_A::INPUT, + true => PIN1_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN1_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN1_A::OUTPUT + } +} +impl core::ops::Deref for PIN1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN1` writer - Pin 1"] +pub struct PIN1_W<'a> { + w: &'a mut W, +} +impl<'a> PIN1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN1_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN1_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN1_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Pin 2\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN2_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN2` reader - Pin 2"] +pub struct PIN2_R(crate::FieldReader); +impl PIN2_R { + pub(crate) fn new(bits: bool) -> Self { + PIN2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN2_A { + match self.bits { + false => PIN2_A::INPUT, + true => PIN2_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN2_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN2_A::OUTPUT + } +} +impl core::ops::Deref for PIN2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN2` writer - Pin 2"] +pub struct PIN2_W<'a> { + w: &'a mut W, +} +impl<'a> PIN2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN2_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN2_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN2_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Pin 3\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN3_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN3` reader - Pin 3"] +pub struct PIN3_R(crate::FieldReader); +impl PIN3_R { + pub(crate) fn new(bits: bool) -> Self { + PIN3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN3_A { + match self.bits { + false => PIN3_A::INPUT, + true => PIN3_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN3_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN3_A::OUTPUT + } +} +impl core::ops::Deref for PIN3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN3` writer - Pin 3"] +pub struct PIN3_W<'a> { + w: &'a mut W, +} +impl<'a> PIN3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN3_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN3_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN3_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Pin 4\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN4_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN4_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN4` reader - Pin 4"] +pub struct PIN4_R(crate::FieldReader); +impl PIN4_R { + pub(crate) fn new(bits: bool) -> Self { + PIN4_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN4_A { + match self.bits { + false => PIN4_A::INPUT, + true => PIN4_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN4_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN4_A::OUTPUT + } +} +impl core::ops::Deref for PIN4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN4` writer - Pin 4"] +pub struct PIN4_W<'a> { + w: &'a mut W, +} +impl<'a> PIN4_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN4_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN4_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN4_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Pin 5\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN5_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN5_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN5` reader - Pin 5"] +pub struct PIN5_R(crate::FieldReader); +impl PIN5_R { + pub(crate) fn new(bits: bool) -> Self { + PIN5_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN5_A { + match self.bits { + false => PIN5_A::INPUT, + true => PIN5_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN5_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN5_A::OUTPUT + } +} +impl core::ops::Deref for PIN5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN5` writer - Pin 5"] +pub struct PIN5_W<'a> { + w: &'a mut W, +} +impl<'a> PIN5_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN5_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN5_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN5_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Pin 6\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN6_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN6_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN6` reader - Pin 6"] +pub struct PIN6_R(crate::FieldReader); +impl PIN6_R { + pub(crate) fn new(bits: bool) -> Self { + PIN6_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN6_A { + match self.bits { + false => PIN6_A::INPUT, + true => PIN6_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN6_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN6_A::OUTPUT + } +} +impl core::ops::Deref for PIN6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN6` writer - Pin 6"] +pub struct PIN6_W<'a> { + w: &'a mut W, +} +impl<'a> PIN6_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN6_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN6_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN6_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Pin 7\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN7_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN7_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN7` reader - Pin 7"] +pub struct PIN7_R(crate::FieldReader); +impl PIN7_R { + pub(crate) fn new(bits: bool) -> Self { + PIN7_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN7_A { + match self.bits { + false => PIN7_A::INPUT, + true => PIN7_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN7_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN7_A::OUTPUT + } +} +impl core::ops::Deref for PIN7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN7` writer - Pin 7"] +pub struct PIN7_W<'a> { + w: &'a mut W, +} +impl<'a> PIN7_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN7_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN7_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN7_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Pin 8\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN8_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN8_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN8` reader - Pin 8"] +pub struct PIN8_R(crate::FieldReader); +impl PIN8_R { + pub(crate) fn new(bits: bool) -> Self { + PIN8_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN8_A { + match self.bits { + false => PIN8_A::INPUT, + true => PIN8_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN8_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN8_A::OUTPUT + } +} +impl core::ops::Deref for PIN8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN8` writer - Pin 8"] +pub struct PIN8_W<'a> { + w: &'a mut W, +} +impl<'a> PIN8_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN8_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN8_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN8_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Pin 9\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN9_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN9_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN9` reader - Pin 9"] +pub struct PIN9_R(crate::FieldReader); +impl PIN9_R { + pub(crate) fn new(bits: bool) -> Self { + PIN9_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN9_A { + match self.bits { + false => PIN9_A::INPUT, + true => PIN9_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN9_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN9_A::OUTPUT + } +} +impl core::ops::Deref for PIN9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN9` writer - Pin 9"] +pub struct PIN9_W<'a> { + w: &'a mut W, +} +impl<'a> PIN9_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN9_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN9_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN9_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Pin 10\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN10_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN10_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN10` reader - Pin 10"] +pub struct PIN10_R(crate::FieldReader); +impl PIN10_R { + pub(crate) fn new(bits: bool) -> Self { + PIN10_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN10_A { + match self.bits { + false => PIN10_A::INPUT, + true => PIN10_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN10_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN10_A::OUTPUT + } +} +impl core::ops::Deref for PIN10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN10` writer - Pin 10"] +pub struct PIN10_W<'a> { + w: &'a mut W, +} +impl<'a> PIN10_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN10_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN10_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN10_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Pin 11\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN11_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN11_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN11` reader - Pin 11"] +pub struct PIN11_R(crate::FieldReader); +impl PIN11_R { + pub(crate) fn new(bits: bool) -> Self { + PIN11_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN11_A { + match self.bits { + false => PIN11_A::INPUT, + true => PIN11_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN11_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN11_A::OUTPUT + } +} +impl core::ops::Deref for PIN11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN11` writer - Pin 11"] +pub struct PIN11_W<'a> { + w: &'a mut W, +} +impl<'a> PIN11_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN11_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN11_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN11_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Pin 12\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN12_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN12_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN12` reader - Pin 12"] +pub struct PIN12_R(crate::FieldReader); +impl PIN12_R { + pub(crate) fn new(bits: bool) -> Self { + PIN12_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN12_A { + match self.bits { + false => PIN12_A::INPUT, + true => PIN12_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN12_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN12_A::OUTPUT + } +} +impl core::ops::Deref for PIN12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN12` writer - Pin 12"] +pub struct PIN12_W<'a> { + w: &'a mut W, +} +impl<'a> PIN12_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN12_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN12_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN12_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Pin 13\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN13_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN13_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN13` reader - Pin 13"] +pub struct PIN13_R(crate::FieldReader); +impl PIN13_R { + pub(crate) fn new(bits: bool) -> Self { + PIN13_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN13_A { + match self.bits { + false => PIN13_A::INPUT, + true => PIN13_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN13_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN13_A::OUTPUT + } +} +impl core::ops::Deref for PIN13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN13` writer - Pin 13"] +pub struct PIN13_W<'a> { + w: &'a mut W, +} +impl<'a> PIN13_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN13_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN13_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN13_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Pin 14\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN14_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN14_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN14` reader - Pin 14"] +pub struct PIN14_R(crate::FieldReader); +impl PIN14_R { + pub(crate) fn new(bits: bool) -> Self { + PIN14_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN14_A { + match self.bits { + false => PIN14_A::INPUT, + true => PIN14_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN14_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN14_A::OUTPUT + } +} +impl core::ops::Deref for PIN14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN14` writer - Pin 14"] +pub struct PIN14_W<'a> { + w: &'a mut W, +} +impl<'a> PIN14_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN14_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN14_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN14_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Pin 15\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN15_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN15_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN15` reader - Pin 15"] +pub struct PIN15_R(crate::FieldReader); +impl PIN15_R { + pub(crate) fn new(bits: bool) -> Self { + PIN15_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN15_A { + match self.bits { + false => PIN15_A::INPUT, + true => PIN15_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN15_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN15_A::OUTPUT + } +} +impl core::ops::Deref for PIN15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN15` writer - Pin 15"] +pub struct PIN15_W<'a> { + w: &'a mut W, +} +impl<'a> PIN15_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN15_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN15_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN15_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Pin 16\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN16_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN16_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN16` reader - Pin 16"] +pub struct PIN16_R(crate::FieldReader); +impl PIN16_R { + pub(crate) fn new(bits: bool) -> Self { + PIN16_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN16_A { + match self.bits { + false => PIN16_A::INPUT, + true => PIN16_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN16_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN16_A::OUTPUT + } +} +impl core::ops::Deref for PIN16_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN16` writer - Pin 16"] +pub struct PIN16_W<'a> { + w: &'a mut W, +} +impl<'a> PIN16_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN16_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN16_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN16_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Pin 17\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN17_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN17_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN17` reader - Pin 17"] +pub struct PIN17_R(crate::FieldReader); +impl PIN17_R { + pub(crate) fn new(bits: bool) -> Self { + PIN17_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN17_A { + match self.bits { + false => PIN17_A::INPUT, + true => PIN17_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN17_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN17_A::OUTPUT + } +} +impl core::ops::Deref for PIN17_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN17` writer - Pin 17"] +pub struct PIN17_W<'a> { + w: &'a mut W, +} +impl<'a> PIN17_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN17_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN17_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN17_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Pin 18\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN18_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN18_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN18` reader - Pin 18"] +pub struct PIN18_R(crate::FieldReader); +impl PIN18_R { + pub(crate) fn new(bits: bool) -> Self { + PIN18_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN18_A { + match self.bits { + false => PIN18_A::INPUT, + true => PIN18_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN18_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN18_A::OUTPUT + } +} +impl core::ops::Deref for PIN18_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN18` writer - Pin 18"] +pub struct PIN18_W<'a> { + w: &'a mut W, +} +impl<'a> PIN18_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN18_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN18_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN18_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Pin 19\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN19_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN19_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN19` reader - Pin 19"] +pub struct PIN19_R(crate::FieldReader); +impl PIN19_R { + pub(crate) fn new(bits: bool) -> Self { + PIN19_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN19_A { + match self.bits { + false => PIN19_A::INPUT, + true => PIN19_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN19_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN19_A::OUTPUT + } +} +impl core::ops::Deref for PIN19_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN19` writer - Pin 19"] +pub struct PIN19_W<'a> { + w: &'a mut W, +} +impl<'a> PIN19_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN19_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN19_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN19_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Pin 20\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN20_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN20_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN20` reader - Pin 20"] +pub struct PIN20_R(crate::FieldReader); +impl PIN20_R { + pub(crate) fn new(bits: bool) -> Self { + PIN20_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN20_A { + match self.bits { + false => PIN20_A::INPUT, + true => PIN20_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN20_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN20_A::OUTPUT + } +} +impl core::ops::Deref for PIN20_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN20` writer - Pin 20"] +pub struct PIN20_W<'a> { + w: &'a mut W, +} +impl<'a> PIN20_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN20_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN20_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN20_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Pin 21\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN21_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN21_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN21` reader - Pin 21"] +pub struct PIN21_R(crate::FieldReader); +impl PIN21_R { + pub(crate) fn new(bits: bool) -> Self { + PIN21_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN21_A { + match self.bits { + false => PIN21_A::INPUT, + true => PIN21_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN21_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN21_A::OUTPUT + } +} +impl core::ops::Deref for PIN21_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN21` writer - Pin 21"] +pub struct PIN21_W<'a> { + w: &'a mut W, +} +impl<'a> PIN21_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN21_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN21_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN21_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); + self.w + } +} +#[doc = "Pin 22\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN22_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN22_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN22` reader - Pin 22"] +pub struct PIN22_R(crate::FieldReader); +impl PIN22_R { + pub(crate) fn new(bits: bool) -> Self { + PIN22_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN22_A { + match self.bits { + false => PIN22_A::INPUT, + true => PIN22_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN22_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN22_A::OUTPUT + } +} +impl core::ops::Deref for PIN22_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN22` writer - Pin 22"] +pub struct PIN22_W<'a> { + w: &'a mut W, +} +impl<'a> PIN22_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN22_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN22_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN22_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); + self.w + } +} +#[doc = "Pin 23\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN23_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN23_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN23` reader - Pin 23"] +pub struct PIN23_R(crate::FieldReader); +impl PIN23_R { + pub(crate) fn new(bits: bool) -> Self { + PIN23_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN23_A { + match self.bits { + false => PIN23_A::INPUT, + true => PIN23_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN23_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN23_A::OUTPUT + } +} +impl core::ops::Deref for PIN23_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN23` writer - Pin 23"] +pub struct PIN23_W<'a> { + w: &'a mut W, +} +impl<'a> PIN23_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN23_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN23_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN23_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); + self.w + } +} +#[doc = "Pin 24\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN24_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN24_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN24` reader - Pin 24"] +pub struct PIN24_R(crate::FieldReader); +impl PIN24_R { + pub(crate) fn new(bits: bool) -> Self { + PIN24_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN24_A { + match self.bits { + false => PIN24_A::INPUT, + true => PIN24_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN24_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN24_A::OUTPUT + } +} +impl core::ops::Deref for PIN24_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN24` writer - Pin 24"] +pub struct PIN24_W<'a> { + w: &'a mut W, +} +impl<'a> PIN24_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN24_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN24_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN24_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Pin 25\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN25_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN25_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN25` reader - Pin 25"] +pub struct PIN25_R(crate::FieldReader); +impl PIN25_R { + pub(crate) fn new(bits: bool) -> Self { + PIN25_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN25_A { + match self.bits { + false => PIN25_A::INPUT, + true => PIN25_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN25_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN25_A::OUTPUT + } +} +impl core::ops::Deref for PIN25_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN25` writer - Pin 25"] +pub struct PIN25_W<'a> { + w: &'a mut W, +} +impl<'a> PIN25_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN25_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN25_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN25_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Pin 26\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN26_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN26_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN26` reader - Pin 26"] +pub struct PIN26_R(crate::FieldReader); +impl PIN26_R { + pub(crate) fn new(bits: bool) -> Self { + PIN26_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN26_A { + match self.bits { + false => PIN26_A::INPUT, + true => PIN26_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN26_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN26_A::OUTPUT + } +} +impl core::ops::Deref for PIN26_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN26` writer - Pin 26"] +pub struct PIN26_W<'a> { + w: &'a mut W, +} +impl<'a> PIN26_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN26_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN26_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN26_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Pin 27\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN27_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN27_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN27` reader - Pin 27"] +pub struct PIN27_R(crate::FieldReader); +impl PIN27_R { + pub(crate) fn new(bits: bool) -> Self { + PIN27_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN27_A { + match self.bits { + false => PIN27_A::INPUT, + true => PIN27_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN27_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN27_A::OUTPUT + } +} +impl core::ops::Deref for PIN27_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN27` writer - Pin 27"] +pub struct PIN27_W<'a> { + w: &'a mut W, +} +impl<'a> PIN27_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN27_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN27_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN27_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +#[doc = "Pin 28\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN28_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN28_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN28` reader - Pin 28"] +pub struct PIN28_R(crate::FieldReader); +impl PIN28_R { + pub(crate) fn new(bits: bool) -> Self { + PIN28_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN28_A { + match self.bits { + false => PIN28_A::INPUT, + true => PIN28_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN28_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN28_A::OUTPUT + } +} +impl core::ops::Deref for PIN28_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN28` writer - Pin 28"] +pub struct PIN28_W<'a> { + w: &'a mut W, +} +impl<'a> PIN28_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN28_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN28_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN28_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); + self.w + } +} +#[doc = "Pin 29\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN29_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN29_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN29` reader - Pin 29"] +pub struct PIN29_R(crate::FieldReader); +impl PIN29_R { + pub(crate) fn new(bits: bool) -> Self { + PIN29_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN29_A { + match self.bits { + false => PIN29_A::INPUT, + true => PIN29_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN29_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN29_A::OUTPUT + } +} +impl core::ops::Deref for PIN29_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN29` writer - Pin 29"] +pub struct PIN29_W<'a> { + w: &'a mut W, +} +impl<'a> PIN29_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN29_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN29_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN29_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); + self.w + } +} +#[doc = "Pin 30\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN30_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN30_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN30` reader - Pin 30"] +pub struct PIN30_R(crate::FieldReader); +impl PIN30_R { + pub(crate) fn new(bits: bool) -> Self { + PIN30_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN30_A { + match self.bits { + false => PIN30_A::INPUT, + true => PIN30_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN30_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN30_A::OUTPUT + } +} +impl core::ops::Deref for PIN30_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN30` writer - Pin 30"] +pub struct PIN30_W<'a> { + w: &'a mut W, +} +impl<'a> PIN30_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN30_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN30_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN30_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); + self.w + } +} +#[doc = "Pin 31\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN31_A { + #[doc = "0: Pin set as input"] + INPUT = 0, + #[doc = "1: Pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN31_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN31` reader - Pin 31"] +pub struct PIN31_R(crate::FieldReader); +impl PIN31_R { + pub(crate) fn new(bits: bool) -> Self { + PIN31_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN31_A { + match self.bits { + false => PIN31_A::INPUT, + true => PIN31_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN31_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN31_A::OUTPUT + } +} +impl core::ops::Deref for PIN31_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN31` writer - Pin 31"] +pub struct PIN31_W<'a> { + w: &'a mut W, +} +impl<'a> PIN31_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN31_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin set as input"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(PIN31_A::INPUT) + } + #[doc = "Pin set as output"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(PIN31_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bit 0 - Pin 0"] + #[inline(always)] + pub fn pin0(&self) -> PIN0_R { + PIN0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Pin 1"] + #[inline(always)] + pub fn pin1(&self) -> PIN1_R { + PIN1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Pin 2"] + #[inline(always)] + pub fn pin2(&self) -> PIN2_R { + PIN2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Pin 3"] + #[inline(always)] + pub fn pin3(&self) -> PIN3_R { + PIN3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Pin 4"] + #[inline(always)] + pub fn pin4(&self) -> PIN4_R { + PIN4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Pin 5"] + #[inline(always)] + pub fn pin5(&self) -> PIN5_R { + PIN5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Pin 6"] + #[inline(always)] + pub fn pin6(&self) -> PIN6_R { + PIN6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Pin 7"] + #[inline(always)] + pub fn pin7(&self) -> PIN7_R { + PIN7_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Pin 8"] + #[inline(always)] + pub fn pin8(&self) -> PIN8_R { + PIN8_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Pin 9"] + #[inline(always)] + pub fn pin9(&self) -> PIN9_R { + PIN9_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Pin 10"] + #[inline(always)] + pub fn pin10(&self) -> PIN10_R { + PIN10_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Pin 11"] + #[inline(always)] + pub fn pin11(&self) -> PIN11_R { + PIN11_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Pin 12"] + #[inline(always)] + pub fn pin12(&self) -> PIN12_R { + PIN12_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Pin 13"] + #[inline(always)] + pub fn pin13(&self) -> PIN13_R { + PIN13_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Pin 14"] + #[inline(always)] + pub fn pin14(&self) -> PIN14_R { + PIN14_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Pin 15"] + #[inline(always)] + pub fn pin15(&self) -> PIN15_R { + PIN15_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Pin 16"] + #[inline(always)] + pub fn pin16(&self) -> PIN16_R { + PIN16_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Pin 17"] + #[inline(always)] + pub fn pin17(&self) -> PIN17_R { + PIN17_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Pin 18"] + #[inline(always)] + pub fn pin18(&self) -> PIN18_R { + PIN18_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Pin 19"] + #[inline(always)] + pub fn pin19(&self) -> PIN19_R { + PIN19_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Pin 20"] + #[inline(always)] + pub fn pin20(&self) -> PIN20_R { + PIN20_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 21 - Pin 21"] + #[inline(always)] + pub fn pin21(&self) -> PIN21_R { + PIN21_R::new(((self.bits >> 21) & 0x01) != 0) + } + #[doc = "Bit 22 - Pin 22"] + #[inline(always)] + pub fn pin22(&self) -> PIN22_R { + PIN22_R::new(((self.bits >> 22) & 0x01) != 0) + } + #[doc = "Bit 23 - Pin 23"] + #[inline(always)] + pub fn pin23(&self) -> PIN23_R { + PIN23_R::new(((self.bits >> 23) & 0x01) != 0) + } + #[doc = "Bit 24 - Pin 24"] + #[inline(always)] + pub fn pin24(&self) -> PIN24_R { + PIN24_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Pin 25"] + #[inline(always)] + pub fn pin25(&self) -> PIN25_R { + PIN25_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Pin 26"] + #[inline(always)] + pub fn pin26(&self) -> PIN26_R { + PIN26_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Pin 27"] + #[inline(always)] + pub fn pin27(&self) -> PIN27_R { + PIN27_R::new(((self.bits >> 27) & 0x01) != 0) + } + #[doc = "Bit 28 - Pin 28"] + #[inline(always)] + pub fn pin28(&self) -> PIN28_R { + PIN28_R::new(((self.bits >> 28) & 0x01) != 0) + } + #[doc = "Bit 29 - Pin 29"] + #[inline(always)] + pub fn pin29(&self) -> PIN29_R { + PIN29_R::new(((self.bits >> 29) & 0x01) != 0) + } + #[doc = "Bit 30 - Pin 30"] + #[inline(always)] + pub fn pin30(&self) -> PIN30_R { + PIN30_R::new(((self.bits >> 30) & 0x01) != 0) + } + #[doc = "Bit 31 - Pin 31"] + #[inline(always)] + pub fn pin31(&self) -> PIN31_R { + PIN31_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Pin 0"] + #[inline(always)] + pub fn pin0(&mut self) -> PIN0_W { + PIN0_W { w: self } + } + #[doc = "Bit 1 - Pin 1"] + #[inline(always)] + pub fn pin1(&mut self) -> PIN1_W { + PIN1_W { w: self } + } + #[doc = "Bit 2 - Pin 2"] + #[inline(always)] + pub fn pin2(&mut self) -> PIN2_W { + PIN2_W { w: self } + } + #[doc = "Bit 3 - Pin 3"] + #[inline(always)] + pub fn pin3(&mut self) -> PIN3_W { + PIN3_W { w: self } + } + #[doc = "Bit 4 - Pin 4"] + #[inline(always)] + pub fn pin4(&mut self) -> PIN4_W { + PIN4_W { w: self } + } + #[doc = "Bit 5 - Pin 5"] + #[inline(always)] + pub fn pin5(&mut self) -> PIN5_W { + PIN5_W { w: self } + } + #[doc = "Bit 6 - Pin 6"] + #[inline(always)] + pub fn pin6(&mut self) -> PIN6_W { + PIN6_W { w: self } + } + #[doc = "Bit 7 - Pin 7"] + #[inline(always)] + pub fn pin7(&mut self) -> PIN7_W { + PIN7_W { w: self } + } + #[doc = "Bit 8 - Pin 8"] + #[inline(always)] + pub fn pin8(&mut self) -> PIN8_W { + PIN8_W { w: self } + } + #[doc = "Bit 9 - Pin 9"] + #[inline(always)] + pub fn pin9(&mut self) -> PIN9_W { + PIN9_W { w: self } + } + #[doc = "Bit 10 - Pin 10"] + #[inline(always)] + pub fn pin10(&mut self) -> PIN10_W { + PIN10_W { w: self } + } + #[doc = "Bit 11 - Pin 11"] + #[inline(always)] + pub fn pin11(&mut self) -> PIN11_W { + PIN11_W { w: self } + } + #[doc = "Bit 12 - Pin 12"] + #[inline(always)] + pub fn pin12(&mut self) -> PIN12_W { + PIN12_W { w: self } + } + #[doc = "Bit 13 - Pin 13"] + #[inline(always)] + pub fn pin13(&mut self) -> PIN13_W { + PIN13_W { w: self } + } + #[doc = "Bit 14 - Pin 14"] + #[inline(always)] + pub fn pin14(&mut self) -> PIN14_W { + PIN14_W { w: self } + } + #[doc = "Bit 15 - Pin 15"] + #[inline(always)] + pub fn pin15(&mut self) -> PIN15_W { + PIN15_W { w: self } + } + #[doc = "Bit 16 - Pin 16"] + #[inline(always)] + pub fn pin16(&mut self) -> PIN16_W { + PIN16_W { w: self } + } + #[doc = "Bit 17 - Pin 17"] + #[inline(always)] + pub fn pin17(&mut self) -> PIN17_W { + PIN17_W { w: self } + } + #[doc = "Bit 18 - Pin 18"] + #[inline(always)] + pub fn pin18(&mut self) -> PIN18_W { + PIN18_W { w: self } + } + #[doc = "Bit 19 - Pin 19"] + #[inline(always)] + pub fn pin19(&mut self) -> PIN19_W { + PIN19_W { w: self } + } + #[doc = "Bit 20 - Pin 20"] + #[inline(always)] + pub fn pin20(&mut self) -> PIN20_W { + PIN20_W { w: self } + } + #[doc = "Bit 21 - Pin 21"] + #[inline(always)] + pub fn pin21(&mut self) -> PIN21_W { + PIN21_W { w: self } + } + #[doc = "Bit 22 - Pin 22"] + #[inline(always)] + pub fn pin22(&mut self) -> PIN22_W { + PIN22_W { w: self } + } + #[doc = "Bit 23 - Pin 23"] + #[inline(always)] + pub fn pin23(&mut self) -> PIN23_W { + PIN23_W { w: self } + } + #[doc = "Bit 24 - Pin 24"] + #[inline(always)] + pub fn pin24(&mut self) -> PIN24_W { + PIN24_W { w: self } + } + #[doc = "Bit 25 - Pin 25"] + #[inline(always)] + pub fn pin25(&mut self) -> PIN25_W { + PIN25_W { w: self } + } + #[doc = "Bit 26 - Pin 26"] + #[inline(always)] + pub fn pin26(&mut self) -> PIN26_W { + PIN26_W { w: self } + } + #[doc = "Bit 27 - Pin 27"] + #[inline(always)] + pub fn pin27(&mut self) -> PIN27_W { + PIN27_W { w: self } + } + #[doc = "Bit 28 - Pin 28"] + #[inline(always)] + pub fn pin28(&mut self) -> PIN28_W { + PIN28_W { w: self } + } + #[doc = "Bit 29 - Pin 29"] + #[inline(always)] + pub fn pin29(&mut self) -> PIN29_W { + PIN29_W { w: self } + } + #[doc = "Bit 30 - Pin 30"] + #[inline(always)] + pub fn pin30(&mut self) -> PIN30_W { + PIN30_W { w: self } + } + #[doc = "Bit 31 - Pin 31"] + #[inline(always)] + pub fn pin31(&mut self) -> PIN31_W { + PIN31_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Direction of GPIO pins\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dir](index.html) module"] +pub struct DIR_SPEC; +impl crate::RegisterSpec for DIR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dir::R](R) reader structure"] +impl crate::Readable for DIR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dir::W](W) writer structure"] +impl crate::Writable for DIR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DIR to value 0"] +impl crate::Resettable for DIR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/p0/dirclr.rs b/src/p0/dirclr.rs new file mode 100644 index 0000000..30e9da3 --- /dev/null +++ b/src/p0/dirclr.rs @@ -0,0 +1,3266 @@ +#[doc = "Register `DIRCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DIRCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Set as input pin 0\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN0_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN0` reader - Set as input pin 0"] +pub struct PIN0_R(crate::FieldReader); +impl PIN0_R { + pub(crate) fn new(bits: bool) -> Self { + PIN0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN0_A { + match self.bits { + false => PIN0_A::INPUT, + true => PIN0_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN0_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN0_A::OUTPUT + } +} +impl core::ops::Deref for PIN0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 0\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN0_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN0_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN0` writer - Set as input pin 0"] +pub struct PIN0_W<'a> { + w: &'a mut W, +} +impl<'a> PIN0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN0_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN0_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Set as input pin 1\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN1_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN1` reader - Set as input pin 1"] +pub struct PIN1_R(crate::FieldReader); +impl PIN1_R { + pub(crate) fn new(bits: bool) -> Self { + PIN1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN1_A { + match self.bits { + false => PIN1_A::INPUT, + true => PIN1_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN1_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN1_A::OUTPUT + } +} +impl core::ops::Deref for PIN1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 1\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN1_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN1_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN1` writer - Set as input pin 1"] +pub struct PIN1_W<'a> { + w: &'a mut W, +} +impl<'a> PIN1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN1_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN1_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Set as input pin 2\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN2_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN2` reader - Set as input pin 2"] +pub struct PIN2_R(crate::FieldReader); +impl PIN2_R { + pub(crate) fn new(bits: bool) -> Self { + PIN2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN2_A { + match self.bits { + false => PIN2_A::INPUT, + true => PIN2_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN2_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN2_A::OUTPUT + } +} +impl core::ops::Deref for PIN2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 2\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN2_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN2_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN2` writer - Set as input pin 2"] +pub struct PIN2_W<'a> { + w: &'a mut W, +} +impl<'a> PIN2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN2_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN2_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Set as input pin 3\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN3_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN3` reader - Set as input pin 3"] +pub struct PIN3_R(crate::FieldReader); +impl PIN3_R { + pub(crate) fn new(bits: bool) -> Self { + PIN3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN3_A { + match self.bits { + false => PIN3_A::INPUT, + true => PIN3_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN3_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN3_A::OUTPUT + } +} +impl core::ops::Deref for PIN3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 3\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN3_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN3_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN3` writer - Set as input pin 3"] +pub struct PIN3_W<'a> { + w: &'a mut W, +} +impl<'a> PIN3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN3_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN3_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Set as input pin 4\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN4_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN4_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN4` reader - Set as input pin 4"] +pub struct PIN4_R(crate::FieldReader); +impl PIN4_R { + pub(crate) fn new(bits: bool) -> Self { + PIN4_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN4_A { + match self.bits { + false => PIN4_A::INPUT, + true => PIN4_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN4_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN4_A::OUTPUT + } +} +impl core::ops::Deref for PIN4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 4\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN4_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN4_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN4` writer - Set as input pin 4"] +pub struct PIN4_W<'a> { + w: &'a mut W, +} +impl<'a> PIN4_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN4_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN4_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Set as input pin 5\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN5_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN5_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN5` reader - Set as input pin 5"] +pub struct PIN5_R(crate::FieldReader); +impl PIN5_R { + pub(crate) fn new(bits: bool) -> Self { + PIN5_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN5_A { + match self.bits { + false => PIN5_A::INPUT, + true => PIN5_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN5_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN5_A::OUTPUT + } +} +impl core::ops::Deref for PIN5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 5\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN5_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN5_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN5` writer - Set as input pin 5"] +pub struct PIN5_W<'a> { + w: &'a mut W, +} +impl<'a> PIN5_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN5_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN5_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Set as input pin 6\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN6_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN6_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN6` reader - Set as input pin 6"] +pub struct PIN6_R(crate::FieldReader); +impl PIN6_R { + pub(crate) fn new(bits: bool) -> Self { + PIN6_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN6_A { + match self.bits { + false => PIN6_A::INPUT, + true => PIN6_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN6_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN6_A::OUTPUT + } +} +impl core::ops::Deref for PIN6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 6\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN6_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN6_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN6` writer - Set as input pin 6"] +pub struct PIN6_W<'a> { + w: &'a mut W, +} +impl<'a> PIN6_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN6_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN6_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Set as input pin 7\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN7_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN7_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN7` reader - Set as input pin 7"] +pub struct PIN7_R(crate::FieldReader); +impl PIN7_R { + pub(crate) fn new(bits: bool) -> Self { + PIN7_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN7_A { + match self.bits { + false => PIN7_A::INPUT, + true => PIN7_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN7_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN7_A::OUTPUT + } +} +impl core::ops::Deref for PIN7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 7\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN7_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN7_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN7` writer - Set as input pin 7"] +pub struct PIN7_W<'a> { + w: &'a mut W, +} +impl<'a> PIN7_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN7_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN7_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Set as input pin 8\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN8_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN8_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN8` reader - Set as input pin 8"] +pub struct PIN8_R(crate::FieldReader); +impl PIN8_R { + pub(crate) fn new(bits: bool) -> Self { + PIN8_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN8_A { + match self.bits { + false => PIN8_A::INPUT, + true => PIN8_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN8_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN8_A::OUTPUT + } +} +impl core::ops::Deref for PIN8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 8\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN8_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN8_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN8` writer - Set as input pin 8"] +pub struct PIN8_W<'a> { + w: &'a mut W, +} +impl<'a> PIN8_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN8_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN8_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Set as input pin 9\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN9_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN9_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN9` reader - Set as input pin 9"] +pub struct PIN9_R(crate::FieldReader); +impl PIN9_R { + pub(crate) fn new(bits: bool) -> Self { + PIN9_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN9_A { + match self.bits { + false => PIN9_A::INPUT, + true => PIN9_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN9_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN9_A::OUTPUT + } +} +impl core::ops::Deref for PIN9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 9\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN9_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN9_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN9` writer - Set as input pin 9"] +pub struct PIN9_W<'a> { + w: &'a mut W, +} +impl<'a> PIN9_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN9_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN9_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Set as input pin 10\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN10_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN10_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN10` reader - Set as input pin 10"] +pub struct PIN10_R(crate::FieldReader); +impl PIN10_R { + pub(crate) fn new(bits: bool) -> Self { + PIN10_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN10_A { + match self.bits { + false => PIN10_A::INPUT, + true => PIN10_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN10_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN10_A::OUTPUT + } +} +impl core::ops::Deref for PIN10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 10\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN10_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN10_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN10` writer - Set as input pin 10"] +pub struct PIN10_W<'a> { + w: &'a mut W, +} +impl<'a> PIN10_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN10_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN10_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Set as input pin 11\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN11_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN11_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN11` reader - Set as input pin 11"] +pub struct PIN11_R(crate::FieldReader); +impl PIN11_R { + pub(crate) fn new(bits: bool) -> Self { + PIN11_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN11_A { + match self.bits { + false => PIN11_A::INPUT, + true => PIN11_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN11_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN11_A::OUTPUT + } +} +impl core::ops::Deref for PIN11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 11\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN11_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN11_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN11` writer - Set as input pin 11"] +pub struct PIN11_W<'a> { + w: &'a mut W, +} +impl<'a> PIN11_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN11_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN11_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Set as input pin 12\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN12_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN12_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN12` reader - Set as input pin 12"] +pub struct PIN12_R(crate::FieldReader); +impl PIN12_R { + pub(crate) fn new(bits: bool) -> Self { + PIN12_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN12_A { + match self.bits { + false => PIN12_A::INPUT, + true => PIN12_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN12_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN12_A::OUTPUT + } +} +impl core::ops::Deref for PIN12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 12\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN12_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN12_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN12` writer - Set as input pin 12"] +pub struct PIN12_W<'a> { + w: &'a mut W, +} +impl<'a> PIN12_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN12_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN12_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Set as input pin 13\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN13_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN13_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN13` reader - Set as input pin 13"] +pub struct PIN13_R(crate::FieldReader); +impl PIN13_R { + pub(crate) fn new(bits: bool) -> Self { + PIN13_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN13_A { + match self.bits { + false => PIN13_A::INPUT, + true => PIN13_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN13_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN13_A::OUTPUT + } +} +impl core::ops::Deref for PIN13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 13\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN13_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN13_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN13` writer - Set as input pin 13"] +pub struct PIN13_W<'a> { + w: &'a mut W, +} +impl<'a> PIN13_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN13_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN13_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Set as input pin 14\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN14_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN14_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN14` reader - Set as input pin 14"] +pub struct PIN14_R(crate::FieldReader); +impl PIN14_R { + pub(crate) fn new(bits: bool) -> Self { + PIN14_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN14_A { + match self.bits { + false => PIN14_A::INPUT, + true => PIN14_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN14_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN14_A::OUTPUT + } +} +impl core::ops::Deref for PIN14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 14\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN14_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN14_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN14` writer - Set as input pin 14"] +pub struct PIN14_W<'a> { + w: &'a mut W, +} +impl<'a> PIN14_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN14_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN14_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Set as input pin 15\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN15_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN15_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN15` reader - Set as input pin 15"] +pub struct PIN15_R(crate::FieldReader); +impl PIN15_R { + pub(crate) fn new(bits: bool) -> Self { + PIN15_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN15_A { + match self.bits { + false => PIN15_A::INPUT, + true => PIN15_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN15_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN15_A::OUTPUT + } +} +impl core::ops::Deref for PIN15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 15\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN15_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN15_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN15` writer - Set as input pin 15"] +pub struct PIN15_W<'a> { + w: &'a mut W, +} +impl<'a> PIN15_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN15_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN15_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Set as input pin 16\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN16_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN16_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN16` reader - Set as input pin 16"] +pub struct PIN16_R(crate::FieldReader); +impl PIN16_R { + pub(crate) fn new(bits: bool) -> Self { + PIN16_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN16_A { + match self.bits { + false => PIN16_A::INPUT, + true => PIN16_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN16_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN16_A::OUTPUT + } +} +impl core::ops::Deref for PIN16_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 16\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN16_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN16_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN16` writer - Set as input pin 16"] +pub struct PIN16_W<'a> { + w: &'a mut W, +} +impl<'a> PIN16_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN16_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN16_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Set as input pin 17\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN17_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN17_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN17` reader - Set as input pin 17"] +pub struct PIN17_R(crate::FieldReader); +impl PIN17_R { + pub(crate) fn new(bits: bool) -> Self { + PIN17_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN17_A { + match self.bits { + false => PIN17_A::INPUT, + true => PIN17_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN17_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN17_A::OUTPUT + } +} +impl core::ops::Deref for PIN17_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 17\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN17_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN17_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN17` writer - Set as input pin 17"] +pub struct PIN17_W<'a> { + w: &'a mut W, +} +impl<'a> PIN17_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN17_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN17_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Set as input pin 18\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN18_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN18_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN18` reader - Set as input pin 18"] +pub struct PIN18_R(crate::FieldReader); +impl PIN18_R { + pub(crate) fn new(bits: bool) -> Self { + PIN18_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN18_A { + match self.bits { + false => PIN18_A::INPUT, + true => PIN18_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN18_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN18_A::OUTPUT + } +} +impl core::ops::Deref for PIN18_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 18\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN18_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN18_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN18` writer - Set as input pin 18"] +pub struct PIN18_W<'a> { + w: &'a mut W, +} +impl<'a> PIN18_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN18_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN18_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Set as input pin 19\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN19_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN19_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN19` reader - Set as input pin 19"] +pub struct PIN19_R(crate::FieldReader); +impl PIN19_R { + pub(crate) fn new(bits: bool) -> Self { + PIN19_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN19_A { + match self.bits { + false => PIN19_A::INPUT, + true => PIN19_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN19_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN19_A::OUTPUT + } +} +impl core::ops::Deref for PIN19_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 19\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN19_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN19_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN19` writer - Set as input pin 19"] +pub struct PIN19_W<'a> { + w: &'a mut W, +} +impl<'a> PIN19_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN19_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN19_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Set as input pin 20\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN20_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN20_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN20` reader - Set as input pin 20"] +pub struct PIN20_R(crate::FieldReader); +impl PIN20_R { + pub(crate) fn new(bits: bool) -> Self { + PIN20_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN20_A { + match self.bits { + false => PIN20_A::INPUT, + true => PIN20_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN20_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN20_A::OUTPUT + } +} +impl core::ops::Deref for PIN20_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 20\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN20_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN20_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN20` writer - Set as input pin 20"] +pub struct PIN20_W<'a> { + w: &'a mut W, +} +impl<'a> PIN20_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN20_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN20_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Set as input pin 21\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN21_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN21_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN21` reader - Set as input pin 21"] +pub struct PIN21_R(crate::FieldReader); +impl PIN21_R { + pub(crate) fn new(bits: bool) -> Self { + PIN21_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN21_A { + match self.bits { + false => PIN21_A::INPUT, + true => PIN21_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN21_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN21_A::OUTPUT + } +} +impl core::ops::Deref for PIN21_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 21\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN21_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN21_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN21` writer - Set as input pin 21"] +pub struct PIN21_W<'a> { + w: &'a mut W, +} +impl<'a> PIN21_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN21_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN21_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); + self.w + } +} +#[doc = "Set as input pin 22\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN22_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN22_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN22` reader - Set as input pin 22"] +pub struct PIN22_R(crate::FieldReader); +impl PIN22_R { + pub(crate) fn new(bits: bool) -> Self { + PIN22_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN22_A { + match self.bits { + false => PIN22_A::INPUT, + true => PIN22_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN22_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN22_A::OUTPUT + } +} +impl core::ops::Deref for PIN22_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 22\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN22_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN22_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN22` writer - Set as input pin 22"] +pub struct PIN22_W<'a> { + w: &'a mut W, +} +impl<'a> PIN22_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN22_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN22_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); + self.w + } +} +#[doc = "Set as input pin 23\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN23_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN23_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN23` reader - Set as input pin 23"] +pub struct PIN23_R(crate::FieldReader); +impl PIN23_R { + pub(crate) fn new(bits: bool) -> Self { + PIN23_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN23_A { + match self.bits { + false => PIN23_A::INPUT, + true => PIN23_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN23_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN23_A::OUTPUT + } +} +impl core::ops::Deref for PIN23_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 23\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN23_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN23_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN23` writer - Set as input pin 23"] +pub struct PIN23_W<'a> { + w: &'a mut W, +} +impl<'a> PIN23_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN23_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN23_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); + self.w + } +} +#[doc = "Set as input pin 24\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN24_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN24_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN24` reader - Set as input pin 24"] +pub struct PIN24_R(crate::FieldReader); +impl PIN24_R { + pub(crate) fn new(bits: bool) -> Self { + PIN24_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN24_A { + match self.bits { + false => PIN24_A::INPUT, + true => PIN24_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN24_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN24_A::OUTPUT + } +} +impl core::ops::Deref for PIN24_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 24\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN24_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN24_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN24` writer - Set as input pin 24"] +pub struct PIN24_W<'a> { + w: &'a mut W, +} +impl<'a> PIN24_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN24_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN24_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Set as input pin 25\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN25_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN25_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN25` reader - Set as input pin 25"] +pub struct PIN25_R(crate::FieldReader); +impl PIN25_R { + pub(crate) fn new(bits: bool) -> Self { + PIN25_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN25_A { + match self.bits { + false => PIN25_A::INPUT, + true => PIN25_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN25_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN25_A::OUTPUT + } +} +impl core::ops::Deref for PIN25_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 25\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN25_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN25_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN25` writer - Set as input pin 25"] +pub struct PIN25_W<'a> { + w: &'a mut W, +} +impl<'a> PIN25_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN25_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN25_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Set as input pin 26\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN26_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN26_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN26` reader - Set as input pin 26"] +pub struct PIN26_R(crate::FieldReader); +impl PIN26_R { + pub(crate) fn new(bits: bool) -> Self { + PIN26_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN26_A { + match self.bits { + false => PIN26_A::INPUT, + true => PIN26_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN26_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN26_A::OUTPUT + } +} +impl core::ops::Deref for PIN26_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 26\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN26_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN26_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN26` writer - Set as input pin 26"] +pub struct PIN26_W<'a> { + w: &'a mut W, +} +impl<'a> PIN26_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN26_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN26_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Set as input pin 27\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN27_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN27_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN27` reader - Set as input pin 27"] +pub struct PIN27_R(crate::FieldReader); +impl PIN27_R { + pub(crate) fn new(bits: bool) -> Self { + PIN27_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN27_A { + match self.bits { + false => PIN27_A::INPUT, + true => PIN27_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN27_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN27_A::OUTPUT + } +} +impl core::ops::Deref for PIN27_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 27\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN27_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN27_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN27` writer - Set as input pin 27"] +pub struct PIN27_W<'a> { + w: &'a mut W, +} +impl<'a> PIN27_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN27_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN27_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +#[doc = "Set as input pin 28\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN28_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN28_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN28` reader - Set as input pin 28"] +pub struct PIN28_R(crate::FieldReader); +impl PIN28_R { + pub(crate) fn new(bits: bool) -> Self { + PIN28_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN28_A { + match self.bits { + false => PIN28_A::INPUT, + true => PIN28_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN28_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN28_A::OUTPUT + } +} +impl core::ops::Deref for PIN28_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 28\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN28_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN28_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN28` writer - Set as input pin 28"] +pub struct PIN28_W<'a> { + w: &'a mut W, +} +impl<'a> PIN28_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN28_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN28_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); + self.w + } +} +#[doc = "Set as input pin 29\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN29_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN29_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN29` reader - Set as input pin 29"] +pub struct PIN29_R(crate::FieldReader); +impl PIN29_R { + pub(crate) fn new(bits: bool) -> Self { + PIN29_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN29_A { + match self.bits { + false => PIN29_A::INPUT, + true => PIN29_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN29_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN29_A::OUTPUT + } +} +impl core::ops::Deref for PIN29_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 29\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN29_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN29_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN29` writer - Set as input pin 29"] +pub struct PIN29_W<'a> { + w: &'a mut W, +} +impl<'a> PIN29_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN29_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN29_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); + self.w + } +} +#[doc = "Set as input pin 30\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN30_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN30_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN30` reader - Set as input pin 30"] +pub struct PIN30_R(crate::FieldReader); +impl PIN30_R { + pub(crate) fn new(bits: bool) -> Self { + PIN30_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN30_A { + match self.bits { + false => PIN30_A::INPUT, + true => PIN30_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN30_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN30_A::OUTPUT + } +} +impl core::ops::Deref for PIN30_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 30\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN30_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN30_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN30` writer - Set as input pin 30"] +pub struct PIN30_W<'a> { + w: &'a mut W, +} +impl<'a> PIN30_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN30_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN30_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); + self.w + } +} +#[doc = "Set as input pin 31\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN31_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN31_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN31` reader - Set as input pin 31"] +pub struct PIN31_R(crate::FieldReader); +impl PIN31_R { + pub(crate) fn new(bits: bool) -> Self { + PIN31_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN31_A { + match self.bits { + false => PIN31_A::INPUT, + true => PIN31_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN31_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN31_A::OUTPUT + } +} +impl core::ops::Deref for PIN31_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as input pin 31\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN31_AW { + #[doc = "1: Write: writing a '1' sets pin to input; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN31_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN31` writer - Set as input pin 31"] +pub struct PIN31_W<'a> { + w: &'a mut W, +} +impl<'a> PIN31_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN31_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to input; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN31_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bit 0 - Set as input pin 0"] + #[inline(always)] + pub fn pin0(&self) -> PIN0_R { + PIN0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Set as input pin 1"] + #[inline(always)] + pub fn pin1(&self) -> PIN1_R { + PIN1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Set as input pin 2"] + #[inline(always)] + pub fn pin2(&self) -> PIN2_R { + PIN2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Set as input pin 3"] + #[inline(always)] + pub fn pin3(&self) -> PIN3_R { + PIN3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Set as input pin 4"] + #[inline(always)] + pub fn pin4(&self) -> PIN4_R { + PIN4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Set as input pin 5"] + #[inline(always)] + pub fn pin5(&self) -> PIN5_R { + PIN5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Set as input pin 6"] + #[inline(always)] + pub fn pin6(&self) -> PIN6_R { + PIN6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Set as input pin 7"] + #[inline(always)] + pub fn pin7(&self) -> PIN7_R { + PIN7_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Set as input pin 8"] + #[inline(always)] + pub fn pin8(&self) -> PIN8_R { + PIN8_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Set as input pin 9"] + #[inline(always)] + pub fn pin9(&self) -> PIN9_R { + PIN9_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Set as input pin 10"] + #[inline(always)] + pub fn pin10(&self) -> PIN10_R { + PIN10_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Set as input pin 11"] + #[inline(always)] + pub fn pin11(&self) -> PIN11_R { + PIN11_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Set as input pin 12"] + #[inline(always)] + pub fn pin12(&self) -> PIN12_R { + PIN12_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Set as input pin 13"] + #[inline(always)] + pub fn pin13(&self) -> PIN13_R { + PIN13_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Set as input pin 14"] + #[inline(always)] + pub fn pin14(&self) -> PIN14_R { + PIN14_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Set as input pin 15"] + #[inline(always)] + pub fn pin15(&self) -> PIN15_R { + PIN15_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Set as input pin 16"] + #[inline(always)] + pub fn pin16(&self) -> PIN16_R { + PIN16_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Set as input pin 17"] + #[inline(always)] + pub fn pin17(&self) -> PIN17_R { + PIN17_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Set as input pin 18"] + #[inline(always)] + pub fn pin18(&self) -> PIN18_R { + PIN18_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Set as input pin 19"] + #[inline(always)] + pub fn pin19(&self) -> PIN19_R { + PIN19_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Set as input pin 20"] + #[inline(always)] + pub fn pin20(&self) -> PIN20_R { + PIN20_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 21 - Set as input pin 21"] + #[inline(always)] + pub fn pin21(&self) -> PIN21_R { + PIN21_R::new(((self.bits >> 21) & 0x01) != 0) + } + #[doc = "Bit 22 - Set as input pin 22"] + #[inline(always)] + pub fn pin22(&self) -> PIN22_R { + PIN22_R::new(((self.bits >> 22) & 0x01) != 0) + } + #[doc = "Bit 23 - Set as input pin 23"] + #[inline(always)] + pub fn pin23(&self) -> PIN23_R { + PIN23_R::new(((self.bits >> 23) & 0x01) != 0) + } + #[doc = "Bit 24 - Set as input pin 24"] + #[inline(always)] + pub fn pin24(&self) -> PIN24_R { + PIN24_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Set as input pin 25"] + #[inline(always)] + pub fn pin25(&self) -> PIN25_R { + PIN25_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Set as input pin 26"] + #[inline(always)] + pub fn pin26(&self) -> PIN26_R { + PIN26_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Set as input pin 27"] + #[inline(always)] + pub fn pin27(&self) -> PIN27_R { + PIN27_R::new(((self.bits >> 27) & 0x01) != 0) + } + #[doc = "Bit 28 - Set as input pin 28"] + #[inline(always)] + pub fn pin28(&self) -> PIN28_R { + PIN28_R::new(((self.bits >> 28) & 0x01) != 0) + } + #[doc = "Bit 29 - Set as input pin 29"] + #[inline(always)] + pub fn pin29(&self) -> PIN29_R { + PIN29_R::new(((self.bits >> 29) & 0x01) != 0) + } + #[doc = "Bit 30 - Set as input pin 30"] + #[inline(always)] + pub fn pin30(&self) -> PIN30_R { + PIN30_R::new(((self.bits >> 30) & 0x01) != 0) + } + #[doc = "Bit 31 - Set as input pin 31"] + #[inline(always)] + pub fn pin31(&self) -> PIN31_R { + PIN31_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Set as input pin 0"] + #[inline(always)] + pub fn pin0(&mut self) -> PIN0_W { + PIN0_W { w: self } + } + #[doc = "Bit 1 - Set as input pin 1"] + #[inline(always)] + pub fn pin1(&mut self) -> PIN1_W { + PIN1_W { w: self } + } + #[doc = "Bit 2 - Set as input pin 2"] + #[inline(always)] + pub fn pin2(&mut self) -> PIN2_W { + PIN2_W { w: self } + } + #[doc = "Bit 3 - Set as input pin 3"] + #[inline(always)] + pub fn pin3(&mut self) -> PIN3_W { + PIN3_W { w: self } + } + #[doc = "Bit 4 - Set as input pin 4"] + #[inline(always)] + pub fn pin4(&mut self) -> PIN4_W { + PIN4_W { w: self } + } + #[doc = "Bit 5 - Set as input pin 5"] + #[inline(always)] + pub fn pin5(&mut self) -> PIN5_W { + PIN5_W { w: self } + } + #[doc = "Bit 6 - Set as input pin 6"] + #[inline(always)] + pub fn pin6(&mut self) -> PIN6_W { + PIN6_W { w: self } + } + #[doc = "Bit 7 - Set as input pin 7"] + #[inline(always)] + pub fn pin7(&mut self) -> PIN7_W { + PIN7_W { w: self } + } + #[doc = "Bit 8 - Set as input pin 8"] + #[inline(always)] + pub fn pin8(&mut self) -> PIN8_W { + PIN8_W { w: self } + } + #[doc = "Bit 9 - Set as input pin 9"] + #[inline(always)] + pub fn pin9(&mut self) -> PIN9_W { + PIN9_W { w: self } + } + #[doc = "Bit 10 - Set as input pin 10"] + #[inline(always)] + pub fn pin10(&mut self) -> PIN10_W { + PIN10_W { w: self } + } + #[doc = "Bit 11 - Set as input pin 11"] + #[inline(always)] + pub fn pin11(&mut self) -> PIN11_W { + PIN11_W { w: self } + } + #[doc = "Bit 12 - Set as input pin 12"] + #[inline(always)] + pub fn pin12(&mut self) -> PIN12_W { + PIN12_W { w: self } + } + #[doc = "Bit 13 - Set as input pin 13"] + #[inline(always)] + pub fn pin13(&mut self) -> PIN13_W { + PIN13_W { w: self } + } + #[doc = "Bit 14 - Set as input pin 14"] + #[inline(always)] + pub fn pin14(&mut self) -> PIN14_W { + PIN14_W { w: self } + } + #[doc = "Bit 15 - Set as input pin 15"] + #[inline(always)] + pub fn pin15(&mut self) -> PIN15_W { + PIN15_W { w: self } + } + #[doc = "Bit 16 - Set as input pin 16"] + #[inline(always)] + pub fn pin16(&mut self) -> PIN16_W { + PIN16_W { w: self } + } + #[doc = "Bit 17 - Set as input pin 17"] + #[inline(always)] + pub fn pin17(&mut self) -> PIN17_W { + PIN17_W { w: self } + } + #[doc = "Bit 18 - Set as input pin 18"] + #[inline(always)] + pub fn pin18(&mut self) -> PIN18_W { + PIN18_W { w: self } + } + #[doc = "Bit 19 - Set as input pin 19"] + #[inline(always)] + pub fn pin19(&mut self) -> PIN19_W { + PIN19_W { w: self } + } + #[doc = "Bit 20 - Set as input pin 20"] + #[inline(always)] + pub fn pin20(&mut self) -> PIN20_W { + PIN20_W { w: self } + } + #[doc = "Bit 21 - Set as input pin 21"] + #[inline(always)] + pub fn pin21(&mut self) -> PIN21_W { + PIN21_W { w: self } + } + #[doc = "Bit 22 - Set as input pin 22"] + #[inline(always)] + pub fn pin22(&mut self) -> PIN22_W { + PIN22_W { w: self } + } + #[doc = "Bit 23 - Set as input pin 23"] + #[inline(always)] + pub fn pin23(&mut self) -> PIN23_W { + PIN23_W { w: self } + } + #[doc = "Bit 24 - Set as input pin 24"] + #[inline(always)] + pub fn pin24(&mut self) -> PIN24_W { + PIN24_W { w: self } + } + #[doc = "Bit 25 - Set as input pin 25"] + #[inline(always)] + pub fn pin25(&mut self) -> PIN25_W { + PIN25_W { w: self } + } + #[doc = "Bit 26 - Set as input pin 26"] + #[inline(always)] + pub fn pin26(&mut self) -> PIN26_W { + PIN26_W { w: self } + } + #[doc = "Bit 27 - Set as input pin 27"] + #[inline(always)] + pub fn pin27(&mut self) -> PIN27_W { + PIN27_W { w: self } + } + #[doc = "Bit 28 - Set as input pin 28"] + #[inline(always)] + pub fn pin28(&mut self) -> PIN28_W { + PIN28_W { w: self } + } + #[doc = "Bit 29 - Set as input pin 29"] + #[inline(always)] + pub fn pin29(&mut self) -> PIN29_W { + PIN29_W { w: self } + } + #[doc = "Bit 30 - Set as input pin 30"] + #[inline(always)] + pub fn pin30(&mut self) -> PIN30_W { + PIN30_W { w: self } + } + #[doc = "Bit 31 - Set as input pin 31"] + #[inline(always)] + pub fn pin31(&mut self) -> PIN31_W { + PIN31_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "DIR clear register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dirclr](index.html) module"] +pub struct DIRCLR_SPEC; +impl crate::RegisterSpec for DIRCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dirclr::R](R) reader structure"] +impl crate::Readable for DIRCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dirclr::W](W) writer structure"] +impl crate::Writable for DIRCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DIRCLR to value 0"] +impl crate::Resettable for DIRCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/p0/dirset.rs b/src/p0/dirset.rs new file mode 100644 index 0000000..12b68d9 --- /dev/null +++ b/src/p0/dirset.rs @@ -0,0 +1,3266 @@ +#[doc = "Register `DIRSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DIRSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Set as output pin 0\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN0_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN0` reader - Set as output pin 0"] +pub struct PIN0_R(crate::FieldReader); +impl PIN0_R { + pub(crate) fn new(bits: bool) -> Self { + PIN0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN0_A { + match self.bits { + false => PIN0_A::INPUT, + true => PIN0_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN0_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN0_A::OUTPUT + } +} +impl core::ops::Deref for PIN0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 0\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN0_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN0_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN0` writer - Set as output pin 0"] +pub struct PIN0_W<'a> { + w: &'a mut W, +} +impl<'a> PIN0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN0_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN0_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Set as output pin 1\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN1_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN1` reader - Set as output pin 1"] +pub struct PIN1_R(crate::FieldReader); +impl PIN1_R { + pub(crate) fn new(bits: bool) -> Self { + PIN1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN1_A { + match self.bits { + false => PIN1_A::INPUT, + true => PIN1_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN1_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN1_A::OUTPUT + } +} +impl core::ops::Deref for PIN1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 1\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN1_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN1_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN1` writer - Set as output pin 1"] +pub struct PIN1_W<'a> { + w: &'a mut W, +} +impl<'a> PIN1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN1_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN1_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Set as output pin 2\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN2_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN2` reader - Set as output pin 2"] +pub struct PIN2_R(crate::FieldReader); +impl PIN2_R { + pub(crate) fn new(bits: bool) -> Self { + PIN2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN2_A { + match self.bits { + false => PIN2_A::INPUT, + true => PIN2_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN2_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN2_A::OUTPUT + } +} +impl core::ops::Deref for PIN2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 2\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN2_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN2_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN2` writer - Set as output pin 2"] +pub struct PIN2_W<'a> { + w: &'a mut W, +} +impl<'a> PIN2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN2_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN2_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Set as output pin 3\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN3_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN3` reader - Set as output pin 3"] +pub struct PIN3_R(crate::FieldReader); +impl PIN3_R { + pub(crate) fn new(bits: bool) -> Self { + PIN3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN3_A { + match self.bits { + false => PIN3_A::INPUT, + true => PIN3_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN3_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN3_A::OUTPUT + } +} +impl core::ops::Deref for PIN3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 3\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN3_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN3_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN3` writer - Set as output pin 3"] +pub struct PIN3_W<'a> { + w: &'a mut W, +} +impl<'a> PIN3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN3_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN3_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Set as output pin 4\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN4_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN4_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN4` reader - Set as output pin 4"] +pub struct PIN4_R(crate::FieldReader); +impl PIN4_R { + pub(crate) fn new(bits: bool) -> Self { + PIN4_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN4_A { + match self.bits { + false => PIN4_A::INPUT, + true => PIN4_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN4_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN4_A::OUTPUT + } +} +impl core::ops::Deref for PIN4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 4\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN4_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN4_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN4` writer - Set as output pin 4"] +pub struct PIN4_W<'a> { + w: &'a mut W, +} +impl<'a> PIN4_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN4_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN4_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Set as output pin 5\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN5_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN5_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN5` reader - Set as output pin 5"] +pub struct PIN5_R(crate::FieldReader); +impl PIN5_R { + pub(crate) fn new(bits: bool) -> Self { + PIN5_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN5_A { + match self.bits { + false => PIN5_A::INPUT, + true => PIN5_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN5_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN5_A::OUTPUT + } +} +impl core::ops::Deref for PIN5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 5\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN5_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN5_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN5` writer - Set as output pin 5"] +pub struct PIN5_W<'a> { + w: &'a mut W, +} +impl<'a> PIN5_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN5_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN5_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Set as output pin 6\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN6_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN6_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN6` reader - Set as output pin 6"] +pub struct PIN6_R(crate::FieldReader); +impl PIN6_R { + pub(crate) fn new(bits: bool) -> Self { + PIN6_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN6_A { + match self.bits { + false => PIN6_A::INPUT, + true => PIN6_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN6_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN6_A::OUTPUT + } +} +impl core::ops::Deref for PIN6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 6\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN6_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN6_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN6` writer - Set as output pin 6"] +pub struct PIN6_W<'a> { + w: &'a mut W, +} +impl<'a> PIN6_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN6_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN6_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Set as output pin 7\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN7_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN7_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN7` reader - Set as output pin 7"] +pub struct PIN7_R(crate::FieldReader); +impl PIN7_R { + pub(crate) fn new(bits: bool) -> Self { + PIN7_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN7_A { + match self.bits { + false => PIN7_A::INPUT, + true => PIN7_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN7_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN7_A::OUTPUT + } +} +impl core::ops::Deref for PIN7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 7\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN7_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN7_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN7` writer - Set as output pin 7"] +pub struct PIN7_W<'a> { + w: &'a mut W, +} +impl<'a> PIN7_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN7_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN7_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Set as output pin 8\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN8_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN8_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN8` reader - Set as output pin 8"] +pub struct PIN8_R(crate::FieldReader); +impl PIN8_R { + pub(crate) fn new(bits: bool) -> Self { + PIN8_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN8_A { + match self.bits { + false => PIN8_A::INPUT, + true => PIN8_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN8_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN8_A::OUTPUT + } +} +impl core::ops::Deref for PIN8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 8\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN8_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN8_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN8` writer - Set as output pin 8"] +pub struct PIN8_W<'a> { + w: &'a mut W, +} +impl<'a> PIN8_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN8_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN8_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Set as output pin 9\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN9_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN9_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN9` reader - Set as output pin 9"] +pub struct PIN9_R(crate::FieldReader); +impl PIN9_R { + pub(crate) fn new(bits: bool) -> Self { + PIN9_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN9_A { + match self.bits { + false => PIN9_A::INPUT, + true => PIN9_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN9_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN9_A::OUTPUT + } +} +impl core::ops::Deref for PIN9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 9\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN9_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN9_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN9` writer - Set as output pin 9"] +pub struct PIN9_W<'a> { + w: &'a mut W, +} +impl<'a> PIN9_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN9_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN9_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Set as output pin 10\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN10_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN10_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN10` reader - Set as output pin 10"] +pub struct PIN10_R(crate::FieldReader); +impl PIN10_R { + pub(crate) fn new(bits: bool) -> Self { + PIN10_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN10_A { + match self.bits { + false => PIN10_A::INPUT, + true => PIN10_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN10_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN10_A::OUTPUT + } +} +impl core::ops::Deref for PIN10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 10\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN10_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN10_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN10` writer - Set as output pin 10"] +pub struct PIN10_W<'a> { + w: &'a mut W, +} +impl<'a> PIN10_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN10_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN10_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Set as output pin 11\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN11_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN11_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN11` reader - Set as output pin 11"] +pub struct PIN11_R(crate::FieldReader); +impl PIN11_R { + pub(crate) fn new(bits: bool) -> Self { + PIN11_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN11_A { + match self.bits { + false => PIN11_A::INPUT, + true => PIN11_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN11_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN11_A::OUTPUT + } +} +impl core::ops::Deref for PIN11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 11\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN11_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN11_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN11` writer - Set as output pin 11"] +pub struct PIN11_W<'a> { + w: &'a mut W, +} +impl<'a> PIN11_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN11_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN11_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Set as output pin 12\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN12_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN12_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN12` reader - Set as output pin 12"] +pub struct PIN12_R(crate::FieldReader); +impl PIN12_R { + pub(crate) fn new(bits: bool) -> Self { + PIN12_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN12_A { + match self.bits { + false => PIN12_A::INPUT, + true => PIN12_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN12_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN12_A::OUTPUT + } +} +impl core::ops::Deref for PIN12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 12\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN12_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN12_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN12` writer - Set as output pin 12"] +pub struct PIN12_W<'a> { + w: &'a mut W, +} +impl<'a> PIN12_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN12_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN12_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Set as output pin 13\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN13_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN13_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN13` reader - Set as output pin 13"] +pub struct PIN13_R(crate::FieldReader); +impl PIN13_R { + pub(crate) fn new(bits: bool) -> Self { + PIN13_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN13_A { + match self.bits { + false => PIN13_A::INPUT, + true => PIN13_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN13_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN13_A::OUTPUT + } +} +impl core::ops::Deref for PIN13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 13\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN13_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN13_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN13` writer - Set as output pin 13"] +pub struct PIN13_W<'a> { + w: &'a mut W, +} +impl<'a> PIN13_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN13_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN13_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Set as output pin 14\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN14_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN14_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN14` reader - Set as output pin 14"] +pub struct PIN14_R(crate::FieldReader); +impl PIN14_R { + pub(crate) fn new(bits: bool) -> Self { + PIN14_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN14_A { + match self.bits { + false => PIN14_A::INPUT, + true => PIN14_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN14_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN14_A::OUTPUT + } +} +impl core::ops::Deref for PIN14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 14\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN14_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN14_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN14` writer - Set as output pin 14"] +pub struct PIN14_W<'a> { + w: &'a mut W, +} +impl<'a> PIN14_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN14_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN14_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Set as output pin 15\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN15_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN15_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN15` reader - Set as output pin 15"] +pub struct PIN15_R(crate::FieldReader); +impl PIN15_R { + pub(crate) fn new(bits: bool) -> Self { + PIN15_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN15_A { + match self.bits { + false => PIN15_A::INPUT, + true => PIN15_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN15_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN15_A::OUTPUT + } +} +impl core::ops::Deref for PIN15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 15\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN15_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN15_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN15` writer - Set as output pin 15"] +pub struct PIN15_W<'a> { + w: &'a mut W, +} +impl<'a> PIN15_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN15_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN15_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Set as output pin 16\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN16_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN16_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN16` reader - Set as output pin 16"] +pub struct PIN16_R(crate::FieldReader); +impl PIN16_R { + pub(crate) fn new(bits: bool) -> Self { + PIN16_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN16_A { + match self.bits { + false => PIN16_A::INPUT, + true => PIN16_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN16_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN16_A::OUTPUT + } +} +impl core::ops::Deref for PIN16_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 16\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN16_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN16_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN16` writer - Set as output pin 16"] +pub struct PIN16_W<'a> { + w: &'a mut W, +} +impl<'a> PIN16_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN16_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN16_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Set as output pin 17\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN17_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN17_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN17` reader - Set as output pin 17"] +pub struct PIN17_R(crate::FieldReader); +impl PIN17_R { + pub(crate) fn new(bits: bool) -> Self { + PIN17_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN17_A { + match self.bits { + false => PIN17_A::INPUT, + true => PIN17_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN17_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN17_A::OUTPUT + } +} +impl core::ops::Deref for PIN17_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 17\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN17_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN17_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN17` writer - Set as output pin 17"] +pub struct PIN17_W<'a> { + w: &'a mut W, +} +impl<'a> PIN17_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN17_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN17_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Set as output pin 18\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN18_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN18_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN18` reader - Set as output pin 18"] +pub struct PIN18_R(crate::FieldReader); +impl PIN18_R { + pub(crate) fn new(bits: bool) -> Self { + PIN18_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN18_A { + match self.bits { + false => PIN18_A::INPUT, + true => PIN18_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN18_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN18_A::OUTPUT + } +} +impl core::ops::Deref for PIN18_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 18\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN18_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN18_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN18` writer - Set as output pin 18"] +pub struct PIN18_W<'a> { + w: &'a mut W, +} +impl<'a> PIN18_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN18_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN18_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Set as output pin 19\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN19_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN19_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN19` reader - Set as output pin 19"] +pub struct PIN19_R(crate::FieldReader); +impl PIN19_R { + pub(crate) fn new(bits: bool) -> Self { + PIN19_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN19_A { + match self.bits { + false => PIN19_A::INPUT, + true => PIN19_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN19_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN19_A::OUTPUT + } +} +impl core::ops::Deref for PIN19_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 19\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN19_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN19_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN19` writer - Set as output pin 19"] +pub struct PIN19_W<'a> { + w: &'a mut W, +} +impl<'a> PIN19_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN19_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN19_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Set as output pin 20\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN20_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN20_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN20` reader - Set as output pin 20"] +pub struct PIN20_R(crate::FieldReader); +impl PIN20_R { + pub(crate) fn new(bits: bool) -> Self { + PIN20_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN20_A { + match self.bits { + false => PIN20_A::INPUT, + true => PIN20_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN20_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN20_A::OUTPUT + } +} +impl core::ops::Deref for PIN20_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 20\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN20_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN20_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN20` writer - Set as output pin 20"] +pub struct PIN20_W<'a> { + w: &'a mut W, +} +impl<'a> PIN20_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN20_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN20_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Set as output pin 21\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN21_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN21_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN21` reader - Set as output pin 21"] +pub struct PIN21_R(crate::FieldReader); +impl PIN21_R { + pub(crate) fn new(bits: bool) -> Self { + PIN21_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN21_A { + match self.bits { + false => PIN21_A::INPUT, + true => PIN21_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN21_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN21_A::OUTPUT + } +} +impl core::ops::Deref for PIN21_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 21\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN21_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN21_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN21` writer - Set as output pin 21"] +pub struct PIN21_W<'a> { + w: &'a mut W, +} +impl<'a> PIN21_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN21_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN21_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); + self.w + } +} +#[doc = "Set as output pin 22\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN22_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN22_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN22` reader - Set as output pin 22"] +pub struct PIN22_R(crate::FieldReader); +impl PIN22_R { + pub(crate) fn new(bits: bool) -> Self { + PIN22_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN22_A { + match self.bits { + false => PIN22_A::INPUT, + true => PIN22_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN22_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN22_A::OUTPUT + } +} +impl core::ops::Deref for PIN22_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 22\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN22_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN22_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN22` writer - Set as output pin 22"] +pub struct PIN22_W<'a> { + w: &'a mut W, +} +impl<'a> PIN22_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN22_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN22_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); + self.w + } +} +#[doc = "Set as output pin 23\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN23_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN23_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN23` reader - Set as output pin 23"] +pub struct PIN23_R(crate::FieldReader); +impl PIN23_R { + pub(crate) fn new(bits: bool) -> Self { + PIN23_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN23_A { + match self.bits { + false => PIN23_A::INPUT, + true => PIN23_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN23_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN23_A::OUTPUT + } +} +impl core::ops::Deref for PIN23_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 23\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN23_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN23_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN23` writer - Set as output pin 23"] +pub struct PIN23_W<'a> { + w: &'a mut W, +} +impl<'a> PIN23_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN23_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN23_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); + self.w + } +} +#[doc = "Set as output pin 24\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN24_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN24_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN24` reader - Set as output pin 24"] +pub struct PIN24_R(crate::FieldReader); +impl PIN24_R { + pub(crate) fn new(bits: bool) -> Self { + PIN24_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN24_A { + match self.bits { + false => PIN24_A::INPUT, + true => PIN24_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN24_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN24_A::OUTPUT + } +} +impl core::ops::Deref for PIN24_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 24\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN24_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN24_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN24` writer - Set as output pin 24"] +pub struct PIN24_W<'a> { + w: &'a mut W, +} +impl<'a> PIN24_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN24_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN24_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Set as output pin 25\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN25_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN25_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN25` reader - Set as output pin 25"] +pub struct PIN25_R(crate::FieldReader); +impl PIN25_R { + pub(crate) fn new(bits: bool) -> Self { + PIN25_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN25_A { + match self.bits { + false => PIN25_A::INPUT, + true => PIN25_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN25_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN25_A::OUTPUT + } +} +impl core::ops::Deref for PIN25_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 25\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN25_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN25_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN25` writer - Set as output pin 25"] +pub struct PIN25_W<'a> { + w: &'a mut W, +} +impl<'a> PIN25_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN25_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN25_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Set as output pin 26\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN26_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN26_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN26` reader - Set as output pin 26"] +pub struct PIN26_R(crate::FieldReader); +impl PIN26_R { + pub(crate) fn new(bits: bool) -> Self { + PIN26_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN26_A { + match self.bits { + false => PIN26_A::INPUT, + true => PIN26_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN26_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN26_A::OUTPUT + } +} +impl core::ops::Deref for PIN26_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 26\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN26_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN26_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN26` writer - Set as output pin 26"] +pub struct PIN26_W<'a> { + w: &'a mut W, +} +impl<'a> PIN26_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN26_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN26_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Set as output pin 27\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN27_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN27_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN27` reader - Set as output pin 27"] +pub struct PIN27_R(crate::FieldReader); +impl PIN27_R { + pub(crate) fn new(bits: bool) -> Self { + PIN27_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN27_A { + match self.bits { + false => PIN27_A::INPUT, + true => PIN27_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN27_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN27_A::OUTPUT + } +} +impl core::ops::Deref for PIN27_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 27\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN27_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN27_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN27` writer - Set as output pin 27"] +pub struct PIN27_W<'a> { + w: &'a mut W, +} +impl<'a> PIN27_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN27_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN27_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +#[doc = "Set as output pin 28\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN28_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN28_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN28` reader - Set as output pin 28"] +pub struct PIN28_R(crate::FieldReader); +impl PIN28_R { + pub(crate) fn new(bits: bool) -> Self { + PIN28_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN28_A { + match self.bits { + false => PIN28_A::INPUT, + true => PIN28_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN28_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN28_A::OUTPUT + } +} +impl core::ops::Deref for PIN28_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 28\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN28_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN28_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN28` writer - Set as output pin 28"] +pub struct PIN28_W<'a> { + w: &'a mut W, +} +impl<'a> PIN28_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN28_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN28_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); + self.w + } +} +#[doc = "Set as output pin 29\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN29_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN29_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN29` reader - Set as output pin 29"] +pub struct PIN29_R(crate::FieldReader); +impl PIN29_R { + pub(crate) fn new(bits: bool) -> Self { + PIN29_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN29_A { + match self.bits { + false => PIN29_A::INPUT, + true => PIN29_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN29_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN29_A::OUTPUT + } +} +impl core::ops::Deref for PIN29_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 29\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN29_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN29_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN29` writer - Set as output pin 29"] +pub struct PIN29_W<'a> { + w: &'a mut W, +} +impl<'a> PIN29_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN29_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN29_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); + self.w + } +} +#[doc = "Set as output pin 30\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN30_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN30_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN30` reader - Set as output pin 30"] +pub struct PIN30_R(crate::FieldReader); +impl PIN30_R { + pub(crate) fn new(bits: bool) -> Self { + PIN30_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN30_A { + match self.bits { + false => PIN30_A::INPUT, + true => PIN30_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN30_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN30_A::OUTPUT + } +} +impl core::ops::Deref for PIN30_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 30\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN30_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN30_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN30` writer - Set as output pin 30"] +pub struct PIN30_W<'a> { + w: &'a mut W, +} +impl<'a> PIN30_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN30_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN30_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); + self.w + } +} +#[doc = "Set as output pin 31\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN31_A { + #[doc = "0: Read: pin set as input"] + INPUT = 0, + #[doc = "1: Read: pin set as output"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN31_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN31` reader - Set as output pin 31"] +pub struct PIN31_R(crate::FieldReader); +impl PIN31_R { + pub(crate) fn new(bits: bool) -> Self { + PIN31_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN31_A { + match self.bits { + false => PIN31_A::INPUT, + true => PIN31_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == PIN31_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == PIN31_A::OUTPUT + } +} +impl core::ops::Deref for PIN31_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Set as output pin 31\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN31_AW { + #[doc = "1: Write: writing a '1' sets pin to output; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN31_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN31` writer - Set as output pin 31"] +pub struct PIN31_W<'a> { + w: &'a mut W, +} +impl<'a> PIN31_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN31_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets pin to output; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN31_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bit 0 - Set as output pin 0"] + #[inline(always)] + pub fn pin0(&self) -> PIN0_R { + PIN0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Set as output pin 1"] + #[inline(always)] + pub fn pin1(&self) -> PIN1_R { + PIN1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Set as output pin 2"] + #[inline(always)] + pub fn pin2(&self) -> PIN2_R { + PIN2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Set as output pin 3"] + #[inline(always)] + pub fn pin3(&self) -> PIN3_R { + PIN3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Set as output pin 4"] + #[inline(always)] + pub fn pin4(&self) -> PIN4_R { + PIN4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Set as output pin 5"] + #[inline(always)] + pub fn pin5(&self) -> PIN5_R { + PIN5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Set as output pin 6"] + #[inline(always)] + pub fn pin6(&self) -> PIN6_R { + PIN6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Set as output pin 7"] + #[inline(always)] + pub fn pin7(&self) -> PIN7_R { + PIN7_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Set as output pin 8"] + #[inline(always)] + pub fn pin8(&self) -> PIN8_R { + PIN8_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Set as output pin 9"] + #[inline(always)] + pub fn pin9(&self) -> PIN9_R { + PIN9_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Set as output pin 10"] + #[inline(always)] + pub fn pin10(&self) -> PIN10_R { + PIN10_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Set as output pin 11"] + #[inline(always)] + pub fn pin11(&self) -> PIN11_R { + PIN11_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Set as output pin 12"] + #[inline(always)] + pub fn pin12(&self) -> PIN12_R { + PIN12_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Set as output pin 13"] + #[inline(always)] + pub fn pin13(&self) -> PIN13_R { + PIN13_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Set as output pin 14"] + #[inline(always)] + pub fn pin14(&self) -> PIN14_R { + PIN14_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Set as output pin 15"] + #[inline(always)] + pub fn pin15(&self) -> PIN15_R { + PIN15_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Set as output pin 16"] + #[inline(always)] + pub fn pin16(&self) -> PIN16_R { + PIN16_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Set as output pin 17"] + #[inline(always)] + pub fn pin17(&self) -> PIN17_R { + PIN17_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Set as output pin 18"] + #[inline(always)] + pub fn pin18(&self) -> PIN18_R { + PIN18_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Set as output pin 19"] + #[inline(always)] + pub fn pin19(&self) -> PIN19_R { + PIN19_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Set as output pin 20"] + #[inline(always)] + pub fn pin20(&self) -> PIN20_R { + PIN20_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 21 - Set as output pin 21"] + #[inline(always)] + pub fn pin21(&self) -> PIN21_R { + PIN21_R::new(((self.bits >> 21) & 0x01) != 0) + } + #[doc = "Bit 22 - Set as output pin 22"] + #[inline(always)] + pub fn pin22(&self) -> PIN22_R { + PIN22_R::new(((self.bits >> 22) & 0x01) != 0) + } + #[doc = "Bit 23 - Set as output pin 23"] + #[inline(always)] + pub fn pin23(&self) -> PIN23_R { + PIN23_R::new(((self.bits >> 23) & 0x01) != 0) + } + #[doc = "Bit 24 - Set as output pin 24"] + #[inline(always)] + pub fn pin24(&self) -> PIN24_R { + PIN24_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Set as output pin 25"] + #[inline(always)] + pub fn pin25(&self) -> PIN25_R { + PIN25_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Set as output pin 26"] + #[inline(always)] + pub fn pin26(&self) -> PIN26_R { + PIN26_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Set as output pin 27"] + #[inline(always)] + pub fn pin27(&self) -> PIN27_R { + PIN27_R::new(((self.bits >> 27) & 0x01) != 0) + } + #[doc = "Bit 28 - Set as output pin 28"] + #[inline(always)] + pub fn pin28(&self) -> PIN28_R { + PIN28_R::new(((self.bits >> 28) & 0x01) != 0) + } + #[doc = "Bit 29 - Set as output pin 29"] + #[inline(always)] + pub fn pin29(&self) -> PIN29_R { + PIN29_R::new(((self.bits >> 29) & 0x01) != 0) + } + #[doc = "Bit 30 - Set as output pin 30"] + #[inline(always)] + pub fn pin30(&self) -> PIN30_R { + PIN30_R::new(((self.bits >> 30) & 0x01) != 0) + } + #[doc = "Bit 31 - Set as output pin 31"] + #[inline(always)] + pub fn pin31(&self) -> PIN31_R { + PIN31_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Set as output pin 0"] + #[inline(always)] + pub fn pin0(&mut self) -> PIN0_W { + PIN0_W { w: self } + } + #[doc = "Bit 1 - Set as output pin 1"] + #[inline(always)] + pub fn pin1(&mut self) -> PIN1_W { + PIN1_W { w: self } + } + #[doc = "Bit 2 - Set as output pin 2"] + #[inline(always)] + pub fn pin2(&mut self) -> PIN2_W { + PIN2_W { w: self } + } + #[doc = "Bit 3 - Set as output pin 3"] + #[inline(always)] + pub fn pin3(&mut self) -> PIN3_W { + PIN3_W { w: self } + } + #[doc = "Bit 4 - Set as output pin 4"] + #[inline(always)] + pub fn pin4(&mut self) -> PIN4_W { + PIN4_W { w: self } + } + #[doc = "Bit 5 - Set as output pin 5"] + #[inline(always)] + pub fn pin5(&mut self) -> PIN5_W { + PIN5_W { w: self } + } + #[doc = "Bit 6 - Set as output pin 6"] + #[inline(always)] + pub fn pin6(&mut self) -> PIN6_W { + PIN6_W { w: self } + } + #[doc = "Bit 7 - Set as output pin 7"] + #[inline(always)] + pub fn pin7(&mut self) -> PIN7_W { + PIN7_W { w: self } + } + #[doc = "Bit 8 - Set as output pin 8"] + #[inline(always)] + pub fn pin8(&mut self) -> PIN8_W { + PIN8_W { w: self } + } + #[doc = "Bit 9 - Set as output pin 9"] + #[inline(always)] + pub fn pin9(&mut self) -> PIN9_W { + PIN9_W { w: self } + } + #[doc = "Bit 10 - Set as output pin 10"] + #[inline(always)] + pub fn pin10(&mut self) -> PIN10_W { + PIN10_W { w: self } + } + #[doc = "Bit 11 - Set as output pin 11"] + #[inline(always)] + pub fn pin11(&mut self) -> PIN11_W { + PIN11_W { w: self } + } + #[doc = "Bit 12 - Set as output pin 12"] + #[inline(always)] + pub fn pin12(&mut self) -> PIN12_W { + PIN12_W { w: self } + } + #[doc = "Bit 13 - Set as output pin 13"] + #[inline(always)] + pub fn pin13(&mut self) -> PIN13_W { + PIN13_W { w: self } + } + #[doc = "Bit 14 - Set as output pin 14"] + #[inline(always)] + pub fn pin14(&mut self) -> PIN14_W { + PIN14_W { w: self } + } + #[doc = "Bit 15 - Set as output pin 15"] + #[inline(always)] + pub fn pin15(&mut self) -> PIN15_W { + PIN15_W { w: self } + } + #[doc = "Bit 16 - Set as output pin 16"] + #[inline(always)] + pub fn pin16(&mut self) -> PIN16_W { + PIN16_W { w: self } + } + #[doc = "Bit 17 - Set as output pin 17"] + #[inline(always)] + pub fn pin17(&mut self) -> PIN17_W { + PIN17_W { w: self } + } + #[doc = "Bit 18 - Set as output pin 18"] + #[inline(always)] + pub fn pin18(&mut self) -> PIN18_W { + PIN18_W { w: self } + } + #[doc = "Bit 19 - Set as output pin 19"] + #[inline(always)] + pub fn pin19(&mut self) -> PIN19_W { + PIN19_W { w: self } + } + #[doc = "Bit 20 - Set as output pin 20"] + #[inline(always)] + pub fn pin20(&mut self) -> PIN20_W { + PIN20_W { w: self } + } + #[doc = "Bit 21 - Set as output pin 21"] + #[inline(always)] + pub fn pin21(&mut self) -> PIN21_W { + PIN21_W { w: self } + } + #[doc = "Bit 22 - Set as output pin 22"] + #[inline(always)] + pub fn pin22(&mut self) -> PIN22_W { + PIN22_W { w: self } + } + #[doc = "Bit 23 - Set as output pin 23"] + #[inline(always)] + pub fn pin23(&mut self) -> PIN23_W { + PIN23_W { w: self } + } + #[doc = "Bit 24 - Set as output pin 24"] + #[inline(always)] + pub fn pin24(&mut self) -> PIN24_W { + PIN24_W { w: self } + } + #[doc = "Bit 25 - Set as output pin 25"] + #[inline(always)] + pub fn pin25(&mut self) -> PIN25_W { + PIN25_W { w: self } + } + #[doc = "Bit 26 - Set as output pin 26"] + #[inline(always)] + pub fn pin26(&mut self) -> PIN26_W { + PIN26_W { w: self } + } + #[doc = "Bit 27 - Set as output pin 27"] + #[inline(always)] + pub fn pin27(&mut self) -> PIN27_W { + PIN27_W { w: self } + } + #[doc = "Bit 28 - Set as output pin 28"] + #[inline(always)] + pub fn pin28(&mut self) -> PIN28_W { + PIN28_W { w: self } + } + #[doc = "Bit 29 - Set as output pin 29"] + #[inline(always)] + pub fn pin29(&mut self) -> PIN29_W { + PIN29_W { w: self } + } + #[doc = "Bit 30 - Set as output pin 30"] + #[inline(always)] + pub fn pin30(&mut self) -> PIN30_W { + PIN30_W { w: self } + } + #[doc = "Bit 31 - Set as output pin 31"] + #[inline(always)] + pub fn pin31(&mut self) -> PIN31_W { + PIN31_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "DIR set register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dirset](index.html) module"] +pub struct DIRSET_SPEC; +impl crate::RegisterSpec for DIRSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dirset::R](R) reader structure"] +impl crate::Readable for DIRSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dirset::W](W) writer structure"] +impl crate::Writable for DIRSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DIRSET to value 0"] +impl crate::Resettable for DIRSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/p0/in_.rs b/src/p0/in_.rs new file mode 100644 index 0000000..f9d888e --- /dev/null +++ b/src/p0/in_.rs @@ -0,0 +1,1665 @@ +#[doc = "Register `IN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Pin 0\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN0_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN0` reader - Pin 0"] +pub struct PIN0_R(crate::FieldReader); +impl PIN0_R { + pub(crate) fn new(bits: bool) -> Self { + PIN0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN0_A { + match self.bits { + false => PIN0_A::LOW, + true => PIN0_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN0_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN0_A::HIGH + } +} +impl core::ops::Deref for PIN0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 1\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN1_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN1` reader - Pin 1"] +pub struct PIN1_R(crate::FieldReader); +impl PIN1_R { + pub(crate) fn new(bits: bool) -> Self { + PIN1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN1_A { + match self.bits { + false => PIN1_A::LOW, + true => PIN1_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN1_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN1_A::HIGH + } +} +impl core::ops::Deref for PIN1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 2\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN2_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN2` reader - Pin 2"] +pub struct PIN2_R(crate::FieldReader); +impl PIN2_R { + pub(crate) fn new(bits: bool) -> Self { + PIN2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN2_A { + match self.bits { + false => PIN2_A::LOW, + true => PIN2_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN2_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN2_A::HIGH + } +} +impl core::ops::Deref for PIN2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 3\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN3_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN3` reader - Pin 3"] +pub struct PIN3_R(crate::FieldReader); +impl PIN3_R { + pub(crate) fn new(bits: bool) -> Self { + PIN3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN3_A { + match self.bits { + false => PIN3_A::LOW, + true => PIN3_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN3_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN3_A::HIGH + } +} +impl core::ops::Deref for PIN3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 4\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN4_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN4_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN4` reader - Pin 4"] +pub struct PIN4_R(crate::FieldReader); +impl PIN4_R { + pub(crate) fn new(bits: bool) -> Self { + PIN4_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN4_A { + match self.bits { + false => PIN4_A::LOW, + true => PIN4_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN4_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN4_A::HIGH + } +} +impl core::ops::Deref for PIN4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 5\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN5_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN5_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN5` reader - Pin 5"] +pub struct PIN5_R(crate::FieldReader); +impl PIN5_R { + pub(crate) fn new(bits: bool) -> Self { + PIN5_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN5_A { + match self.bits { + false => PIN5_A::LOW, + true => PIN5_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN5_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN5_A::HIGH + } +} +impl core::ops::Deref for PIN5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 6\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN6_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN6_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN6` reader - Pin 6"] +pub struct PIN6_R(crate::FieldReader); +impl PIN6_R { + pub(crate) fn new(bits: bool) -> Self { + PIN6_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN6_A { + match self.bits { + false => PIN6_A::LOW, + true => PIN6_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN6_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN6_A::HIGH + } +} +impl core::ops::Deref for PIN6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 7\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN7_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN7_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN7` reader - Pin 7"] +pub struct PIN7_R(crate::FieldReader); +impl PIN7_R { + pub(crate) fn new(bits: bool) -> Self { + PIN7_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN7_A { + match self.bits { + false => PIN7_A::LOW, + true => PIN7_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN7_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN7_A::HIGH + } +} +impl core::ops::Deref for PIN7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 8\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN8_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN8_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN8` reader - Pin 8"] +pub struct PIN8_R(crate::FieldReader); +impl PIN8_R { + pub(crate) fn new(bits: bool) -> Self { + PIN8_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN8_A { + match self.bits { + false => PIN8_A::LOW, + true => PIN8_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN8_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN8_A::HIGH + } +} +impl core::ops::Deref for PIN8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 9\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN9_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN9_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN9` reader - Pin 9"] +pub struct PIN9_R(crate::FieldReader); +impl PIN9_R { + pub(crate) fn new(bits: bool) -> Self { + PIN9_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN9_A { + match self.bits { + false => PIN9_A::LOW, + true => PIN9_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN9_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN9_A::HIGH + } +} +impl core::ops::Deref for PIN9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 10\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN10_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN10_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN10` reader - Pin 10"] +pub struct PIN10_R(crate::FieldReader); +impl PIN10_R { + pub(crate) fn new(bits: bool) -> Self { + PIN10_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN10_A { + match self.bits { + false => PIN10_A::LOW, + true => PIN10_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN10_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN10_A::HIGH + } +} +impl core::ops::Deref for PIN10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 11\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN11_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN11_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN11` reader - Pin 11"] +pub struct PIN11_R(crate::FieldReader); +impl PIN11_R { + pub(crate) fn new(bits: bool) -> Self { + PIN11_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN11_A { + match self.bits { + false => PIN11_A::LOW, + true => PIN11_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN11_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN11_A::HIGH + } +} +impl core::ops::Deref for PIN11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 12\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN12_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN12_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN12` reader - Pin 12"] +pub struct PIN12_R(crate::FieldReader); +impl PIN12_R { + pub(crate) fn new(bits: bool) -> Self { + PIN12_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN12_A { + match self.bits { + false => PIN12_A::LOW, + true => PIN12_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN12_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN12_A::HIGH + } +} +impl core::ops::Deref for PIN12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 13\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN13_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN13_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN13` reader - Pin 13"] +pub struct PIN13_R(crate::FieldReader); +impl PIN13_R { + pub(crate) fn new(bits: bool) -> Self { + PIN13_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN13_A { + match self.bits { + false => PIN13_A::LOW, + true => PIN13_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN13_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN13_A::HIGH + } +} +impl core::ops::Deref for PIN13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 14\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN14_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN14_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN14` reader - Pin 14"] +pub struct PIN14_R(crate::FieldReader); +impl PIN14_R { + pub(crate) fn new(bits: bool) -> Self { + PIN14_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN14_A { + match self.bits { + false => PIN14_A::LOW, + true => PIN14_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN14_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN14_A::HIGH + } +} +impl core::ops::Deref for PIN14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 15\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN15_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN15_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN15` reader - Pin 15"] +pub struct PIN15_R(crate::FieldReader); +impl PIN15_R { + pub(crate) fn new(bits: bool) -> Self { + PIN15_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN15_A { + match self.bits { + false => PIN15_A::LOW, + true => PIN15_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN15_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN15_A::HIGH + } +} +impl core::ops::Deref for PIN15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 16\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN16_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN16_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN16` reader - Pin 16"] +pub struct PIN16_R(crate::FieldReader); +impl PIN16_R { + pub(crate) fn new(bits: bool) -> Self { + PIN16_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN16_A { + match self.bits { + false => PIN16_A::LOW, + true => PIN16_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN16_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN16_A::HIGH + } +} +impl core::ops::Deref for PIN16_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 17\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN17_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN17_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN17` reader - Pin 17"] +pub struct PIN17_R(crate::FieldReader); +impl PIN17_R { + pub(crate) fn new(bits: bool) -> Self { + PIN17_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN17_A { + match self.bits { + false => PIN17_A::LOW, + true => PIN17_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN17_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN17_A::HIGH + } +} +impl core::ops::Deref for PIN17_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 18\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN18_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN18_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN18` reader - Pin 18"] +pub struct PIN18_R(crate::FieldReader); +impl PIN18_R { + pub(crate) fn new(bits: bool) -> Self { + PIN18_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN18_A { + match self.bits { + false => PIN18_A::LOW, + true => PIN18_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN18_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN18_A::HIGH + } +} +impl core::ops::Deref for PIN18_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 19\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN19_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN19_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN19` reader - Pin 19"] +pub struct PIN19_R(crate::FieldReader); +impl PIN19_R { + pub(crate) fn new(bits: bool) -> Self { + PIN19_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN19_A { + match self.bits { + false => PIN19_A::LOW, + true => PIN19_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN19_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN19_A::HIGH + } +} +impl core::ops::Deref for PIN19_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 20\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN20_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN20_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN20` reader - Pin 20"] +pub struct PIN20_R(crate::FieldReader); +impl PIN20_R { + pub(crate) fn new(bits: bool) -> Self { + PIN20_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN20_A { + match self.bits { + false => PIN20_A::LOW, + true => PIN20_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN20_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN20_A::HIGH + } +} +impl core::ops::Deref for PIN20_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 21\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN21_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN21_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN21` reader - Pin 21"] +pub struct PIN21_R(crate::FieldReader); +impl PIN21_R { + pub(crate) fn new(bits: bool) -> Self { + PIN21_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN21_A { + match self.bits { + false => PIN21_A::LOW, + true => PIN21_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN21_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN21_A::HIGH + } +} +impl core::ops::Deref for PIN21_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 22\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN22_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN22_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN22` reader - Pin 22"] +pub struct PIN22_R(crate::FieldReader); +impl PIN22_R { + pub(crate) fn new(bits: bool) -> Self { + PIN22_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN22_A { + match self.bits { + false => PIN22_A::LOW, + true => PIN22_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN22_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN22_A::HIGH + } +} +impl core::ops::Deref for PIN22_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 23\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN23_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN23_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN23` reader - Pin 23"] +pub struct PIN23_R(crate::FieldReader); +impl PIN23_R { + pub(crate) fn new(bits: bool) -> Self { + PIN23_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN23_A { + match self.bits { + false => PIN23_A::LOW, + true => PIN23_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN23_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN23_A::HIGH + } +} +impl core::ops::Deref for PIN23_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 24\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN24_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN24_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN24` reader - Pin 24"] +pub struct PIN24_R(crate::FieldReader); +impl PIN24_R { + pub(crate) fn new(bits: bool) -> Self { + PIN24_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN24_A { + match self.bits { + false => PIN24_A::LOW, + true => PIN24_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN24_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN24_A::HIGH + } +} +impl core::ops::Deref for PIN24_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 25\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN25_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN25_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN25` reader - Pin 25"] +pub struct PIN25_R(crate::FieldReader); +impl PIN25_R { + pub(crate) fn new(bits: bool) -> Self { + PIN25_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN25_A { + match self.bits { + false => PIN25_A::LOW, + true => PIN25_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN25_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN25_A::HIGH + } +} +impl core::ops::Deref for PIN25_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 26\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN26_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN26_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN26` reader - Pin 26"] +pub struct PIN26_R(crate::FieldReader); +impl PIN26_R { + pub(crate) fn new(bits: bool) -> Self { + PIN26_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN26_A { + match self.bits { + false => PIN26_A::LOW, + true => PIN26_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN26_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN26_A::HIGH + } +} +impl core::ops::Deref for PIN26_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 27\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN27_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN27_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN27` reader - Pin 27"] +pub struct PIN27_R(crate::FieldReader); +impl PIN27_R { + pub(crate) fn new(bits: bool) -> Self { + PIN27_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN27_A { + match self.bits { + false => PIN27_A::LOW, + true => PIN27_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN27_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN27_A::HIGH + } +} +impl core::ops::Deref for PIN27_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 28\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN28_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN28_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN28` reader - Pin 28"] +pub struct PIN28_R(crate::FieldReader); +impl PIN28_R { + pub(crate) fn new(bits: bool) -> Self { + PIN28_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN28_A { + match self.bits { + false => PIN28_A::LOW, + true => PIN28_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN28_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN28_A::HIGH + } +} +impl core::ops::Deref for PIN28_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 29\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN29_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN29_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN29` reader - Pin 29"] +pub struct PIN29_R(crate::FieldReader); +impl PIN29_R { + pub(crate) fn new(bits: bool) -> Self { + PIN29_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN29_A { + match self.bits { + false => PIN29_A::LOW, + true => PIN29_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN29_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN29_A::HIGH + } +} +impl core::ops::Deref for PIN29_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 30\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN30_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN30_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN30` reader - Pin 30"] +pub struct PIN30_R(crate::FieldReader); +impl PIN30_R { + pub(crate) fn new(bits: bool) -> Self { + PIN30_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN30_A { + match self.bits { + false => PIN30_A::LOW, + true => PIN30_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN30_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN30_A::HIGH + } +} +impl core::ops::Deref for PIN30_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 31\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN31_A { + #[doc = "0: Pin input is low"] + LOW = 0, + #[doc = "1: Pin input is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN31_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN31` reader - Pin 31"] +pub struct PIN31_R(crate::FieldReader); +impl PIN31_R { + pub(crate) fn new(bits: bool) -> Self { + PIN31_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN31_A { + match self.bits { + false => PIN31_A::LOW, + true => PIN31_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN31_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN31_A::HIGH + } +} +impl core::ops::Deref for PIN31_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bit 0 - Pin 0"] + #[inline(always)] + pub fn pin0(&self) -> PIN0_R { + PIN0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Pin 1"] + #[inline(always)] + pub fn pin1(&self) -> PIN1_R { + PIN1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Pin 2"] + #[inline(always)] + pub fn pin2(&self) -> PIN2_R { + PIN2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Pin 3"] + #[inline(always)] + pub fn pin3(&self) -> PIN3_R { + PIN3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Pin 4"] + #[inline(always)] + pub fn pin4(&self) -> PIN4_R { + PIN4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Pin 5"] + #[inline(always)] + pub fn pin5(&self) -> PIN5_R { + PIN5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Pin 6"] + #[inline(always)] + pub fn pin6(&self) -> PIN6_R { + PIN6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Pin 7"] + #[inline(always)] + pub fn pin7(&self) -> PIN7_R { + PIN7_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Pin 8"] + #[inline(always)] + pub fn pin8(&self) -> PIN8_R { + PIN8_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Pin 9"] + #[inline(always)] + pub fn pin9(&self) -> PIN9_R { + PIN9_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Pin 10"] + #[inline(always)] + pub fn pin10(&self) -> PIN10_R { + PIN10_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Pin 11"] + #[inline(always)] + pub fn pin11(&self) -> PIN11_R { + PIN11_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Pin 12"] + #[inline(always)] + pub fn pin12(&self) -> PIN12_R { + PIN12_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Pin 13"] + #[inline(always)] + pub fn pin13(&self) -> PIN13_R { + PIN13_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Pin 14"] + #[inline(always)] + pub fn pin14(&self) -> PIN14_R { + PIN14_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Pin 15"] + #[inline(always)] + pub fn pin15(&self) -> PIN15_R { + PIN15_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Pin 16"] + #[inline(always)] + pub fn pin16(&self) -> PIN16_R { + PIN16_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Pin 17"] + #[inline(always)] + pub fn pin17(&self) -> PIN17_R { + PIN17_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Pin 18"] + #[inline(always)] + pub fn pin18(&self) -> PIN18_R { + PIN18_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Pin 19"] + #[inline(always)] + pub fn pin19(&self) -> PIN19_R { + PIN19_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Pin 20"] + #[inline(always)] + pub fn pin20(&self) -> PIN20_R { + PIN20_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 21 - Pin 21"] + #[inline(always)] + pub fn pin21(&self) -> PIN21_R { + PIN21_R::new(((self.bits >> 21) & 0x01) != 0) + } + #[doc = "Bit 22 - Pin 22"] + #[inline(always)] + pub fn pin22(&self) -> PIN22_R { + PIN22_R::new(((self.bits >> 22) & 0x01) != 0) + } + #[doc = "Bit 23 - Pin 23"] + #[inline(always)] + pub fn pin23(&self) -> PIN23_R { + PIN23_R::new(((self.bits >> 23) & 0x01) != 0) + } + #[doc = "Bit 24 - Pin 24"] + #[inline(always)] + pub fn pin24(&self) -> PIN24_R { + PIN24_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Pin 25"] + #[inline(always)] + pub fn pin25(&self) -> PIN25_R { + PIN25_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Pin 26"] + #[inline(always)] + pub fn pin26(&self) -> PIN26_R { + PIN26_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Pin 27"] + #[inline(always)] + pub fn pin27(&self) -> PIN27_R { + PIN27_R::new(((self.bits >> 27) & 0x01) != 0) + } + #[doc = "Bit 28 - Pin 28"] + #[inline(always)] + pub fn pin28(&self) -> PIN28_R { + PIN28_R::new(((self.bits >> 28) & 0x01) != 0) + } + #[doc = "Bit 29 - Pin 29"] + #[inline(always)] + pub fn pin29(&self) -> PIN29_R { + PIN29_R::new(((self.bits >> 29) & 0x01) != 0) + } + #[doc = "Bit 30 - Pin 30"] + #[inline(always)] + pub fn pin30(&self) -> PIN30_R { + PIN30_R::new(((self.bits >> 30) & 0x01) != 0) + } + #[doc = "Bit 31 - Pin 31"] + #[inline(always)] + pub fn pin31(&self) -> PIN31_R { + PIN31_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +#[doc = "Read GPIO port\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 [in_](index.html) module"] +pub struct IN_SPEC; +impl crate::RegisterSpec for IN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [in_::R](R) reader structure"] +impl crate::Readable for IN_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets IN to value 0"] +impl crate::Resettable for IN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/p0/latch.rs b/src/p0/latch.rs new file mode 100644 index 0000000..d5eec1e --- /dev/null +++ b/src/p0/latch.rs @@ -0,0 +1,3042 @@ +#[doc = "Register `LATCH` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `LATCH` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Status on whether PIN0 has met criteria set in PIN_CNF0.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN0_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN0` reader - Status on whether PIN0 has met criteria set in PIN_CNF0.SENSE register. Write '1' to clear."] +pub struct PIN0_R(crate::FieldReader); +impl PIN0_R { + pub(crate) fn new(bits: bool) -> Self { + PIN0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN0_A { + match self.bits { + false => PIN0_A::NOTLATCHED, + true => PIN0_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN0_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN0_A::LATCHED + } +} +impl core::ops::Deref for PIN0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN0` writer - Status on whether PIN0 has met criteria set in PIN_CNF0.SENSE register. Write '1' to clear."] +pub struct PIN0_W<'a> { + w: &'a mut W, +} +impl<'a> PIN0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN0_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN0_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN0_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Status on whether PIN1 has met criteria set in PIN_CNF1.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN1_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN1` reader - Status on whether PIN1 has met criteria set in PIN_CNF1.SENSE register. Write '1' to clear."] +pub struct PIN1_R(crate::FieldReader); +impl PIN1_R { + pub(crate) fn new(bits: bool) -> Self { + PIN1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN1_A { + match self.bits { + false => PIN1_A::NOTLATCHED, + true => PIN1_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN1_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN1_A::LATCHED + } +} +impl core::ops::Deref for PIN1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN1` writer - Status on whether PIN1 has met criteria set in PIN_CNF1.SENSE register. Write '1' to clear."] +pub struct PIN1_W<'a> { + w: &'a mut W, +} +impl<'a> PIN1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN1_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN1_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN1_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Status on whether PIN2 has met criteria set in PIN_CNF2.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN2_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN2` reader - Status on whether PIN2 has met criteria set in PIN_CNF2.SENSE register. Write '1' to clear."] +pub struct PIN2_R(crate::FieldReader); +impl PIN2_R { + pub(crate) fn new(bits: bool) -> Self { + PIN2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN2_A { + match self.bits { + false => PIN2_A::NOTLATCHED, + true => PIN2_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN2_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN2_A::LATCHED + } +} +impl core::ops::Deref for PIN2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN2` writer - Status on whether PIN2 has met criteria set in PIN_CNF2.SENSE register. Write '1' to clear."] +pub struct PIN2_W<'a> { + w: &'a mut W, +} +impl<'a> PIN2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN2_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN2_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN2_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Status on whether PIN3 has met criteria set in PIN_CNF3.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN3_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN3` reader - Status on whether PIN3 has met criteria set in PIN_CNF3.SENSE register. Write '1' to clear."] +pub struct PIN3_R(crate::FieldReader); +impl PIN3_R { + pub(crate) fn new(bits: bool) -> Self { + PIN3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN3_A { + match self.bits { + false => PIN3_A::NOTLATCHED, + true => PIN3_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN3_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN3_A::LATCHED + } +} +impl core::ops::Deref for PIN3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN3` writer - Status on whether PIN3 has met criteria set in PIN_CNF3.SENSE register. Write '1' to clear."] +pub struct PIN3_W<'a> { + w: &'a mut W, +} +impl<'a> PIN3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN3_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN3_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN3_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Status on whether PIN4 has met criteria set in PIN_CNF4.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN4_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN4_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN4` reader - Status on whether PIN4 has met criteria set in PIN_CNF4.SENSE register. Write '1' to clear."] +pub struct PIN4_R(crate::FieldReader); +impl PIN4_R { + pub(crate) fn new(bits: bool) -> Self { + PIN4_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN4_A { + match self.bits { + false => PIN4_A::NOTLATCHED, + true => PIN4_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN4_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN4_A::LATCHED + } +} +impl core::ops::Deref for PIN4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN4` writer - Status on whether PIN4 has met criteria set in PIN_CNF4.SENSE register. Write '1' to clear."] +pub struct PIN4_W<'a> { + w: &'a mut W, +} +impl<'a> PIN4_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN4_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN4_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN4_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Status on whether PIN5 has met criteria set in PIN_CNF5.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN5_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN5_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN5` reader - Status on whether PIN5 has met criteria set in PIN_CNF5.SENSE register. Write '1' to clear."] +pub struct PIN5_R(crate::FieldReader); +impl PIN5_R { + pub(crate) fn new(bits: bool) -> Self { + PIN5_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN5_A { + match self.bits { + false => PIN5_A::NOTLATCHED, + true => PIN5_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN5_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN5_A::LATCHED + } +} +impl core::ops::Deref for PIN5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN5` writer - Status on whether PIN5 has met criteria set in PIN_CNF5.SENSE register. Write '1' to clear."] +pub struct PIN5_W<'a> { + w: &'a mut W, +} +impl<'a> PIN5_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN5_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN5_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN5_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Status on whether PIN6 has met criteria set in PIN_CNF6.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN6_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN6_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN6` reader - Status on whether PIN6 has met criteria set in PIN_CNF6.SENSE register. Write '1' to clear."] +pub struct PIN6_R(crate::FieldReader); +impl PIN6_R { + pub(crate) fn new(bits: bool) -> Self { + PIN6_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN6_A { + match self.bits { + false => PIN6_A::NOTLATCHED, + true => PIN6_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN6_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN6_A::LATCHED + } +} +impl core::ops::Deref for PIN6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN6` writer - Status on whether PIN6 has met criteria set in PIN_CNF6.SENSE register. Write '1' to clear."] +pub struct PIN6_W<'a> { + w: &'a mut W, +} +impl<'a> PIN6_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN6_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN6_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN6_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Status on whether PIN7 has met criteria set in PIN_CNF7.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN7_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN7_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN7` reader - Status on whether PIN7 has met criteria set in PIN_CNF7.SENSE register. Write '1' to clear."] +pub struct PIN7_R(crate::FieldReader); +impl PIN7_R { + pub(crate) fn new(bits: bool) -> Self { + PIN7_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN7_A { + match self.bits { + false => PIN7_A::NOTLATCHED, + true => PIN7_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN7_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN7_A::LATCHED + } +} +impl core::ops::Deref for PIN7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN7` writer - Status on whether PIN7 has met criteria set in PIN_CNF7.SENSE register. Write '1' to clear."] +pub struct PIN7_W<'a> { + w: &'a mut W, +} +impl<'a> PIN7_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN7_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN7_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN7_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Status on whether PIN8 has met criteria set in PIN_CNF8.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN8_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN8_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN8` reader - Status on whether PIN8 has met criteria set in PIN_CNF8.SENSE register. Write '1' to clear."] +pub struct PIN8_R(crate::FieldReader); +impl PIN8_R { + pub(crate) fn new(bits: bool) -> Self { + PIN8_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN8_A { + match self.bits { + false => PIN8_A::NOTLATCHED, + true => PIN8_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN8_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN8_A::LATCHED + } +} +impl core::ops::Deref for PIN8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN8` writer - Status on whether PIN8 has met criteria set in PIN_CNF8.SENSE register. Write '1' to clear."] +pub struct PIN8_W<'a> { + w: &'a mut W, +} +impl<'a> PIN8_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN8_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN8_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN8_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Status on whether PIN9 has met criteria set in PIN_CNF9.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN9_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN9_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN9` reader - Status on whether PIN9 has met criteria set in PIN_CNF9.SENSE register. Write '1' to clear."] +pub struct PIN9_R(crate::FieldReader); +impl PIN9_R { + pub(crate) fn new(bits: bool) -> Self { + PIN9_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN9_A { + match self.bits { + false => PIN9_A::NOTLATCHED, + true => PIN9_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN9_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN9_A::LATCHED + } +} +impl core::ops::Deref for PIN9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN9` writer - Status on whether PIN9 has met criteria set in PIN_CNF9.SENSE register. Write '1' to clear."] +pub struct PIN9_W<'a> { + w: &'a mut W, +} +impl<'a> PIN9_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN9_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN9_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN9_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Status on whether PIN10 has met criteria set in PIN_CNF10.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN10_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN10_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN10` reader - Status on whether PIN10 has met criteria set in PIN_CNF10.SENSE register. Write '1' to clear."] +pub struct PIN10_R(crate::FieldReader); +impl PIN10_R { + pub(crate) fn new(bits: bool) -> Self { + PIN10_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN10_A { + match self.bits { + false => PIN10_A::NOTLATCHED, + true => PIN10_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN10_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN10_A::LATCHED + } +} +impl core::ops::Deref for PIN10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN10` writer - Status on whether PIN10 has met criteria set in PIN_CNF10.SENSE register. Write '1' to clear."] +pub struct PIN10_W<'a> { + w: &'a mut W, +} +impl<'a> PIN10_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN10_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN10_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN10_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Status on whether PIN11 has met criteria set in PIN_CNF11.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN11_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN11_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN11` reader - Status on whether PIN11 has met criteria set in PIN_CNF11.SENSE register. Write '1' to clear."] +pub struct PIN11_R(crate::FieldReader); +impl PIN11_R { + pub(crate) fn new(bits: bool) -> Self { + PIN11_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN11_A { + match self.bits { + false => PIN11_A::NOTLATCHED, + true => PIN11_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN11_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN11_A::LATCHED + } +} +impl core::ops::Deref for PIN11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN11` writer - Status on whether PIN11 has met criteria set in PIN_CNF11.SENSE register. Write '1' to clear."] +pub struct PIN11_W<'a> { + w: &'a mut W, +} +impl<'a> PIN11_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN11_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN11_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN11_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Status on whether PIN12 has met criteria set in PIN_CNF12.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN12_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN12_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN12` reader - Status on whether PIN12 has met criteria set in PIN_CNF12.SENSE register. Write '1' to clear."] +pub struct PIN12_R(crate::FieldReader); +impl PIN12_R { + pub(crate) fn new(bits: bool) -> Self { + PIN12_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN12_A { + match self.bits { + false => PIN12_A::NOTLATCHED, + true => PIN12_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN12_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN12_A::LATCHED + } +} +impl core::ops::Deref for PIN12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN12` writer - Status on whether PIN12 has met criteria set in PIN_CNF12.SENSE register. Write '1' to clear."] +pub struct PIN12_W<'a> { + w: &'a mut W, +} +impl<'a> PIN12_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN12_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN12_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN12_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Status on whether PIN13 has met criteria set in PIN_CNF13.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN13_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN13_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN13` reader - Status on whether PIN13 has met criteria set in PIN_CNF13.SENSE register. Write '1' to clear."] +pub struct PIN13_R(crate::FieldReader); +impl PIN13_R { + pub(crate) fn new(bits: bool) -> Self { + PIN13_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN13_A { + match self.bits { + false => PIN13_A::NOTLATCHED, + true => PIN13_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN13_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN13_A::LATCHED + } +} +impl core::ops::Deref for PIN13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN13` writer - Status on whether PIN13 has met criteria set in PIN_CNF13.SENSE register. Write '1' to clear."] +pub struct PIN13_W<'a> { + w: &'a mut W, +} +impl<'a> PIN13_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN13_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN13_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN13_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Status on whether PIN14 has met criteria set in PIN_CNF14.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN14_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN14_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN14` reader - Status on whether PIN14 has met criteria set in PIN_CNF14.SENSE register. Write '1' to clear."] +pub struct PIN14_R(crate::FieldReader); +impl PIN14_R { + pub(crate) fn new(bits: bool) -> Self { + PIN14_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN14_A { + match self.bits { + false => PIN14_A::NOTLATCHED, + true => PIN14_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN14_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN14_A::LATCHED + } +} +impl core::ops::Deref for PIN14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN14` writer - Status on whether PIN14 has met criteria set in PIN_CNF14.SENSE register. Write '1' to clear."] +pub struct PIN14_W<'a> { + w: &'a mut W, +} +impl<'a> PIN14_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN14_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN14_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN14_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Status on whether PIN15 has met criteria set in PIN_CNF15.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN15_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN15_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN15` reader - Status on whether PIN15 has met criteria set in PIN_CNF15.SENSE register. Write '1' to clear."] +pub struct PIN15_R(crate::FieldReader); +impl PIN15_R { + pub(crate) fn new(bits: bool) -> Self { + PIN15_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN15_A { + match self.bits { + false => PIN15_A::NOTLATCHED, + true => PIN15_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN15_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN15_A::LATCHED + } +} +impl core::ops::Deref for PIN15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN15` writer - Status on whether PIN15 has met criteria set in PIN_CNF15.SENSE register. Write '1' to clear."] +pub struct PIN15_W<'a> { + w: &'a mut W, +} +impl<'a> PIN15_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN15_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN15_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN15_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Status on whether PIN16 has met criteria set in PIN_CNF16.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN16_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN16_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN16` reader - Status on whether PIN16 has met criteria set in PIN_CNF16.SENSE register. Write '1' to clear."] +pub struct PIN16_R(crate::FieldReader); +impl PIN16_R { + pub(crate) fn new(bits: bool) -> Self { + PIN16_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN16_A { + match self.bits { + false => PIN16_A::NOTLATCHED, + true => PIN16_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN16_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN16_A::LATCHED + } +} +impl core::ops::Deref for PIN16_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN16` writer - Status on whether PIN16 has met criteria set in PIN_CNF16.SENSE register. Write '1' to clear."] +pub struct PIN16_W<'a> { + w: &'a mut W, +} +impl<'a> PIN16_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN16_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN16_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN16_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Status on whether PIN17 has met criteria set in PIN_CNF17.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN17_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN17_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN17` reader - Status on whether PIN17 has met criteria set in PIN_CNF17.SENSE register. Write '1' to clear."] +pub struct PIN17_R(crate::FieldReader); +impl PIN17_R { + pub(crate) fn new(bits: bool) -> Self { + PIN17_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN17_A { + match self.bits { + false => PIN17_A::NOTLATCHED, + true => PIN17_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN17_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN17_A::LATCHED + } +} +impl core::ops::Deref for PIN17_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN17` writer - Status on whether PIN17 has met criteria set in PIN_CNF17.SENSE register. Write '1' to clear."] +pub struct PIN17_W<'a> { + w: &'a mut W, +} +impl<'a> PIN17_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN17_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN17_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN17_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Status on whether PIN18 has met criteria set in PIN_CNF18.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN18_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN18_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN18` reader - Status on whether PIN18 has met criteria set in PIN_CNF18.SENSE register. Write '1' to clear."] +pub struct PIN18_R(crate::FieldReader); +impl PIN18_R { + pub(crate) fn new(bits: bool) -> Self { + PIN18_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN18_A { + match self.bits { + false => PIN18_A::NOTLATCHED, + true => PIN18_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN18_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN18_A::LATCHED + } +} +impl core::ops::Deref for PIN18_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN18` writer - Status on whether PIN18 has met criteria set in PIN_CNF18.SENSE register. Write '1' to clear."] +pub struct PIN18_W<'a> { + w: &'a mut W, +} +impl<'a> PIN18_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN18_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN18_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN18_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Status on whether PIN19 has met criteria set in PIN_CNF19.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN19_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN19_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN19` reader - Status on whether PIN19 has met criteria set in PIN_CNF19.SENSE register. Write '1' to clear."] +pub struct PIN19_R(crate::FieldReader); +impl PIN19_R { + pub(crate) fn new(bits: bool) -> Self { + PIN19_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN19_A { + match self.bits { + false => PIN19_A::NOTLATCHED, + true => PIN19_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN19_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN19_A::LATCHED + } +} +impl core::ops::Deref for PIN19_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN19` writer - Status on whether PIN19 has met criteria set in PIN_CNF19.SENSE register. Write '1' to clear."] +pub struct PIN19_W<'a> { + w: &'a mut W, +} +impl<'a> PIN19_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN19_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN19_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN19_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Status on whether PIN20 has met criteria set in PIN_CNF20.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN20_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN20_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN20` reader - Status on whether PIN20 has met criteria set in PIN_CNF20.SENSE register. Write '1' to clear."] +pub struct PIN20_R(crate::FieldReader); +impl PIN20_R { + pub(crate) fn new(bits: bool) -> Self { + PIN20_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN20_A { + match self.bits { + false => PIN20_A::NOTLATCHED, + true => PIN20_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN20_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN20_A::LATCHED + } +} +impl core::ops::Deref for PIN20_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN20` writer - Status on whether PIN20 has met criteria set in PIN_CNF20.SENSE register. Write '1' to clear."] +pub struct PIN20_W<'a> { + w: &'a mut W, +} +impl<'a> PIN20_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN20_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN20_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN20_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Status on whether PIN21 has met criteria set in PIN_CNF21.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN21_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN21_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN21` reader - Status on whether PIN21 has met criteria set in PIN_CNF21.SENSE register. Write '1' to clear."] +pub struct PIN21_R(crate::FieldReader); +impl PIN21_R { + pub(crate) fn new(bits: bool) -> Self { + PIN21_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN21_A { + match self.bits { + false => PIN21_A::NOTLATCHED, + true => PIN21_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN21_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN21_A::LATCHED + } +} +impl core::ops::Deref for PIN21_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN21` writer - Status on whether PIN21 has met criteria set in PIN_CNF21.SENSE register. Write '1' to clear."] +pub struct PIN21_W<'a> { + w: &'a mut W, +} +impl<'a> PIN21_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN21_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN21_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN21_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); + self.w + } +} +#[doc = "Status on whether PIN22 has met criteria set in PIN_CNF22.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN22_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN22_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN22` reader - Status on whether PIN22 has met criteria set in PIN_CNF22.SENSE register. Write '1' to clear."] +pub struct PIN22_R(crate::FieldReader); +impl PIN22_R { + pub(crate) fn new(bits: bool) -> Self { + PIN22_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN22_A { + match self.bits { + false => PIN22_A::NOTLATCHED, + true => PIN22_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN22_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN22_A::LATCHED + } +} +impl core::ops::Deref for PIN22_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN22` writer - Status on whether PIN22 has met criteria set in PIN_CNF22.SENSE register. Write '1' to clear."] +pub struct PIN22_W<'a> { + w: &'a mut W, +} +impl<'a> PIN22_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN22_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN22_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN22_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); + self.w + } +} +#[doc = "Status on whether PIN23 has met criteria set in PIN_CNF23.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN23_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN23_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN23` reader - Status on whether PIN23 has met criteria set in PIN_CNF23.SENSE register. Write '1' to clear."] +pub struct PIN23_R(crate::FieldReader); +impl PIN23_R { + pub(crate) fn new(bits: bool) -> Self { + PIN23_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN23_A { + match self.bits { + false => PIN23_A::NOTLATCHED, + true => PIN23_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN23_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN23_A::LATCHED + } +} +impl core::ops::Deref for PIN23_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN23` writer - Status on whether PIN23 has met criteria set in PIN_CNF23.SENSE register. Write '1' to clear."] +pub struct PIN23_W<'a> { + w: &'a mut W, +} +impl<'a> PIN23_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN23_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN23_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN23_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); + self.w + } +} +#[doc = "Status on whether PIN24 has met criteria set in PIN_CNF24.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN24_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN24_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN24` reader - Status on whether PIN24 has met criteria set in PIN_CNF24.SENSE register. Write '1' to clear."] +pub struct PIN24_R(crate::FieldReader); +impl PIN24_R { + pub(crate) fn new(bits: bool) -> Self { + PIN24_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN24_A { + match self.bits { + false => PIN24_A::NOTLATCHED, + true => PIN24_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN24_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN24_A::LATCHED + } +} +impl core::ops::Deref for PIN24_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN24` writer - Status on whether PIN24 has met criteria set in PIN_CNF24.SENSE register. Write '1' to clear."] +pub struct PIN24_W<'a> { + w: &'a mut W, +} +impl<'a> PIN24_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN24_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN24_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN24_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Status on whether PIN25 has met criteria set in PIN_CNF25.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN25_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN25_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN25` reader - Status on whether PIN25 has met criteria set in PIN_CNF25.SENSE register. Write '1' to clear."] +pub struct PIN25_R(crate::FieldReader); +impl PIN25_R { + pub(crate) fn new(bits: bool) -> Self { + PIN25_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN25_A { + match self.bits { + false => PIN25_A::NOTLATCHED, + true => PIN25_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN25_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN25_A::LATCHED + } +} +impl core::ops::Deref for PIN25_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN25` writer - Status on whether PIN25 has met criteria set in PIN_CNF25.SENSE register. Write '1' to clear."] +pub struct PIN25_W<'a> { + w: &'a mut W, +} +impl<'a> PIN25_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN25_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN25_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN25_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Status on whether PIN26 has met criteria set in PIN_CNF26.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN26_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN26_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN26` reader - Status on whether PIN26 has met criteria set in PIN_CNF26.SENSE register. Write '1' to clear."] +pub struct PIN26_R(crate::FieldReader); +impl PIN26_R { + pub(crate) fn new(bits: bool) -> Self { + PIN26_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN26_A { + match self.bits { + false => PIN26_A::NOTLATCHED, + true => PIN26_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN26_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN26_A::LATCHED + } +} +impl core::ops::Deref for PIN26_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN26` writer - Status on whether PIN26 has met criteria set in PIN_CNF26.SENSE register. Write '1' to clear."] +pub struct PIN26_W<'a> { + w: &'a mut W, +} +impl<'a> PIN26_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN26_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN26_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN26_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Status on whether PIN27 has met criteria set in PIN_CNF27.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN27_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN27_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN27` reader - Status on whether PIN27 has met criteria set in PIN_CNF27.SENSE register. Write '1' to clear."] +pub struct PIN27_R(crate::FieldReader); +impl PIN27_R { + pub(crate) fn new(bits: bool) -> Self { + PIN27_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN27_A { + match self.bits { + false => PIN27_A::NOTLATCHED, + true => PIN27_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN27_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN27_A::LATCHED + } +} +impl core::ops::Deref for PIN27_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN27` writer - Status on whether PIN27 has met criteria set in PIN_CNF27.SENSE register. Write '1' to clear."] +pub struct PIN27_W<'a> { + w: &'a mut W, +} +impl<'a> PIN27_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN27_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN27_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN27_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +#[doc = "Status on whether PIN28 has met criteria set in PIN_CNF28.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN28_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN28_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN28` reader - Status on whether PIN28 has met criteria set in PIN_CNF28.SENSE register. Write '1' to clear."] +pub struct PIN28_R(crate::FieldReader); +impl PIN28_R { + pub(crate) fn new(bits: bool) -> Self { + PIN28_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN28_A { + match self.bits { + false => PIN28_A::NOTLATCHED, + true => PIN28_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN28_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN28_A::LATCHED + } +} +impl core::ops::Deref for PIN28_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN28` writer - Status on whether PIN28 has met criteria set in PIN_CNF28.SENSE register. Write '1' to clear."] +pub struct PIN28_W<'a> { + w: &'a mut W, +} +impl<'a> PIN28_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN28_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN28_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN28_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); + self.w + } +} +#[doc = "Status on whether PIN29 has met criteria set in PIN_CNF29.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN29_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN29_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN29` reader - Status on whether PIN29 has met criteria set in PIN_CNF29.SENSE register. Write '1' to clear."] +pub struct PIN29_R(crate::FieldReader); +impl PIN29_R { + pub(crate) fn new(bits: bool) -> Self { + PIN29_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN29_A { + match self.bits { + false => PIN29_A::NOTLATCHED, + true => PIN29_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN29_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN29_A::LATCHED + } +} +impl core::ops::Deref for PIN29_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN29` writer - Status on whether PIN29 has met criteria set in PIN_CNF29.SENSE register. Write '1' to clear."] +pub struct PIN29_W<'a> { + w: &'a mut W, +} +impl<'a> PIN29_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN29_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN29_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN29_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); + self.w + } +} +#[doc = "Status on whether PIN30 has met criteria set in PIN_CNF30.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN30_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN30_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN30` reader - Status on whether PIN30 has met criteria set in PIN_CNF30.SENSE register. Write '1' to clear."] +pub struct PIN30_R(crate::FieldReader); +impl PIN30_R { + pub(crate) fn new(bits: bool) -> Self { + PIN30_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN30_A { + match self.bits { + false => PIN30_A::NOTLATCHED, + true => PIN30_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN30_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN30_A::LATCHED + } +} +impl core::ops::Deref for PIN30_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN30` writer - Status on whether PIN30 has met criteria set in PIN_CNF30.SENSE register. Write '1' to clear."] +pub struct PIN30_W<'a> { + w: &'a mut W, +} +impl<'a> PIN30_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN30_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN30_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN30_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); + self.w + } +} +#[doc = "Status on whether PIN31 has met criteria set in PIN_CNF31.SENSE register. Write '1' to clear.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN31_A { + #[doc = "0: Criteria has not been met"] + NOTLATCHED = 0, + #[doc = "1: Criteria has been met"] + LATCHED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN31_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN31` reader - Status on whether PIN31 has met criteria set in PIN_CNF31.SENSE register. Write '1' to clear."] +pub struct PIN31_R(crate::FieldReader); +impl PIN31_R { + pub(crate) fn new(bits: bool) -> Self { + PIN31_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN31_A { + match self.bits { + false => PIN31_A::NOTLATCHED, + true => PIN31_A::LATCHED, + } + } + #[doc = "Checks if the value of the field is `NOTLATCHED`"] + #[inline(always)] + pub fn is_not_latched(&self) -> bool { + **self == PIN31_A::NOTLATCHED + } + #[doc = "Checks if the value of the field is `LATCHED`"] + #[inline(always)] + pub fn is_latched(&self) -> bool { + **self == PIN31_A::LATCHED + } +} +impl core::ops::Deref for PIN31_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN31` writer - Status on whether PIN31 has met criteria set in PIN_CNF31.SENSE register. Write '1' to clear."] +pub struct PIN31_W<'a> { + w: &'a mut W, +} +impl<'a> PIN31_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN31_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Criteria has not been met"] + #[inline(always)] + pub fn not_latched(self) -> &'a mut W { + self.variant(PIN31_A::NOTLATCHED) + } + #[doc = "Criteria has been met"] + #[inline(always)] + pub fn latched(self) -> &'a mut W { + self.variant(PIN31_A::LATCHED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bit 0 - Status on whether PIN0 has met criteria set in PIN_CNF0.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin0(&self) -> PIN0_R { + PIN0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Status on whether PIN1 has met criteria set in PIN_CNF1.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin1(&self) -> PIN1_R { + PIN1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Status on whether PIN2 has met criteria set in PIN_CNF2.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin2(&self) -> PIN2_R { + PIN2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Status on whether PIN3 has met criteria set in PIN_CNF3.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin3(&self) -> PIN3_R { + PIN3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Status on whether PIN4 has met criteria set in PIN_CNF4.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin4(&self) -> PIN4_R { + PIN4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Status on whether PIN5 has met criteria set in PIN_CNF5.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin5(&self) -> PIN5_R { + PIN5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Status on whether PIN6 has met criteria set in PIN_CNF6.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin6(&self) -> PIN6_R { + PIN6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Status on whether PIN7 has met criteria set in PIN_CNF7.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin7(&self) -> PIN7_R { + PIN7_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Status on whether PIN8 has met criteria set in PIN_CNF8.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin8(&self) -> PIN8_R { + PIN8_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Status on whether PIN9 has met criteria set in PIN_CNF9.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin9(&self) -> PIN9_R { + PIN9_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Status on whether PIN10 has met criteria set in PIN_CNF10.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin10(&self) -> PIN10_R { + PIN10_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Status on whether PIN11 has met criteria set in PIN_CNF11.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin11(&self) -> PIN11_R { + PIN11_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Status on whether PIN12 has met criteria set in PIN_CNF12.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin12(&self) -> PIN12_R { + PIN12_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Status on whether PIN13 has met criteria set in PIN_CNF13.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin13(&self) -> PIN13_R { + PIN13_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Status on whether PIN14 has met criteria set in PIN_CNF14.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin14(&self) -> PIN14_R { + PIN14_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Status on whether PIN15 has met criteria set in PIN_CNF15.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin15(&self) -> PIN15_R { + PIN15_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Status on whether PIN16 has met criteria set in PIN_CNF16.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin16(&self) -> PIN16_R { + PIN16_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Status on whether PIN17 has met criteria set in PIN_CNF17.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin17(&self) -> PIN17_R { + PIN17_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Status on whether PIN18 has met criteria set in PIN_CNF18.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin18(&self) -> PIN18_R { + PIN18_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Status on whether PIN19 has met criteria set in PIN_CNF19.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin19(&self) -> PIN19_R { + PIN19_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Status on whether PIN20 has met criteria set in PIN_CNF20.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin20(&self) -> PIN20_R { + PIN20_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 21 - Status on whether PIN21 has met criteria set in PIN_CNF21.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin21(&self) -> PIN21_R { + PIN21_R::new(((self.bits >> 21) & 0x01) != 0) + } + #[doc = "Bit 22 - Status on whether PIN22 has met criteria set in PIN_CNF22.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin22(&self) -> PIN22_R { + PIN22_R::new(((self.bits >> 22) & 0x01) != 0) + } + #[doc = "Bit 23 - Status on whether PIN23 has met criteria set in PIN_CNF23.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin23(&self) -> PIN23_R { + PIN23_R::new(((self.bits >> 23) & 0x01) != 0) + } + #[doc = "Bit 24 - Status on whether PIN24 has met criteria set in PIN_CNF24.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin24(&self) -> PIN24_R { + PIN24_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Status on whether PIN25 has met criteria set in PIN_CNF25.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin25(&self) -> PIN25_R { + PIN25_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Status on whether PIN26 has met criteria set in PIN_CNF26.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin26(&self) -> PIN26_R { + PIN26_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Status on whether PIN27 has met criteria set in PIN_CNF27.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin27(&self) -> PIN27_R { + PIN27_R::new(((self.bits >> 27) & 0x01) != 0) + } + #[doc = "Bit 28 - Status on whether PIN28 has met criteria set in PIN_CNF28.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin28(&self) -> PIN28_R { + PIN28_R::new(((self.bits >> 28) & 0x01) != 0) + } + #[doc = "Bit 29 - Status on whether PIN29 has met criteria set in PIN_CNF29.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin29(&self) -> PIN29_R { + PIN29_R::new(((self.bits >> 29) & 0x01) != 0) + } + #[doc = "Bit 30 - Status on whether PIN30 has met criteria set in PIN_CNF30.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin30(&self) -> PIN30_R { + PIN30_R::new(((self.bits >> 30) & 0x01) != 0) + } + #[doc = "Bit 31 - Status on whether PIN31 has met criteria set in PIN_CNF31.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin31(&self) -> PIN31_R { + PIN31_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Status on whether PIN0 has met criteria set in PIN_CNF0.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin0(&mut self) -> PIN0_W { + PIN0_W { w: self } + } + #[doc = "Bit 1 - Status on whether PIN1 has met criteria set in PIN_CNF1.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin1(&mut self) -> PIN1_W { + PIN1_W { w: self } + } + #[doc = "Bit 2 - Status on whether PIN2 has met criteria set in PIN_CNF2.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin2(&mut self) -> PIN2_W { + PIN2_W { w: self } + } + #[doc = "Bit 3 - Status on whether PIN3 has met criteria set in PIN_CNF3.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin3(&mut self) -> PIN3_W { + PIN3_W { w: self } + } + #[doc = "Bit 4 - Status on whether PIN4 has met criteria set in PIN_CNF4.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin4(&mut self) -> PIN4_W { + PIN4_W { w: self } + } + #[doc = "Bit 5 - Status on whether PIN5 has met criteria set in PIN_CNF5.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin5(&mut self) -> PIN5_W { + PIN5_W { w: self } + } + #[doc = "Bit 6 - Status on whether PIN6 has met criteria set in PIN_CNF6.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin6(&mut self) -> PIN6_W { + PIN6_W { w: self } + } + #[doc = "Bit 7 - Status on whether PIN7 has met criteria set in PIN_CNF7.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin7(&mut self) -> PIN7_W { + PIN7_W { w: self } + } + #[doc = "Bit 8 - Status on whether PIN8 has met criteria set in PIN_CNF8.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin8(&mut self) -> PIN8_W { + PIN8_W { w: self } + } + #[doc = "Bit 9 - Status on whether PIN9 has met criteria set in PIN_CNF9.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin9(&mut self) -> PIN9_W { + PIN9_W { w: self } + } + #[doc = "Bit 10 - Status on whether PIN10 has met criteria set in PIN_CNF10.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin10(&mut self) -> PIN10_W { + PIN10_W { w: self } + } + #[doc = "Bit 11 - Status on whether PIN11 has met criteria set in PIN_CNF11.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin11(&mut self) -> PIN11_W { + PIN11_W { w: self } + } + #[doc = "Bit 12 - Status on whether PIN12 has met criteria set in PIN_CNF12.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin12(&mut self) -> PIN12_W { + PIN12_W { w: self } + } + #[doc = "Bit 13 - Status on whether PIN13 has met criteria set in PIN_CNF13.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin13(&mut self) -> PIN13_W { + PIN13_W { w: self } + } + #[doc = "Bit 14 - Status on whether PIN14 has met criteria set in PIN_CNF14.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin14(&mut self) -> PIN14_W { + PIN14_W { w: self } + } + #[doc = "Bit 15 - Status on whether PIN15 has met criteria set in PIN_CNF15.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin15(&mut self) -> PIN15_W { + PIN15_W { w: self } + } + #[doc = "Bit 16 - Status on whether PIN16 has met criteria set in PIN_CNF16.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin16(&mut self) -> PIN16_W { + PIN16_W { w: self } + } + #[doc = "Bit 17 - Status on whether PIN17 has met criteria set in PIN_CNF17.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin17(&mut self) -> PIN17_W { + PIN17_W { w: self } + } + #[doc = "Bit 18 - Status on whether PIN18 has met criteria set in PIN_CNF18.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin18(&mut self) -> PIN18_W { + PIN18_W { w: self } + } + #[doc = "Bit 19 - Status on whether PIN19 has met criteria set in PIN_CNF19.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin19(&mut self) -> PIN19_W { + PIN19_W { w: self } + } + #[doc = "Bit 20 - Status on whether PIN20 has met criteria set in PIN_CNF20.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin20(&mut self) -> PIN20_W { + PIN20_W { w: self } + } + #[doc = "Bit 21 - Status on whether PIN21 has met criteria set in PIN_CNF21.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin21(&mut self) -> PIN21_W { + PIN21_W { w: self } + } + #[doc = "Bit 22 - Status on whether PIN22 has met criteria set in PIN_CNF22.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin22(&mut self) -> PIN22_W { + PIN22_W { w: self } + } + #[doc = "Bit 23 - Status on whether PIN23 has met criteria set in PIN_CNF23.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin23(&mut self) -> PIN23_W { + PIN23_W { w: self } + } + #[doc = "Bit 24 - Status on whether PIN24 has met criteria set in PIN_CNF24.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin24(&mut self) -> PIN24_W { + PIN24_W { w: self } + } + #[doc = "Bit 25 - Status on whether PIN25 has met criteria set in PIN_CNF25.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin25(&mut self) -> PIN25_W { + PIN25_W { w: self } + } + #[doc = "Bit 26 - Status on whether PIN26 has met criteria set in PIN_CNF26.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin26(&mut self) -> PIN26_W { + PIN26_W { w: self } + } + #[doc = "Bit 27 - Status on whether PIN27 has met criteria set in PIN_CNF27.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin27(&mut self) -> PIN27_W { + PIN27_W { w: self } + } + #[doc = "Bit 28 - Status on whether PIN28 has met criteria set in PIN_CNF28.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin28(&mut self) -> PIN28_W { + PIN28_W { w: self } + } + #[doc = "Bit 29 - Status on whether PIN29 has met criteria set in PIN_CNF29.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin29(&mut self) -> PIN29_W { + PIN29_W { w: self } + } + #[doc = "Bit 30 - Status on whether PIN30 has met criteria set in PIN_CNF30.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin30(&mut self) -> PIN30_W { + PIN30_W { w: self } + } + #[doc = "Bit 31 - Status on whether PIN31 has met criteria set in PIN_CNF31.SENSE register. Write '1' to clear."] + #[inline(always)] + pub fn pin31(&mut self) -> PIN31_W { + PIN31_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Latch register indicating what GPIO pins that have met the criteria set in the PIN_CNF\\[n\\].SENSE registers\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [latch](index.html) module"] +pub struct LATCH_SPEC; +impl crate::RegisterSpec for LATCH_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [latch::R](R) reader structure"] +impl crate::Readable for LATCH_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [latch::W](W) writer structure"] +impl crate::Writable for LATCH_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LATCH to value 0"] +impl crate::Resettable for LATCH_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/p0/out.rs b/src/p0/out.rs new file mode 100644 index 0000000..20ed770 --- /dev/null +++ b/src/p0/out.rs @@ -0,0 +1,3042 @@ +#[doc = "Register `OUT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `OUT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Pin 0\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN0_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN0` reader - Pin 0"] +pub struct PIN0_R(crate::FieldReader); +impl PIN0_R { + pub(crate) fn new(bits: bool) -> Self { + PIN0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN0_A { + match self.bits { + false => PIN0_A::LOW, + true => PIN0_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN0_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN0_A::HIGH + } +} +impl core::ops::Deref for PIN0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN0` writer - Pin 0"] +pub struct PIN0_W<'a> { + w: &'a mut W, +} +impl<'a> PIN0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN0_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN0_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN0_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Pin 1\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN1_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN1` reader - Pin 1"] +pub struct PIN1_R(crate::FieldReader); +impl PIN1_R { + pub(crate) fn new(bits: bool) -> Self { + PIN1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN1_A { + match self.bits { + false => PIN1_A::LOW, + true => PIN1_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN1_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN1_A::HIGH + } +} +impl core::ops::Deref for PIN1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN1` writer - Pin 1"] +pub struct PIN1_W<'a> { + w: &'a mut W, +} +impl<'a> PIN1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN1_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN1_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN1_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Pin 2\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN2_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN2` reader - Pin 2"] +pub struct PIN2_R(crate::FieldReader); +impl PIN2_R { + pub(crate) fn new(bits: bool) -> Self { + PIN2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN2_A { + match self.bits { + false => PIN2_A::LOW, + true => PIN2_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN2_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN2_A::HIGH + } +} +impl core::ops::Deref for PIN2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN2` writer - Pin 2"] +pub struct PIN2_W<'a> { + w: &'a mut W, +} +impl<'a> PIN2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN2_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN2_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN2_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Pin 3\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN3_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN3` reader - Pin 3"] +pub struct PIN3_R(crate::FieldReader); +impl PIN3_R { + pub(crate) fn new(bits: bool) -> Self { + PIN3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN3_A { + match self.bits { + false => PIN3_A::LOW, + true => PIN3_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN3_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN3_A::HIGH + } +} +impl core::ops::Deref for PIN3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN3` writer - Pin 3"] +pub struct PIN3_W<'a> { + w: &'a mut W, +} +impl<'a> PIN3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN3_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN3_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN3_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Pin 4\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN4_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN4_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN4` reader - Pin 4"] +pub struct PIN4_R(crate::FieldReader); +impl PIN4_R { + pub(crate) fn new(bits: bool) -> Self { + PIN4_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN4_A { + match self.bits { + false => PIN4_A::LOW, + true => PIN4_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN4_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN4_A::HIGH + } +} +impl core::ops::Deref for PIN4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN4` writer - Pin 4"] +pub struct PIN4_W<'a> { + w: &'a mut W, +} +impl<'a> PIN4_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN4_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN4_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN4_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Pin 5\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN5_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN5_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN5` reader - Pin 5"] +pub struct PIN5_R(crate::FieldReader); +impl PIN5_R { + pub(crate) fn new(bits: bool) -> Self { + PIN5_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN5_A { + match self.bits { + false => PIN5_A::LOW, + true => PIN5_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN5_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN5_A::HIGH + } +} +impl core::ops::Deref for PIN5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN5` writer - Pin 5"] +pub struct PIN5_W<'a> { + w: &'a mut W, +} +impl<'a> PIN5_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN5_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN5_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN5_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Pin 6\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN6_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN6_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN6` reader - Pin 6"] +pub struct PIN6_R(crate::FieldReader); +impl PIN6_R { + pub(crate) fn new(bits: bool) -> Self { + PIN6_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN6_A { + match self.bits { + false => PIN6_A::LOW, + true => PIN6_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN6_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN6_A::HIGH + } +} +impl core::ops::Deref for PIN6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN6` writer - Pin 6"] +pub struct PIN6_W<'a> { + w: &'a mut W, +} +impl<'a> PIN6_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN6_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN6_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN6_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Pin 7\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN7_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN7_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN7` reader - Pin 7"] +pub struct PIN7_R(crate::FieldReader); +impl PIN7_R { + pub(crate) fn new(bits: bool) -> Self { + PIN7_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN7_A { + match self.bits { + false => PIN7_A::LOW, + true => PIN7_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN7_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN7_A::HIGH + } +} +impl core::ops::Deref for PIN7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN7` writer - Pin 7"] +pub struct PIN7_W<'a> { + w: &'a mut W, +} +impl<'a> PIN7_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN7_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN7_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN7_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Pin 8\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN8_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN8_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN8` reader - Pin 8"] +pub struct PIN8_R(crate::FieldReader); +impl PIN8_R { + pub(crate) fn new(bits: bool) -> Self { + PIN8_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN8_A { + match self.bits { + false => PIN8_A::LOW, + true => PIN8_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN8_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN8_A::HIGH + } +} +impl core::ops::Deref for PIN8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN8` writer - Pin 8"] +pub struct PIN8_W<'a> { + w: &'a mut W, +} +impl<'a> PIN8_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN8_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN8_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN8_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Pin 9\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN9_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN9_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN9` reader - Pin 9"] +pub struct PIN9_R(crate::FieldReader); +impl PIN9_R { + pub(crate) fn new(bits: bool) -> Self { + PIN9_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN9_A { + match self.bits { + false => PIN9_A::LOW, + true => PIN9_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN9_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN9_A::HIGH + } +} +impl core::ops::Deref for PIN9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN9` writer - Pin 9"] +pub struct PIN9_W<'a> { + w: &'a mut W, +} +impl<'a> PIN9_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN9_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN9_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN9_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Pin 10\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN10_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN10_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN10` reader - Pin 10"] +pub struct PIN10_R(crate::FieldReader); +impl PIN10_R { + pub(crate) fn new(bits: bool) -> Self { + PIN10_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN10_A { + match self.bits { + false => PIN10_A::LOW, + true => PIN10_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN10_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN10_A::HIGH + } +} +impl core::ops::Deref for PIN10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN10` writer - Pin 10"] +pub struct PIN10_W<'a> { + w: &'a mut W, +} +impl<'a> PIN10_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN10_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN10_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN10_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Pin 11\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN11_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN11_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN11` reader - Pin 11"] +pub struct PIN11_R(crate::FieldReader); +impl PIN11_R { + pub(crate) fn new(bits: bool) -> Self { + PIN11_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN11_A { + match self.bits { + false => PIN11_A::LOW, + true => PIN11_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN11_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN11_A::HIGH + } +} +impl core::ops::Deref for PIN11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN11` writer - Pin 11"] +pub struct PIN11_W<'a> { + w: &'a mut W, +} +impl<'a> PIN11_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN11_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN11_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN11_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Pin 12\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN12_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN12_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN12` reader - Pin 12"] +pub struct PIN12_R(crate::FieldReader); +impl PIN12_R { + pub(crate) fn new(bits: bool) -> Self { + PIN12_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN12_A { + match self.bits { + false => PIN12_A::LOW, + true => PIN12_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN12_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN12_A::HIGH + } +} +impl core::ops::Deref for PIN12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN12` writer - Pin 12"] +pub struct PIN12_W<'a> { + w: &'a mut W, +} +impl<'a> PIN12_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN12_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN12_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN12_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Pin 13\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN13_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN13_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN13` reader - Pin 13"] +pub struct PIN13_R(crate::FieldReader); +impl PIN13_R { + pub(crate) fn new(bits: bool) -> Self { + PIN13_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN13_A { + match self.bits { + false => PIN13_A::LOW, + true => PIN13_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN13_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN13_A::HIGH + } +} +impl core::ops::Deref for PIN13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN13` writer - Pin 13"] +pub struct PIN13_W<'a> { + w: &'a mut W, +} +impl<'a> PIN13_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN13_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN13_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN13_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Pin 14\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN14_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN14_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN14` reader - Pin 14"] +pub struct PIN14_R(crate::FieldReader); +impl PIN14_R { + pub(crate) fn new(bits: bool) -> Self { + PIN14_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN14_A { + match self.bits { + false => PIN14_A::LOW, + true => PIN14_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN14_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN14_A::HIGH + } +} +impl core::ops::Deref for PIN14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN14` writer - Pin 14"] +pub struct PIN14_W<'a> { + w: &'a mut W, +} +impl<'a> PIN14_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN14_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN14_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN14_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Pin 15\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN15_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN15_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN15` reader - Pin 15"] +pub struct PIN15_R(crate::FieldReader); +impl PIN15_R { + pub(crate) fn new(bits: bool) -> Self { + PIN15_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN15_A { + match self.bits { + false => PIN15_A::LOW, + true => PIN15_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN15_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN15_A::HIGH + } +} +impl core::ops::Deref for PIN15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN15` writer - Pin 15"] +pub struct PIN15_W<'a> { + w: &'a mut W, +} +impl<'a> PIN15_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN15_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN15_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN15_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Pin 16\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN16_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN16_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN16` reader - Pin 16"] +pub struct PIN16_R(crate::FieldReader); +impl PIN16_R { + pub(crate) fn new(bits: bool) -> Self { + PIN16_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN16_A { + match self.bits { + false => PIN16_A::LOW, + true => PIN16_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN16_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN16_A::HIGH + } +} +impl core::ops::Deref for PIN16_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN16` writer - Pin 16"] +pub struct PIN16_W<'a> { + w: &'a mut W, +} +impl<'a> PIN16_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN16_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN16_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN16_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Pin 17\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN17_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN17_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN17` reader - Pin 17"] +pub struct PIN17_R(crate::FieldReader); +impl PIN17_R { + pub(crate) fn new(bits: bool) -> Self { + PIN17_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN17_A { + match self.bits { + false => PIN17_A::LOW, + true => PIN17_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN17_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN17_A::HIGH + } +} +impl core::ops::Deref for PIN17_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN17` writer - Pin 17"] +pub struct PIN17_W<'a> { + w: &'a mut W, +} +impl<'a> PIN17_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN17_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN17_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN17_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Pin 18\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN18_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN18_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN18` reader - Pin 18"] +pub struct PIN18_R(crate::FieldReader); +impl PIN18_R { + pub(crate) fn new(bits: bool) -> Self { + PIN18_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN18_A { + match self.bits { + false => PIN18_A::LOW, + true => PIN18_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN18_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN18_A::HIGH + } +} +impl core::ops::Deref for PIN18_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN18` writer - Pin 18"] +pub struct PIN18_W<'a> { + w: &'a mut W, +} +impl<'a> PIN18_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN18_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN18_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN18_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Pin 19\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN19_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN19_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN19` reader - Pin 19"] +pub struct PIN19_R(crate::FieldReader); +impl PIN19_R { + pub(crate) fn new(bits: bool) -> Self { + PIN19_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN19_A { + match self.bits { + false => PIN19_A::LOW, + true => PIN19_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN19_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN19_A::HIGH + } +} +impl core::ops::Deref for PIN19_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN19` writer - Pin 19"] +pub struct PIN19_W<'a> { + w: &'a mut W, +} +impl<'a> PIN19_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN19_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN19_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN19_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Pin 20\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN20_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN20_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN20` reader - Pin 20"] +pub struct PIN20_R(crate::FieldReader); +impl PIN20_R { + pub(crate) fn new(bits: bool) -> Self { + PIN20_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN20_A { + match self.bits { + false => PIN20_A::LOW, + true => PIN20_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN20_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN20_A::HIGH + } +} +impl core::ops::Deref for PIN20_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN20` writer - Pin 20"] +pub struct PIN20_W<'a> { + w: &'a mut W, +} +impl<'a> PIN20_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN20_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN20_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN20_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Pin 21\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN21_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN21_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN21` reader - Pin 21"] +pub struct PIN21_R(crate::FieldReader); +impl PIN21_R { + pub(crate) fn new(bits: bool) -> Self { + PIN21_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN21_A { + match self.bits { + false => PIN21_A::LOW, + true => PIN21_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN21_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN21_A::HIGH + } +} +impl core::ops::Deref for PIN21_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN21` writer - Pin 21"] +pub struct PIN21_W<'a> { + w: &'a mut W, +} +impl<'a> PIN21_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN21_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN21_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN21_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); + self.w + } +} +#[doc = "Pin 22\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN22_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN22_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN22` reader - Pin 22"] +pub struct PIN22_R(crate::FieldReader); +impl PIN22_R { + pub(crate) fn new(bits: bool) -> Self { + PIN22_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN22_A { + match self.bits { + false => PIN22_A::LOW, + true => PIN22_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN22_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN22_A::HIGH + } +} +impl core::ops::Deref for PIN22_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN22` writer - Pin 22"] +pub struct PIN22_W<'a> { + w: &'a mut W, +} +impl<'a> PIN22_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN22_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN22_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN22_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); + self.w + } +} +#[doc = "Pin 23\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN23_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN23_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN23` reader - Pin 23"] +pub struct PIN23_R(crate::FieldReader); +impl PIN23_R { + pub(crate) fn new(bits: bool) -> Self { + PIN23_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN23_A { + match self.bits { + false => PIN23_A::LOW, + true => PIN23_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN23_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN23_A::HIGH + } +} +impl core::ops::Deref for PIN23_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN23` writer - Pin 23"] +pub struct PIN23_W<'a> { + w: &'a mut W, +} +impl<'a> PIN23_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN23_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN23_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN23_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); + self.w + } +} +#[doc = "Pin 24\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN24_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN24_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN24` reader - Pin 24"] +pub struct PIN24_R(crate::FieldReader); +impl PIN24_R { + pub(crate) fn new(bits: bool) -> Self { + PIN24_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN24_A { + match self.bits { + false => PIN24_A::LOW, + true => PIN24_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN24_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN24_A::HIGH + } +} +impl core::ops::Deref for PIN24_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN24` writer - Pin 24"] +pub struct PIN24_W<'a> { + w: &'a mut W, +} +impl<'a> PIN24_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN24_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN24_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN24_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Pin 25\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN25_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN25_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN25` reader - Pin 25"] +pub struct PIN25_R(crate::FieldReader); +impl PIN25_R { + pub(crate) fn new(bits: bool) -> Self { + PIN25_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN25_A { + match self.bits { + false => PIN25_A::LOW, + true => PIN25_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN25_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN25_A::HIGH + } +} +impl core::ops::Deref for PIN25_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN25` writer - Pin 25"] +pub struct PIN25_W<'a> { + w: &'a mut W, +} +impl<'a> PIN25_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN25_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN25_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN25_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Pin 26\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN26_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN26_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN26` reader - Pin 26"] +pub struct PIN26_R(crate::FieldReader); +impl PIN26_R { + pub(crate) fn new(bits: bool) -> Self { + PIN26_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN26_A { + match self.bits { + false => PIN26_A::LOW, + true => PIN26_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN26_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN26_A::HIGH + } +} +impl core::ops::Deref for PIN26_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN26` writer - Pin 26"] +pub struct PIN26_W<'a> { + w: &'a mut W, +} +impl<'a> PIN26_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN26_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN26_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN26_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Pin 27\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN27_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN27_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN27` reader - Pin 27"] +pub struct PIN27_R(crate::FieldReader); +impl PIN27_R { + pub(crate) fn new(bits: bool) -> Self { + PIN27_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN27_A { + match self.bits { + false => PIN27_A::LOW, + true => PIN27_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN27_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN27_A::HIGH + } +} +impl core::ops::Deref for PIN27_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN27` writer - Pin 27"] +pub struct PIN27_W<'a> { + w: &'a mut W, +} +impl<'a> PIN27_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN27_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN27_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN27_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +#[doc = "Pin 28\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN28_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN28_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN28` reader - Pin 28"] +pub struct PIN28_R(crate::FieldReader); +impl PIN28_R { + pub(crate) fn new(bits: bool) -> Self { + PIN28_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN28_A { + match self.bits { + false => PIN28_A::LOW, + true => PIN28_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN28_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN28_A::HIGH + } +} +impl core::ops::Deref for PIN28_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN28` writer - Pin 28"] +pub struct PIN28_W<'a> { + w: &'a mut W, +} +impl<'a> PIN28_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN28_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN28_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN28_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); + self.w + } +} +#[doc = "Pin 29\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN29_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN29_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN29` reader - Pin 29"] +pub struct PIN29_R(crate::FieldReader); +impl PIN29_R { + pub(crate) fn new(bits: bool) -> Self { + PIN29_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN29_A { + match self.bits { + false => PIN29_A::LOW, + true => PIN29_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN29_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN29_A::HIGH + } +} +impl core::ops::Deref for PIN29_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN29` writer - Pin 29"] +pub struct PIN29_W<'a> { + w: &'a mut W, +} +impl<'a> PIN29_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN29_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN29_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN29_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); + self.w + } +} +#[doc = "Pin 30\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN30_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN30_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN30` reader - Pin 30"] +pub struct PIN30_R(crate::FieldReader); +impl PIN30_R { + pub(crate) fn new(bits: bool) -> Self { + PIN30_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN30_A { + match self.bits { + false => PIN30_A::LOW, + true => PIN30_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN30_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN30_A::HIGH + } +} +impl core::ops::Deref for PIN30_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN30` writer - Pin 30"] +pub struct PIN30_W<'a> { + w: &'a mut W, +} +impl<'a> PIN30_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN30_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN30_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN30_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); + self.w + } +} +#[doc = "Pin 31\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN31_A { + #[doc = "0: Pin driver is low"] + LOW = 0, + #[doc = "1: Pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN31_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN31` reader - Pin 31"] +pub struct PIN31_R(crate::FieldReader); +impl PIN31_R { + pub(crate) fn new(bits: bool) -> Self { + PIN31_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN31_A { + match self.bits { + false => PIN31_A::LOW, + true => PIN31_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN31_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN31_A::HIGH + } +} +impl core::ops::Deref for PIN31_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN31` writer - Pin 31"] +pub struct PIN31_W<'a> { + w: &'a mut W, +} +impl<'a> PIN31_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN31_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pin driver is low"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(PIN31_A::LOW) + } + #[doc = "Pin driver is high"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(PIN31_A::HIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bit 0 - Pin 0"] + #[inline(always)] + pub fn pin0(&self) -> PIN0_R { + PIN0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Pin 1"] + #[inline(always)] + pub fn pin1(&self) -> PIN1_R { + PIN1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Pin 2"] + #[inline(always)] + pub fn pin2(&self) -> PIN2_R { + PIN2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Pin 3"] + #[inline(always)] + pub fn pin3(&self) -> PIN3_R { + PIN3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Pin 4"] + #[inline(always)] + pub fn pin4(&self) -> PIN4_R { + PIN4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Pin 5"] + #[inline(always)] + pub fn pin5(&self) -> PIN5_R { + PIN5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Pin 6"] + #[inline(always)] + pub fn pin6(&self) -> PIN6_R { + PIN6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Pin 7"] + #[inline(always)] + pub fn pin7(&self) -> PIN7_R { + PIN7_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Pin 8"] + #[inline(always)] + pub fn pin8(&self) -> PIN8_R { + PIN8_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Pin 9"] + #[inline(always)] + pub fn pin9(&self) -> PIN9_R { + PIN9_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Pin 10"] + #[inline(always)] + pub fn pin10(&self) -> PIN10_R { + PIN10_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Pin 11"] + #[inline(always)] + pub fn pin11(&self) -> PIN11_R { + PIN11_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Pin 12"] + #[inline(always)] + pub fn pin12(&self) -> PIN12_R { + PIN12_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Pin 13"] + #[inline(always)] + pub fn pin13(&self) -> PIN13_R { + PIN13_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Pin 14"] + #[inline(always)] + pub fn pin14(&self) -> PIN14_R { + PIN14_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Pin 15"] + #[inline(always)] + pub fn pin15(&self) -> PIN15_R { + PIN15_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Pin 16"] + #[inline(always)] + pub fn pin16(&self) -> PIN16_R { + PIN16_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Pin 17"] + #[inline(always)] + pub fn pin17(&self) -> PIN17_R { + PIN17_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Pin 18"] + #[inline(always)] + pub fn pin18(&self) -> PIN18_R { + PIN18_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Pin 19"] + #[inline(always)] + pub fn pin19(&self) -> PIN19_R { + PIN19_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Pin 20"] + #[inline(always)] + pub fn pin20(&self) -> PIN20_R { + PIN20_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 21 - Pin 21"] + #[inline(always)] + pub fn pin21(&self) -> PIN21_R { + PIN21_R::new(((self.bits >> 21) & 0x01) != 0) + } + #[doc = "Bit 22 - Pin 22"] + #[inline(always)] + pub fn pin22(&self) -> PIN22_R { + PIN22_R::new(((self.bits >> 22) & 0x01) != 0) + } + #[doc = "Bit 23 - Pin 23"] + #[inline(always)] + pub fn pin23(&self) -> PIN23_R { + PIN23_R::new(((self.bits >> 23) & 0x01) != 0) + } + #[doc = "Bit 24 - Pin 24"] + #[inline(always)] + pub fn pin24(&self) -> PIN24_R { + PIN24_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Pin 25"] + #[inline(always)] + pub fn pin25(&self) -> PIN25_R { + PIN25_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Pin 26"] + #[inline(always)] + pub fn pin26(&self) -> PIN26_R { + PIN26_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Pin 27"] + #[inline(always)] + pub fn pin27(&self) -> PIN27_R { + PIN27_R::new(((self.bits >> 27) & 0x01) != 0) + } + #[doc = "Bit 28 - Pin 28"] + #[inline(always)] + pub fn pin28(&self) -> PIN28_R { + PIN28_R::new(((self.bits >> 28) & 0x01) != 0) + } + #[doc = "Bit 29 - Pin 29"] + #[inline(always)] + pub fn pin29(&self) -> PIN29_R { + PIN29_R::new(((self.bits >> 29) & 0x01) != 0) + } + #[doc = "Bit 30 - Pin 30"] + #[inline(always)] + pub fn pin30(&self) -> PIN30_R { + PIN30_R::new(((self.bits >> 30) & 0x01) != 0) + } + #[doc = "Bit 31 - Pin 31"] + #[inline(always)] + pub fn pin31(&self) -> PIN31_R { + PIN31_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Pin 0"] + #[inline(always)] + pub fn pin0(&mut self) -> PIN0_W { + PIN0_W { w: self } + } + #[doc = "Bit 1 - Pin 1"] + #[inline(always)] + pub fn pin1(&mut self) -> PIN1_W { + PIN1_W { w: self } + } + #[doc = "Bit 2 - Pin 2"] + #[inline(always)] + pub fn pin2(&mut self) -> PIN2_W { + PIN2_W { w: self } + } + #[doc = "Bit 3 - Pin 3"] + #[inline(always)] + pub fn pin3(&mut self) -> PIN3_W { + PIN3_W { w: self } + } + #[doc = "Bit 4 - Pin 4"] + #[inline(always)] + pub fn pin4(&mut self) -> PIN4_W { + PIN4_W { w: self } + } + #[doc = "Bit 5 - Pin 5"] + #[inline(always)] + pub fn pin5(&mut self) -> PIN5_W { + PIN5_W { w: self } + } + #[doc = "Bit 6 - Pin 6"] + #[inline(always)] + pub fn pin6(&mut self) -> PIN6_W { + PIN6_W { w: self } + } + #[doc = "Bit 7 - Pin 7"] + #[inline(always)] + pub fn pin7(&mut self) -> PIN7_W { + PIN7_W { w: self } + } + #[doc = "Bit 8 - Pin 8"] + #[inline(always)] + pub fn pin8(&mut self) -> PIN8_W { + PIN8_W { w: self } + } + #[doc = "Bit 9 - Pin 9"] + #[inline(always)] + pub fn pin9(&mut self) -> PIN9_W { + PIN9_W { w: self } + } + #[doc = "Bit 10 - Pin 10"] + #[inline(always)] + pub fn pin10(&mut self) -> PIN10_W { + PIN10_W { w: self } + } + #[doc = "Bit 11 - Pin 11"] + #[inline(always)] + pub fn pin11(&mut self) -> PIN11_W { + PIN11_W { w: self } + } + #[doc = "Bit 12 - Pin 12"] + #[inline(always)] + pub fn pin12(&mut self) -> PIN12_W { + PIN12_W { w: self } + } + #[doc = "Bit 13 - Pin 13"] + #[inline(always)] + pub fn pin13(&mut self) -> PIN13_W { + PIN13_W { w: self } + } + #[doc = "Bit 14 - Pin 14"] + #[inline(always)] + pub fn pin14(&mut self) -> PIN14_W { + PIN14_W { w: self } + } + #[doc = "Bit 15 - Pin 15"] + #[inline(always)] + pub fn pin15(&mut self) -> PIN15_W { + PIN15_W { w: self } + } + #[doc = "Bit 16 - Pin 16"] + #[inline(always)] + pub fn pin16(&mut self) -> PIN16_W { + PIN16_W { w: self } + } + #[doc = "Bit 17 - Pin 17"] + #[inline(always)] + pub fn pin17(&mut self) -> PIN17_W { + PIN17_W { w: self } + } + #[doc = "Bit 18 - Pin 18"] + #[inline(always)] + pub fn pin18(&mut self) -> PIN18_W { + PIN18_W { w: self } + } + #[doc = "Bit 19 - Pin 19"] + #[inline(always)] + pub fn pin19(&mut self) -> PIN19_W { + PIN19_W { w: self } + } + #[doc = "Bit 20 - Pin 20"] + #[inline(always)] + pub fn pin20(&mut self) -> PIN20_W { + PIN20_W { w: self } + } + #[doc = "Bit 21 - Pin 21"] + #[inline(always)] + pub fn pin21(&mut self) -> PIN21_W { + PIN21_W { w: self } + } + #[doc = "Bit 22 - Pin 22"] + #[inline(always)] + pub fn pin22(&mut self) -> PIN22_W { + PIN22_W { w: self } + } + #[doc = "Bit 23 - Pin 23"] + #[inline(always)] + pub fn pin23(&mut self) -> PIN23_W { + PIN23_W { w: self } + } + #[doc = "Bit 24 - Pin 24"] + #[inline(always)] + pub fn pin24(&mut self) -> PIN24_W { + PIN24_W { w: self } + } + #[doc = "Bit 25 - Pin 25"] + #[inline(always)] + pub fn pin25(&mut self) -> PIN25_W { + PIN25_W { w: self } + } + #[doc = "Bit 26 - Pin 26"] + #[inline(always)] + pub fn pin26(&mut self) -> PIN26_W { + PIN26_W { w: self } + } + #[doc = "Bit 27 - Pin 27"] + #[inline(always)] + pub fn pin27(&mut self) -> PIN27_W { + PIN27_W { w: self } + } + #[doc = "Bit 28 - Pin 28"] + #[inline(always)] + pub fn pin28(&mut self) -> PIN28_W { + PIN28_W { w: self } + } + #[doc = "Bit 29 - Pin 29"] + #[inline(always)] + pub fn pin29(&mut self) -> PIN29_W { + PIN29_W { w: self } + } + #[doc = "Bit 30 - Pin 30"] + #[inline(always)] + pub fn pin30(&mut self) -> PIN30_W { + PIN30_W { w: self } + } + #[doc = "Bit 31 - Pin 31"] + #[inline(always)] + pub fn pin31(&mut self) -> PIN31_W { + PIN31_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Write GPIO port\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [out](index.html) module"] +pub struct OUT_SPEC; +impl crate::RegisterSpec for OUT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [out::R](R) reader structure"] +impl crate::Readable for OUT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [out::W](W) writer structure"] +impl crate::Writable for OUT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets OUT to value 0"] +impl crate::Resettable for OUT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/p0/outclr.rs b/src/p0/outclr.rs new file mode 100644 index 0000000..5247d8c --- /dev/null +++ b/src/p0/outclr.rs @@ -0,0 +1,3266 @@ +#[doc = "Register `OUTCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `OUTCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Pin 0\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN0_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN0` reader - Pin 0"] +pub struct PIN0_R(crate::FieldReader); +impl PIN0_R { + pub(crate) fn new(bits: bool) -> Self { + PIN0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN0_A { + match self.bits { + false => PIN0_A::LOW, + true => PIN0_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN0_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN0_A::HIGH + } +} +impl core::ops::Deref for PIN0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 0\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN0_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN0_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN0` writer - Pin 0"] +pub struct PIN0_W<'a> { + w: &'a mut W, +} +impl<'a> PIN0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN0_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN0_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Pin 1\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN1_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN1` reader - Pin 1"] +pub struct PIN1_R(crate::FieldReader); +impl PIN1_R { + pub(crate) fn new(bits: bool) -> Self { + PIN1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN1_A { + match self.bits { + false => PIN1_A::LOW, + true => PIN1_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN1_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN1_A::HIGH + } +} +impl core::ops::Deref for PIN1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 1\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN1_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN1_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN1` writer - Pin 1"] +pub struct PIN1_W<'a> { + w: &'a mut W, +} +impl<'a> PIN1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN1_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN1_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Pin 2\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN2_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN2` reader - Pin 2"] +pub struct PIN2_R(crate::FieldReader); +impl PIN2_R { + pub(crate) fn new(bits: bool) -> Self { + PIN2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN2_A { + match self.bits { + false => PIN2_A::LOW, + true => PIN2_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN2_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN2_A::HIGH + } +} +impl core::ops::Deref for PIN2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 2\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN2_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN2_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN2` writer - Pin 2"] +pub struct PIN2_W<'a> { + w: &'a mut W, +} +impl<'a> PIN2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN2_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN2_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Pin 3\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN3_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN3` reader - Pin 3"] +pub struct PIN3_R(crate::FieldReader); +impl PIN3_R { + pub(crate) fn new(bits: bool) -> Self { + PIN3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN3_A { + match self.bits { + false => PIN3_A::LOW, + true => PIN3_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN3_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN3_A::HIGH + } +} +impl core::ops::Deref for PIN3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 3\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN3_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN3_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN3` writer - Pin 3"] +pub struct PIN3_W<'a> { + w: &'a mut W, +} +impl<'a> PIN3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN3_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN3_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Pin 4\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN4_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN4_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN4` reader - Pin 4"] +pub struct PIN4_R(crate::FieldReader); +impl PIN4_R { + pub(crate) fn new(bits: bool) -> Self { + PIN4_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN4_A { + match self.bits { + false => PIN4_A::LOW, + true => PIN4_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN4_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN4_A::HIGH + } +} +impl core::ops::Deref for PIN4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 4\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN4_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN4_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN4` writer - Pin 4"] +pub struct PIN4_W<'a> { + w: &'a mut W, +} +impl<'a> PIN4_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN4_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN4_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Pin 5\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN5_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN5_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN5` reader - Pin 5"] +pub struct PIN5_R(crate::FieldReader); +impl PIN5_R { + pub(crate) fn new(bits: bool) -> Self { + PIN5_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN5_A { + match self.bits { + false => PIN5_A::LOW, + true => PIN5_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN5_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN5_A::HIGH + } +} +impl core::ops::Deref for PIN5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 5\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN5_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN5_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN5` writer - Pin 5"] +pub struct PIN5_W<'a> { + w: &'a mut W, +} +impl<'a> PIN5_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN5_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN5_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Pin 6\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN6_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN6_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN6` reader - Pin 6"] +pub struct PIN6_R(crate::FieldReader); +impl PIN6_R { + pub(crate) fn new(bits: bool) -> Self { + PIN6_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN6_A { + match self.bits { + false => PIN6_A::LOW, + true => PIN6_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN6_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN6_A::HIGH + } +} +impl core::ops::Deref for PIN6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 6\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN6_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN6_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN6` writer - Pin 6"] +pub struct PIN6_W<'a> { + w: &'a mut W, +} +impl<'a> PIN6_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN6_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN6_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Pin 7\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN7_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN7_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN7` reader - Pin 7"] +pub struct PIN7_R(crate::FieldReader); +impl PIN7_R { + pub(crate) fn new(bits: bool) -> Self { + PIN7_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN7_A { + match self.bits { + false => PIN7_A::LOW, + true => PIN7_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN7_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN7_A::HIGH + } +} +impl core::ops::Deref for PIN7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 7\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN7_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN7_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN7` writer - Pin 7"] +pub struct PIN7_W<'a> { + w: &'a mut W, +} +impl<'a> PIN7_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN7_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN7_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Pin 8\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN8_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN8_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN8` reader - Pin 8"] +pub struct PIN8_R(crate::FieldReader); +impl PIN8_R { + pub(crate) fn new(bits: bool) -> Self { + PIN8_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN8_A { + match self.bits { + false => PIN8_A::LOW, + true => PIN8_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN8_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN8_A::HIGH + } +} +impl core::ops::Deref for PIN8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 8\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN8_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN8_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN8` writer - Pin 8"] +pub struct PIN8_W<'a> { + w: &'a mut W, +} +impl<'a> PIN8_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN8_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN8_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Pin 9\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN9_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN9_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN9` reader - Pin 9"] +pub struct PIN9_R(crate::FieldReader); +impl PIN9_R { + pub(crate) fn new(bits: bool) -> Self { + PIN9_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN9_A { + match self.bits { + false => PIN9_A::LOW, + true => PIN9_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN9_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN9_A::HIGH + } +} +impl core::ops::Deref for PIN9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 9\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN9_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN9_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN9` writer - Pin 9"] +pub struct PIN9_W<'a> { + w: &'a mut W, +} +impl<'a> PIN9_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN9_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN9_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Pin 10\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN10_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN10_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN10` reader - Pin 10"] +pub struct PIN10_R(crate::FieldReader); +impl PIN10_R { + pub(crate) fn new(bits: bool) -> Self { + PIN10_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN10_A { + match self.bits { + false => PIN10_A::LOW, + true => PIN10_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN10_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN10_A::HIGH + } +} +impl core::ops::Deref for PIN10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 10\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN10_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN10_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN10` writer - Pin 10"] +pub struct PIN10_W<'a> { + w: &'a mut W, +} +impl<'a> PIN10_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN10_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN10_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Pin 11\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN11_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN11_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN11` reader - Pin 11"] +pub struct PIN11_R(crate::FieldReader); +impl PIN11_R { + pub(crate) fn new(bits: bool) -> Self { + PIN11_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN11_A { + match self.bits { + false => PIN11_A::LOW, + true => PIN11_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN11_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN11_A::HIGH + } +} +impl core::ops::Deref for PIN11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 11\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN11_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN11_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN11` writer - Pin 11"] +pub struct PIN11_W<'a> { + w: &'a mut W, +} +impl<'a> PIN11_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN11_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN11_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Pin 12\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN12_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN12_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN12` reader - Pin 12"] +pub struct PIN12_R(crate::FieldReader); +impl PIN12_R { + pub(crate) fn new(bits: bool) -> Self { + PIN12_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN12_A { + match self.bits { + false => PIN12_A::LOW, + true => PIN12_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN12_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN12_A::HIGH + } +} +impl core::ops::Deref for PIN12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 12\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN12_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN12_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN12` writer - Pin 12"] +pub struct PIN12_W<'a> { + w: &'a mut W, +} +impl<'a> PIN12_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN12_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN12_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Pin 13\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN13_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN13_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN13` reader - Pin 13"] +pub struct PIN13_R(crate::FieldReader); +impl PIN13_R { + pub(crate) fn new(bits: bool) -> Self { + PIN13_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN13_A { + match self.bits { + false => PIN13_A::LOW, + true => PIN13_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN13_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN13_A::HIGH + } +} +impl core::ops::Deref for PIN13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 13\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN13_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN13_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN13` writer - Pin 13"] +pub struct PIN13_W<'a> { + w: &'a mut W, +} +impl<'a> PIN13_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN13_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN13_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Pin 14\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN14_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN14_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN14` reader - Pin 14"] +pub struct PIN14_R(crate::FieldReader); +impl PIN14_R { + pub(crate) fn new(bits: bool) -> Self { + PIN14_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN14_A { + match self.bits { + false => PIN14_A::LOW, + true => PIN14_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN14_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN14_A::HIGH + } +} +impl core::ops::Deref for PIN14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 14\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN14_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN14_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN14` writer - Pin 14"] +pub struct PIN14_W<'a> { + w: &'a mut W, +} +impl<'a> PIN14_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN14_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN14_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Pin 15\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN15_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN15_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN15` reader - Pin 15"] +pub struct PIN15_R(crate::FieldReader); +impl PIN15_R { + pub(crate) fn new(bits: bool) -> Self { + PIN15_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN15_A { + match self.bits { + false => PIN15_A::LOW, + true => PIN15_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN15_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN15_A::HIGH + } +} +impl core::ops::Deref for PIN15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 15\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN15_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN15_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN15` writer - Pin 15"] +pub struct PIN15_W<'a> { + w: &'a mut W, +} +impl<'a> PIN15_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN15_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN15_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Pin 16\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN16_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN16_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN16` reader - Pin 16"] +pub struct PIN16_R(crate::FieldReader); +impl PIN16_R { + pub(crate) fn new(bits: bool) -> Self { + PIN16_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN16_A { + match self.bits { + false => PIN16_A::LOW, + true => PIN16_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN16_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN16_A::HIGH + } +} +impl core::ops::Deref for PIN16_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 16\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN16_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN16_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN16` writer - Pin 16"] +pub struct PIN16_W<'a> { + w: &'a mut W, +} +impl<'a> PIN16_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN16_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN16_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Pin 17\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN17_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN17_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN17` reader - Pin 17"] +pub struct PIN17_R(crate::FieldReader); +impl PIN17_R { + pub(crate) fn new(bits: bool) -> Self { + PIN17_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN17_A { + match self.bits { + false => PIN17_A::LOW, + true => PIN17_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN17_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN17_A::HIGH + } +} +impl core::ops::Deref for PIN17_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 17\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN17_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN17_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN17` writer - Pin 17"] +pub struct PIN17_W<'a> { + w: &'a mut W, +} +impl<'a> PIN17_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN17_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN17_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Pin 18\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN18_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN18_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN18` reader - Pin 18"] +pub struct PIN18_R(crate::FieldReader); +impl PIN18_R { + pub(crate) fn new(bits: bool) -> Self { + PIN18_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN18_A { + match self.bits { + false => PIN18_A::LOW, + true => PIN18_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN18_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN18_A::HIGH + } +} +impl core::ops::Deref for PIN18_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 18\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN18_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN18_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN18` writer - Pin 18"] +pub struct PIN18_W<'a> { + w: &'a mut W, +} +impl<'a> PIN18_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN18_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN18_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Pin 19\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN19_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN19_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN19` reader - Pin 19"] +pub struct PIN19_R(crate::FieldReader); +impl PIN19_R { + pub(crate) fn new(bits: bool) -> Self { + PIN19_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN19_A { + match self.bits { + false => PIN19_A::LOW, + true => PIN19_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN19_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN19_A::HIGH + } +} +impl core::ops::Deref for PIN19_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 19\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN19_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN19_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN19` writer - Pin 19"] +pub struct PIN19_W<'a> { + w: &'a mut W, +} +impl<'a> PIN19_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN19_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN19_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Pin 20\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN20_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN20_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN20` reader - Pin 20"] +pub struct PIN20_R(crate::FieldReader); +impl PIN20_R { + pub(crate) fn new(bits: bool) -> Self { + PIN20_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN20_A { + match self.bits { + false => PIN20_A::LOW, + true => PIN20_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN20_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN20_A::HIGH + } +} +impl core::ops::Deref for PIN20_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 20\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN20_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN20_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN20` writer - Pin 20"] +pub struct PIN20_W<'a> { + w: &'a mut W, +} +impl<'a> PIN20_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN20_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN20_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Pin 21\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN21_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN21_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN21` reader - Pin 21"] +pub struct PIN21_R(crate::FieldReader); +impl PIN21_R { + pub(crate) fn new(bits: bool) -> Self { + PIN21_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN21_A { + match self.bits { + false => PIN21_A::LOW, + true => PIN21_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN21_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN21_A::HIGH + } +} +impl core::ops::Deref for PIN21_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 21\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN21_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN21_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN21` writer - Pin 21"] +pub struct PIN21_W<'a> { + w: &'a mut W, +} +impl<'a> PIN21_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN21_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN21_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); + self.w + } +} +#[doc = "Pin 22\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN22_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN22_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN22` reader - Pin 22"] +pub struct PIN22_R(crate::FieldReader); +impl PIN22_R { + pub(crate) fn new(bits: bool) -> Self { + PIN22_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN22_A { + match self.bits { + false => PIN22_A::LOW, + true => PIN22_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN22_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN22_A::HIGH + } +} +impl core::ops::Deref for PIN22_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 22\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN22_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN22_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN22` writer - Pin 22"] +pub struct PIN22_W<'a> { + w: &'a mut W, +} +impl<'a> PIN22_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN22_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN22_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); + self.w + } +} +#[doc = "Pin 23\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN23_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN23_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN23` reader - Pin 23"] +pub struct PIN23_R(crate::FieldReader); +impl PIN23_R { + pub(crate) fn new(bits: bool) -> Self { + PIN23_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN23_A { + match self.bits { + false => PIN23_A::LOW, + true => PIN23_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN23_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN23_A::HIGH + } +} +impl core::ops::Deref for PIN23_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 23\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN23_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN23_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN23` writer - Pin 23"] +pub struct PIN23_W<'a> { + w: &'a mut W, +} +impl<'a> PIN23_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN23_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN23_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); + self.w + } +} +#[doc = "Pin 24\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN24_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN24_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN24` reader - Pin 24"] +pub struct PIN24_R(crate::FieldReader); +impl PIN24_R { + pub(crate) fn new(bits: bool) -> Self { + PIN24_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN24_A { + match self.bits { + false => PIN24_A::LOW, + true => PIN24_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN24_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN24_A::HIGH + } +} +impl core::ops::Deref for PIN24_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 24\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN24_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN24_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN24` writer - Pin 24"] +pub struct PIN24_W<'a> { + w: &'a mut W, +} +impl<'a> PIN24_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN24_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN24_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Pin 25\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN25_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN25_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN25` reader - Pin 25"] +pub struct PIN25_R(crate::FieldReader); +impl PIN25_R { + pub(crate) fn new(bits: bool) -> Self { + PIN25_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN25_A { + match self.bits { + false => PIN25_A::LOW, + true => PIN25_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN25_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN25_A::HIGH + } +} +impl core::ops::Deref for PIN25_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 25\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN25_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN25_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN25` writer - Pin 25"] +pub struct PIN25_W<'a> { + w: &'a mut W, +} +impl<'a> PIN25_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN25_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN25_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Pin 26\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN26_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN26_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN26` reader - Pin 26"] +pub struct PIN26_R(crate::FieldReader); +impl PIN26_R { + pub(crate) fn new(bits: bool) -> Self { + PIN26_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN26_A { + match self.bits { + false => PIN26_A::LOW, + true => PIN26_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN26_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN26_A::HIGH + } +} +impl core::ops::Deref for PIN26_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 26\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN26_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN26_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN26` writer - Pin 26"] +pub struct PIN26_W<'a> { + w: &'a mut W, +} +impl<'a> PIN26_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN26_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN26_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Pin 27\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN27_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN27_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN27` reader - Pin 27"] +pub struct PIN27_R(crate::FieldReader); +impl PIN27_R { + pub(crate) fn new(bits: bool) -> Self { + PIN27_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN27_A { + match self.bits { + false => PIN27_A::LOW, + true => PIN27_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN27_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN27_A::HIGH + } +} +impl core::ops::Deref for PIN27_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 27\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN27_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN27_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN27` writer - Pin 27"] +pub struct PIN27_W<'a> { + w: &'a mut W, +} +impl<'a> PIN27_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN27_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN27_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +#[doc = "Pin 28\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN28_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN28_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN28` reader - Pin 28"] +pub struct PIN28_R(crate::FieldReader); +impl PIN28_R { + pub(crate) fn new(bits: bool) -> Self { + PIN28_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN28_A { + match self.bits { + false => PIN28_A::LOW, + true => PIN28_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN28_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN28_A::HIGH + } +} +impl core::ops::Deref for PIN28_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 28\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN28_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN28_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN28` writer - Pin 28"] +pub struct PIN28_W<'a> { + w: &'a mut W, +} +impl<'a> PIN28_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN28_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN28_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); + self.w + } +} +#[doc = "Pin 29\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN29_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN29_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN29` reader - Pin 29"] +pub struct PIN29_R(crate::FieldReader); +impl PIN29_R { + pub(crate) fn new(bits: bool) -> Self { + PIN29_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN29_A { + match self.bits { + false => PIN29_A::LOW, + true => PIN29_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN29_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN29_A::HIGH + } +} +impl core::ops::Deref for PIN29_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 29\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN29_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN29_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN29` writer - Pin 29"] +pub struct PIN29_W<'a> { + w: &'a mut W, +} +impl<'a> PIN29_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN29_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN29_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); + self.w + } +} +#[doc = "Pin 30\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN30_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN30_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN30` reader - Pin 30"] +pub struct PIN30_R(crate::FieldReader); +impl PIN30_R { + pub(crate) fn new(bits: bool) -> Self { + PIN30_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN30_A { + match self.bits { + false => PIN30_A::LOW, + true => PIN30_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN30_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN30_A::HIGH + } +} +impl core::ops::Deref for PIN30_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 30\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN30_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN30_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN30` writer - Pin 30"] +pub struct PIN30_W<'a> { + w: &'a mut W, +} +impl<'a> PIN30_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN30_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN30_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); + self.w + } +} +#[doc = "Pin 31\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN31_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN31_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN31` reader - Pin 31"] +pub struct PIN31_R(crate::FieldReader); +impl PIN31_R { + pub(crate) fn new(bits: bool) -> Self { + PIN31_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN31_A { + match self.bits { + false => PIN31_A::LOW, + true => PIN31_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN31_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN31_A::HIGH + } +} +impl core::ops::Deref for PIN31_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 31\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN31_AW { + #[doc = "1: Write: writing a '1' sets the pin low; writing a '0' has no effect"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN31_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN31` writer - Pin 31"] +pub struct PIN31_W<'a> { + w: &'a mut W, +} +impl<'a> PIN31_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN31_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin low; writing a '0' has no effect"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PIN31_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bit 0 - Pin 0"] + #[inline(always)] + pub fn pin0(&self) -> PIN0_R { + PIN0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Pin 1"] + #[inline(always)] + pub fn pin1(&self) -> PIN1_R { + PIN1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Pin 2"] + #[inline(always)] + pub fn pin2(&self) -> PIN2_R { + PIN2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Pin 3"] + #[inline(always)] + pub fn pin3(&self) -> PIN3_R { + PIN3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Pin 4"] + #[inline(always)] + pub fn pin4(&self) -> PIN4_R { + PIN4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Pin 5"] + #[inline(always)] + pub fn pin5(&self) -> PIN5_R { + PIN5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Pin 6"] + #[inline(always)] + pub fn pin6(&self) -> PIN6_R { + PIN6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Pin 7"] + #[inline(always)] + pub fn pin7(&self) -> PIN7_R { + PIN7_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Pin 8"] + #[inline(always)] + pub fn pin8(&self) -> PIN8_R { + PIN8_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Pin 9"] + #[inline(always)] + pub fn pin9(&self) -> PIN9_R { + PIN9_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Pin 10"] + #[inline(always)] + pub fn pin10(&self) -> PIN10_R { + PIN10_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Pin 11"] + #[inline(always)] + pub fn pin11(&self) -> PIN11_R { + PIN11_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Pin 12"] + #[inline(always)] + pub fn pin12(&self) -> PIN12_R { + PIN12_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Pin 13"] + #[inline(always)] + pub fn pin13(&self) -> PIN13_R { + PIN13_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Pin 14"] + #[inline(always)] + pub fn pin14(&self) -> PIN14_R { + PIN14_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Pin 15"] + #[inline(always)] + pub fn pin15(&self) -> PIN15_R { + PIN15_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Pin 16"] + #[inline(always)] + pub fn pin16(&self) -> PIN16_R { + PIN16_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Pin 17"] + #[inline(always)] + pub fn pin17(&self) -> PIN17_R { + PIN17_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Pin 18"] + #[inline(always)] + pub fn pin18(&self) -> PIN18_R { + PIN18_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Pin 19"] + #[inline(always)] + pub fn pin19(&self) -> PIN19_R { + PIN19_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Pin 20"] + #[inline(always)] + pub fn pin20(&self) -> PIN20_R { + PIN20_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 21 - Pin 21"] + #[inline(always)] + pub fn pin21(&self) -> PIN21_R { + PIN21_R::new(((self.bits >> 21) & 0x01) != 0) + } + #[doc = "Bit 22 - Pin 22"] + #[inline(always)] + pub fn pin22(&self) -> PIN22_R { + PIN22_R::new(((self.bits >> 22) & 0x01) != 0) + } + #[doc = "Bit 23 - Pin 23"] + #[inline(always)] + pub fn pin23(&self) -> PIN23_R { + PIN23_R::new(((self.bits >> 23) & 0x01) != 0) + } + #[doc = "Bit 24 - Pin 24"] + #[inline(always)] + pub fn pin24(&self) -> PIN24_R { + PIN24_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Pin 25"] + #[inline(always)] + pub fn pin25(&self) -> PIN25_R { + PIN25_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Pin 26"] + #[inline(always)] + pub fn pin26(&self) -> PIN26_R { + PIN26_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Pin 27"] + #[inline(always)] + pub fn pin27(&self) -> PIN27_R { + PIN27_R::new(((self.bits >> 27) & 0x01) != 0) + } + #[doc = "Bit 28 - Pin 28"] + #[inline(always)] + pub fn pin28(&self) -> PIN28_R { + PIN28_R::new(((self.bits >> 28) & 0x01) != 0) + } + #[doc = "Bit 29 - Pin 29"] + #[inline(always)] + pub fn pin29(&self) -> PIN29_R { + PIN29_R::new(((self.bits >> 29) & 0x01) != 0) + } + #[doc = "Bit 30 - Pin 30"] + #[inline(always)] + pub fn pin30(&self) -> PIN30_R { + PIN30_R::new(((self.bits >> 30) & 0x01) != 0) + } + #[doc = "Bit 31 - Pin 31"] + #[inline(always)] + pub fn pin31(&self) -> PIN31_R { + PIN31_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Pin 0"] + #[inline(always)] + pub fn pin0(&mut self) -> PIN0_W { + PIN0_W { w: self } + } + #[doc = "Bit 1 - Pin 1"] + #[inline(always)] + pub fn pin1(&mut self) -> PIN1_W { + PIN1_W { w: self } + } + #[doc = "Bit 2 - Pin 2"] + #[inline(always)] + pub fn pin2(&mut self) -> PIN2_W { + PIN2_W { w: self } + } + #[doc = "Bit 3 - Pin 3"] + #[inline(always)] + pub fn pin3(&mut self) -> PIN3_W { + PIN3_W { w: self } + } + #[doc = "Bit 4 - Pin 4"] + #[inline(always)] + pub fn pin4(&mut self) -> PIN4_W { + PIN4_W { w: self } + } + #[doc = "Bit 5 - Pin 5"] + #[inline(always)] + pub fn pin5(&mut self) -> PIN5_W { + PIN5_W { w: self } + } + #[doc = "Bit 6 - Pin 6"] + #[inline(always)] + pub fn pin6(&mut self) -> PIN6_W { + PIN6_W { w: self } + } + #[doc = "Bit 7 - Pin 7"] + #[inline(always)] + pub fn pin7(&mut self) -> PIN7_W { + PIN7_W { w: self } + } + #[doc = "Bit 8 - Pin 8"] + #[inline(always)] + pub fn pin8(&mut self) -> PIN8_W { + PIN8_W { w: self } + } + #[doc = "Bit 9 - Pin 9"] + #[inline(always)] + pub fn pin9(&mut self) -> PIN9_W { + PIN9_W { w: self } + } + #[doc = "Bit 10 - Pin 10"] + #[inline(always)] + pub fn pin10(&mut self) -> PIN10_W { + PIN10_W { w: self } + } + #[doc = "Bit 11 - Pin 11"] + #[inline(always)] + pub fn pin11(&mut self) -> PIN11_W { + PIN11_W { w: self } + } + #[doc = "Bit 12 - Pin 12"] + #[inline(always)] + pub fn pin12(&mut self) -> PIN12_W { + PIN12_W { w: self } + } + #[doc = "Bit 13 - Pin 13"] + #[inline(always)] + pub fn pin13(&mut self) -> PIN13_W { + PIN13_W { w: self } + } + #[doc = "Bit 14 - Pin 14"] + #[inline(always)] + pub fn pin14(&mut self) -> PIN14_W { + PIN14_W { w: self } + } + #[doc = "Bit 15 - Pin 15"] + #[inline(always)] + pub fn pin15(&mut self) -> PIN15_W { + PIN15_W { w: self } + } + #[doc = "Bit 16 - Pin 16"] + #[inline(always)] + pub fn pin16(&mut self) -> PIN16_W { + PIN16_W { w: self } + } + #[doc = "Bit 17 - Pin 17"] + #[inline(always)] + pub fn pin17(&mut self) -> PIN17_W { + PIN17_W { w: self } + } + #[doc = "Bit 18 - Pin 18"] + #[inline(always)] + pub fn pin18(&mut self) -> PIN18_W { + PIN18_W { w: self } + } + #[doc = "Bit 19 - Pin 19"] + #[inline(always)] + pub fn pin19(&mut self) -> PIN19_W { + PIN19_W { w: self } + } + #[doc = "Bit 20 - Pin 20"] + #[inline(always)] + pub fn pin20(&mut self) -> PIN20_W { + PIN20_W { w: self } + } + #[doc = "Bit 21 - Pin 21"] + #[inline(always)] + pub fn pin21(&mut self) -> PIN21_W { + PIN21_W { w: self } + } + #[doc = "Bit 22 - Pin 22"] + #[inline(always)] + pub fn pin22(&mut self) -> PIN22_W { + PIN22_W { w: self } + } + #[doc = "Bit 23 - Pin 23"] + #[inline(always)] + pub fn pin23(&mut self) -> PIN23_W { + PIN23_W { w: self } + } + #[doc = "Bit 24 - Pin 24"] + #[inline(always)] + pub fn pin24(&mut self) -> PIN24_W { + PIN24_W { w: self } + } + #[doc = "Bit 25 - Pin 25"] + #[inline(always)] + pub fn pin25(&mut self) -> PIN25_W { + PIN25_W { w: self } + } + #[doc = "Bit 26 - Pin 26"] + #[inline(always)] + pub fn pin26(&mut self) -> PIN26_W { + PIN26_W { w: self } + } + #[doc = "Bit 27 - Pin 27"] + #[inline(always)] + pub fn pin27(&mut self) -> PIN27_W { + PIN27_W { w: self } + } + #[doc = "Bit 28 - Pin 28"] + #[inline(always)] + pub fn pin28(&mut self) -> PIN28_W { + PIN28_W { w: self } + } + #[doc = "Bit 29 - Pin 29"] + #[inline(always)] + pub fn pin29(&mut self) -> PIN29_W { + PIN29_W { w: self } + } + #[doc = "Bit 30 - Pin 30"] + #[inline(always)] + pub fn pin30(&mut self) -> PIN30_W { + PIN30_W { w: self } + } + #[doc = "Bit 31 - Pin 31"] + #[inline(always)] + pub fn pin31(&mut self) -> PIN31_W { + PIN31_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Clear individual bits in GPIO port\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [outclr](index.html) module"] +pub struct OUTCLR_SPEC; +impl crate::RegisterSpec for OUTCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [outclr::R](R) reader structure"] +impl crate::Readable for OUTCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [outclr::W](W) writer structure"] +impl crate::Writable for OUTCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets OUTCLR to value 0"] +impl crate::Resettable for OUTCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/p0/outset.rs b/src/p0/outset.rs new file mode 100644 index 0000000..700d9c0 --- /dev/null +++ b/src/p0/outset.rs @@ -0,0 +1,3266 @@ +#[doc = "Register `OUTSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `OUTSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Pin 0\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN0_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN0` reader - Pin 0"] +pub struct PIN0_R(crate::FieldReader); +impl PIN0_R { + pub(crate) fn new(bits: bool) -> Self { + PIN0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN0_A { + match self.bits { + false => PIN0_A::LOW, + true => PIN0_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN0_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN0_A::HIGH + } +} +impl core::ops::Deref for PIN0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 0\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN0_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN0_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN0` writer - Pin 0"] +pub struct PIN0_W<'a> { + w: &'a mut W, +} +impl<'a> PIN0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN0_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN0_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Pin 1\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN1_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN1` reader - Pin 1"] +pub struct PIN1_R(crate::FieldReader); +impl PIN1_R { + pub(crate) fn new(bits: bool) -> Self { + PIN1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN1_A { + match self.bits { + false => PIN1_A::LOW, + true => PIN1_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN1_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN1_A::HIGH + } +} +impl core::ops::Deref for PIN1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 1\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN1_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN1_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN1` writer - Pin 1"] +pub struct PIN1_W<'a> { + w: &'a mut W, +} +impl<'a> PIN1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN1_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN1_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Pin 2\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN2_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN2` reader - Pin 2"] +pub struct PIN2_R(crate::FieldReader); +impl PIN2_R { + pub(crate) fn new(bits: bool) -> Self { + PIN2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN2_A { + match self.bits { + false => PIN2_A::LOW, + true => PIN2_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN2_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN2_A::HIGH + } +} +impl core::ops::Deref for PIN2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 2\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN2_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN2_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN2` writer - Pin 2"] +pub struct PIN2_W<'a> { + w: &'a mut W, +} +impl<'a> PIN2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN2_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN2_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Pin 3\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN3_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN3` reader - Pin 3"] +pub struct PIN3_R(crate::FieldReader); +impl PIN3_R { + pub(crate) fn new(bits: bool) -> Self { + PIN3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN3_A { + match self.bits { + false => PIN3_A::LOW, + true => PIN3_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN3_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN3_A::HIGH + } +} +impl core::ops::Deref for PIN3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 3\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN3_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN3_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN3` writer - Pin 3"] +pub struct PIN3_W<'a> { + w: &'a mut W, +} +impl<'a> PIN3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN3_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN3_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Pin 4\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN4_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN4_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN4` reader - Pin 4"] +pub struct PIN4_R(crate::FieldReader); +impl PIN4_R { + pub(crate) fn new(bits: bool) -> Self { + PIN4_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN4_A { + match self.bits { + false => PIN4_A::LOW, + true => PIN4_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN4_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN4_A::HIGH + } +} +impl core::ops::Deref for PIN4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 4\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN4_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN4_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN4` writer - Pin 4"] +pub struct PIN4_W<'a> { + w: &'a mut W, +} +impl<'a> PIN4_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN4_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN4_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Pin 5\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN5_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN5_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN5` reader - Pin 5"] +pub struct PIN5_R(crate::FieldReader); +impl PIN5_R { + pub(crate) fn new(bits: bool) -> Self { + PIN5_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN5_A { + match self.bits { + false => PIN5_A::LOW, + true => PIN5_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN5_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN5_A::HIGH + } +} +impl core::ops::Deref for PIN5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 5\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN5_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN5_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN5` writer - Pin 5"] +pub struct PIN5_W<'a> { + w: &'a mut W, +} +impl<'a> PIN5_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN5_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN5_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Pin 6\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN6_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN6_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN6` reader - Pin 6"] +pub struct PIN6_R(crate::FieldReader); +impl PIN6_R { + pub(crate) fn new(bits: bool) -> Self { + PIN6_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN6_A { + match self.bits { + false => PIN6_A::LOW, + true => PIN6_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN6_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN6_A::HIGH + } +} +impl core::ops::Deref for PIN6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 6\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN6_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN6_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN6` writer - Pin 6"] +pub struct PIN6_W<'a> { + w: &'a mut W, +} +impl<'a> PIN6_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN6_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN6_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Pin 7\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN7_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN7_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN7` reader - Pin 7"] +pub struct PIN7_R(crate::FieldReader); +impl PIN7_R { + pub(crate) fn new(bits: bool) -> Self { + PIN7_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN7_A { + match self.bits { + false => PIN7_A::LOW, + true => PIN7_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN7_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN7_A::HIGH + } +} +impl core::ops::Deref for PIN7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 7\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN7_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN7_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN7` writer - Pin 7"] +pub struct PIN7_W<'a> { + w: &'a mut W, +} +impl<'a> PIN7_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN7_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN7_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Pin 8\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN8_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN8_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN8` reader - Pin 8"] +pub struct PIN8_R(crate::FieldReader); +impl PIN8_R { + pub(crate) fn new(bits: bool) -> Self { + PIN8_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN8_A { + match self.bits { + false => PIN8_A::LOW, + true => PIN8_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN8_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN8_A::HIGH + } +} +impl core::ops::Deref for PIN8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 8\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN8_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN8_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN8` writer - Pin 8"] +pub struct PIN8_W<'a> { + w: &'a mut W, +} +impl<'a> PIN8_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN8_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN8_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Pin 9\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN9_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN9_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN9` reader - Pin 9"] +pub struct PIN9_R(crate::FieldReader); +impl PIN9_R { + pub(crate) fn new(bits: bool) -> Self { + PIN9_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN9_A { + match self.bits { + false => PIN9_A::LOW, + true => PIN9_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN9_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN9_A::HIGH + } +} +impl core::ops::Deref for PIN9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 9\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN9_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN9_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN9` writer - Pin 9"] +pub struct PIN9_W<'a> { + w: &'a mut W, +} +impl<'a> PIN9_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN9_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN9_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Pin 10\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN10_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN10_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN10` reader - Pin 10"] +pub struct PIN10_R(crate::FieldReader); +impl PIN10_R { + pub(crate) fn new(bits: bool) -> Self { + PIN10_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN10_A { + match self.bits { + false => PIN10_A::LOW, + true => PIN10_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN10_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN10_A::HIGH + } +} +impl core::ops::Deref for PIN10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 10\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN10_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN10_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN10` writer - Pin 10"] +pub struct PIN10_W<'a> { + w: &'a mut W, +} +impl<'a> PIN10_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN10_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN10_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Pin 11\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN11_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN11_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN11` reader - Pin 11"] +pub struct PIN11_R(crate::FieldReader); +impl PIN11_R { + pub(crate) fn new(bits: bool) -> Self { + PIN11_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN11_A { + match self.bits { + false => PIN11_A::LOW, + true => PIN11_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN11_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN11_A::HIGH + } +} +impl core::ops::Deref for PIN11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 11\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN11_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN11_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN11` writer - Pin 11"] +pub struct PIN11_W<'a> { + w: &'a mut W, +} +impl<'a> PIN11_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN11_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN11_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Pin 12\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN12_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN12_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN12` reader - Pin 12"] +pub struct PIN12_R(crate::FieldReader); +impl PIN12_R { + pub(crate) fn new(bits: bool) -> Self { + PIN12_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN12_A { + match self.bits { + false => PIN12_A::LOW, + true => PIN12_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN12_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN12_A::HIGH + } +} +impl core::ops::Deref for PIN12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 12\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN12_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN12_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN12` writer - Pin 12"] +pub struct PIN12_W<'a> { + w: &'a mut W, +} +impl<'a> PIN12_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN12_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN12_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Pin 13\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN13_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN13_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN13` reader - Pin 13"] +pub struct PIN13_R(crate::FieldReader); +impl PIN13_R { + pub(crate) fn new(bits: bool) -> Self { + PIN13_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN13_A { + match self.bits { + false => PIN13_A::LOW, + true => PIN13_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN13_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN13_A::HIGH + } +} +impl core::ops::Deref for PIN13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 13\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN13_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN13_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN13` writer - Pin 13"] +pub struct PIN13_W<'a> { + w: &'a mut W, +} +impl<'a> PIN13_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN13_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN13_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Pin 14\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN14_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN14_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN14` reader - Pin 14"] +pub struct PIN14_R(crate::FieldReader); +impl PIN14_R { + pub(crate) fn new(bits: bool) -> Self { + PIN14_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN14_A { + match self.bits { + false => PIN14_A::LOW, + true => PIN14_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN14_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN14_A::HIGH + } +} +impl core::ops::Deref for PIN14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 14\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN14_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN14_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN14` writer - Pin 14"] +pub struct PIN14_W<'a> { + w: &'a mut W, +} +impl<'a> PIN14_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN14_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN14_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Pin 15\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN15_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN15_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN15` reader - Pin 15"] +pub struct PIN15_R(crate::FieldReader); +impl PIN15_R { + pub(crate) fn new(bits: bool) -> Self { + PIN15_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN15_A { + match self.bits { + false => PIN15_A::LOW, + true => PIN15_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN15_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN15_A::HIGH + } +} +impl core::ops::Deref for PIN15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 15\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN15_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN15_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN15` writer - Pin 15"] +pub struct PIN15_W<'a> { + w: &'a mut W, +} +impl<'a> PIN15_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN15_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN15_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Pin 16\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN16_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN16_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN16` reader - Pin 16"] +pub struct PIN16_R(crate::FieldReader); +impl PIN16_R { + pub(crate) fn new(bits: bool) -> Self { + PIN16_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN16_A { + match self.bits { + false => PIN16_A::LOW, + true => PIN16_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN16_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN16_A::HIGH + } +} +impl core::ops::Deref for PIN16_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 16\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN16_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN16_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN16` writer - Pin 16"] +pub struct PIN16_W<'a> { + w: &'a mut W, +} +impl<'a> PIN16_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN16_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN16_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Pin 17\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN17_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN17_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN17` reader - Pin 17"] +pub struct PIN17_R(crate::FieldReader); +impl PIN17_R { + pub(crate) fn new(bits: bool) -> Self { + PIN17_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN17_A { + match self.bits { + false => PIN17_A::LOW, + true => PIN17_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN17_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN17_A::HIGH + } +} +impl core::ops::Deref for PIN17_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 17\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN17_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN17_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN17` writer - Pin 17"] +pub struct PIN17_W<'a> { + w: &'a mut W, +} +impl<'a> PIN17_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN17_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN17_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Pin 18\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN18_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN18_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN18` reader - Pin 18"] +pub struct PIN18_R(crate::FieldReader); +impl PIN18_R { + pub(crate) fn new(bits: bool) -> Self { + PIN18_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN18_A { + match self.bits { + false => PIN18_A::LOW, + true => PIN18_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN18_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN18_A::HIGH + } +} +impl core::ops::Deref for PIN18_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 18\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN18_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN18_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN18` writer - Pin 18"] +pub struct PIN18_W<'a> { + w: &'a mut W, +} +impl<'a> PIN18_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN18_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN18_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Pin 19\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN19_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN19_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN19` reader - Pin 19"] +pub struct PIN19_R(crate::FieldReader); +impl PIN19_R { + pub(crate) fn new(bits: bool) -> Self { + PIN19_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN19_A { + match self.bits { + false => PIN19_A::LOW, + true => PIN19_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN19_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN19_A::HIGH + } +} +impl core::ops::Deref for PIN19_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 19\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN19_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN19_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN19` writer - Pin 19"] +pub struct PIN19_W<'a> { + w: &'a mut W, +} +impl<'a> PIN19_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN19_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN19_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Pin 20\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN20_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN20_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN20` reader - Pin 20"] +pub struct PIN20_R(crate::FieldReader); +impl PIN20_R { + pub(crate) fn new(bits: bool) -> Self { + PIN20_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN20_A { + match self.bits { + false => PIN20_A::LOW, + true => PIN20_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN20_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN20_A::HIGH + } +} +impl core::ops::Deref for PIN20_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 20\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN20_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN20_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN20` writer - Pin 20"] +pub struct PIN20_W<'a> { + w: &'a mut W, +} +impl<'a> PIN20_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN20_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN20_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Pin 21\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN21_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN21_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN21` reader - Pin 21"] +pub struct PIN21_R(crate::FieldReader); +impl PIN21_R { + pub(crate) fn new(bits: bool) -> Self { + PIN21_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN21_A { + match self.bits { + false => PIN21_A::LOW, + true => PIN21_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN21_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN21_A::HIGH + } +} +impl core::ops::Deref for PIN21_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 21\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN21_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN21_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN21` writer - Pin 21"] +pub struct PIN21_W<'a> { + w: &'a mut W, +} +impl<'a> PIN21_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN21_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN21_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); + self.w + } +} +#[doc = "Pin 22\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN22_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN22_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN22` reader - Pin 22"] +pub struct PIN22_R(crate::FieldReader); +impl PIN22_R { + pub(crate) fn new(bits: bool) -> Self { + PIN22_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN22_A { + match self.bits { + false => PIN22_A::LOW, + true => PIN22_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN22_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN22_A::HIGH + } +} +impl core::ops::Deref for PIN22_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 22\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN22_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN22_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN22` writer - Pin 22"] +pub struct PIN22_W<'a> { + w: &'a mut W, +} +impl<'a> PIN22_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN22_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN22_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); + self.w + } +} +#[doc = "Pin 23\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN23_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN23_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN23` reader - Pin 23"] +pub struct PIN23_R(crate::FieldReader); +impl PIN23_R { + pub(crate) fn new(bits: bool) -> Self { + PIN23_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN23_A { + match self.bits { + false => PIN23_A::LOW, + true => PIN23_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN23_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN23_A::HIGH + } +} +impl core::ops::Deref for PIN23_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 23\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN23_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN23_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN23` writer - Pin 23"] +pub struct PIN23_W<'a> { + w: &'a mut W, +} +impl<'a> PIN23_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN23_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN23_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); + self.w + } +} +#[doc = "Pin 24\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN24_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN24_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN24` reader - Pin 24"] +pub struct PIN24_R(crate::FieldReader); +impl PIN24_R { + pub(crate) fn new(bits: bool) -> Self { + PIN24_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN24_A { + match self.bits { + false => PIN24_A::LOW, + true => PIN24_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN24_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN24_A::HIGH + } +} +impl core::ops::Deref for PIN24_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 24\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN24_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN24_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN24` writer - Pin 24"] +pub struct PIN24_W<'a> { + w: &'a mut W, +} +impl<'a> PIN24_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN24_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN24_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Pin 25\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN25_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN25_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN25` reader - Pin 25"] +pub struct PIN25_R(crate::FieldReader); +impl PIN25_R { + pub(crate) fn new(bits: bool) -> Self { + PIN25_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN25_A { + match self.bits { + false => PIN25_A::LOW, + true => PIN25_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN25_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN25_A::HIGH + } +} +impl core::ops::Deref for PIN25_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 25\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN25_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN25_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN25` writer - Pin 25"] +pub struct PIN25_W<'a> { + w: &'a mut W, +} +impl<'a> PIN25_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN25_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN25_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Pin 26\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN26_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN26_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN26` reader - Pin 26"] +pub struct PIN26_R(crate::FieldReader); +impl PIN26_R { + pub(crate) fn new(bits: bool) -> Self { + PIN26_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN26_A { + match self.bits { + false => PIN26_A::LOW, + true => PIN26_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN26_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN26_A::HIGH + } +} +impl core::ops::Deref for PIN26_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 26\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN26_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN26_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN26` writer - Pin 26"] +pub struct PIN26_W<'a> { + w: &'a mut W, +} +impl<'a> PIN26_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN26_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN26_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Pin 27\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN27_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN27_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN27` reader - Pin 27"] +pub struct PIN27_R(crate::FieldReader); +impl PIN27_R { + pub(crate) fn new(bits: bool) -> Self { + PIN27_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN27_A { + match self.bits { + false => PIN27_A::LOW, + true => PIN27_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN27_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN27_A::HIGH + } +} +impl core::ops::Deref for PIN27_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 27\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN27_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN27_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN27` writer - Pin 27"] +pub struct PIN27_W<'a> { + w: &'a mut W, +} +impl<'a> PIN27_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN27_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN27_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +#[doc = "Pin 28\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN28_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN28_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN28` reader - Pin 28"] +pub struct PIN28_R(crate::FieldReader); +impl PIN28_R { + pub(crate) fn new(bits: bool) -> Self { + PIN28_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN28_A { + match self.bits { + false => PIN28_A::LOW, + true => PIN28_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN28_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN28_A::HIGH + } +} +impl core::ops::Deref for PIN28_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 28\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN28_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN28_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN28` writer - Pin 28"] +pub struct PIN28_W<'a> { + w: &'a mut W, +} +impl<'a> PIN28_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN28_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN28_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); + self.w + } +} +#[doc = "Pin 29\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN29_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN29_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN29` reader - Pin 29"] +pub struct PIN29_R(crate::FieldReader); +impl PIN29_R { + pub(crate) fn new(bits: bool) -> Self { + PIN29_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN29_A { + match self.bits { + false => PIN29_A::LOW, + true => PIN29_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN29_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN29_A::HIGH + } +} +impl core::ops::Deref for PIN29_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 29\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN29_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN29_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN29` writer - Pin 29"] +pub struct PIN29_W<'a> { + w: &'a mut W, +} +impl<'a> PIN29_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN29_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN29_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); + self.w + } +} +#[doc = "Pin 30\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN30_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN30_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN30` reader - Pin 30"] +pub struct PIN30_R(crate::FieldReader); +impl PIN30_R { + pub(crate) fn new(bits: bool) -> Self { + PIN30_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN30_A { + match self.bits { + false => PIN30_A::LOW, + true => PIN30_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN30_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN30_A::HIGH + } +} +impl core::ops::Deref for PIN30_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 30\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN30_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN30_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN30` writer - Pin 30"] +pub struct PIN30_W<'a> { + w: &'a mut W, +} +impl<'a> PIN30_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN30_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN30_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); + self.w + } +} +#[doc = "Pin 31\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN31_A { + #[doc = "0: Read: pin driver is low"] + LOW = 0, + #[doc = "1: Read: pin driver is high"] + HIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN31_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN31` reader - Pin 31"] +pub struct PIN31_R(crate::FieldReader); +impl PIN31_R { + pub(crate) fn new(bits: bool) -> Self { + PIN31_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PIN31_A { + match self.bits { + false => PIN31_A::LOW, + true => PIN31_A::HIGH, + } + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == PIN31_A::LOW + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == PIN31_A::HIGH + } +} +impl core::ops::Deref for PIN31_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Pin 31\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PIN31_AW { + #[doc = "1: Write: writing a '1' sets the pin high; writing a '0' has no effect"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PIN31_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PIN31` writer - Pin 31"] +pub struct PIN31_W<'a> { + w: &'a mut W, +} +impl<'a> PIN31_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PIN31_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: writing a '1' sets the pin high; writing a '0' has no effect"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PIN31_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bit 0 - Pin 0"] + #[inline(always)] + pub fn pin0(&self) -> PIN0_R { + PIN0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Pin 1"] + #[inline(always)] + pub fn pin1(&self) -> PIN1_R { + PIN1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Pin 2"] + #[inline(always)] + pub fn pin2(&self) -> PIN2_R { + PIN2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Pin 3"] + #[inline(always)] + pub fn pin3(&self) -> PIN3_R { + PIN3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Pin 4"] + #[inline(always)] + pub fn pin4(&self) -> PIN4_R { + PIN4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Pin 5"] + #[inline(always)] + pub fn pin5(&self) -> PIN5_R { + PIN5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Pin 6"] + #[inline(always)] + pub fn pin6(&self) -> PIN6_R { + PIN6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Pin 7"] + #[inline(always)] + pub fn pin7(&self) -> PIN7_R { + PIN7_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Pin 8"] + #[inline(always)] + pub fn pin8(&self) -> PIN8_R { + PIN8_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Pin 9"] + #[inline(always)] + pub fn pin9(&self) -> PIN9_R { + PIN9_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Pin 10"] + #[inline(always)] + pub fn pin10(&self) -> PIN10_R { + PIN10_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Pin 11"] + #[inline(always)] + pub fn pin11(&self) -> PIN11_R { + PIN11_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Pin 12"] + #[inline(always)] + pub fn pin12(&self) -> PIN12_R { + PIN12_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Pin 13"] + #[inline(always)] + pub fn pin13(&self) -> PIN13_R { + PIN13_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Pin 14"] + #[inline(always)] + pub fn pin14(&self) -> PIN14_R { + PIN14_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Pin 15"] + #[inline(always)] + pub fn pin15(&self) -> PIN15_R { + PIN15_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Pin 16"] + #[inline(always)] + pub fn pin16(&self) -> PIN16_R { + PIN16_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Pin 17"] + #[inline(always)] + pub fn pin17(&self) -> PIN17_R { + PIN17_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Pin 18"] + #[inline(always)] + pub fn pin18(&self) -> PIN18_R { + PIN18_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Pin 19"] + #[inline(always)] + pub fn pin19(&self) -> PIN19_R { + PIN19_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Pin 20"] + #[inline(always)] + pub fn pin20(&self) -> PIN20_R { + PIN20_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 21 - Pin 21"] + #[inline(always)] + pub fn pin21(&self) -> PIN21_R { + PIN21_R::new(((self.bits >> 21) & 0x01) != 0) + } + #[doc = "Bit 22 - Pin 22"] + #[inline(always)] + pub fn pin22(&self) -> PIN22_R { + PIN22_R::new(((self.bits >> 22) & 0x01) != 0) + } + #[doc = "Bit 23 - Pin 23"] + #[inline(always)] + pub fn pin23(&self) -> PIN23_R { + PIN23_R::new(((self.bits >> 23) & 0x01) != 0) + } + #[doc = "Bit 24 - Pin 24"] + #[inline(always)] + pub fn pin24(&self) -> PIN24_R { + PIN24_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Pin 25"] + #[inline(always)] + pub fn pin25(&self) -> PIN25_R { + PIN25_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Pin 26"] + #[inline(always)] + pub fn pin26(&self) -> PIN26_R { + PIN26_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Pin 27"] + #[inline(always)] + pub fn pin27(&self) -> PIN27_R { + PIN27_R::new(((self.bits >> 27) & 0x01) != 0) + } + #[doc = "Bit 28 - Pin 28"] + #[inline(always)] + pub fn pin28(&self) -> PIN28_R { + PIN28_R::new(((self.bits >> 28) & 0x01) != 0) + } + #[doc = "Bit 29 - Pin 29"] + #[inline(always)] + pub fn pin29(&self) -> PIN29_R { + PIN29_R::new(((self.bits >> 29) & 0x01) != 0) + } + #[doc = "Bit 30 - Pin 30"] + #[inline(always)] + pub fn pin30(&self) -> PIN30_R { + PIN30_R::new(((self.bits >> 30) & 0x01) != 0) + } + #[doc = "Bit 31 - Pin 31"] + #[inline(always)] + pub fn pin31(&self) -> PIN31_R { + PIN31_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Pin 0"] + #[inline(always)] + pub fn pin0(&mut self) -> PIN0_W { + PIN0_W { w: self } + } + #[doc = "Bit 1 - Pin 1"] + #[inline(always)] + pub fn pin1(&mut self) -> PIN1_W { + PIN1_W { w: self } + } + #[doc = "Bit 2 - Pin 2"] + #[inline(always)] + pub fn pin2(&mut self) -> PIN2_W { + PIN2_W { w: self } + } + #[doc = "Bit 3 - Pin 3"] + #[inline(always)] + pub fn pin3(&mut self) -> PIN3_W { + PIN3_W { w: self } + } + #[doc = "Bit 4 - Pin 4"] + #[inline(always)] + pub fn pin4(&mut self) -> PIN4_W { + PIN4_W { w: self } + } + #[doc = "Bit 5 - Pin 5"] + #[inline(always)] + pub fn pin5(&mut self) -> PIN5_W { + PIN5_W { w: self } + } + #[doc = "Bit 6 - Pin 6"] + #[inline(always)] + pub fn pin6(&mut self) -> PIN6_W { + PIN6_W { w: self } + } + #[doc = "Bit 7 - Pin 7"] + #[inline(always)] + pub fn pin7(&mut self) -> PIN7_W { + PIN7_W { w: self } + } + #[doc = "Bit 8 - Pin 8"] + #[inline(always)] + pub fn pin8(&mut self) -> PIN8_W { + PIN8_W { w: self } + } + #[doc = "Bit 9 - Pin 9"] + #[inline(always)] + pub fn pin9(&mut self) -> PIN9_W { + PIN9_W { w: self } + } + #[doc = "Bit 10 - Pin 10"] + #[inline(always)] + pub fn pin10(&mut self) -> PIN10_W { + PIN10_W { w: self } + } + #[doc = "Bit 11 - Pin 11"] + #[inline(always)] + pub fn pin11(&mut self) -> PIN11_W { + PIN11_W { w: self } + } + #[doc = "Bit 12 - Pin 12"] + #[inline(always)] + pub fn pin12(&mut self) -> PIN12_W { + PIN12_W { w: self } + } + #[doc = "Bit 13 - Pin 13"] + #[inline(always)] + pub fn pin13(&mut self) -> PIN13_W { + PIN13_W { w: self } + } + #[doc = "Bit 14 - Pin 14"] + #[inline(always)] + pub fn pin14(&mut self) -> PIN14_W { + PIN14_W { w: self } + } + #[doc = "Bit 15 - Pin 15"] + #[inline(always)] + pub fn pin15(&mut self) -> PIN15_W { + PIN15_W { w: self } + } + #[doc = "Bit 16 - Pin 16"] + #[inline(always)] + pub fn pin16(&mut self) -> PIN16_W { + PIN16_W { w: self } + } + #[doc = "Bit 17 - Pin 17"] + #[inline(always)] + pub fn pin17(&mut self) -> PIN17_W { + PIN17_W { w: self } + } + #[doc = "Bit 18 - Pin 18"] + #[inline(always)] + pub fn pin18(&mut self) -> PIN18_W { + PIN18_W { w: self } + } + #[doc = "Bit 19 - Pin 19"] + #[inline(always)] + pub fn pin19(&mut self) -> PIN19_W { + PIN19_W { w: self } + } + #[doc = "Bit 20 - Pin 20"] + #[inline(always)] + pub fn pin20(&mut self) -> PIN20_W { + PIN20_W { w: self } + } + #[doc = "Bit 21 - Pin 21"] + #[inline(always)] + pub fn pin21(&mut self) -> PIN21_W { + PIN21_W { w: self } + } + #[doc = "Bit 22 - Pin 22"] + #[inline(always)] + pub fn pin22(&mut self) -> PIN22_W { + PIN22_W { w: self } + } + #[doc = "Bit 23 - Pin 23"] + #[inline(always)] + pub fn pin23(&mut self) -> PIN23_W { + PIN23_W { w: self } + } + #[doc = "Bit 24 - Pin 24"] + #[inline(always)] + pub fn pin24(&mut self) -> PIN24_W { + PIN24_W { w: self } + } + #[doc = "Bit 25 - Pin 25"] + #[inline(always)] + pub fn pin25(&mut self) -> PIN25_W { + PIN25_W { w: self } + } + #[doc = "Bit 26 - Pin 26"] + #[inline(always)] + pub fn pin26(&mut self) -> PIN26_W { + PIN26_W { w: self } + } + #[doc = "Bit 27 - Pin 27"] + #[inline(always)] + pub fn pin27(&mut self) -> PIN27_W { + PIN27_W { w: self } + } + #[doc = "Bit 28 - Pin 28"] + #[inline(always)] + pub fn pin28(&mut self) -> PIN28_W { + PIN28_W { w: self } + } + #[doc = "Bit 29 - Pin 29"] + #[inline(always)] + pub fn pin29(&mut self) -> PIN29_W { + PIN29_W { w: self } + } + #[doc = "Bit 30 - Pin 30"] + #[inline(always)] + pub fn pin30(&mut self) -> PIN30_W { + PIN30_W { w: self } + } + #[doc = "Bit 31 - Pin 31"] + #[inline(always)] + pub fn pin31(&mut self) -> PIN31_W { + PIN31_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Set individual bits in GPIO port\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [outset](index.html) module"] +pub struct OUTSET_SPEC; +impl crate::RegisterSpec for OUTSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [outset::R](R) reader structure"] +impl crate::Readable for OUTSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [outset::W](W) writer structure"] +impl crate::Writable for OUTSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets OUTSET to value 0"] +impl crate::Resettable for OUTSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/p0/pin_cnf.rs b/src/p0/pin_cnf.rs new file mode 100644 index 0000000..c4cda92 --- /dev/null +++ b/src/p0/pin_cnf.rs @@ -0,0 +1,612 @@ +#[doc = "Register `PIN_CNF[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PIN_CNF[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Pin direction. Same physical register as DIR register\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DIR_A { + #[doc = "0: Configure pin as an input pin"] + INPUT = 0, + #[doc = "1: Configure pin as an output pin"] + OUTPUT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DIR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DIR` reader - Pin direction. Same physical register as DIR register"] +pub struct DIR_R(crate::FieldReader); +impl DIR_R { + pub(crate) fn new(bits: bool) -> Self { + DIR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DIR_A { + match self.bits { + false => DIR_A::INPUT, + true => DIR_A::OUTPUT, + } + } + #[doc = "Checks if the value of the field is `INPUT`"] + #[inline(always)] + pub fn is_input(&self) -> bool { + **self == DIR_A::INPUT + } + #[doc = "Checks if the value of the field is `OUTPUT`"] + #[inline(always)] + pub fn is_output(&self) -> bool { + **self == DIR_A::OUTPUT + } +} +impl core::ops::Deref for DIR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DIR` writer - Pin direction. Same physical register as DIR register"] +pub struct DIR_W<'a> { + w: &'a mut W, +} +impl<'a> DIR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DIR_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Configure pin as an input pin"] + #[inline(always)] + pub fn input(self) -> &'a mut W { + self.variant(DIR_A::INPUT) + } + #[doc = "Configure pin as an output pin"] + #[inline(always)] + pub fn output(self) -> &'a mut W { + self.variant(DIR_A::OUTPUT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Connect or disconnect input buffer\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum INPUT_A { + #[doc = "0: Connect input buffer"] + CONNECT = 0, + #[doc = "1: Disconnect input buffer"] + DISCONNECT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: INPUT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `INPUT` reader - Connect or disconnect input buffer"] +pub struct INPUT_R(crate::FieldReader); +impl INPUT_R { + pub(crate) fn new(bits: bool) -> Self { + INPUT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> INPUT_A { + match self.bits { + false => INPUT_A::CONNECT, + true => INPUT_A::DISCONNECT, + } + } + #[doc = "Checks if the value of the field is `CONNECT`"] + #[inline(always)] + pub fn is_connect(&self) -> bool { + **self == INPUT_A::CONNECT + } + #[doc = "Checks if the value of the field is `DISCONNECT`"] + #[inline(always)] + pub fn is_disconnect(&self) -> bool { + **self == INPUT_A::DISCONNECT + } +} +impl core::ops::Deref for INPUT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `INPUT` writer - Connect or disconnect input buffer"] +pub struct INPUT_W<'a> { + w: &'a mut W, +} +impl<'a> INPUT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: INPUT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Connect input buffer"] + #[inline(always)] + pub fn connect(self) -> &'a mut W { + self.variant(INPUT_A::CONNECT) + } + #[doc = "Disconnect input buffer"] + #[inline(always)] + pub fn disconnect(self) -> &'a mut W { + self.variant(INPUT_A::DISCONNECT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Pull configuration\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum PULL_A { + #[doc = "0: No pull"] + DISABLED = 0, + #[doc = "1: Pull down on pin"] + PULLDOWN = 1, + #[doc = "3: Pull up on pin"] + PULLUP = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: PULL_A) -> Self { + variant as _ + } +} +#[doc = "Field `PULL` reader - Pull configuration"] +pub struct PULL_R(crate::FieldReader); +impl PULL_R { + pub(crate) fn new(bits: u8) -> Self { + PULL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(PULL_A::DISABLED), + 1 => Some(PULL_A::PULLDOWN), + 3 => Some(PULL_A::PULLUP), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PULL_A::DISABLED + } + #[doc = "Checks if the value of the field is `PULLDOWN`"] + #[inline(always)] + pub fn is_pulldown(&self) -> bool { + **self == PULL_A::PULLDOWN + } + #[doc = "Checks if the value of the field is `PULLUP`"] + #[inline(always)] + pub fn is_pullup(&self) -> bool { + **self == PULL_A::PULLUP + } +} +impl core::ops::Deref for PULL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PULL` writer - Pull configuration"] +pub struct PULL_W<'a> { + w: &'a mut W, +} +impl<'a> PULL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PULL_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "No pull"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(PULL_A::DISABLED) + } + #[doc = "Pull down on pin"] + #[inline(always)] + pub fn pulldown(self) -> &'a mut W { + self.variant(PULL_A::PULLDOWN) + } + #[doc = "Pull up on pin"] + #[inline(always)] + pub fn pullup(self) -> &'a mut W { + self.variant(PULL_A::PULLUP) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x03 << 2)) | ((value as u32 & 0x03) << 2); + self.w + } +} +#[doc = "Drive configuration\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum DRIVE_A { + #[doc = "0: Standard '0', standard '1'"] + S0S1 = 0, + #[doc = "1: High drive '0', standard '1'"] + H0S1 = 1, + #[doc = "2: Standard '0', high drive '1'"] + S0H1 = 2, + #[doc = "3: High drive '0', high 'drive '1''"] + H0H1 = 3, + #[doc = "4: Disconnect '0' standard '1' (normally used for wired-or connections)"] + D0S1 = 4, + #[doc = "5: Disconnect '0', high drive '1' (normally used for wired-or connections)"] + D0H1 = 5, + #[doc = "6: Standard '0'. disconnect '1' (normally used for wired-and connections)"] + S0D1 = 6, + #[doc = "7: High drive '0', disconnect '1' (normally used for wired-and connections)"] + H0D1 = 7, +} +impl From for u8 { + #[inline(always)] + fn from(variant: DRIVE_A) -> Self { + variant as _ + } +} +#[doc = "Field `DRIVE` reader - Drive configuration"] +pub struct DRIVE_R(crate::FieldReader); +impl DRIVE_R { + pub(crate) fn new(bits: u8) -> Self { + DRIVE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DRIVE_A { + match self.bits { + 0 => DRIVE_A::S0S1, + 1 => DRIVE_A::H0S1, + 2 => DRIVE_A::S0H1, + 3 => DRIVE_A::H0H1, + 4 => DRIVE_A::D0S1, + 5 => DRIVE_A::D0H1, + 6 => DRIVE_A::S0D1, + 7 => DRIVE_A::H0D1, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `S0S1`"] + #[inline(always)] + pub fn is_s0s1(&self) -> bool { + **self == DRIVE_A::S0S1 + } + #[doc = "Checks if the value of the field is `H0S1`"] + #[inline(always)] + pub fn is_h0s1(&self) -> bool { + **self == DRIVE_A::H0S1 + } + #[doc = "Checks if the value of the field is `S0H1`"] + #[inline(always)] + pub fn is_s0h1(&self) -> bool { + **self == DRIVE_A::S0H1 + } + #[doc = "Checks if the value of the field is `H0H1`"] + #[inline(always)] + pub fn is_h0h1(&self) -> bool { + **self == DRIVE_A::H0H1 + } + #[doc = "Checks if the value of the field is `D0S1`"] + #[inline(always)] + pub fn is_d0s1(&self) -> bool { + **self == DRIVE_A::D0S1 + } + #[doc = "Checks if the value of the field is `D0H1`"] + #[inline(always)] + pub fn is_d0h1(&self) -> bool { + **self == DRIVE_A::D0H1 + } + #[doc = "Checks if the value of the field is `S0D1`"] + #[inline(always)] + pub fn is_s0d1(&self) -> bool { + **self == DRIVE_A::S0D1 + } + #[doc = "Checks if the value of the field is `H0D1`"] + #[inline(always)] + pub fn is_h0d1(&self) -> bool { + **self == DRIVE_A::H0D1 + } +} +impl core::ops::Deref for DRIVE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DRIVE` writer - Drive configuration"] +pub struct DRIVE_W<'a> { + w: &'a mut W, +} +impl<'a> DRIVE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DRIVE_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "Standard '0', standard '1'"] + #[inline(always)] + pub fn s0s1(self) -> &'a mut W { + self.variant(DRIVE_A::S0S1) + } + #[doc = "High drive '0', standard '1'"] + #[inline(always)] + pub fn h0s1(self) -> &'a mut W { + self.variant(DRIVE_A::H0S1) + } + #[doc = "Standard '0', high drive '1'"] + #[inline(always)] + pub fn s0h1(self) -> &'a mut W { + self.variant(DRIVE_A::S0H1) + } + #[doc = "High drive '0', high 'drive '1''"] + #[inline(always)] + pub fn h0h1(self) -> &'a mut W { + self.variant(DRIVE_A::H0H1) + } + #[doc = "Disconnect '0' standard '1' (normally used for wired-or connections)"] + #[inline(always)] + pub fn d0s1(self) -> &'a mut W { + self.variant(DRIVE_A::D0S1) + } + #[doc = "Disconnect '0', high drive '1' (normally used for wired-or connections)"] + #[inline(always)] + pub fn d0h1(self) -> &'a mut W { + self.variant(DRIVE_A::D0H1) + } + #[doc = "Standard '0'. disconnect '1' (normally used for wired-and connections)"] + #[inline(always)] + pub fn s0d1(self) -> &'a mut W { + self.variant(DRIVE_A::S0D1) + } + #[doc = "High drive '0', disconnect '1' (normally used for wired-and connections)"] + #[inline(always)] + pub fn h0d1(self) -> &'a mut W { + self.variant(DRIVE_A::H0D1) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x07 << 8)) | ((value as u32 & 0x07) << 8); + self.w + } +} +#[doc = "Pin sensing mechanism\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum SENSE_A { + #[doc = "0: Disabled"] + DISABLED = 0, + #[doc = "2: Sense for high level"] + HIGH = 2, + #[doc = "3: Sense for low level"] + LOW = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: SENSE_A) -> Self { + variant as _ + } +} +#[doc = "Field `SENSE` reader - Pin sensing mechanism"] +pub struct SENSE_R(crate::FieldReader); +impl SENSE_R { + pub(crate) fn new(bits: u8) -> Self { + SENSE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(SENSE_A::DISABLED), + 2 => Some(SENSE_A::HIGH), + 3 => Some(SENSE_A::LOW), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SENSE_A::DISABLED + } + #[doc = "Checks if the value of the field is `HIGH`"] + #[inline(always)] + pub fn is_high(&self) -> bool { + **self == SENSE_A::HIGH + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == SENSE_A::LOW + } +} +impl core::ops::Deref for SENSE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SENSE` writer - Pin sensing mechanism"] +pub struct SENSE_W<'a> { + w: &'a mut W, +} +impl<'a> SENSE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SENSE_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(SENSE_A::DISABLED) + } + #[doc = "Sense for high level"] + #[inline(always)] + pub fn high(self) -> &'a mut W { + self.variant(SENSE_A::HIGH) + } + #[doc = "Sense for low level"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(SENSE_A::LOW) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x03 << 16)) | ((value as u32 & 0x03) << 16); + self.w + } +} +impl R { + #[doc = "Bit 0 - Pin direction. Same physical register as DIR register"] + #[inline(always)] + pub fn dir(&self) -> DIR_R { + DIR_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Connect or disconnect input buffer"] + #[inline(always)] + pub fn input(&self) -> INPUT_R { + INPUT_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bits 2:3 - Pull configuration"] + #[inline(always)] + pub fn pull(&self) -> PULL_R { + PULL_R::new(((self.bits >> 2) & 0x03) as u8) + } + #[doc = "Bits 8:10 - Drive configuration"] + #[inline(always)] + pub fn drive(&self) -> DRIVE_R { + DRIVE_R::new(((self.bits >> 8) & 0x07) as u8) + } + #[doc = "Bits 16:17 - Pin sensing mechanism"] + #[inline(always)] + pub fn sense(&self) -> SENSE_R { + SENSE_R::new(((self.bits >> 16) & 0x03) as u8) + } +} +impl W { + #[doc = "Bit 0 - Pin direction. Same physical register as DIR register"] + #[inline(always)] + pub fn dir(&mut self) -> DIR_W { + DIR_W { w: self } + } + #[doc = "Bit 1 - Connect or disconnect input buffer"] + #[inline(always)] + pub fn input(&mut self) -> INPUT_W { + INPUT_W { w: self } + } + #[doc = "Bits 2:3 - Pull configuration"] + #[inline(always)] + pub fn pull(&mut self) -> PULL_W { + PULL_W { w: self } + } + #[doc = "Bits 8:10 - Drive configuration"] + #[inline(always)] + pub fn drive(&mut self) -> DRIVE_W { + DRIVE_W { w: self } + } + #[doc = "Bits 16:17 - Pin sensing mechanism"] + #[inline(always)] + pub fn sense(&mut self) -> SENSE_W { + SENSE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description collection\\[0\\]: Configuration of GPIO pins\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pin_cnf](index.html) module"] +pub struct PIN_CNF_SPEC; +impl crate::RegisterSpec for PIN_CNF_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pin_cnf::R](R) reader structure"] +impl crate::Readable for PIN_CNF_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pin_cnf::W](W) writer structure"] +impl crate::Writable for PIN_CNF_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PIN_CNF[%s] +to value 0x02"] +impl crate::Resettable for PIN_CNF_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x02 + } +} diff --git a/src/pdm.rs b/src/pdm.rs new file mode 100644 index 0000000..609de33 --- /dev/null +++ b/src/pdm.rs @@ -0,0 +1,114 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "0x00 - Starts continuous PDM transfer"] + pub tasks_start: crate::Reg, + #[doc = "0x04 - Stops PDM transfer"] + pub tasks_stop: crate::Reg, + _reserved2: [u8; 0xf8], + #[doc = "0x100 - PDM transfer has started"] + pub events_started: crate::Reg, + #[doc = "0x104 - PDM transfer has finished"] + pub events_stopped: crate::Reg, + #[doc = "0x108 - The PDM has written the last sample specified by SAMPLE.MAXCNT (or the last sample after a STOP task has been received) to Data RAM"] + pub events_end: crate::Reg, + _reserved5: [u8; 0x01f4], + #[doc = "0x300 - Enable or disable interrupt"] + pub inten: crate::Reg, + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved8: [u8; 0x01f4], + #[doc = "0x500 - PDM module enable register"] + pub enable: crate::Reg, + #[doc = "0x504 - PDM clock generator control"] + pub pdmclkctrl: crate::Reg, + #[doc = "0x508 - Defines the routing of the connected PDM microphones' signals"] + pub mode: crate::Reg, + _reserved11: [u8; 0x0c], + #[doc = "0x518 - Left output gain adjustment"] + pub gainl: crate::Reg, + #[doc = "0x51c - Right output gain adjustment"] + pub gainr: crate::Reg, + _reserved13: [u8; 0x20], + #[doc = "0x540..0x548 - Unspecified"] + pub psel: PSEL, + _reserved14: [u8; 0x18], + #[doc = "0x560..0x568 - Unspecified"] + pub sample: SAMPLE, +} +#[doc = r"Register block"] +#[repr(C)] +pub struct PSEL { + #[doc = "0x00 - Pin number configuration for PDM CLK signal"] + pub clk: crate::Reg, + #[doc = "0x04 - Pin number configuration for PDM DIN signal"] + pub din: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod psel; +#[doc = r"Register block"] +#[repr(C)] +pub struct SAMPLE { + #[doc = "0x00 - RAM address pointer to write samples to with EasyDMA"] + pub ptr: crate::Reg, + #[doc = "0x04 - Number of samples to allocate memory for in EasyDMA mode"] + pub maxcnt: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod sample; +#[doc = "TASKS_START register accessor: an alias for `Reg`"] +pub type TASKS_START = crate::Reg; +#[doc = "Starts continuous PDM transfer"] +pub mod tasks_start; +#[doc = "TASKS_STOP register accessor: an alias for `Reg`"] +pub type TASKS_STOP = crate::Reg; +#[doc = "Stops PDM transfer"] +pub mod tasks_stop; +#[doc = "EVENTS_STARTED register accessor: an alias for `Reg`"] +pub type EVENTS_STARTED = crate::Reg; +#[doc = "PDM transfer has started"] +pub mod events_started; +#[doc = "EVENTS_STOPPED register accessor: an alias for `Reg`"] +pub type EVENTS_STOPPED = crate::Reg; +#[doc = "PDM transfer has finished"] +pub mod events_stopped; +#[doc = "EVENTS_END register accessor: an alias for `Reg`"] +pub type EVENTS_END = crate::Reg; +#[doc = "The PDM has written the last sample specified by SAMPLE.MAXCNT (or the last sample after a STOP task has been received) to Data RAM"] +pub mod events_end; +#[doc = "INTEN register accessor: an alias for `Reg`"] +pub type INTEN = crate::Reg; +#[doc = "Enable or disable interrupt"] +pub mod inten; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "ENABLE register accessor: an alias for `Reg`"] +pub type ENABLE = crate::Reg; +#[doc = "PDM module enable register"] +pub mod enable; +#[doc = "PDMCLKCTRL register accessor: an alias for `Reg`"] +pub type PDMCLKCTRL = crate::Reg; +#[doc = "PDM clock generator control"] +pub mod pdmclkctrl; +#[doc = "MODE register accessor: an alias for `Reg`"] +pub type MODE = crate::Reg; +#[doc = "Defines the routing of the connected PDM microphones' signals"] +pub mod mode; +#[doc = "GAINL register accessor: an alias for `Reg`"] +pub type GAINL = crate::Reg; +#[doc = "Left output gain adjustment"] +pub mod gainl; +#[doc = "GAINR register accessor: an alias for `Reg`"] +pub type GAINR = crate::Reg; +#[doc = "Right output gain adjustment"] +pub mod gainr; diff --git a/src/pdm/enable.rs b/src/pdm/enable.rs new file mode 100644 index 0000000..8839d6f --- /dev/null +++ b/src/pdm/enable.rs @@ -0,0 +1,159 @@ +#[doc = "Register `ENABLE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ENABLE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable PDM module\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENABLE_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENABLE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENABLE` reader - Enable or disable PDM module"] +pub struct ENABLE_R(crate::FieldReader); +impl ENABLE_R { + pub(crate) fn new(bits: bool) -> Self { + ENABLE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENABLE_A { + match self.bits { + false => ENABLE_A::DISABLED, + true => ENABLE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENABLE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENABLE_A::ENABLED + } +} +impl core::ops::Deref for ENABLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENABLE` writer - Enable or disable PDM module"] +pub struct ENABLE_W<'a> { + w: &'a mut W, +} +impl<'a> ENABLE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENABLE_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENABLE_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENABLE_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable or disable PDM module"] + #[inline(always)] + pub fn enable(&self) -> ENABLE_R { + ENABLE_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Enable or disable PDM module"] + #[inline(always)] + pub fn enable(&mut self) -> ENABLE_W { + ENABLE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "PDM module enable register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [enable](index.html) module"] +pub struct ENABLE_SPEC; +impl crate::RegisterSpec for ENABLE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [enable::R](R) reader structure"] +impl crate::Readable for ENABLE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [enable::W](W) writer structure"] +impl crate::Writable for ENABLE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ENABLE to value 0"] +impl crate::Resettable for ENABLE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pdm/events_end.rs b/src/pdm/events_end.rs new file mode 100644 index 0000000..6570f02 --- /dev/null +++ b/src/pdm/events_end.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_END` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_END` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "The PDM has written the last sample specified by SAMPLE.MAXCNT (or the last sample after a STOP task has been received) to Data RAM\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_end](index.html) module"] +pub struct EVENTS_END_SPEC; +impl crate::RegisterSpec for EVENTS_END_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_end::R](R) reader structure"] +impl crate::Readable for EVENTS_END_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_end::W](W) writer structure"] +impl crate::Writable for EVENTS_END_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_END to value 0"] +impl crate::Resettable for EVENTS_END_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pdm/events_started.rs b/src/pdm/events_started.rs new file mode 100644 index 0000000..2793ec4 --- /dev/null +++ b/src/pdm/events_started.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_STARTED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_STARTED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "PDM transfer has started\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_started](index.html) module"] +pub struct EVENTS_STARTED_SPEC; +impl crate::RegisterSpec for EVENTS_STARTED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_started::R](R) reader structure"] +impl crate::Readable for EVENTS_STARTED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_started::W](W) writer structure"] +impl crate::Writable for EVENTS_STARTED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_STARTED to value 0"] +impl crate::Resettable for EVENTS_STARTED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pdm/events_stopped.rs b/src/pdm/events_stopped.rs new file mode 100644 index 0000000..318709c --- /dev/null +++ b/src/pdm/events_stopped.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_STOPPED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_STOPPED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "PDM transfer has finished\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_stopped](index.html) module"] +pub struct EVENTS_STOPPED_SPEC; +impl crate::RegisterSpec for EVENTS_STOPPED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_stopped::R](R) reader structure"] +impl crate::Readable for EVENTS_STOPPED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_stopped::W](W) writer structure"] +impl crate::Writable for EVENTS_STOPPED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_STOPPED to value 0"] +impl crate::Resettable for EVENTS_STOPPED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pdm/gainl.rs b/src/pdm/gainl.rs new file mode 100644 index 0000000..d0252c3 --- /dev/null +++ b/src/pdm/gainl.rs @@ -0,0 +1,164 @@ +#[doc = "Register `GAINL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GAINL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Left output gain adjustment, in 0.5 dB steps, around the default module gain (see electrical parameters) 0x00 -20 dB gain adjust 0x01 -19.5 dB gain adjust (...) 0x27 -0.5 dB gain adjust 0x28 0 dB gain adjust 0x29 +0.5 dB gain adjust (...) 0x4F +19.5 dB gain adjust 0x50 +20 dB gain adjust\n\nValue on reset: 40"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum GAINL_A { + #[doc = "0: -20dB gain adjustment (minimum)"] + MINGAIN = 0, + #[doc = "40: 0dB gain adjustment ('2500 RMS' requirement)"] + DEFAULTGAIN = 40, + #[doc = "80: +20dB gain adjustment (maximum)"] + MAXGAIN = 80, +} +impl From for u8 { + #[inline(always)] + fn from(variant: GAINL_A) -> Self { + variant as _ + } +} +#[doc = "Field `GAINL` reader - Left output gain adjustment, in 0.5 dB steps, around the default module gain (see electrical parameters) 0x00 -20 dB gain adjust 0x01 -19.5 dB gain adjust (...) 0x27 -0.5 dB gain adjust 0x28 0 dB gain adjust 0x29 +0.5 dB gain adjust (...) 0x4F +19.5 dB gain adjust 0x50 +20 dB gain adjust"] +pub struct GAINL_R(crate::FieldReader); +impl GAINL_R { + pub(crate) fn new(bits: u8) -> Self { + GAINL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(GAINL_A::MINGAIN), + 40 => Some(GAINL_A::DEFAULTGAIN), + 80 => Some(GAINL_A::MAXGAIN), + _ => None, + } + } + #[doc = "Checks if the value of the field is `MINGAIN`"] + #[inline(always)] + pub fn is_min_gain(&self) -> bool { + **self == GAINL_A::MINGAIN + } + #[doc = "Checks if the value of the field is `DEFAULTGAIN`"] + #[inline(always)] + pub fn is_default_gain(&self) -> bool { + **self == GAINL_A::DEFAULTGAIN + } + #[doc = "Checks if the value of the field is `MAXGAIN`"] + #[inline(always)] + pub fn is_max_gain(&self) -> bool { + **self == GAINL_A::MAXGAIN + } +} +impl core::ops::Deref for GAINL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `GAINL` writer - Left output gain adjustment, in 0.5 dB steps, around the default module gain (see electrical parameters) 0x00 -20 dB gain adjust 0x01 -19.5 dB gain adjust (...) 0x27 -0.5 dB gain adjust 0x28 0 dB gain adjust 0x29 +0.5 dB gain adjust (...) 0x4F +19.5 dB gain adjust 0x50 +20 dB gain adjust"] +pub struct GAINL_W<'a> { + w: &'a mut W, +} +impl<'a> GAINL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: GAINL_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "-20dB gain adjustment (minimum)"] + #[inline(always)] + pub fn min_gain(self) -> &'a mut W { + self.variant(GAINL_A::MINGAIN) + } + #[doc = "0dB gain adjustment ('2500 RMS' requirement)"] + #[inline(always)] + pub fn default_gain(self) -> &'a mut W { + self.variant(GAINL_A::DEFAULTGAIN) + } + #[doc = "+20dB gain adjustment (maximum)"] + #[inline(always)] + pub fn max_gain(self) -> &'a mut W { + self.variant(GAINL_A::MAXGAIN) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x7f) | (value as u32 & 0x7f); + self.w + } +} +impl R { + #[doc = "Bits 0:6 - Left output gain adjustment, in 0.5 dB steps, around the default module gain (see electrical parameters) 0x00 -20 dB gain adjust 0x01 -19.5 dB gain adjust (...) 0x27 -0.5 dB gain adjust 0x28 0 dB gain adjust 0x29 +0.5 dB gain adjust (...) 0x4F +19.5 dB gain adjust 0x50 +20 dB gain adjust"] + #[inline(always)] + pub fn gainl(&self) -> GAINL_R { + GAINL_R::new((self.bits & 0x7f) as u8) + } +} +impl W { + #[doc = "Bits 0:6 - Left output gain adjustment, in 0.5 dB steps, around the default module gain (see electrical parameters) 0x00 -20 dB gain adjust 0x01 -19.5 dB gain adjust (...) 0x27 -0.5 dB gain adjust 0x28 0 dB gain adjust 0x29 +0.5 dB gain adjust (...) 0x4F +19.5 dB gain adjust 0x50 +20 dB gain adjust"] + #[inline(always)] + pub fn gainl(&mut self) -> GAINL_W { + GAINL_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Left output gain adjustment\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gainl](index.html) module"] +pub struct GAINL_SPEC; +impl crate::RegisterSpec for GAINL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [gainl::R](R) reader structure"] +impl crate::Readable for GAINL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [gainl::W](W) writer structure"] +impl crate::Writable for GAINL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GAINL to value 0x28"] +impl crate::Resettable for GAINL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x28 + } +} diff --git a/src/pdm/gainr.rs b/src/pdm/gainr.rs new file mode 100644 index 0000000..de7b69f --- /dev/null +++ b/src/pdm/gainr.rs @@ -0,0 +1,164 @@ +#[doc = "Register `GAINR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GAINR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Right output gain adjustment, in 0.5 dB steps, around the default module gain (see electrical parameters)\n\nValue on reset: 40"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum GAINR_A { + #[doc = "0: -20dB gain adjustment (minimum)"] + MINGAIN = 0, + #[doc = "40: 0dB gain adjustment ('2500 RMS' requirement)"] + DEFAULTGAIN = 40, + #[doc = "80: +20dB gain adjustment (maximum)"] + MAXGAIN = 80, +} +impl From for u8 { + #[inline(always)] + fn from(variant: GAINR_A) -> Self { + variant as _ + } +} +#[doc = "Field `GAINR` reader - Right output gain adjustment, in 0.5 dB steps, around the default module gain (see electrical parameters)"] +pub struct GAINR_R(crate::FieldReader); +impl GAINR_R { + pub(crate) fn new(bits: u8) -> Self { + GAINR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(GAINR_A::MINGAIN), + 40 => Some(GAINR_A::DEFAULTGAIN), + 80 => Some(GAINR_A::MAXGAIN), + _ => None, + } + } + #[doc = "Checks if the value of the field is `MINGAIN`"] + #[inline(always)] + pub fn is_min_gain(&self) -> bool { + **self == GAINR_A::MINGAIN + } + #[doc = "Checks if the value of the field is `DEFAULTGAIN`"] + #[inline(always)] + pub fn is_default_gain(&self) -> bool { + **self == GAINR_A::DEFAULTGAIN + } + #[doc = "Checks if the value of the field is `MAXGAIN`"] + #[inline(always)] + pub fn is_max_gain(&self) -> bool { + **self == GAINR_A::MAXGAIN + } +} +impl core::ops::Deref for GAINR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `GAINR` writer - Right output gain adjustment, in 0.5 dB steps, around the default module gain (see electrical parameters)"] +pub struct GAINR_W<'a> { + w: &'a mut W, +} +impl<'a> GAINR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: GAINR_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "-20dB gain adjustment (minimum)"] + #[inline(always)] + pub fn min_gain(self) -> &'a mut W { + self.variant(GAINR_A::MINGAIN) + } + #[doc = "0dB gain adjustment ('2500 RMS' requirement)"] + #[inline(always)] + pub fn default_gain(self) -> &'a mut W { + self.variant(GAINR_A::DEFAULTGAIN) + } + #[doc = "+20dB gain adjustment (maximum)"] + #[inline(always)] + pub fn max_gain(self) -> &'a mut W { + self.variant(GAINR_A::MAXGAIN) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - Right output gain adjustment, in 0.5 dB steps, around the default module gain (see electrical parameters)"] + #[inline(always)] + pub fn gainr(&self) -> GAINR_R { + GAINR_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - Right output gain adjustment, in 0.5 dB steps, around the default module gain (see electrical parameters)"] + #[inline(always)] + pub fn gainr(&mut self) -> GAINR_W { + GAINR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Right output gain adjustment\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gainr](index.html) module"] +pub struct GAINR_SPEC; +impl crate::RegisterSpec for GAINR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [gainr::R](R) reader structure"] +impl crate::Readable for GAINR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [gainr::W](W) writer structure"] +impl crate::Writable for GAINR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GAINR to value 0x28"] +impl crate::Resettable for GAINR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x28 + } +} diff --git a/src/pdm/inten.rs b/src/pdm/inten.rs new file mode 100644 index 0000000..554bad9 --- /dev/null +++ b/src/pdm/inten.rs @@ -0,0 +1,345 @@ +#[doc = "Register `INTEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable interrupt for STARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STARTED_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STARTED` reader - Enable or disable interrupt for STARTED event"] +pub struct STARTED_R(crate::FieldReader); +impl STARTED_R { + pub(crate) fn new(bits: bool) -> Self { + STARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STARTED_A { + match self.bits { + false => STARTED_A::DISABLED, + true => STARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STARTED_A::ENABLED + } +} +impl core::ops::Deref for STARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STARTED` writer - Enable or disable interrupt for STARTED event"] +pub struct STARTED_W<'a> { + w: &'a mut W, +} +impl<'a> STARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STARTED_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(STARTED_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(STARTED_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Enable or disable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` reader - Enable or disable interrupt for STOPPED event"] +pub struct STOPPED_R(crate::FieldReader); +impl STOPPED_R { + pub(crate) fn new(bits: bool) -> Self { + STOPPED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STOPPED_A { + match self.bits { + false => STOPPED_A::DISABLED, + true => STOPPED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STOPPED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STOPPED_A::ENABLED + } +} +impl core::ops::Deref for STOPPED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STOPPED` writer - Enable or disable interrupt for STOPPED event"] +pub struct STOPPED_W<'a> { + w: &'a mut W, +} +impl<'a> STOPPED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STOPPED_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(STOPPED_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(STOPPED_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Enable or disable interrupt for END event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END` reader - Enable or disable interrupt for END event"] +pub struct END_R(crate::FieldReader); +impl END_R { + pub(crate) fn new(bits: bool) -> Self { + END_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> END_A { + match self.bits { + false => END_A::DISABLED, + true => END_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == END_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == END_A::ENABLED + } +} +impl core::ops::Deref for END_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `END` writer - Enable or disable interrupt for END event"] +pub struct END_W<'a> { + w: &'a mut W, +} +impl<'a> END_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: END_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(END_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(END_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable or disable interrupt for STARTED event"] + #[inline(always)] + pub fn started(&self) -> STARTED_R { + STARTED_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Enable or disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&self) -> STOPPED_R { + STOPPED_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Enable or disable interrupt for END event"] + #[inline(always)] + pub fn end(&self) -> END_R { + END_R::new(((self.bits >> 2) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Enable or disable interrupt for STARTED event"] + #[inline(always)] + pub fn started(&mut self) -> STARTED_W { + STARTED_W { w: self } + } + #[doc = "Bit 1 - Enable or disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&mut self) -> STOPPED_W { + STOPPED_W { w: self } + } + #[doc = "Bit 2 - Enable or disable interrupt for END event"] + #[inline(always)] + pub fn end(&mut self) -> END_W { + END_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable or disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [inten](index.html) module"] +pub struct INTEN_SPEC; +impl crate::RegisterSpec for INTEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [inten::R](R) reader structure"] +impl crate::Readable for INTEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [inten::W](W) writer structure"] +impl crate::Writable for INTEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTEN to value 0"] +impl crate::Resettable for INTEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pdm/intenclr.rs b/src/pdm/intenclr.rs new file mode 100644 index 0000000..cfd5389 --- /dev/null +++ b/src/pdm/intenclr.rs @@ -0,0 +1,366 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for STARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STARTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STARTED` reader - Write '1' to Disable interrupt for STARTED event"] +pub struct STARTED_R(crate::FieldReader); +impl STARTED_R { + pub(crate) fn new(bits: bool) -> Self { + STARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STARTED_A { + match self.bits { + false => STARTED_A::DISABLED, + true => STARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STARTED_A::ENABLED + } +} +impl core::ops::Deref for STARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for STARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STARTED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STARTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STARTED` writer - Write '1' to Disable interrupt for STARTED event"] +pub struct STARTED_W<'a> { + w: &'a mut W, +} +impl<'a> STARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STARTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(STARTED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` reader - Write '1' to Disable interrupt for STOPPED event"] +pub struct STOPPED_R(crate::FieldReader); +impl STOPPED_R { + pub(crate) fn new(bits: bool) -> Self { + STOPPED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STOPPED_A { + match self.bits { + false => STOPPED_A::DISABLED, + true => STOPPED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STOPPED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STOPPED_A::ENABLED + } +} +impl core::ops::Deref for STOPPED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` writer - Write '1' to Disable interrupt for STOPPED event"] +pub struct STOPPED_W<'a> { + w: &'a mut W, +} +impl<'a> STOPPED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STOPPED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(STOPPED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for END event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END` reader - Write '1' to Disable interrupt for END event"] +pub struct END_R(crate::FieldReader); +impl END_R { + pub(crate) fn new(bits: bool) -> Self { + END_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> END_A { + match self.bits { + false => END_A::DISABLED, + true => END_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == END_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == END_A::ENABLED + } +} +impl core::ops::Deref for END_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for END event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END` writer - Write '1' to Disable interrupt for END event"] +pub struct END_W<'a> { + w: &'a mut W, +} +impl<'a> END_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: END_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(END_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Disable interrupt for STARTED event"] + #[inline(always)] + pub fn started(&self) -> STARTED_R { + STARTED_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&self) -> STOPPED_R { + STOPPED_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for END event"] + #[inline(always)] + pub fn end(&self) -> END_R { + END_R::new(((self.bits >> 2) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Disable interrupt for STARTED event"] + #[inline(always)] + pub fn started(&mut self) -> STARTED_W { + STARTED_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&mut self) -> STOPPED_W { + STOPPED_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for END event"] + #[inline(always)] + pub fn end(&mut self) -> END_W { + END_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pdm/intenset.rs b/src/pdm/intenset.rs new file mode 100644 index 0000000..46a084f --- /dev/null +++ b/src/pdm/intenset.rs @@ -0,0 +1,366 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for STARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STARTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STARTED` reader - Write '1' to Enable interrupt for STARTED event"] +pub struct STARTED_R(crate::FieldReader); +impl STARTED_R { + pub(crate) fn new(bits: bool) -> Self { + STARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STARTED_A { + match self.bits { + false => STARTED_A::DISABLED, + true => STARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STARTED_A::ENABLED + } +} +impl core::ops::Deref for STARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for STARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STARTED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STARTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STARTED` writer - Write '1' to Enable interrupt for STARTED event"] +pub struct STARTED_W<'a> { + w: &'a mut W, +} +impl<'a> STARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STARTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(STARTED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` reader - Write '1' to Enable interrupt for STOPPED event"] +pub struct STOPPED_R(crate::FieldReader); +impl STOPPED_R { + pub(crate) fn new(bits: bool) -> Self { + STOPPED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STOPPED_A { + match self.bits { + false => STOPPED_A::DISABLED, + true => STOPPED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STOPPED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STOPPED_A::ENABLED + } +} +impl core::ops::Deref for STOPPED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` writer - Write '1' to Enable interrupt for STOPPED event"] +pub struct STOPPED_W<'a> { + w: &'a mut W, +} +impl<'a> STOPPED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STOPPED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(STOPPED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for END event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END` reader - Write '1' to Enable interrupt for END event"] +pub struct END_R(crate::FieldReader); +impl END_R { + pub(crate) fn new(bits: bool) -> Self { + END_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> END_A { + match self.bits { + false => END_A::DISABLED, + true => END_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == END_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == END_A::ENABLED + } +} +impl core::ops::Deref for END_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for END event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END` writer - Write '1' to Enable interrupt for END event"] +pub struct END_W<'a> { + w: &'a mut W, +} +impl<'a> END_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: END_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(END_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Enable interrupt for STARTED event"] + #[inline(always)] + pub fn started(&self) -> STARTED_R { + STARTED_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&self) -> STOPPED_R { + STOPPED_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for END event"] + #[inline(always)] + pub fn end(&self) -> END_R { + END_R::new(((self.bits >> 2) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Enable interrupt for STARTED event"] + #[inline(always)] + pub fn started(&mut self) -> STARTED_W { + STARTED_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&mut self) -> STOPPED_W { + STOPPED_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for END event"] + #[inline(always)] + pub fn end(&mut self) -> END_W { + END_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pdm/mode.rs b/src/pdm/mode.rs new file mode 100644 index 0000000..c1573e6 --- /dev/null +++ b/src/pdm/mode.rs @@ -0,0 +1,252 @@ +#[doc = "Register `MODE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MODE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Mono or stereo operation\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OPERATION_A { + #[doc = "0: Sample and store one pair (Left + Right) of 16bit samples per RAM word R=\\[31:16\\]; L=\\[15:0\\]"] + STEREO = 0, + #[doc = "1: Sample and store two successive Left samples (16 bit each) per RAM word L1=\\[31:16\\]; L0=\\[15:0\\]"] + MONO = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OPERATION_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OPERATION` reader - Mono or stereo operation"] +pub struct OPERATION_R(crate::FieldReader); +impl OPERATION_R { + pub(crate) fn new(bits: bool) -> Self { + OPERATION_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> OPERATION_A { + match self.bits { + false => OPERATION_A::STEREO, + true => OPERATION_A::MONO, + } + } + #[doc = "Checks if the value of the field is `STEREO`"] + #[inline(always)] + pub fn is_stereo(&self) -> bool { + **self == OPERATION_A::STEREO + } + #[doc = "Checks if the value of the field is `MONO`"] + #[inline(always)] + pub fn is_mono(&self) -> bool { + **self == OPERATION_A::MONO + } +} +impl core::ops::Deref for OPERATION_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OPERATION` writer - Mono or stereo operation"] +pub struct OPERATION_W<'a> { + w: &'a mut W, +} +impl<'a> OPERATION_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: OPERATION_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Sample and store one pair (Left + Right) of 16bit samples per RAM word R=\\[31:16\\]; L=\\[15:0\\]"] + #[inline(always)] + pub fn stereo(self) -> &'a mut W { + self.variant(OPERATION_A::STEREO) + } + #[doc = "Sample and store two successive Left samples (16 bit each) per RAM word L1=\\[31:16\\]; L0=\\[15:0\\]"] + #[inline(always)] + pub fn mono(self) -> &'a mut W { + self.variant(OPERATION_A::MONO) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Defines on which PDM_CLK edge Left (or mono) is sampled\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum EDGE_A { + #[doc = "0: Left (or mono) is sampled on falling edge of PDM_CLK"] + LEFTFALLING = 0, + #[doc = "1: Left (or mono) is sampled on rising edge of PDM_CLK"] + LEFTRISING = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: EDGE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `EDGE` reader - Defines on which PDM_CLK edge Left (or mono) is sampled"] +pub struct EDGE_R(crate::FieldReader); +impl EDGE_R { + pub(crate) fn new(bits: bool) -> Self { + EDGE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> EDGE_A { + match self.bits { + false => EDGE_A::LEFTFALLING, + true => EDGE_A::LEFTRISING, + } + } + #[doc = "Checks if the value of the field is `LEFTFALLING`"] + #[inline(always)] + pub fn is_left_falling(&self) -> bool { + **self == EDGE_A::LEFTFALLING + } + #[doc = "Checks if the value of the field is `LEFTRISING`"] + #[inline(always)] + pub fn is_left_rising(&self) -> bool { + **self == EDGE_A::LEFTRISING + } +} +impl core::ops::Deref for EDGE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EDGE` writer - Defines on which PDM_CLK edge Left (or mono) is sampled"] +pub struct EDGE_W<'a> { + w: &'a mut W, +} +impl<'a> EDGE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: EDGE_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Left (or mono) is sampled on falling edge of PDM_CLK"] + #[inline(always)] + pub fn left_falling(self) -> &'a mut W { + self.variant(EDGE_A::LEFTFALLING) + } + #[doc = "Left (or mono) is sampled on rising edge of PDM_CLK"] + #[inline(always)] + pub fn left_rising(self) -> &'a mut W { + self.variant(EDGE_A::LEFTRISING) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +impl R { + #[doc = "Bit 0 - Mono or stereo operation"] + #[inline(always)] + pub fn operation(&self) -> OPERATION_R { + OPERATION_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Defines on which PDM_CLK edge Left (or mono) is sampled"] + #[inline(always)] + pub fn edge(&self) -> EDGE_R { + EDGE_R::new(((self.bits >> 1) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Mono or stereo operation"] + #[inline(always)] + pub fn operation(&mut self) -> OPERATION_W { + OPERATION_W { w: self } + } + #[doc = "Bit 1 - Defines on which PDM_CLK edge Left (or mono) is sampled"] + #[inline(always)] + pub fn edge(&mut self) -> EDGE_W { + EDGE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Defines the routing of the connected PDM microphones' signals\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mode](index.html) module"] +pub struct MODE_SPEC; +impl crate::RegisterSpec for MODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mode::R](R) reader structure"] +impl crate::Readable for MODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mode::W](W) writer structure"] +impl crate::Writable for MODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MODE to value 0"] +impl crate::Resettable for MODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pdm/pdmclkctrl.rs b/src/pdm/pdmclkctrl.rs new file mode 100644 index 0000000..2976e78 --- /dev/null +++ b/src/pdm/pdmclkctrl.rs @@ -0,0 +1,164 @@ +#[doc = "Register `PDMCLKCTRL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PDMCLKCTRL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "PDM_CLK frequency\n\nValue on reset: 138412032"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u32)] +pub enum FREQ_A { + #[doc = "134217728: PDM_CLK = 32 MHz / 32 = 1.000 MHz"] + _1000K = 134217728, + #[doc = "138412032: PDM_CLK = 32 MHz / 31 = 1.032 MHz"] + DEFAULT = 138412032, + #[doc = "142606336: PDM_CLK = 32 MHz / 30 = 1.067 MHz"] + _1067K = 142606336, +} +impl From for u32 { + #[inline(always)] + fn from(variant: FREQ_A) -> Self { + variant as _ + } +} +#[doc = "Field `FREQ` reader - PDM_CLK frequency"] +pub struct FREQ_R(crate::FieldReader); +impl FREQ_R { + pub(crate) fn new(bits: u32) -> Self { + FREQ_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 134217728 => Some(FREQ_A::_1000K), + 138412032 => Some(FREQ_A::DEFAULT), + 142606336 => Some(FREQ_A::_1067K), + _ => None, + } + } + #[doc = "Checks if the value of the field is `_1000K`"] + #[inline(always)] + pub fn is_1000k(&self) -> bool { + **self == FREQ_A::_1000K + } + #[doc = "Checks if the value of the field is `DEFAULT`"] + #[inline(always)] + pub fn is_default(&self) -> bool { + **self == FREQ_A::DEFAULT + } + #[doc = "Checks if the value of the field is `_1067K`"] + #[inline(always)] + pub fn is_1067k(&self) -> bool { + **self == FREQ_A::_1067K + } +} +impl core::ops::Deref for FREQ_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FREQ` writer - PDM_CLK frequency"] +pub struct FREQ_W<'a> { + w: &'a mut W, +} +impl<'a> FREQ_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: FREQ_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "PDM_CLK = 32 MHz / 32 = 1.000 MHz"] + #[inline(always)] + pub fn _1000k(self) -> &'a mut W { + self.variant(FREQ_A::_1000K) + } + #[doc = "PDM_CLK = 32 MHz / 31 = 1.032 MHz"] + #[inline(always)] + pub fn default(self) -> &'a mut W { + self.variant(FREQ_A::DEFAULT) + } + #[doc = "PDM_CLK = 32 MHz / 30 = 1.067 MHz"] + #[inline(always)] + pub fn _1067k(self) -> &'a mut W { + self.variant(FREQ_A::_1067K) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - PDM_CLK frequency"] + #[inline(always)] + pub fn freq(&self) -> FREQ_R { + FREQ_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - PDM_CLK frequency"] + #[inline(always)] + pub fn freq(&mut self) -> FREQ_W { + FREQ_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "PDM clock generator control\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pdmclkctrl](index.html) module"] +pub struct PDMCLKCTRL_SPEC; +impl crate::RegisterSpec for PDMCLKCTRL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pdmclkctrl::R](R) reader structure"] +impl crate::Readable for PDMCLKCTRL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pdmclkctrl::W](W) writer structure"] +impl crate::Writable for PDMCLKCTRL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PDMCLKCTRL to value 0x0840_0000"] +impl crate::Resettable for PDMCLKCTRL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0840_0000 + } +} diff --git a/src/pdm/psel.rs b/src/pdm/psel.rs new file mode 100644 index 0000000..9969fe4 --- /dev/null +++ b/src/pdm/psel.rs @@ -0,0 +1,8 @@ +#[doc = "CLK register accessor: an alias for `Reg`"] +pub type CLK = crate::Reg; +#[doc = "Pin number configuration for PDM CLK signal"] +pub mod clk; +#[doc = "DIN register accessor: an alias for `Reg`"] +pub type DIN = crate::Reg; +#[doc = "Pin number configuration for PDM DIN signal"] +pub mod din; diff --git a/src/pdm/psel/clk.rs b/src/pdm/psel/clk.rs new file mode 100644 index 0000000..0ea5d24 --- /dev/null +++ b/src/pdm/psel/clk.rs @@ -0,0 +1,195 @@ +#[doc = "Register `CLK` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CLK` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PIN` reader - Pin number"] +pub struct PIN_R(crate::FieldReader); +impl PIN_R { + pub(crate) fn new(bits: u8) -> Self { + PIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN` writer - Pin number"] +pub struct PIN_W<'a> { + w: &'a mut W, +} +impl<'a> PIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Connection\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CONNECT_A { + #[doc = "1: Disconnect"] + DISCONNECTED = 1, + #[doc = "0: Connect"] + CONNECTED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: CONNECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CONNECT` reader - Connection"] +pub struct CONNECT_R(crate::FieldReader); +impl CONNECT_R { + pub(crate) fn new(bits: bool) -> Self { + CONNECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CONNECT_A { + match self.bits { + true => CONNECT_A::DISCONNECTED, + false => CONNECT_A::CONNECTED, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == CONNECT_A::DISCONNECTED + } + #[doc = "Checks if the value of the field is `CONNECTED`"] + #[inline(always)] + pub fn is_connected(&self) -> bool { + **self == CONNECT_A::CONNECTED + } +} +impl core::ops::Deref for CONNECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONNECT` writer - Connection"] +pub struct CONNECT_W<'a> { + w: &'a mut W, +} +impl<'a> CONNECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CONNECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(CONNECT_A::DISCONNECTED) + } + #[doc = "Connect"] + #[inline(always)] + pub fn connected(self) -> &'a mut W { + self.variant(CONNECT_A::CONNECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&self) -> PIN_R { + PIN_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&self) -> CONNECT_R { + CONNECT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&mut self) -> PIN_W { + PIN_W { w: self } + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&mut self) -> CONNECT_W { + CONNECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin number configuration for PDM CLK signal\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [clk](index.html) module"] +pub struct CLK_SPEC; +impl crate::RegisterSpec for CLK_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [clk::R](R) reader structure"] +impl crate::Readable for CLK_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [clk::W](W) writer structure"] +impl crate::Writable for CLK_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CLK to value 0xffff_ffff"] +impl crate::Resettable for CLK_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/pdm/psel/din.rs b/src/pdm/psel/din.rs new file mode 100644 index 0000000..902cc7b --- /dev/null +++ b/src/pdm/psel/din.rs @@ -0,0 +1,195 @@ +#[doc = "Register `DIN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DIN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PIN` reader - Pin number"] +pub struct PIN_R(crate::FieldReader); +impl PIN_R { + pub(crate) fn new(bits: u8) -> Self { + PIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN` writer - Pin number"] +pub struct PIN_W<'a> { + w: &'a mut W, +} +impl<'a> PIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Connection\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CONNECT_A { + #[doc = "1: Disconnect"] + DISCONNECTED = 1, + #[doc = "0: Connect"] + CONNECTED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: CONNECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CONNECT` reader - Connection"] +pub struct CONNECT_R(crate::FieldReader); +impl CONNECT_R { + pub(crate) fn new(bits: bool) -> Self { + CONNECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CONNECT_A { + match self.bits { + true => CONNECT_A::DISCONNECTED, + false => CONNECT_A::CONNECTED, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == CONNECT_A::DISCONNECTED + } + #[doc = "Checks if the value of the field is `CONNECTED`"] + #[inline(always)] + pub fn is_connected(&self) -> bool { + **self == CONNECT_A::CONNECTED + } +} +impl core::ops::Deref for CONNECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONNECT` writer - Connection"] +pub struct CONNECT_W<'a> { + w: &'a mut W, +} +impl<'a> CONNECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CONNECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(CONNECT_A::DISCONNECTED) + } + #[doc = "Connect"] + #[inline(always)] + pub fn connected(self) -> &'a mut W { + self.variant(CONNECT_A::CONNECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&self) -> PIN_R { + PIN_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&self) -> CONNECT_R { + CONNECT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&mut self) -> PIN_W { + PIN_W { w: self } + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&mut self) -> CONNECT_W { + CONNECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin number configuration for PDM DIN signal\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [din](index.html) module"] +pub struct DIN_SPEC; +impl crate::RegisterSpec for DIN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [din::R](R) reader structure"] +impl crate::Readable for DIN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [din::W](W) writer structure"] +impl crate::Writable for DIN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DIN to value 0xffff_ffff"] +impl crate::Resettable for DIN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/pdm/sample.rs b/src/pdm/sample.rs new file mode 100644 index 0000000..fd55895 --- /dev/null +++ b/src/pdm/sample.rs @@ -0,0 +1,8 @@ +#[doc = "PTR register accessor: an alias for `Reg`"] +pub type PTR = crate::Reg; +#[doc = "RAM address pointer to write samples to with EasyDMA"] +pub mod ptr; +#[doc = "MAXCNT register accessor: an alias for `Reg`"] +pub type MAXCNT = crate::Reg; +#[doc = "Number of samples to allocate memory for in EasyDMA mode"] +pub mod maxcnt; diff --git a/src/pdm/sample/maxcnt.rs b/src/pdm/sample/maxcnt.rs new file mode 100644 index 0000000..4647acf --- /dev/null +++ b/src/pdm/sample/maxcnt.rs @@ -0,0 +1,102 @@ +#[doc = "Register `MAXCNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MAXCNT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `BUFFSIZE` reader - Length of DMA RAM allocation in number of samples"] +pub struct BUFFSIZE_R(crate::FieldReader); +impl BUFFSIZE_R { + pub(crate) fn new(bits: u16) -> Self { + BUFFSIZE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BUFFSIZE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BUFFSIZE` writer - Length of DMA RAM allocation in number of samples"] +pub struct BUFFSIZE_W<'a> { + w: &'a mut W, +} +impl<'a> BUFFSIZE_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !0x7fff) | (value as u32 & 0x7fff); + self.w + } +} +impl R { + #[doc = "Bits 0:14 - Length of DMA RAM allocation in number of samples"] + #[inline(always)] + pub fn buffsize(&self) -> BUFFSIZE_R { + BUFFSIZE_R::new((self.bits & 0x7fff) as u16) + } +} +impl W { + #[doc = "Bits 0:14 - Length of DMA RAM allocation in number of samples"] + #[inline(always)] + pub fn buffsize(&mut self) -> BUFFSIZE_W { + BUFFSIZE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Number of samples to allocate memory for in EasyDMA mode\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [maxcnt](index.html) module"] +pub struct MAXCNT_SPEC; +impl crate::RegisterSpec for MAXCNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [maxcnt::R](R) reader structure"] +impl crate::Readable for MAXCNT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [maxcnt::W](W) writer structure"] +impl crate::Writable for MAXCNT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MAXCNT to value 0"] +impl crate::Resettable for MAXCNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pdm/sample/ptr.rs b/src/pdm/sample/ptr.rs new file mode 100644 index 0000000..b1219fa --- /dev/null +++ b/src/pdm/sample/ptr.rs @@ -0,0 +1,102 @@ +#[doc = "Register `PTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `SAMPLEPTR` reader - Address to write PDM samples to over DMA"] +pub struct SAMPLEPTR_R(crate::FieldReader); +impl SAMPLEPTR_R { + pub(crate) fn new(bits: u32) -> Self { + SAMPLEPTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SAMPLEPTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SAMPLEPTR` writer - Address to write PDM samples to over DMA"] +pub struct SAMPLEPTR_W<'a> { + w: &'a mut W, +} +impl<'a> SAMPLEPTR_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Address to write PDM samples to over DMA"] + #[inline(always)] + pub fn sampleptr(&self) -> SAMPLEPTR_R { + SAMPLEPTR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Address to write PDM samples to over DMA"] + #[inline(always)] + pub fn sampleptr(&mut self) -> SAMPLEPTR_W { + SAMPLEPTR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "RAM address pointer to write samples to with EasyDMA\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ptr](index.html) module"] +pub struct PTR_SPEC; +impl crate::RegisterSpec for PTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ptr::R](R) reader structure"] +impl crate::Readable for PTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ptr::W](W) writer structure"] +impl crate::Writable for PTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PTR to value 0"] +impl crate::Resettable for PTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pdm/tasks_start.rs b/src/pdm/tasks_start.rs new file mode 100644 index 0000000..a418ae0 --- /dev/null +++ b/src/pdm/tasks_start.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_START` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Starts continuous PDM transfer\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_start](index.html) module"] +pub struct TASKS_START_SPEC; +impl crate::RegisterSpec for TASKS_START_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_start::W](W) writer structure"] +impl crate::Writable for TASKS_START_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_START to value 0"] +impl crate::Resettable for TASKS_START_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pdm/tasks_stop.rs b/src/pdm/tasks_stop.rs new file mode 100644 index 0000000..b385f75 --- /dev/null +++ b/src/pdm/tasks_stop.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STOP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Stops PDM transfer\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_stop](index.html) module"] +pub struct TASKS_STOP_SPEC; +impl crate::RegisterSpec for TASKS_STOP_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_stop::W](W) writer structure"] +impl crate::Writable for TASKS_STOP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STOP to value 0"] +impl crate::Resettable for TASKS_STOP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/power.rs b/src/power.rs new file mode 100644 index 0000000..845eea7 --- /dev/null +++ b/src/power.rs @@ -0,0 +1,148 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + _reserved0: [u8; 0x78], + #[doc = "0x78 - Enable constant latency mode"] + pub tasks_constlat: crate::Reg, + #[doc = "0x7c - Enable low power mode (variable latency)"] + pub tasks_lowpwr: crate::Reg, + _reserved2: [u8; 0x88], + #[doc = "0x108 - Power failure warning"] + pub events_pofwarn: crate::Reg, + _reserved3: [u8; 0x08], + #[doc = "0x114 - CPU entered WFI/WFE sleep"] + pub events_sleepenter: crate::Reg, + #[doc = "0x118 - CPU exited WFI/WFE sleep"] + pub events_sleepexit: crate::Reg, + _reserved5: [u8; 0x01e8], + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved7: [u8; 0xf4], + #[doc = "0x400 - Reset reason"] + pub resetreas: crate::Reg, + _reserved8: [u8; 0x24], + #[doc = "0x428 - Deprecated register - RAM status register"] + pub ramstatus: crate::Reg, + _reserved9: [u8; 0xd4], + #[doc = "0x500 - System OFF register"] + pub systemoff: crate::Reg, + _reserved10: [u8; 0x0c], + #[doc = "0x510 - Power failure comparator configuration"] + pub pofcon: crate::Reg, + _reserved11: [u8; 0x08], + #[doc = "0x51c - General purpose retention register"] + pub gpregret: crate::Reg, + #[doc = "0x520 - General purpose retention register"] + pub gpregret2: crate::Reg, + #[doc = "0x524 - Deprecated register - RAM on/off register (this register is retained)"] + pub ramon: crate::Reg, + _reserved14: [u8; 0x2c], + #[doc = "0x554 - Deprecated register - RAM on/off register (this register is retained)"] + pub ramonb: crate::Reg, + _reserved15: [u8; 0x20], + #[doc = "0x578 - DC/DC enable register"] + pub dcdcen: crate::Reg, + _reserved16: [u8; 0x0384], + #[doc = "0x900..0x90c - Unspecified"] + pub ram0: RAM, + _reserved17: [u8; 0x04], + #[doc = "0x910..0x91c - Unspecified"] + pub ram1: RAM, + _reserved18: [u8; 0x04], + #[doc = "0x920..0x92c - Unspecified"] + pub ram2: RAM, + _reserved19: [u8; 0x04], + #[doc = "0x930..0x93c - Unspecified"] + pub ram3: RAM, + _reserved20: [u8; 0x04], + #[doc = "0x940..0x94c - Unspecified"] + pub ram4: RAM, + _reserved21: [u8; 0x04], + #[doc = "0x950..0x95c - Unspecified"] + pub ram5: RAM, + _reserved22: [u8; 0x04], + #[doc = "0x960..0x96c - Unspecified"] + pub ram6: RAM, + _reserved23: [u8; 0x04], + #[doc = "0x970..0x97c - Unspecified"] + pub ram7: RAM, +} +#[doc = r"Register block"] +#[repr(C)] +pub struct RAM { + #[doc = "0x00 - Description cluster\\[0\\]: RAM0 power control register"] + pub power: crate::Reg, + #[doc = "0x04 - Description cluster\\[0\\]: RAM0 power control set register"] + pub powerset: crate::Reg, + #[doc = "0x08 - Description cluster\\[0\\]: RAM0 power control clear register"] + pub powerclr: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod ram; +#[doc = "TASKS_CONSTLAT register accessor: an alias for `Reg`"] +pub type TASKS_CONSTLAT = crate::Reg; +#[doc = "Enable constant latency mode"] +pub mod tasks_constlat; +#[doc = "TASKS_LOWPWR register accessor: an alias for `Reg`"] +pub type TASKS_LOWPWR = crate::Reg; +#[doc = "Enable low power mode (variable latency)"] +pub mod tasks_lowpwr; +#[doc = "EVENTS_POFWARN register accessor: an alias for `Reg`"] +pub type EVENTS_POFWARN = crate::Reg; +#[doc = "Power failure warning"] +pub mod events_pofwarn; +#[doc = "EVENTS_SLEEPENTER register accessor: an alias for `Reg`"] +pub type EVENTS_SLEEPENTER = crate::Reg; +#[doc = "CPU entered WFI/WFE sleep"] +pub mod events_sleepenter; +#[doc = "EVENTS_SLEEPEXIT register accessor: an alias for `Reg`"] +pub type EVENTS_SLEEPEXIT = crate::Reg; +#[doc = "CPU exited WFI/WFE sleep"] +pub mod events_sleepexit; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "RESETREAS register accessor: an alias for `Reg`"] +pub type RESETREAS = crate::Reg; +#[doc = "Reset reason"] +pub mod resetreas; +#[doc = "RAMSTATUS register accessor: an alias for `Reg`"] +pub type RAMSTATUS = crate::Reg; +#[doc = "Deprecated register - RAM status register"] +pub mod ramstatus; +#[doc = "SYSTEMOFF register accessor: an alias for `Reg`"] +pub type SYSTEMOFF = crate::Reg; +#[doc = "System OFF register"] +pub mod systemoff; +#[doc = "POFCON register accessor: an alias for `Reg`"] +pub type POFCON = crate::Reg; +#[doc = "Power failure comparator configuration"] +pub mod pofcon; +#[doc = "GPREGRET register accessor: an alias for `Reg`"] +pub type GPREGRET = crate::Reg; +#[doc = "General purpose retention register"] +pub mod gpregret; +#[doc = "GPREGRET2 register accessor: an alias for `Reg`"] +pub type GPREGRET2 = crate::Reg; +#[doc = "General purpose retention register"] +pub mod gpregret2; +#[doc = "RAMON register accessor: an alias for `Reg`"] +pub type RAMON = crate::Reg; +#[doc = "Deprecated register - RAM on/off register (this register is retained)"] +pub mod ramon; +#[doc = "RAMONB register accessor: an alias for `Reg`"] +pub type RAMONB = crate::Reg; +#[doc = "Deprecated register - RAM on/off register (this register is retained)"] +pub mod ramonb; +#[doc = "DCDCEN register accessor: an alias for `Reg`"] +pub type DCDCEN = crate::Reg; +#[doc = "DC/DC enable register"] +pub mod dcdcen; diff --git a/src/power/dcdcen.rs b/src/power/dcdcen.rs new file mode 100644 index 0000000..352a005 --- /dev/null +++ b/src/power/dcdcen.rs @@ -0,0 +1,159 @@ +#[doc = "Register `DCDCEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DCDCEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable DC/DC converter\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DCDCEN_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DCDCEN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DCDCEN` reader - Enable or disable DC/DC converter"] +pub struct DCDCEN_R(crate::FieldReader); +impl DCDCEN_R { + pub(crate) fn new(bits: bool) -> Self { + DCDCEN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DCDCEN_A { + match self.bits { + false => DCDCEN_A::DISABLED, + true => DCDCEN_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DCDCEN_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DCDCEN_A::ENABLED + } +} +impl core::ops::Deref for DCDCEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DCDCEN` writer - Enable or disable DC/DC converter"] +pub struct DCDCEN_W<'a> { + w: &'a mut W, +} +impl<'a> DCDCEN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DCDCEN_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(DCDCEN_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(DCDCEN_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable or disable DC/DC converter"] + #[inline(always)] + pub fn dcdcen(&self) -> DCDCEN_R { + DCDCEN_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Enable or disable DC/DC converter"] + #[inline(always)] + pub fn dcdcen(&mut self) -> DCDCEN_W { + DCDCEN_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "DC/DC enable register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dcdcen](index.html) module"] +pub struct DCDCEN_SPEC; +impl crate::RegisterSpec for DCDCEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dcdcen::R](R) reader structure"] +impl crate::Readable for DCDCEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dcdcen::W](W) writer structure"] +impl crate::Writable for DCDCEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DCDCEN to value 0"] +impl crate::Resettable for DCDCEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/power/events_pofwarn.rs b/src/power/events_pofwarn.rs new file mode 100644 index 0000000..74e21f1 --- /dev/null +++ b/src/power/events_pofwarn.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_POFWARN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_POFWARN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Power failure warning\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_pofwarn](index.html) module"] +pub struct EVENTS_POFWARN_SPEC; +impl crate::RegisterSpec for EVENTS_POFWARN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_pofwarn::R](R) reader structure"] +impl crate::Readable for EVENTS_POFWARN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_pofwarn::W](W) writer structure"] +impl crate::Writable for EVENTS_POFWARN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_POFWARN to value 0"] +impl crate::Resettable for EVENTS_POFWARN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/power/events_sleepenter.rs b/src/power/events_sleepenter.rs new file mode 100644 index 0000000..98334be --- /dev/null +++ b/src/power/events_sleepenter.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_SLEEPENTER` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_SLEEPENTER` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "CPU entered WFI/WFE sleep\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_sleepenter](index.html) module"] +pub struct EVENTS_SLEEPENTER_SPEC; +impl crate::RegisterSpec for EVENTS_SLEEPENTER_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_sleepenter::R](R) reader structure"] +impl crate::Readable for EVENTS_SLEEPENTER_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_sleepenter::W](W) writer structure"] +impl crate::Writable for EVENTS_SLEEPENTER_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_SLEEPENTER to value 0"] +impl crate::Resettable for EVENTS_SLEEPENTER_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/power/events_sleepexit.rs b/src/power/events_sleepexit.rs new file mode 100644 index 0000000..43405c3 --- /dev/null +++ b/src/power/events_sleepexit.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_SLEEPEXIT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_SLEEPEXIT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "CPU exited WFI/WFE sleep\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_sleepexit](index.html) module"] +pub struct EVENTS_SLEEPEXIT_SPEC; +impl crate::RegisterSpec for EVENTS_SLEEPEXIT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_sleepexit::R](R) reader structure"] +impl crate::Readable for EVENTS_SLEEPEXIT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_sleepexit::W](W) writer structure"] +impl crate::Writable for EVENTS_SLEEPEXIT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_SLEEPEXIT to value 0"] +impl crate::Resettable for EVENTS_SLEEPEXIT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/power/gpregret.rs b/src/power/gpregret.rs new file mode 100644 index 0000000..4e41cf5 --- /dev/null +++ b/src/power/gpregret.rs @@ -0,0 +1,102 @@ +#[doc = "Register `GPREGRET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GPREGRET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `GPREGRET` reader - General purpose retention register"] +pub struct GPREGRET_R(crate::FieldReader); +impl GPREGRET_R { + pub(crate) fn new(bits: u8) -> Self { + GPREGRET_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for GPREGRET_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `GPREGRET` writer - General purpose retention register"] +pub struct GPREGRET_W<'a> { + w: &'a mut W, +} +impl<'a> GPREGRET_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - General purpose retention register"] + #[inline(always)] + pub fn gpregret(&self) -> GPREGRET_R { + GPREGRET_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - General purpose retention register"] + #[inline(always)] + pub fn gpregret(&mut self) -> GPREGRET_W { + GPREGRET_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "General purpose retention register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gpregret](index.html) module"] +pub struct GPREGRET_SPEC; +impl crate::RegisterSpec for GPREGRET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [gpregret::R](R) reader structure"] +impl crate::Readable for GPREGRET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [gpregret::W](W) writer structure"] +impl crate::Writable for GPREGRET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GPREGRET to value 0"] +impl crate::Resettable for GPREGRET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/power/gpregret2.rs b/src/power/gpregret2.rs new file mode 100644 index 0000000..c8af8ad --- /dev/null +++ b/src/power/gpregret2.rs @@ -0,0 +1,102 @@ +#[doc = "Register `GPREGRET2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `GPREGRET2` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `GPREGRET` reader - General purpose retention register"] +pub struct GPREGRET_R(crate::FieldReader); +impl GPREGRET_R { + pub(crate) fn new(bits: u8) -> Self { + GPREGRET_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for GPREGRET_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `GPREGRET` writer - General purpose retention register"] +pub struct GPREGRET_W<'a> { + w: &'a mut W, +} +impl<'a> GPREGRET_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - General purpose retention register"] + #[inline(always)] + pub fn gpregret(&self) -> GPREGRET_R { + GPREGRET_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - General purpose retention register"] + #[inline(always)] + pub fn gpregret(&mut self) -> GPREGRET_W { + GPREGRET_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "General purpose retention register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [gpregret2](index.html) module"] +pub struct GPREGRET2_SPEC; +impl crate::RegisterSpec for GPREGRET2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [gpregret2::R](R) reader structure"] +impl crate::Readable for GPREGRET2_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [gpregret2::W](W) writer structure"] +impl crate::Writable for GPREGRET2_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets GPREGRET2 to value 0"] +impl crate::Resettable for GPREGRET2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/power/intenclr.rs b/src/power/intenclr.rs new file mode 100644 index 0000000..e7ea46c --- /dev/null +++ b/src/power/intenclr.rs @@ -0,0 +1,366 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for POFWARN event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum POFWARN_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: POFWARN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `POFWARN` reader - Write '1' to Disable interrupt for POFWARN event"] +pub struct POFWARN_R(crate::FieldReader); +impl POFWARN_R { + pub(crate) fn new(bits: bool) -> Self { + POFWARN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> POFWARN_A { + match self.bits { + false => POFWARN_A::DISABLED, + true => POFWARN_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == POFWARN_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == POFWARN_A::ENABLED + } +} +impl core::ops::Deref for POFWARN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for POFWARN event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum POFWARN_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: POFWARN_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `POFWARN` writer - Write '1' to Disable interrupt for POFWARN event"] +pub struct POFWARN_W<'a> { + w: &'a mut W, +} +impl<'a> POFWARN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: POFWARN_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(POFWARN_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for SLEEPENTER event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SLEEPENTER_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SLEEPENTER_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SLEEPENTER` reader - Write '1' to Disable interrupt for SLEEPENTER event"] +pub struct SLEEPENTER_R(crate::FieldReader); +impl SLEEPENTER_R { + pub(crate) fn new(bits: bool) -> Self { + SLEEPENTER_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SLEEPENTER_A { + match self.bits { + false => SLEEPENTER_A::DISABLED, + true => SLEEPENTER_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SLEEPENTER_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SLEEPENTER_A::ENABLED + } +} +impl core::ops::Deref for SLEEPENTER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for SLEEPENTER event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SLEEPENTER_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SLEEPENTER_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SLEEPENTER` writer - Write '1' to Disable interrupt for SLEEPENTER event"] +pub struct SLEEPENTER_W<'a> { + w: &'a mut W, +} +impl<'a> SLEEPENTER_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SLEEPENTER_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(SLEEPENTER_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for SLEEPEXIT event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SLEEPEXIT_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SLEEPEXIT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SLEEPEXIT` reader - Write '1' to Disable interrupt for SLEEPEXIT event"] +pub struct SLEEPEXIT_R(crate::FieldReader); +impl SLEEPEXIT_R { + pub(crate) fn new(bits: bool) -> Self { + SLEEPEXIT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SLEEPEXIT_A { + match self.bits { + false => SLEEPEXIT_A::DISABLED, + true => SLEEPEXIT_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SLEEPEXIT_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SLEEPEXIT_A::ENABLED + } +} +impl core::ops::Deref for SLEEPEXIT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for SLEEPEXIT event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SLEEPEXIT_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SLEEPEXIT_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SLEEPEXIT` writer - Write '1' to Disable interrupt for SLEEPEXIT event"] +pub struct SLEEPEXIT_W<'a> { + w: &'a mut W, +} +impl<'a> SLEEPEXIT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SLEEPEXIT_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(SLEEPEXIT_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +impl R { + #[doc = "Bit 2 - Write '1' to Disable interrupt for POFWARN event"] + #[inline(always)] + pub fn pofwarn(&self) -> POFWARN_R { + POFWARN_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 5 - Write '1' to Disable interrupt for SLEEPENTER event"] + #[inline(always)] + pub fn sleepenter(&self) -> SLEEPENTER_R { + SLEEPENTER_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Write '1' to Disable interrupt for SLEEPEXIT event"] + #[inline(always)] + pub fn sleepexit(&self) -> SLEEPEXIT_R { + SLEEPEXIT_R::new(((self.bits >> 6) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 2 - Write '1' to Disable interrupt for POFWARN event"] + #[inline(always)] + pub fn pofwarn(&mut self) -> POFWARN_W { + POFWARN_W { w: self } + } + #[doc = "Bit 5 - Write '1' to Disable interrupt for SLEEPENTER event"] + #[inline(always)] + pub fn sleepenter(&mut self) -> SLEEPENTER_W { + SLEEPENTER_W { w: self } + } + #[doc = "Bit 6 - Write '1' to Disable interrupt for SLEEPEXIT event"] + #[inline(always)] + pub fn sleepexit(&mut self) -> SLEEPEXIT_W { + SLEEPEXIT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/power/intenset.rs b/src/power/intenset.rs new file mode 100644 index 0000000..9a48bc4 --- /dev/null +++ b/src/power/intenset.rs @@ -0,0 +1,366 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for POFWARN event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum POFWARN_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: POFWARN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `POFWARN` reader - Write '1' to Enable interrupt for POFWARN event"] +pub struct POFWARN_R(crate::FieldReader); +impl POFWARN_R { + pub(crate) fn new(bits: bool) -> Self { + POFWARN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> POFWARN_A { + match self.bits { + false => POFWARN_A::DISABLED, + true => POFWARN_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == POFWARN_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == POFWARN_A::ENABLED + } +} +impl core::ops::Deref for POFWARN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for POFWARN event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum POFWARN_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: POFWARN_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `POFWARN` writer - Write '1' to Enable interrupt for POFWARN event"] +pub struct POFWARN_W<'a> { + w: &'a mut W, +} +impl<'a> POFWARN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: POFWARN_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(POFWARN_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for SLEEPENTER event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SLEEPENTER_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SLEEPENTER_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SLEEPENTER` reader - Write '1' to Enable interrupt for SLEEPENTER event"] +pub struct SLEEPENTER_R(crate::FieldReader); +impl SLEEPENTER_R { + pub(crate) fn new(bits: bool) -> Self { + SLEEPENTER_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SLEEPENTER_A { + match self.bits { + false => SLEEPENTER_A::DISABLED, + true => SLEEPENTER_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SLEEPENTER_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SLEEPENTER_A::ENABLED + } +} +impl core::ops::Deref for SLEEPENTER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for SLEEPENTER event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SLEEPENTER_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SLEEPENTER_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SLEEPENTER` writer - Write '1' to Enable interrupt for SLEEPENTER event"] +pub struct SLEEPENTER_W<'a> { + w: &'a mut W, +} +impl<'a> SLEEPENTER_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SLEEPENTER_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(SLEEPENTER_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for SLEEPEXIT event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SLEEPEXIT_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SLEEPEXIT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SLEEPEXIT` reader - Write '1' to Enable interrupt for SLEEPEXIT event"] +pub struct SLEEPEXIT_R(crate::FieldReader); +impl SLEEPEXIT_R { + pub(crate) fn new(bits: bool) -> Self { + SLEEPEXIT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SLEEPEXIT_A { + match self.bits { + false => SLEEPEXIT_A::DISABLED, + true => SLEEPEXIT_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SLEEPEXIT_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SLEEPEXIT_A::ENABLED + } +} +impl core::ops::Deref for SLEEPEXIT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for SLEEPEXIT event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SLEEPEXIT_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SLEEPEXIT_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SLEEPEXIT` writer - Write '1' to Enable interrupt for SLEEPEXIT event"] +pub struct SLEEPEXIT_W<'a> { + w: &'a mut W, +} +impl<'a> SLEEPEXIT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SLEEPEXIT_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(SLEEPEXIT_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +impl R { + #[doc = "Bit 2 - Write '1' to Enable interrupt for POFWARN event"] + #[inline(always)] + pub fn pofwarn(&self) -> POFWARN_R { + POFWARN_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 5 - Write '1' to Enable interrupt for SLEEPENTER event"] + #[inline(always)] + pub fn sleepenter(&self) -> SLEEPENTER_R { + SLEEPENTER_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Write '1' to Enable interrupt for SLEEPEXIT event"] + #[inline(always)] + pub fn sleepexit(&self) -> SLEEPEXIT_R { + SLEEPEXIT_R::new(((self.bits >> 6) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 2 - Write '1' to Enable interrupt for POFWARN event"] + #[inline(always)] + pub fn pofwarn(&mut self) -> POFWARN_W { + POFWARN_W { w: self } + } + #[doc = "Bit 5 - Write '1' to Enable interrupt for SLEEPENTER event"] + #[inline(always)] + pub fn sleepenter(&mut self) -> SLEEPENTER_W { + SLEEPENTER_W { w: self } + } + #[doc = "Bit 6 - Write '1' to Enable interrupt for SLEEPEXIT event"] + #[inline(always)] + pub fn sleepexit(&mut self) -> SLEEPEXIT_W { + SLEEPEXIT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/power/pofcon.rs b/src/power/pofcon.rs new file mode 100644 index 0000000..7daeac6 --- /dev/null +++ b/src/power/pofcon.rs @@ -0,0 +1,374 @@ +#[doc = "Register `POFCON` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `POFCON` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable power failure comparator\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum POF_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: POF_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `POF` reader - Enable or disable power failure comparator"] +pub struct POF_R(crate::FieldReader); +impl POF_R { + pub(crate) fn new(bits: bool) -> Self { + POF_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> POF_A { + match self.bits { + false => POF_A::DISABLED, + true => POF_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == POF_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == POF_A::ENABLED + } +} +impl core::ops::Deref for POF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `POF` writer - Enable or disable power failure comparator"] +pub struct POF_W<'a> { + w: &'a mut W, +} +impl<'a> POF_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: POF_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(POF_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(POF_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Power failure comparator threshold setting\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum THRESHOLD_A { + #[doc = "4: Set threshold to 1.7 V"] + V17 = 4, + #[doc = "5: Set threshold to 1.8 V"] + V18 = 5, + #[doc = "6: Set threshold to 1.9 V"] + V19 = 6, + #[doc = "7: Set threshold to 2.0 V"] + V20 = 7, + #[doc = "8: Set threshold to 2.1 V"] + V21 = 8, + #[doc = "9: Set threshold to 2.2 V"] + V22 = 9, + #[doc = "10: Set threshold to 2.3 V"] + V23 = 10, + #[doc = "11: Set threshold to 2.4 V"] + V24 = 11, + #[doc = "12: Set threshold to 2.5 V"] + V25 = 12, + #[doc = "13: Set threshold to 2.6 V"] + V26 = 13, + #[doc = "14: Set threshold to 2.7 V"] + V27 = 14, + #[doc = "15: Set threshold to 2.8 V"] + V28 = 15, +} +impl From for u8 { + #[inline(always)] + fn from(variant: THRESHOLD_A) -> Self { + variant as _ + } +} +#[doc = "Field `THRESHOLD` reader - Power failure comparator threshold setting"] +pub struct THRESHOLD_R(crate::FieldReader); +impl THRESHOLD_R { + pub(crate) fn new(bits: u8) -> Self { + THRESHOLD_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 4 => Some(THRESHOLD_A::V17), + 5 => Some(THRESHOLD_A::V18), + 6 => Some(THRESHOLD_A::V19), + 7 => Some(THRESHOLD_A::V20), + 8 => Some(THRESHOLD_A::V21), + 9 => Some(THRESHOLD_A::V22), + 10 => Some(THRESHOLD_A::V23), + 11 => Some(THRESHOLD_A::V24), + 12 => Some(THRESHOLD_A::V25), + 13 => Some(THRESHOLD_A::V26), + 14 => Some(THRESHOLD_A::V27), + 15 => Some(THRESHOLD_A::V28), + _ => None, + } + } + #[doc = "Checks if the value of the field is `V17`"] + #[inline(always)] + pub fn is_v17(&self) -> bool { + **self == THRESHOLD_A::V17 + } + #[doc = "Checks if the value of the field is `V18`"] + #[inline(always)] + pub fn is_v18(&self) -> bool { + **self == THRESHOLD_A::V18 + } + #[doc = "Checks if the value of the field is `V19`"] + #[inline(always)] + pub fn is_v19(&self) -> bool { + **self == THRESHOLD_A::V19 + } + #[doc = "Checks if the value of the field is `V20`"] + #[inline(always)] + pub fn is_v20(&self) -> bool { + **self == THRESHOLD_A::V20 + } + #[doc = "Checks if the value of the field is `V21`"] + #[inline(always)] + pub fn is_v21(&self) -> bool { + **self == THRESHOLD_A::V21 + } + #[doc = "Checks if the value of the field is `V22`"] + #[inline(always)] + pub fn is_v22(&self) -> bool { + **self == THRESHOLD_A::V22 + } + #[doc = "Checks if the value of the field is `V23`"] + #[inline(always)] + pub fn is_v23(&self) -> bool { + **self == THRESHOLD_A::V23 + } + #[doc = "Checks if the value of the field is `V24`"] + #[inline(always)] + pub fn is_v24(&self) -> bool { + **self == THRESHOLD_A::V24 + } + #[doc = "Checks if the value of the field is `V25`"] + #[inline(always)] + pub fn is_v25(&self) -> bool { + **self == THRESHOLD_A::V25 + } + #[doc = "Checks if the value of the field is `V26`"] + #[inline(always)] + pub fn is_v26(&self) -> bool { + **self == THRESHOLD_A::V26 + } + #[doc = "Checks if the value of the field is `V27`"] + #[inline(always)] + pub fn is_v27(&self) -> bool { + **self == THRESHOLD_A::V27 + } + #[doc = "Checks if the value of the field is `V28`"] + #[inline(always)] + pub fn is_v28(&self) -> bool { + **self == THRESHOLD_A::V28 + } +} +impl core::ops::Deref for THRESHOLD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `THRESHOLD` writer - Power failure comparator threshold setting"] +pub struct THRESHOLD_W<'a> { + w: &'a mut W, +} +impl<'a> THRESHOLD_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: THRESHOLD_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Set threshold to 1.7 V"] + #[inline(always)] + pub fn v17(self) -> &'a mut W { + self.variant(THRESHOLD_A::V17) + } + #[doc = "Set threshold to 1.8 V"] + #[inline(always)] + pub fn v18(self) -> &'a mut W { + self.variant(THRESHOLD_A::V18) + } + #[doc = "Set threshold to 1.9 V"] + #[inline(always)] + pub fn v19(self) -> &'a mut W { + self.variant(THRESHOLD_A::V19) + } + #[doc = "Set threshold to 2.0 V"] + #[inline(always)] + pub fn v20(self) -> &'a mut W { + self.variant(THRESHOLD_A::V20) + } + #[doc = "Set threshold to 2.1 V"] + #[inline(always)] + pub fn v21(self) -> &'a mut W { + self.variant(THRESHOLD_A::V21) + } + #[doc = "Set threshold to 2.2 V"] + #[inline(always)] + pub fn v22(self) -> &'a mut W { + self.variant(THRESHOLD_A::V22) + } + #[doc = "Set threshold to 2.3 V"] + #[inline(always)] + pub fn v23(self) -> &'a mut W { + self.variant(THRESHOLD_A::V23) + } + #[doc = "Set threshold to 2.4 V"] + #[inline(always)] + pub fn v24(self) -> &'a mut W { + self.variant(THRESHOLD_A::V24) + } + #[doc = "Set threshold to 2.5 V"] + #[inline(always)] + pub fn v25(self) -> &'a mut W { + self.variant(THRESHOLD_A::V25) + } + #[doc = "Set threshold to 2.6 V"] + #[inline(always)] + pub fn v26(self) -> &'a mut W { + self.variant(THRESHOLD_A::V26) + } + #[doc = "Set threshold to 2.7 V"] + #[inline(always)] + pub fn v27(self) -> &'a mut W { + self.variant(THRESHOLD_A::V27) + } + #[doc = "Set threshold to 2.8 V"] + #[inline(always)] + pub fn v28(self) -> &'a mut W { + self.variant(THRESHOLD_A::V28) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x0f << 1)) | ((value as u32 & 0x0f) << 1); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable or disable power failure comparator"] + #[inline(always)] + pub fn pof(&self) -> POF_R { + POF_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bits 1:4 - Power failure comparator threshold setting"] + #[inline(always)] + pub fn threshold(&self) -> THRESHOLD_R { + THRESHOLD_R::new(((self.bits >> 1) & 0x0f) as u8) + } +} +impl W { + #[doc = "Bit 0 - Enable or disable power failure comparator"] + #[inline(always)] + pub fn pof(&mut self) -> POF_W { + POF_W { w: self } + } + #[doc = "Bits 1:4 - Power failure comparator threshold setting"] + #[inline(always)] + pub fn threshold(&mut self) -> THRESHOLD_W { + THRESHOLD_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Power failure comparator configuration\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pofcon](index.html) module"] +pub struct POFCON_SPEC; +impl crate::RegisterSpec for POFCON_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pofcon::R](R) reader structure"] +impl crate::Readable for POFCON_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pofcon::W](W) writer structure"] +impl crate::Writable for POFCON_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets POFCON to value 0"] +impl crate::Resettable for POFCON_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/power/ram.rs b/src/power/ram.rs new file mode 100644 index 0000000..1457354 --- /dev/null +++ b/src/power/ram.rs @@ -0,0 +1,12 @@ +#[doc = "POWER register accessor: an alias for `Reg`"] +pub type POWER = crate::Reg; +#[doc = "Description cluster\\[0\\]: RAM0 power control register"] +pub mod power; +#[doc = "POWERSET register accessor: an alias for `Reg`"] +pub type POWERSET = crate::Reg; +#[doc = "Description cluster\\[0\\]: RAM0 power control set register"] +pub mod powerset; +#[doc = "POWERCLR register accessor: an alias for `Reg`"] +pub type POWERCLR = crate::Reg; +#[doc = "Description cluster\\[0\\]: RAM0 power control clear register"] +pub mod powerclr; diff --git a/src/power/ram/power.rs b/src/power/ram/power.rs new file mode 100644 index 0000000..065ad1f --- /dev/null +++ b/src/power/ram/power.rs @@ -0,0 +1,438 @@ +#[doc = "Register `POWER` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `POWER` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Keep RAM section S0 ON or OFF in System ON mode.\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum S0POWER_A { + #[doc = "0: Off"] + OFF = 0, + #[doc = "1: On"] + ON = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: S0POWER_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `S0POWER` reader - Keep RAM section S0 ON or OFF in System ON mode."] +pub struct S0POWER_R(crate::FieldReader); +impl S0POWER_R { + pub(crate) fn new(bits: bool) -> Self { + S0POWER_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> S0POWER_A { + match self.bits { + false => S0POWER_A::OFF, + true => S0POWER_A::ON, + } + } + #[doc = "Checks if the value of the field is `OFF`"] + #[inline(always)] + pub fn is_off(&self) -> bool { + **self == S0POWER_A::OFF + } + #[doc = "Checks if the value of the field is `ON`"] + #[inline(always)] + pub fn is_on(&self) -> bool { + **self == S0POWER_A::ON + } +} +impl core::ops::Deref for S0POWER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `S0POWER` writer - Keep RAM section S0 ON or OFF in System ON mode."] +pub struct S0POWER_W<'a> { + w: &'a mut W, +} +impl<'a> S0POWER_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: S0POWER_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Off"] + #[inline(always)] + pub fn off(self) -> &'a mut W { + self.variant(S0POWER_A::OFF) + } + #[doc = "On"] + #[inline(always)] + pub fn on(self) -> &'a mut W { + self.variant(S0POWER_A::ON) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Keep RAM section S1 ON or OFF in System ON mode.\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum S1POWER_A { + #[doc = "0: Off"] + OFF = 0, + #[doc = "1: On"] + ON = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: S1POWER_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `S1POWER` reader - Keep RAM section S1 ON or OFF in System ON mode."] +pub struct S1POWER_R(crate::FieldReader); +impl S1POWER_R { + pub(crate) fn new(bits: bool) -> Self { + S1POWER_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> S1POWER_A { + match self.bits { + false => S1POWER_A::OFF, + true => S1POWER_A::ON, + } + } + #[doc = "Checks if the value of the field is `OFF`"] + #[inline(always)] + pub fn is_off(&self) -> bool { + **self == S1POWER_A::OFF + } + #[doc = "Checks if the value of the field is `ON`"] + #[inline(always)] + pub fn is_on(&self) -> bool { + **self == S1POWER_A::ON + } +} +impl core::ops::Deref for S1POWER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `S1POWER` writer - Keep RAM section S1 ON or OFF in System ON mode."] +pub struct S1POWER_W<'a> { + w: &'a mut W, +} +impl<'a> S1POWER_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: S1POWER_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Off"] + #[inline(always)] + pub fn off(self) -> &'a mut W { + self.variant(S1POWER_A::OFF) + } + #[doc = "On"] + #[inline(always)] + pub fn on(self) -> &'a mut W { + self.variant(S1POWER_A::ON) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Keep retention on RAM section S0 when RAM section is in OFF\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum S0RETENTION_A { + #[doc = "0: Off"] + OFF = 0, + #[doc = "1: On"] + ON = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: S0RETENTION_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `S0RETENTION` reader - Keep retention on RAM section S0 when RAM section is in OFF"] +pub struct S0RETENTION_R(crate::FieldReader); +impl S0RETENTION_R { + pub(crate) fn new(bits: bool) -> Self { + S0RETENTION_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> S0RETENTION_A { + match self.bits { + false => S0RETENTION_A::OFF, + true => S0RETENTION_A::ON, + } + } + #[doc = "Checks if the value of the field is `OFF`"] + #[inline(always)] + pub fn is_off(&self) -> bool { + **self == S0RETENTION_A::OFF + } + #[doc = "Checks if the value of the field is `ON`"] + #[inline(always)] + pub fn is_on(&self) -> bool { + **self == S0RETENTION_A::ON + } +} +impl core::ops::Deref for S0RETENTION_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `S0RETENTION` writer - Keep retention on RAM section S0 when RAM section is in OFF"] +pub struct S0RETENTION_W<'a> { + w: &'a mut W, +} +impl<'a> S0RETENTION_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: S0RETENTION_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Off"] + #[inline(always)] + pub fn off(self) -> &'a mut W { + self.variant(S0RETENTION_A::OFF) + } + #[doc = "On"] + #[inline(always)] + pub fn on(self) -> &'a mut W { + self.variant(S0RETENTION_A::ON) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Keep retention on RAM section S1 when RAM section is in OFF\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum S1RETENTION_A { + #[doc = "0: Off"] + OFF = 0, + #[doc = "1: On"] + ON = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: S1RETENTION_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `S1RETENTION` reader - Keep retention on RAM section S1 when RAM section is in OFF"] +pub struct S1RETENTION_R(crate::FieldReader); +impl S1RETENTION_R { + pub(crate) fn new(bits: bool) -> Self { + S1RETENTION_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> S1RETENTION_A { + match self.bits { + false => S1RETENTION_A::OFF, + true => S1RETENTION_A::ON, + } + } + #[doc = "Checks if the value of the field is `OFF`"] + #[inline(always)] + pub fn is_off(&self) -> bool { + **self == S1RETENTION_A::OFF + } + #[doc = "Checks if the value of the field is `ON`"] + #[inline(always)] + pub fn is_on(&self) -> bool { + **self == S1RETENTION_A::ON + } +} +impl core::ops::Deref for S1RETENTION_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `S1RETENTION` writer - Keep retention on RAM section S1 when RAM section is in OFF"] +pub struct S1RETENTION_W<'a> { + w: &'a mut W, +} +impl<'a> S1RETENTION_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: S1RETENTION_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Off"] + #[inline(always)] + pub fn off(self) -> &'a mut W { + self.variant(S1RETENTION_A::OFF) + } + #[doc = "On"] + #[inline(always)] + pub fn on(self) -> &'a mut W { + self.variant(S1RETENTION_A::ON) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +impl R { + #[doc = "Bit 0 - Keep RAM section S0 ON or OFF in System ON mode."] + #[inline(always)] + pub fn s0power(&self) -> S0POWER_R { + S0POWER_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Keep RAM section S1 ON or OFF in System ON mode."] + #[inline(always)] + pub fn s1power(&self) -> S1POWER_R { + S1POWER_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 16 - Keep retention on RAM section S0 when RAM section is in OFF"] + #[inline(always)] + pub fn s0retention(&self) -> S0RETENTION_R { + S0RETENTION_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Keep retention on RAM section S1 when RAM section is in OFF"] + #[inline(always)] + pub fn s1retention(&self) -> S1RETENTION_R { + S1RETENTION_R::new(((self.bits >> 17) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Keep RAM section S0 ON or OFF in System ON mode."] + #[inline(always)] + pub fn s0power(&mut self) -> S0POWER_W { + S0POWER_W { w: self } + } + #[doc = "Bit 1 - Keep RAM section S1 ON or OFF in System ON mode."] + #[inline(always)] + pub fn s1power(&mut self) -> S1POWER_W { + S1POWER_W { w: self } + } + #[doc = "Bit 16 - Keep retention on RAM section S0 when RAM section is in OFF"] + #[inline(always)] + pub fn s0retention(&mut self) -> S0RETENTION_W { + S0RETENTION_W { w: self } + } + #[doc = "Bit 17 - Keep retention on RAM section S1 when RAM section is in OFF"] + #[inline(always)] + pub fn s1retention(&mut self) -> S1RETENTION_W { + S1RETENTION_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description cluster\\[0\\]: RAM0 power control register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [power](index.html) module"] +pub struct POWER_SPEC; +impl crate::RegisterSpec for POWER_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [power::R](R) reader structure"] +impl crate::Readable for POWER_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [power::W](W) writer structure"] +impl crate::Writable for POWER_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets POWER to value 0xffff"] +impl crate::Resettable for POWER_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff + } +} diff --git a/src/power/ram/powerclr.rs b/src/power/ram/powerclr.rs new file mode 100644 index 0000000..862a66a --- /dev/null +++ b/src/power/ram/powerclr.rs @@ -0,0 +1,241 @@ +#[doc = "Register `POWERCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Keep RAM section S0 of RAM0 on or off in System ON mode\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum S0POWER_AW { + #[doc = "1: Off"] + OFF = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: S0POWER_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `S0POWER` writer - Keep RAM section S0 of RAM0 on or off in System ON mode"] +pub struct S0POWER_W<'a> { + w: &'a mut W, +} +impl<'a> S0POWER_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: S0POWER_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Off"] + #[inline(always)] + pub fn off(self) -> &'a mut W { + self.variant(S0POWER_AW::OFF) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Keep RAM section S1 of RAM0 on or off in System ON mode\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum S1POWER_AW { + #[doc = "1: Off"] + OFF = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: S1POWER_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `S1POWER` writer - Keep RAM section S1 of RAM0 on or off in System ON mode"] +pub struct S1POWER_W<'a> { + w: &'a mut W, +} +impl<'a> S1POWER_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: S1POWER_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Off"] + #[inline(always)] + pub fn off(self) -> &'a mut W { + self.variant(S1POWER_AW::OFF) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Keep retention on RAM section S0 when RAM section is switched off\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum S0RETENTION_AW { + #[doc = "1: Off"] + OFF = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: S0RETENTION_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `S0RETENTION` writer - Keep retention on RAM section S0 when RAM section is switched off"] +pub struct S0RETENTION_W<'a> { + w: &'a mut W, +} +impl<'a> S0RETENTION_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: S0RETENTION_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Off"] + #[inline(always)] + pub fn off(self) -> &'a mut W { + self.variant(S0RETENTION_AW::OFF) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Keep retention on RAM section S1 when RAM section is switched off\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum S1RETENTION_AW { + #[doc = "1: Off"] + OFF = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: S1RETENTION_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `S1RETENTION` writer - Keep retention on RAM section S1 when RAM section is switched off"] +pub struct S1RETENTION_W<'a> { + w: &'a mut W, +} +impl<'a> S1RETENTION_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: S1RETENTION_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Off"] + #[inline(always)] + pub fn off(self) -> &'a mut W { + self.variant(S1RETENTION_AW::OFF) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +impl W { + #[doc = "Bit 0 - Keep RAM section S0 of RAM0 on or off in System ON mode"] + #[inline(always)] + pub fn s0power(&mut self) -> S0POWER_W { + S0POWER_W { w: self } + } + #[doc = "Bit 1 - Keep RAM section S1 of RAM0 on or off in System ON mode"] + #[inline(always)] + pub fn s1power(&mut self) -> S1POWER_W { + S1POWER_W { w: self } + } + #[doc = "Bit 16 - Keep retention on RAM section S0 when RAM section is switched off"] + #[inline(always)] + pub fn s0retention(&mut self) -> S0RETENTION_W { + S0RETENTION_W { w: self } + } + #[doc = "Bit 17 - Keep retention on RAM section S1 when RAM section is switched off"] + #[inline(always)] + pub fn s1retention(&mut self) -> S1RETENTION_W { + S1RETENTION_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description cluster\\[0\\]: RAM0 power control clear register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [powerclr](index.html) module"] +pub struct POWERCLR_SPEC; +impl crate::RegisterSpec for POWERCLR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [powerclr::W](W) writer structure"] +impl crate::Writable for POWERCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets POWERCLR to value 0xffff"] +impl crate::Resettable for POWERCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff + } +} diff --git a/src/power/ram/powerset.rs b/src/power/ram/powerset.rs new file mode 100644 index 0000000..b645394 --- /dev/null +++ b/src/power/ram/powerset.rs @@ -0,0 +1,241 @@ +#[doc = "Register `POWERSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Keep RAM section S0 of RAM0 on or off in System ON mode\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum S0POWER_AW { + #[doc = "1: On"] + ON = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: S0POWER_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `S0POWER` writer - Keep RAM section S0 of RAM0 on or off in System ON mode"] +pub struct S0POWER_W<'a> { + w: &'a mut W, +} +impl<'a> S0POWER_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: S0POWER_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "On"] + #[inline(always)] + pub fn on(self) -> &'a mut W { + self.variant(S0POWER_AW::ON) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Keep RAM section S1 of RAM0 on or off in System ON mode\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum S1POWER_AW { + #[doc = "1: On"] + ON = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: S1POWER_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `S1POWER` writer - Keep RAM section S1 of RAM0 on or off in System ON mode"] +pub struct S1POWER_W<'a> { + w: &'a mut W, +} +impl<'a> S1POWER_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: S1POWER_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "On"] + #[inline(always)] + pub fn on(self) -> &'a mut W { + self.variant(S1POWER_AW::ON) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Keep retention on RAM section S0 when RAM section is switched off\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum S0RETENTION_AW { + #[doc = "1: On"] + ON = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: S0RETENTION_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `S0RETENTION` writer - Keep retention on RAM section S0 when RAM section is switched off"] +pub struct S0RETENTION_W<'a> { + w: &'a mut W, +} +impl<'a> S0RETENTION_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: S0RETENTION_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "On"] + #[inline(always)] + pub fn on(self) -> &'a mut W { + self.variant(S0RETENTION_AW::ON) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Keep retention on RAM section S1 when RAM section is switched off\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum S1RETENTION_AW { + #[doc = "1: On"] + ON = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: S1RETENTION_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `S1RETENTION` writer - Keep retention on RAM section S1 when RAM section is switched off"] +pub struct S1RETENTION_W<'a> { + w: &'a mut W, +} +impl<'a> S1RETENTION_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: S1RETENTION_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "On"] + #[inline(always)] + pub fn on(self) -> &'a mut W { + self.variant(S1RETENTION_AW::ON) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +impl W { + #[doc = "Bit 0 - Keep RAM section S0 of RAM0 on or off in System ON mode"] + #[inline(always)] + pub fn s0power(&mut self) -> S0POWER_W { + S0POWER_W { w: self } + } + #[doc = "Bit 1 - Keep RAM section S1 of RAM0 on or off in System ON mode"] + #[inline(always)] + pub fn s1power(&mut self) -> S1POWER_W { + S1POWER_W { w: self } + } + #[doc = "Bit 16 - Keep retention on RAM section S0 when RAM section is switched off"] + #[inline(always)] + pub fn s0retention(&mut self) -> S0RETENTION_W { + S0RETENTION_W { w: self } + } + #[doc = "Bit 17 - Keep retention on RAM section S1 when RAM section is switched off"] + #[inline(always)] + pub fn s1retention(&mut self) -> S1RETENTION_W { + S1RETENTION_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description cluster\\[0\\]: RAM0 power control set register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [powerset](index.html) module"] +pub struct POWERSET_SPEC; +impl crate::RegisterSpec for POWERSET_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [powerset::W](W) writer structure"] +impl crate::Writable for POWERSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets POWERSET to value 0xffff"] +impl crate::Resettable for POWERSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff + } +} diff --git a/src/power/ramon.rs b/src/power/ramon.rs new file mode 100644 index 0000000..dd1a487 --- /dev/null +++ b/src/power/ramon.rs @@ -0,0 +1,438 @@ +#[doc = "Register `RAMON` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `RAMON` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Keep RAM block 0 on or off in system ON Mode\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ONRAM0_A { + #[doc = "0: Off"] + RAM0OFF = 0, + #[doc = "1: On"] + RAM0ON = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ONRAM0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ONRAM0` reader - Keep RAM block 0 on or off in system ON Mode"] +pub struct ONRAM0_R(crate::FieldReader); +impl ONRAM0_R { + pub(crate) fn new(bits: bool) -> Self { + ONRAM0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ONRAM0_A { + match self.bits { + false => ONRAM0_A::RAM0OFF, + true => ONRAM0_A::RAM0ON, + } + } + #[doc = "Checks if the value of the field is `RAM0OFF`"] + #[inline(always)] + pub fn is_ram0off(&self) -> bool { + **self == ONRAM0_A::RAM0OFF + } + #[doc = "Checks if the value of the field is `RAM0ON`"] + #[inline(always)] + pub fn is_ram0on(&self) -> bool { + **self == ONRAM0_A::RAM0ON + } +} +impl core::ops::Deref for ONRAM0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ONRAM0` writer - Keep RAM block 0 on or off in system ON Mode"] +pub struct ONRAM0_W<'a> { + w: &'a mut W, +} +impl<'a> ONRAM0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ONRAM0_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Off"] + #[inline(always)] + pub fn ram0off(self) -> &'a mut W { + self.variant(ONRAM0_A::RAM0OFF) + } + #[doc = "On"] + #[inline(always)] + pub fn ram0on(self) -> &'a mut W { + self.variant(ONRAM0_A::RAM0ON) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Keep RAM block 1 on or off in system ON Mode\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ONRAM1_A { + #[doc = "0: Off"] + RAM1OFF = 0, + #[doc = "1: On"] + RAM1ON = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ONRAM1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ONRAM1` reader - Keep RAM block 1 on or off in system ON Mode"] +pub struct ONRAM1_R(crate::FieldReader); +impl ONRAM1_R { + pub(crate) fn new(bits: bool) -> Self { + ONRAM1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ONRAM1_A { + match self.bits { + false => ONRAM1_A::RAM1OFF, + true => ONRAM1_A::RAM1ON, + } + } + #[doc = "Checks if the value of the field is `RAM1OFF`"] + #[inline(always)] + pub fn is_ram1off(&self) -> bool { + **self == ONRAM1_A::RAM1OFF + } + #[doc = "Checks if the value of the field is `RAM1ON`"] + #[inline(always)] + pub fn is_ram1on(&self) -> bool { + **self == ONRAM1_A::RAM1ON + } +} +impl core::ops::Deref for ONRAM1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ONRAM1` writer - Keep RAM block 1 on or off in system ON Mode"] +pub struct ONRAM1_W<'a> { + w: &'a mut W, +} +impl<'a> ONRAM1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ONRAM1_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Off"] + #[inline(always)] + pub fn ram1off(self) -> &'a mut W { + self.variant(ONRAM1_A::RAM1OFF) + } + #[doc = "On"] + #[inline(always)] + pub fn ram1on(self) -> &'a mut W { + self.variant(ONRAM1_A::RAM1ON) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Keep retention on RAM block 0 when RAM block is switched off\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OFFRAM0_A { + #[doc = "0: Off"] + RAM0OFF = 0, + #[doc = "1: On"] + RAM0ON = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OFFRAM0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OFFRAM0` reader - Keep retention on RAM block 0 when RAM block is switched off"] +pub struct OFFRAM0_R(crate::FieldReader); +impl OFFRAM0_R { + pub(crate) fn new(bits: bool) -> Self { + OFFRAM0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> OFFRAM0_A { + match self.bits { + false => OFFRAM0_A::RAM0OFF, + true => OFFRAM0_A::RAM0ON, + } + } + #[doc = "Checks if the value of the field is `RAM0OFF`"] + #[inline(always)] + pub fn is_ram0off(&self) -> bool { + **self == OFFRAM0_A::RAM0OFF + } + #[doc = "Checks if the value of the field is `RAM0ON`"] + #[inline(always)] + pub fn is_ram0on(&self) -> bool { + **self == OFFRAM0_A::RAM0ON + } +} +impl core::ops::Deref for OFFRAM0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OFFRAM0` writer - Keep retention on RAM block 0 when RAM block is switched off"] +pub struct OFFRAM0_W<'a> { + w: &'a mut W, +} +impl<'a> OFFRAM0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: OFFRAM0_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Off"] + #[inline(always)] + pub fn ram0off(self) -> &'a mut W { + self.variant(OFFRAM0_A::RAM0OFF) + } + #[doc = "On"] + #[inline(always)] + pub fn ram0on(self) -> &'a mut W { + self.variant(OFFRAM0_A::RAM0ON) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Keep retention on RAM block 1 when RAM block is switched off\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OFFRAM1_A { + #[doc = "0: Off"] + RAM1OFF = 0, + #[doc = "1: On"] + RAM1ON = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OFFRAM1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OFFRAM1` reader - Keep retention on RAM block 1 when RAM block is switched off"] +pub struct OFFRAM1_R(crate::FieldReader); +impl OFFRAM1_R { + pub(crate) fn new(bits: bool) -> Self { + OFFRAM1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> OFFRAM1_A { + match self.bits { + false => OFFRAM1_A::RAM1OFF, + true => OFFRAM1_A::RAM1ON, + } + } + #[doc = "Checks if the value of the field is `RAM1OFF`"] + #[inline(always)] + pub fn is_ram1off(&self) -> bool { + **self == OFFRAM1_A::RAM1OFF + } + #[doc = "Checks if the value of the field is `RAM1ON`"] + #[inline(always)] + pub fn is_ram1on(&self) -> bool { + **self == OFFRAM1_A::RAM1ON + } +} +impl core::ops::Deref for OFFRAM1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OFFRAM1` writer - Keep retention on RAM block 1 when RAM block is switched off"] +pub struct OFFRAM1_W<'a> { + w: &'a mut W, +} +impl<'a> OFFRAM1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: OFFRAM1_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Off"] + #[inline(always)] + pub fn ram1off(self) -> &'a mut W { + self.variant(OFFRAM1_A::RAM1OFF) + } + #[doc = "On"] + #[inline(always)] + pub fn ram1on(self) -> &'a mut W { + self.variant(OFFRAM1_A::RAM1ON) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +impl R { + #[doc = "Bit 0 - Keep RAM block 0 on or off in system ON Mode"] + #[inline(always)] + pub fn onram0(&self) -> ONRAM0_R { + ONRAM0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Keep RAM block 1 on or off in system ON Mode"] + #[inline(always)] + pub fn onram1(&self) -> ONRAM1_R { + ONRAM1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 16 - Keep retention on RAM block 0 when RAM block is switched off"] + #[inline(always)] + pub fn offram0(&self) -> OFFRAM0_R { + OFFRAM0_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Keep retention on RAM block 1 when RAM block is switched off"] + #[inline(always)] + pub fn offram1(&self) -> OFFRAM1_R { + OFFRAM1_R::new(((self.bits >> 17) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Keep RAM block 0 on or off in system ON Mode"] + #[inline(always)] + pub fn onram0(&mut self) -> ONRAM0_W { + ONRAM0_W { w: self } + } + #[doc = "Bit 1 - Keep RAM block 1 on or off in system ON Mode"] + #[inline(always)] + pub fn onram1(&mut self) -> ONRAM1_W { + ONRAM1_W { w: self } + } + #[doc = "Bit 16 - Keep retention on RAM block 0 when RAM block is switched off"] + #[inline(always)] + pub fn offram0(&mut self) -> OFFRAM0_W { + OFFRAM0_W { w: self } + } + #[doc = "Bit 17 - Keep retention on RAM block 1 when RAM block is switched off"] + #[inline(always)] + pub fn offram1(&mut self) -> OFFRAM1_W { + OFFRAM1_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Deprecated register - RAM on/off register (this register is retained)\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ramon](index.html) module"] +pub struct RAMON_SPEC; +impl crate::RegisterSpec for RAMON_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ramon::R](R) reader structure"] +impl crate::Readable for RAMON_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ramon::W](W) writer structure"] +impl crate::Writable for RAMON_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets RAMON to value 0x03"] +impl crate::Resettable for RAMON_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x03 + } +} diff --git a/src/power/ramonb.rs b/src/power/ramonb.rs new file mode 100644 index 0000000..29f16e9 --- /dev/null +++ b/src/power/ramonb.rs @@ -0,0 +1,438 @@ +#[doc = "Register `RAMONB` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `RAMONB` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Keep RAM block 2 on or off in system ON Mode\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ONRAM2_A { + #[doc = "0: Off"] + RAM2OFF = 0, + #[doc = "1: On"] + RAM2ON = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ONRAM2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ONRAM2` reader - Keep RAM block 2 on or off in system ON Mode"] +pub struct ONRAM2_R(crate::FieldReader); +impl ONRAM2_R { + pub(crate) fn new(bits: bool) -> Self { + ONRAM2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ONRAM2_A { + match self.bits { + false => ONRAM2_A::RAM2OFF, + true => ONRAM2_A::RAM2ON, + } + } + #[doc = "Checks if the value of the field is `RAM2OFF`"] + #[inline(always)] + pub fn is_ram2off(&self) -> bool { + **self == ONRAM2_A::RAM2OFF + } + #[doc = "Checks if the value of the field is `RAM2ON`"] + #[inline(always)] + pub fn is_ram2on(&self) -> bool { + **self == ONRAM2_A::RAM2ON + } +} +impl core::ops::Deref for ONRAM2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ONRAM2` writer - Keep RAM block 2 on or off in system ON Mode"] +pub struct ONRAM2_W<'a> { + w: &'a mut W, +} +impl<'a> ONRAM2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ONRAM2_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Off"] + #[inline(always)] + pub fn ram2off(self) -> &'a mut W { + self.variant(ONRAM2_A::RAM2OFF) + } + #[doc = "On"] + #[inline(always)] + pub fn ram2on(self) -> &'a mut W { + self.variant(ONRAM2_A::RAM2ON) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Keep RAM block 3 on or off in system ON Mode\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ONRAM3_A { + #[doc = "0: Off"] + RAM3OFF = 0, + #[doc = "1: On"] + RAM3ON = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ONRAM3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ONRAM3` reader - Keep RAM block 3 on or off in system ON Mode"] +pub struct ONRAM3_R(crate::FieldReader); +impl ONRAM3_R { + pub(crate) fn new(bits: bool) -> Self { + ONRAM3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ONRAM3_A { + match self.bits { + false => ONRAM3_A::RAM3OFF, + true => ONRAM3_A::RAM3ON, + } + } + #[doc = "Checks if the value of the field is `RAM3OFF`"] + #[inline(always)] + pub fn is_ram3off(&self) -> bool { + **self == ONRAM3_A::RAM3OFF + } + #[doc = "Checks if the value of the field is `RAM3ON`"] + #[inline(always)] + pub fn is_ram3on(&self) -> bool { + **self == ONRAM3_A::RAM3ON + } +} +impl core::ops::Deref for ONRAM3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ONRAM3` writer - Keep RAM block 3 on or off in system ON Mode"] +pub struct ONRAM3_W<'a> { + w: &'a mut W, +} +impl<'a> ONRAM3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ONRAM3_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Off"] + #[inline(always)] + pub fn ram3off(self) -> &'a mut W { + self.variant(ONRAM3_A::RAM3OFF) + } + #[doc = "On"] + #[inline(always)] + pub fn ram3on(self) -> &'a mut W { + self.variant(ONRAM3_A::RAM3ON) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Keep retention on RAM block 2 when RAM block is switched off\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OFFRAM2_A { + #[doc = "0: Off"] + RAM2OFF = 0, + #[doc = "1: On"] + RAM2ON = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OFFRAM2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OFFRAM2` reader - Keep retention on RAM block 2 when RAM block is switched off"] +pub struct OFFRAM2_R(crate::FieldReader); +impl OFFRAM2_R { + pub(crate) fn new(bits: bool) -> Self { + OFFRAM2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> OFFRAM2_A { + match self.bits { + false => OFFRAM2_A::RAM2OFF, + true => OFFRAM2_A::RAM2ON, + } + } + #[doc = "Checks if the value of the field is `RAM2OFF`"] + #[inline(always)] + pub fn is_ram2off(&self) -> bool { + **self == OFFRAM2_A::RAM2OFF + } + #[doc = "Checks if the value of the field is `RAM2ON`"] + #[inline(always)] + pub fn is_ram2on(&self) -> bool { + **self == OFFRAM2_A::RAM2ON + } +} +impl core::ops::Deref for OFFRAM2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OFFRAM2` writer - Keep retention on RAM block 2 when RAM block is switched off"] +pub struct OFFRAM2_W<'a> { + w: &'a mut W, +} +impl<'a> OFFRAM2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: OFFRAM2_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Off"] + #[inline(always)] + pub fn ram2off(self) -> &'a mut W { + self.variant(OFFRAM2_A::RAM2OFF) + } + #[doc = "On"] + #[inline(always)] + pub fn ram2on(self) -> &'a mut W { + self.variant(OFFRAM2_A::RAM2ON) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Keep retention on RAM block 3 when RAM block is switched off\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OFFRAM3_A { + #[doc = "0: Off"] + RAM3OFF = 0, + #[doc = "1: On"] + RAM3ON = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OFFRAM3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OFFRAM3` reader - Keep retention on RAM block 3 when RAM block is switched off"] +pub struct OFFRAM3_R(crate::FieldReader); +impl OFFRAM3_R { + pub(crate) fn new(bits: bool) -> Self { + OFFRAM3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> OFFRAM3_A { + match self.bits { + false => OFFRAM3_A::RAM3OFF, + true => OFFRAM3_A::RAM3ON, + } + } + #[doc = "Checks if the value of the field is `RAM3OFF`"] + #[inline(always)] + pub fn is_ram3off(&self) -> bool { + **self == OFFRAM3_A::RAM3OFF + } + #[doc = "Checks if the value of the field is `RAM3ON`"] + #[inline(always)] + pub fn is_ram3on(&self) -> bool { + **self == OFFRAM3_A::RAM3ON + } +} +impl core::ops::Deref for OFFRAM3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OFFRAM3` writer - Keep retention on RAM block 3 when RAM block is switched off"] +pub struct OFFRAM3_W<'a> { + w: &'a mut W, +} +impl<'a> OFFRAM3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: OFFRAM3_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Off"] + #[inline(always)] + pub fn ram3off(self) -> &'a mut W { + self.variant(OFFRAM3_A::RAM3OFF) + } + #[doc = "On"] + #[inline(always)] + pub fn ram3on(self) -> &'a mut W { + self.variant(OFFRAM3_A::RAM3ON) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +impl R { + #[doc = "Bit 0 - Keep RAM block 2 on or off in system ON Mode"] + #[inline(always)] + pub fn onram2(&self) -> ONRAM2_R { + ONRAM2_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Keep RAM block 3 on or off in system ON Mode"] + #[inline(always)] + pub fn onram3(&self) -> ONRAM3_R { + ONRAM3_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 16 - Keep retention on RAM block 2 when RAM block is switched off"] + #[inline(always)] + pub fn offram2(&self) -> OFFRAM2_R { + OFFRAM2_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Keep retention on RAM block 3 when RAM block is switched off"] + #[inline(always)] + pub fn offram3(&self) -> OFFRAM3_R { + OFFRAM3_R::new(((self.bits >> 17) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Keep RAM block 2 on or off in system ON Mode"] + #[inline(always)] + pub fn onram2(&mut self) -> ONRAM2_W { + ONRAM2_W { w: self } + } + #[doc = "Bit 1 - Keep RAM block 3 on or off in system ON Mode"] + #[inline(always)] + pub fn onram3(&mut self) -> ONRAM3_W { + ONRAM3_W { w: self } + } + #[doc = "Bit 16 - Keep retention on RAM block 2 when RAM block is switched off"] + #[inline(always)] + pub fn offram2(&mut self) -> OFFRAM2_W { + OFFRAM2_W { w: self } + } + #[doc = "Bit 17 - Keep retention on RAM block 3 when RAM block is switched off"] + #[inline(always)] + pub fn offram3(&mut self) -> OFFRAM3_W { + OFFRAM3_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Deprecated register - RAM on/off register (this register is retained)\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ramonb](index.html) module"] +pub struct RAMONB_SPEC; +impl crate::RegisterSpec for RAMONB_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ramonb::R](R) reader structure"] +impl crate::Readable for RAMONB_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ramonb::W](W) writer structure"] +impl crate::Writable for RAMONB_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets RAMONB to value 0x03"] +impl crate::Resettable for RAMONB_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x03 + } +} diff --git a/src/power/ramstatus.rs b/src/power/ramstatus.rs new file mode 100644 index 0000000..769d504 --- /dev/null +++ b/src/power/ramstatus.rs @@ -0,0 +1,237 @@ +#[doc = "Register `RAMSTATUS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "RAM block 0 is on or off/powering up\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RAMBLOCK0_A { + #[doc = "0: Off"] + OFF = 0, + #[doc = "1: On"] + ON = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RAMBLOCK0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RAMBLOCK0` reader - RAM block 0 is on or off/powering up"] +pub struct RAMBLOCK0_R(crate::FieldReader); +impl RAMBLOCK0_R { + pub(crate) fn new(bits: bool) -> Self { + RAMBLOCK0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RAMBLOCK0_A { + match self.bits { + false => RAMBLOCK0_A::OFF, + true => RAMBLOCK0_A::ON, + } + } + #[doc = "Checks if the value of the field is `OFF`"] + #[inline(always)] + pub fn is_off(&self) -> bool { + **self == RAMBLOCK0_A::OFF + } + #[doc = "Checks if the value of the field is `ON`"] + #[inline(always)] + pub fn is_on(&self) -> bool { + **self == RAMBLOCK0_A::ON + } +} +impl core::ops::Deref for RAMBLOCK0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "RAM block 1 is on or off/powering up\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RAMBLOCK1_A { + #[doc = "0: Off"] + OFF = 0, + #[doc = "1: On"] + ON = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RAMBLOCK1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RAMBLOCK1` reader - RAM block 1 is on or off/powering up"] +pub struct RAMBLOCK1_R(crate::FieldReader); +impl RAMBLOCK1_R { + pub(crate) fn new(bits: bool) -> Self { + RAMBLOCK1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RAMBLOCK1_A { + match self.bits { + false => RAMBLOCK1_A::OFF, + true => RAMBLOCK1_A::ON, + } + } + #[doc = "Checks if the value of the field is `OFF`"] + #[inline(always)] + pub fn is_off(&self) -> bool { + **self == RAMBLOCK1_A::OFF + } + #[doc = "Checks if the value of the field is `ON`"] + #[inline(always)] + pub fn is_on(&self) -> bool { + **self == RAMBLOCK1_A::ON + } +} +impl core::ops::Deref for RAMBLOCK1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "RAM block 2 is on or off/powering up\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RAMBLOCK2_A { + #[doc = "0: Off"] + OFF = 0, + #[doc = "1: On"] + ON = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RAMBLOCK2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RAMBLOCK2` reader - RAM block 2 is on or off/powering up"] +pub struct RAMBLOCK2_R(crate::FieldReader); +impl RAMBLOCK2_R { + pub(crate) fn new(bits: bool) -> Self { + RAMBLOCK2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RAMBLOCK2_A { + match self.bits { + false => RAMBLOCK2_A::OFF, + true => RAMBLOCK2_A::ON, + } + } + #[doc = "Checks if the value of the field is `OFF`"] + #[inline(always)] + pub fn is_off(&self) -> bool { + **self == RAMBLOCK2_A::OFF + } + #[doc = "Checks if the value of the field is `ON`"] + #[inline(always)] + pub fn is_on(&self) -> bool { + **self == RAMBLOCK2_A::ON + } +} +impl core::ops::Deref for RAMBLOCK2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "RAM block 3 is on or off/powering up\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RAMBLOCK3_A { + #[doc = "0: Off"] + OFF = 0, + #[doc = "1: On"] + ON = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RAMBLOCK3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RAMBLOCK3` reader - RAM block 3 is on or off/powering up"] +pub struct RAMBLOCK3_R(crate::FieldReader); +impl RAMBLOCK3_R { + pub(crate) fn new(bits: bool) -> Self { + RAMBLOCK3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RAMBLOCK3_A { + match self.bits { + false => RAMBLOCK3_A::OFF, + true => RAMBLOCK3_A::ON, + } + } + #[doc = "Checks if the value of the field is `OFF`"] + #[inline(always)] + pub fn is_off(&self) -> bool { + **self == RAMBLOCK3_A::OFF + } + #[doc = "Checks if the value of the field is `ON`"] + #[inline(always)] + pub fn is_on(&self) -> bool { + **self == RAMBLOCK3_A::ON + } +} +impl core::ops::Deref for RAMBLOCK3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bit 0 - RAM block 0 is on or off/powering up"] + #[inline(always)] + pub fn ramblock0(&self) -> RAMBLOCK0_R { + RAMBLOCK0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - RAM block 1 is on or off/powering up"] + #[inline(always)] + pub fn ramblock1(&self) -> RAMBLOCK1_R { + RAMBLOCK1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - RAM block 2 is on or off/powering up"] + #[inline(always)] + pub fn ramblock2(&self) -> RAMBLOCK2_R { + RAMBLOCK2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - RAM block 3 is on or off/powering up"] + #[inline(always)] + pub fn ramblock3(&self) -> RAMBLOCK3_R { + RAMBLOCK3_R::new(((self.bits >> 3) & 0x01) != 0) + } +} +#[doc = "Deprecated register - RAM status register\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 [ramstatus](index.html) module"] +pub struct RAMSTATUS_SPEC; +impl crate::RegisterSpec for RAMSTATUS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ramstatus::R](R) reader structure"] +impl crate::Readable for RAMSTATUS_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets RAMSTATUS to value 0"] +impl crate::Resettable for RAMSTATUS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/power/resetreas.rs b/src/power/resetreas.rs new file mode 100644 index 0000000..e6562d0 --- /dev/null +++ b/src/power/resetreas.rs @@ -0,0 +1,810 @@ +#[doc = "Register `RESETREAS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `RESETREAS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Reset from pin-reset detected\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RESETPIN_A { + #[doc = "0: Not detected"] + NOTDETECTED = 0, + #[doc = "1: Detected"] + DETECTED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RESETPIN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RESETPIN` reader - Reset from pin-reset detected"] +pub struct RESETPIN_R(crate::FieldReader); +impl RESETPIN_R { + pub(crate) fn new(bits: bool) -> Self { + RESETPIN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RESETPIN_A { + match self.bits { + false => RESETPIN_A::NOTDETECTED, + true => RESETPIN_A::DETECTED, + } + } + #[doc = "Checks if the value of the field is `NOTDETECTED`"] + #[inline(always)] + pub fn is_not_detected(&self) -> bool { + **self == RESETPIN_A::NOTDETECTED + } + #[doc = "Checks if the value of the field is `DETECTED`"] + #[inline(always)] + pub fn is_detected(&self) -> bool { + **self == RESETPIN_A::DETECTED + } +} +impl core::ops::Deref for RESETPIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RESETPIN` writer - Reset from pin-reset detected"] +pub struct RESETPIN_W<'a> { + w: &'a mut W, +} +impl<'a> RESETPIN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RESETPIN_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Not detected"] + #[inline(always)] + pub fn not_detected(self) -> &'a mut W { + self.variant(RESETPIN_A::NOTDETECTED) + } + #[doc = "Detected"] + #[inline(always)] + pub fn detected(self) -> &'a mut W { + self.variant(RESETPIN_A::DETECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Reset from watchdog detected\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DOG_A { + #[doc = "0: Not detected"] + NOTDETECTED = 0, + #[doc = "1: Detected"] + DETECTED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DOG_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DOG` reader - Reset from watchdog detected"] +pub struct DOG_R(crate::FieldReader); +impl DOG_R { + pub(crate) fn new(bits: bool) -> Self { + DOG_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DOG_A { + match self.bits { + false => DOG_A::NOTDETECTED, + true => DOG_A::DETECTED, + } + } + #[doc = "Checks if the value of the field is `NOTDETECTED`"] + #[inline(always)] + pub fn is_not_detected(&self) -> bool { + **self == DOG_A::NOTDETECTED + } + #[doc = "Checks if the value of the field is `DETECTED`"] + #[inline(always)] + pub fn is_detected(&self) -> bool { + **self == DOG_A::DETECTED + } +} +impl core::ops::Deref for DOG_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DOG` writer - Reset from watchdog detected"] +pub struct DOG_W<'a> { + w: &'a mut W, +} +impl<'a> DOG_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DOG_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Not detected"] + #[inline(always)] + pub fn not_detected(self) -> &'a mut W { + self.variant(DOG_A::NOTDETECTED) + } + #[doc = "Detected"] + #[inline(always)] + pub fn detected(self) -> &'a mut W { + self.variant(DOG_A::DETECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Reset from soft reset detected\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SREQ_A { + #[doc = "0: Not detected"] + NOTDETECTED = 0, + #[doc = "1: Detected"] + DETECTED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SREQ_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SREQ` reader - Reset from soft reset detected"] +pub struct SREQ_R(crate::FieldReader); +impl SREQ_R { + pub(crate) fn new(bits: bool) -> Self { + SREQ_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SREQ_A { + match self.bits { + false => SREQ_A::NOTDETECTED, + true => SREQ_A::DETECTED, + } + } + #[doc = "Checks if the value of the field is `NOTDETECTED`"] + #[inline(always)] + pub fn is_not_detected(&self) -> bool { + **self == SREQ_A::NOTDETECTED + } + #[doc = "Checks if the value of the field is `DETECTED`"] + #[inline(always)] + pub fn is_detected(&self) -> bool { + **self == SREQ_A::DETECTED + } +} +impl core::ops::Deref for SREQ_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SREQ` writer - Reset from soft reset detected"] +pub struct SREQ_W<'a> { + w: &'a mut W, +} +impl<'a> SREQ_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SREQ_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Not detected"] + #[inline(always)] + pub fn not_detected(self) -> &'a mut W { + self.variant(SREQ_A::NOTDETECTED) + } + #[doc = "Detected"] + #[inline(always)] + pub fn detected(self) -> &'a mut W { + self.variant(SREQ_A::DETECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Reset from CPU lock-up detected\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LOCKUP_A { + #[doc = "0: Not detected"] + NOTDETECTED = 0, + #[doc = "1: Detected"] + DETECTED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LOCKUP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LOCKUP` reader - Reset from CPU lock-up detected"] +pub struct LOCKUP_R(crate::FieldReader); +impl LOCKUP_R { + pub(crate) fn new(bits: bool) -> Self { + LOCKUP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> LOCKUP_A { + match self.bits { + false => LOCKUP_A::NOTDETECTED, + true => LOCKUP_A::DETECTED, + } + } + #[doc = "Checks if the value of the field is `NOTDETECTED`"] + #[inline(always)] + pub fn is_not_detected(&self) -> bool { + **self == LOCKUP_A::NOTDETECTED + } + #[doc = "Checks if the value of the field is `DETECTED`"] + #[inline(always)] + pub fn is_detected(&self) -> bool { + **self == LOCKUP_A::DETECTED + } +} +impl core::ops::Deref for LOCKUP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LOCKUP` writer - Reset from CPU lock-up detected"] +pub struct LOCKUP_W<'a> { + w: &'a mut W, +} +impl<'a> LOCKUP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LOCKUP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Not detected"] + #[inline(always)] + pub fn not_detected(self) -> &'a mut W { + self.variant(LOCKUP_A::NOTDETECTED) + } + #[doc = "Detected"] + #[inline(always)] + pub fn detected(self) -> &'a mut W { + self.variant(LOCKUP_A::DETECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Reset due to wake up from System OFF mode when wakeup is triggered from DETECT signal from GPIO\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OFF_A { + #[doc = "0: Not detected"] + NOTDETECTED = 0, + #[doc = "1: Detected"] + DETECTED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OFF_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OFF` reader - Reset due to wake up from System OFF mode when wakeup is triggered from DETECT signal from GPIO"] +pub struct OFF_R(crate::FieldReader); +impl OFF_R { + pub(crate) fn new(bits: bool) -> Self { + OFF_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> OFF_A { + match self.bits { + false => OFF_A::NOTDETECTED, + true => OFF_A::DETECTED, + } + } + #[doc = "Checks if the value of the field is `NOTDETECTED`"] + #[inline(always)] + pub fn is_not_detected(&self) -> bool { + **self == OFF_A::NOTDETECTED + } + #[doc = "Checks if the value of the field is `DETECTED`"] + #[inline(always)] + pub fn is_detected(&self) -> bool { + **self == OFF_A::DETECTED + } +} +impl core::ops::Deref for OFF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OFF` writer - Reset due to wake up from System OFF mode when wakeup is triggered from DETECT signal from GPIO"] +pub struct OFF_W<'a> { + w: &'a mut W, +} +impl<'a> OFF_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: OFF_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Not detected"] + #[inline(always)] + pub fn not_detected(self) -> &'a mut W { + self.variant(OFF_A::NOTDETECTED) + } + #[doc = "Detected"] + #[inline(always)] + pub fn detected(self) -> &'a mut W { + self.variant(OFF_A::DETECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Reset due to wake up from System OFF mode when wakeup is triggered from ANADETECT signal from LPCOMP\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LPCOMP_A { + #[doc = "0: Not detected"] + NOTDETECTED = 0, + #[doc = "1: Detected"] + DETECTED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LPCOMP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LPCOMP` reader - Reset due to wake up from System OFF mode when wakeup is triggered from ANADETECT signal from LPCOMP"] +pub struct LPCOMP_R(crate::FieldReader); +impl LPCOMP_R { + pub(crate) fn new(bits: bool) -> Self { + LPCOMP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> LPCOMP_A { + match self.bits { + false => LPCOMP_A::NOTDETECTED, + true => LPCOMP_A::DETECTED, + } + } + #[doc = "Checks if the value of the field is `NOTDETECTED`"] + #[inline(always)] + pub fn is_not_detected(&self) -> bool { + **self == LPCOMP_A::NOTDETECTED + } + #[doc = "Checks if the value of the field is `DETECTED`"] + #[inline(always)] + pub fn is_detected(&self) -> bool { + **self == LPCOMP_A::DETECTED + } +} +impl core::ops::Deref for LPCOMP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LPCOMP` writer - Reset due to wake up from System OFF mode when wakeup is triggered from ANADETECT signal from LPCOMP"] +pub struct LPCOMP_W<'a> { + w: &'a mut W, +} +impl<'a> LPCOMP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LPCOMP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Not detected"] + #[inline(always)] + pub fn not_detected(self) -> &'a mut W { + self.variant(LPCOMP_A::NOTDETECTED) + } + #[doc = "Detected"] + #[inline(always)] + pub fn detected(self) -> &'a mut W { + self.variant(LPCOMP_A::DETECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Reset due to wake up from System OFF mode when wakeup is triggered from entering into debug interface mode\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DIF_A { + #[doc = "0: Not detected"] + NOTDETECTED = 0, + #[doc = "1: Detected"] + DETECTED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DIF_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DIF` reader - Reset due to wake up from System OFF mode when wakeup is triggered from entering into debug interface mode"] +pub struct DIF_R(crate::FieldReader); +impl DIF_R { + pub(crate) fn new(bits: bool) -> Self { + DIF_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DIF_A { + match self.bits { + false => DIF_A::NOTDETECTED, + true => DIF_A::DETECTED, + } + } + #[doc = "Checks if the value of the field is `NOTDETECTED`"] + #[inline(always)] + pub fn is_not_detected(&self) -> bool { + **self == DIF_A::NOTDETECTED + } + #[doc = "Checks if the value of the field is `DETECTED`"] + #[inline(always)] + pub fn is_detected(&self) -> bool { + **self == DIF_A::DETECTED + } +} +impl core::ops::Deref for DIF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DIF` writer - Reset due to wake up from System OFF mode when wakeup is triggered from entering into debug interface mode"] +pub struct DIF_W<'a> { + w: &'a mut W, +} +impl<'a> DIF_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DIF_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Not detected"] + #[inline(always)] + pub fn not_detected(self) -> &'a mut W { + self.variant(DIF_A::NOTDETECTED) + } + #[doc = "Detected"] + #[inline(always)] + pub fn detected(self) -> &'a mut W { + self.variant(DIF_A::DETECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Reset due to wake up from System OFF mode by NFC field detect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum NFC_A { + #[doc = "0: Not detected"] + NOTDETECTED = 0, + #[doc = "1: Detected"] + DETECTED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: NFC_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `NFC` reader - Reset due to wake up from System OFF mode by NFC field detect"] +pub struct NFC_R(crate::FieldReader); +impl NFC_R { + pub(crate) fn new(bits: bool) -> Self { + NFC_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> NFC_A { + match self.bits { + false => NFC_A::NOTDETECTED, + true => NFC_A::DETECTED, + } + } + #[doc = "Checks if the value of the field is `NOTDETECTED`"] + #[inline(always)] + pub fn is_not_detected(&self) -> bool { + **self == NFC_A::NOTDETECTED + } + #[doc = "Checks if the value of the field is `DETECTED`"] + #[inline(always)] + pub fn is_detected(&self) -> bool { + **self == NFC_A::DETECTED + } +} +impl core::ops::Deref for NFC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NFC` writer - Reset due to wake up from System OFF mode by NFC field detect"] +pub struct NFC_W<'a> { + w: &'a mut W, +} +impl<'a> NFC_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: NFC_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Not detected"] + #[inline(always)] + pub fn not_detected(self) -> &'a mut W { + self.variant(NFC_A::NOTDETECTED) + } + #[doc = "Detected"] + #[inline(always)] + pub fn detected(self) -> &'a mut W { + self.variant(NFC_A::DETECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +impl R { + #[doc = "Bit 0 - Reset from pin-reset detected"] + #[inline(always)] + pub fn resetpin(&self) -> RESETPIN_R { + RESETPIN_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Reset from watchdog detected"] + #[inline(always)] + pub fn dog(&self) -> DOG_R { + DOG_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Reset from soft reset detected"] + #[inline(always)] + pub fn sreq(&self) -> SREQ_R { + SREQ_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Reset from CPU lock-up detected"] + #[inline(always)] + pub fn lockup(&self) -> LOCKUP_R { + LOCKUP_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 16 - Reset due to wake up from System OFF mode when wakeup is triggered from DETECT signal from GPIO"] + #[inline(always)] + pub fn off(&self) -> OFF_R { + OFF_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Reset due to wake up from System OFF mode when wakeup is triggered from ANADETECT signal from LPCOMP"] + #[inline(always)] + pub fn lpcomp(&self) -> LPCOMP_R { + LPCOMP_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Reset due to wake up from System OFF mode when wakeup is triggered from entering into debug interface mode"] + #[inline(always)] + pub fn dif(&self) -> DIF_R { + DIF_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Reset due to wake up from System OFF mode by NFC field detect"] + #[inline(always)] + pub fn nfc(&self) -> NFC_R { + NFC_R::new(((self.bits >> 19) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Reset from pin-reset detected"] + #[inline(always)] + pub fn resetpin(&mut self) -> RESETPIN_W { + RESETPIN_W { w: self } + } + #[doc = "Bit 1 - Reset from watchdog detected"] + #[inline(always)] + pub fn dog(&mut self) -> DOG_W { + DOG_W { w: self } + } + #[doc = "Bit 2 - Reset from soft reset detected"] + #[inline(always)] + pub fn sreq(&mut self) -> SREQ_W { + SREQ_W { w: self } + } + #[doc = "Bit 3 - Reset from CPU lock-up detected"] + #[inline(always)] + pub fn lockup(&mut self) -> LOCKUP_W { + LOCKUP_W { w: self } + } + #[doc = "Bit 16 - Reset due to wake up from System OFF mode when wakeup is triggered from DETECT signal from GPIO"] + #[inline(always)] + pub fn off(&mut self) -> OFF_W { + OFF_W { w: self } + } + #[doc = "Bit 17 - Reset due to wake up from System OFF mode when wakeup is triggered from ANADETECT signal from LPCOMP"] + #[inline(always)] + pub fn lpcomp(&mut self) -> LPCOMP_W { + LPCOMP_W { w: self } + } + #[doc = "Bit 18 - Reset due to wake up from System OFF mode when wakeup is triggered from entering into debug interface mode"] + #[inline(always)] + pub fn dif(&mut self) -> DIF_W { + DIF_W { w: self } + } + #[doc = "Bit 19 - Reset due to wake up from System OFF mode by NFC field detect"] + #[inline(always)] + pub fn nfc(&mut self) -> NFC_W { + NFC_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Reset reason\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [resetreas](index.html) module"] +pub struct RESETREAS_SPEC; +impl crate::RegisterSpec for RESETREAS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [resetreas::R](R) reader structure"] +impl crate::Readable for RESETREAS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [resetreas::W](W) writer structure"] +impl crate::Writable for RESETREAS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets RESETREAS to value 0"] +impl crate::Resettable for RESETREAS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/power/systemoff.rs b/src/power/systemoff.rs new file mode 100644 index 0000000..e14e782 --- /dev/null +++ b/src/power/systemoff.rs @@ -0,0 +1,94 @@ +#[doc = "Register `SYSTEMOFF` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable System OFF mode\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SYSTEMOFF_AW { + #[doc = "1: Enable System OFF mode"] + ENTER = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SYSTEMOFF_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SYSTEMOFF` writer - Enable System OFF mode"] +pub struct SYSTEMOFF_W<'a> { + w: &'a mut W, +} +impl<'a> SYSTEMOFF_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SYSTEMOFF_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable System OFF mode"] + #[inline(always)] + pub fn enter(self) -> &'a mut W { + self.variant(SYSTEMOFF_AW::ENTER) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl W { + #[doc = "Bit 0 - Enable System OFF mode"] + #[inline(always)] + pub fn systemoff(&mut self) -> SYSTEMOFF_W { + SYSTEMOFF_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "System OFF register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [systemoff](index.html) module"] +pub struct SYSTEMOFF_SPEC; +impl crate::RegisterSpec for SYSTEMOFF_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [systemoff::W](W) writer structure"] +impl crate::Writable for SYSTEMOFF_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SYSTEMOFF to value 0"] +impl crate::Resettable for SYSTEMOFF_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/power/tasks_constlat.rs b/src/power/tasks_constlat.rs new file mode 100644 index 0000000..f29d76d --- /dev/null +++ b/src/power/tasks_constlat.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_CONSTLAT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable constant latency mode\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_constlat](index.html) module"] +pub struct TASKS_CONSTLAT_SPEC; +impl crate::RegisterSpec for TASKS_CONSTLAT_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_constlat::W](W) writer structure"] +impl crate::Writable for TASKS_CONSTLAT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_CONSTLAT to value 0"] +impl crate::Resettable for TASKS_CONSTLAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/power/tasks_lowpwr.rs b/src/power/tasks_lowpwr.rs new file mode 100644 index 0000000..ae7f249 --- /dev/null +++ b/src/power/tasks_lowpwr.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_LOWPWR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable low power mode (variable latency)\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_lowpwr](index.html) module"] +pub struct TASKS_LOWPWR_SPEC; +impl crate::RegisterSpec for TASKS_LOWPWR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_lowpwr::W](W) writer structure"] +impl crate::Writable for TASKS_LOWPWR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_LOWPWR to value 0"] +impl crate::Resettable for TASKS_LOWPWR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ppi.rs b/src/ppi.rs new file mode 100644 index 0000000..616235a --- /dev/null +++ b/src/ppi.rs @@ -0,0 +1,69 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "0x00..0x30 - Channel group tasks"] + pub tasks_chg: [TASKS_CHG; 6], + _reserved1: [u8; 0x04d0], + #[doc = "0x500 - Channel enable register"] + pub chen: crate::Reg, + #[doc = "0x504 - Channel enable set register"] + pub chenset: crate::Reg, + #[doc = "0x508 - Channel enable clear register"] + pub chenclr: crate::Reg, + _reserved4: [u8; 0x04], + #[doc = "0x510..0x5b0 - PPI Channel"] + pub ch: [CH; 20], + _reserved5: [u8; 0x0250], + #[doc = "0x800..0x818 - Description collection\\[0\\]: Channel group 0"] + pub chg: [crate::Reg; 6], + _reserved6: [u8; 0xf8], + #[doc = "0x910..0x990 - Fork"] + pub fork: [FORK; 32], +} +#[doc = r"Register block"] +#[repr(C)] +pub struct TASKS_CHG { + #[doc = "0x00 - Description cluster\\[0\\]: Enable channel group 0"] + pub en: crate::Reg, + #[doc = "0x04 - Description cluster\\[0\\]: Disable channel group 0"] + pub dis: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Channel group tasks"] +pub mod tasks_chg; +#[doc = r"Register block"] +#[repr(C)] +pub struct CH { + #[doc = "0x00 - Description cluster\\[0\\]: Channel 0 event end-point"] + pub eep: crate::Reg, + #[doc = "0x04 - Description cluster\\[0\\]: Channel 0 task end-point"] + pub tep: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "PPI Channel"] +pub mod ch; +#[doc = r"Register block"] +#[repr(C)] +pub struct FORK { + #[doc = "0x00 - Description cluster\\[0\\]: Channel 0 task end-point"] + pub tep: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Fork"] +pub mod fork; +#[doc = "CHEN register accessor: an alias for `Reg`"] +pub type CHEN = crate::Reg; +#[doc = "Channel enable register"] +pub mod chen; +#[doc = "CHENSET register accessor: an alias for `Reg`"] +pub type CHENSET = crate::Reg; +#[doc = "Channel enable set register"] +pub mod chenset; +#[doc = "CHENCLR register accessor: an alias for `Reg`"] +pub type CHENCLR = crate::Reg; +#[doc = "Channel enable clear register"] +pub mod chenclr; +#[doc = "CHG register accessor: an alias for `Reg`"] +pub type CHG = crate::Reg; +#[doc = "Description collection\\[0\\]: Channel group 0"] +pub mod chg; diff --git a/src/ppi/ch.rs b/src/ppi/ch.rs new file mode 100644 index 0000000..cfe2e53 --- /dev/null +++ b/src/ppi/ch.rs @@ -0,0 +1,8 @@ +#[doc = "EEP register accessor: an alias for `Reg`"] +pub type EEP = crate::Reg; +#[doc = "Description cluster\\[0\\]: Channel 0 event end-point"] +pub mod eep; +#[doc = "TEP register accessor: an alias for `Reg`"] +pub type TEP = crate::Reg; +#[doc = "Description cluster\\[0\\]: Channel 0 task end-point"] +pub mod tep; diff --git a/src/ppi/ch/eep.rs b/src/ppi/ch/eep.rs new file mode 100644 index 0000000..deeac13 --- /dev/null +++ b/src/ppi/ch/eep.rs @@ -0,0 +1,102 @@ +#[doc = "Register `EEP` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EEP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `EEP` reader - Pointer to event register. Accepts only addresses to registers from the Event group."] +pub struct EEP_R(crate::FieldReader); +impl EEP_R { + pub(crate) fn new(bits: u32) -> Self { + EEP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for EEP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `EEP` writer - Pointer to event register. Accepts only addresses to registers from the Event group."] +pub struct EEP_W<'a> { + w: &'a mut W, +} +impl<'a> EEP_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Pointer to event register. Accepts only addresses to registers from the Event group."] + #[inline(always)] + pub fn eep(&self) -> EEP_R { + EEP_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Pointer to event register. Accepts only addresses to registers from the Event group."] + #[inline(always)] + pub fn eep(&mut self) -> EEP_W { + EEP_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description cluster\\[0\\]: Channel 0 event end-point\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [eep](index.html) module"] +pub struct EEP_SPEC; +impl crate::RegisterSpec for EEP_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [eep::R](R) reader structure"] +impl crate::Readable for EEP_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [eep::W](W) writer structure"] +impl crate::Writable for EEP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EEP to value 0"] +impl crate::Resettable for EEP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ppi/ch/tep.rs b/src/ppi/ch/tep.rs new file mode 100644 index 0000000..a7f0f5b --- /dev/null +++ b/src/ppi/ch/tep.rs @@ -0,0 +1,102 @@ +#[doc = "Register `TEP` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `TEP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `TEP` reader - Pointer to task register. Accepts only addresses to registers from the Task group."] +pub struct TEP_R(crate::FieldReader); +impl TEP_R { + pub(crate) fn new(bits: u32) -> Self { + TEP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TEP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TEP` writer - Pointer to task register. Accepts only addresses to registers from the Task group."] +pub struct TEP_W<'a> { + w: &'a mut W, +} +impl<'a> TEP_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Pointer to task register. Accepts only addresses to registers from the Task group."] + #[inline(always)] + pub fn tep(&self) -> TEP_R { + TEP_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Pointer to task register. Accepts only addresses to registers from the Task group."] + #[inline(always)] + pub fn tep(&mut self) -> TEP_W { + TEP_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description cluster\\[0\\]: Channel 0 task end-point\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tep](index.html) module"] +pub struct TEP_SPEC; +impl crate::RegisterSpec for TEP_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [tep::R](R) reader structure"] +impl crate::Readable for TEP_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [tep::W](W) writer structure"] +impl crate::Writable for TEP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TEP to value 0"] +impl crate::Resettable for TEP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ppi/chen.rs b/src/ppi/chen.rs new file mode 100644 index 0000000..5c5e01b --- /dev/null +++ b/src/ppi/chen.rs @@ -0,0 +1,3042 @@ +#[doc = "Register `CHEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CHEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable channel 0\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH0_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH0` reader - Enable or disable channel 0"] +pub struct CH0_R(crate::FieldReader); +impl CH0_R { + pub(crate) fn new(bits: bool) -> Self { + CH0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH0_A { + match self.bits { + false => CH0_A::DISABLED, + true => CH0_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH0_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH0_A::ENABLED + } +} +impl core::ops::Deref for CH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH0` writer - Enable or disable channel 0"] +pub struct CH0_W<'a> { + w: &'a mut W, +} +impl<'a> CH0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH0_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH0_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH0_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Enable or disable channel 1\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH1_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH1` reader - Enable or disable channel 1"] +pub struct CH1_R(crate::FieldReader); +impl CH1_R { + pub(crate) fn new(bits: bool) -> Self { + CH1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH1_A { + match self.bits { + false => CH1_A::DISABLED, + true => CH1_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH1_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH1_A::ENABLED + } +} +impl core::ops::Deref for CH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH1` writer - Enable or disable channel 1"] +pub struct CH1_W<'a> { + w: &'a mut W, +} +impl<'a> CH1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH1_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH1_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH1_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Enable or disable channel 2\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH2_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH2` reader - Enable or disable channel 2"] +pub struct CH2_R(crate::FieldReader); +impl CH2_R { + pub(crate) fn new(bits: bool) -> Self { + CH2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH2_A { + match self.bits { + false => CH2_A::DISABLED, + true => CH2_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH2_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH2_A::ENABLED + } +} +impl core::ops::Deref for CH2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH2` writer - Enable or disable channel 2"] +pub struct CH2_W<'a> { + w: &'a mut W, +} +impl<'a> CH2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH2_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH2_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH2_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Enable or disable channel 3\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH3_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH3` reader - Enable or disable channel 3"] +pub struct CH3_R(crate::FieldReader); +impl CH3_R { + pub(crate) fn new(bits: bool) -> Self { + CH3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH3_A { + match self.bits { + false => CH3_A::DISABLED, + true => CH3_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH3_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH3_A::ENABLED + } +} +impl core::ops::Deref for CH3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH3` writer - Enable or disable channel 3"] +pub struct CH3_W<'a> { + w: &'a mut W, +} +impl<'a> CH3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH3_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH3_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH3_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Enable or disable channel 4\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH4_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH4_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH4` reader - Enable or disable channel 4"] +pub struct CH4_R(crate::FieldReader); +impl CH4_R { + pub(crate) fn new(bits: bool) -> Self { + CH4_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH4_A { + match self.bits { + false => CH4_A::DISABLED, + true => CH4_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH4_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH4_A::ENABLED + } +} +impl core::ops::Deref for CH4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH4` writer - Enable or disable channel 4"] +pub struct CH4_W<'a> { + w: &'a mut W, +} +impl<'a> CH4_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH4_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH4_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH4_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Enable or disable channel 5\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH5_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH5_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH5` reader - Enable or disable channel 5"] +pub struct CH5_R(crate::FieldReader); +impl CH5_R { + pub(crate) fn new(bits: bool) -> Self { + CH5_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH5_A { + match self.bits { + false => CH5_A::DISABLED, + true => CH5_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH5_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH5_A::ENABLED + } +} +impl core::ops::Deref for CH5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH5` writer - Enable or disable channel 5"] +pub struct CH5_W<'a> { + w: &'a mut W, +} +impl<'a> CH5_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH5_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH5_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH5_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Enable or disable channel 6\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH6_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH6_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH6` reader - Enable or disable channel 6"] +pub struct CH6_R(crate::FieldReader); +impl CH6_R { + pub(crate) fn new(bits: bool) -> Self { + CH6_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH6_A { + match self.bits { + false => CH6_A::DISABLED, + true => CH6_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH6_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH6_A::ENABLED + } +} +impl core::ops::Deref for CH6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH6` writer - Enable or disable channel 6"] +pub struct CH6_W<'a> { + w: &'a mut W, +} +impl<'a> CH6_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH6_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH6_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH6_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Enable or disable channel 7\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH7_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH7_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH7` reader - Enable or disable channel 7"] +pub struct CH7_R(crate::FieldReader); +impl CH7_R { + pub(crate) fn new(bits: bool) -> Self { + CH7_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH7_A { + match self.bits { + false => CH7_A::DISABLED, + true => CH7_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH7_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH7_A::ENABLED + } +} +impl core::ops::Deref for CH7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH7` writer - Enable or disable channel 7"] +pub struct CH7_W<'a> { + w: &'a mut W, +} +impl<'a> CH7_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH7_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH7_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH7_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Enable or disable channel 8\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH8_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH8_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH8` reader - Enable or disable channel 8"] +pub struct CH8_R(crate::FieldReader); +impl CH8_R { + pub(crate) fn new(bits: bool) -> Self { + CH8_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH8_A { + match self.bits { + false => CH8_A::DISABLED, + true => CH8_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH8_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH8_A::ENABLED + } +} +impl core::ops::Deref for CH8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH8` writer - Enable or disable channel 8"] +pub struct CH8_W<'a> { + w: &'a mut W, +} +impl<'a> CH8_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH8_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH8_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH8_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Enable or disable channel 9\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH9_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH9_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH9` reader - Enable or disable channel 9"] +pub struct CH9_R(crate::FieldReader); +impl CH9_R { + pub(crate) fn new(bits: bool) -> Self { + CH9_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH9_A { + match self.bits { + false => CH9_A::DISABLED, + true => CH9_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH9_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH9_A::ENABLED + } +} +impl core::ops::Deref for CH9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH9` writer - Enable or disable channel 9"] +pub struct CH9_W<'a> { + w: &'a mut W, +} +impl<'a> CH9_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH9_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH9_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH9_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Enable or disable channel 10\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH10_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH10_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH10` reader - Enable or disable channel 10"] +pub struct CH10_R(crate::FieldReader); +impl CH10_R { + pub(crate) fn new(bits: bool) -> Self { + CH10_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH10_A { + match self.bits { + false => CH10_A::DISABLED, + true => CH10_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH10_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH10_A::ENABLED + } +} +impl core::ops::Deref for CH10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH10` writer - Enable or disable channel 10"] +pub struct CH10_W<'a> { + w: &'a mut W, +} +impl<'a> CH10_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH10_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH10_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH10_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Enable or disable channel 11\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH11_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH11_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH11` reader - Enable or disable channel 11"] +pub struct CH11_R(crate::FieldReader); +impl CH11_R { + pub(crate) fn new(bits: bool) -> Self { + CH11_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH11_A { + match self.bits { + false => CH11_A::DISABLED, + true => CH11_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH11_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH11_A::ENABLED + } +} +impl core::ops::Deref for CH11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH11` writer - Enable or disable channel 11"] +pub struct CH11_W<'a> { + w: &'a mut W, +} +impl<'a> CH11_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH11_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH11_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH11_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Enable or disable channel 12\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH12_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH12_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH12` reader - Enable or disable channel 12"] +pub struct CH12_R(crate::FieldReader); +impl CH12_R { + pub(crate) fn new(bits: bool) -> Self { + CH12_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH12_A { + match self.bits { + false => CH12_A::DISABLED, + true => CH12_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH12_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH12_A::ENABLED + } +} +impl core::ops::Deref for CH12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH12` writer - Enable or disable channel 12"] +pub struct CH12_W<'a> { + w: &'a mut W, +} +impl<'a> CH12_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH12_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH12_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH12_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Enable or disable channel 13\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH13_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH13_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH13` reader - Enable or disable channel 13"] +pub struct CH13_R(crate::FieldReader); +impl CH13_R { + pub(crate) fn new(bits: bool) -> Self { + CH13_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH13_A { + match self.bits { + false => CH13_A::DISABLED, + true => CH13_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH13_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH13_A::ENABLED + } +} +impl core::ops::Deref for CH13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH13` writer - Enable or disable channel 13"] +pub struct CH13_W<'a> { + w: &'a mut W, +} +impl<'a> CH13_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH13_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH13_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH13_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Enable or disable channel 14\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH14_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH14_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH14` reader - Enable or disable channel 14"] +pub struct CH14_R(crate::FieldReader); +impl CH14_R { + pub(crate) fn new(bits: bool) -> Self { + CH14_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH14_A { + match self.bits { + false => CH14_A::DISABLED, + true => CH14_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH14_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH14_A::ENABLED + } +} +impl core::ops::Deref for CH14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH14` writer - Enable or disable channel 14"] +pub struct CH14_W<'a> { + w: &'a mut W, +} +impl<'a> CH14_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH14_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH14_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH14_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Enable or disable channel 15\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH15_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH15_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH15` reader - Enable or disable channel 15"] +pub struct CH15_R(crate::FieldReader); +impl CH15_R { + pub(crate) fn new(bits: bool) -> Self { + CH15_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH15_A { + match self.bits { + false => CH15_A::DISABLED, + true => CH15_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH15_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH15_A::ENABLED + } +} +impl core::ops::Deref for CH15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH15` writer - Enable or disable channel 15"] +pub struct CH15_W<'a> { + w: &'a mut W, +} +impl<'a> CH15_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH15_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH15_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH15_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Enable or disable channel 16\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH16_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH16_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH16` reader - Enable or disable channel 16"] +pub struct CH16_R(crate::FieldReader); +impl CH16_R { + pub(crate) fn new(bits: bool) -> Self { + CH16_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH16_A { + match self.bits { + false => CH16_A::DISABLED, + true => CH16_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH16_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH16_A::ENABLED + } +} +impl core::ops::Deref for CH16_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH16` writer - Enable or disable channel 16"] +pub struct CH16_W<'a> { + w: &'a mut W, +} +impl<'a> CH16_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH16_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH16_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH16_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Enable or disable channel 17\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH17_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH17_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH17` reader - Enable or disable channel 17"] +pub struct CH17_R(crate::FieldReader); +impl CH17_R { + pub(crate) fn new(bits: bool) -> Self { + CH17_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH17_A { + match self.bits { + false => CH17_A::DISABLED, + true => CH17_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH17_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH17_A::ENABLED + } +} +impl core::ops::Deref for CH17_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH17` writer - Enable or disable channel 17"] +pub struct CH17_W<'a> { + w: &'a mut W, +} +impl<'a> CH17_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH17_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH17_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH17_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Enable or disable channel 18\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH18_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH18_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH18` reader - Enable or disable channel 18"] +pub struct CH18_R(crate::FieldReader); +impl CH18_R { + pub(crate) fn new(bits: bool) -> Self { + CH18_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH18_A { + match self.bits { + false => CH18_A::DISABLED, + true => CH18_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH18_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH18_A::ENABLED + } +} +impl core::ops::Deref for CH18_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH18` writer - Enable or disable channel 18"] +pub struct CH18_W<'a> { + w: &'a mut W, +} +impl<'a> CH18_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH18_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH18_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH18_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Enable or disable channel 19\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH19_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH19_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH19` reader - Enable or disable channel 19"] +pub struct CH19_R(crate::FieldReader); +impl CH19_R { + pub(crate) fn new(bits: bool) -> Self { + CH19_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH19_A { + match self.bits { + false => CH19_A::DISABLED, + true => CH19_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH19_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH19_A::ENABLED + } +} +impl core::ops::Deref for CH19_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH19` writer - Enable or disable channel 19"] +pub struct CH19_W<'a> { + w: &'a mut W, +} +impl<'a> CH19_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH19_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH19_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH19_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Enable or disable channel 20\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH20_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH20_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH20` reader - Enable or disable channel 20"] +pub struct CH20_R(crate::FieldReader); +impl CH20_R { + pub(crate) fn new(bits: bool) -> Self { + CH20_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH20_A { + match self.bits { + false => CH20_A::DISABLED, + true => CH20_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH20_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH20_A::ENABLED + } +} +impl core::ops::Deref for CH20_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH20` writer - Enable or disable channel 20"] +pub struct CH20_W<'a> { + w: &'a mut W, +} +impl<'a> CH20_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH20_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH20_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH20_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Enable or disable channel 21\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH21_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH21_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH21` reader - Enable or disable channel 21"] +pub struct CH21_R(crate::FieldReader); +impl CH21_R { + pub(crate) fn new(bits: bool) -> Self { + CH21_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH21_A { + match self.bits { + false => CH21_A::DISABLED, + true => CH21_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH21_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH21_A::ENABLED + } +} +impl core::ops::Deref for CH21_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH21` writer - Enable or disable channel 21"] +pub struct CH21_W<'a> { + w: &'a mut W, +} +impl<'a> CH21_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH21_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH21_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH21_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); + self.w + } +} +#[doc = "Enable or disable channel 22\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH22_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH22_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH22` reader - Enable or disable channel 22"] +pub struct CH22_R(crate::FieldReader); +impl CH22_R { + pub(crate) fn new(bits: bool) -> Self { + CH22_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH22_A { + match self.bits { + false => CH22_A::DISABLED, + true => CH22_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH22_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH22_A::ENABLED + } +} +impl core::ops::Deref for CH22_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH22` writer - Enable or disable channel 22"] +pub struct CH22_W<'a> { + w: &'a mut W, +} +impl<'a> CH22_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH22_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH22_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH22_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); + self.w + } +} +#[doc = "Enable or disable channel 23\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH23_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH23_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH23` reader - Enable or disable channel 23"] +pub struct CH23_R(crate::FieldReader); +impl CH23_R { + pub(crate) fn new(bits: bool) -> Self { + CH23_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH23_A { + match self.bits { + false => CH23_A::DISABLED, + true => CH23_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH23_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH23_A::ENABLED + } +} +impl core::ops::Deref for CH23_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH23` writer - Enable or disable channel 23"] +pub struct CH23_W<'a> { + w: &'a mut W, +} +impl<'a> CH23_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH23_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH23_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH23_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); + self.w + } +} +#[doc = "Enable or disable channel 24\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH24_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH24_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH24` reader - Enable or disable channel 24"] +pub struct CH24_R(crate::FieldReader); +impl CH24_R { + pub(crate) fn new(bits: bool) -> Self { + CH24_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH24_A { + match self.bits { + false => CH24_A::DISABLED, + true => CH24_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH24_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH24_A::ENABLED + } +} +impl core::ops::Deref for CH24_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH24` writer - Enable or disable channel 24"] +pub struct CH24_W<'a> { + w: &'a mut W, +} +impl<'a> CH24_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH24_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH24_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH24_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Enable or disable channel 25\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH25_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH25_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH25` reader - Enable or disable channel 25"] +pub struct CH25_R(crate::FieldReader); +impl CH25_R { + pub(crate) fn new(bits: bool) -> Self { + CH25_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH25_A { + match self.bits { + false => CH25_A::DISABLED, + true => CH25_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH25_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH25_A::ENABLED + } +} +impl core::ops::Deref for CH25_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH25` writer - Enable or disable channel 25"] +pub struct CH25_W<'a> { + w: &'a mut W, +} +impl<'a> CH25_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH25_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH25_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH25_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Enable or disable channel 26\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH26_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH26_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH26` reader - Enable or disable channel 26"] +pub struct CH26_R(crate::FieldReader); +impl CH26_R { + pub(crate) fn new(bits: bool) -> Self { + CH26_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH26_A { + match self.bits { + false => CH26_A::DISABLED, + true => CH26_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH26_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH26_A::ENABLED + } +} +impl core::ops::Deref for CH26_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH26` writer - Enable or disable channel 26"] +pub struct CH26_W<'a> { + w: &'a mut W, +} +impl<'a> CH26_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH26_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH26_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH26_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Enable or disable channel 27\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH27_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH27_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH27` reader - Enable or disable channel 27"] +pub struct CH27_R(crate::FieldReader); +impl CH27_R { + pub(crate) fn new(bits: bool) -> Self { + CH27_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH27_A { + match self.bits { + false => CH27_A::DISABLED, + true => CH27_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH27_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH27_A::ENABLED + } +} +impl core::ops::Deref for CH27_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH27` writer - Enable or disable channel 27"] +pub struct CH27_W<'a> { + w: &'a mut W, +} +impl<'a> CH27_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH27_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH27_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH27_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +#[doc = "Enable or disable channel 28\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH28_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH28_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH28` reader - Enable or disable channel 28"] +pub struct CH28_R(crate::FieldReader); +impl CH28_R { + pub(crate) fn new(bits: bool) -> Self { + CH28_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH28_A { + match self.bits { + false => CH28_A::DISABLED, + true => CH28_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH28_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH28_A::ENABLED + } +} +impl core::ops::Deref for CH28_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH28` writer - Enable or disable channel 28"] +pub struct CH28_W<'a> { + w: &'a mut W, +} +impl<'a> CH28_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH28_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH28_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH28_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); + self.w + } +} +#[doc = "Enable or disable channel 29\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH29_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH29_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH29` reader - Enable or disable channel 29"] +pub struct CH29_R(crate::FieldReader); +impl CH29_R { + pub(crate) fn new(bits: bool) -> Self { + CH29_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH29_A { + match self.bits { + false => CH29_A::DISABLED, + true => CH29_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH29_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH29_A::ENABLED + } +} +impl core::ops::Deref for CH29_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH29` writer - Enable or disable channel 29"] +pub struct CH29_W<'a> { + w: &'a mut W, +} +impl<'a> CH29_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH29_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH29_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH29_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); + self.w + } +} +#[doc = "Enable or disable channel 30\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH30_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH30_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH30` reader - Enable or disable channel 30"] +pub struct CH30_R(crate::FieldReader); +impl CH30_R { + pub(crate) fn new(bits: bool) -> Self { + CH30_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH30_A { + match self.bits { + false => CH30_A::DISABLED, + true => CH30_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH30_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH30_A::ENABLED + } +} +impl core::ops::Deref for CH30_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH30` writer - Enable or disable channel 30"] +pub struct CH30_W<'a> { + w: &'a mut W, +} +impl<'a> CH30_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH30_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH30_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH30_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); + self.w + } +} +#[doc = "Enable or disable channel 31\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH31_A { + #[doc = "0: Disable channel"] + DISABLED = 0, + #[doc = "1: Enable channel"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH31_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH31` reader - Enable or disable channel 31"] +pub struct CH31_R(crate::FieldReader); +impl CH31_R { + pub(crate) fn new(bits: bool) -> Self { + CH31_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH31_A { + match self.bits { + false => CH31_A::DISABLED, + true => CH31_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH31_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH31_A::ENABLED + } +} +impl core::ops::Deref for CH31_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH31` writer - Enable or disable channel 31"] +pub struct CH31_W<'a> { + w: &'a mut W, +} +impl<'a> CH31_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH31_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable channel"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH31_A::DISABLED) + } + #[doc = "Enable channel"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH31_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable or disable channel 0"] + #[inline(always)] + pub fn ch0(&self) -> CH0_R { + CH0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Enable or disable channel 1"] + #[inline(always)] + pub fn ch1(&self) -> CH1_R { + CH1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Enable or disable channel 2"] + #[inline(always)] + pub fn ch2(&self) -> CH2_R { + CH2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Enable or disable channel 3"] + #[inline(always)] + pub fn ch3(&self) -> CH3_R { + CH3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Enable or disable channel 4"] + #[inline(always)] + pub fn ch4(&self) -> CH4_R { + CH4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Enable or disable channel 5"] + #[inline(always)] + pub fn ch5(&self) -> CH5_R { + CH5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Enable or disable channel 6"] + #[inline(always)] + pub fn ch6(&self) -> CH6_R { + CH6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Enable or disable channel 7"] + #[inline(always)] + pub fn ch7(&self) -> CH7_R { + CH7_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Enable or disable channel 8"] + #[inline(always)] + pub fn ch8(&self) -> CH8_R { + CH8_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Enable or disable channel 9"] + #[inline(always)] + pub fn ch9(&self) -> CH9_R { + CH9_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Enable or disable channel 10"] + #[inline(always)] + pub fn ch10(&self) -> CH10_R { + CH10_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Enable or disable channel 11"] + #[inline(always)] + pub fn ch11(&self) -> CH11_R { + CH11_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Enable or disable channel 12"] + #[inline(always)] + pub fn ch12(&self) -> CH12_R { + CH12_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Enable or disable channel 13"] + #[inline(always)] + pub fn ch13(&self) -> CH13_R { + CH13_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Enable or disable channel 14"] + #[inline(always)] + pub fn ch14(&self) -> CH14_R { + CH14_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Enable or disable channel 15"] + #[inline(always)] + pub fn ch15(&self) -> CH15_R { + CH15_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Enable or disable channel 16"] + #[inline(always)] + pub fn ch16(&self) -> CH16_R { + CH16_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Enable or disable channel 17"] + #[inline(always)] + pub fn ch17(&self) -> CH17_R { + CH17_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Enable or disable channel 18"] + #[inline(always)] + pub fn ch18(&self) -> CH18_R { + CH18_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Enable or disable channel 19"] + #[inline(always)] + pub fn ch19(&self) -> CH19_R { + CH19_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Enable or disable channel 20"] + #[inline(always)] + pub fn ch20(&self) -> CH20_R { + CH20_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 21 - Enable or disable channel 21"] + #[inline(always)] + pub fn ch21(&self) -> CH21_R { + CH21_R::new(((self.bits >> 21) & 0x01) != 0) + } + #[doc = "Bit 22 - Enable or disable channel 22"] + #[inline(always)] + pub fn ch22(&self) -> CH22_R { + CH22_R::new(((self.bits >> 22) & 0x01) != 0) + } + #[doc = "Bit 23 - Enable or disable channel 23"] + #[inline(always)] + pub fn ch23(&self) -> CH23_R { + CH23_R::new(((self.bits >> 23) & 0x01) != 0) + } + #[doc = "Bit 24 - Enable or disable channel 24"] + #[inline(always)] + pub fn ch24(&self) -> CH24_R { + CH24_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Enable or disable channel 25"] + #[inline(always)] + pub fn ch25(&self) -> CH25_R { + CH25_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Enable or disable channel 26"] + #[inline(always)] + pub fn ch26(&self) -> CH26_R { + CH26_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Enable or disable channel 27"] + #[inline(always)] + pub fn ch27(&self) -> CH27_R { + CH27_R::new(((self.bits >> 27) & 0x01) != 0) + } + #[doc = "Bit 28 - Enable or disable channel 28"] + #[inline(always)] + pub fn ch28(&self) -> CH28_R { + CH28_R::new(((self.bits >> 28) & 0x01) != 0) + } + #[doc = "Bit 29 - Enable or disable channel 29"] + #[inline(always)] + pub fn ch29(&self) -> CH29_R { + CH29_R::new(((self.bits >> 29) & 0x01) != 0) + } + #[doc = "Bit 30 - Enable or disable channel 30"] + #[inline(always)] + pub fn ch30(&self) -> CH30_R { + CH30_R::new(((self.bits >> 30) & 0x01) != 0) + } + #[doc = "Bit 31 - Enable or disable channel 31"] + #[inline(always)] + pub fn ch31(&self) -> CH31_R { + CH31_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Enable or disable channel 0"] + #[inline(always)] + pub fn ch0(&mut self) -> CH0_W { + CH0_W { w: self } + } + #[doc = "Bit 1 - Enable or disable channel 1"] + #[inline(always)] + pub fn ch1(&mut self) -> CH1_W { + CH1_W { w: self } + } + #[doc = "Bit 2 - Enable or disable channel 2"] + #[inline(always)] + pub fn ch2(&mut self) -> CH2_W { + CH2_W { w: self } + } + #[doc = "Bit 3 - Enable or disable channel 3"] + #[inline(always)] + pub fn ch3(&mut self) -> CH3_W { + CH3_W { w: self } + } + #[doc = "Bit 4 - Enable or disable channel 4"] + #[inline(always)] + pub fn ch4(&mut self) -> CH4_W { + CH4_W { w: self } + } + #[doc = "Bit 5 - Enable or disable channel 5"] + #[inline(always)] + pub fn ch5(&mut self) -> CH5_W { + CH5_W { w: self } + } + #[doc = "Bit 6 - Enable or disable channel 6"] + #[inline(always)] + pub fn ch6(&mut self) -> CH6_W { + CH6_W { w: self } + } + #[doc = "Bit 7 - Enable or disable channel 7"] + #[inline(always)] + pub fn ch7(&mut self) -> CH7_W { + CH7_W { w: self } + } + #[doc = "Bit 8 - Enable or disable channel 8"] + #[inline(always)] + pub fn ch8(&mut self) -> CH8_W { + CH8_W { w: self } + } + #[doc = "Bit 9 - Enable or disable channel 9"] + #[inline(always)] + pub fn ch9(&mut self) -> CH9_W { + CH9_W { w: self } + } + #[doc = "Bit 10 - Enable or disable channel 10"] + #[inline(always)] + pub fn ch10(&mut self) -> CH10_W { + CH10_W { w: self } + } + #[doc = "Bit 11 - Enable or disable channel 11"] + #[inline(always)] + pub fn ch11(&mut self) -> CH11_W { + CH11_W { w: self } + } + #[doc = "Bit 12 - Enable or disable channel 12"] + #[inline(always)] + pub fn ch12(&mut self) -> CH12_W { + CH12_W { w: self } + } + #[doc = "Bit 13 - Enable or disable channel 13"] + #[inline(always)] + pub fn ch13(&mut self) -> CH13_W { + CH13_W { w: self } + } + #[doc = "Bit 14 - Enable or disable channel 14"] + #[inline(always)] + pub fn ch14(&mut self) -> CH14_W { + CH14_W { w: self } + } + #[doc = "Bit 15 - Enable or disable channel 15"] + #[inline(always)] + pub fn ch15(&mut self) -> CH15_W { + CH15_W { w: self } + } + #[doc = "Bit 16 - Enable or disable channel 16"] + #[inline(always)] + pub fn ch16(&mut self) -> CH16_W { + CH16_W { w: self } + } + #[doc = "Bit 17 - Enable or disable channel 17"] + #[inline(always)] + pub fn ch17(&mut self) -> CH17_W { + CH17_W { w: self } + } + #[doc = "Bit 18 - Enable or disable channel 18"] + #[inline(always)] + pub fn ch18(&mut self) -> CH18_W { + CH18_W { w: self } + } + #[doc = "Bit 19 - Enable or disable channel 19"] + #[inline(always)] + pub fn ch19(&mut self) -> CH19_W { + CH19_W { w: self } + } + #[doc = "Bit 20 - Enable or disable channel 20"] + #[inline(always)] + pub fn ch20(&mut self) -> CH20_W { + CH20_W { w: self } + } + #[doc = "Bit 21 - Enable or disable channel 21"] + #[inline(always)] + pub fn ch21(&mut self) -> CH21_W { + CH21_W { w: self } + } + #[doc = "Bit 22 - Enable or disable channel 22"] + #[inline(always)] + pub fn ch22(&mut self) -> CH22_W { + CH22_W { w: self } + } + #[doc = "Bit 23 - Enable or disable channel 23"] + #[inline(always)] + pub fn ch23(&mut self) -> CH23_W { + CH23_W { w: self } + } + #[doc = "Bit 24 - Enable or disable channel 24"] + #[inline(always)] + pub fn ch24(&mut self) -> CH24_W { + CH24_W { w: self } + } + #[doc = "Bit 25 - Enable or disable channel 25"] + #[inline(always)] + pub fn ch25(&mut self) -> CH25_W { + CH25_W { w: self } + } + #[doc = "Bit 26 - Enable or disable channel 26"] + #[inline(always)] + pub fn ch26(&mut self) -> CH26_W { + CH26_W { w: self } + } + #[doc = "Bit 27 - Enable or disable channel 27"] + #[inline(always)] + pub fn ch27(&mut self) -> CH27_W { + CH27_W { w: self } + } + #[doc = "Bit 28 - Enable or disable channel 28"] + #[inline(always)] + pub fn ch28(&mut self) -> CH28_W { + CH28_W { w: self } + } + #[doc = "Bit 29 - Enable or disable channel 29"] + #[inline(always)] + pub fn ch29(&mut self) -> CH29_W { + CH29_W { w: self } + } + #[doc = "Bit 30 - Enable or disable channel 30"] + #[inline(always)] + pub fn ch30(&mut self) -> CH30_W { + CH30_W { w: self } + } + #[doc = "Bit 31 - Enable or disable channel 31"] + #[inline(always)] + pub fn ch31(&mut self) -> CH31_W { + CH31_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Channel enable register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [chen](index.html) module"] +pub struct CHEN_SPEC; +impl crate::RegisterSpec for CHEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [chen::R](R) reader structure"] +impl crate::Readable for CHEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [chen::W](W) writer structure"] +impl crate::Writable for CHEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CHEN to value 0"] +impl crate::Resettable for CHEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ppi/chenclr.rs b/src/ppi/chenclr.rs new file mode 100644 index 0000000..e116e3d --- /dev/null +++ b/src/ppi/chenclr.rs @@ -0,0 +1,3266 @@ +#[doc = "Register `CHENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CHENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Channel 0 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH0_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH0` reader - Channel 0 enable clear register. Writing '0' has no effect"] +pub struct CH0_R(crate::FieldReader); +impl CH0_R { + pub(crate) fn new(bits: bool) -> Self { + CH0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH0_A { + match self.bits { + false => CH0_A::DISABLED, + true => CH0_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH0_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH0_A::ENABLED + } +} +impl core::ops::Deref for CH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 0 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH0_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH0_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH0` writer - Channel 0 enable clear register. Writing '0' has no effect"] +pub struct CH0_W<'a> { + w: &'a mut W, +} +impl<'a> CH0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH0_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH0_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Channel 1 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH1_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH1` reader - Channel 1 enable clear register. Writing '0' has no effect"] +pub struct CH1_R(crate::FieldReader); +impl CH1_R { + pub(crate) fn new(bits: bool) -> Self { + CH1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH1_A { + match self.bits { + false => CH1_A::DISABLED, + true => CH1_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH1_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH1_A::ENABLED + } +} +impl core::ops::Deref for CH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 1 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH1_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH1_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH1` writer - Channel 1 enable clear register. Writing '0' has no effect"] +pub struct CH1_W<'a> { + w: &'a mut W, +} +impl<'a> CH1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH1_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH1_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Channel 2 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH2_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH2` reader - Channel 2 enable clear register. Writing '0' has no effect"] +pub struct CH2_R(crate::FieldReader); +impl CH2_R { + pub(crate) fn new(bits: bool) -> Self { + CH2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH2_A { + match self.bits { + false => CH2_A::DISABLED, + true => CH2_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH2_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH2_A::ENABLED + } +} +impl core::ops::Deref for CH2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 2 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH2_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH2_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH2` writer - Channel 2 enable clear register. Writing '0' has no effect"] +pub struct CH2_W<'a> { + w: &'a mut W, +} +impl<'a> CH2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH2_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH2_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Channel 3 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH3_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH3` reader - Channel 3 enable clear register. Writing '0' has no effect"] +pub struct CH3_R(crate::FieldReader); +impl CH3_R { + pub(crate) fn new(bits: bool) -> Self { + CH3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH3_A { + match self.bits { + false => CH3_A::DISABLED, + true => CH3_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH3_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH3_A::ENABLED + } +} +impl core::ops::Deref for CH3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 3 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH3_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH3_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH3` writer - Channel 3 enable clear register. Writing '0' has no effect"] +pub struct CH3_W<'a> { + w: &'a mut W, +} +impl<'a> CH3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH3_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH3_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Channel 4 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH4_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH4_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH4` reader - Channel 4 enable clear register. Writing '0' has no effect"] +pub struct CH4_R(crate::FieldReader); +impl CH4_R { + pub(crate) fn new(bits: bool) -> Self { + CH4_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH4_A { + match self.bits { + false => CH4_A::DISABLED, + true => CH4_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH4_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH4_A::ENABLED + } +} +impl core::ops::Deref for CH4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 4 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH4_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH4_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH4` writer - Channel 4 enable clear register. Writing '0' has no effect"] +pub struct CH4_W<'a> { + w: &'a mut W, +} +impl<'a> CH4_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH4_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH4_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Channel 5 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH5_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH5_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH5` reader - Channel 5 enable clear register. Writing '0' has no effect"] +pub struct CH5_R(crate::FieldReader); +impl CH5_R { + pub(crate) fn new(bits: bool) -> Self { + CH5_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH5_A { + match self.bits { + false => CH5_A::DISABLED, + true => CH5_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH5_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH5_A::ENABLED + } +} +impl core::ops::Deref for CH5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 5 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH5_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH5_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH5` writer - Channel 5 enable clear register. Writing '0' has no effect"] +pub struct CH5_W<'a> { + w: &'a mut W, +} +impl<'a> CH5_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH5_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH5_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Channel 6 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH6_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH6_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH6` reader - Channel 6 enable clear register. Writing '0' has no effect"] +pub struct CH6_R(crate::FieldReader); +impl CH6_R { + pub(crate) fn new(bits: bool) -> Self { + CH6_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH6_A { + match self.bits { + false => CH6_A::DISABLED, + true => CH6_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH6_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH6_A::ENABLED + } +} +impl core::ops::Deref for CH6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 6 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH6_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH6_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH6` writer - Channel 6 enable clear register. Writing '0' has no effect"] +pub struct CH6_W<'a> { + w: &'a mut W, +} +impl<'a> CH6_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH6_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH6_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Channel 7 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH7_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH7_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH7` reader - Channel 7 enable clear register. Writing '0' has no effect"] +pub struct CH7_R(crate::FieldReader); +impl CH7_R { + pub(crate) fn new(bits: bool) -> Self { + CH7_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH7_A { + match self.bits { + false => CH7_A::DISABLED, + true => CH7_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH7_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH7_A::ENABLED + } +} +impl core::ops::Deref for CH7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 7 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH7_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH7_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH7` writer - Channel 7 enable clear register. Writing '0' has no effect"] +pub struct CH7_W<'a> { + w: &'a mut W, +} +impl<'a> CH7_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH7_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH7_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Channel 8 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH8_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH8_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH8` reader - Channel 8 enable clear register. Writing '0' has no effect"] +pub struct CH8_R(crate::FieldReader); +impl CH8_R { + pub(crate) fn new(bits: bool) -> Self { + CH8_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH8_A { + match self.bits { + false => CH8_A::DISABLED, + true => CH8_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH8_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH8_A::ENABLED + } +} +impl core::ops::Deref for CH8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 8 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH8_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH8_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH8` writer - Channel 8 enable clear register. Writing '0' has no effect"] +pub struct CH8_W<'a> { + w: &'a mut W, +} +impl<'a> CH8_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH8_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH8_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Channel 9 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH9_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH9_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH9` reader - Channel 9 enable clear register. Writing '0' has no effect"] +pub struct CH9_R(crate::FieldReader); +impl CH9_R { + pub(crate) fn new(bits: bool) -> Self { + CH9_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH9_A { + match self.bits { + false => CH9_A::DISABLED, + true => CH9_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH9_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH9_A::ENABLED + } +} +impl core::ops::Deref for CH9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 9 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH9_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH9_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH9` writer - Channel 9 enable clear register. Writing '0' has no effect"] +pub struct CH9_W<'a> { + w: &'a mut W, +} +impl<'a> CH9_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH9_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH9_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Channel 10 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH10_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH10_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH10` reader - Channel 10 enable clear register. Writing '0' has no effect"] +pub struct CH10_R(crate::FieldReader); +impl CH10_R { + pub(crate) fn new(bits: bool) -> Self { + CH10_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH10_A { + match self.bits { + false => CH10_A::DISABLED, + true => CH10_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH10_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH10_A::ENABLED + } +} +impl core::ops::Deref for CH10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 10 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH10_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH10_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH10` writer - Channel 10 enable clear register. Writing '0' has no effect"] +pub struct CH10_W<'a> { + w: &'a mut W, +} +impl<'a> CH10_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH10_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH10_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Channel 11 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH11_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH11_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH11` reader - Channel 11 enable clear register. Writing '0' has no effect"] +pub struct CH11_R(crate::FieldReader); +impl CH11_R { + pub(crate) fn new(bits: bool) -> Self { + CH11_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH11_A { + match self.bits { + false => CH11_A::DISABLED, + true => CH11_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH11_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH11_A::ENABLED + } +} +impl core::ops::Deref for CH11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 11 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH11_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH11_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH11` writer - Channel 11 enable clear register. Writing '0' has no effect"] +pub struct CH11_W<'a> { + w: &'a mut W, +} +impl<'a> CH11_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH11_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH11_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Channel 12 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH12_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH12_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH12` reader - Channel 12 enable clear register. Writing '0' has no effect"] +pub struct CH12_R(crate::FieldReader); +impl CH12_R { + pub(crate) fn new(bits: bool) -> Self { + CH12_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH12_A { + match self.bits { + false => CH12_A::DISABLED, + true => CH12_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH12_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH12_A::ENABLED + } +} +impl core::ops::Deref for CH12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 12 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH12_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH12_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH12` writer - Channel 12 enable clear register. Writing '0' has no effect"] +pub struct CH12_W<'a> { + w: &'a mut W, +} +impl<'a> CH12_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH12_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH12_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Channel 13 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH13_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH13_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH13` reader - Channel 13 enable clear register. Writing '0' has no effect"] +pub struct CH13_R(crate::FieldReader); +impl CH13_R { + pub(crate) fn new(bits: bool) -> Self { + CH13_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH13_A { + match self.bits { + false => CH13_A::DISABLED, + true => CH13_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH13_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH13_A::ENABLED + } +} +impl core::ops::Deref for CH13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 13 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH13_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH13_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH13` writer - Channel 13 enable clear register. Writing '0' has no effect"] +pub struct CH13_W<'a> { + w: &'a mut W, +} +impl<'a> CH13_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH13_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH13_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Channel 14 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH14_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH14_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH14` reader - Channel 14 enable clear register. Writing '0' has no effect"] +pub struct CH14_R(crate::FieldReader); +impl CH14_R { + pub(crate) fn new(bits: bool) -> Self { + CH14_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH14_A { + match self.bits { + false => CH14_A::DISABLED, + true => CH14_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH14_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH14_A::ENABLED + } +} +impl core::ops::Deref for CH14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 14 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH14_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH14_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH14` writer - Channel 14 enable clear register. Writing '0' has no effect"] +pub struct CH14_W<'a> { + w: &'a mut W, +} +impl<'a> CH14_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH14_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH14_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Channel 15 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH15_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH15_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH15` reader - Channel 15 enable clear register. Writing '0' has no effect"] +pub struct CH15_R(crate::FieldReader); +impl CH15_R { + pub(crate) fn new(bits: bool) -> Self { + CH15_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH15_A { + match self.bits { + false => CH15_A::DISABLED, + true => CH15_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH15_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH15_A::ENABLED + } +} +impl core::ops::Deref for CH15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 15 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH15_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH15_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH15` writer - Channel 15 enable clear register. Writing '0' has no effect"] +pub struct CH15_W<'a> { + w: &'a mut W, +} +impl<'a> CH15_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH15_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH15_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Channel 16 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH16_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH16_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH16` reader - Channel 16 enable clear register. Writing '0' has no effect"] +pub struct CH16_R(crate::FieldReader); +impl CH16_R { + pub(crate) fn new(bits: bool) -> Self { + CH16_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH16_A { + match self.bits { + false => CH16_A::DISABLED, + true => CH16_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH16_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH16_A::ENABLED + } +} +impl core::ops::Deref for CH16_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 16 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH16_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH16_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH16` writer - Channel 16 enable clear register. Writing '0' has no effect"] +pub struct CH16_W<'a> { + w: &'a mut W, +} +impl<'a> CH16_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH16_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH16_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Channel 17 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH17_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH17_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH17` reader - Channel 17 enable clear register. Writing '0' has no effect"] +pub struct CH17_R(crate::FieldReader); +impl CH17_R { + pub(crate) fn new(bits: bool) -> Self { + CH17_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH17_A { + match self.bits { + false => CH17_A::DISABLED, + true => CH17_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH17_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH17_A::ENABLED + } +} +impl core::ops::Deref for CH17_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 17 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH17_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH17_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH17` writer - Channel 17 enable clear register. Writing '0' has no effect"] +pub struct CH17_W<'a> { + w: &'a mut W, +} +impl<'a> CH17_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH17_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH17_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Channel 18 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH18_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH18_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH18` reader - Channel 18 enable clear register. Writing '0' has no effect"] +pub struct CH18_R(crate::FieldReader); +impl CH18_R { + pub(crate) fn new(bits: bool) -> Self { + CH18_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH18_A { + match self.bits { + false => CH18_A::DISABLED, + true => CH18_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH18_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH18_A::ENABLED + } +} +impl core::ops::Deref for CH18_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 18 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH18_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH18_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH18` writer - Channel 18 enable clear register. Writing '0' has no effect"] +pub struct CH18_W<'a> { + w: &'a mut W, +} +impl<'a> CH18_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH18_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH18_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Channel 19 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH19_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH19_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH19` reader - Channel 19 enable clear register. Writing '0' has no effect"] +pub struct CH19_R(crate::FieldReader); +impl CH19_R { + pub(crate) fn new(bits: bool) -> Self { + CH19_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH19_A { + match self.bits { + false => CH19_A::DISABLED, + true => CH19_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH19_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH19_A::ENABLED + } +} +impl core::ops::Deref for CH19_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 19 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH19_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH19_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH19` writer - Channel 19 enable clear register. Writing '0' has no effect"] +pub struct CH19_W<'a> { + w: &'a mut W, +} +impl<'a> CH19_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH19_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH19_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Channel 20 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH20_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH20_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH20` reader - Channel 20 enable clear register. Writing '0' has no effect"] +pub struct CH20_R(crate::FieldReader); +impl CH20_R { + pub(crate) fn new(bits: bool) -> Self { + CH20_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH20_A { + match self.bits { + false => CH20_A::DISABLED, + true => CH20_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH20_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH20_A::ENABLED + } +} +impl core::ops::Deref for CH20_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 20 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH20_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH20_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH20` writer - Channel 20 enable clear register. Writing '0' has no effect"] +pub struct CH20_W<'a> { + w: &'a mut W, +} +impl<'a> CH20_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH20_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH20_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Channel 21 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH21_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH21_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH21` reader - Channel 21 enable clear register. Writing '0' has no effect"] +pub struct CH21_R(crate::FieldReader); +impl CH21_R { + pub(crate) fn new(bits: bool) -> Self { + CH21_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH21_A { + match self.bits { + false => CH21_A::DISABLED, + true => CH21_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH21_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH21_A::ENABLED + } +} +impl core::ops::Deref for CH21_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 21 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH21_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH21_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH21` writer - Channel 21 enable clear register. Writing '0' has no effect"] +pub struct CH21_W<'a> { + w: &'a mut W, +} +impl<'a> CH21_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH21_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH21_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); + self.w + } +} +#[doc = "Channel 22 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH22_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH22_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH22` reader - Channel 22 enable clear register. Writing '0' has no effect"] +pub struct CH22_R(crate::FieldReader); +impl CH22_R { + pub(crate) fn new(bits: bool) -> Self { + CH22_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH22_A { + match self.bits { + false => CH22_A::DISABLED, + true => CH22_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH22_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH22_A::ENABLED + } +} +impl core::ops::Deref for CH22_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 22 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH22_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH22_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH22` writer - Channel 22 enable clear register. Writing '0' has no effect"] +pub struct CH22_W<'a> { + w: &'a mut W, +} +impl<'a> CH22_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH22_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH22_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); + self.w + } +} +#[doc = "Channel 23 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH23_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH23_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH23` reader - Channel 23 enable clear register. Writing '0' has no effect"] +pub struct CH23_R(crate::FieldReader); +impl CH23_R { + pub(crate) fn new(bits: bool) -> Self { + CH23_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH23_A { + match self.bits { + false => CH23_A::DISABLED, + true => CH23_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH23_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH23_A::ENABLED + } +} +impl core::ops::Deref for CH23_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 23 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH23_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH23_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH23` writer - Channel 23 enable clear register. Writing '0' has no effect"] +pub struct CH23_W<'a> { + w: &'a mut W, +} +impl<'a> CH23_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH23_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH23_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); + self.w + } +} +#[doc = "Channel 24 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH24_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH24_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH24` reader - Channel 24 enable clear register. Writing '0' has no effect"] +pub struct CH24_R(crate::FieldReader); +impl CH24_R { + pub(crate) fn new(bits: bool) -> Self { + CH24_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH24_A { + match self.bits { + false => CH24_A::DISABLED, + true => CH24_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH24_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH24_A::ENABLED + } +} +impl core::ops::Deref for CH24_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 24 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH24_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH24_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH24` writer - Channel 24 enable clear register. Writing '0' has no effect"] +pub struct CH24_W<'a> { + w: &'a mut W, +} +impl<'a> CH24_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH24_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH24_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Channel 25 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH25_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH25_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH25` reader - Channel 25 enable clear register. Writing '0' has no effect"] +pub struct CH25_R(crate::FieldReader); +impl CH25_R { + pub(crate) fn new(bits: bool) -> Self { + CH25_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH25_A { + match self.bits { + false => CH25_A::DISABLED, + true => CH25_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH25_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH25_A::ENABLED + } +} +impl core::ops::Deref for CH25_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 25 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH25_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH25_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH25` writer - Channel 25 enable clear register. Writing '0' has no effect"] +pub struct CH25_W<'a> { + w: &'a mut W, +} +impl<'a> CH25_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH25_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH25_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Channel 26 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH26_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH26_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH26` reader - Channel 26 enable clear register. Writing '0' has no effect"] +pub struct CH26_R(crate::FieldReader); +impl CH26_R { + pub(crate) fn new(bits: bool) -> Self { + CH26_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH26_A { + match self.bits { + false => CH26_A::DISABLED, + true => CH26_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH26_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH26_A::ENABLED + } +} +impl core::ops::Deref for CH26_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 26 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH26_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH26_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH26` writer - Channel 26 enable clear register. Writing '0' has no effect"] +pub struct CH26_W<'a> { + w: &'a mut W, +} +impl<'a> CH26_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH26_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH26_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Channel 27 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH27_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH27_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH27` reader - Channel 27 enable clear register. Writing '0' has no effect"] +pub struct CH27_R(crate::FieldReader); +impl CH27_R { + pub(crate) fn new(bits: bool) -> Self { + CH27_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH27_A { + match self.bits { + false => CH27_A::DISABLED, + true => CH27_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH27_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH27_A::ENABLED + } +} +impl core::ops::Deref for CH27_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 27 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH27_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH27_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH27` writer - Channel 27 enable clear register. Writing '0' has no effect"] +pub struct CH27_W<'a> { + w: &'a mut W, +} +impl<'a> CH27_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH27_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH27_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +#[doc = "Channel 28 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH28_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH28_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH28` reader - Channel 28 enable clear register. Writing '0' has no effect"] +pub struct CH28_R(crate::FieldReader); +impl CH28_R { + pub(crate) fn new(bits: bool) -> Self { + CH28_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH28_A { + match self.bits { + false => CH28_A::DISABLED, + true => CH28_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH28_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH28_A::ENABLED + } +} +impl core::ops::Deref for CH28_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 28 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH28_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH28_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH28` writer - Channel 28 enable clear register. Writing '0' has no effect"] +pub struct CH28_W<'a> { + w: &'a mut W, +} +impl<'a> CH28_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH28_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH28_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); + self.w + } +} +#[doc = "Channel 29 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH29_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH29_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH29` reader - Channel 29 enable clear register. Writing '0' has no effect"] +pub struct CH29_R(crate::FieldReader); +impl CH29_R { + pub(crate) fn new(bits: bool) -> Self { + CH29_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH29_A { + match self.bits { + false => CH29_A::DISABLED, + true => CH29_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH29_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH29_A::ENABLED + } +} +impl core::ops::Deref for CH29_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 29 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH29_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH29_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH29` writer - Channel 29 enable clear register. Writing '0' has no effect"] +pub struct CH29_W<'a> { + w: &'a mut W, +} +impl<'a> CH29_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH29_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH29_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); + self.w + } +} +#[doc = "Channel 30 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH30_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH30_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH30` reader - Channel 30 enable clear register. Writing '0' has no effect"] +pub struct CH30_R(crate::FieldReader); +impl CH30_R { + pub(crate) fn new(bits: bool) -> Self { + CH30_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH30_A { + match self.bits { + false => CH30_A::DISABLED, + true => CH30_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH30_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH30_A::ENABLED + } +} +impl core::ops::Deref for CH30_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 30 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH30_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH30_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH30` writer - Channel 30 enable clear register. Writing '0' has no effect"] +pub struct CH30_W<'a> { + w: &'a mut W, +} +impl<'a> CH30_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH30_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH30_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); + self.w + } +} +#[doc = "Channel 31 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH31_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH31_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH31` reader - Channel 31 enable clear register. Writing '0' has no effect"] +pub struct CH31_R(crate::FieldReader); +impl CH31_R { + pub(crate) fn new(bits: bool) -> Self { + CH31_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH31_A { + match self.bits { + false => CH31_A::DISABLED, + true => CH31_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH31_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH31_A::ENABLED + } +} +impl core::ops::Deref for CH31_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 31 enable clear register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH31_AW { + #[doc = "1: Write: disable channel"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH31_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH31` writer - Channel 31 enable clear register. Writing '0' has no effect"] +pub struct CH31_W<'a> { + w: &'a mut W, +} +impl<'a> CH31_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH31_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: disable channel"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH31_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bit 0 - Channel 0 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch0(&self) -> CH0_R { + CH0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Channel 1 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch1(&self) -> CH1_R { + CH1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Channel 2 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch2(&self) -> CH2_R { + CH2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Channel 3 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch3(&self) -> CH3_R { + CH3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Channel 4 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch4(&self) -> CH4_R { + CH4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Channel 5 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch5(&self) -> CH5_R { + CH5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Channel 6 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch6(&self) -> CH6_R { + CH6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Channel 7 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch7(&self) -> CH7_R { + CH7_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Channel 8 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch8(&self) -> CH8_R { + CH8_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Channel 9 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch9(&self) -> CH9_R { + CH9_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Channel 10 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch10(&self) -> CH10_R { + CH10_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Channel 11 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch11(&self) -> CH11_R { + CH11_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Channel 12 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch12(&self) -> CH12_R { + CH12_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Channel 13 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch13(&self) -> CH13_R { + CH13_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Channel 14 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch14(&self) -> CH14_R { + CH14_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Channel 15 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch15(&self) -> CH15_R { + CH15_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Channel 16 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch16(&self) -> CH16_R { + CH16_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Channel 17 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch17(&self) -> CH17_R { + CH17_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Channel 18 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch18(&self) -> CH18_R { + CH18_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Channel 19 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch19(&self) -> CH19_R { + CH19_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Channel 20 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch20(&self) -> CH20_R { + CH20_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 21 - Channel 21 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch21(&self) -> CH21_R { + CH21_R::new(((self.bits >> 21) & 0x01) != 0) + } + #[doc = "Bit 22 - Channel 22 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch22(&self) -> CH22_R { + CH22_R::new(((self.bits >> 22) & 0x01) != 0) + } + #[doc = "Bit 23 - Channel 23 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch23(&self) -> CH23_R { + CH23_R::new(((self.bits >> 23) & 0x01) != 0) + } + #[doc = "Bit 24 - Channel 24 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch24(&self) -> CH24_R { + CH24_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Channel 25 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch25(&self) -> CH25_R { + CH25_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Channel 26 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch26(&self) -> CH26_R { + CH26_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Channel 27 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch27(&self) -> CH27_R { + CH27_R::new(((self.bits >> 27) & 0x01) != 0) + } + #[doc = "Bit 28 - Channel 28 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch28(&self) -> CH28_R { + CH28_R::new(((self.bits >> 28) & 0x01) != 0) + } + #[doc = "Bit 29 - Channel 29 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch29(&self) -> CH29_R { + CH29_R::new(((self.bits >> 29) & 0x01) != 0) + } + #[doc = "Bit 30 - Channel 30 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch30(&self) -> CH30_R { + CH30_R::new(((self.bits >> 30) & 0x01) != 0) + } + #[doc = "Bit 31 - Channel 31 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch31(&self) -> CH31_R { + CH31_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Channel 0 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch0(&mut self) -> CH0_W { + CH0_W { w: self } + } + #[doc = "Bit 1 - Channel 1 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch1(&mut self) -> CH1_W { + CH1_W { w: self } + } + #[doc = "Bit 2 - Channel 2 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch2(&mut self) -> CH2_W { + CH2_W { w: self } + } + #[doc = "Bit 3 - Channel 3 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch3(&mut self) -> CH3_W { + CH3_W { w: self } + } + #[doc = "Bit 4 - Channel 4 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch4(&mut self) -> CH4_W { + CH4_W { w: self } + } + #[doc = "Bit 5 - Channel 5 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch5(&mut self) -> CH5_W { + CH5_W { w: self } + } + #[doc = "Bit 6 - Channel 6 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch6(&mut self) -> CH6_W { + CH6_W { w: self } + } + #[doc = "Bit 7 - Channel 7 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch7(&mut self) -> CH7_W { + CH7_W { w: self } + } + #[doc = "Bit 8 - Channel 8 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch8(&mut self) -> CH8_W { + CH8_W { w: self } + } + #[doc = "Bit 9 - Channel 9 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch9(&mut self) -> CH9_W { + CH9_W { w: self } + } + #[doc = "Bit 10 - Channel 10 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch10(&mut self) -> CH10_W { + CH10_W { w: self } + } + #[doc = "Bit 11 - Channel 11 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch11(&mut self) -> CH11_W { + CH11_W { w: self } + } + #[doc = "Bit 12 - Channel 12 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch12(&mut self) -> CH12_W { + CH12_W { w: self } + } + #[doc = "Bit 13 - Channel 13 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch13(&mut self) -> CH13_W { + CH13_W { w: self } + } + #[doc = "Bit 14 - Channel 14 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch14(&mut self) -> CH14_W { + CH14_W { w: self } + } + #[doc = "Bit 15 - Channel 15 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch15(&mut self) -> CH15_W { + CH15_W { w: self } + } + #[doc = "Bit 16 - Channel 16 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch16(&mut self) -> CH16_W { + CH16_W { w: self } + } + #[doc = "Bit 17 - Channel 17 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch17(&mut self) -> CH17_W { + CH17_W { w: self } + } + #[doc = "Bit 18 - Channel 18 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch18(&mut self) -> CH18_W { + CH18_W { w: self } + } + #[doc = "Bit 19 - Channel 19 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch19(&mut self) -> CH19_W { + CH19_W { w: self } + } + #[doc = "Bit 20 - Channel 20 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch20(&mut self) -> CH20_W { + CH20_W { w: self } + } + #[doc = "Bit 21 - Channel 21 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch21(&mut self) -> CH21_W { + CH21_W { w: self } + } + #[doc = "Bit 22 - Channel 22 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch22(&mut self) -> CH22_W { + CH22_W { w: self } + } + #[doc = "Bit 23 - Channel 23 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch23(&mut self) -> CH23_W { + CH23_W { w: self } + } + #[doc = "Bit 24 - Channel 24 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch24(&mut self) -> CH24_W { + CH24_W { w: self } + } + #[doc = "Bit 25 - Channel 25 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch25(&mut self) -> CH25_W { + CH25_W { w: self } + } + #[doc = "Bit 26 - Channel 26 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch26(&mut self) -> CH26_W { + CH26_W { w: self } + } + #[doc = "Bit 27 - Channel 27 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch27(&mut self) -> CH27_W { + CH27_W { w: self } + } + #[doc = "Bit 28 - Channel 28 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch28(&mut self) -> CH28_W { + CH28_W { w: self } + } + #[doc = "Bit 29 - Channel 29 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch29(&mut self) -> CH29_W { + CH29_W { w: self } + } + #[doc = "Bit 30 - Channel 30 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch30(&mut self) -> CH30_W { + CH30_W { w: self } + } + #[doc = "Bit 31 - Channel 31 enable clear register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch31(&mut self) -> CH31_W { + CH31_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Channel enable clear register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [chenclr](index.html) module"] +pub struct CHENCLR_SPEC; +impl crate::RegisterSpec for CHENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [chenclr::R](R) reader structure"] +impl crate::Readable for CHENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [chenclr::W](W) writer structure"] +impl crate::Writable for CHENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CHENCLR to value 0"] +impl crate::Resettable for CHENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ppi/chenset.rs b/src/ppi/chenset.rs new file mode 100644 index 0000000..62ecb9d --- /dev/null +++ b/src/ppi/chenset.rs @@ -0,0 +1,3266 @@ +#[doc = "Register `CHENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CHENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Channel 0 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH0_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH0` reader - Channel 0 enable set register. Writing '0' has no effect"] +pub struct CH0_R(crate::FieldReader); +impl CH0_R { + pub(crate) fn new(bits: bool) -> Self { + CH0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH0_A { + match self.bits { + false => CH0_A::DISABLED, + true => CH0_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH0_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH0_A::ENABLED + } +} +impl core::ops::Deref for CH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 0 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH0_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH0_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH0` writer - Channel 0 enable set register. Writing '0' has no effect"] +pub struct CH0_W<'a> { + w: &'a mut W, +} +impl<'a> CH0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH0_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH0_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Channel 1 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH1_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH1` reader - Channel 1 enable set register. Writing '0' has no effect"] +pub struct CH1_R(crate::FieldReader); +impl CH1_R { + pub(crate) fn new(bits: bool) -> Self { + CH1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH1_A { + match self.bits { + false => CH1_A::DISABLED, + true => CH1_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH1_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH1_A::ENABLED + } +} +impl core::ops::Deref for CH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 1 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH1_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH1_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH1` writer - Channel 1 enable set register. Writing '0' has no effect"] +pub struct CH1_W<'a> { + w: &'a mut W, +} +impl<'a> CH1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH1_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH1_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Channel 2 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH2_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH2` reader - Channel 2 enable set register. Writing '0' has no effect"] +pub struct CH2_R(crate::FieldReader); +impl CH2_R { + pub(crate) fn new(bits: bool) -> Self { + CH2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH2_A { + match self.bits { + false => CH2_A::DISABLED, + true => CH2_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH2_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH2_A::ENABLED + } +} +impl core::ops::Deref for CH2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 2 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH2_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH2_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH2` writer - Channel 2 enable set register. Writing '0' has no effect"] +pub struct CH2_W<'a> { + w: &'a mut W, +} +impl<'a> CH2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH2_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH2_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Channel 3 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH3_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH3` reader - Channel 3 enable set register. Writing '0' has no effect"] +pub struct CH3_R(crate::FieldReader); +impl CH3_R { + pub(crate) fn new(bits: bool) -> Self { + CH3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH3_A { + match self.bits { + false => CH3_A::DISABLED, + true => CH3_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH3_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH3_A::ENABLED + } +} +impl core::ops::Deref for CH3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 3 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH3_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH3_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH3` writer - Channel 3 enable set register. Writing '0' has no effect"] +pub struct CH3_W<'a> { + w: &'a mut W, +} +impl<'a> CH3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH3_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH3_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Channel 4 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH4_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH4_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH4` reader - Channel 4 enable set register. Writing '0' has no effect"] +pub struct CH4_R(crate::FieldReader); +impl CH4_R { + pub(crate) fn new(bits: bool) -> Self { + CH4_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH4_A { + match self.bits { + false => CH4_A::DISABLED, + true => CH4_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH4_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH4_A::ENABLED + } +} +impl core::ops::Deref for CH4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 4 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH4_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH4_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH4` writer - Channel 4 enable set register. Writing '0' has no effect"] +pub struct CH4_W<'a> { + w: &'a mut W, +} +impl<'a> CH4_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH4_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH4_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Channel 5 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH5_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH5_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH5` reader - Channel 5 enable set register. Writing '0' has no effect"] +pub struct CH5_R(crate::FieldReader); +impl CH5_R { + pub(crate) fn new(bits: bool) -> Self { + CH5_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH5_A { + match self.bits { + false => CH5_A::DISABLED, + true => CH5_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH5_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH5_A::ENABLED + } +} +impl core::ops::Deref for CH5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 5 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH5_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH5_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH5` writer - Channel 5 enable set register. Writing '0' has no effect"] +pub struct CH5_W<'a> { + w: &'a mut W, +} +impl<'a> CH5_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH5_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH5_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Channel 6 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH6_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH6_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH6` reader - Channel 6 enable set register. Writing '0' has no effect"] +pub struct CH6_R(crate::FieldReader); +impl CH6_R { + pub(crate) fn new(bits: bool) -> Self { + CH6_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH6_A { + match self.bits { + false => CH6_A::DISABLED, + true => CH6_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH6_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH6_A::ENABLED + } +} +impl core::ops::Deref for CH6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 6 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH6_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH6_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH6` writer - Channel 6 enable set register. Writing '0' has no effect"] +pub struct CH6_W<'a> { + w: &'a mut W, +} +impl<'a> CH6_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH6_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH6_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Channel 7 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH7_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH7_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH7` reader - Channel 7 enable set register. Writing '0' has no effect"] +pub struct CH7_R(crate::FieldReader); +impl CH7_R { + pub(crate) fn new(bits: bool) -> Self { + CH7_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH7_A { + match self.bits { + false => CH7_A::DISABLED, + true => CH7_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH7_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH7_A::ENABLED + } +} +impl core::ops::Deref for CH7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 7 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH7_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH7_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH7` writer - Channel 7 enable set register. Writing '0' has no effect"] +pub struct CH7_W<'a> { + w: &'a mut W, +} +impl<'a> CH7_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH7_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH7_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Channel 8 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH8_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH8_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH8` reader - Channel 8 enable set register. Writing '0' has no effect"] +pub struct CH8_R(crate::FieldReader); +impl CH8_R { + pub(crate) fn new(bits: bool) -> Self { + CH8_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH8_A { + match self.bits { + false => CH8_A::DISABLED, + true => CH8_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH8_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH8_A::ENABLED + } +} +impl core::ops::Deref for CH8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 8 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH8_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH8_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH8` writer - Channel 8 enable set register. Writing '0' has no effect"] +pub struct CH8_W<'a> { + w: &'a mut W, +} +impl<'a> CH8_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH8_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH8_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Channel 9 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH9_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH9_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH9` reader - Channel 9 enable set register. Writing '0' has no effect"] +pub struct CH9_R(crate::FieldReader); +impl CH9_R { + pub(crate) fn new(bits: bool) -> Self { + CH9_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH9_A { + match self.bits { + false => CH9_A::DISABLED, + true => CH9_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH9_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH9_A::ENABLED + } +} +impl core::ops::Deref for CH9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 9 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH9_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH9_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH9` writer - Channel 9 enable set register. Writing '0' has no effect"] +pub struct CH9_W<'a> { + w: &'a mut W, +} +impl<'a> CH9_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH9_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH9_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Channel 10 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH10_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH10_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH10` reader - Channel 10 enable set register. Writing '0' has no effect"] +pub struct CH10_R(crate::FieldReader); +impl CH10_R { + pub(crate) fn new(bits: bool) -> Self { + CH10_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH10_A { + match self.bits { + false => CH10_A::DISABLED, + true => CH10_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH10_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH10_A::ENABLED + } +} +impl core::ops::Deref for CH10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 10 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH10_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH10_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH10` writer - Channel 10 enable set register. Writing '0' has no effect"] +pub struct CH10_W<'a> { + w: &'a mut W, +} +impl<'a> CH10_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH10_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH10_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Channel 11 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH11_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH11_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH11` reader - Channel 11 enable set register. Writing '0' has no effect"] +pub struct CH11_R(crate::FieldReader); +impl CH11_R { + pub(crate) fn new(bits: bool) -> Self { + CH11_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH11_A { + match self.bits { + false => CH11_A::DISABLED, + true => CH11_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH11_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH11_A::ENABLED + } +} +impl core::ops::Deref for CH11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 11 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH11_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH11_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH11` writer - Channel 11 enable set register. Writing '0' has no effect"] +pub struct CH11_W<'a> { + w: &'a mut W, +} +impl<'a> CH11_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH11_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH11_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Channel 12 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH12_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH12_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH12` reader - Channel 12 enable set register. Writing '0' has no effect"] +pub struct CH12_R(crate::FieldReader); +impl CH12_R { + pub(crate) fn new(bits: bool) -> Self { + CH12_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH12_A { + match self.bits { + false => CH12_A::DISABLED, + true => CH12_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH12_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH12_A::ENABLED + } +} +impl core::ops::Deref for CH12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 12 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH12_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH12_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH12` writer - Channel 12 enable set register. Writing '0' has no effect"] +pub struct CH12_W<'a> { + w: &'a mut W, +} +impl<'a> CH12_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH12_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH12_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Channel 13 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH13_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH13_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH13` reader - Channel 13 enable set register. Writing '0' has no effect"] +pub struct CH13_R(crate::FieldReader); +impl CH13_R { + pub(crate) fn new(bits: bool) -> Self { + CH13_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH13_A { + match self.bits { + false => CH13_A::DISABLED, + true => CH13_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH13_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH13_A::ENABLED + } +} +impl core::ops::Deref for CH13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 13 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH13_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH13_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH13` writer - Channel 13 enable set register. Writing '0' has no effect"] +pub struct CH13_W<'a> { + w: &'a mut W, +} +impl<'a> CH13_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH13_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH13_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Channel 14 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH14_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH14_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH14` reader - Channel 14 enable set register. Writing '0' has no effect"] +pub struct CH14_R(crate::FieldReader); +impl CH14_R { + pub(crate) fn new(bits: bool) -> Self { + CH14_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH14_A { + match self.bits { + false => CH14_A::DISABLED, + true => CH14_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH14_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH14_A::ENABLED + } +} +impl core::ops::Deref for CH14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 14 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH14_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH14_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH14` writer - Channel 14 enable set register. Writing '0' has no effect"] +pub struct CH14_W<'a> { + w: &'a mut W, +} +impl<'a> CH14_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH14_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH14_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Channel 15 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH15_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH15_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH15` reader - Channel 15 enable set register. Writing '0' has no effect"] +pub struct CH15_R(crate::FieldReader); +impl CH15_R { + pub(crate) fn new(bits: bool) -> Self { + CH15_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH15_A { + match self.bits { + false => CH15_A::DISABLED, + true => CH15_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH15_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH15_A::ENABLED + } +} +impl core::ops::Deref for CH15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 15 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH15_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH15_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH15` writer - Channel 15 enable set register. Writing '0' has no effect"] +pub struct CH15_W<'a> { + w: &'a mut W, +} +impl<'a> CH15_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH15_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH15_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Channel 16 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH16_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH16_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH16` reader - Channel 16 enable set register. Writing '0' has no effect"] +pub struct CH16_R(crate::FieldReader); +impl CH16_R { + pub(crate) fn new(bits: bool) -> Self { + CH16_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH16_A { + match self.bits { + false => CH16_A::DISABLED, + true => CH16_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH16_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH16_A::ENABLED + } +} +impl core::ops::Deref for CH16_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 16 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH16_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH16_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH16` writer - Channel 16 enable set register. Writing '0' has no effect"] +pub struct CH16_W<'a> { + w: &'a mut W, +} +impl<'a> CH16_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH16_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH16_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Channel 17 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH17_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH17_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH17` reader - Channel 17 enable set register. Writing '0' has no effect"] +pub struct CH17_R(crate::FieldReader); +impl CH17_R { + pub(crate) fn new(bits: bool) -> Self { + CH17_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH17_A { + match self.bits { + false => CH17_A::DISABLED, + true => CH17_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH17_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH17_A::ENABLED + } +} +impl core::ops::Deref for CH17_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 17 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH17_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH17_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH17` writer - Channel 17 enable set register. Writing '0' has no effect"] +pub struct CH17_W<'a> { + w: &'a mut W, +} +impl<'a> CH17_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH17_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH17_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Channel 18 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH18_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH18_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH18` reader - Channel 18 enable set register. Writing '0' has no effect"] +pub struct CH18_R(crate::FieldReader); +impl CH18_R { + pub(crate) fn new(bits: bool) -> Self { + CH18_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH18_A { + match self.bits { + false => CH18_A::DISABLED, + true => CH18_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH18_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH18_A::ENABLED + } +} +impl core::ops::Deref for CH18_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 18 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH18_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH18_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH18` writer - Channel 18 enable set register. Writing '0' has no effect"] +pub struct CH18_W<'a> { + w: &'a mut W, +} +impl<'a> CH18_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH18_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH18_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Channel 19 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH19_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH19_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH19` reader - Channel 19 enable set register. Writing '0' has no effect"] +pub struct CH19_R(crate::FieldReader); +impl CH19_R { + pub(crate) fn new(bits: bool) -> Self { + CH19_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH19_A { + match self.bits { + false => CH19_A::DISABLED, + true => CH19_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH19_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH19_A::ENABLED + } +} +impl core::ops::Deref for CH19_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 19 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH19_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH19_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH19` writer - Channel 19 enable set register. Writing '0' has no effect"] +pub struct CH19_W<'a> { + w: &'a mut W, +} +impl<'a> CH19_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH19_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH19_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Channel 20 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH20_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH20_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH20` reader - Channel 20 enable set register. Writing '0' has no effect"] +pub struct CH20_R(crate::FieldReader); +impl CH20_R { + pub(crate) fn new(bits: bool) -> Self { + CH20_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH20_A { + match self.bits { + false => CH20_A::DISABLED, + true => CH20_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH20_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH20_A::ENABLED + } +} +impl core::ops::Deref for CH20_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 20 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH20_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH20_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH20` writer - Channel 20 enable set register. Writing '0' has no effect"] +pub struct CH20_W<'a> { + w: &'a mut W, +} +impl<'a> CH20_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH20_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH20_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Channel 21 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH21_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH21_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH21` reader - Channel 21 enable set register. Writing '0' has no effect"] +pub struct CH21_R(crate::FieldReader); +impl CH21_R { + pub(crate) fn new(bits: bool) -> Self { + CH21_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH21_A { + match self.bits { + false => CH21_A::DISABLED, + true => CH21_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH21_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH21_A::ENABLED + } +} +impl core::ops::Deref for CH21_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 21 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH21_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH21_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH21` writer - Channel 21 enable set register. Writing '0' has no effect"] +pub struct CH21_W<'a> { + w: &'a mut W, +} +impl<'a> CH21_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH21_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH21_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); + self.w + } +} +#[doc = "Channel 22 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH22_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH22_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH22` reader - Channel 22 enable set register. Writing '0' has no effect"] +pub struct CH22_R(crate::FieldReader); +impl CH22_R { + pub(crate) fn new(bits: bool) -> Self { + CH22_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH22_A { + match self.bits { + false => CH22_A::DISABLED, + true => CH22_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH22_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH22_A::ENABLED + } +} +impl core::ops::Deref for CH22_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 22 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH22_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH22_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH22` writer - Channel 22 enable set register. Writing '0' has no effect"] +pub struct CH22_W<'a> { + w: &'a mut W, +} +impl<'a> CH22_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH22_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH22_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); + self.w + } +} +#[doc = "Channel 23 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH23_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH23_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH23` reader - Channel 23 enable set register. Writing '0' has no effect"] +pub struct CH23_R(crate::FieldReader); +impl CH23_R { + pub(crate) fn new(bits: bool) -> Self { + CH23_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH23_A { + match self.bits { + false => CH23_A::DISABLED, + true => CH23_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH23_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH23_A::ENABLED + } +} +impl core::ops::Deref for CH23_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 23 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH23_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH23_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH23` writer - Channel 23 enable set register. Writing '0' has no effect"] +pub struct CH23_W<'a> { + w: &'a mut W, +} +impl<'a> CH23_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH23_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH23_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); + self.w + } +} +#[doc = "Channel 24 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH24_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH24_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH24` reader - Channel 24 enable set register. Writing '0' has no effect"] +pub struct CH24_R(crate::FieldReader); +impl CH24_R { + pub(crate) fn new(bits: bool) -> Self { + CH24_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH24_A { + match self.bits { + false => CH24_A::DISABLED, + true => CH24_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH24_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH24_A::ENABLED + } +} +impl core::ops::Deref for CH24_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 24 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH24_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH24_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH24` writer - Channel 24 enable set register. Writing '0' has no effect"] +pub struct CH24_W<'a> { + w: &'a mut W, +} +impl<'a> CH24_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH24_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH24_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Channel 25 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH25_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH25_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH25` reader - Channel 25 enable set register. Writing '0' has no effect"] +pub struct CH25_R(crate::FieldReader); +impl CH25_R { + pub(crate) fn new(bits: bool) -> Self { + CH25_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH25_A { + match self.bits { + false => CH25_A::DISABLED, + true => CH25_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH25_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH25_A::ENABLED + } +} +impl core::ops::Deref for CH25_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 25 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH25_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH25_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH25` writer - Channel 25 enable set register. Writing '0' has no effect"] +pub struct CH25_W<'a> { + w: &'a mut W, +} +impl<'a> CH25_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH25_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH25_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Channel 26 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH26_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH26_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH26` reader - Channel 26 enable set register. Writing '0' has no effect"] +pub struct CH26_R(crate::FieldReader); +impl CH26_R { + pub(crate) fn new(bits: bool) -> Self { + CH26_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH26_A { + match self.bits { + false => CH26_A::DISABLED, + true => CH26_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH26_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH26_A::ENABLED + } +} +impl core::ops::Deref for CH26_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 26 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH26_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH26_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH26` writer - Channel 26 enable set register. Writing '0' has no effect"] +pub struct CH26_W<'a> { + w: &'a mut W, +} +impl<'a> CH26_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH26_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH26_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Channel 27 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH27_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH27_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH27` reader - Channel 27 enable set register. Writing '0' has no effect"] +pub struct CH27_R(crate::FieldReader); +impl CH27_R { + pub(crate) fn new(bits: bool) -> Self { + CH27_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH27_A { + match self.bits { + false => CH27_A::DISABLED, + true => CH27_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH27_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH27_A::ENABLED + } +} +impl core::ops::Deref for CH27_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 27 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH27_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH27_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH27` writer - Channel 27 enable set register. Writing '0' has no effect"] +pub struct CH27_W<'a> { + w: &'a mut W, +} +impl<'a> CH27_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH27_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH27_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +#[doc = "Channel 28 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH28_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH28_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH28` reader - Channel 28 enable set register. Writing '0' has no effect"] +pub struct CH28_R(crate::FieldReader); +impl CH28_R { + pub(crate) fn new(bits: bool) -> Self { + CH28_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH28_A { + match self.bits { + false => CH28_A::DISABLED, + true => CH28_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH28_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH28_A::ENABLED + } +} +impl core::ops::Deref for CH28_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 28 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH28_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH28_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH28` writer - Channel 28 enable set register. Writing '0' has no effect"] +pub struct CH28_W<'a> { + w: &'a mut W, +} +impl<'a> CH28_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH28_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH28_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); + self.w + } +} +#[doc = "Channel 29 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH29_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH29_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH29` reader - Channel 29 enable set register. Writing '0' has no effect"] +pub struct CH29_R(crate::FieldReader); +impl CH29_R { + pub(crate) fn new(bits: bool) -> Self { + CH29_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH29_A { + match self.bits { + false => CH29_A::DISABLED, + true => CH29_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH29_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH29_A::ENABLED + } +} +impl core::ops::Deref for CH29_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 29 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH29_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH29_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH29` writer - Channel 29 enable set register. Writing '0' has no effect"] +pub struct CH29_W<'a> { + w: &'a mut W, +} +impl<'a> CH29_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH29_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH29_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); + self.w + } +} +#[doc = "Channel 30 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH30_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH30_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH30` reader - Channel 30 enable set register. Writing '0' has no effect"] +pub struct CH30_R(crate::FieldReader); +impl CH30_R { + pub(crate) fn new(bits: bool) -> Self { + CH30_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH30_A { + match self.bits { + false => CH30_A::DISABLED, + true => CH30_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH30_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH30_A::ENABLED + } +} +impl core::ops::Deref for CH30_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 30 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH30_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH30_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH30` writer - Channel 30 enable set register. Writing '0' has no effect"] +pub struct CH30_W<'a> { + w: &'a mut W, +} +impl<'a> CH30_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH30_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH30_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); + self.w + } +} +#[doc = "Channel 31 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH31_A { + #[doc = "0: Read: channel disabled"] + DISABLED = 0, + #[doc = "1: Read: channel enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH31_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH31` reader - Channel 31 enable set register. Writing '0' has no effect"] +pub struct CH31_R(crate::FieldReader); +impl CH31_R { + pub(crate) fn new(bits: bool) -> Self { + CH31_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH31_A { + match self.bits { + false => CH31_A::DISABLED, + true => CH31_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH31_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH31_A::ENABLED + } +} +impl core::ops::Deref for CH31_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Channel 31 enable set register. Writing '0' has no effect\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH31_AW { + #[doc = "1: Write: Enable channel"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH31_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH31` writer - Channel 31 enable set register. Writing '0' has no effect"] +pub struct CH31_W<'a> { + w: &'a mut W, +} +impl<'a> CH31_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH31_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: Enable channel"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH31_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bit 0 - Channel 0 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch0(&self) -> CH0_R { + CH0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Channel 1 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch1(&self) -> CH1_R { + CH1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Channel 2 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch2(&self) -> CH2_R { + CH2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Channel 3 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch3(&self) -> CH3_R { + CH3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Channel 4 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch4(&self) -> CH4_R { + CH4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Channel 5 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch5(&self) -> CH5_R { + CH5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Channel 6 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch6(&self) -> CH6_R { + CH6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Channel 7 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch7(&self) -> CH7_R { + CH7_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Channel 8 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch8(&self) -> CH8_R { + CH8_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Channel 9 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch9(&self) -> CH9_R { + CH9_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Channel 10 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch10(&self) -> CH10_R { + CH10_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Channel 11 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch11(&self) -> CH11_R { + CH11_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Channel 12 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch12(&self) -> CH12_R { + CH12_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Channel 13 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch13(&self) -> CH13_R { + CH13_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Channel 14 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch14(&self) -> CH14_R { + CH14_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Channel 15 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch15(&self) -> CH15_R { + CH15_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Channel 16 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch16(&self) -> CH16_R { + CH16_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Channel 17 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch17(&self) -> CH17_R { + CH17_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Channel 18 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch18(&self) -> CH18_R { + CH18_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Channel 19 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch19(&self) -> CH19_R { + CH19_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Channel 20 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch20(&self) -> CH20_R { + CH20_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 21 - Channel 21 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch21(&self) -> CH21_R { + CH21_R::new(((self.bits >> 21) & 0x01) != 0) + } + #[doc = "Bit 22 - Channel 22 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch22(&self) -> CH22_R { + CH22_R::new(((self.bits >> 22) & 0x01) != 0) + } + #[doc = "Bit 23 - Channel 23 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch23(&self) -> CH23_R { + CH23_R::new(((self.bits >> 23) & 0x01) != 0) + } + #[doc = "Bit 24 - Channel 24 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch24(&self) -> CH24_R { + CH24_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Channel 25 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch25(&self) -> CH25_R { + CH25_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Channel 26 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch26(&self) -> CH26_R { + CH26_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Channel 27 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch27(&self) -> CH27_R { + CH27_R::new(((self.bits >> 27) & 0x01) != 0) + } + #[doc = "Bit 28 - Channel 28 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch28(&self) -> CH28_R { + CH28_R::new(((self.bits >> 28) & 0x01) != 0) + } + #[doc = "Bit 29 - Channel 29 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch29(&self) -> CH29_R { + CH29_R::new(((self.bits >> 29) & 0x01) != 0) + } + #[doc = "Bit 30 - Channel 30 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch30(&self) -> CH30_R { + CH30_R::new(((self.bits >> 30) & 0x01) != 0) + } + #[doc = "Bit 31 - Channel 31 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch31(&self) -> CH31_R { + CH31_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Channel 0 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch0(&mut self) -> CH0_W { + CH0_W { w: self } + } + #[doc = "Bit 1 - Channel 1 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch1(&mut self) -> CH1_W { + CH1_W { w: self } + } + #[doc = "Bit 2 - Channel 2 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch2(&mut self) -> CH2_W { + CH2_W { w: self } + } + #[doc = "Bit 3 - Channel 3 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch3(&mut self) -> CH3_W { + CH3_W { w: self } + } + #[doc = "Bit 4 - Channel 4 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch4(&mut self) -> CH4_W { + CH4_W { w: self } + } + #[doc = "Bit 5 - Channel 5 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch5(&mut self) -> CH5_W { + CH5_W { w: self } + } + #[doc = "Bit 6 - Channel 6 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch6(&mut self) -> CH6_W { + CH6_W { w: self } + } + #[doc = "Bit 7 - Channel 7 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch7(&mut self) -> CH7_W { + CH7_W { w: self } + } + #[doc = "Bit 8 - Channel 8 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch8(&mut self) -> CH8_W { + CH8_W { w: self } + } + #[doc = "Bit 9 - Channel 9 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch9(&mut self) -> CH9_W { + CH9_W { w: self } + } + #[doc = "Bit 10 - Channel 10 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch10(&mut self) -> CH10_W { + CH10_W { w: self } + } + #[doc = "Bit 11 - Channel 11 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch11(&mut self) -> CH11_W { + CH11_W { w: self } + } + #[doc = "Bit 12 - Channel 12 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch12(&mut self) -> CH12_W { + CH12_W { w: self } + } + #[doc = "Bit 13 - Channel 13 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch13(&mut self) -> CH13_W { + CH13_W { w: self } + } + #[doc = "Bit 14 - Channel 14 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch14(&mut self) -> CH14_W { + CH14_W { w: self } + } + #[doc = "Bit 15 - Channel 15 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch15(&mut self) -> CH15_W { + CH15_W { w: self } + } + #[doc = "Bit 16 - Channel 16 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch16(&mut self) -> CH16_W { + CH16_W { w: self } + } + #[doc = "Bit 17 - Channel 17 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch17(&mut self) -> CH17_W { + CH17_W { w: self } + } + #[doc = "Bit 18 - Channel 18 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch18(&mut self) -> CH18_W { + CH18_W { w: self } + } + #[doc = "Bit 19 - Channel 19 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch19(&mut self) -> CH19_W { + CH19_W { w: self } + } + #[doc = "Bit 20 - Channel 20 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch20(&mut self) -> CH20_W { + CH20_W { w: self } + } + #[doc = "Bit 21 - Channel 21 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch21(&mut self) -> CH21_W { + CH21_W { w: self } + } + #[doc = "Bit 22 - Channel 22 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch22(&mut self) -> CH22_W { + CH22_W { w: self } + } + #[doc = "Bit 23 - Channel 23 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch23(&mut self) -> CH23_W { + CH23_W { w: self } + } + #[doc = "Bit 24 - Channel 24 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch24(&mut self) -> CH24_W { + CH24_W { w: self } + } + #[doc = "Bit 25 - Channel 25 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch25(&mut self) -> CH25_W { + CH25_W { w: self } + } + #[doc = "Bit 26 - Channel 26 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch26(&mut self) -> CH26_W { + CH26_W { w: self } + } + #[doc = "Bit 27 - Channel 27 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch27(&mut self) -> CH27_W { + CH27_W { w: self } + } + #[doc = "Bit 28 - Channel 28 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch28(&mut self) -> CH28_W { + CH28_W { w: self } + } + #[doc = "Bit 29 - Channel 29 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch29(&mut self) -> CH29_W { + CH29_W { w: self } + } + #[doc = "Bit 30 - Channel 30 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch30(&mut self) -> CH30_W { + CH30_W { w: self } + } + #[doc = "Bit 31 - Channel 31 enable set register. Writing '0' has no effect"] + #[inline(always)] + pub fn ch31(&mut self) -> CH31_W { + CH31_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Channel enable set register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [chenset](index.html) module"] +pub struct CHENSET_SPEC; +impl crate::RegisterSpec for CHENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [chenset::R](R) reader structure"] +impl crate::Readable for CHENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [chenset::W](W) writer structure"] +impl crate::Writable for CHENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CHENSET to value 0"] +impl crate::Resettable for CHENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ppi/chg.rs b/src/ppi/chg.rs new file mode 100644 index 0000000..f24aff9 --- /dev/null +++ b/src/ppi/chg.rs @@ -0,0 +1,3043 @@ +#[doc = "Register `CHG[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CHG[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Include or exclude channel 0\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH0_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH0` reader - Include or exclude channel 0"] +pub struct CH0_R(crate::FieldReader); +impl CH0_R { + pub(crate) fn new(bits: bool) -> Self { + CH0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH0_A { + match self.bits { + false => CH0_A::EXCLUDED, + true => CH0_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH0_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH0_A::INCLUDED + } +} +impl core::ops::Deref for CH0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH0` writer - Include or exclude channel 0"] +pub struct CH0_W<'a> { + w: &'a mut W, +} +impl<'a> CH0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH0_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH0_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH0_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Include or exclude channel 1\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH1_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH1` reader - Include or exclude channel 1"] +pub struct CH1_R(crate::FieldReader); +impl CH1_R { + pub(crate) fn new(bits: bool) -> Self { + CH1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH1_A { + match self.bits { + false => CH1_A::EXCLUDED, + true => CH1_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH1_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH1_A::INCLUDED + } +} +impl core::ops::Deref for CH1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH1` writer - Include or exclude channel 1"] +pub struct CH1_W<'a> { + w: &'a mut W, +} +impl<'a> CH1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH1_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH1_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH1_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Include or exclude channel 2\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH2_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH2` reader - Include or exclude channel 2"] +pub struct CH2_R(crate::FieldReader); +impl CH2_R { + pub(crate) fn new(bits: bool) -> Self { + CH2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH2_A { + match self.bits { + false => CH2_A::EXCLUDED, + true => CH2_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH2_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH2_A::INCLUDED + } +} +impl core::ops::Deref for CH2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH2` writer - Include or exclude channel 2"] +pub struct CH2_W<'a> { + w: &'a mut W, +} +impl<'a> CH2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH2_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH2_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH2_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Include or exclude channel 3\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH3_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH3` reader - Include or exclude channel 3"] +pub struct CH3_R(crate::FieldReader); +impl CH3_R { + pub(crate) fn new(bits: bool) -> Self { + CH3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH3_A { + match self.bits { + false => CH3_A::EXCLUDED, + true => CH3_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH3_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH3_A::INCLUDED + } +} +impl core::ops::Deref for CH3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH3` writer - Include or exclude channel 3"] +pub struct CH3_W<'a> { + w: &'a mut W, +} +impl<'a> CH3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH3_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH3_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH3_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Include or exclude channel 4\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH4_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH4_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH4` reader - Include or exclude channel 4"] +pub struct CH4_R(crate::FieldReader); +impl CH4_R { + pub(crate) fn new(bits: bool) -> Self { + CH4_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH4_A { + match self.bits { + false => CH4_A::EXCLUDED, + true => CH4_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH4_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH4_A::INCLUDED + } +} +impl core::ops::Deref for CH4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH4` writer - Include or exclude channel 4"] +pub struct CH4_W<'a> { + w: &'a mut W, +} +impl<'a> CH4_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH4_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH4_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH4_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Include or exclude channel 5\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH5_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH5_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH5` reader - Include or exclude channel 5"] +pub struct CH5_R(crate::FieldReader); +impl CH5_R { + pub(crate) fn new(bits: bool) -> Self { + CH5_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH5_A { + match self.bits { + false => CH5_A::EXCLUDED, + true => CH5_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH5_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH5_A::INCLUDED + } +} +impl core::ops::Deref for CH5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH5` writer - Include or exclude channel 5"] +pub struct CH5_W<'a> { + w: &'a mut W, +} +impl<'a> CH5_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH5_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH5_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH5_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Include or exclude channel 6\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH6_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH6_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH6` reader - Include or exclude channel 6"] +pub struct CH6_R(crate::FieldReader); +impl CH6_R { + pub(crate) fn new(bits: bool) -> Self { + CH6_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH6_A { + match self.bits { + false => CH6_A::EXCLUDED, + true => CH6_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH6_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH6_A::INCLUDED + } +} +impl core::ops::Deref for CH6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH6` writer - Include or exclude channel 6"] +pub struct CH6_W<'a> { + w: &'a mut W, +} +impl<'a> CH6_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH6_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH6_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH6_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Include or exclude channel 7\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH7_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH7_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH7` reader - Include or exclude channel 7"] +pub struct CH7_R(crate::FieldReader); +impl CH7_R { + pub(crate) fn new(bits: bool) -> Self { + CH7_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH7_A { + match self.bits { + false => CH7_A::EXCLUDED, + true => CH7_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH7_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH7_A::INCLUDED + } +} +impl core::ops::Deref for CH7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH7` writer - Include or exclude channel 7"] +pub struct CH7_W<'a> { + w: &'a mut W, +} +impl<'a> CH7_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH7_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH7_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH7_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Include or exclude channel 8\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH8_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH8_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH8` reader - Include or exclude channel 8"] +pub struct CH8_R(crate::FieldReader); +impl CH8_R { + pub(crate) fn new(bits: bool) -> Self { + CH8_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH8_A { + match self.bits { + false => CH8_A::EXCLUDED, + true => CH8_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH8_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH8_A::INCLUDED + } +} +impl core::ops::Deref for CH8_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH8` writer - Include or exclude channel 8"] +pub struct CH8_W<'a> { + w: &'a mut W, +} +impl<'a> CH8_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH8_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH8_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH8_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Include or exclude channel 9\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH9_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH9_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH9` reader - Include or exclude channel 9"] +pub struct CH9_R(crate::FieldReader); +impl CH9_R { + pub(crate) fn new(bits: bool) -> Self { + CH9_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH9_A { + match self.bits { + false => CH9_A::EXCLUDED, + true => CH9_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH9_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH9_A::INCLUDED + } +} +impl core::ops::Deref for CH9_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH9` writer - Include or exclude channel 9"] +pub struct CH9_W<'a> { + w: &'a mut W, +} +impl<'a> CH9_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH9_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH9_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH9_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Include or exclude channel 10\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH10_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH10_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH10` reader - Include or exclude channel 10"] +pub struct CH10_R(crate::FieldReader); +impl CH10_R { + pub(crate) fn new(bits: bool) -> Self { + CH10_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH10_A { + match self.bits { + false => CH10_A::EXCLUDED, + true => CH10_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH10_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH10_A::INCLUDED + } +} +impl core::ops::Deref for CH10_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH10` writer - Include or exclude channel 10"] +pub struct CH10_W<'a> { + w: &'a mut W, +} +impl<'a> CH10_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH10_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH10_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH10_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Include or exclude channel 11\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH11_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH11_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH11` reader - Include or exclude channel 11"] +pub struct CH11_R(crate::FieldReader); +impl CH11_R { + pub(crate) fn new(bits: bool) -> Self { + CH11_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH11_A { + match self.bits { + false => CH11_A::EXCLUDED, + true => CH11_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH11_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH11_A::INCLUDED + } +} +impl core::ops::Deref for CH11_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH11` writer - Include or exclude channel 11"] +pub struct CH11_W<'a> { + w: &'a mut W, +} +impl<'a> CH11_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH11_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH11_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH11_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Include or exclude channel 12\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH12_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH12_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH12` reader - Include or exclude channel 12"] +pub struct CH12_R(crate::FieldReader); +impl CH12_R { + pub(crate) fn new(bits: bool) -> Self { + CH12_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH12_A { + match self.bits { + false => CH12_A::EXCLUDED, + true => CH12_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH12_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH12_A::INCLUDED + } +} +impl core::ops::Deref for CH12_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH12` writer - Include or exclude channel 12"] +pub struct CH12_W<'a> { + w: &'a mut W, +} +impl<'a> CH12_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH12_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH12_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH12_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Include or exclude channel 13\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH13_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH13_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH13` reader - Include or exclude channel 13"] +pub struct CH13_R(crate::FieldReader); +impl CH13_R { + pub(crate) fn new(bits: bool) -> Self { + CH13_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH13_A { + match self.bits { + false => CH13_A::EXCLUDED, + true => CH13_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH13_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH13_A::INCLUDED + } +} +impl core::ops::Deref for CH13_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH13` writer - Include or exclude channel 13"] +pub struct CH13_W<'a> { + w: &'a mut W, +} +impl<'a> CH13_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH13_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH13_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH13_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Include or exclude channel 14\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH14_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH14_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH14` reader - Include or exclude channel 14"] +pub struct CH14_R(crate::FieldReader); +impl CH14_R { + pub(crate) fn new(bits: bool) -> Self { + CH14_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH14_A { + match self.bits { + false => CH14_A::EXCLUDED, + true => CH14_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH14_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH14_A::INCLUDED + } +} +impl core::ops::Deref for CH14_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH14` writer - Include or exclude channel 14"] +pub struct CH14_W<'a> { + w: &'a mut W, +} +impl<'a> CH14_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH14_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH14_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH14_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Include or exclude channel 15\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH15_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH15_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH15` reader - Include or exclude channel 15"] +pub struct CH15_R(crate::FieldReader); +impl CH15_R { + pub(crate) fn new(bits: bool) -> Self { + CH15_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH15_A { + match self.bits { + false => CH15_A::EXCLUDED, + true => CH15_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH15_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH15_A::INCLUDED + } +} +impl core::ops::Deref for CH15_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH15` writer - Include or exclude channel 15"] +pub struct CH15_W<'a> { + w: &'a mut W, +} +impl<'a> CH15_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH15_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH15_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH15_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Include or exclude channel 16\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH16_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH16_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH16` reader - Include or exclude channel 16"] +pub struct CH16_R(crate::FieldReader); +impl CH16_R { + pub(crate) fn new(bits: bool) -> Self { + CH16_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH16_A { + match self.bits { + false => CH16_A::EXCLUDED, + true => CH16_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH16_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH16_A::INCLUDED + } +} +impl core::ops::Deref for CH16_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH16` writer - Include or exclude channel 16"] +pub struct CH16_W<'a> { + w: &'a mut W, +} +impl<'a> CH16_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH16_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH16_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH16_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Include or exclude channel 17\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH17_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH17_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH17` reader - Include or exclude channel 17"] +pub struct CH17_R(crate::FieldReader); +impl CH17_R { + pub(crate) fn new(bits: bool) -> Self { + CH17_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH17_A { + match self.bits { + false => CH17_A::EXCLUDED, + true => CH17_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH17_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH17_A::INCLUDED + } +} +impl core::ops::Deref for CH17_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH17` writer - Include or exclude channel 17"] +pub struct CH17_W<'a> { + w: &'a mut W, +} +impl<'a> CH17_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH17_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH17_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH17_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Include or exclude channel 18\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH18_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH18_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH18` reader - Include or exclude channel 18"] +pub struct CH18_R(crate::FieldReader); +impl CH18_R { + pub(crate) fn new(bits: bool) -> Self { + CH18_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH18_A { + match self.bits { + false => CH18_A::EXCLUDED, + true => CH18_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH18_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH18_A::INCLUDED + } +} +impl core::ops::Deref for CH18_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH18` writer - Include or exclude channel 18"] +pub struct CH18_W<'a> { + w: &'a mut W, +} +impl<'a> CH18_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH18_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH18_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH18_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Include or exclude channel 19\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH19_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH19_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH19` reader - Include or exclude channel 19"] +pub struct CH19_R(crate::FieldReader); +impl CH19_R { + pub(crate) fn new(bits: bool) -> Self { + CH19_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH19_A { + match self.bits { + false => CH19_A::EXCLUDED, + true => CH19_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH19_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH19_A::INCLUDED + } +} +impl core::ops::Deref for CH19_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH19` writer - Include or exclude channel 19"] +pub struct CH19_W<'a> { + w: &'a mut W, +} +impl<'a> CH19_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH19_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH19_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH19_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Include or exclude channel 20\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH20_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH20_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH20` reader - Include or exclude channel 20"] +pub struct CH20_R(crate::FieldReader); +impl CH20_R { + pub(crate) fn new(bits: bool) -> Self { + CH20_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH20_A { + match self.bits { + false => CH20_A::EXCLUDED, + true => CH20_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH20_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH20_A::INCLUDED + } +} +impl core::ops::Deref for CH20_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH20` writer - Include or exclude channel 20"] +pub struct CH20_W<'a> { + w: &'a mut W, +} +impl<'a> CH20_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH20_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH20_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH20_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Include or exclude channel 21\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH21_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH21_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH21` reader - Include or exclude channel 21"] +pub struct CH21_R(crate::FieldReader); +impl CH21_R { + pub(crate) fn new(bits: bool) -> Self { + CH21_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH21_A { + match self.bits { + false => CH21_A::EXCLUDED, + true => CH21_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH21_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH21_A::INCLUDED + } +} +impl core::ops::Deref for CH21_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH21` writer - Include or exclude channel 21"] +pub struct CH21_W<'a> { + w: &'a mut W, +} +impl<'a> CH21_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH21_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH21_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH21_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); + self.w + } +} +#[doc = "Include or exclude channel 22\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH22_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH22_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH22` reader - Include or exclude channel 22"] +pub struct CH22_R(crate::FieldReader); +impl CH22_R { + pub(crate) fn new(bits: bool) -> Self { + CH22_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH22_A { + match self.bits { + false => CH22_A::EXCLUDED, + true => CH22_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH22_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH22_A::INCLUDED + } +} +impl core::ops::Deref for CH22_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH22` writer - Include or exclude channel 22"] +pub struct CH22_W<'a> { + w: &'a mut W, +} +impl<'a> CH22_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH22_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH22_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH22_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); + self.w + } +} +#[doc = "Include or exclude channel 23\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH23_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH23_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH23` reader - Include or exclude channel 23"] +pub struct CH23_R(crate::FieldReader); +impl CH23_R { + pub(crate) fn new(bits: bool) -> Self { + CH23_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH23_A { + match self.bits { + false => CH23_A::EXCLUDED, + true => CH23_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH23_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH23_A::INCLUDED + } +} +impl core::ops::Deref for CH23_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH23` writer - Include or exclude channel 23"] +pub struct CH23_W<'a> { + w: &'a mut W, +} +impl<'a> CH23_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH23_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH23_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH23_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); + self.w + } +} +#[doc = "Include or exclude channel 24\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH24_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH24_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH24` reader - Include or exclude channel 24"] +pub struct CH24_R(crate::FieldReader); +impl CH24_R { + pub(crate) fn new(bits: bool) -> Self { + CH24_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH24_A { + match self.bits { + false => CH24_A::EXCLUDED, + true => CH24_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH24_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH24_A::INCLUDED + } +} +impl core::ops::Deref for CH24_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH24` writer - Include or exclude channel 24"] +pub struct CH24_W<'a> { + w: &'a mut W, +} +impl<'a> CH24_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH24_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH24_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH24_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Include or exclude channel 25\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH25_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH25_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH25` reader - Include or exclude channel 25"] +pub struct CH25_R(crate::FieldReader); +impl CH25_R { + pub(crate) fn new(bits: bool) -> Self { + CH25_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH25_A { + match self.bits { + false => CH25_A::EXCLUDED, + true => CH25_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH25_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH25_A::INCLUDED + } +} +impl core::ops::Deref for CH25_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH25` writer - Include or exclude channel 25"] +pub struct CH25_W<'a> { + w: &'a mut W, +} +impl<'a> CH25_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH25_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH25_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH25_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Include or exclude channel 26\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH26_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH26_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH26` reader - Include or exclude channel 26"] +pub struct CH26_R(crate::FieldReader); +impl CH26_R { + pub(crate) fn new(bits: bool) -> Self { + CH26_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH26_A { + match self.bits { + false => CH26_A::EXCLUDED, + true => CH26_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH26_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH26_A::INCLUDED + } +} +impl core::ops::Deref for CH26_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH26` writer - Include or exclude channel 26"] +pub struct CH26_W<'a> { + w: &'a mut W, +} +impl<'a> CH26_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH26_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH26_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH26_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +#[doc = "Include or exclude channel 27\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH27_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH27_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH27` reader - Include or exclude channel 27"] +pub struct CH27_R(crate::FieldReader); +impl CH27_R { + pub(crate) fn new(bits: bool) -> Self { + CH27_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH27_A { + match self.bits { + false => CH27_A::EXCLUDED, + true => CH27_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH27_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH27_A::INCLUDED + } +} +impl core::ops::Deref for CH27_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH27` writer - Include or exclude channel 27"] +pub struct CH27_W<'a> { + w: &'a mut W, +} +impl<'a> CH27_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH27_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH27_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH27_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 27)) | ((value as u32 & 0x01) << 27); + self.w + } +} +#[doc = "Include or exclude channel 28\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH28_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH28_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH28` reader - Include or exclude channel 28"] +pub struct CH28_R(crate::FieldReader); +impl CH28_R { + pub(crate) fn new(bits: bool) -> Self { + CH28_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH28_A { + match self.bits { + false => CH28_A::EXCLUDED, + true => CH28_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH28_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH28_A::INCLUDED + } +} +impl core::ops::Deref for CH28_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH28` writer - Include or exclude channel 28"] +pub struct CH28_W<'a> { + w: &'a mut W, +} +impl<'a> CH28_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH28_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH28_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH28_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 28)) | ((value as u32 & 0x01) << 28); + self.w + } +} +#[doc = "Include or exclude channel 29\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH29_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH29_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH29` reader - Include or exclude channel 29"] +pub struct CH29_R(crate::FieldReader); +impl CH29_R { + pub(crate) fn new(bits: bool) -> Self { + CH29_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH29_A { + match self.bits { + false => CH29_A::EXCLUDED, + true => CH29_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH29_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH29_A::INCLUDED + } +} +impl core::ops::Deref for CH29_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH29` writer - Include or exclude channel 29"] +pub struct CH29_W<'a> { + w: &'a mut W, +} +impl<'a> CH29_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH29_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH29_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH29_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 29)) | ((value as u32 & 0x01) << 29); + self.w + } +} +#[doc = "Include or exclude channel 30\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH30_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH30_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH30` reader - Include or exclude channel 30"] +pub struct CH30_R(crate::FieldReader); +impl CH30_R { + pub(crate) fn new(bits: bool) -> Self { + CH30_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH30_A { + match self.bits { + false => CH30_A::EXCLUDED, + true => CH30_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH30_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH30_A::INCLUDED + } +} +impl core::ops::Deref for CH30_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH30` writer - Include or exclude channel 30"] +pub struct CH30_W<'a> { + w: &'a mut W, +} +impl<'a> CH30_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH30_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH30_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH30_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 30)) | ((value as u32 & 0x01) << 30); + self.w + } +} +#[doc = "Include or exclude channel 31\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH31_A { + #[doc = "0: Exclude"] + EXCLUDED = 0, + #[doc = "1: Include"] + INCLUDED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH31_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH31` reader - Include or exclude channel 31"] +pub struct CH31_R(crate::FieldReader); +impl CH31_R { + pub(crate) fn new(bits: bool) -> Self { + CH31_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH31_A { + match self.bits { + false => CH31_A::EXCLUDED, + true => CH31_A::INCLUDED, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == CH31_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == CH31_A::INCLUDED + } +} +impl core::ops::Deref for CH31_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH31` writer - Include or exclude channel 31"] +pub struct CH31_W<'a> { + w: &'a mut W, +} +impl<'a> CH31_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH31_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Exclude"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(CH31_A::EXCLUDED) + } + #[doc = "Include"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(CH31_A::INCLUDED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bit 0 - Include or exclude channel 0"] + #[inline(always)] + pub fn ch0(&self) -> CH0_R { + CH0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Include or exclude channel 1"] + #[inline(always)] + pub fn ch1(&self) -> CH1_R { + CH1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Include or exclude channel 2"] + #[inline(always)] + pub fn ch2(&self) -> CH2_R { + CH2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Include or exclude channel 3"] + #[inline(always)] + pub fn ch3(&self) -> CH3_R { + CH3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Include or exclude channel 4"] + #[inline(always)] + pub fn ch4(&self) -> CH4_R { + CH4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Include or exclude channel 5"] + #[inline(always)] + pub fn ch5(&self) -> CH5_R { + CH5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Include or exclude channel 6"] + #[inline(always)] + pub fn ch6(&self) -> CH6_R { + CH6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Include or exclude channel 7"] + #[inline(always)] + pub fn ch7(&self) -> CH7_R { + CH7_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Include or exclude channel 8"] + #[inline(always)] + pub fn ch8(&self) -> CH8_R { + CH8_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Include or exclude channel 9"] + #[inline(always)] + pub fn ch9(&self) -> CH9_R { + CH9_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Include or exclude channel 10"] + #[inline(always)] + pub fn ch10(&self) -> CH10_R { + CH10_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Include or exclude channel 11"] + #[inline(always)] + pub fn ch11(&self) -> CH11_R { + CH11_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Include or exclude channel 12"] + #[inline(always)] + pub fn ch12(&self) -> CH12_R { + CH12_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Include or exclude channel 13"] + #[inline(always)] + pub fn ch13(&self) -> CH13_R { + CH13_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Include or exclude channel 14"] + #[inline(always)] + pub fn ch14(&self) -> CH14_R { + CH14_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Include or exclude channel 15"] + #[inline(always)] + pub fn ch15(&self) -> CH15_R { + CH15_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Include or exclude channel 16"] + #[inline(always)] + pub fn ch16(&self) -> CH16_R { + CH16_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Include or exclude channel 17"] + #[inline(always)] + pub fn ch17(&self) -> CH17_R { + CH17_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Include or exclude channel 18"] + #[inline(always)] + pub fn ch18(&self) -> CH18_R { + CH18_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Include or exclude channel 19"] + #[inline(always)] + pub fn ch19(&self) -> CH19_R { + CH19_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Include or exclude channel 20"] + #[inline(always)] + pub fn ch20(&self) -> CH20_R { + CH20_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 21 - Include or exclude channel 21"] + #[inline(always)] + pub fn ch21(&self) -> CH21_R { + CH21_R::new(((self.bits >> 21) & 0x01) != 0) + } + #[doc = "Bit 22 - Include or exclude channel 22"] + #[inline(always)] + pub fn ch22(&self) -> CH22_R { + CH22_R::new(((self.bits >> 22) & 0x01) != 0) + } + #[doc = "Bit 23 - Include or exclude channel 23"] + #[inline(always)] + pub fn ch23(&self) -> CH23_R { + CH23_R::new(((self.bits >> 23) & 0x01) != 0) + } + #[doc = "Bit 24 - Include or exclude channel 24"] + #[inline(always)] + pub fn ch24(&self) -> CH24_R { + CH24_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Include or exclude channel 25"] + #[inline(always)] + pub fn ch25(&self) -> CH25_R { + CH25_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Include or exclude channel 26"] + #[inline(always)] + pub fn ch26(&self) -> CH26_R { + CH26_R::new(((self.bits >> 26) & 0x01) != 0) + } + #[doc = "Bit 27 - Include or exclude channel 27"] + #[inline(always)] + pub fn ch27(&self) -> CH27_R { + CH27_R::new(((self.bits >> 27) & 0x01) != 0) + } + #[doc = "Bit 28 - Include or exclude channel 28"] + #[inline(always)] + pub fn ch28(&self) -> CH28_R { + CH28_R::new(((self.bits >> 28) & 0x01) != 0) + } + #[doc = "Bit 29 - Include or exclude channel 29"] + #[inline(always)] + pub fn ch29(&self) -> CH29_R { + CH29_R::new(((self.bits >> 29) & 0x01) != 0) + } + #[doc = "Bit 30 - Include or exclude channel 30"] + #[inline(always)] + pub fn ch30(&self) -> CH30_R { + CH30_R::new(((self.bits >> 30) & 0x01) != 0) + } + #[doc = "Bit 31 - Include or exclude channel 31"] + #[inline(always)] + pub fn ch31(&self) -> CH31_R { + CH31_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Include or exclude channel 0"] + #[inline(always)] + pub fn ch0(&mut self) -> CH0_W { + CH0_W { w: self } + } + #[doc = "Bit 1 - Include or exclude channel 1"] + #[inline(always)] + pub fn ch1(&mut self) -> CH1_W { + CH1_W { w: self } + } + #[doc = "Bit 2 - Include or exclude channel 2"] + #[inline(always)] + pub fn ch2(&mut self) -> CH2_W { + CH2_W { w: self } + } + #[doc = "Bit 3 - Include or exclude channel 3"] + #[inline(always)] + pub fn ch3(&mut self) -> CH3_W { + CH3_W { w: self } + } + #[doc = "Bit 4 - Include or exclude channel 4"] + #[inline(always)] + pub fn ch4(&mut self) -> CH4_W { + CH4_W { w: self } + } + #[doc = "Bit 5 - Include or exclude channel 5"] + #[inline(always)] + pub fn ch5(&mut self) -> CH5_W { + CH5_W { w: self } + } + #[doc = "Bit 6 - Include or exclude channel 6"] + #[inline(always)] + pub fn ch6(&mut self) -> CH6_W { + CH6_W { w: self } + } + #[doc = "Bit 7 - Include or exclude channel 7"] + #[inline(always)] + pub fn ch7(&mut self) -> CH7_W { + CH7_W { w: self } + } + #[doc = "Bit 8 - Include or exclude channel 8"] + #[inline(always)] + pub fn ch8(&mut self) -> CH8_W { + CH8_W { w: self } + } + #[doc = "Bit 9 - Include or exclude channel 9"] + #[inline(always)] + pub fn ch9(&mut self) -> CH9_W { + CH9_W { w: self } + } + #[doc = "Bit 10 - Include or exclude channel 10"] + #[inline(always)] + pub fn ch10(&mut self) -> CH10_W { + CH10_W { w: self } + } + #[doc = "Bit 11 - Include or exclude channel 11"] + #[inline(always)] + pub fn ch11(&mut self) -> CH11_W { + CH11_W { w: self } + } + #[doc = "Bit 12 - Include or exclude channel 12"] + #[inline(always)] + pub fn ch12(&mut self) -> CH12_W { + CH12_W { w: self } + } + #[doc = "Bit 13 - Include or exclude channel 13"] + #[inline(always)] + pub fn ch13(&mut self) -> CH13_W { + CH13_W { w: self } + } + #[doc = "Bit 14 - Include or exclude channel 14"] + #[inline(always)] + pub fn ch14(&mut self) -> CH14_W { + CH14_W { w: self } + } + #[doc = "Bit 15 - Include or exclude channel 15"] + #[inline(always)] + pub fn ch15(&mut self) -> CH15_W { + CH15_W { w: self } + } + #[doc = "Bit 16 - Include or exclude channel 16"] + #[inline(always)] + pub fn ch16(&mut self) -> CH16_W { + CH16_W { w: self } + } + #[doc = "Bit 17 - Include or exclude channel 17"] + #[inline(always)] + pub fn ch17(&mut self) -> CH17_W { + CH17_W { w: self } + } + #[doc = "Bit 18 - Include or exclude channel 18"] + #[inline(always)] + pub fn ch18(&mut self) -> CH18_W { + CH18_W { w: self } + } + #[doc = "Bit 19 - Include or exclude channel 19"] + #[inline(always)] + pub fn ch19(&mut self) -> CH19_W { + CH19_W { w: self } + } + #[doc = "Bit 20 - Include or exclude channel 20"] + #[inline(always)] + pub fn ch20(&mut self) -> CH20_W { + CH20_W { w: self } + } + #[doc = "Bit 21 - Include or exclude channel 21"] + #[inline(always)] + pub fn ch21(&mut self) -> CH21_W { + CH21_W { w: self } + } + #[doc = "Bit 22 - Include or exclude channel 22"] + #[inline(always)] + pub fn ch22(&mut self) -> CH22_W { + CH22_W { w: self } + } + #[doc = "Bit 23 - Include or exclude channel 23"] + #[inline(always)] + pub fn ch23(&mut self) -> CH23_W { + CH23_W { w: self } + } + #[doc = "Bit 24 - Include or exclude channel 24"] + #[inline(always)] + pub fn ch24(&mut self) -> CH24_W { + CH24_W { w: self } + } + #[doc = "Bit 25 - Include or exclude channel 25"] + #[inline(always)] + pub fn ch25(&mut self) -> CH25_W { + CH25_W { w: self } + } + #[doc = "Bit 26 - Include or exclude channel 26"] + #[inline(always)] + pub fn ch26(&mut self) -> CH26_W { + CH26_W { w: self } + } + #[doc = "Bit 27 - Include or exclude channel 27"] + #[inline(always)] + pub fn ch27(&mut self) -> CH27_W { + CH27_W { w: self } + } + #[doc = "Bit 28 - Include or exclude channel 28"] + #[inline(always)] + pub fn ch28(&mut self) -> CH28_W { + CH28_W { w: self } + } + #[doc = "Bit 29 - Include or exclude channel 29"] + #[inline(always)] + pub fn ch29(&mut self) -> CH29_W { + CH29_W { w: self } + } + #[doc = "Bit 30 - Include or exclude channel 30"] + #[inline(always)] + pub fn ch30(&mut self) -> CH30_W { + CH30_W { w: self } + } + #[doc = "Bit 31 - Include or exclude channel 31"] + #[inline(always)] + pub fn ch31(&mut self) -> CH31_W { + CH31_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description collection\\[0\\]: Channel group 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [chg](index.html) module"] +pub struct CHG_SPEC; +impl crate::RegisterSpec for CHG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [chg::R](R) reader structure"] +impl crate::Readable for CHG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [chg::W](W) writer structure"] +impl crate::Writable for CHG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CHG[%s] +to value 0"] +impl crate::Resettable for CHG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ppi/fork.rs b/src/ppi/fork.rs new file mode 100644 index 0000000..296c02e --- /dev/null +++ b/src/ppi/fork.rs @@ -0,0 +1,4 @@ +#[doc = "TEP register accessor: an alias for `Reg`"] +pub type TEP = crate::Reg; +#[doc = "Description cluster\\[0\\]: Channel 0 task end-point"] +pub mod tep; diff --git a/src/ppi/fork/tep.rs b/src/ppi/fork/tep.rs new file mode 100644 index 0000000..b28e68a --- /dev/null +++ b/src/ppi/fork/tep.rs @@ -0,0 +1,102 @@ +#[doc = "Register `TEP` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `TEP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `TEP` reader - Pointer to task register"] +pub struct TEP_R(crate::FieldReader); +impl TEP_R { + pub(crate) fn new(bits: u32) -> Self { + TEP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TEP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TEP` writer - Pointer to task register"] +pub struct TEP_W<'a> { + w: &'a mut W, +} +impl<'a> TEP_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Pointer to task register"] + #[inline(always)] + pub fn tep(&self) -> TEP_R { + TEP_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Pointer to task register"] + #[inline(always)] + pub fn tep(&mut self) -> TEP_W { + TEP_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description cluster\\[0\\]: Channel 0 task end-point\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tep](index.html) module"] +pub struct TEP_SPEC; +impl crate::RegisterSpec for TEP_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [tep::R](R) reader structure"] +impl crate::Readable for TEP_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [tep::W](W) writer structure"] +impl crate::Writable for TEP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TEP to value 0"] +impl crate::Resettable for TEP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ppi/tasks_chg.rs b/src/ppi/tasks_chg.rs new file mode 100644 index 0000000..b1e024d --- /dev/null +++ b/src/ppi/tasks_chg.rs @@ -0,0 +1,8 @@ +#[doc = "EN register accessor: an alias for `Reg`"] +pub type EN = crate::Reg; +#[doc = "Description cluster\\[0\\]: Enable channel group 0"] +pub mod en; +#[doc = "DIS register accessor: an alias for `Reg`"] +pub type DIS = crate::Reg; +#[doc = "Description cluster\\[0\\]: Disable channel group 0"] +pub mod dis; diff --git a/src/ppi/tasks_chg/dis.rs b/src/ppi/tasks_chg/dis.rs new file mode 100644 index 0000000..a337f3f --- /dev/null +++ b/src/ppi/tasks_chg/dis.rs @@ -0,0 +1,45 @@ +#[doc = "Register `DIS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description cluster\\[0\\]: Disable channel group 0\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dis](index.html) module"] +pub struct DIS_SPEC; +impl crate::RegisterSpec for DIS_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [dis::W](W) writer structure"] +impl crate::Writable for DIS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DIS to value 0"] +impl crate::Resettable for DIS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/ppi/tasks_chg/en.rs b/src/ppi/tasks_chg/en.rs new file mode 100644 index 0000000..ca41a8e --- /dev/null +++ b/src/ppi/tasks_chg/en.rs @@ -0,0 +1,45 @@ +#[doc = "Register `EN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description cluster\\[0\\]: Enable channel group 0\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [en](index.html) module"] +pub struct EN_SPEC; +impl crate::RegisterSpec for EN_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [en::W](W) writer structure"] +impl crate::Writable for EN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EN to value 0"] +impl crate::Resettable for EN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pwm0.rs b/src/pwm0.rs new file mode 100644 index 0000000..d7c1695 --- /dev/null +++ b/src/pwm0.rs @@ -0,0 +1,150 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + _reserved0: [u8; 0x04], + #[doc = "0x04 - Stops PWM pulse generation on all channels at the end of current PWM period, and stops sequence playback"] + pub tasks_stop: crate::Reg, + #[doc = "0x08..0x10 - Description collection\\[0\\]: Loads the first PWM value on all enabled channels from sequence 0, and starts playing that sequence at the rate defined in SEQ\\[0\\]REFRESH and/or DECODER.MODE. Causes PWM generation to start it was not running."] + pub tasks_seqstart: [crate::Reg; 2], + #[doc = "0x10 - Steps by one value in the current sequence on all enabled channels if DECODER.MODE=NextStep. Does not cause PWM generation to start it was not running."] + pub tasks_nextstep: crate::Reg, + _reserved3: [u8; 0xf0], + #[doc = "0x104 - Response to STOP task, emitted when PWM pulses are no longer generated"] + pub events_stopped: crate::Reg, + #[doc = "0x108..0x110 - Description collection\\[0\\]: First PWM period started on sequence 0"] + pub events_seqstarted: [crate::Reg; 2], + #[doc = "0x110..0x118 - Description collection\\[0\\]: Emitted at end of every sequence 0, when last value from RAM has been applied to wave counter"] + pub events_seqend: [crate::Reg; 2], + #[doc = "0x118 - Emitted at the end of each PWM period"] + pub events_pwmperiodend: crate::Reg, + #[doc = "0x11c - Concatenated sequences have been played the amount of times defined in LOOP.CNT"] + pub events_loopsdone: crate::Reg, + _reserved8: [u8; 0xe0], + #[doc = "0x200 - Shortcut register"] + pub shorts: crate::Reg, + _reserved9: [u8; 0xfc], + #[doc = "0x300 - Enable or disable interrupt"] + pub inten: crate::Reg, + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved12: [u8; 0x01f4], + #[doc = "0x500 - PWM module enable register"] + pub enable: crate::Reg, + #[doc = "0x504 - Selects operating mode of the wave counter"] + pub mode: crate::Reg, + #[doc = "0x508 - Value up to which the pulse generator counter counts"] + pub countertop: crate::Reg, + #[doc = "0x50c - Configuration for PWM_CLK"] + pub prescaler: crate::Reg, + #[doc = "0x510 - Configuration of the decoder"] + pub decoder: crate::Reg, + #[doc = "0x514 - Amount of playback of a loop"] + pub loop_: crate::Reg, + _reserved18: [u8; 0x08], + #[doc = "0x520..0x530 - Unspecified"] + pub seq0: SEQ, + _reserved19: [u8; 0x10], + #[doc = "0x540..0x550 - Unspecified"] + pub seq1: SEQ, + _reserved20: [u8; 0x10], + #[doc = "0x560..0x570 - Unspecified"] + pub psel: PSEL, +} +#[doc = r"Register block"] +#[repr(C)] +pub struct SEQ { + #[doc = "0x00 - Description cluster\\[0\\]: Beginning address in Data RAM of this sequence"] + pub ptr: crate::Reg, + #[doc = "0x04 - Description cluster\\[0\\]: Amount of values (duty cycles) in this sequence"] + pub cnt: crate::Reg, + #[doc = "0x08 - Description cluster\\[0\\]: Amount of additional PWM periods between samples loaded into compare register"] + pub refresh: crate::Reg, + #[doc = "0x0c - Description cluster\\[0\\]: Time added after the sequence"] + pub enddelay: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod seq; +#[doc = r"Register block"] +#[repr(C)] +pub struct PSEL { + #[doc = "0x00..0x10 - Description collection\\[0\\]: Output pin select for PWM channel 0"] + pub out: [crate::Reg; 4], +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod psel; +#[doc = "TASKS_STOP register accessor: an alias for `Reg`"] +pub type TASKS_STOP = crate::Reg; +#[doc = "Stops PWM pulse generation on all channels at the end of current PWM period, and stops sequence playback"] +pub mod tasks_stop; +#[doc = "TASKS_SEQSTART register accessor: an alias for `Reg`"] +pub type TASKS_SEQSTART = crate::Reg; +#[doc = "Description collection\\[0\\]: Loads the first PWM value on all enabled channels from sequence 0, and starts playing that sequence at the rate defined in SEQ\\[0\\]REFRESH and/or DECODER.MODE. Causes PWM generation to start it was not running."] +pub mod tasks_seqstart; +#[doc = "TASKS_NEXTSTEP register accessor: an alias for `Reg`"] +pub type TASKS_NEXTSTEP = crate::Reg; +#[doc = "Steps by one value in the current sequence on all enabled channels if DECODER.MODE=NextStep. Does not cause PWM generation to start it was not running."] +pub mod tasks_nextstep; +#[doc = "EVENTS_STOPPED register accessor: an alias for `Reg`"] +pub type EVENTS_STOPPED = crate::Reg; +#[doc = "Response to STOP task, emitted when PWM pulses are no longer generated"] +pub mod events_stopped; +#[doc = "EVENTS_SEQSTARTED register accessor: an alias for `Reg`"] +pub type EVENTS_SEQSTARTED = crate::Reg; +#[doc = "Description collection\\[0\\]: First PWM period started on sequence 0"] +pub mod events_seqstarted; +#[doc = "EVENTS_SEQEND register accessor: an alias for `Reg`"] +pub type EVENTS_SEQEND = crate::Reg; +#[doc = "Description collection\\[0\\]: Emitted at end of every sequence 0, when last value from RAM has been applied to wave counter"] +pub mod events_seqend; +#[doc = "EVENTS_PWMPERIODEND register accessor: an alias for `Reg`"] +pub type EVENTS_PWMPERIODEND = crate::Reg; +#[doc = "Emitted at the end of each PWM period"] +pub mod events_pwmperiodend; +#[doc = "EVENTS_LOOPSDONE register accessor: an alias for `Reg`"] +pub type EVENTS_LOOPSDONE = crate::Reg; +#[doc = "Concatenated sequences have been played the amount of times defined in LOOP.CNT"] +pub mod events_loopsdone; +#[doc = "SHORTS register accessor: an alias for `Reg`"] +pub type SHORTS = crate::Reg; +#[doc = "Shortcut register"] +pub mod shorts; +#[doc = "INTEN register accessor: an alias for `Reg`"] +pub type INTEN = crate::Reg; +#[doc = "Enable or disable interrupt"] +pub mod inten; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "ENABLE register accessor: an alias for `Reg`"] +pub type ENABLE = crate::Reg; +#[doc = "PWM module enable register"] +pub mod enable; +#[doc = "MODE register accessor: an alias for `Reg`"] +pub type MODE = crate::Reg; +#[doc = "Selects operating mode of the wave counter"] +pub mod mode; +#[doc = "COUNTERTOP register accessor: an alias for `Reg`"] +pub type COUNTERTOP = crate::Reg; +#[doc = "Value up to which the pulse generator counter counts"] +pub mod countertop; +#[doc = "PRESCALER register accessor: an alias for `Reg`"] +pub type PRESCALER = crate::Reg; +#[doc = "Configuration for PWM_CLK"] +pub mod prescaler; +#[doc = "DECODER register accessor: an alias for `Reg`"] +pub type DECODER = crate::Reg; +#[doc = "Configuration of the decoder"] +pub mod decoder; +#[doc = "LOOP register accessor: an alias for `Reg`"] +pub type LOOP = crate::Reg; +#[doc = "Amount of playback of a loop"] +pub mod loop_; diff --git a/src/pwm0/countertop.rs b/src/pwm0/countertop.rs new file mode 100644 index 0000000..def6926 --- /dev/null +++ b/src/pwm0/countertop.rs @@ -0,0 +1,102 @@ +#[doc = "Register `COUNTERTOP` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `COUNTERTOP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `COUNTERTOP` reader - Value up to which the pulse generator counter counts. This register is ignored when DECODER.MODE=WaveForm and only values from RAM will be used."] +pub struct COUNTERTOP_R(crate::FieldReader); +impl COUNTERTOP_R { + pub(crate) fn new(bits: u16) -> Self { + COUNTERTOP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for COUNTERTOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `COUNTERTOP` writer - Value up to which the pulse generator counter counts. This register is ignored when DECODER.MODE=WaveForm and only values from RAM will be used."] +pub struct COUNTERTOP_W<'a> { + w: &'a mut W, +} +impl<'a> COUNTERTOP_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !0x7fff) | (value as u32 & 0x7fff); + self.w + } +} +impl R { + #[doc = "Bits 0:14 - Value up to which the pulse generator counter counts. This register is ignored when DECODER.MODE=WaveForm and only values from RAM will be used."] + #[inline(always)] + pub fn countertop(&self) -> COUNTERTOP_R { + COUNTERTOP_R::new((self.bits & 0x7fff) as u16) + } +} +impl W { + #[doc = "Bits 0:14 - Value up to which the pulse generator counter counts. This register is ignored when DECODER.MODE=WaveForm and only values from RAM will be used."] + #[inline(always)] + pub fn countertop(&mut self) -> COUNTERTOP_W { + COUNTERTOP_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Value up to which the pulse generator counter counts\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [countertop](index.html) module"] +pub struct COUNTERTOP_SPEC; +impl crate::RegisterSpec for COUNTERTOP_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [countertop::R](R) reader structure"] +impl crate::Readable for COUNTERTOP_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [countertop::W](W) writer structure"] +impl crate::Writable for COUNTERTOP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets COUNTERTOP to value 0x03ff"] +impl crate::Resettable for COUNTERTOP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x03ff + } +} diff --git a/src/pwm0/decoder.rs b/src/pwm0/decoder.rs new file mode 100644 index 0000000..f0e8d54 --- /dev/null +++ b/src/pwm0/decoder.rs @@ -0,0 +1,270 @@ +#[doc = "Register `DECODER` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DECODER` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "How a sequence is read from RAM and spread to the compare register\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum LOAD_A { + #[doc = "0: 1st half word (16-bit) used in all PWM channels 0..3"] + COMMON = 0, + #[doc = "1: 1st half word (16-bit) used in channel 0..1; 2nd word in channel 2..3"] + GROUPED = 1, + #[doc = "2: 1st half word (16-bit) in ch.0; 2nd in ch.1; ...; 4th in ch.3"] + INDIVIDUAL = 2, + #[doc = "3: 1st half word (16-bit) in ch.0; 2nd in ch.1; ...; 4th in COUNTERTOP"] + WAVEFORM = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: LOAD_A) -> Self { + variant as _ + } +} +#[doc = "Field `LOAD` reader - How a sequence is read from RAM and spread to the compare register"] +pub struct LOAD_R(crate::FieldReader); +impl LOAD_R { + pub(crate) fn new(bits: u8) -> Self { + LOAD_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> LOAD_A { + match self.bits { + 0 => LOAD_A::COMMON, + 1 => LOAD_A::GROUPED, + 2 => LOAD_A::INDIVIDUAL, + 3 => LOAD_A::WAVEFORM, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `COMMON`"] + #[inline(always)] + pub fn is_common(&self) -> bool { + **self == LOAD_A::COMMON + } + #[doc = "Checks if the value of the field is `GROUPED`"] + #[inline(always)] + pub fn is_grouped(&self) -> bool { + **self == LOAD_A::GROUPED + } + #[doc = "Checks if the value of the field is `INDIVIDUAL`"] + #[inline(always)] + pub fn is_individual(&self) -> bool { + **self == LOAD_A::INDIVIDUAL + } + #[doc = "Checks if the value of the field is `WAVEFORM`"] + #[inline(always)] + pub fn is_wave_form(&self) -> bool { + **self == LOAD_A::WAVEFORM + } +} +impl core::ops::Deref for LOAD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LOAD` writer - How a sequence is read from RAM and spread to the compare register"] +pub struct LOAD_W<'a> { + w: &'a mut W, +} +impl<'a> LOAD_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LOAD_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "1st half word (16-bit) used in all PWM channels 0..3"] + #[inline(always)] + pub fn common(self) -> &'a mut W { + self.variant(LOAD_A::COMMON) + } + #[doc = "1st half word (16-bit) used in channel 0..1; 2nd word in channel 2..3"] + #[inline(always)] + pub fn grouped(self) -> &'a mut W { + self.variant(LOAD_A::GROUPED) + } + #[doc = "1st half word (16-bit) in ch.0; 2nd in ch.1; ...; 4th in ch.3"] + #[inline(always)] + pub fn individual(self) -> &'a mut W { + self.variant(LOAD_A::INDIVIDUAL) + } + #[doc = "1st half word (16-bit) in ch.0; 2nd in ch.1; ...; 4th in COUNTERTOP"] + #[inline(always)] + pub fn wave_form(self) -> &'a mut W { + self.variant(LOAD_A::WAVEFORM) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); + self.w + } +} +#[doc = "Selects source for advancing the active sequence\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum MODE_A { + #[doc = "0: SEQ\\[n\\].REFRESH is used to determine loading internal compare registers"] + REFRESHCOUNT = 0, + #[doc = "1: NEXTSTEP task causes a new value to be loaded to internal compare registers"] + NEXTSTEP = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: MODE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `MODE` reader - Selects source for advancing the active sequence"] +pub struct MODE_R(crate::FieldReader); +impl MODE_R { + pub(crate) fn new(bits: bool) -> Self { + MODE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> MODE_A { + match self.bits { + false => MODE_A::REFRESHCOUNT, + true => MODE_A::NEXTSTEP, + } + } + #[doc = "Checks if the value of the field is `REFRESHCOUNT`"] + #[inline(always)] + pub fn is_refresh_count(&self) -> bool { + **self == MODE_A::REFRESHCOUNT + } + #[doc = "Checks if the value of the field is `NEXTSTEP`"] + #[inline(always)] + pub fn is_next_step(&self) -> bool { + **self == MODE_A::NEXTSTEP + } +} +impl core::ops::Deref for MODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MODE` writer - Selects source for advancing the active sequence"] +pub struct MODE_W<'a> { + w: &'a mut W, +} +impl<'a> MODE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: MODE_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "SEQ\\[n\\].REFRESH is used to determine loading internal compare registers"] + #[inline(always)] + pub fn refresh_count(self) -> &'a mut W { + self.variant(MODE_A::REFRESHCOUNT) + } + #[doc = "NEXTSTEP task causes a new value to be loaded to internal compare registers"] + #[inline(always)] + pub fn next_step(self) -> &'a mut W { + self.variant(MODE_A::NEXTSTEP) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +impl R { + #[doc = "Bits 0:1 - How a sequence is read from RAM and spread to the compare register"] + #[inline(always)] + pub fn load(&self) -> LOAD_R { + LOAD_R::new((self.bits & 0x03) as u8) + } + #[doc = "Bit 8 - Selects source for advancing the active sequence"] + #[inline(always)] + pub fn mode(&self) -> MODE_R { + MODE_R::new(((self.bits >> 8) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:1 - How a sequence is read from RAM and spread to the compare register"] + #[inline(always)] + pub fn load(&mut self) -> LOAD_W { + LOAD_W { w: self } + } + #[doc = "Bit 8 - Selects source for advancing the active sequence"] + #[inline(always)] + pub fn mode(&mut self) -> MODE_W { + MODE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Configuration of the decoder\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [decoder](index.html) module"] +pub struct DECODER_SPEC; +impl crate::RegisterSpec for DECODER_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [decoder::R](R) reader structure"] +impl crate::Readable for DECODER_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [decoder::W](W) writer structure"] +impl crate::Writable for DECODER_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DECODER to value 0"] +impl crate::Resettable for DECODER_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pwm0/enable.rs b/src/pwm0/enable.rs new file mode 100644 index 0000000..75b8838 --- /dev/null +++ b/src/pwm0/enable.rs @@ -0,0 +1,159 @@ +#[doc = "Register `ENABLE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ENABLE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable PWM module\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENABLE_A { + #[doc = "0: Disabled"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENABLE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENABLE` reader - Enable or disable PWM module"] +pub struct ENABLE_R(crate::FieldReader); +impl ENABLE_R { + pub(crate) fn new(bits: bool) -> Self { + ENABLE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENABLE_A { + match self.bits { + false => ENABLE_A::DISABLED, + true => ENABLE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENABLE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENABLE_A::ENABLED + } +} +impl core::ops::Deref for ENABLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENABLE` writer - Enable or disable PWM module"] +pub struct ENABLE_W<'a> { + w: &'a mut W, +} +impl<'a> ENABLE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENABLE_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENABLE_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENABLE_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable or disable PWM module"] + #[inline(always)] + pub fn enable(&self) -> ENABLE_R { + ENABLE_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Enable or disable PWM module"] + #[inline(always)] + pub fn enable(&mut self) -> ENABLE_W { + ENABLE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "PWM module enable register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [enable](index.html) module"] +pub struct ENABLE_SPEC; +impl crate::RegisterSpec for ENABLE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [enable::R](R) reader structure"] +impl crate::Readable for ENABLE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [enable::W](W) writer structure"] +impl crate::Writable for ENABLE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ENABLE to value 0"] +impl crate::Resettable for ENABLE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pwm0/events_loopsdone.rs b/src/pwm0/events_loopsdone.rs new file mode 100644 index 0000000..1b0baea --- /dev/null +++ b/src/pwm0/events_loopsdone.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_LOOPSDONE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_LOOPSDONE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Concatenated sequences have been played the amount of times defined in LOOP.CNT\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_loopsdone](index.html) module"] +pub struct EVENTS_LOOPSDONE_SPEC; +impl crate::RegisterSpec for EVENTS_LOOPSDONE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_loopsdone::R](R) reader structure"] +impl crate::Readable for EVENTS_LOOPSDONE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_loopsdone::W](W) writer structure"] +impl crate::Writable for EVENTS_LOOPSDONE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_LOOPSDONE to value 0"] +impl crate::Resettable for EVENTS_LOOPSDONE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pwm0/events_pwmperiodend.rs b/src/pwm0/events_pwmperiodend.rs new file mode 100644 index 0000000..024cd3e --- /dev/null +++ b/src/pwm0/events_pwmperiodend.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_PWMPERIODEND` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_PWMPERIODEND` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Emitted at the end of each PWM period\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_pwmperiodend](index.html) module"] +pub struct EVENTS_PWMPERIODEND_SPEC; +impl crate::RegisterSpec for EVENTS_PWMPERIODEND_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_pwmperiodend::R](R) reader structure"] +impl crate::Readable for EVENTS_PWMPERIODEND_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_pwmperiodend::W](W) writer structure"] +impl crate::Writable for EVENTS_PWMPERIODEND_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_PWMPERIODEND to value 0"] +impl crate::Resettable for EVENTS_PWMPERIODEND_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pwm0/events_seqend.rs b/src/pwm0/events_seqend.rs new file mode 100644 index 0000000..431467e --- /dev/null +++ b/src/pwm0/events_seqend.rs @@ -0,0 +1,65 @@ +#[doc = "Register `EVENTS_SEQEND[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_SEQEND[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description collection\\[0\\]: Emitted at end of every sequence 0, when last value from RAM has been applied to wave counter\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_seqend](index.html) module"] +pub struct EVENTS_SEQEND_SPEC; +impl crate::RegisterSpec for EVENTS_SEQEND_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_seqend::R](R) reader structure"] +impl crate::Readable for EVENTS_SEQEND_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_seqend::W](W) writer structure"] +impl crate::Writable for EVENTS_SEQEND_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_SEQEND[%s] +to value 0"] +impl crate::Resettable for EVENTS_SEQEND_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pwm0/events_seqstarted.rs b/src/pwm0/events_seqstarted.rs new file mode 100644 index 0000000..27f9f8d --- /dev/null +++ b/src/pwm0/events_seqstarted.rs @@ -0,0 +1,65 @@ +#[doc = "Register `EVENTS_SEQSTARTED[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_SEQSTARTED[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description collection\\[0\\]: First PWM period started on sequence 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_seqstarted](index.html) module"] +pub struct EVENTS_SEQSTARTED_SPEC; +impl crate::RegisterSpec for EVENTS_SEQSTARTED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_seqstarted::R](R) reader structure"] +impl crate::Readable for EVENTS_SEQSTARTED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_seqstarted::W](W) writer structure"] +impl crate::Writable for EVENTS_SEQSTARTED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_SEQSTARTED[%s] +to value 0"] +impl crate::Resettable for EVENTS_SEQSTARTED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pwm0/events_stopped.rs b/src/pwm0/events_stopped.rs new file mode 100644 index 0000000..16ed4b4 --- /dev/null +++ b/src/pwm0/events_stopped.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_STOPPED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_STOPPED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Response to STOP task, emitted when PWM pulses are no longer generated\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_stopped](index.html) module"] +pub struct EVENTS_STOPPED_SPEC; +impl crate::RegisterSpec for EVENTS_STOPPED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_stopped::R](R) reader structure"] +impl crate::Readable for EVENTS_STOPPED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_stopped::W](W) writer structure"] +impl crate::Writable for EVENTS_STOPPED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_STOPPED to value 0"] +impl crate::Resettable for EVENTS_STOPPED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pwm0/inten.rs b/src/pwm0/inten.rs new file mode 100644 index 0000000..e26d94a --- /dev/null +++ b/src/pwm0/inten.rs @@ -0,0 +1,737 @@ +#[doc = "Register `INTEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` reader - Enable or disable interrupt for STOPPED event"] +pub struct STOPPED_R(crate::FieldReader); +impl STOPPED_R { + pub(crate) fn new(bits: bool) -> Self { + STOPPED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STOPPED_A { + match self.bits { + false => STOPPED_A::DISABLED, + true => STOPPED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STOPPED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STOPPED_A::ENABLED + } +} +impl core::ops::Deref for STOPPED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STOPPED` writer - Enable or disable interrupt for STOPPED event"] +pub struct STOPPED_W<'a> { + w: &'a mut W, +} +impl<'a> STOPPED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STOPPED_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(STOPPED_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(STOPPED_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Enable or disable interrupt for SEQSTARTED\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SEQSTARTED0_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SEQSTARTED0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SEQSTARTED0` reader - Enable or disable interrupt for SEQSTARTED\\[0\\] +event"] +pub struct SEQSTARTED0_R(crate::FieldReader); +impl SEQSTARTED0_R { + pub(crate) fn new(bits: bool) -> Self { + SEQSTARTED0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SEQSTARTED0_A { + match self.bits { + false => SEQSTARTED0_A::DISABLED, + true => SEQSTARTED0_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SEQSTARTED0_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SEQSTARTED0_A::ENABLED + } +} +impl core::ops::Deref for SEQSTARTED0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SEQSTARTED0` writer - Enable or disable interrupt for SEQSTARTED\\[0\\] +event"] +pub struct SEQSTARTED0_W<'a> { + w: &'a mut W, +} +impl<'a> SEQSTARTED0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SEQSTARTED0_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(SEQSTARTED0_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(SEQSTARTED0_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Enable or disable interrupt for SEQSTARTED\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SEQSTARTED1_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SEQSTARTED1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SEQSTARTED1` reader - Enable or disable interrupt for SEQSTARTED\\[1\\] +event"] +pub struct SEQSTARTED1_R(crate::FieldReader); +impl SEQSTARTED1_R { + pub(crate) fn new(bits: bool) -> Self { + SEQSTARTED1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SEQSTARTED1_A { + match self.bits { + false => SEQSTARTED1_A::DISABLED, + true => SEQSTARTED1_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SEQSTARTED1_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SEQSTARTED1_A::ENABLED + } +} +impl core::ops::Deref for SEQSTARTED1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SEQSTARTED1` writer - Enable or disable interrupt for SEQSTARTED\\[1\\] +event"] +pub struct SEQSTARTED1_W<'a> { + w: &'a mut W, +} +impl<'a> SEQSTARTED1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SEQSTARTED1_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(SEQSTARTED1_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(SEQSTARTED1_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Enable or disable interrupt for SEQEND\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SEQEND0_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SEQEND0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SEQEND0` reader - Enable or disable interrupt for SEQEND\\[0\\] +event"] +pub struct SEQEND0_R(crate::FieldReader); +impl SEQEND0_R { + pub(crate) fn new(bits: bool) -> Self { + SEQEND0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SEQEND0_A { + match self.bits { + false => SEQEND0_A::DISABLED, + true => SEQEND0_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SEQEND0_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SEQEND0_A::ENABLED + } +} +impl core::ops::Deref for SEQEND0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SEQEND0` writer - Enable or disable interrupt for SEQEND\\[0\\] +event"] +pub struct SEQEND0_W<'a> { + w: &'a mut W, +} +impl<'a> SEQEND0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SEQEND0_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(SEQEND0_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(SEQEND0_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Enable or disable interrupt for SEQEND\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SEQEND1_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SEQEND1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SEQEND1` reader - Enable or disable interrupt for SEQEND\\[1\\] +event"] +pub struct SEQEND1_R(crate::FieldReader); +impl SEQEND1_R { + pub(crate) fn new(bits: bool) -> Self { + SEQEND1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SEQEND1_A { + match self.bits { + false => SEQEND1_A::DISABLED, + true => SEQEND1_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SEQEND1_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SEQEND1_A::ENABLED + } +} +impl core::ops::Deref for SEQEND1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SEQEND1` writer - Enable or disable interrupt for SEQEND\\[1\\] +event"] +pub struct SEQEND1_W<'a> { + w: &'a mut W, +} +impl<'a> SEQEND1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SEQEND1_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(SEQEND1_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(SEQEND1_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Enable or disable interrupt for PWMPERIODEND event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PWMPERIODEND_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PWMPERIODEND_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PWMPERIODEND` reader - Enable or disable interrupt for PWMPERIODEND event"] +pub struct PWMPERIODEND_R(crate::FieldReader); +impl PWMPERIODEND_R { + pub(crate) fn new(bits: bool) -> Self { + PWMPERIODEND_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PWMPERIODEND_A { + match self.bits { + false => PWMPERIODEND_A::DISABLED, + true => PWMPERIODEND_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PWMPERIODEND_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PWMPERIODEND_A::ENABLED + } +} +impl core::ops::Deref for PWMPERIODEND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PWMPERIODEND` writer - Enable or disable interrupt for PWMPERIODEND event"] +pub struct PWMPERIODEND_W<'a> { + w: &'a mut W, +} +impl<'a> PWMPERIODEND_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PWMPERIODEND_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(PWMPERIODEND_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(PWMPERIODEND_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Enable or disable interrupt for LOOPSDONE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LOOPSDONE_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LOOPSDONE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LOOPSDONE` reader - Enable or disable interrupt for LOOPSDONE event"] +pub struct LOOPSDONE_R(crate::FieldReader); +impl LOOPSDONE_R { + pub(crate) fn new(bits: bool) -> Self { + LOOPSDONE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> LOOPSDONE_A { + match self.bits { + false => LOOPSDONE_A::DISABLED, + true => LOOPSDONE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == LOOPSDONE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == LOOPSDONE_A::ENABLED + } +} +impl core::ops::Deref for LOOPSDONE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LOOPSDONE` writer - Enable or disable interrupt for LOOPSDONE event"] +pub struct LOOPSDONE_W<'a> { + w: &'a mut W, +} +impl<'a> LOOPSDONE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LOOPSDONE_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(LOOPSDONE_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(LOOPSDONE_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +impl R { + #[doc = "Bit 1 - Enable or disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&self) -> STOPPED_R { + STOPPED_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Enable or disable interrupt for SEQSTARTED\\[0\\] +event"] + #[inline(always)] + pub fn seqstarted0(&self) -> SEQSTARTED0_R { + SEQSTARTED0_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Enable or disable interrupt for SEQSTARTED\\[1\\] +event"] + #[inline(always)] + pub fn seqstarted1(&self) -> SEQSTARTED1_R { + SEQSTARTED1_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Enable or disable interrupt for SEQEND\\[0\\] +event"] + #[inline(always)] + pub fn seqend0(&self) -> SEQEND0_R { + SEQEND0_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Enable or disable interrupt for SEQEND\\[1\\] +event"] + #[inline(always)] + pub fn seqend1(&self) -> SEQEND1_R { + SEQEND1_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Enable or disable interrupt for PWMPERIODEND event"] + #[inline(always)] + pub fn pwmperiodend(&self) -> PWMPERIODEND_R { + PWMPERIODEND_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Enable or disable interrupt for LOOPSDONE event"] + #[inline(always)] + pub fn loopsdone(&self) -> LOOPSDONE_R { + LOOPSDONE_R::new(((self.bits >> 7) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 1 - Enable or disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&mut self) -> STOPPED_W { + STOPPED_W { w: self } + } + #[doc = "Bit 2 - Enable or disable interrupt for SEQSTARTED\\[0\\] +event"] + #[inline(always)] + pub fn seqstarted0(&mut self) -> SEQSTARTED0_W { + SEQSTARTED0_W { w: self } + } + #[doc = "Bit 3 - Enable or disable interrupt for SEQSTARTED\\[1\\] +event"] + #[inline(always)] + pub fn seqstarted1(&mut self) -> SEQSTARTED1_W { + SEQSTARTED1_W { w: self } + } + #[doc = "Bit 4 - Enable or disable interrupt for SEQEND\\[0\\] +event"] + #[inline(always)] + pub fn seqend0(&mut self) -> SEQEND0_W { + SEQEND0_W { w: self } + } + #[doc = "Bit 5 - Enable or disable interrupt for SEQEND\\[1\\] +event"] + #[inline(always)] + pub fn seqend1(&mut self) -> SEQEND1_W { + SEQEND1_W { w: self } + } + #[doc = "Bit 6 - Enable or disable interrupt for PWMPERIODEND event"] + #[inline(always)] + pub fn pwmperiodend(&mut self) -> PWMPERIODEND_W { + PWMPERIODEND_W { w: self } + } + #[doc = "Bit 7 - Enable or disable interrupt for LOOPSDONE event"] + #[inline(always)] + pub fn loopsdone(&mut self) -> LOOPSDONE_W { + LOOPSDONE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable or disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [inten](index.html) module"] +pub struct INTEN_SPEC; +impl crate::RegisterSpec for INTEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [inten::R](R) reader structure"] +impl crate::Readable for INTEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [inten::W](W) writer structure"] +impl crate::Writable for INTEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTEN to value 0"] +impl crate::Resettable for INTEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pwm0/intenclr.rs b/src/pwm0/intenclr.rs new file mode 100644 index 0000000..3e0c052 --- /dev/null +++ b/src/pwm0/intenclr.rs @@ -0,0 +1,790 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` reader - Write '1' to Disable interrupt for STOPPED event"] +pub struct STOPPED_R(crate::FieldReader); +impl STOPPED_R { + pub(crate) fn new(bits: bool) -> Self { + STOPPED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STOPPED_A { + match self.bits { + false => STOPPED_A::DISABLED, + true => STOPPED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STOPPED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STOPPED_A::ENABLED + } +} +impl core::ops::Deref for STOPPED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` writer - Write '1' to Disable interrupt for STOPPED event"] +pub struct STOPPED_W<'a> { + w: &'a mut W, +} +impl<'a> STOPPED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STOPPED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(STOPPED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for SEQSTARTED\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SEQSTARTED0_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SEQSTARTED0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SEQSTARTED0` reader - Write '1' to Disable interrupt for SEQSTARTED\\[0\\] +event"] +pub struct SEQSTARTED0_R(crate::FieldReader); +impl SEQSTARTED0_R { + pub(crate) fn new(bits: bool) -> Self { + SEQSTARTED0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SEQSTARTED0_A { + match self.bits { + false => SEQSTARTED0_A::DISABLED, + true => SEQSTARTED0_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SEQSTARTED0_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SEQSTARTED0_A::ENABLED + } +} +impl core::ops::Deref for SEQSTARTED0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for SEQSTARTED\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SEQSTARTED0_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SEQSTARTED0_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SEQSTARTED0` writer - Write '1' to Disable interrupt for SEQSTARTED\\[0\\] +event"] +pub struct SEQSTARTED0_W<'a> { + w: &'a mut W, +} +impl<'a> SEQSTARTED0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SEQSTARTED0_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(SEQSTARTED0_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for SEQSTARTED\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SEQSTARTED1_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SEQSTARTED1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SEQSTARTED1` reader - Write '1' to Disable interrupt for SEQSTARTED\\[1\\] +event"] +pub struct SEQSTARTED1_R(crate::FieldReader); +impl SEQSTARTED1_R { + pub(crate) fn new(bits: bool) -> Self { + SEQSTARTED1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SEQSTARTED1_A { + match self.bits { + false => SEQSTARTED1_A::DISABLED, + true => SEQSTARTED1_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SEQSTARTED1_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SEQSTARTED1_A::ENABLED + } +} +impl core::ops::Deref for SEQSTARTED1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for SEQSTARTED\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SEQSTARTED1_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SEQSTARTED1_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SEQSTARTED1` writer - Write '1' to Disable interrupt for SEQSTARTED\\[1\\] +event"] +pub struct SEQSTARTED1_W<'a> { + w: &'a mut W, +} +impl<'a> SEQSTARTED1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SEQSTARTED1_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(SEQSTARTED1_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for SEQEND\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SEQEND0_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SEQEND0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SEQEND0` reader - Write '1' to Disable interrupt for SEQEND\\[0\\] +event"] +pub struct SEQEND0_R(crate::FieldReader); +impl SEQEND0_R { + pub(crate) fn new(bits: bool) -> Self { + SEQEND0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SEQEND0_A { + match self.bits { + false => SEQEND0_A::DISABLED, + true => SEQEND0_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SEQEND0_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SEQEND0_A::ENABLED + } +} +impl core::ops::Deref for SEQEND0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for SEQEND\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SEQEND0_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SEQEND0_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SEQEND0` writer - Write '1' to Disable interrupt for SEQEND\\[0\\] +event"] +pub struct SEQEND0_W<'a> { + w: &'a mut W, +} +impl<'a> SEQEND0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SEQEND0_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(SEQEND0_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for SEQEND\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SEQEND1_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SEQEND1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SEQEND1` reader - Write '1' to Disable interrupt for SEQEND\\[1\\] +event"] +pub struct SEQEND1_R(crate::FieldReader); +impl SEQEND1_R { + pub(crate) fn new(bits: bool) -> Self { + SEQEND1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SEQEND1_A { + match self.bits { + false => SEQEND1_A::DISABLED, + true => SEQEND1_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SEQEND1_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SEQEND1_A::ENABLED + } +} +impl core::ops::Deref for SEQEND1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for SEQEND\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SEQEND1_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SEQEND1_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SEQEND1` writer - Write '1' to Disable interrupt for SEQEND\\[1\\] +event"] +pub struct SEQEND1_W<'a> { + w: &'a mut W, +} +impl<'a> SEQEND1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SEQEND1_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(SEQEND1_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for PWMPERIODEND event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PWMPERIODEND_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PWMPERIODEND_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PWMPERIODEND` reader - Write '1' to Disable interrupt for PWMPERIODEND event"] +pub struct PWMPERIODEND_R(crate::FieldReader); +impl PWMPERIODEND_R { + pub(crate) fn new(bits: bool) -> Self { + PWMPERIODEND_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PWMPERIODEND_A { + match self.bits { + false => PWMPERIODEND_A::DISABLED, + true => PWMPERIODEND_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PWMPERIODEND_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PWMPERIODEND_A::ENABLED + } +} +impl core::ops::Deref for PWMPERIODEND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for PWMPERIODEND event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PWMPERIODEND_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PWMPERIODEND_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PWMPERIODEND` writer - Write '1' to Disable interrupt for PWMPERIODEND event"] +pub struct PWMPERIODEND_W<'a> { + w: &'a mut W, +} +impl<'a> PWMPERIODEND_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PWMPERIODEND_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PWMPERIODEND_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for LOOPSDONE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LOOPSDONE_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LOOPSDONE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LOOPSDONE` reader - Write '1' to Disable interrupt for LOOPSDONE event"] +pub struct LOOPSDONE_R(crate::FieldReader); +impl LOOPSDONE_R { + pub(crate) fn new(bits: bool) -> Self { + LOOPSDONE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> LOOPSDONE_A { + match self.bits { + false => LOOPSDONE_A::DISABLED, + true => LOOPSDONE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == LOOPSDONE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == LOOPSDONE_A::ENABLED + } +} +impl core::ops::Deref for LOOPSDONE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for LOOPSDONE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LOOPSDONE_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LOOPSDONE_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LOOPSDONE` writer - Write '1' to Disable interrupt for LOOPSDONE event"] +pub struct LOOPSDONE_W<'a> { + w: &'a mut W, +} +impl<'a> LOOPSDONE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LOOPSDONE_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(LOOPSDONE_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +impl R { + #[doc = "Bit 1 - Write '1' to Disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&self) -> STOPPED_R { + STOPPED_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for SEQSTARTED\\[0\\] +event"] + #[inline(always)] + pub fn seqstarted0(&self) -> SEQSTARTED0_R { + SEQSTARTED0_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Write '1' to Disable interrupt for SEQSTARTED\\[1\\] +event"] + #[inline(always)] + pub fn seqstarted1(&self) -> SEQSTARTED1_R { + SEQSTARTED1_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Write '1' to Disable interrupt for SEQEND\\[0\\] +event"] + #[inline(always)] + pub fn seqend0(&self) -> SEQEND0_R { + SEQEND0_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Write '1' to Disable interrupt for SEQEND\\[1\\] +event"] + #[inline(always)] + pub fn seqend1(&self) -> SEQEND1_R { + SEQEND1_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Write '1' to Disable interrupt for PWMPERIODEND event"] + #[inline(always)] + pub fn pwmperiodend(&self) -> PWMPERIODEND_R { + PWMPERIODEND_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Write '1' to Disable interrupt for LOOPSDONE event"] + #[inline(always)] + pub fn loopsdone(&self) -> LOOPSDONE_R { + LOOPSDONE_R::new(((self.bits >> 7) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 1 - Write '1' to Disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&mut self) -> STOPPED_W { + STOPPED_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for SEQSTARTED\\[0\\] +event"] + #[inline(always)] + pub fn seqstarted0(&mut self) -> SEQSTARTED0_W { + SEQSTARTED0_W { w: self } + } + #[doc = "Bit 3 - Write '1' to Disable interrupt for SEQSTARTED\\[1\\] +event"] + #[inline(always)] + pub fn seqstarted1(&mut self) -> SEQSTARTED1_W { + SEQSTARTED1_W { w: self } + } + #[doc = "Bit 4 - Write '1' to Disable interrupt for SEQEND\\[0\\] +event"] + #[inline(always)] + pub fn seqend0(&mut self) -> SEQEND0_W { + SEQEND0_W { w: self } + } + #[doc = "Bit 5 - Write '1' to Disable interrupt for SEQEND\\[1\\] +event"] + #[inline(always)] + pub fn seqend1(&mut self) -> SEQEND1_W { + SEQEND1_W { w: self } + } + #[doc = "Bit 6 - Write '1' to Disable interrupt for PWMPERIODEND event"] + #[inline(always)] + pub fn pwmperiodend(&mut self) -> PWMPERIODEND_W { + PWMPERIODEND_W { w: self } + } + #[doc = "Bit 7 - Write '1' to Disable interrupt for LOOPSDONE event"] + #[inline(always)] + pub fn loopsdone(&mut self) -> LOOPSDONE_W { + LOOPSDONE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pwm0/intenset.rs b/src/pwm0/intenset.rs new file mode 100644 index 0000000..d30a6a2 --- /dev/null +++ b/src/pwm0/intenset.rs @@ -0,0 +1,790 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` reader - Write '1' to Enable interrupt for STOPPED event"] +pub struct STOPPED_R(crate::FieldReader); +impl STOPPED_R { + pub(crate) fn new(bits: bool) -> Self { + STOPPED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STOPPED_A { + match self.bits { + false => STOPPED_A::DISABLED, + true => STOPPED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STOPPED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STOPPED_A::ENABLED + } +} +impl core::ops::Deref for STOPPED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` writer - Write '1' to Enable interrupt for STOPPED event"] +pub struct STOPPED_W<'a> { + w: &'a mut W, +} +impl<'a> STOPPED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STOPPED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(STOPPED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for SEQSTARTED\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SEQSTARTED0_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SEQSTARTED0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SEQSTARTED0` reader - Write '1' to Enable interrupt for SEQSTARTED\\[0\\] +event"] +pub struct SEQSTARTED0_R(crate::FieldReader); +impl SEQSTARTED0_R { + pub(crate) fn new(bits: bool) -> Self { + SEQSTARTED0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SEQSTARTED0_A { + match self.bits { + false => SEQSTARTED0_A::DISABLED, + true => SEQSTARTED0_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SEQSTARTED0_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SEQSTARTED0_A::ENABLED + } +} +impl core::ops::Deref for SEQSTARTED0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for SEQSTARTED\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SEQSTARTED0_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SEQSTARTED0_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SEQSTARTED0` writer - Write '1' to Enable interrupt for SEQSTARTED\\[0\\] +event"] +pub struct SEQSTARTED0_W<'a> { + w: &'a mut W, +} +impl<'a> SEQSTARTED0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SEQSTARTED0_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(SEQSTARTED0_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for SEQSTARTED\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SEQSTARTED1_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SEQSTARTED1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SEQSTARTED1` reader - Write '1' to Enable interrupt for SEQSTARTED\\[1\\] +event"] +pub struct SEQSTARTED1_R(crate::FieldReader); +impl SEQSTARTED1_R { + pub(crate) fn new(bits: bool) -> Self { + SEQSTARTED1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SEQSTARTED1_A { + match self.bits { + false => SEQSTARTED1_A::DISABLED, + true => SEQSTARTED1_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SEQSTARTED1_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SEQSTARTED1_A::ENABLED + } +} +impl core::ops::Deref for SEQSTARTED1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for SEQSTARTED\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SEQSTARTED1_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SEQSTARTED1_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SEQSTARTED1` writer - Write '1' to Enable interrupt for SEQSTARTED\\[1\\] +event"] +pub struct SEQSTARTED1_W<'a> { + w: &'a mut W, +} +impl<'a> SEQSTARTED1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SEQSTARTED1_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(SEQSTARTED1_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for SEQEND\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SEQEND0_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SEQEND0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SEQEND0` reader - Write '1' to Enable interrupt for SEQEND\\[0\\] +event"] +pub struct SEQEND0_R(crate::FieldReader); +impl SEQEND0_R { + pub(crate) fn new(bits: bool) -> Self { + SEQEND0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SEQEND0_A { + match self.bits { + false => SEQEND0_A::DISABLED, + true => SEQEND0_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SEQEND0_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SEQEND0_A::ENABLED + } +} +impl core::ops::Deref for SEQEND0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for SEQEND\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SEQEND0_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SEQEND0_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SEQEND0` writer - Write '1' to Enable interrupt for SEQEND\\[0\\] +event"] +pub struct SEQEND0_W<'a> { + w: &'a mut W, +} +impl<'a> SEQEND0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SEQEND0_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(SEQEND0_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for SEQEND\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SEQEND1_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SEQEND1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SEQEND1` reader - Write '1' to Enable interrupt for SEQEND\\[1\\] +event"] +pub struct SEQEND1_R(crate::FieldReader); +impl SEQEND1_R { + pub(crate) fn new(bits: bool) -> Self { + SEQEND1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SEQEND1_A { + match self.bits { + false => SEQEND1_A::DISABLED, + true => SEQEND1_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SEQEND1_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SEQEND1_A::ENABLED + } +} +impl core::ops::Deref for SEQEND1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for SEQEND\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SEQEND1_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SEQEND1_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SEQEND1` writer - Write '1' to Enable interrupt for SEQEND\\[1\\] +event"] +pub struct SEQEND1_W<'a> { + w: &'a mut W, +} +impl<'a> SEQEND1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SEQEND1_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(SEQEND1_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for PWMPERIODEND event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PWMPERIODEND_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PWMPERIODEND_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PWMPERIODEND` reader - Write '1' to Enable interrupt for PWMPERIODEND event"] +pub struct PWMPERIODEND_R(crate::FieldReader); +impl PWMPERIODEND_R { + pub(crate) fn new(bits: bool) -> Self { + PWMPERIODEND_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PWMPERIODEND_A { + match self.bits { + false => PWMPERIODEND_A::DISABLED, + true => PWMPERIODEND_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PWMPERIODEND_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PWMPERIODEND_A::ENABLED + } +} +impl core::ops::Deref for PWMPERIODEND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for PWMPERIODEND event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PWMPERIODEND_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PWMPERIODEND_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PWMPERIODEND` writer - Write '1' to Enable interrupt for PWMPERIODEND event"] +pub struct PWMPERIODEND_W<'a> { + w: &'a mut W, +} +impl<'a> PWMPERIODEND_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PWMPERIODEND_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PWMPERIODEND_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for LOOPSDONE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LOOPSDONE_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LOOPSDONE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LOOPSDONE` reader - Write '1' to Enable interrupt for LOOPSDONE event"] +pub struct LOOPSDONE_R(crate::FieldReader); +impl LOOPSDONE_R { + pub(crate) fn new(bits: bool) -> Self { + LOOPSDONE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> LOOPSDONE_A { + match self.bits { + false => LOOPSDONE_A::DISABLED, + true => LOOPSDONE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == LOOPSDONE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == LOOPSDONE_A::ENABLED + } +} +impl core::ops::Deref for LOOPSDONE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for LOOPSDONE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LOOPSDONE_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LOOPSDONE_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LOOPSDONE` writer - Write '1' to Enable interrupt for LOOPSDONE event"] +pub struct LOOPSDONE_W<'a> { + w: &'a mut W, +} +impl<'a> LOOPSDONE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LOOPSDONE_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(LOOPSDONE_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +impl R { + #[doc = "Bit 1 - Write '1' to Enable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&self) -> STOPPED_R { + STOPPED_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for SEQSTARTED\\[0\\] +event"] + #[inline(always)] + pub fn seqstarted0(&self) -> SEQSTARTED0_R { + SEQSTARTED0_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Write '1' to Enable interrupt for SEQSTARTED\\[1\\] +event"] + #[inline(always)] + pub fn seqstarted1(&self) -> SEQSTARTED1_R { + SEQSTARTED1_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Write '1' to Enable interrupt for SEQEND\\[0\\] +event"] + #[inline(always)] + pub fn seqend0(&self) -> SEQEND0_R { + SEQEND0_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Write '1' to Enable interrupt for SEQEND\\[1\\] +event"] + #[inline(always)] + pub fn seqend1(&self) -> SEQEND1_R { + SEQEND1_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Write '1' to Enable interrupt for PWMPERIODEND event"] + #[inline(always)] + pub fn pwmperiodend(&self) -> PWMPERIODEND_R { + PWMPERIODEND_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Write '1' to Enable interrupt for LOOPSDONE event"] + #[inline(always)] + pub fn loopsdone(&self) -> LOOPSDONE_R { + LOOPSDONE_R::new(((self.bits >> 7) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 1 - Write '1' to Enable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&mut self) -> STOPPED_W { + STOPPED_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for SEQSTARTED\\[0\\] +event"] + #[inline(always)] + pub fn seqstarted0(&mut self) -> SEQSTARTED0_W { + SEQSTARTED0_W { w: self } + } + #[doc = "Bit 3 - Write '1' to Enable interrupt for SEQSTARTED\\[1\\] +event"] + #[inline(always)] + pub fn seqstarted1(&mut self) -> SEQSTARTED1_W { + SEQSTARTED1_W { w: self } + } + #[doc = "Bit 4 - Write '1' to Enable interrupt for SEQEND\\[0\\] +event"] + #[inline(always)] + pub fn seqend0(&mut self) -> SEQEND0_W { + SEQEND0_W { w: self } + } + #[doc = "Bit 5 - Write '1' to Enable interrupt for SEQEND\\[1\\] +event"] + #[inline(always)] + pub fn seqend1(&mut self) -> SEQEND1_W { + SEQEND1_W { w: self } + } + #[doc = "Bit 6 - Write '1' to Enable interrupt for PWMPERIODEND event"] + #[inline(always)] + pub fn pwmperiodend(&mut self) -> PWMPERIODEND_W { + PWMPERIODEND_W { w: self } + } + #[doc = "Bit 7 - Write '1' to Enable interrupt for LOOPSDONE event"] + #[inline(always)] + pub fn loopsdone(&mut self) -> LOOPSDONE_W { + LOOPSDONE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pwm0/loop_.rs b/src/pwm0/loop_.rs new file mode 100644 index 0000000..d9747c4 --- /dev/null +++ b/src/pwm0/loop_.rs @@ -0,0 +1,138 @@ +#[doc = "Register `LOOP` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `LOOP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Amount of playback of pattern cycles\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u16)] +pub enum CNT_A { + #[doc = "0: Looping disabled (stop at the end of the sequence)"] + DISABLED = 0, +} +impl From for u16 { + #[inline(always)] + fn from(variant: CNT_A) -> Self { + variant as _ + } +} +#[doc = "Field `CNT` reader - Amount of playback of pattern cycles"] +pub struct CNT_R(crate::FieldReader); +impl CNT_R { + pub(crate) fn new(bits: u16) -> Self { + CNT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(CNT_A::DISABLED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CNT_A::DISABLED + } +} +impl core::ops::Deref for CNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CNT` writer - Amount of playback of pattern cycles"] +pub struct CNT_W<'a> { + w: &'a mut W, +} +impl<'a> CNT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CNT_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Looping disabled (stop at the end of the sequence)"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CNT_A::DISABLED) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); + self.w + } +} +impl R { + #[doc = "Bits 0:15 - Amount of playback of pattern cycles"] + #[inline(always)] + pub fn cnt(&self) -> CNT_R { + CNT_R::new((self.bits & 0xffff) as u16) + } +} +impl W { + #[doc = "Bits 0:15 - Amount of playback of pattern cycles"] + #[inline(always)] + pub fn cnt(&mut self) -> CNT_W { + CNT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Amount of playback of a loop\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [loop_](index.html) module"] +pub struct LOOP_SPEC; +impl crate::RegisterSpec for LOOP_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [loop_::R](R) reader structure"] +impl crate::Readable for LOOP_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [loop_::W](W) writer structure"] +impl crate::Writable for LOOP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LOOP to value 0"] +impl crate::Resettable for LOOP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pwm0/mode.rs b/src/pwm0/mode.rs new file mode 100644 index 0000000..8fd2933 --- /dev/null +++ b/src/pwm0/mode.rs @@ -0,0 +1,159 @@ +#[doc = "Register `MODE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MODE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Selects up or up and down as wave counter mode\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum UPDOWN_A { + #[doc = "0: Up counter - edge aligned PWM duty-cycle"] + UP = 0, + #[doc = "1: Up and down counter - center aligned PWM duty cycle"] + UPANDDOWN = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: UPDOWN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `UPDOWN` reader - Selects up or up and down as wave counter mode"] +pub struct UPDOWN_R(crate::FieldReader); +impl UPDOWN_R { + pub(crate) fn new(bits: bool) -> Self { + UPDOWN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> UPDOWN_A { + match self.bits { + false => UPDOWN_A::UP, + true => UPDOWN_A::UPANDDOWN, + } + } + #[doc = "Checks if the value of the field is `UP`"] + #[inline(always)] + pub fn is_up(&self) -> bool { + **self == UPDOWN_A::UP + } + #[doc = "Checks if the value of the field is `UPANDDOWN`"] + #[inline(always)] + pub fn is_up_and_down(&self) -> bool { + **self == UPDOWN_A::UPANDDOWN + } +} +impl core::ops::Deref for UPDOWN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `UPDOWN` writer - Selects up or up and down as wave counter mode"] +pub struct UPDOWN_W<'a> { + w: &'a mut W, +} +impl<'a> UPDOWN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: UPDOWN_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Up counter - edge aligned PWM duty-cycle"] + #[inline(always)] + pub fn up(self) -> &'a mut W { + self.variant(UPDOWN_A::UP) + } + #[doc = "Up and down counter - center aligned PWM duty cycle"] + #[inline(always)] + pub fn up_and_down(self) -> &'a mut W { + self.variant(UPDOWN_A::UPANDDOWN) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Selects up or up and down as wave counter mode"] + #[inline(always)] + pub fn updown(&self) -> UPDOWN_R { + UPDOWN_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Selects up or up and down as wave counter mode"] + #[inline(always)] + pub fn updown(&mut self) -> UPDOWN_W { + UPDOWN_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Selects operating mode of the wave counter\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mode](index.html) module"] +pub struct MODE_SPEC; +impl crate::RegisterSpec for MODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mode::R](R) reader structure"] +impl crate::Readable for MODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mode::W](W) writer structure"] +impl crate::Writable for MODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MODE to value 0"] +impl crate::Resettable for MODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pwm0/prescaler.rs b/src/pwm0/prescaler.rs new file mode 100644 index 0000000..b7ee747 --- /dev/null +++ b/src/pwm0/prescaler.rs @@ -0,0 +1,229 @@ +#[doc = "Register `PRESCALER` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PRESCALER` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Pre-scaler of PWM_CLK\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum PRESCALER_A { + #[doc = "0: Divide by 1 (16MHz)"] + DIV_1 = 0, + #[doc = "1: Divide by 2 ( 8MHz)"] + DIV_2 = 1, + #[doc = "2: Divide by 4 ( 4MHz)"] + DIV_4 = 2, + #[doc = "3: Divide by 8 ( 2MHz)"] + DIV_8 = 3, + #[doc = "4: Divide by 16 ( 1MHz)"] + DIV_16 = 4, + #[doc = "5: Divide by 32 ( 500kHz)"] + DIV_32 = 5, + #[doc = "6: Divide by 64 ( 250kHz)"] + DIV_64 = 6, + #[doc = "7: Divide by 128 ( 125kHz)"] + DIV_128 = 7, +} +impl From for u8 { + #[inline(always)] + fn from(variant: PRESCALER_A) -> Self { + variant as _ + } +} +#[doc = "Field `PRESCALER` reader - Pre-scaler of PWM_CLK"] +pub struct PRESCALER_R(crate::FieldReader); +impl PRESCALER_R { + pub(crate) fn new(bits: u8) -> Self { + PRESCALER_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PRESCALER_A { + match self.bits { + 0 => PRESCALER_A::DIV_1, + 1 => PRESCALER_A::DIV_2, + 2 => PRESCALER_A::DIV_4, + 3 => PRESCALER_A::DIV_8, + 4 => PRESCALER_A::DIV_16, + 5 => PRESCALER_A::DIV_32, + 6 => PRESCALER_A::DIV_64, + 7 => PRESCALER_A::DIV_128, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `DIV_1`"] + #[inline(always)] + pub fn is_div_1(&self) -> bool { + **self == PRESCALER_A::DIV_1 + } + #[doc = "Checks if the value of the field is `DIV_2`"] + #[inline(always)] + pub fn is_div_2(&self) -> bool { + **self == PRESCALER_A::DIV_2 + } + #[doc = "Checks if the value of the field is `DIV_4`"] + #[inline(always)] + pub fn is_div_4(&self) -> bool { + **self == PRESCALER_A::DIV_4 + } + #[doc = "Checks if the value of the field is `DIV_8`"] + #[inline(always)] + pub fn is_div_8(&self) -> bool { + **self == PRESCALER_A::DIV_8 + } + #[doc = "Checks if the value of the field is `DIV_16`"] + #[inline(always)] + pub fn is_div_16(&self) -> bool { + **self == PRESCALER_A::DIV_16 + } + #[doc = "Checks if the value of the field is `DIV_32`"] + #[inline(always)] + pub fn is_div_32(&self) -> bool { + **self == PRESCALER_A::DIV_32 + } + #[doc = "Checks if the value of the field is `DIV_64`"] + #[inline(always)] + pub fn is_div_64(&self) -> bool { + **self == PRESCALER_A::DIV_64 + } + #[doc = "Checks if the value of the field is `DIV_128`"] + #[inline(always)] + pub fn is_div_128(&self) -> bool { + **self == PRESCALER_A::DIV_128 + } +} +impl core::ops::Deref for PRESCALER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRESCALER` writer - Pre-scaler of PWM_CLK"] +pub struct PRESCALER_W<'a> { + w: &'a mut W, +} +impl<'a> PRESCALER_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PRESCALER_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "Divide by 1 (16MHz)"] + #[inline(always)] + pub fn div_1(self) -> &'a mut W { + self.variant(PRESCALER_A::DIV_1) + } + #[doc = "Divide by 2 ( 8MHz)"] + #[inline(always)] + pub fn div_2(self) -> &'a mut W { + self.variant(PRESCALER_A::DIV_2) + } + #[doc = "Divide by 4 ( 4MHz)"] + #[inline(always)] + pub fn div_4(self) -> &'a mut W { + self.variant(PRESCALER_A::DIV_4) + } + #[doc = "Divide by 8 ( 2MHz)"] + #[inline(always)] + pub fn div_8(self) -> &'a mut W { + self.variant(PRESCALER_A::DIV_8) + } + #[doc = "Divide by 16 ( 1MHz)"] + #[inline(always)] + pub fn div_16(self) -> &'a mut W { + self.variant(PRESCALER_A::DIV_16) + } + #[doc = "Divide by 32 ( 500kHz)"] + #[inline(always)] + pub fn div_32(self) -> &'a mut W { + self.variant(PRESCALER_A::DIV_32) + } + #[doc = "Divide by 64 ( 250kHz)"] + #[inline(always)] + pub fn div_64(self) -> &'a mut W { + self.variant(PRESCALER_A::DIV_64) + } + #[doc = "Divide by 128 ( 125kHz)"] + #[inline(always)] + pub fn div_128(self) -> &'a mut W { + self.variant(PRESCALER_A::DIV_128) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); + self.w + } +} +impl R { + #[doc = "Bits 0:2 - Pre-scaler of PWM_CLK"] + #[inline(always)] + pub fn prescaler(&self) -> PRESCALER_R { + PRESCALER_R::new((self.bits & 0x07) as u8) + } +} +impl W { + #[doc = "Bits 0:2 - Pre-scaler of PWM_CLK"] + #[inline(always)] + pub fn prescaler(&mut self) -> PRESCALER_W { + PRESCALER_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Configuration for PWM_CLK\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prescaler](index.html) module"] +pub struct PRESCALER_SPEC; +impl crate::RegisterSpec for PRESCALER_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [prescaler::R](R) reader structure"] +impl crate::Readable for PRESCALER_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [prescaler::W](W) writer structure"] +impl crate::Writable for PRESCALER_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PRESCALER to value 0"] +impl crate::Resettable for PRESCALER_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pwm0/psel.rs b/src/pwm0/psel.rs new file mode 100644 index 0000000..46b2cf1 --- /dev/null +++ b/src/pwm0/psel.rs @@ -0,0 +1,4 @@ +#[doc = "OUT register accessor: an alias for `Reg`"] +pub type OUT = crate::Reg; +#[doc = "Description collection\\[0\\]: Output pin select for PWM channel 0"] +pub mod out; diff --git a/src/pwm0/psel/out.rs b/src/pwm0/psel/out.rs new file mode 100644 index 0000000..fcacd37 --- /dev/null +++ b/src/pwm0/psel/out.rs @@ -0,0 +1,196 @@ +#[doc = "Register `OUT[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `OUT[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PIN` reader - Pin number"] +pub struct PIN_R(crate::FieldReader); +impl PIN_R { + pub(crate) fn new(bits: u8) -> Self { + PIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN` writer - Pin number"] +pub struct PIN_W<'a> { + w: &'a mut W, +} +impl<'a> PIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Connection\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CONNECT_A { + #[doc = "1: Disconnect"] + DISCONNECTED = 1, + #[doc = "0: Connect"] + CONNECTED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: CONNECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CONNECT` reader - Connection"] +pub struct CONNECT_R(crate::FieldReader); +impl CONNECT_R { + pub(crate) fn new(bits: bool) -> Self { + CONNECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CONNECT_A { + match self.bits { + true => CONNECT_A::DISCONNECTED, + false => CONNECT_A::CONNECTED, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == CONNECT_A::DISCONNECTED + } + #[doc = "Checks if the value of the field is `CONNECTED`"] + #[inline(always)] + pub fn is_connected(&self) -> bool { + **self == CONNECT_A::CONNECTED + } +} +impl core::ops::Deref for CONNECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONNECT` writer - Connection"] +pub struct CONNECT_W<'a> { + w: &'a mut W, +} +impl<'a> CONNECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CONNECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(CONNECT_A::DISCONNECTED) + } + #[doc = "Connect"] + #[inline(always)] + pub fn connected(self) -> &'a mut W { + self.variant(CONNECT_A::CONNECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&self) -> PIN_R { + PIN_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&self) -> CONNECT_R { + CONNECT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&mut self) -> PIN_W { + PIN_W { w: self } + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&mut self) -> CONNECT_W { + CONNECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description collection\\[0\\]: Output pin select for PWM channel 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [out](index.html) module"] +pub struct OUT_SPEC; +impl crate::RegisterSpec for OUT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [out::R](R) reader structure"] +impl crate::Readable for OUT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [out::W](W) writer structure"] +impl crate::Writable for OUT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets OUT[%s] +to value 0xffff_ffff"] +impl crate::Resettable for OUT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/pwm0/seq.rs b/src/pwm0/seq.rs new file mode 100644 index 0000000..deccac8 --- /dev/null +++ b/src/pwm0/seq.rs @@ -0,0 +1,16 @@ +#[doc = "PTR register accessor: an alias for `Reg`"] +pub type PTR = crate::Reg; +#[doc = "Description cluster\\[0\\]: Beginning address in Data RAM of this sequence"] +pub mod ptr; +#[doc = "CNT register accessor: an alias for `Reg`"] +pub type CNT = crate::Reg; +#[doc = "Description cluster\\[0\\]: Amount of values (duty cycles) in this sequence"] +pub mod cnt; +#[doc = "REFRESH register accessor: an alias for `Reg`"] +pub type REFRESH = crate::Reg; +#[doc = "Description cluster\\[0\\]: Amount of additional PWM periods between samples loaded into compare register"] +pub mod refresh; +#[doc = "ENDDELAY register accessor: an alias for `Reg`"] +pub type ENDDELAY = crate::Reg; +#[doc = "Description cluster\\[0\\]: Time added after the sequence"] +pub mod enddelay; diff --git a/src/pwm0/seq/cnt.rs b/src/pwm0/seq/cnt.rs new file mode 100644 index 0000000..757632d --- /dev/null +++ b/src/pwm0/seq/cnt.rs @@ -0,0 +1,138 @@ +#[doc = "Register `CNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CNT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Amount of values (duty cycles) in this sequence\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u16)] +pub enum CNT_A { + #[doc = "0: Sequence is disabled, and shall not be started as it is empty"] + DISABLED = 0, +} +impl From for u16 { + #[inline(always)] + fn from(variant: CNT_A) -> Self { + variant as _ + } +} +#[doc = "Field `CNT` reader - Amount of values (duty cycles) in this sequence"] +pub struct CNT_R(crate::FieldReader); +impl CNT_R { + pub(crate) fn new(bits: u16) -> Self { + CNT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(CNT_A::DISABLED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CNT_A::DISABLED + } +} +impl core::ops::Deref for CNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CNT` writer - Amount of values (duty cycles) in this sequence"] +pub struct CNT_W<'a> { + w: &'a mut W, +} +impl<'a> CNT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CNT_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Sequence is disabled, and shall not be started as it is empty"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CNT_A::DISABLED) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !0x7fff) | (value as u32 & 0x7fff); + self.w + } +} +impl R { + #[doc = "Bits 0:14 - Amount of values (duty cycles) in this sequence"] + #[inline(always)] + pub fn cnt(&self) -> CNT_R { + CNT_R::new((self.bits & 0x7fff) as u16) + } +} +impl W { + #[doc = "Bits 0:14 - Amount of values (duty cycles) in this sequence"] + #[inline(always)] + pub fn cnt(&mut self) -> CNT_W { + CNT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description cluster\\[0\\]: Amount of values (duty cycles) in this sequence\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cnt](index.html) module"] +pub struct CNT_SPEC; +impl crate::RegisterSpec for CNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cnt::R](R) reader structure"] +impl crate::Readable for CNT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [cnt::W](W) writer structure"] +impl crate::Writable for CNT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CNT to value 0"] +impl crate::Resettable for CNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pwm0/seq/enddelay.rs b/src/pwm0/seq/enddelay.rs new file mode 100644 index 0000000..35d0101 --- /dev/null +++ b/src/pwm0/seq/enddelay.rs @@ -0,0 +1,102 @@ +#[doc = "Register `ENDDELAY` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ENDDELAY` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CNT` reader - Time added after the sequence in PWM periods"] +pub struct CNT_R(crate::FieldReader); +impl CNT_R { + pub(crate) fn new(bits: u32) -> Self { + CNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CNT` writer - Time added after the sequence in PWM periods"] +pub struct CNT_W<'a> { + w: &'a mut W, +} +impl<'a> CNT_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0x00ff_ffff) | (value as u32 & 0x00ff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:23 - Time added after the sequence in PWM periods"] + #[inline(always)] + pub fn cnt(&self) -> CNT_R { + CNT_R::new((self.bits & 0x00ff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:23 - Time added after the sequence in PWM periods"] + #[inline(always)] + pub fn cnt(&mut self) -> CNT_W { + CNT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description cluster\\[0\\]: Time added after the sequence\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [enddelay](index.html) module"] +pub struct ENDDELAY_SPEC; +impl crate::RegisterSpec for ENDDELAY_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [enddelay::R](R) reader structure"] +impl crate::Readable for ENDDELAY_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [enddelay::W](W) writer structure"] +impl crate::Writable for ENDDELAY_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ENDDELAY to value 0"] +impl crate::Resettable for ENDDELAY_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pwm0/seq/ptr.rs b/src/pwm0/seq/ptr.rs new file mode 100644 index 0000000..0cf82f0 --- /dev/null +++ b/src/pwm0/seq/ptr.rs @@ -0,0 +1,102 @@ +#[doc = "Register `PTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PTR` reader - Beginning address in Data RAM of this sequence"] +pub struct PTR_R(crate::FieldReader); +impl PTR_R { + pub(crate) fn new(bits: u32) -> Self { + PTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PTR` writer - Beginning address in Data RAM of this sequence"] +pub struct PTR_W<'a> { + w: &'a mut W, +} +impl<'a> PTR_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Beginning address in Data RAM of this sequence"] + #[inline(always)] + pub fn ptr(&self) -> PTR_R { + PTR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Beginning address in Data RAM of this sequence"] + #[inline(always)] + pub fn ptr(&mut self) -> PTR_W { + PTR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description cluster\\[0\\]: Beginning address in Data RAM of this sequence\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ptr](index.html) module"] +pub struct PTR_SPEC; +impl crate::RegisterSpec for PTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ptr::R](R) reader structure"] +impl crate::Readable for PTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ptr::W](W) writer structure"] +impl crate::Writable for PTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PTR to value 0"] +impl crate::Resettable for PTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pwm0/seq/refresh.rs b/src/pwm0/seq/refresh.rs new file mode 100644 index 0000000..f847871 --- /dev/null +++ b/src/pwm0/seq/refresh.rs @@ -0,0 +1,138 @@ +#[doc = "Register `REFRESH` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `REFRESH` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Amount of additional PWM periods between samples loaded into compare register (load every REFRESH.CNT+1 PWM periods)\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u32)] +pub enum CNT_A { + #[doc = "0: Update every PWM period"] + CONTINUOUS = 0, +} +impl From for u32 { + #[inline(always)] + fn from(variant: CNT_A) -> Self { + variant as _ + } +} +#[doc = "Field `CNT` reader - Amount of additional PWM periods between samples loaded into compare register (load every REFRESH.CNT+1 PWM periods)"] +pub struct CNT_R(crate::FieldReader); +impl CNT_R { + pub(crate) fn new(bits: u32) -> Self { + CNT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(CNT_A::CONTINUOUS), + _ => None, + } + } + #[doc = "Checks if the value of the field is `CONTINUOUS`"] + #[inline(always)] + pub fn is_continuous(&self) -> bool { + **self == CNT_A::CONTINUOUS + } +} +impl core::ops::Deref for CNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CNT` writer - Amount of additional PWM periods between samples loaded into compare register (load every REFRESH.CNT+1 PWM periods)"] +pub struct CNT_W<'a> { + w: &'a mut W, +} +impl<'a> CNT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CNT_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Update every PWM period"] + #[inline(always)] + pub fn continuous(self) -> &'a mut W { + self.variant(CNT_A::CONTINUOUS) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0x00ff_ffff) | (value as u32 & 0x00ff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:23 - Amount of additional PWM periods between samples loaded into compare register (load every REFRESH.CNT+1 PWM periods)"] + #[inline(always)] + pub fn cnt(&self) -> CNT_R { + CNT_R::new((self.bits & 0x00ff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:23 - Amount of additional PWM periods between samples loaded into compare register (load every REFRESH.CNT+1 PWM periods)"] + #[inline(always)] + pub fn cnt(&mut self) -> CNT_W { + CNT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description cluster\\[0\\]: Amount of additional PWM periods between samples loaded into compare register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [refresh](index.html) module"] +pub struct REFRESH_SPEC; +impl crate::RegisterSpec for REFRESH_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [refresh::R](R) reader structure"] +impl crate::Readable for REFRESH_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [refresh::W](W) writer structure"] +impl crate::Writable for REFRESH_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets REFRESH to value 0x01"] +impl crate::Resettable for REFRESH_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x01 + } +} diff --git a/src/pwm0/shorts.rs b/src/pwm0/shorts.rs new file mode 100644 index 0000000..5720544 --- /dev/null +++ b/src/pwm0/shorts.rs @@ -0,0 +1,551 @@ +#[doc = "Register `SHORTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SHORTS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Shortcut between SEQEND\\[0\\] +event and STOP task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SEQEND0_STOP_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SEQEND0_STOP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SEQEND0_STOP` reader - Shortcut between SEQEND\\[0\\] +event and STOP task"] +pub struct SEQEND0_STOP_R(crate::FieldReader); +impl SEQEND0_STOP_R { + pub(crate) fn new(bits: bool) -> Self { + SEQEND0_STOP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SEQEND0_STOP_A { + match self.bits { + false => SEQEND0_STOP_A::DISABLED, + true => SEQEND0_STOP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SEQEND0_STOP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SEQEND0_STOP_A::ENABLED + } +} +impl core::ops::Deref for SEQEND0_STOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SEQEND0_STOP` writer - Shortcut between SEQEND\\[0\\] +event and STOP task"] +pub struct SEQEND0_STOP_W<'a> { + w: &'a mut W, +} +impl<'a> SEQEND0_STOP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SEQEND0_STOP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(SEQEND0_STOP_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(SEQEND0_STOP_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Shortcut between SEQEND\\[1\\] +event and STOP task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SEQEND1_STOP_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SEQEND1_STOP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SEQEND1_STOP` reader - Shortcut between SEQEND\\[1\\] +event and STOP task"] +pub struct SEQEND1_STOP_R(crate::FieldReader); +impl SEQEND1_STOP_R { + pub(crate) fn new(bits: bool) -> Self { + SEQEND1_STOP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SEQEND1_STOP_A { + match self.bits { + false => SEQEND1_STOP_A::DISABLED, + true => SEQEND1_STOP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SEQEND1_STOP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SEQEND1_STOP_A::ENABLED + } +} +impl core::ops::Deref for SEQEND1_STOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SEQEND1_STOP` writer - Shortcut between SEQEND\\[1\\] +event and STOP task"] +pub struct SEQEND1_STOP_W<'a> { + w: &'a mut W, +} +impl<'a> SEQEND1_STOP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SEQEND1_STOP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(SEQEND1_STOP_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(SEQEND1_STOP_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Shortcut between LOOPSDONE event and SEQSTART\\[0\\] +task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LOOPSDONE_SEQSTART0_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LOOPSDONE_SEQSTART0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LOOPSDONE_SEQSTART0` reader - Shortcut between LOOPSDONE event and SEQSTART\\[0\\] +task"] +pub struct LOOPSDONE_SEQSTART0_R(crate::FieldReader); +impl LOOPSDONE_SEQSTART0_R { + pub(crate) fn new(bits: bool) -> Self { + LOOPSDONE_SEQSTART0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> LOOPSDONE_SEQSTART0_A { + match self.bits { + false => LOOPSDONE_SEQSTART0_A::DISABLED, + true => LOOPSDONE_SEQSTART0_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == LOOPSDONE_SEQSTART0_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == LOOPSDONE_SEQSTART0_A::ENABLED + } +} +impl core::ops::Deref for LOOPSDONE_SEQSTART0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LOOPSDONE_SEQSTART0` writer - Shortcut between LOOPSDONE event and SEQSTART\\[0\\] +task"] +pub struct LOOPSDONE_SEQSTART0_W<'a> { + w: &'a mut W, +} +impl<'a> LOOPSDONE_SEQSTART0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LOOPSDONE_SEQSTART0_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(LOOPSDONE_SEQSTART0_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(LOOPSDONE_SEQSTART0_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Shortcut between LOOPSDONE event and SEQSTART\\[1\\] +task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LOOPSDONE_SEQSTART1_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LOOPSDONE_SEQSTART1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LOOPSDONE_SEQSTART1` reader - Shortcut between LOOPSDONE event and SEQSTART\\[1\\] +task"] +pub struct LOOPSDONE_SEQSTART1_R(crate::FieldReader); +impl LOOPSDONE_SEQSTART1_R { + pub(crate) fn new(bits: bool) -> Self { + LOOPSDONE_SEQSTART1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> LOOPSDONE_SEQSTART1_A { + match self.bits { + false => LOOPSDONE_SEQSTART1_A::DISABLED, + true => LOOPSDONE_SEQSTART1_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == LOOPSDONE_SEQSTART1_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == LOOPSDONE_SEQSTART1_A::ENABLED + } +} +impl core::ops::Deref for LOOPSDONE_SEQSTART1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LOOPSDONE_SEQSTART1` writer - Shortcut between LOOPSDONE event and SEQSTART\\[1\\] +task"] +pub struct LOOPSDONE_SEQSTART1_W<'a> { + w: &'a mut W, +} +impl<'a> LOOPSDONE_SEQSTART1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LOOPSDONE_SEQSTART1_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(LOOPSDONE_SEQSTART1_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(LOOPSDONE_SEQSTART1_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Shortcut between LOOPSDONE event and STOP task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LOOPSDONE_STOP_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LOOPSDONE_STOP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LOOPSDONE_STOP` reader - Shortcut between LOOPSDONE event and STOP task"] +pub struct LOOPSDONE_STOP_R(crate::FieldReader); +impl LOOPSDONE_STOP_R { + pub(crate) fn new(bits: bool) -> Self { + LOOPSDONE_STOP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> LOOPSDONE_STOP_A { + match self.bits { + false => LOOPSDONE_STOP_A::DISABLED, + true => LOOPSDONE_STOP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == LOOPSDONE_STOP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == LOOPSDONE_STOP_A::ENABLED + } +} +impl core::ops::Deref for LOOPSDONE_STOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LOOPSDONE_STOP` writer - Shortcut between LOOPSDONE event and STOP task"] +pub struct LOOPSDONE_STOP_W<'a> { + w: &'a mut W, +} +impl<'a> LOOPSDONE_STOP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LOOPSDONE_STOP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(LOOPSDONE_STOP_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(LOOPSDONE_STOP_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +impl R { + #[doc = "Bit 0 - Shortcut between SEQEND\\[0\\] +event and STOP task"] + #[inline(always)] + pub fn seqend0_stop(&self) -> SEQEND0_STOP_R { + SEQEND0_STOP_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Shortcut between SEQEND\\[1\\] +event and STOP task"] + #[inline(always)] + pub fn seqend1_stop(&self) -> SEQEND1_STOP_R { + SEQEND1_STOP_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Shortcut between LOOPSDONE event and SEQSTART\\[0\\] +task"] + #[inline(always)] + pub fn loopsdone_seqstart0(&self) -> LOOPSDONE_SEQSTART0_R { + LOOPSDONE_SEQSTART0_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Shortcut between LOOPSDONE event and SEQSTART\\[1\\] +task"] + #[inline(always)] + pub fn loopsdone_seqstart1(&self) -> LOOPSDONE_SEQSTART1_R { + LOOPSDONE_SEQSTART1_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Shortcut between LOOPSDONE event and STOP task"] + #[inline(always)] + pub fn loopsdone_stop(&self) -> LOOPSDONE_STOP_R { + LOOPSDONE_STOP_R::new(((self.bits >> 4) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Shortcut between SEQEND\\[0\\] +event and STOP task"] + #[inline(always)] + pub fn seqend0_stop(&mut self) -> SEQEND0_STOP_W { + SEQEND0_STOP_W { w: self } + } + #[doc = "Bit 1 - Shortcut between SEQEND\\[1\\] +event and STOP task"] + #[inline(always)] + pub fn seqend1_stop(&mut self) -> SEQEND1_STOP_W { + SEQEND1_STOP_W { w: self } + } + #[doc = "Bit 2 - Shortcut between LOOPSDONE event and SEQSTART\\[0\\] +task"] + #[inline(always)] + pub fn loopsdone_seqstart0(&mut self) -> LOOPSDONE_SEQSTART0_W { + LOOPSDONE_SEQSTART0_W { w: self } + } + #[doc = "Bit 3 - Shortcut between LOOPSDONE event and SEQSTART\\[1\\] +task"] + #[inline(always)] + pub fn loopsdone_seqstart1(&mut self) -> LOOPSDONE_SEQSTART1_W { + LOOPSDONE_SEQSTART1_W { w: self } + } + #[doc = "Bit 4 - Shortcut between LOOPSDONE event and STOP task"] + #[inline(always)] + pub fn loopsdone_stop(&mut self) -> LOOPSDONE_STOP_W { + LOOPSDONE_STOP_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Shortcut register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [shorts](index.html) module"] +pub struct SHORTS_SPEC; +impl crate::RegisterSpec for SHORTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [shorts::R](R) reader structure"] +impl crate::Readable for SHORTS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [shorts::W](W) writer structure"] +impl crate::Writable for SHORTS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SHORTS to value 0"] +impl crate::Resettable for SHORTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pwm0/tasks_nextstep.rs b/src/pwm0/tasks_nextstep.rs new file mode 100644 index 0000000..8c0c6a8 --- /dev/null +++ b/src/pwm0/tasks_nextstep.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_NEXTSTEP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Steps by one value in the current sequence on all enabled channels if DECODER.MODE=NextStep. Does not cause PWM generation to start it was not running.\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_nextstep](index.html) module"] +pub struct TASKS_NEXTSTEP_SPEC; +impl crate::RegisterSpec for TASKS_NEXTSTEP_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_nextstep::W](W) writer structure"] +impl crate::Writable for TASKS_NEXTSTEP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_NEXTSTEP to value 0"] +impl crate::Resettable for TASKS_NEXTSTEP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pwm0/tasks_seqstart.rs b/src/pwm0/tasks_seqstart.rs new file mode 100644 index 0000000..c8a5061 --- /dev/null +++ b/src/pwm0/tasks_seqstart.rs @@ -0,0 +1,46 @@ +#[doc = "Register `TASKS_SEQSTART[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description collection\\[0\\]: Loads the first PWM value on all enabled channels from sequence 0, and starts playing that sequence at the rate defined in SEQ\\[0\\]REFRESH and/or DECODER.MODE. Causes PWM generation to start it was not running.\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_seqstart](index.html) module"] +pub struct TASKS_SEQSTART_SPEC; +impl crate::RegisterSpec for TASKS_SEQSTART_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_seqstart::W](W) writer structure"] +impl crate::Writable for TASKS_SEQSTART_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_SEQSTART[%s] +to value 0"] +impl crate::Resettable for TASKS_SEQSTART_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/pwm0/tasks_stop.rs b/src/pwm0/tasks_stop.rs new file mode 100644 index 0000000..0223a9e --- /dev/null +++ b/src/pwm0/tasks_stop.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STOP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Stops PWM pulse generation on all channels at the end of current PWM period, and stops sequence playback\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_stop](index.html) module"] +pub struct TASKS_STOP_SPEC; +impl crate::RegisterSpec for TASKS_STOP_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_stop::W](W) writer structure"] +impl crate::Writable for TASKS_STOP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STOP to value 0"] +impl crate::Resettable for TASKS_STOP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/qdec.rs b/src/qdec.rs new file mode 100644 index 0000000..211dfdb --- /dev/null +++ b/src/qdec.rs @@ -0,0 +1,168 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "0x00 - Task starting the quadrature decoder"] + pub tasks_start: crate::Reg, + #[doc = "0x04 - Task stopping the quadrature decoder"] + pub tasks_stop: crate::Reg, + #[doc = "0x08 - Read and clear ACC and ACCDBL"] + pub tasks_readclracc: crate::Reg, + #[doc = "0x0c - Read and clear ACC"] + pub tasks_rdclracc: crate::Reg, + #[doc = "0x10 - Read and clear ACCDBL"] + pub tasks_rdclrdbl: crate::Reg, + _reserved5: [u8; 0xec], + #[doc = "0x100 - Event being generated for every new sample value written to the SAMPLE register"] + pub events_samplerdy: crate::Reg, + #[doc = "0x104 - Non-null report ready"] + pub events_reportrdy: crate::Reg, + #[doc = "0x108 - ACC or ACCDBL register overflow"] + pub events_accof: crate::Reg, + #[doc = "0x10c - Double displacement(s) detected"] + pub events_dblrdy: crate::Reg, + #[doc = "0x110 - QDEC has been stopped"] + pub events_stopped: crate::Reg, + _reserved10: [u8; 0xec], + #[doc = "0x200 - Shortcut register"] + pub shorts: crate::Reg, + _reserved11: [u8; 0x0100], + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved13: [u8; 0x01f4], + #[doc = "0x500 - Enable the quadrature decoder"] + pub enable: crate::Reg, + #[doc = "0x504 - LED output pin polarity"] + pub ledpol: crate::Reg, + #[doc = "0x508 - Sample period"] + pub sampleper: crate::Reg, + #[doc = "0x50c - Motion sample value"] + pub sample: crate::Reg, + #[doc = "0x510 - Number of samples to be taken before REPORTRDY and DBLRDY events can be generated"] + pub reportper: crate::Reg, + #[doc = "0x514 - Register accumulating the valid transitions"] + pub acc: crate::Reg, + #[doc = "0x518 - Snapshot of the ACC register, updated by the READCLRACC or RDCLRACC task"] + pub accread: crate::Reg, + #[doc = "0x51c..0x528 - Unspecified"] + pub psel: PSEL, + #[doc = "0x528 - Enable input debounce filters"] + pub dbfen: crate::Reg, + _reserved22: [u8; 0x14], + #[doc = "0x540 - Time period the LED is switched ON prior to sampling"] + pub ledpre: crate::Reg, + #[doc = "0x544 - Register accumulating the number of detected double transitions"] + pub accdbl: crate::Reg, + #[doc = "0x548 - Snapshot of the ACCDBL, updated by the READCLRACC or RDCLRDBL task"] + pub accdblread: crate::Reg, +} +#[doc = r"Register block"] +#[repr(C)] +pub struct PSEL { + #[doc = "0x00 - Pin select for LED signal"] + pub led: crate::Reg, + #[doc = "0x04 - Pin select for A signal"] + pub a: crate::Reg, + #[doc = "0x08 - Pin select for B signal"] + pub b: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod psel; +#[doc = "TASKS_START register accessor: an alias for `Reg`"] +pub type TASKS_START = crate::Reg; +#[doc = "Task starting the quadrature decoder"] +pub mod tasks_start; +#[doc = "TASKS_STOP register accessor: an alias for `Reg`"] +pub type TASKS_STOP = crate::Reg; +#[doc = "Task stopping the quadrature decoder"] +pub mod tasks_stop; +#[doc = "TASKS_READCLRACC register accessor: an alias for `Reg`"] +pub type TASKS_READCLRACC = crate::Reg; +#[doc = "Read and clear ACC and ACCDBL"] +pub mod tasks_readclracc; +#[doc = "TASKS_RDCLRACC register accessor: an alias for `Reg`"] +pub type TASKS_RDCLRACC = crate::Reg; +#[doc = "Read and clear ACC"] +pub mod tasks_rdclracc; +#[doc = "TASKS_RDCLRDBL register accessor: an alias for `Reg`"] +pub type TASKS_RDCLRDBL = crate::Reg; +#[doc = "Read and clear ACCDBL"] +pub mod tasks_rdclrdbl; +#[doc = "EVENTS_SAMPLERDY register accessor: an alias for `Reg`"] +pub type EVENTS_SAMPLERDY = crate::Reg; +#[doc = "Event being generated for every new sample value written to the SAMPLE register"] +pub mod events_samplerdy; +#[doc = "EVENTS_REPORTRDY register accessor: an alias for `Reg`"] +pub type EVENTS_REPORTRDY = crate::Reg; +#[doc = "Non-null report ready"] +pub mod events_reportrdy; +#[doc = "EVENTS_ACCOF register accessor: an alias for `Reg`"] +pub type EVENTS_ACCOF = crate::Reg; +#[doc = "ACC or ACCDBL register overflow"] +pub mod events_accof; +#[doc = "EVENTS_DBLRDY register accessor: an alias for `Reg`"] +pub type EVENTS_DBLRDY = crate::Reg; +#[doc = "Double displacement(s) detected"] +pub mod events_dblrdy; +#[doc = "EVENTS_STOPPED register accessor: an alias for `Reg`"] +pub type EVENTS_STOPPED = crate::Reg; +#[doc = "QDEC has been stopped"] +pub mod events_stopped; +#[doc = "SHORTS register accessor: an alias for `Reg`"] +pub type SHORTS = crate::Reg; +#[doc = "Shortcut register"] +pub mod shorts; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "ENABLE register accessor: an alias for `Reg`"] +pub type ENABLE = crate::Reg; +#[doc = "Enable the quadrature decoder"] +pub mod enable; +#[doc = "LEDPOL register accessor: an alias for `Reg`"] +pub type LEDPOL = crate::Reg; +#[doc = "LED output pin polarity"] +pub mod ledpol; +#[doc = "SAMPLEPER register accessor: an alias for `Reg`"] +pub type SAMPLEPER = crate::Reg; +#[doc = "Sample period"] +pub mod sampleper; +#[doc = "SAMPLE register accessor: an alias for `Reg`"] +pub type SAMPLE = crate::Reg; +#[doc = "Motion sample value"] +pub mod sample; +#[doc = "REPORTPER register accessor: an alias for `Reg`"] +pub type REPORTPER = crate::Reg; +#[doc = "Number of samples to be taken before REPORTRDY and DBLRDY events can be generated"] +pub mod reportper; +#[doc = "ACC register accessor: an alias for `Reg`"] +pub type ACC = crate::Reg; +#[doc = "Register accumulating the valid transitions"] +pub mod acc; +#[doc = "ACCREAD register accessor: an alias for `Reg`"] +pub type ACCREAD = crate::Reg; +#[doc = "Snapshot of the ACC register, updated by the READCLRACC or RDCLRACC task"] +pub mod accread; +#[doc = "DBFEN register accessor: an alias for `Reg`"] +pub type DBFEN = crate::Reg; +#[doc = "Enable input debounce filters"] +pub mod dbfen; +#[doc = "LEDPRE register accessor: an alias for `Reg`"] +pub type LEDPRE = crate::Reg; +#[doc = "Time period the LED is switched ON prior to sampling"] +pub mod ledpre; +#[doc = "ACCDBL register accessor: an alias for `Reg`"] +pub type ACCDBL = crate::Reg; +#[doc = "Register accumulating the number of detected double transitions"] +pub mod accdbl; +#[doc = "ACCDBLREAD register accessor: an alias for `Reg`"] +pub type ACCDBLREAD = crate::Reg; +#[doc = "Snapshot of the ACCDBL, updated by the READCLRACC or RDCLRDBL task"] +pub mod accdblread; diff --git a/src/qdec/acc.rs b/src/qdec/acc.rs new file mode 100644 index 0000000..ede0e76 --- /dev/null +++ b/src/qdec/acc.rs @@ -0,0 +1,52 @@ +#[doc = "Register `ACC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `ACC` reader - Register accumulating all valid samples (not double transition) read from the SAMPLE register"] +pub struct ACC_R(crate::FieldReader); +impl ACC_R { + pub(crate) fn new(bits: u32) -> Self { + ACC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ACC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:31 - Register accumulating all valid samples (not double transition) read from the SAMPLE register"] + #[inline(always)] + pub fn acc(&self) -> ACC_R { + ACC_R::new((self.bits & 0xffff_ffff) as u32) + } +} +#[doc = "Register accumulating the valid transitions\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 [acc](index.html) module"] +pub struct ACC_SPEC; +impl crate::RegisterSpec for ACC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [acc::R](R) reader structure"] +impl crate::Readable for ACC_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets ACC to value 0"] +impl crate::Resettable for ACC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/qdec/accdbl.rs b/src/qdec/accdbl.rs new file mode 100644 index 0000000..a426c13 --- /dev/null +++ b/src/qdec/accdbl.rs @@ -0,0 +1,52 @@ +#[doc = "Register `ACCDBL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `ACCDBL` reader - Register accumulating the number of detected double or illegal transitions. ( SAMPLE = 2 )."] +pub struct ACCDBL_R(crate::FieldReader); +impl ACCDBL_R { + pub(crate) fn new(bits: u8) -> Self { + ACCDBL_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ACCDBL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:3 - Register accumulating the number of detected double or illegal transitions. ( SAMPLE = 2 )."] + #[inline(always)] + pub fn accdbl(&self) -> ACCDBL_R { + ACCDBL_R::new((self.bits & 0x0f) as u8) + } +} +#[doc = "Register accumulating the number of detected double transitions\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 [accdbl](index.html) module"] +pub struct ACCDBL_SPEC; +impl crate::RegisterSpec for ACCDBL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [accdbl::R](R) reader structure"] +impl crate::Readable for ACCDBL_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets ACCDBL to value 0"] +impl crate::Resettable for ACCDBL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/qdec/accdblread.rs b/src/qdec/accdblread.rs new file mode 100644 index 0000000..3d3dfbd --- /dev/null +++ b/src/qdec/accdblread.rs @@ -0,0 +1,52 @@ +#[doc = "Register `ACCDBLREAD` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `ACCDBLREAD` reader - Snapshot of the ACCDBL register. This field is updated when the READCLRACC or RDCLRDBL task is triggered."] +pub struct ACCDBLREAD_R(crate::FieldReader); +impl ACCDBLREAD_R { + pub(crate) fn new(bits: u8) -> Self { + ACCDBLREAD_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ACCDBLREAD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:3 - Snapshot of the ACCDBL register. This field is updated when the READCLRACC or RDCLRDBL task is triggered."] + #[inline(always)] + pub fn accdblread(&self) -> ACCDBLREAD_R { + ACCDBLREAD_R::new((self.bits & 0x0f) as u8) + } +} +#[doc = "Snapshot of the ACCDBL, updated by the READCLRACC or RDCLRDBL task\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 [accdblread](index.html) module"] +pub struct ACCDBLREAD_SPEC; +impl crate::RegisterSpec for ACCDBLREAD_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [accdblread::R](R) reader structure"] +impl crate::Readable for ACCDBLREAD_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets ACCDBLREAD to value 0"] +impl crate::Resettable for ACCDBLREAD_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/qdec/accread.rs b/src/qdec/accread.rs new file mode 100644 index 0000000..1f45b06 --- /dev/null +++ b/src/qdec/accread.rs @@ -0,0 +1,52 @@ +#[doc = "Register `ACCREAD` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `ACCREAD` reader - Snapshot of the ACC register."] +pub struct ACCREAD_R(crate::FieldReader); +impl ACCREAD_R { + pub(crate) fn new(bits: u32) -> Self { + ACCREAD_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ACCREAD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:31 - Snapshot of the ACC register."] + #[inline(always)] + pub fn accread(&self) -> ACCREAD_R { + ACCREAD_R::new((self.bits & 0xffff_ffff) as u32) + } +} +#[doc = "Snapshot of the ACC register, updated by the READCLRACC or RDCLRACC task\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 [accread](index.html) module"] +pub struct ACCREAD_SPEC; +impl crate::RegisterSpec for ACCREAD_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [accread::R](R) reader structure"] +impl crate::Readable for ACCREAD_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets ACCREAD to value 0"] +impl crate::Resettable for ACCREAD_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/qdec/dbfen.rs b/src/qdec/dbfen.rs new file mode 100644 index 0000000..04c0c8c --- /dev/null +++ b/src/qdec/dbfen.rs @@ -0,0 +1,159 @@ +#[doc = "Register `DBFEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DBFEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable input debounce filters\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DBFEN_A { + #[doc = "0: Debounce input filters disabled"] + DISABLED = 0, + #[doc = "1: Debounce input filters enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DBFEN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DBFEN` reader - Enable input debounce filters"] +pub struct DBFEN_R(crate::FieldReader); +impl DBFEN_R { + pub(crate) fn new(bits: bool) -> Self { + DBFEN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DBFEN_A { + match self.bits { + false => DBFEN_A::DISABLED, + true => DBFEN_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DBFEN_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DBFEN_A::ENABLED + } +} +impl core::ops::Deref for DBFEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DBFEN` writer - Enable input debounce filters"] +pub struct DBFEN_W<'a> { + w: &'a mut W, +} +impl<'a> DBFEN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DBFEN_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Debounce input filters disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(DBFEN_A::DISABLED) + } + #[doc = "Debounce input filters enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(DBFEN_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable input debounce filters"] + #[inline(always)] + pub fn dbfen(&self) -> DBFEN_R { + DBFEN_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Enable input debounce filters"] + #[inline(always)] + pub fn dbfen(&mut self) -> DBFEN_W { + DBFEN_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable input debounce filters\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dbfen](index.html) module"] +pub struct DBFEN_SPEC; +impl crate::RegisterSpec for DBFEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dbfen::R](R) reader structure"] +impl crate::Readable for DBFEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dbfen::W](W) writer structure"] +impl crate::Writable for DBFEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DBFEN to value 0"] +impl crate::Resettable for DBFEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/qdec/enable.rs b/src/qdec/enable.rs new file mode 100644 index 0000000..9c93641 --- /dev/null +++ b/src/qdec/enable.rs @@ -0,0 +1,159 @@ +#[doc = "Register `ENABLE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ENABLE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable the quadrature decoder\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENABLE_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENABLE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENABLE` reader - Enable or disable the quadrature decoder"] +pub struct ENABLE_R(crate::FieldReader); +impl ENABLE_R { + pub(crate) fn new(bits: bool) -> Self { + ENABLE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENABLE_A { + match self.bits { + false => ENABLE_A::DISABLED, + true => ENABLE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENABLE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENABLE_A::ENABLED + } +} +impl core::ops::Deref for ENABLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENABLE` writer - Enable or disable the quadrature decoder"] +pub struct ENABLE_W<'a> { + w: &'a mut W, +} +impl<'a> ENABLE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENABLE_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENABLE_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENABLE_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable or disable the quadrature decoder"] + #[inline(always)] + pub fn enable(&self) -> ENABLE_R { + ENABLE_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Enable or disable the quadrature decoder"] + #[inline(always)] + pub fn enable(&mut self) -> ENABLE_W { + ENABLE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable the quadrature decoder\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [enable](index.html) module"] +pub struct ENABLE_SPEC; +impl crate::RegisterSpec for ENABLE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [enable::R](R) reader structure"] +impl crate::Readable for ENABLE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [enable::W](W) writer structure"] +impl crate::Writable for ENABLE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ENABLE to value 0"] +impl crate::Resettable for ENABLE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/qdec/events_accof.rs b/src/qdec/events_accof.rs new file mode 100644 index 0000000..e9ab1a4 --- /dev/null +++ b/src/qdec/events_accof.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_ACCOF` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_ACCOF` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "ACC or ACCDBL register overflow\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_accof](index.html) module"] +pub struct EVENTS_ACCOF_SPEC; +impl crate::RegisterSpec for EVENTS_ACCOF_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_accof::R](R) reader structure"] +impl crate::Readable for EVENTS_ACCOF_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_accof::W](W) writer structure"] +impl crate::Writable for EVENTS_ACCOF_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_ACCOF to value 0"] +impl crate::Resettable for EVENTS_ACCOF_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/qdec/events_dblrdy.rs b/src/qdec/events_dblrdy.rs new file mode 100644 index 0000000..beea7d4 --- /dev/null +++ b/src/qdec/events_dblrdy.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_DBLRDY` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_DBLRDY` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Double displacement(s) detected\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_dblrdy](index.html) module"] +pub struct EVENTS_DBLRDY_SPEC; +impl crate::RegisterSpec for EVENTS_DBLRDY_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_dblrdy::R](R) reader structure"] +impl crate::Readable for EVENTS_DBLRDY_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_dblrdy::W](W) writer structure"] +impl crate::Writable for EVENTS_DBLRDY_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_DBLRDY to value 0"] +impl crate::Resettable for EVENTS_DBLRDY_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/qdec/events_reportrdy.rs b/src/qdec/events_reportrdy.rs new file mode 100644 index 0000000..cf0593b --- /dev/null +++ b/src/qdec/events_reportrdy.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_REPORTRDY` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_REPORTRDY` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Non-null report ready\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_reportrdy](index.html) module"] +pub struct EVENTS_REPORTRDY_SPEC; +impl crate::RegisterSpec for EVENTS_REPORTRDY_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_reportrdy::R](R) reader structure"] +impl crate::Readable for EVENTS_REPORTRDY_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_reportrdy::W](W) writer structure"] +impl crate::Writable for EVENTS_REPORTRDY_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_REPORTRDY to value 0"] +impl crate::Resettable for EVENTS_REPORTRDY_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/qdec/events_samplerdy.rs b/src/qdec/events_samplerdy.rs new file mode 100644 index 0000000..bcf7aeb --- /dev/null +++ b/src/qdec/events_samplerdy.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_SAMPLERDY` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_SAMPLERDY` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Event being generated for every new sample value written to the SAMPLE register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_samplerdy](index.html) module"] +pub struct EVENTS_SAMPLERDY_SPEC; +impl crate::RegisterSpec for EVENTS_SAMPLERDY_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_samplerdy::R](R) reader structure"] +impl crate::Readable for EVENTS_SAMPLERDY_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_samplerdy::W](W) writer structure"] +impl crate::Writable for EVENTS_SAMPLERDY_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_SAMPLERDY to value 0"] +impl crate::Resettable for EVENTS_SAMPLERDY_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/qdec/events_stopped.rs b/src/qdec/events_stopped.rs new file mode 100644 index 0000000..a5c602b --- /dev/null +++ b/src/qdec/events_stopped.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_STOPPED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_STOPPED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "QDEC has been stopped\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_stopped](index.html) module"] +pub struct EVENTS_STOPPED_SPEC; +impl crate::RegisterSpec for EVENTS_STOPPED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_stopped::R](R) reader structure"] +impl crate::Readable for EVENTS_STOPPED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_stopped::W](W) writer structure"] +impl crate::Writable for EVENTS_STOPPED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_STOPPED to value 0"] +impl crate::Resettable for EVENTS_STOPPED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/qdec/intenclr.rs b/src/qdec/intenclr.rs new file mode 100644 index 0000000..35e145a --- /dev/null +++ b/src/qdec/intenclr.rs @@ -0,0 +1,566 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for SAMPLERDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SAMPLERDY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SAMPLERDY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SAMPLERDY` reader - Write '1' to Disable interrupt for SAMPLERDY event"] +pub struct SAMPLERDY_R(crate::FieldReader); +impl SAMPLERDY_R { + pub(crate) fn new(bits: bool) -> Self { + SAMPLERDY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SAMPLERDY_A { + match self.bits { + false => SAMPLERDY_A::DISABLED, + true => SAMPLERDY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SAMPLERDY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SAMPLERDY_A::ENABLED + } +} +impl core::ops::Deref for SAMPLERDY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for SAMPLERDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SAMPLERDY_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SAMPLERDY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SAMPLERDY` writer - Write '1' to Disable interrupt for SAMPLERDY event"] +pub struct SAMPLERDY_W<'a> { + w: &'a mut W, +} +impl<'a> SAMPLERDY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SAMPLERDY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(SAMPLERDY_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for REPORTRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REPORTRDY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REPORTRDY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REPORTRDY` reader - Write '1' to Disable interrupt for REPORTRDY event"] +pub struct REPORTRDY_R(crate::FieldReader); +impl REPORTRDY_R { + pub(crate) fn new(bits: bool) -> Self { + REPORTRDY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REPORTRDY_A { + match self.bits { + false => REPORTRDY_A::DISABLED, + true => REPORTRDY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REPORTRDY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REPORTRDY_A::ENABLED + } +} +impl core::ops::Deref for REPORTRDY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for REPORTRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REPORTRDY_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REPORTRDY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REPORTRDY` writer - Write '1' to Disable interrupt for REPORTRDY event"] +pub struct REPORTRDY_W<'a> { + w: &'a mut W, +} +impl<'a> REPORTRDY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REPORTRDY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(REPORTRDY_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for ACCOF event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ACCOF_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ACCOF_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ACCOF` reader - Write '1' to Disable interrupt for ACCOF event"] +pub struct ACCOF_R(crate::FieldReader); +impl ACCOF_R { + pub(crate) fn new(bits: bool) -> Self { + ACCOF_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ACCOF_A { + match self.bits { + false => ACCOF_A::DISABLED, + true => ACCOF_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ACCOF_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ACCOF_A::ENABLED + } +} +impl core::ops::Deref for ACCOF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for ACCOF event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ACCOF_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ACCOF_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ACCOF` writer - Write '1' to Disable interrupt for ACCOF event"] +pub struct ACCOF_W<'a> { + w: &'a mut W, +} +impl<'a> ACCOF_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ACCOF_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(ACCOF_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for DBLRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DBLRDY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DBLRDY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DBLRDY` reader - Write '1' to Disable interrupt for DBLRDY event"] +pub struct DBLRDY_R(crate::FieldReader); +impl DBLRDY_R { + pub(crate) fn new(bits: bool) -> Self { + DBLRDY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DBLRDY_A { + match self.bits { + false => DBLRDY_A::DISABLED, + true => DBLRDY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DBLRDY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DBLRDY_A::ENABLED + } +} +impl core::ops::Deref for DBLRDY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for DBLRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DBLRDY_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DBLRDY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DBLRDY` writer - Write '1' to Disable interrupt for DBLRDY event"] +pub struct DBLRDY_W<'a> { + w: &'a mut W, +} +impl<'a> DBLRDY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DBLRDY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(DBLRDY_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` reader - Write '1' to Disable interrupt for STOPPED event"] +pub struct STOPPED_R(crate::FieldReader); +impl STOPPED_R { + pub(crate) fn new(bits: bool) -> Self { + STOPPED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STOPPED_A { + match self.bits { + false => STOPPED_A::DISABLED, + true => STOPPED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STOPPED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STOPPED_A::ENABLED + } +} +impl core::ops::Deref for STOPPED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` writer - Write '1' to Disable interrupt for STOPPED event"] +pub struct STOPPED_W<'a> { + w: &'a mut W, +} +impl<'a> STOPPED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STOPPED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(STOPPED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Disable interrupt for SAMPLERDY event"] + #[inline(always)] + pub fn samplerdy(&self) -> SAMPLERDY_R { + SAMPLERDY_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for REPORTRDY event"] + #[inline(always)] + pub fn reportrdy(&self) -> REPORTRDY_R { + REPORTRDY_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for ACCOF event"] + #[inline(always)] + pub fn accof(&self) -> ACCOF_R { + ACCOF_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Write '1' to Disable interrupt for DBLRDY event"] + #[inline(always)] + pub fn dblrdy(&self) -> DBLRDY_R { + DBLRDY_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Write '1' to Disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&self) -> STOPPED_R { + STOPPED_R::new(((self.bits >> 4) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Disable interrupt for SAMPLERDY event"] + #[inline(always)] + pub fn samplerdy(&mut self) -> SAMPLERDY_W { + SAMPLERDY_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for REPORTRDY event"] + #[inline(always)] + pub fn reportrdy(&mut self) -> REPORTRDY_W { + REPORTRDY_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for ACCOF event"] + #[inline(always)] + pub fn accof(&mut self) -> ACCOF_W { + ACCOF_W { w: self } + } + #[doc = "Bit 3 - Write '1' to Disable interrupt for DBLRDY event"] + #[inline(always)] + pub fn dblrdy(&mut self) -> DBLRDY_W { + DBLRDY_W { w: self } + } + #[doc = "Bit 4 - Write '1' to Disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&mut self) -> STOPPED_W { + STOPPED_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/qdec/intenset.rs b/src/qdec/intenset.rs new file mode 100644 index 0000000..0b13751 --- /dev/null +++ b/src/qdec/intenset.rs @@ -0,0 +1,566 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for SAMPLERDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SAMPLERDY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SAMPLERDY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SAMPLERDY` reader - Write '1' to Enable interrupt for SAMPLERDY event"] +pub struct SAMPLERDY_R(crate::FieldReader); +impl SAMPLERDY_R { + pub(crate) fn new(bits: bool) -> Self { + SAMPLERDY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SAMPLERDY_A { + match self.bits { + false => SAMPLERDY_A::DISABLED, + true => SAMPLERDY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SAMPLERDY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SAMPLERDY_A::ENABLED + } +} +impl core::ops::Deref for SAMPLERDY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for SAMPLERDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SAMPLERDY_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SAMPLERDY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SAMPLERDY` writer - Write '1' to Enable interrupt for SAMPLERDY event"] +pub struct SAMPLERDY_W<'a> { + w: &'a mut W, +} +impl<'a> SAMPLERDY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SAMPLERDY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(SAMPLERDY_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for REPORTRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REPORTRDY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REPORTRDY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REPORTRDY` reader - Write '1' to Enable interrupt for REPORTRDY event"] +pub struct REPORTRDY_R(crate::FieldReader); +impl REPORTRDY_R { + pub(crate) fn new(bits: bool) -> Self { + REPORTRDY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REPORTRDY_A { + match self.bits { + false => REPORTRDY_A::DISABLED, + true => REPORTRDY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REPORTRDY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REPORTRDY_A::ENABLED + } +} +impl core::ops::Deref for REPORTRDY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for REPORTRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REPORTRDY_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REPORTRDY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REPORTRDY` writer - Write '1' to Enable interrupt for REPORTRDY event"] +pub struct REPORTRDY_W<'a> { + w: &'a mut W, +} +impl<'a> REPORTRDY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REPORTRDY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(REPORTRDY_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for ACCOF event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ACCOF_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ACCOF_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ACCOF` reader - Write '1' to Enable interrupt for ACCOF event"] +pub struct ACCOF_R(crate::FieldReader); +impl ACCOF_R { + pub(crate) fn new(bits: bool) -> Self { + ACCOF_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ACCOF_A { + match self.bits { + false => ACCOF_A::DISABLED, + true => ACCOF_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ACCOF_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ACCOF_A::ENABLED + } +} +impl core::ops::Deref for ACCOF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for ACCOF event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ACCOF_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ACCOF_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ACCOF` writer - Write '1' to Enable interrupt for ACCOF event"] +pub struct ACCOF_W<'a> { + w: &'a mut W, +} +impl<'a> ACCOF_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ACCOF_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(ACCOF_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for DBLRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DBLRDY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DBLRDY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DBLRDY` reader - Write '1' to Enable interrupt for DBLRDY event"] +pub struct DBLRDY_R(crate::FieldReader); +impl DBLRDY_R { + pub(crate) fn new(bits: bool) -> Self { + DBLRDY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DBLRDY_A { + match self.bits { + false => DBLRDY_A::DISABLED, + true => DBLRDY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DBLRDY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DBLRDY_A::ENABLED + } +} +impl core::ops::Deref for DBLRDY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for DBLRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DBLRDY_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DBLRDY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DBLRDY` writer - Write '1' to Enable interrupt for DBLRDY event"] +pub struct DBLRDY_W<'a> { + w: &'a mut W, +} +impl<'a> DBLRDY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DBLRDY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(DBLRDY_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` reader - Write '1' to Enable interrupt for STOPPED event"] +pub struct STOPPED_R(crate::FieldReader); +impl STOPPED_R { + pub(crate) fn new(bits: bool) -> Self { + STOPPED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STOPPED_A { + match self.bits { + false => STOPPED_A::DISABLED, + true => STOPPED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STOPPED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STOPPED_A::ENABLED + } +} +impl core::ops::Deref for STOPPED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` writer - Write '1' to Enable interrupt for STOPPED event"] +pub struct STOPPED_W<'a> { + w: &'a mut W, +} +impl<'a> STOPPED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STOPPED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(STOPPED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Enable interrupt for SAMPLERDY event"] + #[inline(always)] + pub fn samplerdy(&self) -> SAMPLERDY_R { + SAMPLERDY_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for REPORTRDY event"] + #[inline(always)] + pub fn reportrdy(&self) -> REPORTRDY_R { + REPORTRDY_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for ACCOF event"] + #[inline(always)] + pub fn accof(&self) -> ACCOF_R { + ACCOF_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Write '1' to Enable interrupt for DBLRDY event"] + #[inline(always)] + pub fn dblrdy(&self) -> DBLRDY_R { + DBLRDY_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Write '1' to Enable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&self) -> STOPPED_R { + STOPPED_R::new(((self.bits >> 4) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Enable interrupt for SAMPLERDY event"] + #[inline(always)] + pub fn samplerdy(&mut self) -> SAMPLERDY_W { + SAMPLERDY_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for REPORTRDY event"] + #[inline(always)] + pub fn reportrdy(&mut self) -> REPORTRDY_W { + REPORTRDY_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for ACCOF event"] + #[inline(always)] + pub fn accof(&mut self) -> ACCOF_W { + ACCOF_W { w: self } + } + #[doc = "Bit 3 - Write '1' to Enable interrupt for DBLRDY event"] + #[inline(always)] + pub fn dblrdy(&mut self) -> DBLRDY_W { + DBLRDY_W { w: self } + } + #[doc = "Bit 4 - Write '1' to Enable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&mut self) -> STOPPED_W { + STOPPED_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/qdec/ledpol.rs b/src/qdec/ledpol.rs new file mode 100644 index 0000000..ea8c086 --- /dev/null +++ b/src/qdec/ledpol.rs @@ -0,0 +1,159 @@ +#[doc = "Register `LEDPOL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `LEDPOL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "LED output pin polarity\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LEDPOL_A { + #[doc = "0: Led active on output pin low"] + ACTIVELOW = 0, + #[doc = "1: Led active on output pin high"] + ACTIVEHIGH = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LEDPOL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LEDPOL` reader - LED output pin polarity"] +pub struct LEDPOL_R(crate::FieldReader); +impl LEDPOL_R { + pub(crate) fn new(bits: bool) -> Self { + LEDPOL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> LEDPOL_A { + match self.bits { + false => LEDPOL_A::ACTIVELOW, + true => LEDPOL_A::ACTIVEHIGH, + } + } + #[doc = "Checks if the value of the field is `ACTIVELOW`"] + #[inline(always)] + pub fn is_active_low(&self) -> bool { + **self == LEDPOL_A::ACTIVELOW + } + #[doc = "Checks if the value of the field is `ACTIVEHIGH`"] + #[inline(always)] + pub fn is_active_high(&self) -> bool { + **self == LEDPOL_A::ACTIVEHIGH + } +} +impl core::ops::Deref for LEDPOL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LEDPOL` writer - LED output pin polarity"] +pub struct LEDPOL_W<'a> { + w: &'a mut W, +} +impl<'a> LEDPOL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LEDPOL_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Led active on output pin low"] + #[inline(always)] + pub fn active_low(self) -> &'a mut W { + self.variant(LEDPOL_A::ACTIVELOW) + } + #[doc = "Led active on output pin high"] + #[inline(always)] + pub fn active_high(self) -> &'a mut W { + self.variant(LEDPOL_A::ACTIVEHIGH) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - LED output pin polarity"] + #[inline(always)] + pub fn ledpol(&self) -> LEDPOL_R { + LEDPOL_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - LED output pin polarity"] + #[inline(always)] + pub fn ledpol(&mut self) -> LEDPOL_W { + LEDPOL_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "LED output pin polarity\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ledpol](index.html) module"] +pub struct LEDPOL_SPEC; +impl crate::RegisterSpec for LEDPOL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ledpol::R](R) reader structure"] +impl crate::Readable for LEDPOL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ledpol::W](W) writer structure"] +impl crate::Writable for LEDPOL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LEDPOL to value 0"] +impl crate::Resettable for LEDPOL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/qdec/ledpre.rs b/src/qdec/ledpre.rs new file mode 100644 index 0000000..75d0fcf --- /dev/null +++ b/src/qdec/ledpre.rs @@ -0,0 +1,102 @@ +#[doc = "Register `LEDPRE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `LEDPRE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `LEDPRE` reader - Period in us the LED is switched on prior to sampling"] +pub struct LEDPRE_R(crate::FieldReader); +impl LEDPRE_R { + pub(crate) fn new(bits: u16) -> Self { + LEDPRE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LEDPRE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LEDPRE` writer - Period in us the LED is switched on prior to sampling"] +pub struct LEDPRE_W<'a> { + w: &'a mut W, +} +impl<'a> LEDPRE_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01ff) | (value as u32 & 0x01ff); + self.w + } +} +impl R { + #[doc = "Bits 0:8 - Period in us the LED is switched on prior to sampling"] + #[inline(always)] + pub fn ledpre(&self) -> LEDPRE_R { + LEDPRE_R::new((self.bits & 0x01ff) as u16) + } +} +impl W { + #[doc = "Bits 0:8 - Period in us the LED is switched on prior to sampling"] + #[inline(always)] + pub fn ledpre(&mut self) -> LEDPRE_W { + LEDPRE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Time period the LED is switched ON prior to sampling\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ledpre](index.html) module"] +pub struct LEDPRE_SPEC; +impl crate::RegisterSpec for LEDPRE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ledpre::R](R) reader structure"] +impl crate::Readable for LEDPRE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ledpre::W](W) writer structure"] +impl crate::Writable for LEDPRE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LEDPRE to value 0x10"] +impl crate::Resettable for LEDPRE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x10 + } +} diff --git a/src/qdec/psel.rs b/src/qdec/psel.rs new file mode 100644 index 0000000..29154d5 --- /dev/null +++ b/src/qdec/psel.rs @@ -0,0 +1,12 @@ +#[doc = "LED register accessor: an alias for `Reg`"] +pub type LED = crate::Reg; +#[doc = "Pin select for LED signal"] +pub mod led; +#[doc = "A register accessor: an alias for `Reg`"] +pub type A = crate::Reg; +#[doc = "Pin select for A signal"] +pub mod a; +#[doc = "B register accessor: an alias for `Reg`"] +pub type B = crate::Reg; +#[doc = "Pin select for B signal"] +pub mod b; diff --git a/src/qdec/psel/a.rs b/src/qdec/psel/a.rs new file mode 100644 index 0000000..bc3453e --- /dev/null +++ b/src/qdec/psel/a.rs @@ -0,0 +1,195 @@ +#[doc = "Register `A` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `A` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PIN` reader - Pin number"] +pub struct PIN_R(crate::FieldReader); +impl PIN_R { + pub(crate) fn new(bits: u8) -> Self { + PIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN` writer - Pin number"] +pub struct PIN_W<'a> { + w: &'a mut W, +} +impl<'a> PIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Connection\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CONNECT_A { + #[doc = "1: Disconnect"] + DISCONNECTED = 1, + #[doc = "0: Connect"] + CONNECTED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: CONNECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CONNECT` reader - Connection"] +pub struct CONNECT_R(crate::FieldReader); +impl CONNECT_R { + pub(crate) fn new(bits: bool) -> Self { + CONNECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CONNECT_A { + match self.bits { + true => CONNECT_A::DISCONNECTED, + false => CONNECT_A::CONNECTED, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == CONNECT_A::DISCONNECTED + } + #[doc = "Checks if the value of the field is `CONNECTED`"] + #[inline(always)] + pub fn is_connected(&self) -> bool { + **self == CONNECT_A::CONNECTED + } +} +impl core::ops::Deref for CONNECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONNECT` writer - Connection"] +pub struct CONNECT_W<'a> { + w: &'a mut W, +} +impl<'a> CONNECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CONNECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(CONNECT_A::DISCONNECTED) + } + #[doc = "Connect"] + #[inline(always)] + pub fn connected(self) -> &'a mut W { + self.variant(CONNECT_A::CONNECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&self) -> PIN_R { + PIN_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&self) -> CONNECT_R { + CONNECT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&mut self) -> PIN_W { + PIN_W { w: self } + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&mut self) -> CONNECT_W { + CONNECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for A signal\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [a](index.html) module"] +pub struct A_SPEC; +impl crate::RegisterSpec for A_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [a::R](R) reader structure"] +impl crate::Readable for A_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [a::W](W) writer structure"] +impl crate::Writable for A_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets A to value 0xffff_ffff"] +impl crate::Resettable for A_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/qdec/psel/b.rs b/src/qdec/psel/b.rs new file mode 100644 index 0000000..34ccfb6 --- /dev/null +++ b/src/qdec/psel/b.rs @@ -0,0 +1,195 @@ +#[doc = "Register `B` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `B` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PIN` reader - Pin number"] +pub struct PIN_R(crate::FieldReader); +impl PIN_R { + pub(crate) fn new(bits: u8) -> Self { + PIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN` writer - Pin number"] +pub struct PIN_W<'a> { + w: &'a mut W, +} +impl<'a> PIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Connection\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CONNECT_A { + #[doc = "1: Disconnect"] + DISCONNECTED = 1, + #[doc = "0: Connect"] + CONNECTED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: CONNECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CONNECT` reader - Connection"] +pub struct CONNECT_R(crate::FieldReader); +impl CONNECT_R { + pub(crate) fn new(bits: bool) -> Self { + CONNECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CONNECT_A { + match self.bits { + true => CONNECT_A::DISCONNECTED, + false => CONNECT_A::CONNECTED, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == CONNECT_A::DISCONNECTED + } + #[doc = "Checks if the value of the field is `CONNECTED`"] + #[inline(always)] + pub fn is_connected(&self) -> bool { + **self == CONNECT_A::CONNECTED + } +} +impl core::ops::Deref for CONNECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONNECT` writer - Connection"] +pub struct CONNECT_W<'a> { + w: &'a mut W, +} +impl<'a> CONNECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CONNECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(CONNECT_A::DISCONNECTED) + } + #[doc = "Connect"] + #[inline(always)] + pub fn connected(self) -> &'a mut W { + self.variant(CONNECT_A::CONNECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&self) -> PIN_R { + PIN_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&self) -> CONNECT_R { + CONNECT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&mut self) -> PIN_W { + PIN_W { w: self } + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&mut self) -> CONNECT_W { + CONNECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for B signal\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [b](index.html) module"] +pub struct B_SPEC; +impl crate::RegisterSpec for B_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [b::R](R) reader structure"] +impl crate::Readable for B_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [b::W](W) writer structure"] +impl crate::Writable for B_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets B to value 0xffff_ffff"] +impl crate::Resettable for B_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/qdec/psel/led.rs b/src/qdec/psel/led.rs new file mode 100644 index 0000000..da2736a --- /dev/null +++ b/src/qdec/psel/led.rs @@ -0,0 +1,195 @@ +#[doc = "Register `LED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `LED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PIN` reader - Pin number"] +pub struct PIN_R(crate::FieldReader); +impl PIN_R { + pub(crate) fn new(bits: u8) -> Self { + PIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN` writer - Pin number"] +pub struct PIN_W<'a> { + w: &'a mut W, +} +impl<'a> PIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Connection\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CONNECT_A { + #[doc = "1: Disconnect"] + DISCONNECTED = 1, + #[doc = "0: Connect"] + CONNECTED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: CONNECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CONNECT` reader - Connection"] +pub struct CONNECT_R(crate::FieldReader); +impl CONNECT_R { + pub(crate) fn new(bits: bool) -> Self { + CONNECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CONNECT_A { + match self.bits { + true => CONNECT_A::DISCONNECTED, + false => CONNECT_A::CONNECTED, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == CONNECT_A::DISCONNECTED + } + #[doc = "Checks if the value of the field is `CONNECTED`"] + #[inline(always)] + pub fn is_connected(&self) -> bool { + **self == CONNECT_A::CONNECTED + } +} +impl core::ops::Deref for CONNECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONNECT` writer - Connection"] +pub struct CONNECT_W<'a> { + w: &'a mut W, +} +impl<'a> CONNECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CONNECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(CONNECT_A::DISCONNECTED) + } + #[doc = "Connect"] + #[inline(always)] + pub fn connected(self) -> &'a mut W { + self.variant(CONNECT_A::CONNECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&self) -> PIN_R { + PIN_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&self) -> CONNECT_R { + CONNECT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&mut self) -> PIN_W { + PIN_W { w: self } + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&mut self) -> CONNECT_W { + CONNECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for LED signal\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [led](index.html) module"] +pub struct LED_SPEC; +impl crate::RegisterSpec for LED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [led::R](R) reader structure"] +impl crate::Readable for LED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [led::W](W) writer structure"] +impl crate::Writable for LED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LED to value 0xffff_ffff"] +impl crate::Resettable for LED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/qdec/reportper.rs b/src/qdec/reportper.rs new file mode 100644 index 0000000..4564a6c --- /dev/null +++ b/src/qdec/reportper.rs @@ -0,0 +1,242 @@ +#[doc = "Register `REPORTPER` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `REPORTPER` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Specifies the number of samples to be accumulated in the ACC register before the REPORTRDY and DBLRDY events can be generated\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum REPORTPER_A { + #[doc = "0: 10 samples / report"] + _10SMPL = 0, + #[doc = "1: 40 samples / report"] + _40SMPL = 1, + #[doc = "2: 80 samples / report"] + _80SMPL = 2, + #[doc = "3: 120 samples / report"] + _120SMPL = 3, + #[doc = "4: 160 samples / report"] + _160SMPL = 4, + #[doc = "5: 200 samples / report"] + _200SMPL = 5, + #[doc = "6: 240 samples / report"] + _240SMPL = 6, + #[doc = "7: 280 samples / report"] + _280SMPL = 7, + #[doc = "8: 1 sample / report"] + _1SMPL = 8, +} +impl From for u8 { + #[inline(always)] + fn from(variant: REPORTPER_A) -> Self { + variant as _ + } +} +#[doc = "Field `REPORTPER` reader - Specifies the number of samples to be accumulated in the ACC register before the REPORTRDY and DBLRDY events can be generated"] +pub struct REPORTPER_R(crate::FieldReader); +impl REPORTPER_R { + pub(crate) fn new(bits: u8) -> Self { + REPORTPER_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(REPORTPER_A::_10SMPL), + 1 => Some(REPORTPER_A::_40SMPL), + 2 => Some(REPORTPER_A::_80SMPL), + 3 => Some(REPORTPER_A::_120SMPL), + 4 => Some(REPORTPER_A::_160SMPL), + 5 => Some(REPORTPER_A::_200SMPL), + 6 => Some(REPORTPER_A::_240SMPL), + 7 => Some(REPORTPER_A::_280SMPL), + 8 => Some(REPORTPER_A::_1SMPL), + _ => None, + } + } + #[doc = "Checks if the value of the field is `_10SMPL`"] + #[inline(always)] + pub fn is_10smpl(&self) -> bool { + **self == REPORTPER_A::_10SMPL + } + #[doc = "Checks if the value of the field is `_40SMPL`"] + #[inline(always)] + pub fn is_40smpl(&self) -> bool { + **self == REPORTPER_A::_40SMPL + } + #[doc = "Checks if the value of the field is `_80SMPL`"] + #[inline(always)] + pub fn is_80smpl(&self) -> bool { + **self == REPORTPER_A::_80SMPL + } + #[doc = "Checks if the value of the field is `_120SMPL`"] + #[inline(always)] + pub fn is_120smpl(&self) -> bool { + **self == REPORTPER_A::_120SMPL + } + #[doc = "Checks if the value of the field is `_160SMPL`"] + #[inline(always)] + pub fn is_160smpl(&self) -> bool { + **self == REPORTPER_A::_160SMPL + } + #[doc = "Checks if the value of the field is `_200SMPL`"] + #[inline(always)] + pub fn is_200smpl(&self) -> bool { + **self == REPORTPER_A::_200SMPL + } + #[doc = "Checks if the value of the field is `_240SMPL`"] + #[inline(always)] + pub fn is_240smpl(&self) -> bool { + **self == REPORTPER_A::_240SMPL + } + #[doc = "Checks if the value of the field is `_280SMPL`"] + #[inline(always)] + pub fn is_280smpl(&self) -> bool { + **self == REPORTPER_A::_280SMPL + } + #[doc = "Checks if the value of the field is `_1SMPL`"] + #[inline(always)] + pub fn is_1smpl(&self) -> bool { + **self == REPORTPER_A::_1SMPL + } +} +impl core::ops::Deref for REPORTPER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REPORTPER` writer - Specifies the number of samples to be accumulated in the ACC register before the REPORTRDY and DBLRDY events can be generated"] +pub struct REPORTPER_W<'a> { + w: &'a mut W, +} +impl<'a> REPORTPER_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REPORTPER_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "10 samples / report"] + #[inline(always)] + pub fn _10smpl(self) -> &'a mut W { + self.variant(REPORTPER_A::_10SMPL) + } + #[doc = "40 samples / report"] + #[inline(always)] + pub fn _40smpl(self) -> &'a mut W { + self.variant(REPORTPER_A::_40SMPL) + } + #[doc = "80 samples / report"] + #[inline(always)] + pub fn _80smpl(self) -> &'a mut W { + self.variant(REPORTPER_A::_80SMPL) + } + #[doc = "120 samples / report"] + #[inline(always)] + pub fn _120smpl(self) -> &'a mut W { + self.variant(REPORTPER_A::_120SMPL) + } + #[doc = "160 samples / report"] + #[inline(always)] + pub fn _160smpl(self) -> &'a mut W { + self.variant(REPORTPER_A::_160SMPL) + } + #[doc = "200 samples / report"] + #[inline(always)] + pub fn _200smpl(self) -> &'a mut W { + self.variant(REPORTPER_A::_200SMPL) + } + #[doc = "240 samples / report"] + #[inline(always)] + pub fn _240smpl(self) -> &'a mut W { + self.variant(REPORTPER_A::_240SMPL) + } + #[doc = "280 samples / report"] + #[inline(always)] + pub fn _280smpl(self) -> &'a mut W { + self.variant(REPORTPER_A::_280SMPL) + } + #[doc = "1 sample / report"] + #[inline(always)] + pub fn _1smpl(self) -> &'a mut W { + self.variant(REPORTPER_A::_1SMPL) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); + self.w + } +} +impl R { + #[doc = "Bits 0:3 - Specifies the number of samples to be accumulated in the ACC register before the REPORTRDY and DBLRDY events can be generated"] + #[inline(always)] + pub fn reportper(&self) -> REPORTPER_R { + REPORTPER_R::new((self.bits & 0x0f) as u8) + } +} +impl W { + #[doc = "Bits 0:3 - Specifies the number of samples to be accumulated in the ACC register before the REPORTRDY and DBLRDY events can be generated"] + #[inline(always)] + pub fn reportper(&mut self) -> REPORTPER_W { + REPORTPER_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Number of samples to be taken before REPORTRDY and DBLRDY events can be generated\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [reportper](index.html) module"] +pub struct REPORTPER_SPEC; +impl crate::RegisterSpec for REPORTPER_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [reportper::R](R) reader structure"] +impl crate::Readable for REPORTPER_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [reportper::W](W) writer structure"] +impl crate::Writable for REPORTPER_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets REPORTPER to value 0"] +impl crate::Resettable for REPORTPER_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/qdec/sample.rs b/src/qdec/sample.rs new file mode 100644 index 0000000..dcaddab --- /dev/null +++ b/src/qdec/sample.rs @@ -0,0 +1,52 @@ +#[doc = "Register `SAMPLE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `SAMPLE` reader - Last motion sample"] +pub struct SAMPLE_R(crate::FieldReader); +impl SAMPLE_R { + pub(crate) fn new(bits: u32) -> Self { + SAMPLE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for SAMPLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:31 - Last motion sample"] + #[inline(always)] + pub fn sample(&self) -> SAMPLE_R { + SAMPLE_R::new((self.bits & 0xffff_ffff) as u32) + } +} +#[doc = "Motion sample value\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 [sample](index.html) module"] +pub struct SAMPLE_SPEC; +impl crate::RegisterSpec for SAMPLE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sample::R](R) reader structure"] +impl crate::Readable for SAMPLE_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets SAMPLE to value 0"] +impl crate::Resettable for SAMPLE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/qdec/sampleper.rs b/src/qdec/sampleper.rs new file mode 100644 index 0000000..fb59bc9 --- /dev/null +++ b/src/qdec/sampleper.rs @@ -0,0 +1,268 @@ +#[doc = "Register `SAMPLEPER` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SAMPLEPER` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Sample period. The SAMPLE register will be updated for every new sample\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum SAMPLEPER_A { + #[doc = "0: 128 us"] + _128US = 0, + #[doc = "1: 256 us"] + _256US = 1, + #[doc = "2: 512 us"] + _512US = 2, + #[doc = "3: 1024 us"] + _1024US = 3, + #[doc = "4: 2048 us"] + _2048US = 4, + #[doc = "5: 4096 us"] + _4096US = 5, + #[doc = "6: 8192 us"] + _8192US = 6, + #[doc = "7: 16384 us"] + _16384US = 7, + #[doc = "8: 32768 us"] + _32MS = 8, + #[doc = "9: 65536 us"] + _65MS = 9, + #[doc = "10: 131072 us"] + _131MS = 10, +} +impl From for u8 { + #[inline(always)] + fn from(variant: SAMPLEPER_A) -> Self { + variant as _ + } +} +#[doc = "Field `SAMPLEPER` reader - Sample period. The SAMPLE register will be updated for every new sample"] +pub struct SAMPLEPER_R(crate::FieldReader); +impl SAMPLEPER_R { + pub(crate) fn new(bits: u8) -> Self { + SAMPLEPER_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(SAMPLEPER_A::_128US), + 1 => Some(SAMPLEPER_A::_256US), + 2 => Some(SAMPLEPER_A::_512US), + 3 => Some(SAMPLEPER_A::_1024US), + 4 => Some(SAMPLEPER_A::_2048US), + 5 => Some(SAMPLEPER_A::_4096US), + 6 => Some(SAMPLEPER_A::_8192US), + 7 => Some(SAMPLEPER_A::_16384US), + 8 => Some(SAMPLEPER_A::_32MS), + 9 => Some(SAMPLEPER_A::_65MS), + 10 => Some(SAMPLEPER_A::_131MS), + _ => None, + } + } + #[doc = "Checks if the value of the field is `_128US`"] + #[inline(always)] + pub fn is_128us(&self) -> bool { + **self == SAMPLEPER_A::_128US + } + #[doc = "Checks if the value of the field is `_256US`"] + #[inline(always)] + pub fn is_256us(&self) -> bool { + **self == SAMPLEPER_A::_256US + } + #[doc = "Checks if the value of the field is `_512US`"] + #[inline(always)] + pub fn is_512us(&self) -> bool { + **self == SAMPLEPER_A::_512US + } + #[doc = "Checks if the value of the field is `_1024US`"] + #[inline(always)] + pub fn is_1024us(&self) -> bool { + **self == SAMPLEPER_A::_1024US + } + #[doc = "Checks if the value of the field is `_2048US`"] + #[inline(always)] + pub fn is_2048us(&self) -> bool { + **self == SAMPLEPER_A::_2048US + } + #[doc = "Checks if the value of the field is `_4096US`"] + #[inline(always)] + pub fn is_4096us(&self) -> bool { + **self == SAMPLEPER_A::_4096US + } + #[doc = "Checks if the value of the field is `_8192US`"] + #[inline(always)] + pub fn is_8192us(&self) -> bool { + **self == SAMPLEPER_A::_8192US + } + #[doc = "Checks if the value of the field is `_16384US`"] + #[inline(always)] + pub fn is_16384us(&self) -> bool { + **self == SAMPLEPER_A::_16384US + } + #[doc = "Checks if the value of the field is `_32MS`"] + #[inline(always)] + pub fn is_32ms(&self) -> bool { + **self == SAMPLEPER_A::_32MS + } + #[doc = "Checks if the value of the field is `_65MS`"] + #[inline(always)] + pub fn is_65ms(&self) -> bool { + **self == SAMPLEPER_A::_65MS + } + #[doc = "Checks if the value of the field is `_131MS`"] + #[inline(always)] + pub fn is_131ms(&self) -> bool { + **self == SAMPLEPER_A::_131MS + } +} +impl core::ops::Deref for SAMPLEPER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SAMPLEPER` writer - Sample period. The SAMPLE register will be updated for every new sample"] +pub struct SAMPLEPER_W<'a> { + w: &'a mut W, +} +impl<'a> SAMPLEPER_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SAMPLEPER_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "128 us"] + #[inline(always)] + pub fn _128us(self) -> &'a mut W { + self.variant(SAMPLEPER_A::_128US) + } + #[doc = "256 us"] + #[inline(always)] + pub fn _256us(self) -> &'a mut W { + self.variant(SAMPLEPER_A::_256US) + } + #[doc = "512 us"] + #[inline(always)] + pub fn _512us(self) -> &'a mut W { + self.variant(SAMPLEPER_A::_512US) + } + #[doc = "1024 us"] + #[inline(always)] + pub fn _1024us(self) -> &'a mut W { + self.variant(SAMPLEPER_A::_1024US) + } + #[doc = "2048 us"] + #[inline(always)] + pub fn _2048us(self) -> &'a mut W { + self.variant(SAMPLEPER_A::_2048US) + } + #[doc = "4096 us"] + #[inline(always)] + pub fn _4096us(self) -> &'a mut W { + self.variant(SAMPLEPER_A::_4096US) + } + #[doc = "8192 us"] + #[inline(always)] + pub fn _8192us(self) -> &'a mut W { + self.variant(SAMPLEPER_A::_8192US) + } + #[doc = "16384 us"] + #[inline(always)] + pub fn _16384us(self) -> &'a mut W { + self.variant(SAMPLEPER_A::_16384US) + } + #[doc = "32768 us"] + #[inline(always)] + pub fn _32ms(self) -> &'a mut W { + self.variant(SAMPLEPER_A::_32MS) + } + #[doc = "65536 us"] + #[inline(always)] + pub fn _65ms(self) -> &'a mut W { + self.variant(SAMPLEPER_A::_65MS) + } + #[doc = "131072 us"] + #[inline(always)] + pub fn _131ms(self) -> &'a mut W { + self.variant(SAMPLEPER_A::_131MS) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); + self.w + } +} +impl R { + #[doc = "Bits 0:3 - Sample period. The SAMPLE register will be updated for every new sample"] + #[inline(always)] + pub fn sampleper(&self) -> SAMPLEPER_R { + SAMPLEPER_R::new((self.bits & 0x0f) as u8) + } +} +impl W { + #[doc = "Bits 0:3 - Sample period. The SAMPLE register will be updated for every new sample"] + #[inline(always)] + pub fn sampleper(&mut self) -> SAMPLEPER_W { + SAMPLEPER_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Sample period\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sampleper](index.html) module"] +pub struct SAMPLEPER_SPEC; +impl crate::RegisterSpec for SAMPLEPER_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sampleper::R](R) reader structure"] +impl crate::Readable for SAMPLEPER_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sampleper::W](W) writer structure"] +impl crate::Writable for SAMPLEPER_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SAMPLEPER to value 0"] +impl crate::Resettable for SAMPLEPER_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/qdec/shorts.rs b/src/qdec/shorts.rs new file mode 100644 index 0000000..3bd09e8 --- /dev/null +++ b/src/qdec/shorts.rs @@ -0,0 +1,717 @@ +#[doc = "Register `SHORTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SHORTS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Shortcut between REPORTRDY event and READCLRACC task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REPORTRDY_READCLRACC_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REPORTRDY_READCLRACC_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REPORTRDY_READCLRACC` reader - Shortcut between REPORTRDY event and READCLRACC task"] +pub struct REPORTRDY_READCLRACC_R(crate::FieldReader); +impl REPORTRDY_READCLRACC_R { + pub(crate) fn new(bits: bool) -> Self { + REPORTRDY_READCLRACC_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REPORTRDY_READCLRACC_A { + match self.bits { + false => REPORTRDY_READCLRACC_A::DISABLED, + true => REPORTRDY_READCLRACC_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REPORTRDY_READCLRACC_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REPORTRDY_READCLRACC_A::ENABLED + } +} +impl core::ops::Deref for REPORTRDY_READCLRACC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REPORTRDY_READCLRACC` writer - Shortcut between REPORTRDY event and READCLRACC task"] +pub struct REPORTRDY_READCLRACC_W<'a> { + w: &'a mut W, +} +impl<'a> REPORTRDY_READCLRACC_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REPORTRDY_READCLRACC_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REPORTRDY_READCLRACC_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REPORTRDY_READCLRACC_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Shortcut between SAMPLERDY event and STOP task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SAMPLERDY_STOP_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SAMPLERDY_STOP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SAMPLERDY_STOP` reader - Shortcut between SAMPLERDY event and STOP task"] +pub struct SAMPLERDY_STOP_R(crate::FieldReader); +impl SAMPLERDY_STOP_R { + pub(crate) fn new(bits: bool) -> Self { + SAMPLERDY_STOP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SAMPLERDY_STOP_A { + match self.bits { + false => SAMPLERDY_STOP_A::DISABLED, + true => SAMPLERDY_STOP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SAMPLERDY_STOP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SAMPLERDY_STOP_A::ENABLED + } +} +impl core::ops::Deref for SAMPLERDY_STOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SAMPLERDY_STOP` writer - Shortcut between SAMPLERDY event and STOP task"] +pub struct SAMPLERDY_STOP_W<'a> { + w: &'a mut W, +} +impl<'a> SAMPLERDY_STOP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SAMPLERDY_STOP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(SAMPLERDY_STOP_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(SAMPLERDY_STOP_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Shortcut between REPORTRDY event and RDCLRACC task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REPORTRDY_RDCLRACC_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REPORTRDY_RDCLRACC_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REPORTRDY_RDCLRACC` reader - Shortcut between REPORTRDY event and RDCLRACC task"] +pub struct REPORTRDY_RDCLRACC_R(crate::FieldReader); +impl REPORTRDY_RDCLRACC_R { + pub(crate) fn new(bits: bool) -> Self { + REPORTRDY_RDCLRACC_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REPORTRDY_RDCLRACC_A { + match self.bits { + false => REPORTRDY_RDCLRACC_A::DISABLED, + true => REPORTRDY_RDCLRACC_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REPORTRDY_RDCLRACC_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REPORTRDY_RDCLRACC_A::ENABLED + } +} +impl core::ops::Deref for REPORTRDY_RDCLRACC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REPORTRDY_RDCLRACC` writer - Shortcut between REPORTRDY event and RDCLRACC task"] +pub struct REPORTRDY_RDCLRACC_W<'a> { + w: &'a mut W, +} +impl<'a> REPORTRDY_RDCLRACC_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REPORTRDY_RDCLRACC_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REPORTRDY_RDCLRACC_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REPORTRDY_RDCLRACC_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Shortcut between REPORTRDY event and STOP task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REPORTRDY_STOP_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REPORTRDY_STOP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REPORTRDY_STOP` reader - Shortcut between REPORTRDY event and STOP task"] +pub struct REPORTRDY_STOP_R(crate::FieldReader); +impl REPORTRDY_STOP_R { + pub(crate) fn new(bits: bool) -> Self { + REPORTRDY_STOP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REPORTRDY_STOP_A { + match self.bits { + false => REPORTRDY_STOP_A::DISABLED, + true => REPORTRDY_STOP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == REPORTRDY_STOP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == REPORTRDY_STOP_A::ENABLED + } +} +impl core::ops::Deref for REPORTRDY_STOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REPORTRDY_STOP` writer - Shortcut between REPORTRDY event and STOP task"] +pub struct REPORTRDY_STOP_W<'a> { + w: &'a mut W, +} +impl<'a> REPORTRDY_STOP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REPORTRDY_STOP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(REPORTRDY_STOP_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(REPORTRDY_STOP_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Shortcut between DBLRDY event and RDCLRDBL task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DBLRDY_RDCLRDBL_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DBLRDY_RDCLRDBL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DBLRDY_RDCLRDBL` reader - Shortcut between DBLRDY event and RDCLRDBL task"] +pub struct DBLRDY_RDCLRDBL_R(crate::FieldReader); +impl DBLRDY_RDCLRDBL_R { + pub(crate) fn new(bits: bool) -> Self { + DBLRDY_RDCLRDBL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DBLRDY_RDCLRDBL_A { + match self.bits { + false => DBLRDY_RDCLRDBL_A::DISABLED, + true => DBLRDY_RDCLRDBL_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DBLRDY_RDCLRDBL_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DBLRDY_RDCLRDBL_A::ENABLED + } +} +impl core::ops::Deref for DBLRDY_RDCLRDBL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DBLRDY_RDCLRDBL` writer - Shortcut between DBLRDY event and RDCLRDBL task"] +pub struct DBLRDY_RDCLRDBL_W<'a> { + w: &'a mut W, +} +impl<'a> DBLRDY_RDCLRDBL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DBLRDY_RDCLRDBL_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(DBLRDY_RDCLRDBL_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(DBLRDY_RDCLRDBL_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Shortcut between DBLRDY event and STOP task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DBLRDY_STOP_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DBLRDY_STOP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DBLRDY_STOP` reader - Shortcut between DBLRDY event and STOP task"] +pub struct DBLRDY_STOP_R(crate::FieldReader); +impl DBLRDY_STOP_R { + pub(crate) fn new(bits: bool) -> Self { + DBLRDY_STOP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DBLRDY_STOP_A { + match self.bits { + false => DBLRDY_STOP_A::DISABLED, + true => DBLRDY_STOP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DBLRDY_STOP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DBLRDY_STOP_A::ENABLED + } +} +impl core::ops::Deref for DBLRDY_STOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DBLRDY_STOP` writer - Shortcut between DBLRDY event and STOP task"] +pub struct DBLRDY_STOP_W<'a> { + w: &'a mut W, +} +impl<'a> DBLRDY_STOP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DBLRDY_STOP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(DBLRDY_STOP_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(DBLRDY_STOP_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Shortcut between SAMPLERDY event and READCLRACC task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SAMPLERDY_READCLRACC_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SAMPLERDY_READCLRACC_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SAMPLERDY_READCLRACC` reader - Shortcut between SAMPLERDY event and READCLRACC task"] +pub struct SAMPLERDY_READCLRACC_R(crate::FieldReader); +impl SAMPLERDY_READCLRACC_R { + pub(crate) fn new(bits: bool) -> Self { + SAMPLERDY_READCLRACC_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SAMPLERDY_READCLRACC_A { + match self.bits { + false => SAMPLERDY_READCLRACC_A::DISABLED, + true => SAMPLERDY_READCLRACC_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SAMPLERDY_READCLRACC_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SAMPLERDY_READCLRACC_A::ENABLED + } +} +impl core::ops::Deref for SAMPLERDY_READCLRACC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SAMPLERDY_READCLRACC` writer - Shortcut between SAMPLERDY event and READCLRACC task"] +pub struct SAMPLERDY_READCLRACC_W<'a> { + w: &'a mut W, +} +impl<'a> SAMPLERDY_READCLRACC_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SAMPLERDY_READCLRACC_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(SAMPLERDY_READCLRACC_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(SAMPLERDY_READCLRACC_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +impl R { + #[doc = "Bit 0 - Shortcut between REPORTRDY event and READCLRACC task"] + #[inline(always)] + pub fn reportrdy_readclracc(&self) -> REPORTRDY_READCLRACC_R { + REPORTRDY_READCLRACC_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Shortcut between SAMPLERDY event and STOP task"] + #[inline(always)] + pub fn samplerdy_stop(&self) -> SAMPLERDY_STOP_R { + SAMPLERDY_STOP_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Shortcut between REPORTRDY event and RDCLRACC task"] + #[inline(always)] + pub fn reportrdy_rdclracc(&self) -> REPORTRDY_RDCLRACC_R { + REPORTRDY_RDCLRACC_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Shortcut between REPORTRDY event and STOP task"] + #[inline(always)] + pub fn reportrdy_stop(&self) -> REPORTRDY_STOP_R { + REPORTRDY_STOP_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Shortcut between DBLRDY event and RDCLRDBL task"] + #[inline(always)] + pub fn dblrdy_rdclrdbl(&self) -> DBLRDY_RDCLRDBL_R { + DBLRDY_RDCLRDBL_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Shortcut between DBLRDY event and STOP task"] + #[inline(always)] + pub fn dblrdy_stop(&self) -> DBLRDY_STOP_R { + DBLRDY_STOP_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Shortcut between SAMPLERDY event and READCLRACC task"] + #[inline(always)] + pub fn samplerdy_readclracc(&self) -> SAMPLERDY_READCLRACC_R { + SAMPLERDY_READCLRACC_R::new(((self.bits >> 6) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Shortcut between REPORTRDY event and READCLRACC task"] + #[inline(always)] + pub fn reportrdy_readclracc(&mut self) -> REPORTRDY_READCLRACC_W { + REPORTRDY_READCLRACC_W { w: self } + } + #[doc = "Bit 1 - Shortcut between SAMPLERDY event and STOP task"] + #[inline(always)] + pub fn samplerdy_stop(&mut self) -> SAMPLERDY_STOP_W { + SAMPLERDY_STOP_W { w: self } + } + #[doc = "Bit 2 - Shortcut between REPORTRDY event and RDCLRACC task"] + #[inline(always)] + pub fn reportrdy_rdclracc(&mut self) -> REPORTRDY_RDCLRACC_W { + REPORTRDY_RDCLRACC_W { w: self } + } + #[doc = "Bit 3 - Shortcut between REPORTRDY event and STOP task"] + #[inline(always)] + pub fn reportrdy_stop(&mut self) -> REPORTRDY_STOP_W { + REPORTRDY_STOP_W { w: self } + } + #[doc = "Bit 4 - Shortcut between DBLRDY event and RDCLRDBL task"] + #[inline(always)] + pub fn dblrdy_rdclrdbl(&mut self) -> DBLRDY_RDCLRDBL_W { + DBLRDY_RDCLRDBL_W { w: self } + } + #[doc = "Bit 5 - Shortcut between DBLRDY event and STOP task"] + #[inline(always)] + pub fn dblrdy_stop(&mut self) -> DBLRDY_STOP_W { + DBLRDY_STOP_W { w: self } + } + #[doc = "Bit 6 - Shortcut between SAMPLERDY event and READCLRACC task"] + #[inline(always)] + pub fn samplerdy_readclracc(&mut self) -> SAMPLERDY_READCLRACC_W { + SAMPLERDY_READCLRACC_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Shortcut register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [shorts](index.html) module"] +pub struct SHORTS_SPEC; +impl crate::RegisterSpec for SHORTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [shorts::R](R) reader structure"] +impl crate::Readable for SHORTS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [shorts::W](W) writer structure"] +impl crate::Writable for SHORTS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SHORTS to value 0"] +impl crate::Resettable for SHORTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/qdec/tasks_rdclracc.rs b/src/qdec/tasks_rdclracc.rs new file mode 100644 index 0000000..3611817 --- /dev/null +++ b/src/qdec/tasks_rdclracc.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_RDCLRACC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Read and clear ACC\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_rdclracc](index.html) module"] +pub struct TASKS_RDCLRACC_SPEC; +impl crate::RegisterSpec for TASKS_RDCLRACC_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_rdclracc::W](W) writer structure"] +impl crate::Writable for TASKS_RDCLRACC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_RDCLRACC to value 0"] +impl crate::Resettable for TASKS_RDCLRACC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/qdec/tasks_rdclrdbl.rs b/src/qdec/tasks_rdclrdbl.rs new file mode 100644 index 0000000..38e38c3 --- /dev/null +++ b/src/qdec/tasks_rdclrdbl.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_RDCLRDBL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Read and clear ACCDBL\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_rdclrdbl](index.html) module"] +pub struct TASKS_RDCLRDBL_SPEC; +impl crate::RegisterSpec for TASKS_RDCLRDBL_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_rdclrdbl::W](W) writer structure"] +impl crate::Writable for TASKS_RDCLRDBL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_RDCLRDBL to value 0"] +impl crate::Resettable for TASKS_RDCLRDBL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/qdec/tasks_readclracc.rs b/src/qdec/tasks_readclracc.rs new file mode 100644 index 0000000..41a176a --- /dev/null +++ b/src/qdec/tasks_readclracc.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_READCLRACC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Read and clear ACC and ACCDBL\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_readclracc](index.html) module"] +pub struct TASKS_READCLRACC_SPEC; +impl crate::RegisterSpec for TASKS_READCLRACC_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_readclracc::W](W) writer structure"] +impl crate::Writable for TASKS_READCLRACC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_READCLRACC to value 0"] +impl crate::Resettable for TASKS_READCLRACC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/qdec/tasks_start.rs b/src/qdec/tasks_start.rs new file mode 100644 index 0000000..ecaf8a4 --- /dev/null +++ b/src/qdec/tasks_start.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_START` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Task starting the quadrature decoder\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_start](index.html) module"] +pub struct TASKS_START_SPEC; +impl crate::RegisterSpec for TASKS_START_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_start::W](W) writer structure"] +impl crate::Writable for TASKS_START_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_START to value 0"] +impl crate::Resettable for TASKS_START_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/qdec/tasks_stop.rs b/src/qdec/tasks_stop.rs new file mode 100644 index 0000000..c37fbfc --- /dev/null +++ b/src/qdec/tasks_stop.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STOP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Task stopping the quadrature decoder\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_stop](index.html) module"] +pub struct TASKS_STOP_SPEC; +impl crate::RegisterSpec for TASKS_STOP_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_stop::W](W) writer structure"] +impl crate::Writable for TASKS_STOP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STOP to value 0"] +impl crate::Resettable for TASKS_STOP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio.rs b/src/radio.rs new file mode 100644 index 0000000..edd7d9f --- /dev/null +++ b/src/radio.rs @@ -0,0 +1,335 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "0x00 - Enable RADIO in TX mode"] + pub tasks_txen: crate::Reg, + #[doc = "0x04 - Enable RADIO in RX mode"] + pub tasks_rxen: crate::Reg, + #[doc = "0x08 - Start RADIO"] + pub tasks_start: crate::Reg, + #[doc = "0x0c - Stop RADIO"] + pub tasks_stop: crate::Reg, + #[doc = "0x10 - Disable RADIO"] + pub tasks_disable: crate::Reg, + #[doc = "0x14 - Start the RSSI and take one single sample of the receive signal strength."] + pub tasks_rssistart: crate::Reg, + #[doc = "0x18 - Stop the RSSI measurement"] + pub tasks_rssistop: crate::Reg, + #[doc = "0x1c - Start the bit counter"] + pub tasks_bcstart: crate::Reg, + #[doc = "0x20 - Stop the bit counter"] + pub tasks_bcstop: crate::Reg, + _reserved9: [u8; 0xdc], + #[doc = "0x100 - RADIO has ramped up and is ready to be started"] + pub events_ready: crate::Reg, + #[doc = "0x104 - Address sent or received"] + pub events_address: crate::Reg, + #[doc = "0x108 - Packet payload sent or received"] + pub events_payload: crate::Reg, + #[doc = "0x10c - Packet sent or received"] + pub events_end: crate::Reg, + #[doc = "0x110 - RADIO has been disabled"] + pub events_disabled: crate::Reg, + #[doc = "0x114 - A device address match occurred on the last received packet"] + pub events_devmatch: crate::Reg, + #[doc = "0x118 - No device address match occurred on the last received packet"] + pub events_devmiss: crate::Reg, + #[doc = "0x11c - Sampling of receive signal strength complete."] + pub events_rssiend: crate::Reg, + _reserved17: [u8; 0x08], + #[doc = "0x128 - Bit counter reached bit count value."] + pub events_bcmatch: crate::Reg, + _reserved18: [u8; 0x04], + #[doc = "0x130 - Packet received with CRC ok"] + pub events_crcok: crate::Reg, + #[doc = "0x134 - Packet received with CRC error"] + pub events_crcerror: crate::Reg, + _reserved20: [u8; 0xc8], + #[doc = "0x200 - Shortcut register"] + pub shorts: crate::Reg, + _reserved21: [u8; 0x0100], + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved23: [u8; 0xf4], + #[doc = "0x400 - CRC status"] + pub crcstatus: crate::Reg, + _reserved24: [u8; 0x04], + #[doc = "0x408 - Received address"] + pub rxmatch: crate::Reg, + #[doc = "0x40c - CRC field of previously received packet"] + pub rxcrc: crate::Reg, + #[doc = "0x410 - Device address match index"] + pub dai: crate::Reg, + _reserved27: [u8; 0xf0], + #[doc = "0x504 - Packet pointer"] + pub packetptr: crate::Reg, + #[doc = "0x508 - Frequency"] + pub frequency: crate::Reg, + #[doc = "0x50c - Output power"] + pub txpower: crate::Reg, + #[doc = "0x510 - Data rate and modulation"] + pub mode: crate::Reg, + #[doc = "0x514 - Packet configuration register 0"] + pub pcnf0: crate::Reg, + #[doc = "0x518 - Packet configuration register 1"] + pub pcnf1: crate::Reg, + #[doc = "0x51c - Base address 0"] + pub base0: crate::Reg, + #[doc = "0x520 - Base address 1"] + pub base1: crate::Reg, + #[doc = "0x524 - Prefixes bytes for logical addresses 0-3"] + pub prefix0: crate::Reg, + #[doc = "0x528 - Prefixes bytes for logical addresses 4-7"] + pub prefix1: crate::Reg, + #[doc = "0x52c - Transmit address select"] + pub txaddress: crate::Reg, + #[doc = "0x530 - Receive address select"] + pub rxaddresses: crate::Reg, + #[doc = "0x534 - CRC configuration"] + pub crccnf: crate::Reg, + #[doc = "0x538 - CRC polynomial"] + pub crcpoly: crate::Reg, + #[doc = "0x53c - CRC initial value"] + pub crcinit: crate::Reg, + #[doc = "0x540 - Unspecified"] + pub unused0: crate::Reg, + #[doc = "0x544 - Inter Frame Spacing in us"] + pub tifs: crate::Reg, + #[doc = "0x548 - RSSI sample"] + pub rssisample: crate::Reg, + _reserved45: [u8; 0x04], + #[doc = "0x550 - Current radio state"] + pub state: crate::Reg, + #[doc = "0x554 - Data whitening initial value"] + pub datawhiteiv: crate::Reg, + _reserved47: [u8; 0x08], + #[doc = "0x560 - Bit counter compare"] + pub bcc: crate::Reg, + _reserved48: [u8; 0x9c], + #[doc = "0x600..0x620 - Description collection\\[0\\]: Device address base segment 0"] + pub dab: [crate::Reg; 8], + #[doc = "0x620..0x640 - Description collection\\[0\\]: Device address prefix 0"] + pub dap: [crate::Reg; 8], + #[doc = "0x640 - Device address match configuration"] + pub dacnf: crate::Reg, + _reserved51: [u8; 0x0c], + #[doc = "0x650 - Radio mode configuration register 0"] + pub modecnf0: crate::Reg, + _reserved52: [u8; 0x09a8], + #[doc = "0xffc - Peripheral power control"] + pub power: crate::Reg, +} +#[doc = "TASKS_TXEN register accessor: an alias for `Reg`"] +pub type TASKS_TXEN = crate::Reg; +#[doc = "Enable RADIO in TX mode"] +pub mod tasks_txen; +#[doc = "TASKS_RXEN register accessor: an alias for `Reg`"] +pub type TASKS_RXEN = crate::Reg; +#[doc = "Enable RADIO in RX mode"] +pub mod tasks_rxen; +#[doc = "TASKS_START register accessor: an alias for `Reg`"] +pub type TASKS_START = crate::Reg; +#[doc = "Start RADIO"] +pub mod tasks_start; +#[doc = "TASKS_STOP register accessor: an alias for `Reg`"] +pub type TASKS_STOP = crate::Reg; +#[doc = "Stop RADIO"] +pub mod tasks_stop; +#[doc = "TASKS_DISABLE register accessor: an alias for `Reg`"] +pub type TASKS_DISABLE = crate::Reg; +#[doc = "Disable RADIO"] +pub mod tasks_disable; +#[doc = "TASKS_RSSISTART register accessor: an alias for `Reg`"] +pub type TASKS_RSSISTART = crate::Reg; +#[doc = "Start the RSSI and take one single sample of the receive signal strength."] +pub mod tasks_rssistart; +#[doc = "TASKS_RSSISTOP register accessor: an alias for `Reg`"] +pub type TASKS_RSSISTOP = crate::Reg; +#[doc = "Stop the RSSI measurement"] +pub mod tasks_rssistop; +#[doc = "TASKS_BCSTART register accessor: an alias for `Reg`"] +pub type TASKS_BCSTART = crate::Reg; +#[doc = "Start the bit counter"] +pub mod tasks_bcstart; +#[doc = "TASKS_BCSTOP register accessor: an alias for `Reg`"] +pub type TASKS_BCSTOP = crate::Reg; +#[doc = "Stop the bit counter"] +pub mod tasks_bcstop; +#[doc = "EVENTS_READY register accessor: an alias for `Reg`"] +pub type EVENTS_READY = crate::Reg; +#[doc = "RADIO has ramped up and is ready to be started"] +pub mod events_ready; +#[doc = "EVENTS_ADDRESS register accessor: an alias for `Reg`"] +pub type EVENTS_ADDRESS = crate::Reg; +#[doc = "Address sent or received"] +pub mod events_address; +#[doc = "EVENTS_PAYLOAD register accessor: an alias for `Reg`"] +pub type EVENTS_PAYLOAD = crate::Reg; +#[doc = "Packet payload sent or received"] +pub mod events_payload; +#[doc = "EVENTS_END register accessor: an alias for `Reg`"] +pub type EVENTS_END = crate::Reg; +#[doc = "Packet sent or received"] +pub mod events_end; +#[doc = "EVENTS_DISABLED register accessor: an alias for `Reg`"] +pub type EVENTS_DISABLED = crate::Reg; +#[doc = "RADIO has been disabled"] +pub mod events_disabled; +#[doc = "EVENTS_DEVMATCH register accessor: an alias for `Reg`"] +pub type EVENTS_DEVMATCH = crate::Reg; +#[doc = "A device address match occurred on the last received packet"] +pub mod events_devmatch; +#[doc = "EVENTS_DEVMISS register accessor: an alias for `Reg`"] +pub type EVENTS_DEVMISS = crate::Reg; +#[doc = "No device address match occurred on the last received packet"] +pub mod events_devmiss; +#[doc = "EVENTS_RSSIEND register accessor: an alias for `Reg`"] +pub type EVENTS_RSSIEND = crate::Reg; +#[doc = "Sampling of receive signal strength complete."] +pub mod events_rssiend; +#[doc = "EVENTS_BCMATCH register accessor: an alias for `Reg`"] +pub type EVENTS_BCMATCH = crate::Reg; +#[doc = "Bit counter reached bit count value."] +pub mod events_bcmatch; +#[doc = "EVENTS_CRCOK register accessor: an alias for `Reg`"] +pub type EVENTS_CRCOK = crate::Reg; +#[doc = "Packet received with CRC ok"] +pub mod events_crcok; +#[doc = "EVENTS_CRCERROR register accessor: an alias for `Reg`"] +pub type EVENTS_CRCERROR = crate::Reg; +#[doc = "Packet received with CRC error"] +pub mod events_crcerror; +#[doc = "SHORTS register accessor: an alias for `Reg`"] +pub type SHORTS = crate::Reg; +#[doc = "Shortcut register"] +pub mod shorts; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "CRCSTATUS register accessor: an alias for `Reg`"] +pub type CRCSTATUS = crate::Reg; +#[doc = "CRC status"] +pub mod crcstatus; +#[doc = "RXMATCH register accessor: an alias for `Reg`"] +pub type RXMATCH = crate::Reg; +#[doc = "Received address"] +pub mod rxmatch; +#[doc = "RXCRC register accessor: an alias for `Reg`"] +pub type RXCRC = crate::Reg; +#[doc = "CRC field of previously received packet"] +pub mod rxcrc; +#[doc = "DAI register accessor: an alias for `Reg`"] +pub type DAI = crate::Reg; +#[doc = "Device address match index"] +pub mod dai; +#[doc = "PACKETPTR register accessor: an alias for `Reg`"] +pub type PACKETPTR = crate::Reg; +#[doc = "Packet pointer"] +pub mod packetptr; +#[doc = "FREQUENCY register accessor: an alias for `Reg`"] +pub type FREQUENCY = crate::Reg; +#[doc = "Frequency"] +pub mod frequency; +#[doc = "TXPOWER register accessor: an alias for `Reg`"] +pub type TXPOWER = crate::Reg; +#[doc = "Output power"] +pub mod txpower; +#[doc = "MODE register accessor: an alias for `Reg`"] +pub type MODE = crate::Reg; +#[doc = "Data rate and modulation"] +pub mod mode; +#[doc = "PCNF0 register accessor: an alias for `Reg`"] +pub type PCNF0 = crate::Reg; +#[doc = "Packet configuration register 0"] +pub mod pcnf0; +#[doc = "PCNF1 register accessor: an alias for `Reg`"] +pub type PCNF1 = crate::Reg; +#[doc = "Packet configuration register 1"] +pub mod pcnf1; +#[doc = "BASE0 register accessor: an alias for `Reg`"] +pub type BASE0 = crate::Reg; +#[doc = "Base address 0"] +pub mod base0; +#[doc = "BASE1 register accessor: an alias for `Reg`"] +pub type BASE1 = crate::Reg; +#[doc = "Base address 1"] +pub mod base1; +#[doc = "PREFIX0 register accessor: an alias for `Reg`"] +pub type PREFIX0 = crate::Reg; +#[doc = "Prefixes bytes for logical addresses 0-3"] +pub mod prefix0; +#[doc = "PREFIX1 register accessor: an alias for `Reg`"] +pub type PREFIX1 = crate::Reg; +#[doc = "Prefixes bytes for logical addresses 4-7"] +pub mod prefix1; +#[doc = "TXADDRESS register accessor: an alias for `Reg`"] +pub type TXADDRESS = crate::Reg; +#[doc = "Transmit address select"] +pub mod txaddress; +#[doc = "RXADDRESSES register accessor: an alias for `Reg`"] +pub type RXADDRESSES = crate::Reg; +#[doc = "Receive address select"] +pub mod rxaddresses; +#[doc = "CRCCNF register accessor: an alias for `Reg`"] +pub type CRCCNF = crate::Reg; +#[doc = "CRC configuration"] +pub mod crccnf; +#[doc = "CRCPOLY register accessor: an alias for `Reg`"] +pub type CRCPOLY = crate::Reg; +#[doc = "CRC polynomial"] +pub mod crcpoly; +#[doc = "CRCINIT register accessor: an alias for `Reg`"] +pub type CRCINIT = crate::Reg; +#[doc = "CRC initial value"] +pub mod crcinit; +#[doc = "UNUSED0 register accessor: an alias for `Reg`"] +pub type UNUSED0 = crate::Reg; +#[doc = "Unspecified"] +pub mod unused0; +#[doc = "TIFS register accessor: an alias for `Reg`"] +pub type TIFS = crate::Reg; +#[doc = "Inter Frame Spacing in us"] +pub mod tifs; +#[doc = "RSSISAMPLE register accessor: an alias for `Reg`"] +pub type RSSISAMPLE = crate::Reg; +#[doc = "RSSI sample"] +pub mod rssisample; +#[doc = "STATE register accessor: an alias for `Reg`"] +pub type STATE = crate::Reg; +#[doc = "Current radio state"] +pub mod state; +#[doc = "DATAWHITEIV register accessor: an alias for `Reg`"] +pub type DATAWHITEIV = crate::Reg; +#[doc = "Data whitening initial value"] +pub mod datawhiteiv; +#[doc = "BCC register accessor: an alias for `Reg`"] +pub type BCC = crate::Reg; +#[doc = "Bit counter compare"] +pub mod bcc; +#[doc = "DAB register accessor: an alias for `Reg`"] +pub type DAB = crate::Reg; +#[doc = "Description collection\\[0\\]: Device address base segment 0"] +pub mod dab; +#[doc = "DAP register accessor: an alias for `Reg`"] +pub type DAP = crate::Reg; +#[doc = "Description collection\\[0\\]: Device address prefix 0"] +pub mod dap; +#[doc = "DACNF register accessor: an alias for `Reg`"] +pub type DACNF = crate::Reg; +#[doc = "Device address match configuration"] +pub mod dacnf; +#[doc = "MODECNF0 register accessor: an alias for `Reg`"] +pub type MODECNF0 = crate::Reg; +#[doc = "Radio mode configuration register 0"] +pub mod modecnf0; +#[doc = "POWER register accessor: an alias for `Reg`"] +pub type POWER = crate::Reg; +#[doc = "Peripheral power control"] +pub mod power; diff --git a/src/radio/base0.rs b/src/radio/base0.rs new file mode 100644 index 0000000..8b670b5 --- /dev/null +++ b/src/radio/base0.rs @@ -0,0 +1,102 @@ +#[doc = "Register `BASE0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `BASE0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `BASE0` reader - Base address 0"] +pub struct BASE0_R(crate::FieldReader); +impl BASE0_R { + pub(crate) fn new(bits: u32) -> Self { + BASE0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BASE0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BASE0` writer - Base address 0"] +pub struct BASE0_W<'a> { + w: &'a mut W, +} +impl<'a> BASE0_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Base address 0"] + #[inline(always)] + pub fn base0(&self) -> BASE0_R { + BASE0_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Base address 0"] + #[inline(always)] + pub fn base0(&mut self) -> BASE0_W { + BASE0_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Base address 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [base0](index.html) module"] +pub struct BASE0_SPEC; +impl crate::RegisterSpec for BASE0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [base0::R](R) reader structure"] +impl crate::Readable for BASE0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [base0::W](W) writer structure"] +impl crate::Writable for BASE0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets BASE0 to value 0"] +impl crate::Resettable for BASE0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/base1.rs b/src/radio/base1.rs new file mode 100644 index 0000000..d8061ee --- /dev/null +++ b/src/radio/base1.rs @@ -0,0 +1,102 @@ +#[doc = "Register `BASE1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `BASE1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `BASE1` reader - Base address 1"] +pub struct BASE1_R(crate::FieldReader); +impl BASE1_R { + pub(crate) fn new(bits: u32) -> Self { + BASE1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BASE1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BASE1` writer - Base address 1"] +pub struct BASE1_W<'a> { + w: &'a mut W, +} +impl<'a> BASE1_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Base address 1"] + #[inline(always)] + pub fn base1(&self) -> BASE1_R { + BASE1_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Base address 1"] + #[inline(always)] + pub fn base1(&mut self) -> BASE1_W { + BASE1_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Base address 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [base1](index.html) module"] +pub struct BASE1_SPEC; +impl crate::RegisterSpec for BASE1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [base1::R](R) reader structure"] +impl crate::Readable for BASE1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [base1::W](W) writer structure"] +impl crate::Writable for BASE1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets BASE1 to value 0"] +impl crate::Resettable for BASE1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/bcc.rs b/src/radio/bcc.rs new file mode 100644 index 0000000..d30ece6 --- /dev/null +++ b/src/radio/bcc.rs @@ -0,0 +1,102 @@ +#[doc = "Register `BCC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `BCC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `BCC` reader - Bit counter compare"] +pub struct BCC_R(crate::FieldReader); +impl BCC_R { + pub(crate) fn new(bits: u32) -> Self { + BCC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BCC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BCC` writer - Bit counter compare"] +pub struct BCC_W<'a> { + w: &'a mut W, +} +impl<'a> BCC_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Bit counter compare"] + #[inline(always)] + pub fn bcc(&self) -> BCC_R { + BCC_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Bit counter compare"] + #[inline(always)] + pub fn bcc(&mut self) -> BCC_W { + BCC_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Bit counter compare\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [bcc](index.html) module"] +pub struct BCC_SPEC; +impl crate::RegisterSpec for BCC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [bcc::R](R) reader structure"] +impl crate::Readable for BCC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [bcc::W](W) writer structure"] +impl crate::Writable for BCC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets BCC to value 0"] +impl crate::Resettable for BCC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/crccnf.rs b/src/radio/crccnf.rs new file mode 100644 index 0000000..051d63b --- /dev/null +++ b/src/radio/crccnf.rs @@ -0,0 +1,270 @@ +#[doc = "Register `CRCCNF` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CRCCNF` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "CRC length in number of bytes.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum LEN_A { + #[doc = "0: CRC length is zero and CRC calculation is disabled"] + DISABLED = 0, + #[doc = "1: CRC length is one byte and CRC calculation is enabled"] + ONE = 1, + #[doc = "2: CRC length is two bytes and CRC calculation is enabled"] + TWO = 2, + #[doc = "3: CRC length is three bytes and CRC calculation is enabled"] + THREE = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: LEN_A) -> Self { + variant as _ + } +} +#[doc = "Field `LEN` reader - CRC length in number of bytes."] +pub struct LEN_R(crate::FieldReader); +impl LEN_R { + pub(crate) fn new(bits: u8) -> Self { + LEN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> LEN_A { + match self.bits { + 0 => LEN_A::DISABLED, + 1 => LEN_A::ONE, + 2 => LEN_A::TWO, + 3 => LEN_A::THREE, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == LEN_A::DISABLED + } + #[doc = "Checks if the value of the field is `ONE`"] + #[inline(always)] + pub fn is_one(&self) -> bool { + **self == LEN_A::ONE + } + #[doc = "Checks if the value of the field is `TWO`"] + #[inline(always)] + pub fn is_two(&self) -> bool { + **self == LEN_A::TWO + } + #[doc = "Checks if the value of the field is `THREE`"] + #[inline(always)] + pub fn is_three(&self) -> bool { + **self == LEN_A::THREE + } +} +impl core::ops::Deref for LEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LEN` writer - CRC length in number of bytes."] +pub struct LEN_W<'a> { + w: &'a mut W, +} +impl<'a> LEN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LEN_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "CRC length is zero and CRC calculation is disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(LEN_A::DISABLED) + } + #[doc = "CRC length is one byte and CRC calculation is enabled"] + #[inline(always)] + pub fn one(self) -> &'a mut W { + self.variant(LEN_A::ONE) + } + #[doc = "CRC length is two bytes and CRC calculation is enabled"] + #[inline(always)] + pub fn two(self) -> &'a mut W { + self.variant(LEN_A::TWO) + } + #[doc = "CRC length is three bytes and CRC calculation is enabled"] + #[inline(always)] + pub fn three(self) -> &'a mut W { + self.variant(LEN_A::THREE) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); + self.w + } +} +#[doc = "Include or exclude packet address field out of CRC calculation.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SKIPADDR_A { + #[doc = "0: CRC calculation includes address field"] + INCLUDE = 0, + #[doc = "1: CRC calculation does not include address field. The CRC calculation will start at the first byte after the address."] + SKIP = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SKIPADDR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SKIPADDR` reader - Include or exclude packet address field out of CRC calculation."] +pub struct SKIPADDR_R(crate::FieldReader); +impl SKIPADDR_R { + pub(crate) fn new(bits: bool) -> Self { + SKIPADDR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SKIPADDR_A { + match self.bits { + false => SKIPADDR_A::INCLUDE, + true => SKIPADDR_A::SKIP, + } + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == SKIPADDR_A::INCLUDE + } + #[doc = "Checks if the value of the field is `SKIP`"] + #[inline(always)] + pub fn is_skip(&self) -> bool { + **self == SKIPADDR_A::SKIP + } +} +impl core::ops::Deref for SKIPADDR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SKIPADDR` writer - Include or exclude packet address field out of CRC calculation."] +pub struct SKIPADDR_W<'a> { + w: &'a mut W, +} +impl<'a> SKIPADDR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SKIPADDR_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "CRC calculation includes address field"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(SKIPADDR_A::INCLUDE) + } + #[doc = "CRC calculation does not include address field. The CRC calculation will start at the first byte after the address."] + #[inline(always)] + pub fn skip(self) -> &'a mut W { + self.variant(SKIPADDR_A::SKIP) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +impl R { + #[doc = "Bits 0:1 - CRC length in number of bytes."] + #[inline(always)] + pub fn len(&self) -> LEN_R { + LEN_R::new((self.bits & 0x03) as u8) + } + #[doc = "Bit 8 - Include or exclude packet address field out of CRC calculation."] + #[inline(always)] + pub fn skipaddr(&self) -> SKIPADDR_R { + SKIPADDR_R::new(((self.bits >> 8) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:1 - CRC length in number of bytes."] + #[inline(always)] + pub fn len(&mut self) -> LEN_W { + LEN_W { w: self } + } + #[doc = "Bit 8 - Include or exclude packet address field out of CRC calculation."] + #[inline(always)] + pub fn skipaddr(&mut self) -> SKIPADDR_W { + SKIPADDR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "CRC configuration\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [crccnf](index.html) module"] +pub struct CRCCNF_SPEC; +impl crate::RegisterSpec for CRCCNF_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [crccnf::R](R) reader structure"] +impl crate::Readable for CRCCNF_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [crccnf::W](W) writer structure"] +impl crate::Writable for CRCCNF_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CRCCNF to value 0"] +impl crate::Resettable for CRCCNF_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/crcinit.rs b/src/radio/crcinit.rs new file mode 100644 index 0000000..89d2da6 --- /dev/null +++ b/src/radio/crcinit.rs @@ -0,0 +1,102 @@ +#[doc = "Register `CRCINIT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CRCINIT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CRCINIT` reader - CRC initial value"] +pub struct CRCINIT_R(crate::FieldReader); +impl CRCINIT_R { + pub(crate) fn new(bits: u32) -> Self { + CRCINIT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CRCINIT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CRCINIT` writer - CRC initial value"] +pub struct CRCINIT_W<'a> { + w: &'a mut W, +} +impl<'a> CRCINIT_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0x00ff_ffff) | (value as u32 & 0x00ff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:23 - CRC initial value"] + #[inline(always)] + pub fn crcinit(&self) -> CRCINIT_R { + CRCINIT_R::new((self.bits & 0x00ff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:23 - CRC initial value"] + #[inline(always)] + pub fn crcinit(&mut self) -> CRCINIT_W { + CRCINIT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "CRC initial value\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [crcinit](index.html) module"] +pub struct CRCINIT_SPEC; +impl crate::RegisterSpec for CRCINIT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [crcinit::R](R) reader structure"] +impl crate::Readable for CRCINIT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [crcinit::W](W) writer structure"] +impl crate::Writable for CRCINIT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CRCINIT to value 0"] +impl crate::Resettable for CRCINIT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/crcpoly.rs b/src/radio/crcpoly.rs new file mode 100644 index 0000000..ae33243 --- /dev/null +++ b/src/radio/crcpoly.rs @@ -0,0 +1,102 @@ +#[doc = "Register `CRCPOLY` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CRCPOLY` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CRCPOLY` reader - CRC polynomial"] +pub struct CRCPOLY_R(crate::FieldReader); +impl CRCPOLY_R { + pub(crate) fn new(bits: u32) -> Self { + CRCPOLY_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CRCPOLY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CRCPOLY` writer - CRC polynomial"] +pub struct CRCPOLY_W<'a> { + w: &'a mut W, +} +impl<'a> CRCPOLY_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0x00ff_ffff) | (value as u32 & 0x00ff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:23 - CRC polynomial"] + #[inline(always)] + pub fn crcpoly(&self) -> CRCPOLY_R { + CRCPOLY_R::new((self.bits & 0x00ff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:23 - CRC polynomial"] + #[inline(always)] + pub fn crcpoly(&mut self) -> CRCPOLY_W { + CRCPOLY_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "CRC polynomial\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [crcpoly](index.html) module"] +pub struct CRCPOLY_SPEC; +impl crate::RegisterSpec for CRCPOLY_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [crcpoly::R](R) reader structure"] +impl crate::Readable for CRCPOLY_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [crcpoly::W](W) writer structure"] +impl crate::Writable for CRCPOLY_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CRCPOLY to value 0"] +impl crate::Resettable for CRCPOLY_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/crcstatus.rs b/src/radio/crcstatus.rs new file mode 100644 index 0000000..9b3204a --- /dev/null +++ b/src/radio/crcstatus.rs @@ -0,0 +1,84 @@ +#[doc = "Register `CRCSTATUS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "CRC status of packet received\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CRCSTATUS_A { + #[doc = "0: Packet received with CRC error"] + CRCERROR = 0, + #[doc = "1: Packet received with CRC ok"] + CRCOK = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CRCSTATUS_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CRCSTATUS` reader - CRC status of packet received"] +pub struct CRCSTATUS_R(crate::FieldReader); +impl CRCSTATUS_R { + pub(crate) fn new(bits: bool) -> Self { + CRCSTATUS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CRCSTATUS_A { + match self.bits { + false => CRCSTATUS_A::CRCERROR, + true => CRCSTATUS_A::CRCOK, + } + } + #[doc = "Checks if the value of the field is `CRCERROR`"] + #[inline(always)] + pub fn is_crcerror(&self) -> bool { + **self == CRCSTATUS_A::CRCERROR + } + #[doc = "Checks if the value of the field is `CRCOK`"] + #[inline(always)] + pub fn is_crcok(&self) -> bool { + **self == CRCSTATUS_A::CRCOK + } +} +impl core::ops::Deref for CRCSTATUS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bit 0 - CRC status of packet received"] + #[inline(always)] + pub fn crcstatus(&self) -> CRCSTATUS_R { + CRCSTATUS_R::new((self.bits & 0x01) != 0) + } +} +#[doc = "CRC status\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 [crcstatus](index.html) module"] +pub struct CRCSTATUS_SPEC; +impl crate::RegisterSpec for CRCSTATUS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [crcstatus::R](R) reader structure"] +impl crate::Readable for CRCSTATUS_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets CRCSTATUS to value 0"] +impl crate::Resettable for CRCSTATUS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/dab.rs b/src/radio/dab.rs new file mode 100644 index 0000000..cc3519c --- /dev/null +++ b/src/radio/dab.rs @@ -0,0 +1,103 @@ +#[doc = "Register `DAB[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DAB[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DAB` reader - Device address base segment 0"] +pub struct DAB_R(crate::FieldReader); +impl DAB_R { + pub(crate) fn new(bits: u32) -> Self { + DAB_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DAB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DAB` writer - Device address base segment 0"] +pub struct DAB_W<'a> { + w: &'a mut W, +} +impl<'a> DAB_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Device address base segment 0"] + #[inline(always)] + pub fn dab(&self) -> DAB_R { + DAB_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Device address base segment 0"] + #[inline(always)] + pub fn dab(&mut self) -> DAB_W { + DAB_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description collection\\[0\\]: Device address base segment 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dab](index.html) module"] +pub struct DAB_SPEC; +impl crate::RegisterSpec for DAB_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dab::R](R) reader structure"] +impl crate::Readable for DAB_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dab::W](W) writer structure"] +impl crate::Writable for DAB_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DAB[%s] +to value 0"] +impl crate::Resettable for DAB_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/dacnf.rs b/src/radio/dacnf.rs new file mode 100644 index 0000000..5cf3e7f --- /dev/null +++ b/src/radio/dacnf.rs @@ -0,0 +1,1178 @@ +#[doc = "Register `DACNF` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DACNF` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable device address matching using device address 0\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENA0_A { + #[doc = "0: Disabled"] + DISABLED = 0, + #[doc = "1: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENA0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENA0` reader - Enable or disable device address matching using device address 0"] +pub struct ENA0_R(crate::FieldReader); +impl ENA0_R { + pub(crate) fn new(bits: bool) -> Self { + ENA0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENA0_A { + match self.bits { + false => ENA0_A::DISABLED, + true => ENA0_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENA0_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENA0_A::ENABLED + } +} +impl core::ops::Deref for ENA0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENA0` writer - Enable or disable device address matching using device address 0"] +pub struct ENA0_W<'a> { + w: &'a mut W, +} +impl<'a> ENA0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENA0_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENA0_A::DISABLED) + } + #[doc = "Enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENA0_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Enable or disable device address matching using device address 1\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENA1_A { + #[doc = "0: Disabled"] + DISABLED = 0, + #[doc = "1: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENA1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENA1` reader - Enable or disable device address matching using device address 1"] +pub struct ENA1_R(crate::FieldReader); +impl ENA1_R { + pub(crate) fn new(bits: bool) -> Self { + ENA1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENA1_A { + match self.bits { + false => ENA1_A::DISABLED, + true => ENA1_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENA1_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENA1_A::ENABLED + } +} +impl core::ops::Deref for ENA1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENA1` writer - Enable or disable device address matching using device address 1"] +pub struct ENA1_W<'a> { + w: &'a mut W, +} +impl<'a> ENA1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENA1_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENA1_A::DISABLED) + } + #[doc = "Enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENA1_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Enable or disable device address matching using device address 2\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENA2_A { + #[doc = "0: Disabled"] + DISABLED = 0, + #[doc = "1: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENA2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENA2` reader - Enable or disable device address matching using device address 2"] +pub struct ENA2_R(crate::FieldReader); +impl ENA2_R { + pub(crate) fn new(bits: bool) -> Self { + ENA2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENA2_A { + match self.bits { + false => ENA2_A::DISABLED, + true => ENA2_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENA2_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENA2_A::ENABLED + } +} +impl core::ops::Deref for ENA2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENA2` writer - Enable or disable device address matching using device address 2"] +pub struct ENA2_W<'a> { + w: &'a mut W, +} +impl<'a> ENA2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENA2_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENA2_A::DISABLED) + } + #[doc = "Enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENA2_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Enable or disable device address matching using device address 3\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENA3_A { + #[doc = "0: Disabled"] + DISABLED = 0, + #[doc = "1: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENA3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENA3` reader - Enable or disable device address matching using device address 3"] +pub struct ENA3_R(crate::FieldReader); +impl ENA3_R { + pub(crate) fn new(bits: bool) -> Self { + ENA3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENA3_A { + match self.bits { + false => ENA3_A::DISABLED, + true => ENA3_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENA3_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENA3_A::ENABLED + } +} +impl core::ops::Deref for ENA3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENA3` writer - Enable or disable device address matching using device address 3"] +pub struct ENA3_W<'a> { + w: &'a mut W, +} +impl<'a> ENA3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENA3_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENA3_A::DISABLED) + } + #[doc = "Enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENA3_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Enable or disable device address matching using device address 4\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENA4_A { + #[doc = "0: Disabled"] + DISABLED = 0, + #[doc = "1: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENA4_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENA4` reader - Enable or disable device address matching using device address 4"] +pub struct ENA4_R(crate::FieldReader); +impl ENA4_R { + pub(crate) fn new(bits: bool) -> Self { + ENA4_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENA4_A { + match self.bits { + false => ENA4_A::DISABLED, + true => ENA4_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENA4_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENA4_A::ENABLED + } +} +impl core::ops::Deref for ENA4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENA4` writer - Enable or disable device address matching using device address 4"] +pub struct ENA4_W<'a> { + w: &'a mut W, +} +impl<'a> ENA4_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENA4_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENA4_A::DISABLED) + } + #[doc = "Enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENA4_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Enable or disable device address matching using device address 5\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENA5_A { + #[doc = "0: Disabled"] + DISABLED = 0, + #[doc = "1: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENA5_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENA5` reader - Enable or disable device address matching using device address 5"] +pub struct ENA5_R(crate::FieldReader); +impl ENA5_R { + pub(crate) fn new(bits: bool) -> Self { + ENA5_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENA5_A { + match self.bits { + false => ENA5_A::DISABLED, + true => ENA5_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENA5_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENA5_A::ENABLED + } +} +impl core::ops::Deref for ENA5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENA5` writer - Enable or disable device address matching using device address 5"] +pub struct ENA5_W<'a> { + w: &'a mut W, +} +impl<'a> ENA5_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENA5_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENA5_A::DISABLED) + } + #[doc = "Enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENA5_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Enable or disable device address matching using device address 6\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENA6_A { + #[doc = "0: Disabled"] + DISABLED = 0, + #[doc = "1: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENA6_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENA6` reader - Enable or disable device address matching using device address 6"] +pub struct ENA6_R(crate::FieldReader); +impl ENA6_R { + pub(crate) fn new(bits: bool) -> Self { + ENA6_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENA6_A { + match self.bits { + false => ENA6_A::DISABLED, + true => ENA6_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENA6_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENA6_A::ENABLED + } +} +impl core::ops::Deref for ENA6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENA6` writer - Enable or disable device address matching using device address 6"] +pub struct ENA6_W<'a> { + w: &'a mut W, +} +impl<'a> ENA6_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENA6_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENA6_A::DISABLED) + } + #[doc = "Enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENA6_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Enable or disable device address matching using device address 7\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENA7_A { + #[doc = "0: Disabled"] + DISABLED = 0, + #[doc = "1: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENA7_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENA7` reader - Enable or disable device address matching using device address 7"] +pub struct ENA7_R(crate::FieldReader); +impl ENA7_R { + pub(crate) fn new(bits: bool) -> Self { + ENA7_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENA7_A { + match self.bits { + false => ENA7_A::DISABLED, + true => ENA7_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENA7_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENA7_A::ENABLED + } +} +impl core::ops::Deref for ENA7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENA7` writer - Enable or disable device address matching using device address 7"] +pub struct ENA7_W<'a> { + w: &'a mut W, +} +impl<'a> ENA7_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENA7_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENA7_A::DISABLED) + } + #[doc = "Enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENA7_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Field `TXADD0` reader - TxAdd for device address 0"] +pub struct TXADD0_R(crate::FieldReader); +impl TXADD0_R { + pub(crate) fn new(bits: bool) -> Self { + TXADD0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TXADD0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TXADD0` writer - TxAdd for device address 0"] +pub struct TXADD0_W<'a> { + w: &'a mut W, +} +impl<'a> TXADD0_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Field `TXADD1` reader - TxAdd for device address 1"] +pub struct TXADD1_R(crate::FieldReader); +impl TXADD1_R { + pub(crate) fn new(bits: bool) -> Self { + TXADD1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TXADD1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TXADD1` writer - TxAdd for device address 1"] +pub struct TXADD1_W<'a> { + w: &'a mut W, +} +impl<'a> TXADD1_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Field `TXADD2` reader - TxAdd for device address 2"] +pub struct TXADD2_R(crate::FieldReader); +impl TXADD2_R { + pub(crate) fn new(bits: bool) -> Self { + TXADD2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TXADD2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TXADD2` writer - TxAdd for device address 2"] +pub struct TXADD2_W<'a> { + w: &'a mut W, +} +impl<'a> TXADD2_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Field `TXADD3` reader - TxAdd for device address 3"] +pub struct TXADD3_R(crate::FieldReader); +impl TXADD3_R { + pub(crate) fn new(bits: bool) -> Self { + TXADD3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TXADD3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TXADD3` writer - TxAdd for device address 3"] +pub struct TXADD3_W<'a> { + w: &'a mut W, +} +impl<'a> TXADD3_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Field `TXADD4` reader - TxAdd for device address 4"] +pub struct TXADD4_R(crate::FieldReader); +impl TXADD4_R { + pub(crate) fn new(bits: bool) -> Self { + TXADD4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TXADD4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TXADD4` writer - TxAdd for device address 4"] +pub struct TXADD4_W<'a> { + w: &'a mut W, +} +impl<'a> TXADD4_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Field `TXADD5` reader - TxAdd for device address 5"] +pub struct TXADD5_R(crate::FieldReader); +impl TXADD5_R { + pub(crate) fn new(bits: bool) -> Self { + TXADD5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TXADD5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TXADD5` writer - TxAdd for device address 5"] +pub struct TXADD5_W<'a> { + w: &'a mut W, +} +impl<'a> TXADD5_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Field `TXADD6` reader - TxAdd for device address 6"] +pub struct TXADD6_R(crate::FieldReader); +impl TXADD6_R { + pub(crate) fn new(bits: bool) -> Self { + TXADD6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TXADD6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TXADD6` writer - TxAdd for device address 6"] +pub struct TXADD6_W<'a> { + w: &'a mut W, +} +impl<'a> TXADD6_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Field `TXADD7` reader - TxAdd for device address 7"] +pub struct TXADD7_R(crate::FieldReader); +impl TXADD7_R { + pub(crate) fn new(bits: bool) -> Self { + TXADD7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TXADD7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TXADD7` writer - TxAdd for device address 7"] +pub struct TXADD7_W<'a> { + w: &'a mut W, +} +impl<'a> TXADD7_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable or disable device address matching using device address 0"] + #[inline(always)] + pub fn ena0(&self) -> ENA0_R { + ENA0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Enable or disable device address matching using device address 1"] + #[inline(always)] + pub fn ena1(&self) -> ENA1_R { + ENA1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Enable or disable device address matching using device address 2"] + #[inline(always)] + pub fn ena2(&self) -> ENA2_R { + ENA2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Enable or disable device address matching using device address 3"] + #[inline(always)] + pub fn ena3(&self) -> ENA3_R { + ENA3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Enable or disable device address matching using device address 4"] + #[inline(always)] + pub fn ena4(&self) -> ENA4_R { + ENA4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Enable or disable device address matching using device address 5"] + #[inline(always)] + pub fn ena5(&self) -> ENA5_R { + ENA5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Enable or disable device address matching using device address 6"] + #[inline(always)] + pub fn ena6(&self) -> ENA6_R { + ENA6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Enable or disable device address matching using device address 7"] + #[inline(always)] + pub fn ena7(&self) -> ENA7_R { + ENA7_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - TxAdd for device address 0"] + #[inline(always)] + pub fn txadd0(&self) -> TXADD0_R { + TXADD0_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - TxAdd for device address 1"] + #[inline(always)] + pub fn txadd1(&self) -> TXADD1_R { + TXADD1_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - TxAdd for device address 2"] + #[inline(always)] + pub fn txadd2(&self) -> TXADD2_R { + TXADD2_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - TxAdd for device address 3"] + #[inline(always)] + pub fn txadd3(&self) -> TXADD3_R { + TXADD3_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - TxAdd for device address 4"] + #[inline(always)] + pub fn txadd4(&self) -> TXADD4_R { + TXADD4_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - TxAdd for device address 5"] + #[inline(always)] + pub fn txadd5(&self) -> TXADD5_R { + TXADD5_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - TxAdd for device address 6"] + #[inline(always)] + pub fn txadd6(&self) -> TXADD6_R { + TXADD6_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - TxAdd for device address 7"] + #[inline(always)] + pub fn txadd7(&self) -> TXADD7_R { + TXADD7_R::new(((self.bits >> 15) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Enable or disable device address matching using device address 0"] + #[inline(always)] + pub fn ena0(&mut self) -> ENA0_W { + ENA0_W { w: self } + } + #[doc = "Bit 1 - Enable or disable device address matching using device address 1"] + #[inline(always)] + pub fn ena1(&mut self) -> ENA1_W { + ENA1_W { w: self } + } + #[doc = "Bit 2 - Enable or disable device address matching using device address 2"] + #[inline(always)] + pub fn ena2(&mut self) -> ENA2_W { + ENA2_W { w: self } + } + #[doc = "Bit 3 - Enable or disable device address matching using device address 3"] + #[inline(always)] + pub fn ena3(&mut self) -> ENA3_W { + ENA3_W { w: self } + } + #[doc = "Bit 4 - Enable or disable device address matching using device address 4"] + #[inline(always)] + pub fn ena4(&mut self) -> ENA4_W { + ENA4_W { w: self } + } + #[doc = "Bit 5 - Enable or disable device address matching using device address 5"] + #[inline(always)] + pub fn ena5(&mut self) -> ENA5_W { + ENA5_W { w: self } + } + #[doc = "Bit 6 - Enable or disable device address matching using device address 6"] + #[inline(always)] + pub fn ena6(&mut self) -> ENA6_W { + ENA6_W { w: self } + } + #[doc = "Bit 7 - Enable or disable device address matching using device address 7"] + #[inline(always)] + pub fn ena7(&mut self) -> ENA7_W { + ENA7_W { w: self } + } + #[doc = "Bit 8 - TxAdd for device address 0"] + #[inline(always)] + pub fn txadd0(&mut self) -> TXADD0_W { + TXADD0_W { w: self } + } + #[doc = "Bit 9 - TxAdd for device address 1"] + #[inline(always)] + pub fn txadd1(&mut self) -> TXADD1_W { + TXADD1_W { w: self } + } + #[doc = "Bit 10 - TxAdd for device address 2"] + #[inline(always)] + pub fn txadd2(&mut self) -> TXADD2_W { + TXADD2_W { w: self } + } + #[doc = "Bit 11 - TxAdd for device address 3"] + #[inline(always)] + pub fn txadd3(&mut self) -> TXADD3_W { + TXADD3_W { w: self } + } + #[doc = "Bit 12 - TxAdd for device address 4"] + #[inline(always)] + pub fn txadd4(&mut self) -> TXADD4_W { + TXADD4_W { w: self } + } + #[doc = "Bit 13 - TxAdd for device address 5"] + #[inline(always)] + pub fn txadd5(&mut self) -> TXADD5_W { + TXADD5_W { w: self } + } + #[doc = "Bit 14 - TxAdd for device address 6"] + #[inline(always)] + pub fn txadd6(&mut self) -> TXADD6_W { + TXADD6_W { w: self } + } + #[doc = "Bit 15 - TxAdd for device address 7"] + #[inline(always)] + pub fn txadd7(&mut self) -> TXADD7_W { + TXADD7_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Device address match configuration\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dacnf](index.html) module"] +pub struct DACNF_SPEC; +impl crate::RegisterSpec for DACNF_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dacnf::R](R) reader structure"] +impl crate::Readable for DACNF_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dacnf::W](W) writer structure"] +impl crate::Writable for DACNF_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DACNF to value 0"] +impl crate::Resettable for DACNF_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/dai.rs b/src/radio/dai.rs new file mode 100644 index 0000000..f498f07 --- /dev/null +++ b/src/radio/dai.rs @@ -0,0 +1,52 @@ +#[doc = "Register `DAI` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `DAI` reader - Device address match index"] +pub struct DAI_R(crate::FieldReader); +impl DAI_R { + pub(crate) fn new(bits: u8) -> Self { + DAI_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DAI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:2 - Device address match index"] + #[inline(always)] + pub fn dai(&self) -> DAI_R { + DAI_R::new((self.bits & 0x07) as u8) + } +} +#[doc = "Device address match index\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 [dai](index.html) module"] +pub struct DAI_SPEC; +impl crate::RegisterSpec for DAI_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dai::R](R) reader structure"] +impl crate::Readable for DAI_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets DAI to value 0"] +impl crate::Resettable for DAI_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/dap.rs b/src/radio/dap.rs new file mode 100644 index 0000000..d2cb3b1 --- /dev/null +++ b/src/radio/dap.rs @@ -0,0 +1,103 @@ +#[doc = "Register `DAP[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DAP[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DAP` reader - Device address prefix 0"] +pub struct DAP_R(crate::FieldReader); +impl DAP_R { + pub(crate) fn new(bits: u16) -> Self { + DAP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DAP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DAP` writer - Device address prefix 0"] +pub struct DAP_W<'a> { + w: &'a mut W, +} +impl<'a> DAP_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); + self.w + } +} +impl R { + #[doc = "Bits 0:15 - Device address prefix 0"] + #[inline(always)] + pub fn dap(&self) -> DAP_R { + DAP_R::new((self.bits & 0xffff) as u16) + } +} +impl W { + #[doc = "Bits 0:15 - Device address prefix 0"] + #[inline(always)] + pub fn dap(&mut self) -> DAP_W { + DAP_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description collection\\[0\\]: Device address prefix 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dap](index.html) module"] +pub struct DAP_SPEC; +impl crate::RegisterSpec for DAP_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [dap::R](R) reader structure"] +impl crate::Readable for DAP_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [dap::W](W) writer structure"] +impl crate::Writable for DAP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DAP[%s] +to value 0"] +impl crate::Resettable for DAP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/datawhiteiv.rs b/src/radio/datawhiteiv.rs new file mode 100644 index 0000000..8ab6e37 --- /dev/null +++ b/src/radio/datawhiteiv.rs @@ -0,0 +1,102 @@ +#[doc = "Register `DATAWHITEIV` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DATAWHITEIV` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DATAWHITEIV` reader - Data whitening initial value. Bit 6 is hard-wired to '1', writing '0' to it has no effect, and it will always be read back and used by the device as '1'."] +pub struct DATAWHITEIV_R(crate::FieldReader); +impl DATAWHITEIV_R { + pub(crate) fn new(bits: u8) -> Self { + DATAWHITEIV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DATAWHITEIV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DATAWHITEIV` writer - Data whitening initial value. Bit 6 is hard-wired to '1', writing '0' to it has no effect, and it will always be read back and used by the device as '1'."] +pub struct DATAWHITEIV_W<'a> { + w: &'a mut W, +} +impl<'a> DATAWHITEIV_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x7f) | (value as u32 & 0x7f); + self.w + } +} +impl R { + #[doc = "Bits 0:6 - Data whitening initial value. Bit 6 is hard-wired to '1', writing '0' to it has no effect, and it will always be read back and used by the device as '1'."] + #[inline(always)] + pub fn datawhiteiv(&self) -> DATAWHITEIV_R { + DATAWHITEIV_R::new((self.bits & 0x7f) as u8) + } +} +impl W { + #[doc = "Bits 0:6 - Data whitening initial value. Bit 6 is hard-wired to '1', writing '0' to it has no effect, and it will always be read back and used by the device as '1'."] + #[inline(always)] + pub fn datawhiteiv(&mut self) -> DATAWHITEIV_W { + DATAWHITEIV_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Data whitening initial value\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [datawhiteiv](index.html) module"] +pub struct DATAWHITEIV_SPEC; +impl crate::RegisterSpec for DATAWHITEIV_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [datawhiteiv::R](R) reader structure"] +impl crate::Readable for DATAWHITEIV_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [datawhiteiv::W](W) writer structure"] +impl crate::Writable for DATAWHITEIV_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DATAWHITEIV to value 0x40"] +impl crate::Resettable for DATAWHITEIV_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x40 + } +} diff --git a/src/radio/events_address.rs b/src/radio/events_address.rs new file mode 100644 index 0000000..d442c26 --- /dev/null +++ b/src/radio/events_address.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_ADDRESS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_ADDRESS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Address sent or received\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_address](index.html) module"] +pub struct EVENTS_ADDRESS_SPEC; +impl crate::RegisterSpec for EVENTS_ADDRESS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_address::R](R) reader structure"] +impl crate::Readable for EVENTS_ADDRESS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_address::W](W) writer structure"] +impl crate::Writable for EVENTS_ADDRESS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_ADDRESS to value 0"] +impl crate::Resettable for EVENTS_ADDRESS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/events_bcmatch.rs b/src/radio/events_bcmatch.rs new file mode 100644 index 0000000..bb24e6a --- /dev/null +++ b/src/radio/events_bcmatch.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_BCMATCH` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_BCMATCH` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Bit counter reached bit count value.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_bcmatch](index.html) module"] +pub struct EVENTS_BCMATCH_SPEC; +impl crate::RegisterSpec for EVENTS_BCMATCH_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_bcmatch::R](R) reader structure"] +impl crate::Readable for EVENTS_BCMATCH_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_bcmatch::W](W) writer structure"] +impl crate::Writable for EVENTS_BCMATCH_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_BCMATCH to value 0"] +impl crate::Resettable for EVENTS_BCMATCH_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/events_crcerror.rs b/src/radio/events_crcerror.rs new file mode 100644 index 0000000..99122c6 --- /dev/null +++ b/src/radio/events_crcerror.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_CRCERROR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_CRCERROR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Packet received with CRC error\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_crcerror](index.html) module"] +pub struct EVENTS_CRCERROR_SPEC; +impl crate::RegisterSpec for EVENTS_CRCERROR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_crcerror::R](R) reader structure"] +impl crate::Readable for EVENTS_CRCERROR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_crcerror::W](W) writer structure"] +impl crate::Writable for EVENTS_CRCERROR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_CRCERROR to value 0"] +impl crate::Resettable for EVENTS_CRCERROR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/events_crcok.rs b/src/radio/events_crcok.rs new file mode 100644 index 0000000..6d1b08a --- /dev/null +++ b/src/radio/events_crcok.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_CRCOK` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_CRCOK` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Packet received with CRC ok\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_crcok](index.html) module"] +pub struct EVENTS_CRCOK_SPEC; +impl crate::RegisterSpec for EVENTS_CRCOK_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_crcok::R](R) reader structure"] +impl crate::Readable for EVENTS_CRCOK_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_crcok::W](W) writer structure"] +impl crate::Writable for EVENTS_CRCOK_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_CRCOK to value 0"] +impl crate::Resettable for EVENTS_CRCOK_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/events_devmatch.rs b/src/radio/events_devmatch.rs new file mode 100644 index 0000000..56a656d --- /dev/null +++ b/src/radio/events_devmatch.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_DEVMATCH` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_DEVMATCH` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "A device address match occurred on the last received packet\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_devmatch](index.html) module"] +pub struct EVENTS_DEVMATCH_SPEC; +impl crate::RegisterSpec for EVENTS_DEVMATCH_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_devmatch::R](R) reader structure"] +impl crate::Readable for EVENTS_DEVMATCH_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_devmatch::W](W) writer structure"] +impl crate::Writable for EVENTS_DEVMATCH_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_DEVMATCH to value 0"] +impl crate::Resettable for EVENTS_DEVMATCH_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/events_devmiss.rs b/src/radio/events_devmiss.rs new file mode 100644 index 0000000..572dd48 --- /dev/null +++ b/src/radio/events_devmiss.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_DEVMISS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_DEVMISS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "No device address match occurred on the last received packet\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_devmiss](index.html) module"] +pub struct EVENTS_DEVMISS_SPEC; +impl crate::RegisterSpec for EVENTS_DEVMISS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_devmiss::R](R) reader structure"] +impl crate::Readable for EVENTS_DEVMISS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_devmiss::W](W) writer structure"] +impl crate::Writable for EVENTS_DEVMISS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_DEVMISS to value 0"] +impl crate::Resettable for EVENTS_DEVMISS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/events_disabled.rs b/src/radio/events_disabled.rs new file mode 100644 index 0000000..ebff0b1 --- /dev/null +++ b/src/radio/events_disabled.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_DISABLED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_DISABLED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "RADIO has been disabled\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_disabled](index.html) module"] +pub struct EVENTS_DISABLED_SPEC; +impl crate::RegisterSpec for EVENTS_DISABLED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_disabled::R](R) reader structure"] +impl crate::Readable for EVENTS_DISABLED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_disabled::W](W) writer structure"] +impl crate::Writable for EVENTS_DISABLED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_DISABLED to value 0"] +impl crate::Resettable for EVENTS_DISABLED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/events_end.rs b/src/radio/events_end.rs new file mode 100644 index 0000000..d6883f8 --- /dev/null +++ b/src/radio/events_end.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_END` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_END` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Packet sent or received\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_end](index.html) module"] +pub struct EVENTS_END_SPEC; +impl crate::RegisterSpec for EVENTS_END_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_end::R](R) reader structure"] +impl crate::Readable for EVENTS_END_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_end::W](W) writer structure"] +impl crate::Writable for EVENTS_END_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_END to value 0"] +impl crate::Resettable for EVENTS_END_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/events_payload.rs b/src/radio/events_payload.rs new file mode 100644 index 0000000..ec93f3f --- /dev/null +++ b/src/radio/events_payload.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_PAYLOAD` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_PAYLOAD` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Packet payload sent or received\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_payload](index.html) module"] +pub struct EVENTS_PAYLOAD_SPEC; +impl crate::RegisterSpec for EVENTS_PAYLOAD_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_payload::R](R) reader structure"] +impl crate::Readable for EVENTS_PAYLOAD_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_payload::W](W) writer structure"] +impl crate::Writable for EVENTS_PAYLOAD_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_PAYLOAD to value 0"] +impl crate::Resettable for EVENTS_PAYLOAD_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/events_ready.rs b/src/radio/events_ready.rs new file mode 100644 index 0000000..5a332e2 --- /dev/null +++ b/src/radio/events_ready.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_READY` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_READY` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "RADIO has ramped up and is ready to be started\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_ready](index.html) module"] +pub struct EVENTS_READY_SPEC; +impl crate::RegisterSpec for EVENTS_READY_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_ready::R](R) reader structure"] +impl crate::Readable for EVENTS_READY_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_ready::W](W) writer structure"] +impl crate::Writable for EVENTS_READY_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_READY to value 0"] +impl crate::Resettable for EVENTS_READY_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/events_rssiend.rs b/src/radio/events_rssiend.rs new file mode 100644 index 0000000..9e919f4 --- /dev/null +++ b/src/radio/events_rssiend.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_RSSIEND` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_RSSIEND` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Sampling of receive signal strength complete.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_rssiend](index.html) module"] +pub struct EVENTS_RSSIEND_SPEC; +impl crate::RegisterSpec for EVENTS_RSSIEND_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_rssiend::R](R) reader structure"] +impl crate::Readable for EVENTS_RSSIEND_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_rssiend::W](W) writer structure"] +impl crate::Writable for EVENTS_RSSIEND_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_RSSIEND to value 0"] +impl crate::Resettable for EVENTS_RSSIEND_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/frequency.rs b/src/radio/frequency.rs new file mode 100644 index 0000000..27735eb --- /dev/null +++ b/src/radio/frequency.rs @@ -0,0 +1,195 @@ +#[doc = "Register `FREQUENCY` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `FREQUENCY` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `FREQUENCY` reader - Radio channel frequency"] +pub struct FREQUENCY_R(crate::FieldReader); +impl FREQUENCY_R { + pub(crate) fn new(bits: u8) -> Self { + FREQUENCY_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for FREQUENCY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FREQUENCY` writer - Radio channel frequency"] +pub struct FREQUENCY_W<'a> { + w: &'a mut W, +} +impl<'a> FREQUENCY_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x7f) | (value as u32 & 0x7f); + self.w + } +} +#[doc = "Channel map selection.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum MAP_A { + #[doc = "0: Channel map between 2400 MHZ .. 2500 MHz"] + DEFAULT = 0, + #[doc = "1: Channel map between 2360 MHZ .. 2460 MHz"] + LOW = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: MAP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `MAP` reader - Channel map selection."] +pub struct MAP_R(crate::FieldReader); +impl MAP_R { + pub(crate) fn new(bits: bool) -> Self { + MAP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> MAP_A { + match self.bits { + false => MAP_A::DEFAULT, + true => MAP_A::LOW, + } + } + #[doc = "Checks if the value of the field is `DEFAULT`"] + #[inline(always)] + pub fn is_default(&self) -> bool { + **self == MAP_A::DEFAULT + } + #[doc = "Checks if the value of the field is `LOW`"] + #[inline(always)] + pub fn is_low(&self) -> bool { + **self == MAP_A::LOW + } +} +impl core::ops::Deref for MAP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MAP` writer - Channel map selection."] +pub struct MAP_W<'a> { + w: &'a mut W, +} +impl<'a> MAP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: MAP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Channel map between 2400 MHZ .. 2500 MHz"] + #[inline(always)] + pub fn default(self) -> &'a mut W { + self.variant(MAP_A::DEFAULT) + } + #[doc = "Channel map between 2360 MHZ .. 2460 MHz"] + #[inline(always)] + pub fn low(self) -> &'a mut W { + self.variant(MAP_A::LOW) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +impl R { + #[doc = "Bits 0:6 - Radio channel frequency"] + #[inline(always)] + pub fn frequency(&self) -> FREQUENCY_R { + FREQUENCY_R::new((self.bits & 0x7f) as u8) + } + #[doc = "Bit 8 - Channel map selection."] + #[inline(always)] + pub fn map(&self) -> MAP_R { + MAP_R::new(((self.bits >> 8) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:6 - Radio channel frequency"] + #[inline(always)] + pub fn frequency(&mut self) -> FREQUENCY_W { + FREQUENCY_W { w: self } + } + #[doc = "Bit 8 - Channel map selection."] + #[inline(always)] + pub fn map(&mut self) -> MAP_W { + MAP_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Frequency\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [frequency](index.html) module"] +pub struct FREQUENCY_SPEC; +impl crate::RegisterSpec for FREQUENCY_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [frequency::R](R) reader structure"] +impl crate::Readable for FREQUENCY_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [frequency::W](W) writer structure"] +impl crate::Writable for FREQUENCY_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets FREQUENCY to value 0x02"] +impl crate::Resettable for FREQUENCY_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x02 + } +} diff --git a/src/radio/intenclr.rs b/src/radio/intenclr.rs new file mode 100644 index 0000000..f551b31 --- /dev/null +++ b/src/radio/intenclr.rs @@ -0,0 +1,1166 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for READY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY` reader - Write '1' to Disable interrupt for READY event"] +pub struct READY_R(crate::FieldReader); +impl READY_R { + pub(crate) fn new(bits: bool) -> Self { + READY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> READY_A { + match self.bits { + false => READY_A::DISABLED, + true => READY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == READY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == READY_A::ENABLED + } +} +impl core::ops::Deref for READY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for READY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY` writer - Write '1' to Disable interrupt for READY event"] +pub struct READY_W<'a> { + w: &'a mut W, +} +impl<'a> READY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: READY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(READY_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for ADDRESS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ADDRESS_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ADDRESS_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ADDRESS` reader - Write '1' to Disable interrupt for ADDRESS event"] +pub struct ADDRESS_R(crate::FieldReader); +impl ADDRESS_R { + pub(crate) fn new(bits: bool) -> Self { + ADDRESS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ADDRESS_A { + match self.bits { + false => ADDRESS_A::DISABLED, + true => ADDRESS_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ADDRESS_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ADDRESS_A::ENABLED + } +} +impl core::ops::Deref for ADDRESS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for ADDRESS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ADDRESS_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ADDRESS_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ADDRESS` writer - Write '1' to Disable interrupt for ADDRESS event"] +pub struct ADDRESS_W<'a> { + w: &'a mut W, +} +impl<'a> ADDRESS_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ADDRESS_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(ADDRESS_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for PAYLOAD event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PAYLOAD_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PAYLOAD_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PAYLOAD` reader - Write '1' to Disable interrupt for PAYLOAD event"] +pub struct PAYLOAD_R(crate::FieldReader); +impl PAYLOAD_R { + pub(crate) fn new(bits: bool) -> Self { + PAYLOAD_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PAYLOAD_A { + match self.bits { + false => PAYLOAD_A::DISABLED, + true => PAYLOAD_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PAYLOAD_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PAYLOAD_A::ENABLED + } +} +impl core::ops::Deref for PAYLOAD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for PAYLOAD event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PAYLOAD_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PAYLOAD_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PAYLOAD` writer - Write '1' to Disable interrupt for PAYLOAD event"] +pub struct PAYLOAD_W<'a> { + w: &'a mut W, +} +impl<'a> PAYLOAD_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PAYLOAD_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(PAYLOAD_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for END event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END` reader - Write '1' to Disable interrupt for END event"] +pub struct END_R(crate::FieldReader); +impl END_R { + pub(crate) fn new(bits: bool) -> Self { + END_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> END_A { + match self.bits { + false => END_A::DISABLED, + true => END_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == END_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == END_A::ENABLED + } +} +impl core::ops::Deref for END_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for END event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END` writer - Write '1' to Disable interrupt for END event"] +pub struct END_W<'a> { + w: &'a mut W, +} +impl<'a> END_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: END_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(END_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for DISABLED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DISABLED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DISABLED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DISABLED` reader - Write '1' to Disable interrupt for DISABLED event"] +pub struct DISABLED_R(crate::FieldReader); +impl DISABLED_R { + pub(crate) fn new(bits: bool) -> Self { + DISABLED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DISABLED_A { + match self.bits { + false => DISABLED_A::DISABLED, + true => DISABLED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DISABLED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DISABLED_A::ENABLED + } +} +impl core::ops::Deref for DISABLED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for DISABLED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DISABLED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DISABLED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DISABLED` writer - Write '1' to Disable interrupt for DISABLED event"] +pub struct DISABLED_W<'a> { + w: &'a mut W, +} +impl<'a> DISABLED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DISABLED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(DISABLED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for DEVMATCH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DEVMATCH_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DEVMATCH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DEVMATCH` reader - Write '1' to Disable interrupt for DEVMATCH event"] +pub struct DEVMATCH_R(crate::FieldReader); +impl DEVMATCH_R { + pub(crate) fn new(bits: bool) -> Self { + DEVMATCH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DEVMATCH_A { + match self.bits { + false => DEVMATCH_A::DISABLED, + true => DEVMATCH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DEVMATCH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DEVMATCH_A::ENABLED + } +} +impl core::ops::Deref for DEVMATCH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for DEVMATCH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DEVMATCH_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DEVMATCH_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DEVMATCH` writer - Write '1' to Disable interrupt for DEVMATCH event"] +pub struct DEVMATCH_W<'a> { + w: &'a mut W, +} +impl<'a> DEVMATCH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DEVMATCH_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(DEVMATCH_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for DEVMISS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DEVMISS_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DEVMISS_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DEVMISS` reader - Write '1' to Disable interrupt for DEVMISS event"] +pub struct DEVMISS_R(crate::FieldReader); +impl DEVMISS_R { + pub(crate) fn new(bits: bool) -> Self { + DEVMISS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DEVMISS_A { + match self.bits { + false => DEVMISS_A::DISABLED, + true => DEVMISS_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DEVMISS_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DEVMISS_A::ENABLED + } +} +impl core::ops::Deref for DEVMISS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for DEVMISS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DEVMISS_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DEVMISS_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DEVMISS` writer - Write '1' to Disable interrupt for DEVMISS event"] +pub struct DEVMISS_W<'a> { + w: &'a mut W, +} +impl<'a> DEVMISS_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DEVMISS_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(DEVMISS_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for RSSIEND event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RSSIEND_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RSSIEND_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RSSIEND` reader - Write '1' to Disable interrupt for RSSIEND event"] +pub struct RSSIEND_R(crate::FieldReader); +impl RSSIEND_R { + pub(crate) fn new(bits: bool) -> Self { + RSSIEND_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RSSIEND_A { + match self.bits { + false => RSSIEND_A::DISABLED, + true => RSSIEND_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RSSIEND_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RSSIEND_A::ENABLED + } +} +impl core::ops::Deref for RSSIEND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for RSSIEND event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RSSIEND_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RSSIEND_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RSSIEND` writer - Write '1' to Disable interrupt for RSSIEND event"] +pub struct RSSIEND_W<'a> { + w: &'a mut W, +} +impl<'a> RSSIEND_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RSSIEND_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(RSSIEND_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for BCMATCH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum BCMATCH_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: BCMATCH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `BCMATCH` reader - Write '1' to Disable interrupt for BCMATCH event"] +pub struct BCMATCH_R(crate::FieldReader); +impl BCMATCH_R { + pub(crate) fn new(bits: bool) -> Self { + BCMATCH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> BCMATCH_A { + match self.bits { + false => BCMATCH_A::DISABLED, + true => BCMATCH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == BCMATCH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == BCMATCH_A::ENABLED + } +} +impl core::ops::Deref for BCMATCH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for BCMATCH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum BCMATCH_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: BCMATCH_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `BCMATCH` writer - Write '1' to Disable interrupt for BCMATCH event"] +pub struct BCMATCH_W<'a> { + w: &'a mut W, +} +impl<'a> BCMATCH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: BCMATCH_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(BCMATCH_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for CRCOK event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CRCOK_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CRCOK_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CRCOK` reader - Write '1' to Disable interrupt for CRCOK event"] +pub struct CRCOK_R(crate::FieldReader); +impl CRCOK_R { + pub(crate) fn new(bits: bool) -> Self { + CRCOK_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CRCOK_A { + match self.bits { + false => CRCOK_A::DISABLED, + true => CRCOK_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CRCOK_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CRCOK_A::ENABLED + } +} +impl core::ops::Deref for CRCOK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for CRCOK event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CRCOK_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CRCOK_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CRCOK` writer - Write '1' to Disable interrupt for CRCOK event"] +pub struct CRCOK_W<'a> { + w: &'a mut W, +} +impl<'a> CRCOK_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CRCOK_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CRCOK_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for CRCERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CRCERROR_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CRCERROR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CRCERROR` reader - Write '1' to Disable interrupt for CRCERROR event"] +pub struct CRCERROR_R(crate::FieldReader); +impl CRCERROR_R { + pub(crate) fn new(bits: bool) -> Self { + CRCERROR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CRCERROR_A { + match self.bits { + false => CRCERROR_A::DISABLED, + true => CRCERROR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CRCERROR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CRCERROR_A::ENABLED + } +} +impl core::ops::Deref for CRCERROR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for CRCERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CRCERROR_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CRCERROR_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CRCERROR` writer - Write '1' to Disable interrupt for CRCERROR event"] +pub struct CRCERROR_W<'a> { + w: &'a mut W, +} +impl<'a> CRCERROR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CRCERROR_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CRCERROR_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Disable interrupt for READY event"] + #[inline(always)] + pub fn ready(&self) -> READY_R { + READY_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for ADDRESS event"] + #[inline(always)] + pub fn address(&self) -> ADDRESS_R { + ADDRESS_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for PAYLOAD event"] + #[inline(always)] + pub fn payload(&self) -> PAYLOAD_R { + PAYLOAD_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Write '1' to Disable interrupt for END event"] + #[inline(always)] + pub fn end(&self) -> END_R { + END_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Write '1' to Disable interrupt for DISABLED event"] + #[inline(always)] + pub fn disabled(&self) -> DISABLED_R { + DISABLED_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Write '1' to Disable interrupt for DEVMATCH event"] + #[inline(always)] + pub fn devmatch(&self) -> DEVMATCH_R { + DEVMATCH_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Write '1' to Disable interrupt for DEVMISS event"] + #[inline(always)] + pub fn devmiss(&self) -> DEVMISS_R { + DEVMISS_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Write '1' to Disable interrupt for RSSIEND event"] + #[inline(always)] + pub fn rssiend(&self) -> RSSIEND_R { + RSSIEND_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 10 - Write '1' to Disable interrupt for BCMATCH event"] + #[inline(always)] + pub fn bcmatch(&self) -> BCMATCH_R { + BCMATCH_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 12 - Write '1' to Disable interrupt for CRCOK event"] + #[inline(always)] + pub fn crcok(&self) -> CRCOK_R { + CRCOK_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Write '1' to Disable interrupt for CRCERROR event"] + #[inline(always)] + pub fn crcerror(&self) -> CRCERROR_R { + CRCERROR_R::new(((self.bits >> 13) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Disable interrupt for READY event"] + #[inline(always)] + pub fn ready(&mut self) -> READY_W { + READY_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for ADDRESS event"] + #[inline(always)] + pub fn address(&mut self) -> ADDRESS_W { + ADDRESS_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for PAYLOAD event"] + #[inline(always)] + pub fn payload(&mut self) -> PAYLOAD_W { + PAYLOAD_W { w: self } + } + #[doc = "Bit 3 - Write '1' to Disable interrupt for END event"] + #[inline(always)] + pub fn end(&mut self) -> END_W { + END_W { w: self } + } + #[doc = "Bit 4 - Write '1' to Disable interrupt for DISABLED event"] + #[inline(always)] + pub fn disabled(&mut self) -> DISABLED_W { + DISABLED_W { w: self } + } + #[doc = "Bit 5 - Write '1' to Disable interrupt for DEVMATCH event"] + #[inline(always)] + pub fn devmatch(&mut self) -> DEVMATCH_W { + DEVMATCH_W { w: self } + } + #[doc = "Bit 6 - Write '1' to Disable interrupt for DEVMISS event"] + #[inline(always)] + pub fn devmiss(&mut self) -> DEVMISS_W { + DEVMISS_W { w: self } + } + #[doc = "Bit 7 - Write '1' to Disable interrupt for RSSIEND event"] + #[inline(always)] + pub fn rssiend(&mut self) -> RSSIEND_W { + RSSIEND_W { w: self } + } + #[doc = "Bit 10 - Write '1' to Disable interrupt for BCMATCH event"] + #[inline(always)] + pub fn bcmatch(&mut self) -> BCMATCH_W { + BCMATCH_W { w: self } + } + #[doc = "Bit 12 - Write '1' to Disable interrupt for CRCOK event"] + #[inline(always)] + pub fn crcok(&mut self) -> CRCOK_W { + CRCOK_W { w: self } + } + #[doc = "Bit 13 - Write '1' to Disable interrupt for CRCERROR event"] + #[inline(always)] + pub fn crcerror(&mut self) -> CRCERROR_W { + CRCERROR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/intenset.rs b/src/radio/intenset.rs new file mode 100644 index 0000000..6abf799 --- /dev/null +++ b/src/radio/intenset.rs @@ -0,0 +1,1166 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for READY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY` reader - Write '1' to Enable interrupt for READY event"] +pub struct READY_R(crate::FieldReader); +impl READY_R { + pub(crate) fn new(bits: bool) -> Self { + READY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> READY_A { + match self.bits { + false => READY_A::DISABLED, + true => READY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == READY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == READY_A::ENABLED + } +} +impl core::ops::Deref for READY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for READY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY` writer - Write '1' to Enable interrupt for READY event"] +pub struct READY_W<'a> { + w: &'a mut W, +} +impl<'a> READY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: READY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(READY_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for ADDRESS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ADDRESS_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ADDRESS_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ADDRESS` reader - Write '1' to Enable interrupt for ADDRESS event"] +pub struct ADDRESS_R(crate::FieldReader); +impl ADDRESS_R { + pub(crate) fn new(bits: bool) -> Self { + ADDRESS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ADDRESS_A { + match self.bits { + false => ADDRESS_A::DISABLED, + true => ADDRESS_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ADDRESS_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ADDRESS_A::ENABLED + } +} +impl core::ops::Deref for ADDRESS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for ADDRESS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ADDRESS_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ADDRESS_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ADDRESS` writer - Write '1' to Enable interrupt for ADDRESS event"] +pub struct ADDRESS_W<'a> { + w: &'a mut W, +} +impl<'a> ADDRESS_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ADDRESS_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(ADDRESS_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for PAYLOAD event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PAYLOAD_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PAYLOAD_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PAYLOAD` reader - Write '1' to Enable interrupt for PAYLOAD event"] +pub struct PAYLOAD_R(crate::FieldReader); +impl PAYLOAD_R { + pub(crate) fn new(bits: bool) -> Self { + PAYLOAD_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PAYLOAD_A { + match self.bits { + false => PAYLOAD_A::DISABLED, + true => PAYLOAD_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PAYLOAD_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PAYLOAD_A::ENABLED + } +} +impl core::ops::Deref for PAYLOAD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for PAYLOAD event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PAYLOAD_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PAYLOAD_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PAYLOAD` writer - Write '1' to Enable interrupt for PAYLOAD event"] +pub struct PAYLOAD_W<'a> { + w: &'a mut W, +} +impl<'a> PAYLOAD_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PAYLOAD_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(PAYLOAD_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for END event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END` reader - Write '1' to Enable interrupt for END event"] +pub struct END_R(crate::FieldReader); +impl END_R { + pub(crate) fn new(bits: bool) -> Self { + END_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> END_A { + match self.bits { + false => END_A::DISABLED, + true => END_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == END_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == END_A::ENABLED + } +} +impl core::ops::Deref for END_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for END event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END` writer - Write '1' to Enable interrupt for END event"] +pub struct END_W<'a> { + w: &'a mut W, +} +impl<'a> END_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: END_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(END_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for DISABLED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DISABLED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DISABLED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DISABLED` reader - Write '1' to Enable interrupt for DISABLED event"] +pub struct DISABLED_R(crate::FieldReader); +impl DISABLED_R { + pub(crate) fn new(bits: bool) -> Self { + DISABLED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DISABLED_A { + match self.bits { + false => DISABLED_A::DISABLED, + true => DISABLED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DISABLED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DISABLED_A::ENABLED + } +} +impl core::ops::Deref for DISABLED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for DISABLED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DISABLED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DISABLED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DISABLED` writer - Write '1' to Enable interrupt for DISABLED event"] +pub struct DISABLED_W<'a> { + w: &'a mut W, +} +impl<'a> DISABLED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DISABLED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(DISABLED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for DEVMATCH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DEVMATCH_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DEVMATCH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DEVMATCH` reader - Write '1' to Enable interrupt for DEVMATCH event"] +pub struct DEVMATCH_R(crate::FieldReader); +impl DEVMATCH_R { + pub(crate) fn new(bits: bool) -> Self { + DEVMATCH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DEVMATCH_A { + match self.bits { + false => DEVMATCH_A::DISABLED, + true => DEVMATCH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DEVMATCH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DEVMATCH_A::ENABLED + } +} +impl core::ops::Deref for DEVMATCH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for DEVMATCH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DEVMATCH_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DEVMATCH_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DEVMATCH` writer - Write '1' to Enable interrupt for DEVMATCH event"] +pub struct DEVMATCH_W<'a> { + w: &'a mut W, +} +impl<'a> DEVMATCH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DEVMATCH_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(DEVMATCH_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for DEVMISS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DEVMISS_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DEVMISS_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DEVMISS` reader - Write '1' to Enable interrupt for DEVMISS event"] +pub struct DEVMISS_R(crate::FieldReader); +impl DEVMISS_R { + pub(crate) fn new(bits: bool) -> Self { + DEVMISS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DEVMISS_A { + match self.bits { + false => DEVMISS_A::DISABLED, + true => DEVMISS_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DEVMISS_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DEVMISS_A::ENABLED + } +} +impl core::ops::Deref for DEVMISS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for DEVMISS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DEVMISS_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DEVMISS_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DEVMISS` writer - Write '1' to Enable interrupt for DEVMISS event"] +pub struct DEVMISS_W<'a> { + w: &'a mut W, +} +impl<'a> DEVMISS_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DEVMISS_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(DEVMISS_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for RSSIEND event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RSSIEND_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RSSIEND_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RSSIEND` reader - Write '1' to Enable interrupt for RSSIEND event"] +pub struct RSSIEND_R(crate::FieldReader); +impl RSSIEND_R { + pub(crate) fn new(bits: bool) -> Self { + RSSIEND_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RSSIEND_A { + match self.bits { + false => RSSIEND_A::DISABLED, + true => RSSIEND_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RSSIEND_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RSSIEND_A::ENABLED + } +} +impl core::ops::Deref for RSSIEND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for RSSIEND event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RSSIEND_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RSSIEND_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RSSIEND` writer - Write '1' to Enable interrupt for RSSIEND event"] +pub struct RSSIEND_W<'a> { + w: &'a mut W, +} +impl<'a> RSSIEND_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RSSIEND_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(RSSIEND_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for BCMATCH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum BCMATCH_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: BCMATCH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `BCMATCH` reader - Write '1' to Enable interrupt for BCMATCH event"] +pub struct BCMATCH_R(crate::FieldReader); +impl BCMATCH_R { + pub(crate) fn new(bits: bool) -> Self { + BCMATCH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> BCMATCH_A { + match self.bits { + false => BCMATCH_A::DISABLED, + true => BCMATCH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == BCMATCH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == BCMATCH_A::ENABLED + } +} +impl core::ops::Deref for BCMATCH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for BCMATCH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum BCMATCH_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: BCMATCH_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `BCMATCH` writer - Write '1' to Enable interrupt for BCMATCH event"] +pub struct BCMATCH_W<'a> { + w: &'a mut W, +} +impl<'a> BCMATCH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: BCMATCH_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(BCMATCH_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for CRCOK event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CRCOK_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CRCOK_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CRCOK` reader - Write '1' to Enable interrupt for CRCOK event"] +pub struct CRCOK_R(crate::FieldReader); +impl CRCOK_R { + pub(crate) fn new(bits: bool) -> Self { + CRCOK_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CRCOK_A { + match self.bits { + false => CRCOK_A::DISABLED, + true => CRCOK_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CRCOK_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CRCOK_A::ENABLED + } +} +impl core::ops::Deref for CRCOK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for CRCOK event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CRCOK_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CRCOK_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CRCOK` writer - Write '1' to Enable interrupt for CRCOK event"] +pub struct CRCOK_W<'a> { + w: &'a mut W, +} +impl<'a> CRCOK_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CRCOK_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CRCOK_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for CRCERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CRCERROR_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CRCERROR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CRCERROR` reader - Write '1' to Enable interrupt for CRCERROR event"] +pub struct CRCERROR_R(crate::FieldReader); +impl CRCERROR_R { + pub(crate) fn new(bits: bool) -> Self { + CRCERROR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CRCERROR_A { + match self.bits { + false => CRCERROR_A::DISABLED, + true => CRCERROR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CRCERROR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CRCERROR_A::ENABLED + } +} +impl core::ops::Deref for CRCERROR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for CRCERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CRCERROR_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CRCERROR_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CRCERROR` writer - Write '1' to Enable interrupt for CRCERROR event"] +pub struct CRCERROR_W<'a> { + w: &'a mut W, +} +impl<'a> CRCERROR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CRCERROR_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CRCERROR_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Enable interrupt for READY event"] + #[inline(always)] + pub fn ready(&self) -> READY_R { + READY_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for ADDRESS event"] + #[inline(always)] + pub fn address(&self) -> ADDRESS_R { + ADDRESS_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for PAYLOAD event"] + #[inline(always)] + pub fn payload(&self) -> PAYLOAD_R { + PAYLOAD_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Write '1' to Enable interrupt for END event"] + #[inline(always)] + pub fn end(&self) -> END_R { + END_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Write '1' to Enable interrupt for DISABLED event"] + #[inline(always)] + pub fn disabled(&self) -> DISABLED_R { + DISABLED_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Write '1' to Enable interrupt for DEVMATCH event"] + #[inline(always)] + pub fn devmatch(&self) -> DEVMATCH_R { + DEVMATCH_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Write '1' to Enable interrupt for DEVMISS event"] + #[inline(always)] + pub fn devmiss(&self) -> DEVMISS_R { + DEVMISS_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Write '1' to Enable interrupt for RSSIEND event"] + #[inline(always)] + pub fn rssiend(&self) -> RSSIEND_R { + RSSIEND_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 10 - Write '1' to Enable interrupt for BCMATCH event"] + #[inline(always)] + pub fn bcmatch(&self) -> BCMATCH_R { + BCMATCH_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 12 - Write '1' to Enable interrupt for CRCOK event"] + #[inline(always)] + pub fn crcok(&self) -> CRCOK_R { + CRCOK_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Write '1' to Enable interrupt for CRCERROR event"] + #[inline(always)] + pub fn crcerror(&self) -> CRCERROR_R { + CRCERROR_R::new(((self.bits >> 13) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Enable interrupt for READY event"] + #[inline(always)] + pub fn ready(&mut self) -> READY_W { + READY_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for ADDRESS event"] + #[inline(always)] + pub fn address(&mut self) -> ADDRESS_W { + ADDRESS_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for PAYLOAD event"] + #[inline(always)] + pub fn payload(&mut self) -> PAYLOAD_W { + PAYLOAD_W { w: self } + } + #[doc = "Bit 3 - Write '1' to Enable interrupt for END event"] + #[inline(always)] + pub fn end(&mut self) -> END_W { + END_W { w: self } + } + #[doc = "Bit 4 - Write '1' to Enable interrupt for DISABLED event"] + #[inline(always)] + pub fn disabled(&mut self) -> DISABLED_W { + DISABLED_W { w: self } + } + #[doc = "Bit 5 - Write '1' to Enable interrupt for DEVMATCH event"] + #[inline(always)] + pub fn devmatch(&mut self) -> DEVMATCH_W { + DEVMATCH_W { w: self } + } + #[doc = "Bit 6 - Write '1' to Enable interrupt for DEVMISS event"] + #[inline(always)] + pub fn devmiss(&mut self) -> DEVMISS_W { + DEVMISS_W { w: self } + } + #[doc = "Bit 7 - Write '1' to Enable interrupt for RSSIEND event"] + #[inline(always)] + pub fn rssiend(&mut self) -> RSSIEND_W { + RSSIEND_W { w: self } + } + #[doc = "Bit 10 - Write '1' to Enable interrupt for BCMATCH event"] + #[inline(always)] + pub fn bcmatch(&mut self) -> BCMATCH_W { + BCMATCH_W { w: self } + } + #[doc = "Bit 12 - Write '1' to Enable interrupt for CRCOK event"] + #[inline(always)] + pub fn crcok(&mut self) -> CRCOK_W { + CRCOK_W { w: self } + } + #[doc = "Bit 13 - Write '1' to Enable interrupt for CRCERROR event"] + #[inline(always)] + pub fn crcerror(&mut self) -> CRCERROR_W { + CRCERROR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/mode.rs b/src/radio/mode.rs new file mode 100644 index 0000000..0dfdb92 --- /dev/null +++ b/src/radio/mode.rs @@ -0,0 +1,190 @@ +#[doc = "Register `MODE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MODE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Radio data rate and modulation setting. The radio supports Frequency-shift Keying (FSK) modulation.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum MODE_A { + #[doc = "0: 1 Mbit/s Nordic proprietary radio mode"] + NRF_1MBIT = 0, + #[doc = "1: 2 Mbit/s Nordic proprietary radio mode"] + NRF_2MBIT = 1, + #[doc = "2: Deprecated enumerator - 250 kbit/s Nordic proprietary radio mode"] + NRF_250KBIT = 2, + #[doc = "3: 1 Mbit/s Bluetooth Low Energy"] + BLE_1MBIT = 3, + #[doc = "4: 2 Mbit/s Bluetooth Low Energy"] + BLE_2MBIT = 4, +} +impl From for u8 { + #[inline(always)] + fn from(variant: MODE_A) -> Self { + variant as _ + } +} +#[doc = "Field `MODE` reader - Radio data rate and modulation setting. The radio supports Frequency-shift Keying (FSK) modulation."] +pub struct MODE_R(crate::FieldReader); +impl MODE_R { + pub(crate) fn new(bits: u8) -> Self { + MODE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(MODE_A::NRF_1MBIT), + 1 => Some(MODE_A::NRF_2MBIT), + 2 => Some(MODE_A::NRF_250KBIT), + 3 => Some(MODE_A::BLE_1MBIT), + 4 => Some(MODE_A::BLE_2MBIT), + _ => None, + } + } + #[doc = "Checks if the value of the field is `NRF_1MBIT`"] + #[inline(always)] + pub fn is_nrf_1mbit(&self) -> bool { + **self == MODE_A::NRF_1MBIT + } + #[doc = "Checks if the value of the field is `NRF_2MBIT`"] + #[inline(always)] + pub fn is_nrf_2mbit(&self) -> bool { + **self == MODE_A::NRF_2MBIT + } + #[doc = "Checks if the value of the field is `NRF_250KBIT`"] + #[inline(always)] + pub fn is_nrf_250kbit(&self) -> bool { + **self == MODE_A::NRF_250KBIT + } + #[doc = "Checks if the value of the field is `BLE_1MBIT`"] + #[inline(always)] + pub fn is_ble_1mbit(&self) -> bool { + **self == MODE_A::BLE_1MBIT + } + #[doc = "Checks if the value of the field is `BLE_2MBIT`"] + #[inline(always)] + pub fn is_ble_2mbit(&self) -> bool { + **self == MODE_A::BLE_2MBIT + } +} +impl core::ops::Deref for MODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MODE` writer - Radio data rate and modulation setting. The radio supports Frequency-shift Keying (FSK) modulation."] +pub struct MODE_W<'a> { + w: &'a mut W, +} +impl<'a> MODE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: MODE_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "1 Mbit/s Nordic proprietary radio mode"] + #[inline(always)] + pub fn nrf_1mbit(self) -> &'a mut W { + self.variant(MODE_A::NRF_1MBIT) + } + #[doc = "2 Mbit/s Nordic proprietary radio mode"] + #[inline(always)] + pub fn nrf_2mbit(self) -> &'a mut W { + self.variant(MODE_A::NRF_2MBIT) + } + #[doc = "Deprecated enumerator - 250 kbit/s Nordic proprietary radio mode"] + #[inline(always)] + pub fn nrf_250kbit(self) -> &'a mut W { + self.variant(MODE_A::NRF_250KBIT) + } + #[doc = "1 Mbit/s Bluetooth Low Energy"] + #[inline(always)] + pub fn ble_1mbit(self) -> &'a mut W { + self.variant(MODE_A::BLE_1MBIT) + } + #[doc = "2 Mbit/s Bluetooth Low Energy"] + #[inline(always)] + pub fn ble_2mbit(self) -> &'a mut W { + self.variant(MODE_A::BLE_2MBIT) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); + self.w + } +} +impl R { + #[doc = "Bits 0:3 - Radio data rate and modulation setting. The radio supports Frequency-shift Keying (FSK) modulation."] + #[inline(always)] + pub fn mode(&self) -> MODE_R { + MODE_R::new((self.bits & 0x0f) as u8) + } +} +impl W { + #[doc = "Bits 0:3 - Radio data rate and modulation setting. The radio supports Frequency-shift Keying (FSK) modulation."] + #[inline(always)] + pub fn mode(&mut self) -> MODE_W { + MODE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Data rate and modulation\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mode](index.html) module"] +pub struct MODE_SPEC; +impl crate::RegisterSpec for MODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mode::R](R) reader structure"] +impl crate::Readable for MODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mode::W](W) writer structure"] +impl crate::Writable for MODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MODE to value 0"] +impl crate::Resettable for MODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/modecnf0.rs b/src/radio/modecnf0.rs new file mode 100644 index 0000000..17d2752 --- /dev/null +++ b/src/radio/modecnf0.rs @@ -0,0 +1,257 @@ +#[doc = "Register `MODECNF0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MODECNF0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Radio ramp-up time\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RU_A { + #[doc = "0: Default ramp-up time (tRXEN), compatible with firmware written for nRF51"] + DEFAULT = 0, + #[doc = "1: Fast ramp-up (tRXEN,FAST), see electrical specification for more information"] + FAST = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RU_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RU` reader - Radio ramp-up time"] +pub struct RU_R(crate::FieldReader); +impl RU_R { + pub(crate) fn new(bits: bool) -> Self { + RU_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RU_A { + match self.bits { + false => RU_A::DEFAULT, + true => RU_A::FAST, + } + } + #[doc = "Checks if the value of the field is `DEFAULT`"] + #[inline(always)] + pub fn is_default(&self) -> bool { + **self == RU_A::DEFAULT + } + #[doc = "Checks if the value of the field is `FAST`"] + #[inline(always)] + pub fn is_fast(&self) -> bool { + **self == RU_A::FAST + } +} +impl core::ops::Deref for RU_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RU` writer - Radio ramp-up time"] +pub struct RU_W<'a> { + w: &'a mut W, +} +impl<'a> RU_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RU_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Default ramp-up time (tRXEN), compatible with firmware written for nRF51"] + #[inline(always)] + pub fn default(self) -> &'a mut W { + self.variant(RU_A::DEFAULT) + } + #[doc = "Fast ramp-up (tRXEN,FAST), see electrical specification for more information"] + #[inline(always)] + pub fn fast(self) -> &'a mut W { + self.variant(RU_A::FAST) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Default TX value\n\nValue on reset: 2"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum DTX_A { + #[doc = "0: Transmit '1'"] + B1 = 0, + #[doc = "1: Transmit '0'"] + B0 = 1, + #[doc = "2: Transmit center frequency"] + CENTER = 2, +} +impl From for u8 { + #[inline(always)] + fn from(variant: DTX_A) -> Self { + variant as _ + } +} +#[doc = "Field `DTX` reader - Default TX value"] +pub struct DTX_R(crate::FieldReader); +impl DTX_R { + pub(crate) fn new(bits: u8) -> Self { + DTX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(DTX_A::B1), + 1 => Some(DTX_A::B0), + 2 => Some(DTX_A::CENTER), + _ => None, + } + } + #[doc = "Checks if the value of the field is `B1`"] + #[inline(always)] + pub fn is_b1(&self) -> bool { + **self == DTX_A::B1 + } + #[doc = "Checks if the value of the field is `B0`"] + #[inline(always)] + pub fn is_b0(&self) -> bool { + **self == DTX_A::B0 + } + #[doc = "Checks if the value of the field is `CENTER`"] + #[inline(always)] + pub fn is_center(&self) -> bool { + **self == DTX_A::CENTER + } +} +impl core::ops::Deref for DTX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DTX` writer - Default TX value"] +pub struct DTX_W<'a> { + w: &'a mut W, +} +impl<'a> DTX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DTX_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Transmit '1'"] + #[inline(always)] + pub fn b1(self) -> &'a mut W { + self.variant(DTX_A::B1) + } + #[doc = "Transmit '0'"] + #[inline(always)] + pub fn b0(self) -> &'a mut W { + self.variant(DTX_A::B0) + } + #[doc = "Transmit center frequency"] + #[inline(always)] + pub fn center(self) -> &'a mut W { + self.variant(DTX_A::CENTER) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8); + self.w + } +} +impl R { + #[doc = "Bit 0 - Radio ramp-up time"] + #[inline(always)] + pub fn ru(&self) -> RU_R { + RU_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bits 8:9 - Default TX value"] + #[inline(always)] + pub fn dtx(&self) -> DTX_R { + DTX_R::new(((self.bits >> 8) & 0x03) as u8) + } +} +impl W { + #[doc = "Bit 0 - Radio ramp-up time"] + #[inline(always)] + pub fn ru(&mut self) -> RU_W { + RU_W { w: self } + } + #[doc = "Bits 8:9 - Default TX value"] + #[inline(always)] + pub fn dtx(&mut self) -> DTX_W { + DTX_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Radio mode configuration register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [modecnf0](index.html) module"] +pub struct MODECNF0_SPEC; +impl crate::RegisterSpec for MODECNF0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [modecnf0::R](R) reader structure"] +impl crate::Readable for MODECNF0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [modecnf0::W](W) writer structure"] +impl crate::Writable for MODECNF0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MODECNF0 to value 0x0200"] +impl crate::Resettable for MODECNF0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0200 + } +} diff --git a/src/radio/packetptr.rs b/src/radio/packetptr.rs new file mode 100644 index 0000000..d3cdcf5 --- /dev/null +++ b/src/radio/packetptr.rs @@ -0,0 +1,102 @@ +#[doc = "Register `PACKETPTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PACKETPTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PACKETPTR` reader - Packet pointer"] +pub struct PACKETPTR_R(crate::FieldReader); +impl PACKETPTR_R { + pub(crate) fn new(bits: u32) -> Self { + PACKETPTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PACKETPTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PACKETPTR` writer - Packet pointer"] +pub struct PACKETPTR_W<'a> { + w: &'a mut W, +} +impl<'a> PACKETPTR_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Packet pointer"] + #[inline(always)] + pub fn packetptr(&self) -> PACKETPTR_R { + PACKETPTR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Packet pointer"] + #[inline(always)] + pub fn packetptr(&mut self) -> PACKETPTR_W { + PACKETPTR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Packet pointer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [packetptr](index.html) module"] +pub struct PACKETPTR_SPEC; +impl crate::RegisterSpec for PACKETPTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [packetptr::R](R) reader structure"] +impl crate::Readable for PACKETPTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [packetptr::W](W) writer structure"] +impl crate::Writable for PACKETPTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PACKETPTR to value 0"] +impl crate::Resettable for PACKETPTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/pcnf0.rs b/src/radio/pcnf0.rs new file mode 100644 index 0000000..86b8623 --- /dev/null +++ b/src/radio/pcnf0.rs @@ -0,0 +1,370 @@ +#[doc = "Register `PCNF0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PCNF0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `LFLEN` reader - Length on air of LENGTH field in number of bits."] +pub struct LFLEN_R(crate::FieldReader); +impl LFLEN_R { + pub(crate) fn new(bits: u8) -> Self { + LFLEN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LFLEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LFLEN` writer - Length on air of LENGTH field in number of bits."] +pub struct LFLEN_W<'a> { + w: &'a mut W, +} +impl<'a> LFLEN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); + self.w + } +} +#[doc = "Field `S0LEN` reader - Length on air of S0 field in number of bytes."] +pub struct S0LEN_R(crate::FieldReader); +impl S0LEN_R { + pub(crate) fn new(bits: bool) -> Self { + S0LEN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for S0LEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `S0LEN` writer - Length on air of S0 field in number of bytes."] +pub struct S0LEN_W<'a> { + w: &'a mut W, +} +impl<'a> S0LEN_W<'a> { + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Field `S1LEN` reader - Length on air of S1 field in number of bits."] +pub struct S1LEN_R(crate::FieldReader); +impl S1LEN_R { + pub(crate) fn new(bits: u8) -> Self { + S1LEN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for S1LEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `S1LEN` writer - Length on air of S1 field in number of bits."] +pub struct S1LEN_W<'a> { + w: &'a mut W, +} +impl<'a> S1LEN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x0f << 16)) | ((value as u32 & 0x0f) << 16); + self.w + } +} +#[doc = "Include or exclude S1 field in RAM\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum S1INCL_A { + #[doc = "0: Include S1 field in RAM only if S1LEN > 0"] + AUTOMATIC = 0, + #[doc = "1: Always include S1 field in RAM independent of S1LEN"] + INCLUDE = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: S1INCL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `S1INCL` reader - Include or exclude S1 field in RAM"] +pub struct S1INCL_R(crate::FieldReader); +impl S1INCL_R { + pub(crate) fn new(bits: bool) -> Self { + S1INCL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> S1INCL_A { + match self.bits { + false => S1INCL_A::AUTOMATIC, + true => S1INCL_A::INCLUDE, + } + } + #[doc = "Checks if the value of the field is `AUTOMATIC`"] + #[inline(always)] + pub fn is_automatic(&self) -> bool { + **self == S1INCL_A::AUTOMATIC + } + #[doc = "Checks if the value of the field is `INCLUDE`"] + #[inline(always)] + pub fn is_include(&self) -> bool { + **self == S1INCL_A::INCLUDE + } +} +impl core::ops::Deref for S1INCL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `S1INCL` writer - Include or exclude S1 field in RAM"] +pub struct S1INCL_W<'a> { + w: &'a mut W, +} +impl<'a> S1INCL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: S1INCL_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Include S1 field in RAM only if S1LEN > 0"] + #[inline(always)] + pub fn automatic(self) -> &'a mut W { + self.variant(S1INCL_A::AUTOMATIC) + } + #[doc = "Always include S1 field in RAM independent of S1LEN"] + #[inline(always)] + pub fn include(self) -> &'a mut W { + self.variant(S1INCL_A::INCLUDE) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Length of preamble on air. Decision point: TASKS_START task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PLEN_A { + #[doc = "0: 8-bit preamble"] + _8BIT = 0, + #[doc = "1: 16-bit preamble"] + _16BIT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PLEN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PLEN` reader - Length of preamble on air. Decision point: TASKS_START task"] +pub struct PLEN_R(crate::FieldReader); +impl PLEN_R { + pub(crate) fn new(bits: bool) -> Self { + PLEN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PLEN_A { + match self.bits { + false => PLEN_A::_8BIT, + true => PLEN_A::_16BIT, + } + } + #[doc = "Checks if the value of the field is `_8BIT`"] + #[inline(always)] + pub fn is_8bit(&self) -> bool { + **self == PLEN_A::_8BIT + } + #[doc = "Checks if the value of the field is `_16BIT`"] + #[inline(always)] + pub fn is_16bit(&self) -> bool { + **self == PLEN_A::_16BIT + } +} +impl core::ops::Deref for PLEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PLEN` writer - Length of preamble on air. Decision point: TASKS_START task"] +pub struct PLEN_W<'a> { + w: &'a mut W, +} +impl<'a> PLEN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PLEN_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "8-bit preamble"] + #[inline(always)] + pub fn _8bit(self) -> &'a mut W { + self.variant(PLEN_A::_8BIT) + } + #[doc = "16-bit preamble"] + #[inline(always)] + pub fn _16bit(self) -> &'a mut W { + self.variant(PLEN_A::_16BIT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +impl R { + #[doc = "Bits 0:3 - Length on air of LENGTH field in number of bits."] + #[inline(always)] + pub fn lflen(&self) -> LFLEN_R { + LFLEN_R::new((self.bits & 0x0f) as u8) + } + #[doc = "Bit 8 - Length on air of S0 field in number of bytes."] + #[inline(always)] + pub fn s0len(&self) -> S0LEN_R { + S0LEN_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bits 16:19 - Length on air of S1 field in number of bits."] + #[inline(always)] + pub fn s1len(&self) -> S1LEN_R { + S1LEN_R::new(((self.bits >> 16) & 0x0f) as u8) + } + #[doc = "Bit 20 - Include or exclude S1 field in RAM"] + #[inline(always)] + pub fn s1incl(&self) -> S1INCL_R { + S1INCL_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 24 - Length of preamble on air. Decision point: TASKS_START task"] + #[inline(always)] + pub fn plen(&self) -> PLEN_R { + PLEN_R::new(((self.bits >> 24) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:3 - Length on air of LENGTH field in number of bits."] + #[inline(always)] + pub fn lflen(&mut self) -> LFLEN_W { + LFLEN_W { w: self } + } + #[doc = "Bit 8 - Length on air of S0 field in number of bytes."] + #[inline(always)] + pub fn s0len(&mut self) -> S0LEN_W { + S0LEN_W { w: self } + } + #[doc = "Bits 16:19 - Length on air of S1 field in number of bits."] + #[inline(always)] + pub fn s1len(&mut self) -> S1LEN_W { + S1LEN_W { w: self } + } + #[doc = "Bit 20 - Include or exclude S1 field in RAM"] + #[inline(always)] + pub fn s1incl(&mut self) -> S1INCL_W { + S1INCL_W { w: self } + } + #[doc = "Bit 24 - Length of preamble on air. Decision point: TASKS_START task"] + #[inline(always)] + pub fn plen(&mut self) -> PLEN_W { + PLEN_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Packet configuration register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pcnf0](index.html) module"] +pub struct PCNF0_SPEC; +impl crate::RegisterSpec for PCNF0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pcnf0::R](R) reader structure"] +impl crate::Readable for PCNF0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pcnf0::W](W) writer structure"] +impl crate::Writable for PCNF0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PCNF0 to value 0"] +impl crate::Resettable for PCNF0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/pcnf1.rs b/src/radio/pcnf1.rs new file mode 100644 index 0000000..a1f3b02 --- /dev/null +++ b/src/radio/pcnf1.rs @@ -0,0 +1,360 @@ +#[doc = "Register `PCNF1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PCNF1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `MAXLEN` reader - Maximum length of packet payload. If the packet payload is larger than MAXLEN, the radio will truncate the payload to MAXLEN."] +pub struct MAXLEN_R(crate::FieldReader); +impl MAXLEN_R { + pub(crate) fn new(bits: u8) -> Self { + MAXLEN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MAXLEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MAXLEN` writer - Maximum length of packet payload. If the packet payload is larger than MAXLEN, the radio will truncate the payload to MAXLEN."] +pub struct MAXLEN_W<'a> { + w: &'a mut W, +} +impl<'a> MAXLEN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +#[doc = "Field `STATLEN` reader - Static length in number of bytes"] +pub struct STATLEN_R(crate::FieldReader); +impl STATLEN_R { + pub(crate) fn new(bits: u8) -> Self { + STATLEN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for STATLEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STATLEN` writer - Static length in number of bytes"] +pub struct STATLEN_W<'a> { + w: &'a mut W, +} +impl<'a> STATLEN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); + self.w + } +} +#[doc = "Field `BALEN` reader - Base address length in number of bytes"] +pub struct BALEN_R(crate::FieldReader); +impl BALEN_R { + pub(crate) fn new(bits: u8) -> Self { + BALEN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for BALEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BALEN` writer - Base address length in number of bytes"] +pub struct BALEN_W<'a> { + w: &'a mut W, +} +impl<'a> BALEN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x07 << 16)) | ((value as u32 & 0x07) << 16); + self.w + } +} +#[doc = "On air endianness of packet, this applies to the S0, LENGTH, S1 and the PAYLOAD fields.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDIAN_A { + #[doc = "0: Least Significant bit on air first"] + LITTLE = 0, + #[doc = "1: Most significant bit on air first"] + BIG = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDIAN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDIAN` reader - On air endianness of packet, this applies to the S0, LENGTH, S1 and the PAYLOAD fields."] +pub struct ENDIAN_R(crate::FieldReader); +impl ENDIAN_R { + pub(crate) fn new(bits: bool) -> Self { + ENDIAN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDIAN_A { + match self.bits { + false => ENDIAN_A::LITTLE, + true => ENDIAN_A::BIG, + } + } + #[doc = "Checks if the value of the field is `LITTLE`"] + #[inline(always)] + pub fn is_little(&self) -> bool { + **self == ENDIAN_A::LITTLE + } + #[doc = "Checks if the value of the field is `BIG`"] + #[inline(always)] + pub fn is_big(&self) -> bool { + **self == ENDIAN_A::BIG + } +} +impl core::ops::Deref for ENDIAN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENDIAN` writer - On air endianness of packet, this applies to the S0, LENGTH, S1 and the PAYLOAD fields."] +pub struct ENDIAN_W<'a> { + w: &'a mut W, +} +impl<'a> ENDIAN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDIAN_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Least Significant bit on air first"] + #[inline(always)] + pub fn little(self) -> &'a mut W { + self.variant(ENDIAN_A::LITTLE) + } + #[doc = "Most significant bit on air first"] + #[inline(always)] + pub fn big(self) -> &'a mut W { + self.variant(ENDIAN_A::BIG) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +#[doc = "Enable or disable packet whitening\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum WHITEEN_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: WHITEEN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `WHITEEN` reader - Enable or disable packet whitening"] +pub struct WHITEEN_R(crate::FieldReader); +impl WHITEEN_R { + pub(crate) fn new(bits: bool) -> Self { + WHITEEN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> WHITEEN_A { + match self.bits { + false => WHITEEN_A::DISABLED, + true => WHITEEN_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == WHITEEN_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == WHITEEN_A::ENABLED + } +} +impl core::ops::Deref for WHITEEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `WHITEEN` writer - Enable or disable packet whitening"] +pub struct WHITEEN_W<'a> { + w: &'a mut W, +} +impl<'a> WHITEEN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: WHITEEN_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(WHITEEN_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(WHITEEN_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - Maximum length of packet payload. If the packet payload is larger than MAXLEN, the radio will truncate the payload to MAXLEN."] + #[inline(always)] + pub fn maxlen(&self) -> MAXLEN_R { + MAXLEN_R::new((self.bits & 0xff) as u8) + } + #[doc = "Bits 8:15 - Static length in number of bytes"] + #[inline(always)] + pub fn statlen(&self) -> STATLEN_R { + STATLEN_R::new(((self.bits >> 8) & 0xff) as u8) + } + #[doc = "Bits 16:18 - Base address length in number of bytes"] + #[inline(always)] + pub fn balen(&self) -> BALEN_R { + BALEN_R::new(((self.bits >> 16) & 0x07) as u8) + } + #[doc = "Bit 24 - On air endianness of packet, this applies to the S0, LENGTH, S1 and the PAYLOAD fields."] + #[inline(always)] + pub fn endian(&self) -> ENDIAN_R { + ENDIAN_R::new(((self.bits >> 24) & 0x01) != 0) + } + #[doc = "Bit 25 - Enable or disable packet whitening"] + #[inline(always)] + pub fn whiteen(&self) -> WHITEEN_R { + WHITEEN_R::new(((self.bits >> 25) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:7 - Maximum length of packet payload. If the packet payload is larger than MAXLEN, the radio will truncate the payload to MAXLEN."] + #[inline(always)] + pub fn maxlen(&mut self) -> MAXLEN_W { + MAXLEN_W { w: self } + } + #[doc = "Bits 8:15 - Static length in number of bytes"] + #[inline(always)] + pub fn statlen(&mut self) -> STATLEN_W { + STATLEN_W { w: self } + } + #[doc = "Bits 16:18 - Base address length in number of bytes"] + #[inline(always)] + pub fn balen(&mut self) -> BALEN_W { + BALEN_W { w: self } + } + #[doc = "Bit 24 - On air endianness of packet, this applies to the S0, LENGTH, S1 and the PAYLOAD fields."] + #[inline(always)] + pub fn endian(&mut self) -> ENDIAN_W { + ENDIAN_W { w: self } + } + #[doc = "Bit 25 - Enable or disable packet whitening"] + #[inline(always)] + pub fn whiteen(&mut self) -> WHITEEN_W { + WHITEEN_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Packet configuration register 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pcnf1](index.html) module"] +pub struct PCNF1_SPEC; +impl crate::RegisterSpec for PCNF1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pcnf1::R](R) reader structure"] +impl crate::Readable for PCNF1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pcnf1::W](W) writer structure"] +impl crate::Writable for PCNF1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PCNF1 to value 0"] +impl crate::Resettable for PCNF1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/power.rs b/src/radio/power.rs new file mode 100644 index 0000000..818be1f --- /dev/null +++ b/src/radio/power.rs @@ -0,0 +1,159 @@ +#[doc = "Register `POWER` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `POWER` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Peripheral power control. The peripheral and its registers will be reset to its initial state by switching the peripheral off and then back on again.\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum POWER_A { + #[doc = "0: Peripheral is powered off"] + DISABLED = 0, + #[doc = "1: Peripheral is powered on"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: POWER_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `POWER` reader - Peripheral power control. The peripheral and its registers will be reset to its initial state by switching the peripheral off and then back on again."] +pub struct POWER_R(crate::FieldReader); +impl POWER_R { + pub(crate) fn new(bits: bool) -> Self { + POWER_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> POWER_A { + match self.bits { + false => POWER_A::DISABLED, + true => POWER_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == POWER_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == POWER_A::ENABLED + } +} +impl core::ops::Deref for POWER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `POWER` writer - Peripheral power control. The peripheral and its registers will be reset to its initial state by switching the peripheral off and then back on again."] +pub struct POWER_W<'a> { + w: &'a mut W, +} +impl<'a> POWER_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: POWER_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Peripheral is powered off"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(POWER_A::DISABLED) + } + #[doc = "Peripheral is powered on"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(POWER_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Peripheral power control. The peripheral and its registers will be reset to its initial state by switching the peripheral off and then back on again."] + #[inline(always)] + pub fn power(&self) -> POWER_R { + POWER_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Peripheral power control. The peripheral and its registers will be reset to its initial state by switching the peripheral off and then back on again."] + #[inline(always)] + pub fn power(&mut self) -> POWER_W { + POWER_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Peripheral power control\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [power](index.html) module"] +pub struct POWER_SPEC; +impl crate::RegisterSpec for POWER_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [power::R](R) reader structure"] +impl crate::Readable for POWER_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [power::W](W) writer structure"] +impl crate::Writable for POWER_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets POWER to value 0x01"] +impl crate::Resettable for POWER_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x01 + } +} diff --git a/src/radio/prefix0.rs b/src/radio/prefix0.rs new file mode 100644 index 0000000..ab9cd58 --- /dev/null +++ b/src/radio/prefix0.rs @@ -0,0 +1,210 @@ +#[doc = "Register `PREFIX0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PREFIX0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `AP0` reader - Address prefix 0."] +pub struct AP0_R(crate::FieldReader); +impl AP0_R { + pub(crate) fn new(bits: u8) -> Self { + AP0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AP0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AP0` writer - Address prefix 0."] +pub struct AP0_W<'a> { + w: &'a mut W, +} +impl<'a> AP0_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +#[doc = "Field `AP1` reader - Address prefix 1."] +pub struct AP1_R(crate::FieldReader); +impl AP1_R { + pub(crate) fn new(bits: u8) -> Self { + AP1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AP1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AP1` writer - Address prefix 1."] +pub struct AP1_W<'a> { + w: &'a mut W, +} +impl<'a> AP1_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); + self.w + } +} +#[doc = "Field `AP2` reader - Address prefix 2."] +pub struct AP2_R(crate::FieldReader); +impl AP2_R { + pub(crate) fn new(bits: u8) -> Self { + AP2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AP2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AP2` writer - Address prefix 2."] +pub struct AP2_W<'a> { + w: &'a mut W, +} +impl<'a> AP2_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); + self.w + } +} +#[doc = "Field `AP3` reader - Address prefix 3."] +pub struct AP3_R(crate::FieldReader); +impl AP3_R { + pub(crate) fn new(bits: u8) -> Self { + AP3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AP3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AP3` writer - Address prefix 3."] +pub struct AP3_W<'a> { + w: &'a mut W, +} +impl<'a> AP3_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - Address prefix 0."] + #[inline(always)] + pub fn ap0(&self) -> AP0_R { + AP0_R::new((self.bits & 0xff) as u8) + } + #[doc = "Bits 8:15 - Address prefix 1."] + #[inline(always)] + pub fn ap1(&self) -> AP1_R { + AP1_R::new(((self.bits >> 8) & 0xff) as u8) + } + #[doc = "Bits 16:23 - Address prefix 2."] + #[inline(always)] + pub fn ap2(&self) -> AP2_R { + AP2_R::new(((self.bits >> 16) & 0xff) as u8) + } + #[doc = "Bits 24:31 - Address prefix 3."] + #[inline(always)] + pub fn ap3(&self) -> AP3_R { + AP3_R::new(((self.bits >> 24) & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - Address prefix 0."] + #[inline(always)] + pub fn ap0(&mut self) -> AP0_W { + AP0_W { w: self } + } + #[doc = "Bits 8:15 - Address prefix 1."] + #[inline(always)] + pub fn ap1(&mut self) -> AP1_W { + AP1_W { w: self } + } + #[doc = "Bits 16:23 - Address prefix 2."] + #[inline(always)] + pub fn ap2(&mut self) -> AP2_W { + AP2_W { w: self } + } + #[doc = "Bits 24:31 - Address prefix 3."] + #[inline(always)] + pub fn ap3(&mut self) -> AP3_W { + AP3_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Prefixes bytes for logical addresses 0-3\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prefix0](index.html) module"] +pub struct PREFIX0_SPEC; +impl crate::RegisterSpec for PREFIX0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [prefix0::R](R) reader structure"] +impl crate::Readable for PREFIX0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [prefix0::W](W) writer structure"] +impl crate::Writable for PREFIX0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PREFIX0 to value 0"] +impl crate::Resettable for PREFIX0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/prefix1.rs b/src/radio/prefix1.rs new file mode 100644 index 0000000..3fc636f --- /dev/null +++ b/src/radio/prefix1.rs @@ -0,0 +1,210 @@ +#[doc = "Register `PREFIX1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PREFIX1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `AP4` reader - Address prefix 4."] +pub struct AP4_R(crate::FieldReader); +impl AP4_R { + pub(crate) fn new(bits: u8) -> Self { + AP4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AP4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AP4` writer - Address prefix 4."] +pub struct AP4_W<'a> { + w: &'a mut W, +} +impl<'a> AP4_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +#[doc = "Field `AP5` reader - Address prefix 5."] +pub struct AP5_R(crate::FieldReader); +impl AP5_R { + pub(crate) fn new(bits: u8) -> Self { + AP5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AP5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AP5` writer - Address prefix 5."] +pub struct AP5_W<'a> { + w: &'a mut W, +} +impl<'a> AP5_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0xff << 8)) | ((value as u32 & 0xff) << 8); + self.w + } +} +#[doc = "Field `AP6` reader - Address prefix 6."] +pub struct AP6_R(crate::FieldReader); +impl AP6_R { + pub(crate) fn new(bits: u8) -> Self { + AP6_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AP6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AP6` writer - Address prefix 6."] +pub struct AP6_W<'a> { + w: &'a mut W, +} +impl<'a> AP6_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0xff << 16)) | ((value as u32 & 0xff) << 16); + self.w + } +} +#[doc = "Field `AP7` reader - Address prefix 7."] +pub struct AP7_R(crate::FieldReader); +impl AP7_R { + pub(crate) fn new(bits: u8) -> Self { + AP7_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AP7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `AP7` writer - Address prefix 7."] +pub struct AP7_W<'a> { + w: &'a mut W, +} +impl<'a> AP7_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0xff << 24)) | ((value as u32 & 0xff) << 24); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - Address prefix 4."] + #[inline(always)] + pub fn ap4(&self) -> AP4_R { + AP4_R::new((self.bits & 0xff) as u8) + } + #[doc = "Bits 8:15 - Address prefix 5."] + #[inline(always)] + pub fn ap5(&self) -> AP5_R { + AP5_R::new(((self.bits >> 8) & 0xff) as u8) + } + #[doc = "Bits 16:23 - Address prefix 6."] + #[inline(always)] + pub fn ap6(&self) -> AP6_R { + AP6_R::new(((self.bits >> 16) & 0xff) as u8) + } + #[doc = "Bits 24:31 - Address prefix 7."] + #[inline(always)] + pub fn ap7(&self) -> AP7_R { + AP7_R::new(((self.bits >> 24) & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - Address prefix 4."] + #[inline(always)] + pub fn ap4(&mut self) -> AP4_W { + AP4_W { w: self } + } + #[doc = "Bits 8:15 - Address prefix 5."] + #[inline(always)] + pub fn ap5(&mut self) -> AP5_W { + AP5_W { w: self } + } + #[doc = "Bits 16:23 - Address prefix 6."] + #[inline(always)] + pub fn ap6(&mut self) -> AP6_W { + AP6_W { w: self } + } + #[doc = "Bits 24:31 - Address prefix 7."] + #[inline(always)] + pub fn ap7(&mut self) -> AP7_W { + AP7_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Prefixes bytes for logical addresses 4-7\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prefix1](index.html) module"] +pub struct PREFIX1_SPEC; +impl crate::RegisterSpec for PREFIX1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [prefix1::R](R) reader structure"] +impl crate::Readable for PREFIX1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [prefix1::W](W) writer structure"] +impl crate::Writable for PREFIX1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PREFIX1 to value 0"] +impl crate::Resettable for PREFIX1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/rssisample.rs b/src/radio/rssisample.rs new file mode 100644 index 0000000..dc558a6 --- /dev/null +++ b/src/radio/rssisample.rs @@ -0,0 +1,52 @@ +#[doc = "Register `RSSISAMPLE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `RSSISAMPLE` reader - RSSI sample"] +pub struct RSSISAMPLE_R(crate::FieldReader); +impl RSSISAMPLE_R { + pub(crate) fn new(bits: u8) -> Self { + RSSISAMPLE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RSSISAMPLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:6 - RSSI sample"] + #[inline(always)] + pub fn rssisample(&self) -> RSSISAMPLE_R { + RSSISAMPLE_R::new((self.bits & 0x7f) as u8) + } +} +#[doc = "RSSI sample\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 [rssisample](index.html) module"] +pub struct RSSISAMPLE_SPEC; +impl crate::RegisterSpec for RSSISAMPLE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rssisample::R](R) reader structure"] +impl crate::Readable for RSSISAMPLE_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets RSSISAMPLE to value 0"] +impl crate::Resettable for RSSISAMPLE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/rxaddresses.rs b/src/radio/rxaddresses.rs new file mode 100644 index 0000000..d4fcdf6 --- /dev/null +++ b/src/radio/rxaddresses.rs @@ -0,0 +1,810 @@ +#[doc = "Register `RXADDRESSES` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `RXADDRESSES` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable reception on logical address 0.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ADDR0_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ADDR0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ADDR0` reader - Enable or disable reception on logical address 0."] +pub struct ADDR0_R(crate::FieldReader); +impl ADDR0_R { + pub(crate) fn new(bits: bool) -> Self { + ADDR0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ADDR0_A { + match self.bits { + false => ADDR0_A::DISABLED, + true => ADDR0_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ADDR0_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ADDR0_A::ENABLED + } +} +impl core::ops::Deref for ADDR0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ADDR0` writer - Enable or disable reception on logical address 0."] +pub struct ADDR0_W<'a> { + w: &'a mut W, +} +impl<'a> ADDR0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ADDR0_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ADDR0_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ADDR0_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Enable or disable reception on logical address 1.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ADDR1_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ADDR1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ADDR1` reader - Enable or disable reception on logical address 1."] +pub struct ADDR1_R(crate::FieldReader); +impl ADDR1_R { + pub(crate) fn new(bits: bool) -> Self { + ADDR1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ADDR1_A { + match self.bits { + false => ADDR1_A::DISABLED, + true => ADDR1_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ADDR1_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ADDR1_A::ENABLED + } +} +impl core::ops::Deref for ADDR1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ADDR1` writer - Enable or disable reception on logical address 1."] +pub struct ADDR1_W<'a> { + w: &'a mut W, +} +impl<'a> ADDR1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ADDR1_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ADDR1_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ADDR1_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Enable or disable reception on logical address 2.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ADDR2_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ADDR2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ADDR2` reader - Enable or disable reception on logical address 2."] +pub struct ADDR2_R(crate::FieldReader); +impl ADDR2_R { + pub(crate) fn new(bits: bool) -> Self { + ADDR2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ADDR2_A { + match self.bits { + false => ADDR2_A::DISABLED, + true => ADDR2_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ADDR2_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ADDR2_A::ENABLED + } +} +impl core::ops::Deref for ADDR2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ADDR2` writer - Enable or disable reception on logical address 2."] +pub struct ADDR2_W<'a> { + w: &'a mut W, +} +impl<'a> ADDR2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ADDR2_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ADDR2_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ADDR2_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Enable or disable reception on logical address 3.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ADDR3_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ADDR3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ADDR3` reader - Enable or disable reception on logical address 3."] +pub struct ADDR3_R(crate::FieldReader); +impl ADDR3_R { + pub(crate) fn new(bits: bool) -> Self { + ADDR3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ADDR3_A { + match self.bits { + false => ADDR3_A::DISABLED, + true => ADDR3_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ADDR3_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ADDR3_A::ENABLED + } +} +impl core::ops::Deref for ADDR3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ADDR3` writer - Enable or disable reception on logical address 3."] +pub struct ADDR3_W<'a> { + w: &'a mut W, +} +impl<'a> ADDR3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ADDR3_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ADDR3_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ADDR3_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Enable or disable reception on logical address 4.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ADDR4_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ADDR4_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ADDR4` reader - Enable or disable reception on logical address 4."] +pub struct ADDR4_R(crate::FieldReader); +impl ADDR4_R { + pub(crate) fn new(bits: bool) -> Self { + ADDR4_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ADDR4_A { + match self.bits { + false => ADDR4_A::DISABLED, + true => ADDR4_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ADDR4_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ADDR4_A::ENABLED + } +} +impl core::ops::Deref for ADDR4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ADDR4` writer - Enable or disable reception on logical address 4."] +pub struct ADDR4_W<'a> { + w: &'a mut W, +} +impl<'a> ADDR4_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ADDR4_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ADDR4_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ADDR4_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Enable or disable reception on logical address 5.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ADDR5_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ADDR5_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ADDR5` reader - Enable or disable reception on logical address 5."] +pub struct ADDR5_R(crate::FieldReader); +impl ADDR5_R { + pub(crate) fn new(bits: bool) -> Self { + ADDR5_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ADDR5_A { + match self.bits { + false => ADDR5_A::DISABLED, + true => ADDR5_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ADDR5_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ADDR5_A::ENABLED + } +} +impl core::ops::Deref for ADDR5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ADDR5` writer - Enable or disable reception on logical address 5."] +pub struct ADDR5_W<'a> { + w: &'a mut W, +} +impl<'a> ADDR5_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ADDR5_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ADDR5_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ADDR5_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Enable or disable reception on logical address 6.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ADDR6_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ADDR6_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ADDR6` reader - Enable or disable reception on logical address 6."] +pub struct ADDR6_R(crate::FieldReader); +impl ADDR6_R { + pub(crate) fn new(bits: bool) -> Self { + ADDR6_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ADDR6_A { + match self.bits { + false => ADDR6_A::DISABLED, + true => ADDR6_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ADDR6_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ADDR6_A::ENABLED + } +} +impl core::ops::Deref for ADDR6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ADDR6` writer - Enable or disable reception on logical address 6."] +pub struct ADDR6_W<'a> { + w: &'a mut W, +} +impl<'a> ADDR6_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ADDR6_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ADDR6_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ADDR6_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Enable or disable reception on logical address 7.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ADDR7_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ADDR7_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ADDR7` reader - Enable or disable reception on logical address 7."] +pub struct ADDR7_R(crate::FieldReader); +impl ADDR7_R { + pub(crate) fn new(bits: bool) -> Self { + ADDR7_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ADDR7_A { + match self.bits { + false => ADDR7_A::DISABLED, + true => ADDR7_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ADDR7_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ADDR7_A::ENABLED + } +} +impl core::ops::Deref for ADDR7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ADDR7` writer - Enable or disable reception on logical address 7."] +pub struct ADDR7_W<'a> { + w: &'a mut W, +} +impl<'a> ADDR7_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ADDR7_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ADDR7_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ADDR7_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable or disable reception on logical address 0."] + #[inline(always)] + pub fn addr0(&self) -> ADDR0_R { + ADDR0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Enable or disable reception on logical address 1."] + #[inline(always)] + pub fn addr1(&self) -> ADDR1_R { + ADDR1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Enable or disable reception on logical address 2."] + #[inline(always)] + pub fn addr2(&self) -> ADDR2_R { + ADDR2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Enable or disable reception on logical address 3."] + #[inline(always)] + pub fn addr3(&self) -> ADDR3_R { + ADDR3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Enable or disable reception on logical address 4."] + #[inline(always)] + pub fn addr4(&self) -> ADDR4_R { + ADDR4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Enable or disable reception on logical address 5."] + #[inline(always)] + pub fn addr5(&self) -> ADDR5_R { + ADDR5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Enable or disable reception on logical address 6."] + #[inline(always)] + pub fn addr6(&self) -> ADDR6_R { + ADDR6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Enable or disable reception on logical address 7."] + #[inline(always)] + pub fn addr7(&self) -> ADDR7_R { + ADDR7_R::new(((self.bits >> 7) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Enable or disable reception on logical address 0."] + #[inline(always)] + pub fn addr0(&mut self) -> ADDR0_W { + ADDR0_W { w: self } + } + #[doc = "Bit 1 - Enable or disable reception on logical address 1."] + #[inline(always)] + pub fn addr1(&mut self) -> ADDR1_W { + ADDR1_W { w: self } + } + #[doc = "Bit 2 - Enable or disable reception on logical address 2."] + #[inline(always)] + pub fn addr2(&mut self) -> ADDR2_W { + ADDR2_W { w: self } + } + #[doc = "Bit 3 - Enable or disable reception on logical address 3."] + #[inline(always)] + pub fn addr3(&mut self) -> ADDR3_W { + ADDR3_W { w: self } + } + #[doc = "Bit 4 - Enable or disable reception on logical address 4."] + #[inline(always)] + pub fn addr4(&mut self) -> ADDR4_W { + ADDR4_W { w: self } + } + #[doc = "Bit 5 - Enable or disable reception on logical address 5."] + #[inline(always)] + pub fn addr5(&mut self) -> ADDR5_W { + ADDR5_W { w: self } + } + #[doc = "Bit 6 - Enable or disable reception on logical address 6."] + #[inline(always)] + pub fn addr6(&mut self) -> ADDR6_W { + ADDR6_W { w: self } + } + #[doc = "Bit 7 - Enable or disable reception on logical address 7."] + #[inline(always)] + pub fn addr7(&mut self) -> ADDR7_W { + ADDR7_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Receive address select\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rxaddresses](index.html) module"] +pub struct RXADDRESSES_SPEC; +impl crate::RegisterSpec for RXADDRESSES_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rxaddresses::R](R) reader structure"] +impl crate::Readable for RXADDRESSES_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [rxaddresses::W](W) writer structure"] +impl crate::Writable for RXADDRESSES_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets RXADDRESSES to value 0"] +impl crate::Resettable for RXADDRESSES_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/rxcrc.rs b/src/radio/rxcrc.rs new file mode 100644 index 0000000..05e1e31 --- /dev/null +++ b/src/radio/rxcrc.rs @@ -0,0 +1,52 @@ +#[doc = "Register `RXCRC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `RXCRC` reader - CRC field of previously received packet"] +pub struct RXCRC_R(crate::FieldReader); +impl RXCRC_R { + pub(crate) fn new(bits: u32) -> Self { + RXCRC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RXCRC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:23 - CRC field of previously received packet"] + #[inline(always)] + pub fn rxcrc(&self) -> RXCRC_R { + RXCRC_R::new((self.bits & 0x00ff_ffff) as u32) + } +} +#[doc = "CRC field of previously received packet\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 [rxcrc](index.html) module"] +pub struct RXCRC_SPEC; +impl crate::RegisterSpec for RXCRC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rxcrc::R](R) reader structure"] +impl crate::Readable for RXCRC_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets RXCRC to value 0"] +impl crate::Resettable for RXCRC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/rxmatch.rs b/src/radio/rxmatch.rs new file mode 100644 index 0000000..bc8e7fc --- /dev/null +++ b/src/radio/rxmatch.rs @@ -0,0 +1,52 @@ +#[doc = "Register `RXMATCH` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `RXMATCH` reader - Received address"] +pub struct RXMATCH_R(crate::FieldReader); +impl RXMATCH_R { + pub(crate) fn new(bits: u8) -> Self { + RXMATCH_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RXMATCH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:2 - Received address"] + #[inline(always)] + pub fn rxmatch(&self) -> RXMATCH_R { + RXMATCH_R::new((self.bits & 0x07) as u8) + } +} +#[doc = "Received address\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 [rxmatch](index.html) module"] +pub struct RXMATCH_SPEC; +impl crate::RegisterSpec for RXMATCH_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rxmatch::R](R) reader structure"] +impl crate::Readable for RXMATCH_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets RXMATCH to value 0"] +impl crate::Resettable for RXMATCH_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/shorts.rs b/src/radio/shorts.rs new file mode 100644 index 0000000..c0a20dd --- /dev/null +++ b/src/radio/shorts.rs @@ -0,0 +1,810 @@ +#[doc = "Register `SHORTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SHORTS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Shortcut between READY event and START task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_START_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_START_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY_START` reader - Shortcut between READY event and START task"] +pub struct READY_START_R(crate::FieldReader); +impl READY_START_R { + pub(crate) fn new(bits: bool) -> Self { + READY_START_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> READY_START_A { + match self.bits { + false => READY_START_A::DISABLED, + true => READY_START_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == READY_START_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == READY_START_A::ENABLED + } +} +impl core::ops::Deref for READY_START_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `READY_START` writer - Shortcut between READY event and START task"] +pub struct READY_START_W<'a> { + w: &'a mut W, +} +impl<'a> READY_START_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: READY_START_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(READY_START_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(READY_START_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Shortcut between END event and DISABLE task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_DISABLE_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_DISABLE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END_DISABLE` reader - Shortcut between END event and DISABLE task"] +pub struct END_DISABLE_R(crate::FieldReader); +impl END_DISABLE_R { + pub(crate) fn new(bits: bool) -> Self { + END_DISABLE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> END_DISABLE_A { + match self.bits { + false => END_DISABLE_A::DISABLED, + true => END_DISABLE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == END_DISABLE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == END_DISABLE_A::ENABLED + } +} +impl core::ops::Deref for END_DISABLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `END_DISABLE` writer - Shortcut between END event and DISABLE task"] +pub struct END_DISABLE_W<'a> { + w: &'a mut W, +} +impl<'a> END_DISABLE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: END_DISABLE_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(END_DISABLE_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(END_DISABLE_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Shortcut between DISABLED event and TXEN task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DISABLED_TXEN_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DISABLED_TXEN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DISABLED_TXEN` reader - Shortcut between DISABLED event and TXEN task"] +pub struct DISABLED_TXEN_R(crate::FieldReader); +impl DISABLED_TXEN_R { + pub(crate) fn new(bits: bool) -> Self { + DISABLED_TXEN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DISABLED_TXEN_A { + match self.bits { + false => DISABLED_TXEN_A::DISABLED, + true => DISABLED_TXEN_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DISABLED_TXEN_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DISABLED_TXEN_A::ENABLED + } +} +impl core::ops::Deref for DISABLED_TXEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DISABLED_TXEN` writer - Shortcut between DISABLED event and TXEN task"] +pub struct DISABLED_TXEN_W<'a> { + w: &'a mut W, +} +impl<'a> DISABLED_TXEN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DISABLED_TXEN_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(DISABLED_TXEN_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(DISABLED_TXEN_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Shortcut between DISABLED event and RXEN task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DISABLED_RXEN_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DISABLED_RXEN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DISABLED_RXEN` reader - Shortcut between DISABLED event and RXEN task"] +pub struct DISABLED_RXEN_R(crate::FieldReader); +impl DISABLED_RXEN_R { + pub(crate) fn new(bits: bool) -> Self { + DISABLED_RXEN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DISABLED_RXEN_A { + match self.bits { + false => DISABLED_RXEN_A::DISABLED, + true => DISABLED_RXEN_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DISABLED_RXEN_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DISABLED_RXEN_A::ENABLED + } +} +impl core::ops::Deref for DISABLED_RXEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DISABLED_RXEN` writer - Shortcut between DISABLED event and RXEN task"] +pub struct DISABLED_RXEN_W<'a> { + w: &'a mut W, +} +impl<'a> DISABLED_RXEN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DISABLED_RXEN_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(DISABLED_RXEN_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(DISABLED_RXEN_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Shortcut between ADDRESS event and RSSISTART task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ADDRESS_RSSISTART_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ADDRESS_RSSISTART_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ADDRESS_RSSISTART` reader - Shortcut between ADDRESS event and RSSISTART task"] +pub struct ADDRESS_RSSISTART_R(crate::FieldReader); +impl ADDRESS_RSSISTART_R { + pub(crate) fn new(bits: bool) -> Self { + ADDRESS_RSSISTART_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ADDRESS_RSSISTART_A { + match self.bits { + false => ADDRESS_RSSISTART_A::DISABLED, + true => ADDRESS_RSSISTART_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ADDRESS_RSSISTART_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ADDRESS_RSSISTART_A::ENABLED + } +} +impl core::ops::Deref for ADDRESS_RSSISTART_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ADDRESS_RSSISTART` writer - Shortcut between ADDRESS event and RSSISTART task"] +pub struct ADDRESS_RSSISTART_W<'a> { + w: &'a mut W, +} +impl<'a> ADDRESS_RSSISTART_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ADDRESS_RSSISTART_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ADDRESS_RSSISTART_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ADDRESS_RSSISTART_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Shortcut between END event and START task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_START_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_START_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END_START` reader - Shortcut between END event and START task"] +pub struct END_START_R(crate::FieldReader); +impl END_START_R { + pub(crate) fn new(bits: bool) -> Self { + END_START_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> END_START_A { + match self.bits { + false => END_START_A::DISABLED, + true => END_START_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == END_START_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == END_START_A::ENABLED + } +} +impl core::ops::Deref for END_START_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `END_START` writer - Shortcut between END event and START task"] +pub struct END_START_W<'a> { + w: &'a mut W, +} +impl<'a> END_START_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: END_START_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(END_START_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(END_START_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Shortcut between ADDRESS event and BCSTART task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ADDRESS_BCSTART_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ADDRESS_BCSTART_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ADDRESS_BCSTART` reader - Shortcut between ADDRESS event and BCSTART task"] +pub struct ADDRESS_BCSTART_R(crate::FieldReader); +impl ADDRESS_BCSTART_R { + pub(crate) fn new(bits: bool) -> Self { + ADDRESS_BCSTART_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ADDRESS_BCSTART_A { + match self.bits { + false => ADDRESS_BCSTART_A::DISABLED, + true => ADDRESS_BCSTART_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ADDRESS_BCSTART_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ADDRESS_BCSTART_A::ENABLED + } +} +impl core::ops::Deref for ADDRESS_BCSTART_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ADDRESS_BCSTART` writer - Shortcut between ADDRESS event and BCSTART task"] +pub struct ADDRESS_BCSTART_W<'a> { + w: &'a mut W, +} +impl<'a> ADDRESS_BCSTART_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ADDRESS_BCSTART_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ADDRESS_BCSTART_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ADDRESS_BCSTART_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Shortcut between DISABLED event and RSSISTOP task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DISABLED_RSSISTOP_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DISABLED_RSSISTOP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DISABLED_RSSISTOP` reader - Shortcut between DISABLED event and RSSISTOP task"] +pub struct DISABLED_RSSISTOP_R(crate::FieldReader); +impl DISABLED_RSSISTOP_R { + pub(crate) fn new(bits: bool) -> Self { + DISABLED_RSSISTOP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DISABLED_RSSISTOP_A { + match self.bits { + false => DISABLED_RSSISTOP_A::DISABLED, + true => DISABLED_RSSISTOP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DISABLED_RSSISTOP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DISABLED_RSSISTOP_A::ENABLED + } +} +impl core::ops::Deref for DISABLED_RSSISTOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DISABLED_RSSISTOP` writer - Shortcut between DISABLED event and RSSISTOP task"] +pub struct DISABLED_RSSISTOP_W<'a> { + w: &'a mut W, +} +impl<'a> DISABLED_RSSISTOP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DISABLED_RSSISTOP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(DISABLED_RSSISTOP_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(DISABLED_RSSISTOP_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +impl R { + #[doc = "Bit 0 - Shortcut between READY event and START task"] + #[inline(always)] + pub fn ready_start(&self) -> READY_START_R { + READY_START_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Shortcut between END event and DISABLE task"] + #[inline(always)] + pub fn end_disable(&self) -> END_DISABLE_R { + END_DISABLE_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Shortcut between DISABLED event and TXEN task"] + #[inline(always)] + pub fn disabled_txen(&self) -> DISABLED_TXEN_R { + DISABLED_TXEN_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Shortcut between DISABLED event and RXEN task"] + #[inline(always)] + pub fn disabled_rxen(&self) -> DISABLED_RXEN_R { + DISABLED_RXEN_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Shortcut between ADDRESS event and RSSISTART task"] + #[inline(always)] + pub fn address_rssistart(&self) -> ADDRESS_RSSISTART_R { + ADDRESS_RSSISTART_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Shortcut between END event and START task"] + #[inline(always)] + pub fn end_start(&self) -> END_START_R { + END_START_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Shortcut between ADDRESS event and BCSTART task"] + #[inline(always)] + pub fn address_bcstart(&self) -> ADDRESS_BCSTART_R { + ADDRESS_BCSTART_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 8 - Shortcut between DISABLED event and RSSISTOP task"] + #[inline(always)] + pub fn disabled_rssistop(&self) -> DISABLED_RSSISTOP_R { + DISABLED_RSSISTOP_R::new(((self.bits >> 8) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Shortcut between READY event and START task"] + #[inline(always)] + pub fn ready_start(&mut self) -> READY_START_W { + READY_START_W { w: self } + } + #[doc = "Bit 1 - Shortcut between END event and DISABLE task"] + #[inline(always)] + pub fn end_disable(&mut self) -> END_DISABLE_W { + END_DISABLE_W { w: self } + } + #[doc = "Bit 2 - Shortcut between DISABLED event and TXEN task"] + #[inline(always)] + pub fn disabled_txen(&mut self) -> DISABLED_TXEN_W { + DISABLED_TXEN_W { w: self } + } + #[doc = "Bit 3 - Shortcut between DISABLED event and RXEN task"] + #[inline(always)] + pub fn disabled_rxen(&mut self) -> DISABLED_RXEN_W { + DISABLED_RXEN_W { w: self } + } + #[doc = "Bit 4 - Shortcut between ADDRESS event and RSSISTART task"] + #[inline(always)] + pub fn address_rssistart(&mut self) -> ADDRESS_RSSISTART_W { + ADDRESS_RSSISTART_W { w: self } + } + #[doc = "Bit 5 - Shortcut between END event and START task"] + #[inline(always)] + pub fn end_start(&mut self) -> END_START_W { + END_START_W { w: self } + } + #[doc = "Bit 6 - Shortcut between ADDRESS event and BCSTART task"] + #[inline(always)] + pub fn address_bcstart(&mut self) -> ADDRESS_BCSTART_W { + ADDRESS_BCSTART_W { w: self } + } + #[doc = "Bit 8 - Shortcut between DISABLED event and RSSISTOP task"] + #[inline(always)] + pub fn disabled_rssistop(&mut self) -> DISABLED_RSSISTOP_W { + DISABLED_RSSISTOP_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Shortcut register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [shorts](index.html) module"] +pub struct SHORTS_SPEC; +impl crate::RegisterSpec for SHORTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [shorts::R](R) reader structure"] +impl crate::Readable for SHORTS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [shorts::W](W) writer structure"] +impl crate::Writable for SHORTS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SHORTS to value 0"] +impl crate::Resettable for SHORTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/state.rs b/src/radio/state.rs new file mode 100644 index 0000000..2d30ddf --- /dev/null +++ b/src/radio/state.rs @@ -0,0 +1,142 @@ +#[doc = "Register `STATE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Current radio state\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum STATE_A { + #[doc = "0: RADIO is in the Disabled state"] + DISABLED = 0, + #[doc = "1: RADIO is in the RXRU state"] + RXRU = 1, + #[doc = "2: RADIO is in the RXIDLE state"] + RXIDLE = 2, + #[doc = "3: RADIO is in the RX state"] + RX = 3, + #[doc = "4: RADIO is in the RXDISABLED state"] + RXDISABLE = 4, + #[doc = "9: RADIO is in the TXRU state"] + TXRU = 9, + #[doc = "10: RADIO is in the TXIDLE state"] + TXIDLE = 10, + #[doc = "11: RADIO is in the TX state"] + TX = 11, + #[doc = "12: RADIO is in the TXDISABLED state"] + TXDISABLE = 12, +} +impl From for u8 { + #[inline(always)] + fn from(variant: STATE_A) -> Self { + variant as _ + } +} +#[doc = "Field `STATE` reader - Current radio state"] +pub struct STATE_R(crate::FieldReader); +impl STATE_R { + pub(crate) fn new(bits: u8) -> Self { + STATE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(STATE_A::DISABLED), + 1 => Some(STATE_A::RXRU), + 2 => Some(STATE_A::RXIDLE), + 3 => Some(STATE_A::RX), + 4 => Some(STATE_A::RXDISABLE), + 9 => Some(STATE_A::TXRU), + 10 => Some(STATE_A::TXIDLE), + 11 => Some(STATE_A::TX), + 12 => Some(STATE_A::TXDISABLE), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STATE_A::DISABLED + } + #[doc = "Checks if the value of the field is `RXRU`"] + #[inline(always)] + pub fn is_rx_ru(&self) -> bool { + **self == STATE_A::RXRU + } + #[doc = "Checks if the value of the field is `RXIDLE`"] + #[inline(always)] + pub fn is_rx_idle(&self) -> bool { + **self == STATE_A::RXIDLE + } + #[doc = "Checks if the value of the field is `RX`"] + #[inline(always)] + pub fn is_rx(&self) -> bool { + **self == STATE_A::RX + } + #[doc = "Checks if the value of the field is `RXDISABLE`"] + #[inline(always)] + pub fn is_rx_disable(&self) -> bool { + **self == STATE_A::RXDISABLE + } + #[doc = "Checks if the value of the field is `TXRU`"] + #[inline(always)] + pub fn is_tx_ru(&self) -> bool { + **self == STATE_A::TXRU + } + #[doc = "Checks if the value of the field is `TXIDLE`"] + #[inline(always)] + pub fn is_tx_idle(&self) -> bool { + **self == STATE_A::TXIDLE + } + #[doc = "Checks if the value of the field is `TX`"] + #[inline(always)] + pub fn is_tx(&self) -> bool { + **self == STATE_A::TX + } + #[doc = "Checks if the value of the field is `TXDISABLE`"] + #[inline(always)] + pub fn is_tx_disable(&self) -> bool { + **self == STATE_A::TXDISABLE + } +} +impl core::ops::Deref for STATE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:3 - Current radio state"] + #[inline(always)] + pub fn state(&self) -> STATE_R { + STATE_R::new((self.bits & 0x0f) as u8) + } +} +#[doc = "Current radio state\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 [state](index.html) module"] +pub struct STATE_SPEC; +impl crate::RegisterSpec for STATE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [state::R](R) reader structure"] +impl crate::Readable for STATE_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets STATE to value 0"] +impl crate::Resettable for STATE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/tasks_bcstart.rs b/src/radio/tasks_bcstart.rs new file mode 100644 index 0000000..671000e --- /dev/null +++ b/src/radio/tasks_bcstart.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_BCSTART` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start the bit counter\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_bcstart](index.html) module"] +pub struct TASKS_BCSTART_SPEC; +impl crate::RegisterSpec for TASKS_BCSTART_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_bcstart::W](W) writer structure"] +impl crate::Writable for TASKS_BCSTART_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_BCSTART to value 0"] +impl crate::Resettable for TASKS_BCSTART_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/tasks_bcstop.rs b/src/radio/tasks_bcstop.rs new file mode 100644 index 0000000..fdd35e5 --- /dev/null +++ b/src/radio/tasks_bcstop.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_BCSTOP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Stop the bit counter\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_bcstop](index.html) module"] +pub struct TASKS_BCSTOP_SPEC; +impl crate::RegisterSpec for TASKS_BCSTOP_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_bcstop::W](W) writer structure"] +impl crate::Writable for TASKS_BCSTOP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_BCSTOP to value 0"] +impl crate::Resettable for TASKS_BCSTOP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/tasks_disable.rs b/src/radio/tasks_disable.rs new file mode 100644 index 0000000..817dc00 --- /dev/null +++ b/src/radio/tasks_disable.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_DISABLE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable RADIO\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_disable](index.html) module"] +pub struct TASKS_DISABLE_SPEC; +impl crate::RegisterSpec for TASKS_DISABLE_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_disable::W](W) writer structure"] +impl crate::Writable for TASKS_DISABLE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_DISABLE to value 0"] +impl crate::Resettable for TASKS_DISABLE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/tasks_rssistart.rs b/src/radio/tasks_rssistart.rs new file mode 100644 index 0000000..39be9a9 --- /dev/null +++ b/src/radio/tasks_rssistart.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_RSSISTART` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start the RSSI and take one single sample of the receive signal strength.\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_rssistart](index.html) module"] +pub struct TASKS_RSSISTART_SPEC; +impl crate::RegisterSpec for TASKS_RSSISTART_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_rssistart::W](W) writer structure"] +impl crate::Writable for TASKS_RSSISTART_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_RSSISTART to value 0"] +impl crate::Resettable for TASKS_RSSISTART_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/tasks_rssistop.rs b/src/radio/tasks_rssistop.rs new file mode 100644 index 0000000..e3ef57e --- /dev/null +++ b/src/radio/tasks_rssistop.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_RSSISTOP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Stop the RSSI measurement\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_rssistop](index.html) module"] +pub struct TASKS_RSSISTOP_SPEC; +impl crate::RegisterSpec for TASKS_RSSISTOP_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_rssistop::W](W) writer structure"] +impl crate::Writable for TASKS_RSSISTOP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_RSSISTOP to value 0"] +impl crate::Resettable for TASKS_RSSISTOP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/tasks_rxen.rs b/src/radio/tasks_rxen.rs new file mode 100644 index 0000000..8bdbe12 --- /dev/null +++ b/src/radio/tasks_rxen.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_RXEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable RADIO in RX mode\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_rxen](index.html) module"] +pub struct TASKS_RXEN_SPEC; +impl crate::RegisterSpec for TASKS_RXEN_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_rxen::W](W) writer structure"] +impl crate::Writable for TASKS_RXEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_RXEN to value 0"] +impl crate::Resettable for TASKS_RXEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/tasks_start.rs b/src/radio/tasks_start.rs new file mode 100644 index 0000000..f58645c --- /dev/null +++ b/src/radio/tasks_start.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_START` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start RADIO\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_start](index.html) module"] +pub struct TASKS_START_SPEC; +impl crate::RegisterSpec for TASKS_START_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_start::W](W) writer structure"] +impl crate::Writable for TASKS_START_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_START to value 0"] +impl crate::Resettable for TASKS_START_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/tasks_stop.rs b/src/radio/tasks_stop.rs new file mode 100644 index 0000000..906fa02 --- /dev/null +++ b/src/radio/tasks_stop.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STOP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Stop RADIO\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_stop](index.html) module"] +pub struct TASKS_STOP_SPEC; +impl crate::RegisterSpec for TASKS_STOP_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_stop::W](W) writer structure"] +impl crate::Writable for TASKS_STOP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STOP to value 0"] +impl crate::Resettable for TASKS_STOP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/tasks_txen.rs b/src/radio/tasks_txen.rs new file mode 100644 index 0000000..18496b2 --- /dev/null +++ b/src/radio/tasks_txen.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_TXEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable RADIO in TX mode\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_txen](index.html) module"] +pub struct TASKS_TXEN_SPEC; +impl crate::RegisterSpec for TASKS_TXEN_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_txen::W](W) writer structure"] +impl crate::Writable for TASKS_TXEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_TXEN to value 0"] +impl crate::Resettable for TASKS_TXEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/tifs.rs b/src/radio/tifs.rs new file mode 100644 index 0000000..14607b2 --- /dev/null +++ b/src/radio/tifs.rs @@ -0,0 +1,102 @@ +#[doc = "Register `TIFS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `TIFS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `TIFS` reader - Inter Frame Spacing in us"] +pub struct TIFS_R(crate::FieldReader); +impl TIFS_R { + pub(crate) fn new(bits: u8) -> Self { + TIFS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TIFS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TIFS` writer - Inter Frame Spacing in us"] +pub struct TIFS_W<'a> { + w: &'a mut W, +} +impl<'a> TIFS_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - Inter Frame Spacing in us"] + #[inline(always)] + pub fn tifs(&self) -> TIFS_R { + TIFS_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - Inter Frame Spacing in us"] + #[inline(always)] + pub fn tifs(&mut self) -> TIFS_W { + TIFS_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Inter Frame Spacing in us\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tifs](index.html) module"] +pub struct TIFS_SPEC; +impl crate::RegisterSpec for TIFS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [tifs::R](R) reader structure"] +impl crate::Readable for TIFS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [tifs::W](W) writer structure"] +impl crate::Writable for TIFS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TIFS to value 0"] +impl crate::Resettable for TIFS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/txaddress.rs b/src/radio/txaddress.rs new file mode 100644 index 0000000..1ee6474 --- /dev/null +++ b/src/radio/txaddress.rs @@ -0,0 +1,102 @@ +#[doc = "Register `TXADDRESS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `TXADDRESS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `TXADDRESS` reader - Transmit address select"] +pub struct TXADDRESS_R(crate::FieldReader); +impl TXADDRESS_R { + pub(crate) fn new(bits: u8) -> Self { + TXADDRESS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TXADDRESS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TXADDRESS` writer - Transmit address select"] +pub struct TXADDRESS_W<'a> { + w: &'a mut W, +} +impl<'a> TXADDRESS_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); + self.w + } +} +impl R { + #[doc = "Bits 0:2 - Transmit address select"] + #[inline(always)] + pub fn txaddress(&self) -> TXADDRESS_R { + TXADDRESS_R::new((self.bits & 0x07) as u8) + } +} +impl W { + #[doc = "Bits 0:2 - Transmit address select"] + #[inline(always)] + pub fn txaddress(&mut self) -> TXADDRESS_W { + TXADDRESS_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Transmit address select\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [txaddress](index.html) module"] +pub struct TXADDRESS_SPEC; +impl crate::RegisterSpec for TXADDRESS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [txaddress::R](R) reader structure"] +impl crate::Readable for TXADDRESS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [txaddress::W](W) writer structure"] +impl crate::Writable for TXADDRESS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TXADDRESS to value 0"] +impl crate::Resettable for TXADDRESS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/txpower.rs b/src/radio/txpower.rs new file mode 100644 index 0000000..ef238a5 --- /dev/null +++ b/src/radio/txpower.rs @@ -0,0 +1,255 @@ +#[doc = "Register `TXPOWER` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `TXPOWER` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "RADIO output power.\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum TXPOWER_A { + #[doc = "4: +4 dBm"] + POS4DBM = 4, + #[doc = "3: +3 dBm"] + POS3DBM = 3, + #[doc = "0: 0 dBm"] + _0DBM = 0, + #[doc = "252: -4 dBm"] + NEG4DBM = 252, + #[doc = "248: -8 dBm"] + NEG8DBM = 248, + #[doc = "244: -12 dBm"] + NEG12DBM = 244, + #[doc = "240: -16 dBm"] + NEG16DBM = 240, + #[doc = "236: -20 dBm"] + NEG20DBM = 236, + #[doc = "255: Deprecated enumerator - -40 dBm"] + NEG30DBM = 255, + #[doc = "216: -40 dBm"] + NEG40DBM = 216, +} +impl From for u8 { + #[inline(always)] + fn from(variant: TXPOWER_A) -> Self { + variant as _ + } +} +#[doc = "Field `TXPOWER` reader - RADIO output power."] +pub struct TXPOWER_R(crate::FieldReader); +impl TXPOWER_R { + pub(crate) fn new(bits: u8) -> Self { + TXPOWER_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 4 => Some(TXPOWER_A::POS4DBM), + 3 => Some(TXPOWER_A::POS3DBM), + 0 => Some(TXPOWER_A::_0DBM), + 252 => Some(TXPOWER_A::NEG4DBM), + 248 => Some(TXPOWER_A::NEG8DBM), + 244 => Some(TXPOWER_A::NEG12DBM), + 240 => Some(TXPOWER_A::NEG16DBM), + 236 => Some(TXPOWER_A::NEG20DBM), + 255 => Some(TXPOWER_A::NEG30DBM), + 216 => Some(TXPOWER_A::NEG40DBM), + _ => None, + } + } + #[doc = "Checks if the value of the field is `POS4DBM`"] + #[inline(always)] + pub fn is_pos4d_bm(&self) -> bool { + **self == TXPOWER_A::POS4DBM + } + #[doc = "Checks if the value of the field is `POS3DBM`"] + #[inline(always)] + pub fn is_pos3d_bm(&self) -> bool { + **self == TXPOWER_A::POS3DBM + } + #[doc = "Checks if the value of the field is `_0DBM`"] + #[inline(always)] + pub fn is_0d_bm(&self) -> bool { + **self == TXPOWER_A::_0DBM + } + #[doc = "Checks if the value of the field is `NEG4DBM`"] + #[inline(always)] + pub fn is_neg4d_bm(&self) -> bool { + **self == TXPOWER_A::NEG4DBM + } + #[doc = "Checks if the value of the field is `NEG8DBM`"] + #[inline(always)] + pub fn is_neg8d_bm(&self) -> bool { + **self == TXPOWER_A::NEG8DBM + } + #[doc = "Checks if the value of the field is `NEG12DBM`"] + #[inline(always)] + pub fn is_neg12d_bm(&self) -> bool { + **self == TXPOWER_A::NEG12DBM + } + #[doc = "Checks if the value of the field is `NEG16DBM`"] + #[inline(always)] + pub fn is_neg16d_bm(&self) -> bool { + **self == TXPOWER_A::NEG16DBM + } + #[doc = "Checks if the value of the field is `NEG20DBM`"] + #[inline(always)] + pub fn is_neg20d_bm(&self) -> bool { + **self == TXPOWER_A::NEG20DBM + } + #[doc = "Checks if the value of the field is `NEG30DBM`"] + #[inline(always)] + pub fn is_neg30d_bm(&self) -> bool { + **self == TXPOWER_A::NEG30DBM + } + #[doc = "Checks if the value of the field is `NEG40DBM`"] + #[inline(always)] + pub fn is_neg40d_bm(&self) -> bool { + **self == TXPOWER_A::NEG40DBM + } +} +impl core::ops::Deref for TXPOWER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TXPOWER` writer - RADIO output power."] +pub struct TXPOWER_W<'a> { + w: &'a mut W, +} +impl<'a> TXPOWER_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXPOWER_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "+4 dBm"] + #[inline(always)] + pub fn pos4d_bm(self) -> &'a mut W { + self.variant(TXPOWER_A::POS4DBM) + } + #[doc = "+3 dBm"] + #[inline(always)] + pub fn pos3d_bm(self) -> &'a mut W { + self.variant(TXPOWER_A::POS3DBM) + } + #[doc = "0 dBm"] + #[inline(always)] + pub fn _0d_bm(self) -> &'a mut W { + self.variant(TXPOWER_A::_0DBM) + } + #[doc = "-4 dBm"] + #[inline(always)] + pub fn neg4d_bm(self) -> &'a mut W { + self.variant(TXPOWER_A::NEG4DBM) + } + #[doc = "-8 dBm"] + #[inline(always)] + pub fn neg8d_bm(self) -> &'a mut W { + self.variant(TXPOWER_A::NEG8DBM) + } + #[doc = "-12 dBm"] + #[inline(always)] + pub fn neg12d_bm(self) -> &'a mut W { + self.variant(TXPOWER_A::NEG12DBM) + } + #[doc = "-16 dBm"] + #[inline(always)] + pub fn neg16d_bm(self) -> &'a mut W { + self.variant(TXPOWER_A::NEG16DBM) + } + #[doc = "-20 dBm"] + #[inline(always)] + pub fn neg20d_bm(self) -> &'a mut W { + self.variant(TXPOWER_A::NEG20DBM) + } + #[doc = "Deprecated enumerator - -40 dBm"] + #[inline(always)] + pub fn neg30d_bm(self) -> &'a mut W { + self.variant(TXPOWER_A::NEG30DBM) + } + #[doc = "-40 dBm"] + #[inline(always)] + pub fn neg40d_bm(self) -> &'a mut W { + self.variant(TXPOWER_A::NEG40DBM) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - RADIO output power."] + #[inline(always)] + pub fn txpower(&self) -> TXPOWER_R { + TXPOWER_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - RADIO output power."] + #[inline(always)] + pub fn txpower(&mut self) -> TXPOWER_W { + TXPOWER_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Output power\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [txpower](index.html) module"] +pub struct TXPOWER_SPEC; +impl crate::RegisterSpec for TXPOWER_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [txpower::R](R) reader structure"] +impl crate::Readable for TXPOWER_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [txpower::W](W) writer structure"] +impl crate::Writable for TXPOWER_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TXPOWER to value 0"] +impl crate::Resettable for TXPOWER_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/radio/unused0.rs b/src/radio/unused0.rs new file mode 100644 index 0000000..c1af181 --- /dev/null +++ b/src/radio/unused0.rs @@ -0,0 +1,64 @@ +#[doc = "Register `UNUSED0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `UNUSED0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Unspecified\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [unused0](index.html) module"] +pub struct UNUSED0_SPEC; +impl crate::RegisterSpec for UNUSED0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [unused0::R](R) reader structure"] +impl crate::Readable for UNUSED0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [unused0::W](W) writer structure"] +impl crate::Writable for UNUSED0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets UNUSED0 to value 0"] +impl crate::Resettable for UNUSED0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/rng.rs b/src/rng.rs new file mode 100644 index 0000000..e6ee874 --- /dev/null +++ b/src/rng.rs @@ -0,0 +1,56 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "0x00 - Task starting the random number generator"] + pub tasks_start: crate::Reg, + #[doc = "0x04 - Task stopping the random number generator"] + pub tasks_stop: crate::Reg, + _reserved2: [u8; 0xf8], + #[doc = "0x100 - Event being generated for every new random number written to the VALUE register"] + pub events_valrdy: crate::Reg, + _reserved3: [u8; 0xfc], + #[doc = "0x200 - Shortcut register"] + pub shorts: crate::Reg, + _reserved4: [u8; 0x0100], + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved6: [u8; 0x01f8], + #[doc = "0x504 - Configuration register"] + pub config: crate::Reg, + #[doc = "0x508 - Output random number"] + pub value: crate::Reg, +} +#[doc = "TASKS_START register accessor: an alias for `Reg`"] +pub type TASKS_START = crate::Reg; +#[doc = "Task starting the random number generator"] +pub mod tasks_start; +#[doc = "TASKS_STOP register accessor: an alias for `Reg`"] +pub type TASKS_STOP = crate::Reg; +#[doc = "Task stopping the random number generator"] +pub mod tasks_stop; +#[doc = "EVENTS_VALRDY register accessor: an alias for `Reg`"] +pub type EVENTS_VALRDY = crate::Reg; +#[doc = "Event being generated for every new random number written to the VALUE register"] +pub mod events_valrdy; +#[doc = "SHORTS register accessor: an alias for `Reg`"] +pub type SHORTS = crate::Reg; +#[doc = "Shortcut register"] +pub mod shorts; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "CONFIG register accessor: an alias for `Reg`"] +pub type CONFIG = crate::Reg; +#[doc = "Configuration register"] +pub mod config; +#[doc = "VALUE register accessor: an alias for `Reg`"] +pub type VALUE = crate::Reg; +#[doc = "Output random number"] +pub mod value; diff --git a/src/rng/config.rs b/src/rng/config.rs new file mode 100644 index 0000000..17d97c9 --- /dev/null +++ b/src/rng/config.rs @@ -0,0 +1,159 @@ +#[doc = "Register `CONFIG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CONFIG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Bias correction\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DERCEN_A { + #[doc = "0: Disabled"] + DISABLED = 0, + #[doc = "1: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DERCEN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DERCEN` reader - Bias correction"] +pub struct DERCEN_R(crate::FieldReader); +impl DERCEN_R { + pub(crate) fn new(bits: bool) -> Self { + DERCEN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DERCEN_A { + match self.bits { + false => DERCEN_A::DISABLED, + true => DERCEN_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DERCEN_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DERCEN_A::ENABLED + } +} +impl core::ops::Deref for DERCEN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DERCEN` writer - Bias correction"] +pub struct DERCEN_W<'a> { + w: &'a mut W, +} +impl<'a> DERCEN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DERCEN_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(DERCEN_A::DISABLED) + } + #[doc = "Enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(DERCEN_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Bias correction"] + #[inline(always)] + pub fn dercen(&self) -> DERCEN_R { + DERCEN_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Bias correction"] + #[inline(always)] + pub fn dercen(&mut self) -> DERCEN_W { + DERCEN_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Configuration register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [config](index.html) module"] +pub struct CONFIG_SPEC; +impl crate::RegisterSpec for CONFIG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [config::R](R) reader structure"] +impl crate::Readable for CONFIG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [config::W](W) writer structure"] +impl crate::Writable for CONFIG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CONFIG to value 0"] +impl crate::Resettable for CONFIG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/rng/events_valrdy.rs b/src/rng/events_valrdy.rs new file mode 100644 index 0000000..49db460 --- /dev/null +++ b/src/rng/events_valrdy.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_VALRDY` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_VALRDY` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Event being generated for every new random number written to the VALUE register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_valrdy](index.html) module"] +pub struct EVENTS_VALRDY_SPEC; +impl crate::RegisterSpec for EVENTS_VALRDY_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_valrdy::R](R) reader structure"] +impl crate::Readable for EVENTS_VALRDY_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_valrdy::W](W) writer structure"] +impl crate::Writable for EVENTS_VALRDY_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_VALRDY to value 0"] +impl crate::Resettable for EVENTS_VALRDY_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/rng/intenclr.rs b/src/rng/intenclr.rs new file mode 100644 index 0000000..13d6f1f --- /dev/null +++ b/src/rng/intenclr.rs @@ -0,0 +1,166 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for VALRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum VALRDY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: VALRDY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `VALRDY` reader - Write '1' to Disable interrupt for VALRDY event"] +pub struct VALRDY_R(crate::FieldReader); +impl VALRDY_R { + pub(crate) fn new(bits: bool) -> Self { + VALRDY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> VALRDY_A { + match self.bits { + false => VALRDY_A::DISABLED, + true => VALRDY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == VALRDY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == VALRDY_A::ENABLED + } +} +impl core::ops::Deref for VALRDY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for VALRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum VALRDY_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: VALRDY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `VALRDY` writer - Write '1' to Disable interrupt for VALRDY event"] +pub struct VALRDY_W<'a> { + w: &'a mut W, +} +impl<'a> VALRDY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: VALRDY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(VALRDY_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Disable interrupt for VALRDY event"] + #[inline(always)] + pub fn valrdy(&self) -> VALRDY_R { + VALRDY_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Disable interrupt for VALRDY event"] + #[inline(always)] + pub fn valrdy(&mut self) -> VALRDY_W { + VALRDY_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/rng/intenset.rs b/src/rng/intenset.rs new file mode 100644 index 0000000..fff4fd0 --- /dev/null +++ b/src/rng/intenset.rs @@ -0,0 +1,166 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for VALRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum VALRDY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: VALRDY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `VALRDY` reader - Write '1' to Enable interrupt for VALRDY event"] +pub struct VALRDY_R(crate::FieldReader); +impl VALRDY_R { + pub(crate) fn new(bits: bool) -> Self { + VALRDY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> VALRDY_A { + match self.bits { + false => VALRDY_A::DISABLED, + true => VALRDY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == VALRDY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == VALRDY_A::ENABLED + } +} +impl core::ops::Deref for VALRDY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for VALRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum VALRDY_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: VALRDY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `VALRDY` writer - Write '1' to Enable interrupt for VALRDY event"] +pub struct VALRDY_W<'a> { + w: &'a mut W, +} +impl<'a> VALRDY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: VALRDY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(VALRDY_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Enable interrupt for VALRDY event"] + #[inline(always)] + pub fn valrdy(&self) -> VALRDY_R { + VALRDY_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Enable interrupt for VALRDY event"] + #[inline(always)] + pub fn valrdy(&mut self) -> VALRDY_W { + VALRDY_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/rng/shorts.rs b/src/rng/shorts.rs new file mode 100644 index 0000000..aa5df7e --- /dev/null +++ b/src/rng/shorts.rs @@ -0,0 +1,159 @@ +#[doc = "Register `SHORTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SHORTS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Shortcut between VALRDY event and STOP task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum VALRDY_STOP_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: VALRDY_STOP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `VALRDY_STOP` reader - Shortcut between VALRDY event and STOP task"] +pub struct VALRDY_STOP_R(crate::FieldReader); +impl VALRDY_STOP_R { + pub(crate) fn new(bits: bool) -> Self { + VALRDY_STOP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> VALRDY_STOP_A { + match self.bits { + false => VALRDY_STOP_A::DISABLED, + true => VALRDY_STOP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == VALRDY_STOP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == VALRDY_STOP_A::ENABLED + } +} +impl core::ops::Deref for VALRDY_STOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VALRDY_STOP` writer - Shortcut between VALRDY event and STOP task"] +pub struct VALRDY_STOP_W<'a> { + w: &'a mut W, +} +impl<'a> VALRDY_STOP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: VALRDY_STOP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(VALRDY_STOP_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(VALRDY_STOP_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Shortcut between VALRDY event and STOP task"] + #[inline(always)] + pub fn valrdy_stop(&self) -> VALRDY_STOP_R { + VALRDY_STOP_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Shortcut between VALRDY event and STOP task"] + #[inline(always)] + pub fn valrdy_stop(&mut self) -> VALRDY_STOP_W { + VALRDY_STOP_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Shortcut register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [shorts](index.html) module"] +pub struct SHORTS_SPEC; +impl crate::RegisterSpec for SHORTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [shorts::R](R) reader structure"] +impl crate::Readable for SHORTS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [shorts::W](W) writer structure"] +impl crate::Writable for SHORTS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SHORTS to value 0"] +impl crate::Resettable for SHORTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/rng/tasks_start.rs b/src/rng/tasks_start.rs new file mode 100644 index 0000000..cda9ecd --- /dev/null +++ b/src/rng/tasks_start.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_START` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Task starting the random number generator\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_start](index.html) module"] +pub struct TASKS_START_SPEC; +impl crate::RegisterSpec for TASKS_START_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_start::W](W) writer structure"] +impl crate::Writable for TASKS_START_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_START to value 0"] +impl crate::Resettable for TASKS_START_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/rng/tasks_stop.rs b/src/rng/tasks_stop.rs new file mode 100644 index 0000000..88e03ec --- /dev/null +++ b/src/rng/tasks_stop.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STOP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Task stopping the random number generator\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_stop](index.html) module"] +pub struct TASKS_STOP_SPEC; +impl crate::RegisterSpec for TASKS_STOP_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_stop::W](W) writer structure"] +impl crate::Writable for TASKS_STOP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STOP to value 0"] +impl crate::Resettable for TASKS_STOP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/rng/value.rs b/src/rng/value.rs new file mode 100644 index 0000000..fb1b35a --- /dev/null +++ b/src/rng/value.rs @@ -0,0 +1,52 @@ +#[doc = "Register `VALUE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `VALUE` reader - Generated random number"] +pub struct VALUE_R(crate::FieldReader); +impl VALUE_R { + pub(crate) fn new(bits: u8) -> Self { + VALUE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for VALUE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:7 - Generated random number"] + #[inline(always)] + pub fn value(&self) -> VALUE_R { + VALUE_R::new((self.bits & 0xff) as u8) + } +} +#[doc = "Output random number\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 [value](index.html) module"] +pub struct VALUE_SPEC; +impl crate::RegisterSpec for VALUE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [value::R](R) reader structure"] +impl crate::Readable for VALUE_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets VALUE to value 0"] +impl crate::Resettable for VALUE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/rtc0.rs b/src/rtc0.rs new file mode 100644 index 0000000..bd6f9da --- /dev/null +++ b/src/rtc0.rs @@ -0,0 +1,102 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "0x00 - Start RTC COUNTER"] + pub tasks_start: crate::Reg, + #[doc = "0x04 - Stop RTC COUNTER"] + pub tasks_stop: crate::Reg, + #[doc = "0x08 - Clear RTC COUNTER"] + pub tasks_clear: crate::Reg, + #[doc = "0x0c - Set COUNTER to 0xFFFFF0"] + pub tasks_trigovrflw: crate::Reg, + _reserved4: [u8; 0xf0], + #[doc = "0x100 - Event on COUNTER increment"] + pub events_tick: crate::Reg, + #[doc = "0x104 - Event on COUNTER overflow"] + pub events_ovrflw: crate::Reg, + _reserved6: [u8; 0x38], + #[doc = "0x140..0x150 - Description collection\\[0\\]: Compare event on CC\\[0\\] +match"] + pub events_compare: [crate::Reg; 4], + _reserved7: [u8; 0x01b4], + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved9: [u8; 0x34], + #[doc = "0x340 - Enable or disable event routing"] + pub evten: crate::Reg, + #[doc = "0x344 - Enable event routing"] + pub evtenset: crate::Reg, + #[doc = "0x348 - Disable event routing"] + pub evtenclr: crate::Reg, + _reserved12: [u8; 0x01b8], + #[doc = "0x504 - Current COUNTER value"] + pub counter: crate::Reg, + #[doc = "0x508 - 12 bit prescaler for COUNTER frequency (32768/(PRESCALER+1)).Must be written when RTC is stopped"] + pub prescaler: crate::Reg, + _reserved14: [u8; 0x34], + #[doc = "0x540..0x550 - Description collection\\[0\\]: Compare register 0"] + pub cc: [crate::Reg; 4], +} +#[doc = "TASKS_START register accessor: an alias for `Reg`"] +pub type TASKS_START = crate::Reg; +#[doc = "Start RTC COUNTER"] +pub mod tasks_start; +#[doc = "TASKS_STOP register accessor: an alias for `Reg`"] +pub type TASKS_STOP = crate::Reg; +#[doc = "Stop RTC COUNTER"] +pub mod tasks_stop; +#[doc = "TASKS_CLEAR register accessor: an alias for `Reg`"] +pub type TASKS_CLEAR = crate::Reg; +#[doc = "Clear RTC COUNTER"] +pub mod tasks_clear; +#[doc = "TASKS_TRIGOVRFLW register accessor: an alias for `Reg`"] +pub type TASKS_TRIGOVRFLW = crate::Reg; +#[doc = "Set COUNTER to 0xFFFFF0"] +pub mod tasks_trigovrflw; +#[doc = "EVENTS_TICK register accessor: an alias for `Reg`"] +pub type EVENTS_TICK = crate::Reg; +#[doc = "Event on COUNTER increment"] +pub mod events_tick; +#[doc = "EVENTS_OVRFLW register accessor: an alias for `Reg`"] +pub type EVENTS_OVRFLW = crate::Reg; +#[doc = "Event on COUNTER overflow"] +pub mod events_ovrflw; +#[doc = "EVENTS_COMPARE register accessor: an alias for `Reg`"] +pub type EVENTS_COMPARE = crate::Reg; +#[doc = "Description collection\\[0\\]: Compare event on CC\\[0\\] +match"] +pub mod events_compare; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "EVTEN register accessor: an alias for `Reg`"] +pub type EVTEN = crate::Reg; +#[doc = "Enable or disable event routing"] +pub mod evten; +#[doc = "EVTENSET register accessor: an alias for `Reg`"] +pub type EVTENSET = crate::Reg; +#[doc = "Enable event routing"] +pub mod evtenset; +#[doc = "EVTENCLR register accessor: an alias for `Reg`"] +pub type EVTENCLR = crate::Reg; +#[doc = "Disable event routing"] +pub mod evtenclr; +#[doc = "COUNTER register accessor: an alias for `Reg`"] +pub type COUNTER = crate::Reg; +#[doc = "Current COUNTER value"] +pub mod counter; +#[doc = "PRESCALER register accessor: an alias for `Reg`"] +pub type PRESCALER = crate::Reg; +#[doc = "12 bit prescaler for COUNTER frequency (32768/(PRESCALER+1)).Must be written when RTC is stopped"] +pub mod prescaler; +#[doc = "CC register accessor: an alias for `Reg`"] +pub type CC = crate::Reg; +#[doc = "Description collection\\[0\\]: Compare register 0"] +pub mod cc; diff --git a/src/rtc0/cc.rs b/src/rtc0/cc.rs new file mode 100644 index 0000000..1fc4ced --- /dev/null +++ b/src/rtc0/cc.rs @@ -0,0 +1,103 @@ +#[doc = "Register `CC[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CC[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `COMPARE` reader - Compare value"] +pub struct COMPARE_R(crate::FieldReader); +impl COMPARE_R { + pub(crate) fn new(bits: u32) -> Self { + COMPARE_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for COMPARE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `COMPARE` writer - Compare value"] +pub struct COMPARE_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0x00ff_ffff) | (value as u32 & 0x00ff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:23 - Compare value"] + #[inline(always)] + pub fn compare(&self) -> COMPARE_R { + COMPARE_R::new((self.bits & 0x00ff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:23 - Compare value"] + #[inline(always)] + pub fn compare(&mut self) -> COMPARE_W { + COMPARE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description collection\\[0\\]: Compare register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cc](index.html) module"] +pub struct CC_SPEC; +impl crate::RegisterSpec for CC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cc::R](R) reader structure"] +impl crate::Readable for CC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [cc::W](W) writer structure"] +impl crate::Writable for CC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CC[%s] +to value 0"] +impl crate::Resettable for CC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/rtc0/counter.rs b/src/rtc0/counter.rs new file mode 100644 index 0000000..177967b --- /dev/null +++ b/src/rtc0/counter.rs @@ -0,0 +1,52 @@ +#[doc = "Register `COUNTER` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `COUNTER` reader - Counter value"] +pub struct COUNTER_R(crate::FieldReader); +impl COUNTER_R { + pub(crate) fn new(bits: u32) -> Self { + COUNTER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for COUNTER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:23 - Counter value"] + #[inline(always)] + pub fn counter(&self) -> COUNTER_R { + COUNTER_R::new((self.bits & 0x00ff_ffff) as u32) + } +} +#[doc = "Current COUNTER value\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 [counter](index.html) module"] +pub struct COUNTER_SPEC; +impl crate::RegisterSpec for COUNTER_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [counter::R](R) reader structure"] +impl crate::Readable for COUNTER_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets COUNTER to value 0"] +impl crate::Resettable for COUNTER_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/rtc0/events_compare.rs b/src/rtc0/events_compare.rs new file mode 100644 index 0000000..a523d4b --- /dev/null +++ b/src/rtc0/events_compare.rs @@ -0,0 +1,66 @@ +#[doc = "Register `EVENTS_COMPARE[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_COMPARE[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description collection\\[0\\]: Compare event on CC\\[0\\] +match\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_compare](index.html) module"] +pub struct EVENTS_COMPARE_SPEC; +impl crate::RegisterSpec for EVENTS_COMPARE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_compare::R](R) reader structure"] +impl crate::Readable for EVENTS_COMPARE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_compare::W](W) writer structure"] +impl crate::Writable for EVENTS_COMPARE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_COMPARE[%s] +to value 0"] +impl crate::Resettable for EVENTS_COMPARE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/rtc0/events_ovrflw.rs b/src/rtc0/events_ovrflw.rs new file mode 100644 index 0000000..0c64fa6 --- /dev/null +++ b/src/rtc0/events_ovrflw.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_OVRFLW` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_OVRFLW` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Event on COUNTER overflow\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_ovrflw](index.html) module"] +pub struct EVENTS_OVRFLW_SPEC; +impl crate::RegisterSpec for EVENTS_OVRFLW_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_ovrflw::R](R) reader structure"] +impl crate::Readable for EVENTS_OVRFLW_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_ovrflw::W](W) writer structure"] +impl crate::Writable for EVENTS_OVRFLW_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_OVRFLW to value 0"] +impl crate::Resettable for EVENTS_OVRFLW_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/rtc0/events_tick.rs b/src/rtc0/events_tick.rs new file mode 100644 index 0000000..71773a0 --- /dev/null +++ b/src/rtc0/events_tick.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_TICK` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_TICK` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Event on COUNTER increment\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_tick](index.html) module"] +pub struct EVENTS_TICK_SPEC; +impl crate::RegisterSpec for EVENTS_TICK_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_tick::R](R) reader structure"] +impl crate::Readable for EVENTS_TICK_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_tick::W](W) writer structure"] +impl crate::Writable for EVENTS_TICK_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_TICK to value 0"] +impl crate::Resettable for EVENTS_TICK_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/rtc0/evten.rs b/src/rtc0/evten.rs new file mode 100644 index 0000000..3134152 --- /dev/null +++ b/src/rtc0/evten.rs @@ -0,0 +1,644 @@ +#[doc = "Register `EVTEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVTEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable event routing for TICK event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TICK_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TICK_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TICK` reader - Enable or disable event routing for TICK event"] +pub struct TICK_R(crate::FieldReader); +impl TICK_R { + pub(crate) fn new(bits: bool) -> Self { + TICK_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TICK_A { + match self.bits { + false => TICK_A::DISABLED, + true => TICK_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TICK_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TICK_A::ENABLED + } +} +impl core::ops::Deref for TICK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TICK` writer - Enable or disable event routing for TICK event"] +pub struct TICK_W<'a> { + w: &'a mut W, +} +impl<'a> TICK_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TICK_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(TICK_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(TICK_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Enable or disable event routing for OVRFLW event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OVRFLW_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OVRFLW_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OVRFLW` reader - Enable or disable event routing for OVRFLW event"] +pub struct OVRFLW_R(crate::FieldReader); +impl OVRFLW_R { + pub(crate) fn new(bits: bool) -> Self { + OVRFLW_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> OVRFLW_A { + match self.bits { + false => OVRFLW_A::DISABLED, + true => OVRFLW_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == OVRFLW_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == OVRFLW_A::ENABLED + } +} +impl core::ops::Deref for OVRFLW_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OVRFLW` writer - Enable or disable event routing for OVRFLW event"] +pub struct OVRFLW_W<'a> { + w: &'a mut W, +} +impl<'a> OVRFLW_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: OVRFLW_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(OVRFLW_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(OVRFLW_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Enable or disable event routing for COMPARE\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE0_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE0` reader - Enable or disable event routing for COMPARE\\[0\\] +event"] +pub struct COMPARE0_R(crate::FieldReader); +impl COMPARE0_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE0_A { + match self.bits { + false => COMPARE0_A::DISABLED, + true => COMPARE0_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE0_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE0_A::ENABLED + } +} +impl core::ops::Deref for COMPARE0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `COMPARE0` writer - Enable or disable event routing for COMPARE\\[0\\] +event"] +pub struct COMPARE0_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE0_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(COMPARE0_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(COMPARE0_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Enable or disable event routing for COMPARE\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE1_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE1` reader - Enable or disable event routing for COMPARE\\[1\\] +event"] +pub struct COMPARE1_R(crate::FieldReader); +impl COMPARE1_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE1_A { + match self.bits { + false => COMPARE1_A::DISABLED, + true => COMPARE1_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE1_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE1_A::ENABLED + } +} +impl core::ops::Deref for COMPARE1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `COMPARE1` writer - Enable or disable event routing for COMPARE\\[1\\] +event"] +pub struct COMPARE1_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE1_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(COMPARE1_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(COMPARE1_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Enable or disable event routing for COMPARE\\[2\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE2_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE2` reader - Enable or disable event routing for COMPARE\\[2\\] +event"] +pub struct COMPARE2_R(crate::FieldReader); +impl COMPARE2_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE2_A { + match self.bits { + false => COMPARE2_A::DISABLED, + true => COMPARE2_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE2_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE2_A::ENABLED + } +} +impl core::ops::Deref for COMPARE2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `COMPARE2` writer - Enable or disable event routing for COMPARE\\[2\\] +event"] +pub struct COMPARE2_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE2_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(COMPARE2_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(COMPARE2_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Enable or disable event routing for COMPARE\\[3\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE3_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE3` reader - Enable or disable event routing for COMPARE\\[3\\] +event"] +pub struct COMPARE3_R(crate::FieldReader); +impl COMPARE3_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE3_A { + match self.bits { + false => COMPARE3_A::DISABLED, + true => COMPARE3_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE3_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE3_A::ENABLED + } +} +impl core::ops::Deref for COMPARE3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `COMPARE3` writer - Enable or disable event routing for COMPARE\\[3\\] +event"] +pub struct COMPARE3_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE3_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(COMPARE3_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(COMPARE3_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable or disable event routing for TICK event"] + #[inline(always)] + pub fn tick(&self) -> TICK_R { + TICK_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Enable or disable event routing for OVRFLW event"] + #[inline(always)] + pub fn ovrflw(&self) -> OVRFLW_R { + OVRFLW_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 16 - Enable or disable event routing for COMPARE\\[0\\] +event"] + #[inline(always)] + pub fn compare0(&self) -> COMPARE0_R { + COMPARE0_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Enable or disable event routing for COMPARE\\[1\\] +event"] + #[inline(always)] + pub fn compare1(&self) -> COMPARE1_R { + COMPARE1_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Enable or disable event routing for COMPARE\\[2\\] +event"] + #[inline(always)] + pub fn compare2(&self) -> COMPARE2_R { + COMPARE2_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Enable or disable event routing for COMPARE\\[3\\] +event"] + #[inline(always)] + pub fn compare3(&self) -> COMPARE3_R { + COMPARE3_R::new(((self.bits >> 19) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Enable or disable event routing for TICK event"] + #[inline(always)] + pub fn tick(&mut self) -> TICK_W { + TICK_W { w: self } + } + #[doc = "Bit 1 - Enable or disable event routing for OVRFLW event"] + #[inline(always)] + pub fn ovrflw(&mut self) -> OVRFLW_W { + OVRFLW_W { w: self } + } + #[doc = "Bit 16 - Enable or disable event routing for COMPARE\\[0\\] +event"] + #[inline(always)] + pub fn compare0(&mut self) -> COMPARE0_W { + COMPARE0_W { w: self } + } + #[doc = "Bit 17 - Enable or disable event routing for COMPARE\\[1\\] +event"] + #[inline(always)] + pub fn compare1(&mut self) -> COMPARE1_W { + COMPARE1_W { w: self } + } + #[doc = "Bit 18 - Enable or disable event routing for COMPARE\\[2\\] +event"] + #[inline(always)] + pub fn compare2(&mut self) -> COMPARE2_W { + COMPARE2_W { w: self } + } + #[doc = "Bit 19 - Enable or disable event routing for COMPARE\\[3\\] +event"] + #[inline(always)] + pub fn compare3(&mut self) -> COMPARE3_W { + COMPARE3_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable or disable event routing\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [evten](index.html) module"] +pub struct EVTEN_SPEC; +impl crate::RegisterSpec for EVTEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [evten::R](R) reader structure"] +impl crate::Readable for EVTEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [evten::W](W) writer structure"] +impl crate::Writable for EVTEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVTEN to value 0"] +impl crate::Resettable for EVTEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/rtc0/evtenclr.rs b/src/rtc0/evtenclr.rs new file mode 100644 index 0000000..775310b --- /dev/null +++ b/src/rtc0/evtenclr.rs @@ -0,0 +1,690 @@ +#[doc = "Register `EVTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable event routing for TICK event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TICK_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TICK_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TICK` reader - Write '1' to Disable event routing for TICK event"] +pub struct TICK_R(crate::FieldReader); +impl TICK_R { + pub(crate) fn new(bits: bool) -> Self { + TICK_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TICK_A { + match self.bits { + false => TICK_A::DISABLED, + true => TICK_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TICK_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TICK_A::ENABLED + } +} +impl core::ops::Deref for TICK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable event routing for TICK event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TICK_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TICK_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TICK` writer - Write '1' to Disable event routing for TICK event"] +pub struct TICK_W<'a> { + w: &'a mut W, +} +impl<'a> TICK_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TICK_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TICK_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Disable event routing for OVRFLW event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OVRFLW_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OVRFLW_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OVRFLW` reader - Write '1' to Disable event routing for OVRFLW event"] +pub struct OVRFLW_R(crate::FieldReader); +impl OVRFLW_R { + pub(crate) fn new(bits: bool) -> Self { + OVRFLW_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> OVRFLW_A { + match self.bits { + false => OVRFLW_A::DISABLED, + true => OVRFLW_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == OVRFLW_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == OVRFLW_A::ENABLED + } +} +impl core::ops::Deref for OVRFLW_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable event routing for OVRFLW event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OVRFLW_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OVRFLW_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OVRFLW` writer - Write '1' to Disable event routing for OVRFLW event"] +pub struct OVRFLW_W<'a> { + w: &'a mut W, +} +impl<'a> OVRFLW_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: OVRFLW_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(OVRFLW_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Disable event routing for COMPARE\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE0_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE0` reader - Write '1' to Disable event routing for COMPARE\\[0\\] +event"] +pub struct COMPARE0_R(crate::FieldReader); +impl COMPARE0_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE0_A { + match self.bits { + false => COMPARE0_A::DISABLED, + true => COMPARE0_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE0_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE0_A::ENABLED + } +} +impl core::ops::Deref for COMPARE0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable event routing for COMPARE\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE0_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE0_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE0` writer - Write '1' to Disable event routing for COMPARE\\[0\\] +event"] +pub struct COMPARE0_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE0_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(COMPARE0_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Write '1' to Disable event routing for COMPARE\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE1_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE1` reader - Write '1' to Disable event routing for COMPARE\\[1\\] +event"] +pub struct COMPARE1_R(crate::FieldReader); +impl COMPARE1_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE1_A { + match self.bits { + false => COMPARE1_A::DISABLED, + true => COMPARE1_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE1_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE1_A::ENABLED + } +} +impl core::ops::Deref for COMPARE1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable event routing for COMPARE\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE1_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE1_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE1` writer - Write '1' to Disable event routing for COMPARE\\[1\\] +event"] +pub struct COMPARE1_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE1_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(COMPARE1_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Write '1' to Disable event routing for COMPARE\\[2\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE2_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE2` reader - Write '1' to Disable event routing for COMPARE\\[2\\] +event"] +pub struct COMPARE2_R(crate::FieldReader); +impl COMPARE2_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE2_A { + match self.bits { + false => COMPARE2_A::DISABLED, + true => COMPARE2_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE2_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE2_A::ENABLED + } +} +impl core::ops::Deref for COMPARE2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable event routing for COMPARE\\[2\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE2_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE2_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE2` writer - Write '1' to Disable event routing for COMPARE\\[2\\] +event"] +pub struct COMPARE2_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE2_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(COMPARE2_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Write '1' to Disable event routing for COMPARE\\[3\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE3_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE3` reader - Write '1' to Disable event routing for COMPARE\\[3\\] +event"] +pub struct COMPARE3_R(crate::FieldReader); +impl COMPARE3_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE3_A { + match self.bits { + false => COMPARE3_A::DISABLED, + true => COMPARE3_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE3_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE3_A::ENABLED + } +} +impl core::ops::Deref for COMPARE3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable event routing for COMPARE\\[3\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE3_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE3_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE3` writer - Write '1' to Disable event routing for COMPARE\\[3\\] +event"] +pub struct COMPARE3_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE3_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(COMPARE3_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Disable event routing for TICK event"] + #[inline(always)] + pub fn tick(&self) -> TICK_R { + TICK_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Disable event routing for OVRFLW event"] + #[inline(always)] + pub fn ovrflw(&self) -> OVRFLW_R { + OVRFLW_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 16 - Write '1' to Disable event routing for COMPARE\\[0\\] +event"] + #[inline(always)] + pub fn compare0(&self) -> COMPARE0_R { + COMPARE0_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Write '1' to Disable event routing for COMPARE\\[1\\] +event"] + #[inline(always)] + pub fn compare1(&self) -> COMPARE1_R { + COMPARE1_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Write '1' to Disable event routing for COMPARE\\[2\\] +event"] + #[inline(always)] + pub fn compare2(&self) -> COMPARE2_R { + COMPARE2_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Write '1' to Disable event routing for COMPARE\\[3\\] +event"] + #[inline(always)] + pub fn compare3(&self) -> COMPARE3_R { + COMPARE3_R::new(((self.bits >> 19) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Disable event routing for TICK event"] + #[inline(always)] + pub fn tick(&mut self) -> TICK_W { + TICK_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Disable event routing for OVRFLW event"] + #[inline(always)] + pub fn ovrflw(&mut self) -> OVRFLW_W { + OVRFLW_W { w: self } + } + #[doc = "Bit 16 - Write '1' to Disable event routing for COMPARE\\[0\\] +event"] + #[inline(always)] + pub fn compare0(&mut self) -> COMPARE0_W { + COMPARE0_W { w: self } + } + #[doc = "Bit 17 - Write '1' to Disable event routing for COMPARE\\[1\\] +event"] + #[inline(always)] + pub fn compare1(&mut self) -> COMPARE1_W { + COMPARE1_W { w: self } + } + #[doc = "Bit 18 - Write '1' to Disable event routing for COMPARE\\[2\\] +event"] + #[inline(always)] + pub fn compare2(&mut self) -> COMPARE2_W { + COMPARE2_W { w: self } + } + #[doc = "Bit 19 - Write '1' to Disable event routing for COMPARE\\[3\\] +event"] + #[inline(always)] + pub fn compare3(&mut self) -> COMPARE3_W { + COMPARE3_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable event routing\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [evtenclr](index.html) module"] +pub struct EVTENCLR_SPEC; +impl crate::RegisterSpec for EVTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [evtenclr::R](R) reader structure"] +impl crate::Readable for EVTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [evtenclr::W](W) writer structure"] +impl crate::Writable for EVTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVTENCLR to value 0"] +impl crate::Resettable for EVTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/rtc0/evtenset.rs b/src/rtc0/evtenset.rs new file mode 100644 index 0000000..d6b5c7a --- /dev/null +++ b/src/rtc0/evtenset.rs @@ -0,0 +1,690 @@ +#[doc = "Register `EVTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable event routing for TICK event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TICK_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TICK_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TICK` reader - Write '1' to Enable event routing for TICK event"] +pub struct TICK_R(crate::FieldReader); +impl TICK_R { + pub(crate) fn new(bits: bool) -> Self { + TICK_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TICK_A { + match self.bits { + false => TICK_A::DISABLED, + true => TICK_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TICK_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TICK_A::ENABLED + } +} +impl core::ops::Deref for TICK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable event routing for TICK event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TICK_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TICK_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TICK` writer - Write '1' to Enable event routing for TICK event"] +pub struct TICK_W<'a> { + w: &'a mut W, +} +impl<'a> TICK_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TICK_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TICK_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Enable event routing for OVRFLW event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OVRFLW_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OVRFLW_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OVRFLW` reader - Write '1' to Enable event routing for OVRFLW event"] +pub struct OVRFLW_R(crate::FieldReader); +impl OVRFLW_R { + pub(crate) fn new(bits: bool) -> Self { + OVRFLW_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> OVRFLW_A { + match self.bits { + false => OVRFLW_A::DISABLED, + true => OVRFLW_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == OVRFLW_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == OVRFLW_A::ENABLED + } +} +impl core::ops::Deref for OVRFLW_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable event routing for OVRFLW event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OVRFLW_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OVRFLW_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OVRFLW` writer - Write '1' to Enable event routing for OVRFLW event"] +pub struct OVRFLW_W<'a> { + w: &'a mut W, +} +impl<'a> OVRFLW_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: OVRFLW_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(OVRFLW_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Enable event routing for COMPARE\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE0_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE0` reader - Write '1' to Enable event routing for COMPARE\\[0\\] +event"] +pub struct COMPARE0_R(crate::FieldReader); +impl COMPARE0_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE0_A { + match self.bits { + false => COMPARE0_A::DISABLED, + true => COMPARE0_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE0_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE0_A::ENABLED + } +} +impl core::ops::Deref for COMPARE0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable event routing for COMPARE\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE0_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE0_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE0` writer - Write '1' to Enable event routing for COMPARE\\[0\\] +event"] +pub struct COMPARE0_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE0_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(COMPARE0_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Write '1' to Enable event routing for COMPARE\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE1_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE1` reader - Write '1' to Enable event routing for COMPARE\\[1\\] +event"] +pub struct COMPARE1_R(crate::FieldReader); +impl COMPARE1_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE1_A { + match self.bits { + false => COMPARE1_A::DISABLED, + true => COMPARE1_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE1_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE1_A::ENABLED + } +} +impl core::ops::Deref for COMPARE1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable event routing for COMPARE\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE1_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE1_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE1` writer - Write '1' to Enable event routing for COMPARE\\[1\\] +event"] +pub struct COMPARE1_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE1_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(COMPARE1_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Write '1' to Enable event routing for COMPARE\\[2\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE2_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE2` reader - Write '1' to Enable event routing for COMPARE\\[2\\] +event"] +pub struct COMPARE2_R(crate::FieldReader); +impl COMPARE2_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE2_A { + match self.bits { + false => COMPARE2_A::DISABLED, + true => COMPARE2_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE2_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE2_A::ENABLED + } +} +impl core::ops::Deref for COMPARE2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable event routing for COMPARE\\[2\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE2_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE2_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE2` writer - Write '1' to Enable event routing for COMPARE\\[2\\] +event"] +pub struct COMPARE2_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE2_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(COMPARE2_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Write '1' to Enable event routing for COMPARE\\[3\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE3_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE3` reader - Write '1' to Enable event routing for COMPARE\\[3\\] +event"] +pub struct COMPARE3_R(crate::FieldReader); +impl COMPARE3_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE3_A { + match self.bits { + false => COMPARE3_A::DISABLED, + true => COMPARE3_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE3_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE3_A::ENABLED + } +} +impl core::ops::Deref for COMPARE3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable event routing for COMPARE\\[3\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE3_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE3_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE3` writer - Write '1' to Enable event routing for COMPARE\\[3\\] +event"] +pub struct COMPARE3_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE3_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(COMPARE3_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Enable event routing for TICK event"] + #[inline(always)] + pub fn tick(&self) -> TICK_R { + TICK_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Enable event routing for OVRFLW event"] + #[inline(always)] + pub fn ovrflw(&self) -> OVRFLW_R { + OVRFLW_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 16 - Write '1' to Enable event routing for COMPARE\\[0\\] +event"] + #[inline(always)] + pub fn compare0(&self) -> COMPARE0_R { + COMPARE0_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Write '1' to Enable event routing for COMPARE\\[1\\] +event"] + #[inline(always)] + pub fn compare1(&self) -> COMPARE1_R { + COMPARE1_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Write '1' to Enable event routing for COMPARE\\[2\\] +event"] + #[inline(always)] + pub fn compare2(&self) -> COMPARE2_R { + COMPARE2_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Write '1' to Enable event routing for COMPARE\\[3\\] +event"] + #[inline(always)] + pub fn compare3(&self) -> COMPARE3_R { + COMPARE3_R::new(((self.bits >> 19) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Enable event routing for TICK event"] + #[inline(always)] + pub fn tick(&mut self) -> TICK_W { + TICK_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Enable event routing for OVRFLW event"] + #[inline(always)] + pub fn ovrflw(&mut self) -> OVRFLW_W { + OVRFLW_W { w: self } + } + #[doc = "Bit 16 - Write '1' to Enable event routing for COMPARE\\[0\\] +event"] + #[inline(always)] + pub fn compare0(&mut self) -> COMPARE0_W { + COMPARE0_W { w: self } + } + #[doc = "Bit 17 - Write '1' to Enable event routing for COMPARE\\[1\\] +event"] + #[inline(always)] + pub fn compare1(&mut self) -> COMPARE1_W { + COMPARE1_W { w: self } + } + #[doc = "Bit 18 - Write '1' to Enable event routing for COMPARE\\[2\\] +event"] + #[inline(always)] + pub fn compare2(&mut self) -> COMPARE2_W { + COMPARE2_W { w: self } + } + #[doc = "Bit 19 - Write '1' to Enable event routing for COMPARE\\[3\\] +event"] + #[inline(always)] + pub fn compare3(&mut self) -> COMPARE3_W { + COMPARE3_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable event routing\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [evtenset](index.html) module"] +pub struct EVTENSET_SPEC; +impl crate::RegisterSpec for EVTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [evtenset::R](R) reader structure"] +impl crate::Readable for EVTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [evtenset::W](W) writer structure"] +impl crate::Writable for EVTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVTENSET to value 0"] +impl crate::Resettable for EVTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/rtc0/intenclr.rs b/src/rtc0/intenclr.rs new file mode 100644 index 0000000..a9f4c9c --- /dev/null +++ b/src/rtc0/intenclr.rs @@ -0,0 +1,690 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for TICK event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TICK_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TICK_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TICK` reader - Write '1' to Disable interrupt for TICK event"] +pub struct TICK_R(crate::FieldReader); +impl TICK_R { + pub(crate) fn new(bits: bool) -> Self { + TICK_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TICK_A { + match self.bits { + false => TICK_A::DISABLED, + true => TICK_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TICK_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TICK_A::ENABLED + } +} +impl core::ops::Deref for TICK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TICK event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TICK_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TICK_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TICK` writer - Write '1' to Disable interrupt for TICK event"] +pub struct TICK_W<'a> { + w: &'a mut W, +} +impl<'a> TICK_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TICK_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TICK_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for OVRFLW event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OVRFLW_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OVRFLW_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OVRFLW` reader - Write '1' to Disable interrupt for OVRFLW event"] +pub struct OVRFLW_R(crate::FieldReader); +impl OVRFLW_R { + pub(crate) fn new(bits: bool) -> Self { + OVRFLW_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> OVRFLW_A { + match self.bits { + false => OVRFLW_A::DISABLED, + true => OVRFLW_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == OVRFLW_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == OVRFLW_A::ENABLED + } +} +impl core::ops::Deref for OVRFLW_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for OVRFLW event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OVRFLW_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OVRFLW_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OVRFLW` writer - Write '1' to Disable interrupt for OVRFLW event"] +pub struct OVRFLW_W<'a> { + w: &'a mut W, +} +impl<'a> OVRFLW_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: OVRFLW_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(OVRFLW_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for COMPARE\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE0_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE0` reader - Write '1' to Disable interrupt for COMPARE\\[0\\] +event"] +pub struct COMPARE0_R(crate::FieldReader); +impl COMPARE0_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE0_A { + match self.bits { + false => COMPARE0_A::DISABLED, + true => COMPARE0_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE0_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE0_A::ENABLED + } +} +impl core::ops::Deref for COMPARE0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for COMPARE\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE0_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE0_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE0` writer - Write '1' to Disable interrupt for COMPARE\\[0\\] +event"] +pub struct COMPARE0_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE0_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(COMPARE0_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for COMPARE\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE1_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE1` reader - Write '1' to Disable interrupt for COMPARE\\[1\\] +event"] +pub struct COMPARE1_R(crate::FieldReader); +impl COMPARE1_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE1_A { + match self.bits { + false => COMPARE1_A::DISABLED, + true => COMPARE1_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE1_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE1_A::ENABLED + } +} +impl core::ops::Deref for COMPARE1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for COMPARE\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE1_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE1_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE1` writer - Write '1' to Disable interrupt for COMPARE\\[1\\] +event"] +pub struct COMPARE1_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE1_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(COMPARE1_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for COMPARE\\[2\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE2_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE2` reader - Write '1' to Disable interrupt for COMPARE\\[2\\] +event"] +pub struct COMPARE2_R(crate::FieldReader); +impl COMPARE2_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE2_A { + match self.bits { + false => COMPARE2_A::DISABLED, + true => COMPARE2_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE2_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE2_A::ENABLED + } +} +impl core::ops::Deref for COMPARE2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for COMPARE\\[2\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE2_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE2_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE2` writer - Write '1' to Disable interrupt for COMPARE\\[2\\] +event"] +pub struct COMPARE2_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE2_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(COMPARE2_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for COMPARE\\[3\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE3_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE3` reader - Write '1' to Disable interrupt for COMPARE\\[3\\] +event"] +pub struct COMPARE3_R(crate::FieldReader); +impl COMPARE3_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE3_A { + match self.bits { + false => COMPARE3_A::DISABLED, + true => COMPARE3_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE3_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE3_A::ENABLED + } +} +impl core::ops::Deref for COMPARE3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for COMPARE\\[3\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE3_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE3_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE3` writer - Write '1' to Disable interrupt for COMPARE\\[3\\] +event"] +pub struct COMPARE3_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE3_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(COMPARE3_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Disable interrupt for TICK event"] + #[inline(always)] + pub fn tick(&self) -> TICK_R { + TICK_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for OVRFLW event"] + #[inline(always)] + pub fn ovrflw(&self) -> OVRFLW_R { + OVRFLW_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 16 - Write '1' to Disable interrupt for COMPARE\\[0\\] +event"] + #[inline(always)] + pub fn compare0(&self) -> COMPARE0_R { + COMPARE0_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Write '1' to Disable interrupt for COMPARE\\[1\\] +event"] + #[inline(always)] + pub fn compare1(&self) -> COMPARE1_R { + COMPARE1_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Write '1' to Disable interrupt for COMPARE\\[2\\] +event"] + #[inline(always)] + pub fn compare2(&self) -> COMPARE2_R { + COMPARE2_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Write '1' to Disable interrupt for COMPARE\\[3\\] +event"] + #[inline(always)] + pub fn compare3(&self) -> COMPARE3_R { + COMPARE3_R::new(((self.bits >> 19) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Disable interrupt for TICK event"] + #[inline(always)] + pub fn tick(&mut self) -> TICK_W { + TICK_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for OVRFLW event"] + #[inline(always)] + pub fn ovrflw(&mut self) -> OVRFLW_W { + OVRFLW_W { w: self } + } + #[doc = "Bit 16 - Write '1' to Disable interrupt for COMPARE\\[0\\] +event"] + #[inline(always)] + pub fn compare0(&mut self) -> COMPARE0_W { + COMPARE0_W { w: self } + } + #[doc = "Bit 17 - Write '1' to Disable interrupt for COMPARE\\[1\\] +event"] + #[inline(always)] + pub fn compare1(&mut self) -> COMPARE1_W { + COMPARE1_W { w: self } + } + #[doc = "Bit 18 - Write '1' to Disable interrupt for COMPARE\\[2\\] +event"] + #[inline(always)] + pub fn compare2(&mut self) -> COMPARE2_W { + COMPARE2_W { w: self } + } + #[doc = "Bit 19 - Write '1' to Disable interrupt for COMPARE\\[3\\] +event"] + #[inline(always)] + pub fn compare3(&mut self) -> COMPARE3_W { + COMPARE3_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/rtc0/intenset.rs b/src/rtc0/intenset.rs new file mode 100644 index 0000000..044b067 --- /dev/null +++ b/src/rtc0/intenset.rs @@ -0,0 +1,690 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for TICK event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TICK_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TICK_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TICK` reader - Write '1' to Enable interrupt for TICK event"] +pub struct TICK_R(crate::FieldReader); +impl TICK_R { + pub(crate) fn new(bits: bool) -> Self { + TICK_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TICK_A { + match self.bits { + false => TICK_A::DISABLED, + true => TICK_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TICK_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TICK_A::ENABLED + } +} +impl core::ops::Deref for TICK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TICK event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TICK_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TICK_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TICK` writer - Write '1' to Enable interrupt for TICK event"] +pub struct TICK_W<'a> { + w: &'a mut W, +} +impl<'a> TICK_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TICK_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TICK_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for OVRFLW event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OVRFLW_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OVRFLW_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OVRFLW` reader - Write '1' to Enable interrupt for OVRFLW event"] +pub struct OVRFLW_R(crate::FieldReader); +impl OVRFLW_R { + pub(crate) fn new(bits: bool) -> Self { + OVRFLW_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> OVRFLW_A { + match self.bits { + false => OVRFLW_A::DISABLED, + true => OVRFLW_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == OVRFLW_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == OVRFLW_A::ENABLED + } +} +impl core::ops::Deref for OVRFLW_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for OVRFLW event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OVRFLW_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OVRFLW_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OVRFLW` writer - Write '1' to Enable interrupt for OVRFLW event"] +pub struct OVRFLW_W<'a> { + w: &'a mut W, +} +impl<'a> OVRFLW_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: OVRFLW_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(OVRFLW_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for COMPARE\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE0_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE0` reader - Write '1' to Enable interrupt for COMPARE\\[0\\] +event"] +pub struct COMPARE0_R(crate::FieldReader); +impl COMPARE0_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE0_A { + match self.bits { + false => COMPARE0_A::DISABLED, + true => COMPARE0_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE0_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE0_A::ENABLED + } +} +impl core::ops::Deref for COMPARE0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for COMPARE\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE0_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE0_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE0` writer - Write '1' to Enable interrupt for COMPARE\\[0\\] +event"] +pub struct COMPARE0_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE0_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(COMPARE0_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for COMPARE\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE1_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE1` reader - Write '1' to Enable interrupt for COMPARE\\[1\\] +event"] +pub struct COMPARE1_R(crate::FieldReader); +impl COMPARE1_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE1_A { + match self.bits { + false => COMPARE1_A::DISABLED, + true => COMPARE1_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE1_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE1_A::ENABLED + } +} +impl core::ops::Deref for COMPARE1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for COMPARE\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE1_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE1_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE1` writer - Write '1' to Enable interrupt for COMPARE\\[1\\] +event"] +pub struct COMPARE1_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE1_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(COMPARE1_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for COMPARE\\[2\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE2_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE2` reader - Write '1' to Enable interrupt for COMPARE\\[2\\] +event"] +pub struct COMPARE2_R(crate::FieldReader); +impl COMPARE2_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE2_A { + match self.bits { + false => COMPARE2_A::DISABLED, + true => COMPARE2_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE2_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE2_A::ENABLED + } +} +impl core::ops::Deref for COMPARE2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for COMPARE\\[2\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE2_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE2_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE2` writer - Write '1' to Enable interrupt for COMPARE\\[2\\] +event"] +pub struct COMPARE2_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE2_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(COMPARE2_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for COMPARE\\[3\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE3_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE3` reader - Write '1' to Enable interrupt for COMPARE\\[3\\] +event"] +pub struct COMPARE3_R(crate::FieldReader); +impl COMPARE3_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE3_A { + match self.bits { + false => COMPARE3_A::DISABLED, + true => COMPARE3_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE3_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE3_A::ENABLED + } +} +impl core::ops::Deref for COMPARE3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for COMPARE\\[3\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE3_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE3_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE3` writer - Write '1' to Enable interrupt for COMPARE\\[3\\] +event"] +pub struct COMPARE3_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE3_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(COMPARE3_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Enable interrupt for TICK event"] + #[inline(always)] + pub fn tick(&self) -> TICK_R { + TICK_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for OVRFLW event"] + #[inline(always)] + pub fn ovrflw(&self) -> OVRFLW_R { + OVRFLW_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 16 - Write '1' to Enable interrupt for COMPARE\\[0\\] +event"] + #[inline(always)] + pub fn compare0(&self) -> COMPARE0_R { + COMPARE0_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Write '1' to Enable interrupt for COMPARE\\[1\\] +event"] + #[inline(always)] + pub fn compare1(&self) -> COMPARE1_R { + COMPARE1_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Write '1' to Enable interrupt for COMPARE\\[2\\] +event"] + #[inline(always)] + pub fn compare2(&self) -> COMPARE2_R { + COMPARE2_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Write '1' to Enable interrupt for COMPARE\\[3\\] +event"] + #[inline(always)] + pub fn compare3(&self) -> COMPARE3_R { + COMPARE3_R::new(((self.bits >> 19) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Enable interrupt for TICK event"] + #[inline(always)] + pub fn tick(&mut self) -> TICK_W { + TICK_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for OVRFLW event"] + #[inline(always)] + pub fn ovrflw(&mut self) -> OVRFLW_W { + OVRFLW_W { w: self } + } + #[doc = "Bit 16 - Write '1' to Enable interrupt for COMPARE\\[0\\] +event"] + #[inline(always)] + pub fn compare0(&mut self) -> COMPARE0_W { + COMPARE0_W { w: self } + } + #[doc = "Bit 17 - Write '1' to Enable interrupt for COMPARE\\[1\\] +event"] + #[inline(always)] + pub fn compare1(&mut self) -> COMPARE1_W { + COMPARE1_W { w: self } + } + #[doc = "Bit 18 - Write '1' to Enable interrupt for COMPARE\\[2\\] +event"] + #[inline(always)] + pub fn compare2(&mut self) -> COMPARE2_W { + COMPARE2_W { w: self } + } + #[doc = "Bit 19 - Write '1' to Enable interrupt for COMPARE\\[3\\] +event"] + #[inline(always)] + pub fn compare3(&mut self) -> COMPARE3_W { + COMPARE3_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/rtc0/prescaler.rs b/src/rtc0/prescaler.rs new file mode 100644 index 0000000..2e7889a --- /dev/null +++ b/src/rtc0/prescaler.rs @@ -0,0 +1,102 @@ +#[doc = "Register `PRESCALER` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PRESCALER` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRESCALER` reader - Prescaler value"] +pub struct PRESCALER_R(crate::FieldReader); +impl PRESCALER_R { + pub(crate) fn new(bits: u16) -> Self { + PRESCALER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRESCALER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRESCALER` writer - Prescaler value"] +pub struct PRESCALER_W<'a> { + w: &'a mut W, +} +impl<'a> PRESCALER_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !0x0fff) | (value as u32 & 0x0fff); + self.w + } +} +impl R { + #[doc = "Bits 0:11 - Prescaler value"] + #[inline(always)] + pub fn prescaler(&self) -> PRESCALER_R { + PRESCALER_R::new((self.bits & 0x0fff) as u16) + } +} +impl W { + #[doc = "Bits 0:11 - Prescaler value"] + #[inline(always)] + pub fn prescaler(&mut self) -> PRESCALER_W { + PRESCALER_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "12 bit prescaler for COUNTER frequency (32768/(PRESCALER+1)).Must be written when RTC is stopped\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prescaler](index.html) module"] +pub struct PRESCALER_SPEC; +impl crate::RegisterSpec for PRESCALER_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [prescaler::R](R) reader structure"] +impl crate::Readable for PRESCALER_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [prescaler::W](W) writer structure"] +impl crate::Writable for PRESCALER_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PRESCALER to value 0"] +impl crate::Resettable for PRESCALER_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/rtc0/tasks_clear.rs b/src/rtc0/tasks_clear.rs new file mode 100644 index 0000000..3840b2f --- /dev/null +++ b/src/rtc0/tasks_clear.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_CLEAR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Clear RTC COUNTER\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_clear](index.html) module"] +pub struct TASKS_CLEAR_SPEC; +impl crate::RegisterSpec for TASKS_CLEAR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_clear::W](W) writer structure"] +impl crate::Writable for TASKS_CLEAR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_CLEAR to value 0"] +impl crate::Resettable for TASKS_CLEAR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/rtc0/tasks_start.rs b/src/rtc0/tasks_start.rs new file mode 100644 index 0000000..c89ede8 --- /dev/null +++ b/src/rtc0/tasks_start.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_START` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start RTC COUNTER\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_start](index.html) module"] +pub struct TASKS_START_SPEC; +impl crate::RegisterSpec for TASKS_START_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_start::W](W) writer structure"] +impl crate::Writable for TASKS_START_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_START to value 0"] +impl crate::Resettable for TASKS_START_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/rtc0/tasks_stop.rs b/src/rtc0/tasks_stop.rs new file mode 100644 index 0000000..03fe526 --- /dev/null +++ b/src/rtc0/tasks_stop.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STOP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Stop RTC COUNTER\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_stop](index.html) module"] +pub struct TASKS_STOP_SPEC; +impl crate::RegisterSpec for TASKS_STOP_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_stop::W](W) writer structure"] +impl crate::Writable for TASKS_STOP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STOP to value 0"] +impl crate::Resettable for TASKS_STOP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/rtc0/tasks_trigovrflw.rs b/src/rtc0/tasks_trigovrflw.rs new file mode 100644 index 0000000..df85a8d --- /dev/null +++ b/src/rtc0/tasks_trigovrflw.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_TRIGOVRFLW` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Set COUNTER to 0xFFFFF0\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_trigovrflw](index.html) module"] +pub struct TASKS_TRIGOVRFLW_SPEC; +impl crate::RegisterSpec for TASKS_TRIGOVRFLW_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_trigovrflw::W](W) writer structure"] +impl crate::Writable for TASKS_TRIGOVRFLW_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_TRIGOVRFLW to value 0"] +impl crate::Resettable for TASKS_TRIGOVRFLW_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/saadc.rs b/src/saadc.rs new file mode 100644 index 0000000..9c82d5b --- /dev/null +++ b/src/saadc.rs @@ -0,0 +1,164 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "0x00 - Start the ADC and prepare the result buffer in RAM"] + pub tasks_start: crate::Reg, + #[doc = "0x04 - Take one ADC sample, if scan is enabled all channels are sampled"] + pub tasks_sample: crate::Reg, + #[doc = "0x08 - Stop the ADC and terminate any on-going conversion"] + pub tasks_stop: crate::Reg, + #[doc = "0x0c - Starts offset auto-calibration"] + pub tasks_calibrateoffset: crate::Reg, + _reserved4: [u8; 0xf0], + #[doc = "0x100 - The ADC has started"] + pub events_started: crate::Reg, + #[doc = "0x104 - The ADC has filled up the Result buffer"] + pub events_end: crate::Reg, + #[doc = "0x108 - A conversion task has been completed. Depending on the mode, multiple conversions might be needed for a result to be transferred to RAM."] + pub events_done: crate::Reg, + #[doc = "0x10c - A result is ready to get transferred to RAM."] + pub events_resultdone: crate::Reg, + #[doc = "0x110 - Calibration is complete"] + pub events_calibratedone: crate::Reg, + #[doc = "0x114 - The ADC has stopped"] + pub events_stopped: crate::Reg, + #[doc = "0x118..0x158 - Unspecified"] + pub events_ch: [EVENTS_CH; 8], + _reserved11: [u8; 0x01a8], + #[doc = "0x300 - Enable or disable interrupt"] + pub inten: crate::Reg, + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved14: [u8; 0xf4], + #[doc = "0x400 - Status"] + pub status: crate::Reg, + _reserved15: [u8; 0xfc], + #[doc = "0x500 - Enable or disable ADC"] + pub enable: crate::Reg, + _reserved16: [u8; 0x0c], + #[doc = "0x510..0x590 - Unspecified"] + pub ch: [CH; 8], + _reserved17: [u8; 0x60], + #[doc = "0x5f0 - Resolution configuration"] + pub resolution: crate::Reg, + #[doc = "0x5f4 - Oversampling configuration. OVERSAMPLE should not be combined with SCAN. The RESOLUTION is applied before averaging, thus for high OVERSAMPLE a higher RESOLUTION should be used."] + pub oversample: crate::Reg, + #[doc = "0x5f8 - Controls normal or continuous sample rate"] + pub samplerate: crate::Reg, + _reserved20: [u8; 0x30], + #[doc = "0x62c..0x638 - RESULT EasyDMA channel"] + pub result: RESULT, +} +#[doc = r"Register block"] +#[repr(C)] +pub struct EVENTS_CH { + #[doc = "0x00 - Description cluster\\[0\\]: Last results is equal or above CH\\[0\\].LIMIT.HIGH"] + pub limith: crate::Reg, + #[doc = "0x04 - Description cluster\\[0\\]: Last results is equal or below CH\\[0\\].LIMIT.LOW"] + pub limitl: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod events_ch; +#[doc = r"Register block"] +#[repr(C)] +pub struct CH { + #[doc = "0x00 - Description cluster\\[0\\]: Input positive pin selection for CH\\[0\\]"] + pub pselp: crate::Reg, + #[doc = "0x04 - Description cluster\\[0\\]: Input negative pin selection for CH\\[0\\]"] + pub pseln: crate::Reg, + #[doc = "0x08 - Description cluster\\[0\\]: Input configuration for CH\\[0\\]"] + pub config: crate::Reg, + #[doc = "0x0c - Description cluster\\[0\\]: High/low limits for event monitoring a channel"] + pub limit: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod ch; +#[doc = r"Register block"] +#[repr(C)] +pub struct RESULT { + #[doc = "0x00 - Data pointer"] + pub ptr: crate::Reg, + #[doc = "0x04 - Maximum number of buffer words to transfer"] + pub maxcnt: crate::Reg, + #[doc = "0x08 - Number of buffer words transferred since last START"] + pub amount: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "RESULT EasyDMA channel"] +pub mod result; +#[doc = "TASKS_START register accessor: an alias for `Reg`"] +pub type TASKS_START = crate::Reg; +#[doc = "Start the ADC and prepare the result buffer in RAM"] +pub mod tasks_start; +#[doc = "TASKS_SAMPLE register accessor: an alias for `Reg`"] +pub type TASKS_SAMPLE = crate::Reg; +#[doc = "Take one ADC sample, if scan is enabled all channels are sampled"] +pub mod tasks_sample; +#[doc = "TASKS_STOP register accessor: an alias for `Reg`"] +pub type TASKS_STOP = crate::Reg; +#[doc = "Stop the ADC and terminate any on-going conversion"] +pub mod tasks_stop; +#[doc = "TASKS_CALIBRATEOFFSET register accessor: an alias for `Reg`"] +pub type TASKS_CALIBRATEOFFSET = crate::Reg; +#[doc = "Starts offset auto-calibration"] +pub mod tasks_calibrateoffset; +#[doc = "EVENTS_STARTED register accessor: an alias for `Reg`"] +pub type EVENTS_STARTED = crate::Reg; +#[doc = "The ADC has started"] +pub mod events_started; +#[doc = "EVENTS_END register accessor: an alias for `Reg`"] +pub type EVENTS_END = crate::Reg; +#[doc = "The ADC has filled up the Result buffer"] +pub mod events_end; +#[doc = "EVENTS_DONE register accessor: an alias for `Reg`"] +pub type EVENTS_DONE = crate::Reg; +#[doc = "A conversion task has been completed. Depending on the mode, multiple conversions might be needed for a result to be transferred to RAM."] +pub mod events_done; +#[doc = "EVENTS_RESULTDONE register accessor: an alias for `Reg`"] +pub type EVENTS_RESULTDONE = crate::Reg; +#[doc = "A result is ready to get transferred to RAM."] +pub mod events_resultdone; +#[doc = "EVENTS_CALIBRATEDONE register accessor: an alias for `Reg`"] +pub type EVENTS_CALIBRATEDONE = crate::Reg; +#[doc = "Calibration is complete"] +pub mod events_calibratedone; +#[doc = "EVENTS_STOPPED register accessor: an alias for `Reg`"] +pub type EVENTS_STOPPED = crate::Reg; +#[doc = "The ADC has stopped"] +pub mod events_stopped; +#[doc = "INTEN register accessor: an alias for `Reg`"] +pub type INTEN = crate::Reg; +#[doc = "Enable or disable interrupt"] +pub mod inten; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "STATUS register accessor: an alias for `Reg`"] +pub type STATUS = crate::Reg; +#[doc = "Status"] +pub mod status; +#[doc = "ENABLE register accessor: an alias for `Reg`"] +pub type ENABLE = crate::Reg; +#[doc = "Enable or disable ADC"] +pub mod enable; +#[doc = "RESOLUTION register accessor: an alias for `Reg`"] +pub type RESOLUTION = crate::Reg; +#[doc = "Resolution configuration"] +pub mod resolution; +#[doc = "OVERSAMPLE register accessor: an alias for `Reg`"] +pub type OVERSAMPLE = crate::Reg; +#[doc = "Oversampling configuration. OVERSAMPLE should not be combined with SCAN. The RESOLUTION is applied before averaging, thus for high OVERSAMPLE a higher RESOLUTION should be used."] +pub mod oversample; +#[doc = "SAMPLERATE register accessor: an alias for `Reg`"] +pub type SAMPLERATE = crate::Reg; +#[doc = "Controls normal or continuous sample rate"] +pub mod samplerate; diff --git a/src/saadc/ch.rs b/src/saadc/ch.rs new file mode 100644 index 0000000..d526c8f --- /dev/null +++ b/src/saadc/ch.rs @@ -0,0 +1,16 @@ +#[doc = "PSELP register accessor: an alias for `Reg`"] +pub type PSELP = crate::Reg; +#[doc = "Description cluster\\[0\\]: Input positive pin selection for CH\\[0\\]"] +pub mod pselp; +#[doc = "PSELN register accessor: an alias for `Reg`"] +pub type PSELN = crate::Reg; +#[doc = "Description cluster\\[0\\]: Input negative pin selection for CH\\[0\\]"] +pub mod pseln; +#[doc = "CONFIG register accessor: an alias for `Reg`"] +pub type CONFIG = crate::Reg; +#[doc = "Description cluster\\[0\\]: Input configuration for CH\\[0\\]"] +pub mod config; +#[doc = "LIMIT register accessor: an alias for `Reg`"] +pub type LIMIT = crate::Reg; +#[doc = "Description cluster\\[0\\]: High/low limits for event monitoring a channel"] +pub mod limit; diff --git a/src/saadc/ch/config.rs b/src/saadc/ch/config.rs new file mode 100644 index 0000000..6ed4189 --- /dev/null +++ b/src/saadc/ch/config.rs @@ -0,0 +1,867 @@ +#[doc = "Register `CONFIG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CONFIG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Positive channel resistor control\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum RESP_A { + #[doc = "0: Bypass resistor ladder"] + BYPASS = 0, + #[doc = "1: Pull-down to GND"] + PULLDOWN = 1, + #[doc = "2: Pull-up to VDD"] + PULLUP = 2, + #[doc = "3: Set input at VDD/2"] + VDD1_2 = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: RESP_A) -> Self { + variant as _ + } +} +#[doc = "Field `RESP` reader - Positive channel resistor control"] +pub struct RESP_R(crate::FieldReader); +impl RESP_R { + pub(crate) fn new(bits: u8) -> Self { + RESP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RESP_A { + match self.bits { + 0 => RESP_A::BYPASS, + 1 => RESP_A::PULLDOWN, + 2 => RESP_A::PULLUP, + 3 => RESP_A::VDD1_2, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `BYPASS`"] + #[inline(always)] + pub fn is_bypass(&self) -> bool { + **self == RESP_A::BYPASS + } + #[doc = "Checks if the value of the field is `PULLDOWN`"] + #[inline(always)] + pub fn is_pulldown(&self) -> bool { + **self == RESP_A::PULLDOWN + } + #[doc = "Checks if the value of the field is `PULLUP`"] + #[inline(always)] + pub fn is_pullup(&self) -> bool { + **self == RESP_A::PULLUP + } + #[doc = "Checks if the value of the field is `VDD1_2`"] + #[inline(always)] + pub fn is_vdd1_2(&self) -> bool { + **self == RESP_A::VDD1_2 + } +} +impl core::ops::Deref for RESP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RESP` writer - Positive channel resistor control"] +pub struct RESP_W<'a> { + w: &'a mut W, +} +impl<'a> RESP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RESP_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "Bypass resistor ladder"] + #[inline(always)] + pub fn bypass(self) -> &'a mut W { + self.variant(RESP_A::BYPASS) + } + #[doc = "Pull-down to GND"] + #[inline(always)] + pub fn pulldown(self) -> &'a mut W { + self.variant(RESP_A::PULLDOWN) + } + #[doc = "Pull-up to VDD"] + #[inline(always)] + pub fn pullup(self) -> &'a mut W { + self.variant(RESP_A::PULLUP) + } + #[doc = "Set input at VDD/2"] + #[inline(always)] + pub fn vdd1_2(self) -> &'a mut W { + self.variant(RESP_A::VDD1_2) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); + self.w + } +} +#[doc = "Negative channel resistor control\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum RESN_A { + #[doc = "0: Bypass resistor ladder"] + BYPASS = 0, + #[doc = "1: Pull-down to GND"] + PULLDOWN = 1, + #[doc = "2: Pull-up to VDD"] + PULLUP = 2, + #[doc = "3: Set input at VDD/2"] + VDD1_2 = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: RESN_A) -> Self { + variant as _ + } +} +#[doc = "Field `RESN` reader - Negative channel resistor control"] +pub struct RESN_R(crate::FieldReader); +impl RESN_R { + pub(crate) fn new(bits: u8) -> Self { + RESN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RESN_A { + match self.bits { + 0 => RESN_A::BYPASS, + 1 => RESN_A::PULLDOWN, + 2 => RESN_A::PULLUP, + 3 => RESN_A::VDD1_2, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `BYPASS`"] + #[inline(always)] + pub fn is_bypass(&self) -> bool { + **self == RESN_A::BYPASS + } + #[doc = "Checks if the value of the field is `PULLDOWN`"] + #[inline(always)] + pub fn is_pulldown(&self) -> bool { + **self == RESN_A::PULLDOWN + } + #[doc = "Checks if the value of the field is `PULLUP`"] + #[inline(always)] + pub fn is_pullup(&self) -> bool { + **self == RESN_A::PULLUP + } + #[doc = "Checks if the value of the field is `VDD1_2`"] + #[inline(always)] + pub fn is_vdd1_2(&self) -> bool { + **self == RESN_A::VDD1_2 + } +} +impl core::ops::Deref for RESN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RESN` writer - Negative channel resistor control"] +pub struct RESN_W<'a> { + w: &'a mut W, +} +impl<'a> RESN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RESN_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "Bypass resistor ladder"] + #[inline(always)] + pub fn bypass(self) -> &'a mut W { + self.variant(RESN_A::BYPASS) + } + #[doc = "Pull-down to GND"] + #[inline(always)] + pub fn pulldown(self) -> &'a mut W { + self.variant(RESN_A::PULLDOWN) + } + #[doc = "Pull-up to VDD"] + #[inline(always)] + pub fn pullup(self) -> &'a mut W { + self.variant(RESN_A::PULLUP) + } + #[doc = "Set input at VDD/2"] + #[inline(always)] + pub fn vdd1_2(self) -> &'a mut W { + self.variant(RESN_A::VDD1_2) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x03 << 4)) | ((value as u32 & 0x03) << 4); + self.w + } +} +#[doc = "Gain control\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum GAIN_A { + #[doc = "0: 1/6"] + GAIN1_6 = 0, + #[doc = "1: 1/5"] + GAIN1_5 = 1, + #[doc = "2: 1/4"] + GAIN1_4 = 2, + #[doc = "3: 1/3"] + GAIN1_3 = 3, + #[doc = "4: 1/2"] + GAIN1_2 = 4, + #[doc = "5: 1"] + GAIN1 = 5, + #[doc = "6: 2"] + GAIN2 = 6, + #[doc = "7: 4"] + GAIN4 = 7, +} +impl From for u8 { + #[inline(always)] + fn from(variant: GAIN_A) -> Self { + variant as _ + } +} +#[doc = "Field `GAIN` reader - Gain control"] +pub struct GAIN_R(crate::FieldReader); +impl GAIN_R { + pub(crate) fn new(bits: u8) -> Self { + GAIN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> GAIN_A { + match self.bits { + 0 => GAIN_A::GAIN1_6, + 1 => GAIN_A::GAIN1_5, + 2 => GAIN_A::GAIN1_4, + 3 => GAIN_A::GAIN1_3, + 4 => GAIN_A::GAIN1_2, + 5 => GAIN_A::GAIN1, + 6 => GAIN_A::GAIN2, + 7 => GAIN_A::GAIN4, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `GAIN1_6`"] + #[inline(always)] + pub fn is_gain1_6(&self) -> bool { + **self == GAIN_A::GAIN1_6 + } + #[doc = "Checks if the value of the field is `GAIN1_5`"] + #[inline(always)] + pub fn is_gain1_5(&self) -> bool { + **self == GAIN_A::GAIN1_5 + } + #[doc = "Checks if the value of the field is `GAIN1_4`"] + #[inline(always)] + pub fn is_gain1_4(&self) -> bool { + **self == GAIN_A::GAIN1_4 + } + #[doc = "Checks if the value of the field is `GAIN1_3`"] + #[inline(always)] + pub fn is_gain1_3(&self) -> bool { + **self == GAIN_A::GAIN1_3 + } + #[doc = "Checks if the value of the field is `GAIN1_2`"] + #[inline(always)] + pub fn is_gain1_2(&self) -> bool { + **self == GAIN_A::GAIN1_2 + } + #[doc = "Checks if the value of the field is `GAIN1`"] + #[inline(always)] + pub fn is_gain1(&self) -> bool { + **self == GAIN_A::GAIN1 + } + #[doc = "Checks if the value of the field is `GAIN2`"] + #[inline(always)] + pub fn is_gain2(&self) -> bool { + **self == GAIN_A::GAIN2 + } + #[doc = "Checks if the value of the field is `GAIN4`"] + #[inline(always)] + pub fn is_gain4(&self) -> bool { + **self == GAIN_A::GAIN4 + } +} +impl core::ops::Deref for GAIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `GAIN` writer - Gain control"] +pub struct GAIN_W<'a> { + w: &'a mut W, +} +impl<'a> GAIN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: GAIN_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "1/6"] + #[inline(always)] + pub fn gain1_6(self) -> &'a mut W { + self.variant(GAIN_A::GAIN1_6) + } + #[doc = "1/5"] + #[inline(always)] + pub fn gain1_5(self) -> &'a mut W { + self.variant(GAIN_A::GAIN1_5) + } + #[doc = "1/4"] + #[inline(always)] + pub fn gain1_4(self) -> &'a mut W { + self.variant(GAIN_A::GAIN1_4) + } + #[doc = "1/3"] + #[inline(always)] + pub fn gain1_3(self) -> &'a mut W { + self.variant(GAIN_A::GAIN1_3) + } + #[doc = "1/2"] + #[inline(always)] + pub fn gain1_2(self) -> &'a mut W { + self.variant(GAIN_A::GAIN1_2) + } + #[doc = "1"] + #[inline(always)] + pub fn gain1(self) -> &'a mut W { + self.variant(GAIN_A::GAIN1) + } + #[doc = "2"] + #[inline(always)] + pub fn gain2(self) -> &'a mut W { + self.variant(GAIN_A::GAIN2) + } + #[doc = "4"] + #[inline(always)] + pub fn gain4(self) -> &'a mut W { + self.variant(GAIN_A::GAIN4) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x07 << 8)) | ((value as u32 & 0x07) << 8); + self.w + } +} +#[doc = "Reference control\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum REFSEL_A { + #[doc = "0: Internal reference (0.6 V)"] + INTERNAL = 0, + #[doc = "1: VDD/4 as reference"] + VDD1_4 = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: REFSEL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `REFSEL` reader - Reference control"] +pub struct REFSEL_R(crate::FieldReader); +impl REFSEL_R { + pub(crate) fn new(bits: bool) -> Self { + REFSEL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> REFSEL_A { + match self.bits { + false => REFSEL_A::INTERNAL, + true => REFSEL_A::VDD1_4, + } + } + #[doc = "Checks if the value of the field is `INTERNAL`"] + #[inline(always)] + pub fn is_internal(&self) -> bool { + **self == REFSEL_A::INTERNAL + } + #[doc = "Checks if the value of the field is `VDD1_4`"] + #[inline(always)] + pub fn is_vdd1_4(&self) -> bool { + **self == REFSEL_A::VDD1_4 + } +} +impl core::ops::Deref for REFSEL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `REFSEL` writer - Reference control"] +pub struct REFSEL_W<'a> { + w: &'a mut W, +} +impl<'a> REFSEL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: REFSEL_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Internal reference (0.6 V)"] + #[inline(always)] + pub fn internal(self) -> &'a mut W { + self.variant(REFSEL_A::INTERNAL) + } + #[doc = "VDD/4 as reference"] + #[inline(always)] + pub fn vdd1_4(self) -> &'a mut W { + self.variant(REFSEL_A::VDD1_4) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Acquisition time, the time the ADC uses to sample the input voltage\n\nValue on reset: 2"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum TACQ_A { + #[doc = "0: 3 us"] + _3US = 0, + #[doc = "1: 5 us"] + _5US = 1, + #[doc = "2: 10 us"] + _10US = 2, + #[doc = "3: 15 us"] + _15US = 3, + #[doc = "4: 20 us"] + _20US = 4, + #[doc = "5: 40 us"] + _40US = 5, +} +impl From for u8 { + #[inline(always)] + fn from(variant: TACQ_A) -> Self { + variant as _ + } +} +#[doc = "Field `TACQ` reader - Acquisition time, the time the ADC uses to sample the input voltage"] +pub struct TACQ_R(crate::FieldReader); +impl TACQ_R { + pub(crate) fn new(bits: u8) -> Self { + TACQ_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(TACQ_A::_3US), + 1 => Some(TACQ_A::_5US), + 2 => Some(TACQ_A::_10US), + 3 => Some(TACQ_A::_15US), + 4 => Some(TACQ_A::_20US), + 5 => Some(TACQ_A::_40US), + _ => None, + } + } + #[doc = "Checks if the value of the field is `_3US`"] + #[inline(always)] + pub fn is_3us(&self) -> bool { + **self == TACQ_A::_3US + } + #[doc = "Checks if the value of the field is `_5US`"] + #[inline(always)] + pub fn is_5us(&self) -> bool { + **self == TACQ_A::_5US + } + #[doc = "Checks if the value of the field is `_10US`"] + #[inline(always)] + pub fn is_10us(&self) -> bool { + **self == TACQ_A::_10US + } + #[doc = "Checks if the value of the field is `_15US`"] + #[inline(always)] + pub fn is_15us(&self) -> bool { + **self == TACQ_A::_15US + } + #[doc = "Checks if the value of the field is `_20US`"] + #[inline(always)] + pub fn is_20us(&self) -> bool { + **self == TACQ_A::_20US + } + #[doc = "Checks if the value of the field is `_40US`"] + #[inline(always)] + pub fn is_40us(&self) -> bool { + **self == TACQ_A::_40US + } +} +impl core::ops::Deref for TACQ_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TACQ` writer - Acquisition time, the time the ADC uses to sample the input voltage"] +pub struct TACQ_W<'a> { + w: &'a mut W, +} +impl<'a> TACQ_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TACQ_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "3 us"] + #[inline(always)] + pub fn _3us(self) -> &'a mut W { + self.variant(TACQ_A::_3US) + } + #[doc = "5 us"] + #[inline(always)] + pub fn _5us(self) -> &'a mut W { + self.variant(TACQ_A::_5US) + } + #[doc = "10 us"] + #[inline(always)] + pub fn _10us(self) -> &'a mut W { + self.variant(TACQ_A::_10US) + } + #[doc = "15 us"] + #[inline(always)] + pub fn _15us(self) -> &'a mut W { + self.variant(TACQ_A::_15US) + } + #[doc = "20 us"] + #[inline(always)] + pub fn _20us(self) -> &'a mut W { + self.variant(TACQ_A::_20US) + } + #[doc = "40 us"] + #[inline(always)] + pub fn _40us(self) -> &'a mut W { + self.variant(TACQ_A::_40US) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x07 << 16)) | ((value as u32 & 0x07) << 16); + self.w + } +} +#[doc = "Enable differential mode\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum MODE_A { + #[doc = "0: Single ended, PSELN will be ignored, negative input to ADC shorted to GND"] + SE = 0, + #[doc = "1: Differential"] + DIFF = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: MODE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `MODE` reader - Enable differential mode"] +pub struct MODE_R(crate::FieldReader); +impl MODE_R { + pub(crate) fn new(bits: bool) -> Self { + MODE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> MODE_A { + match self.bits { + false => MODE_A::SE, + true => MODE_A::DIFF, + } + } + #[doc = "Checks if the value of the field is `SE`"] + #[inline(always)] + pub fn is_se(&self) -> bool { + **self == MODE_A::SE + } + #[doc = "Checks if the value of the field is `DIFF`"] + #[inline(always)] + pub fn is_diff(&self) -> bool { + **self == MODE_A::DIFF + } +} +impl core::ops::Deref for MODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MODE` writer - Enable differential mode"] +pub struct MODE_W<'a> { + w: &'a mut W, +} +impl<'a> MODE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: MODE_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Single ended, PSELN will be ignored, negative input to ADC shorted to GND"] + #[inline(always)] + pub fn se(self) -> &'a mut W { + self.variant(MODE_A::SE) + } + #[doc = "Differential"] + #[inline(always)] + pub fn diff(self) -> &'a mut W { + self.variant(MODE_A::DIFF) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Enable burst mode\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum BURST_A { + #[doc = "0: Burst mode is disabled (normal operation)"] + DISABLED = 0, + #[doc = "1: Burst mode is enabled. SAADC takes 2^OVERSAMPLE number of samples as fast as it can, and sends the average to Data RAM."] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: BURST_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `BURST` reader - Enable burst mode"] +pub struct BURST_R(crate::FieldReader); +impl BURST_R { + pub(crate) fn new(bits: bool) -> Self { + BURST_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> BURST_A { + match self.bits { + false => BURST_A::DISABLED, + true => BURST_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == BURST_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == BURST_A::ENABLED + } +} +impl core::ops::Deref for BURST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BURST` writer - Enable burst mode"] +pub struct BURST_W<'a> { + w: &'a mut W, +} +impl<'a> BURST_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: BURST_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Burst mode is disabled (normal operation)"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(BURST_A::DISABLED) + } + #[doc = "Burst mode is enabled. SAADC takes 2^OVERSAMPLE number of samples as fast as it can, and sends the average to Data RAM."] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(BURST_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +impl R { + #[doc = "Bits 0:1 - Positive channel resistor control"] + #[inline(always)] + pub fn resp(&self) -> RESP_R { + RESP_R::new((self.bits & 0x03) as u8) + } + #[doc = "Bits 4:5 - Negative channel resistor control"] + #[inline(always)] + pub fn resn(&self) -> RESN_R { + RESN_R::new(((self.bits >> 4) & 0x03) as u8) + } + #[doc = "Bits 8:10 - Gain control"] + #[inline(always)] + pub fn gain(&self) -> GAIN_R { + GAIN_R::new(((self.bits >> 8) & 0x07) as u8) + } + #[doc = "Bit 12 - Reference control"] + #[inline(always)] + pub fn refsel(&self) -> REFSEL_R { + REFSEL_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bits 16:18 - Acquisition time, the time the ADC uses to sample the input voltage"] + #[inline(always)] + pub fn tacq(&self) -> TACQ_R { + TACQ_R::new(((self.bits >> 16) & 0x07) as u8) + } + #[doc = "Bit 20 - Enable differential mode"] + #[inline(always)] + pub fn mode(&self) -> MODE_R { + MODE_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 24 - Enable burst mode"] + #[inline(always)] + pub fn burst(&self) -> BURST_R { + BURST_R::new(((self.bits >> 24) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:1 - Positive channel resistor control"] + #[inline(always)] + pub fn resp(&mut self) -> RESP_W { + RESP_W { w: self } + } + #[doc = "Bits 4:5 - Negative channel resistor control"] + #[inline(always)] + pub fn resn(&mut self) -> RESN_W { + RESN_W { w: self } + } + #[doc = "Bits 8:10 - Gain control"] + #[inline(always)] + pub fn gain(&mut self) -> GAIN_W { + GAIN_W { w: self } + } + #[doc = "Bit 12 - Reference control"] + #[inline(always)] + pub fn refsel(&mut self) -> REFSEL_W { + REFSEL_W { w: self } + } + #[doc = "Bits 16:18 - Acquisition time, the time the ADC uses to sample the input voltage"] + #[inline(always)] + pub fn tacq(&mut self) -> TACQ_W { + TACQ_W { w: self } + } + #[doc = "Bit 20 - Enable differential mode"] + #[inline(always)] + pub fn mode(&mut self) -> MODE_W { + MODE_W { w: self } + } + #[doc = "Bit 24 - Enable burst mode"] + #[inline(always)] + pub fn burst(&mut self) -> BURST_W { + BURST_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description cluster\\[0\\]: Input configuration for CH\\[0\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [config](index.html) module"] +pub struct CONFIG_SPEC; +impl crate::RegisterSpec for CONFIG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [config::R](R) reader structure"] +impl crate::Readable for CONFIG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [config::W](W) writer structure"] +impl crate::Writable for CONFIG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CONFIG to value 0x0002_0000"] +impl crate::Resettable for CONFIG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0002_0000 + } +} diff --git a/src/saadc/ch/limit.rs b/src/saadc/ch/limit.rs new file mode 100644 index 0000000..8b9e5fb --- /dev/null +++ b/src/saadc/ch/limit.rs @@ -0,0 +1,138 @@ +#[doc = "Register `LIMIT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `LIMIT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `LOW` reader - Low level limit"] +pub struct LOW_R(crate::FieldReader); +impl LOW_R { + pub(crate) fn new(bits: u16) -> Self { + LOW_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for LOW_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LOW` writer - Low level limit"] +pub struct LOW_W<'a> { + w: &'a mut W, +} +impl<'a> LOW_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff) | (value as u32 & 0xffff); + self.w + } +} +#[doc = "Field `HIGH` reader - High level limit"] +pub struct HIGH_R(crate::FieldReader); +impl HIGH_R { + pub(crate) fn new(bits: u16) -> Self { + HIGH_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for HIGH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HIGH` writer - High level limit"] +pub struct HIGH_W<'a> { + w: &'a mut W, +} +impl<'a> HIGH_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !(0xffff << 16)) | ((value as u32 & 0xffff) << 16); + self.w + } +} +impl R { + #[doc = "Bits 0:15 - Low level limit"] + #[inline(always)] + pub fn low(&self) -> LOW_R { + LOW_R::new((self.bits & 0xffff) as u16) + } + #[doc = "Bits 16:31 - High level limit"] + #[inline(always)] + pub fn high(&self) -> HIGH_R { + HIGH_R::new(((self.bits >> 16) & 0xffff) as u16) + } +} +impl W { + #[doc = "Bits 0:15 - Low level limit"] + #[inline(always)] + pub fn low(&mut self) -> LOW_W { + LOW_W { w: self } + } + #[doc = "Bits 16:31 - High level limit"] + #[inline(always)] + pub fn high(&mut self) -> HIGH_W { + HIGH_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description cluster\\[0\\]: High/low limits for event monitoring a channel\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [limit](index.html) module"] +pub struct LIMIT_SPEC; +impl crate::RegisterSpec for LIMIT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [limit::R](R) reader structure"] +impl crate::Readable for LIMIT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [limit::W](W) writer structure"] +impl crate::Writable for LIMIT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LIMIT to value 0x7fff_8000"] +impl crate::Resettable for LIMIT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x7fff_8000 + } +} diff --git a/src/saadc/ch/pseln.rs b/src/saadc/ch/pseln.rs new file mode 100644 index 0000000..1cc2599 --- /dev/null +++ b/src/saadc/ch/pseln.rs @@ -0,0 +1,255 @@ +#[doc = "Register `PSELN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PSELN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Analog negative input, enables differential channel\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum PSELN_A { + #[doc = "0: Not connected"] + NC = 0, + #[doc = "1: AIN0"] + ANALOGINPUT0 = 1, + #[doc = "2: AIN1"] + ANALOGINPUT1 = 2, + #[doc = "3: AIN2"] + ANALOGINPUT2 = 3, + #[doc = "4: AIN3"] + ANALOGINPUT3 = 4, + #[doc = "5: AIN4"] + ANALOGINPUT4 = 5, + #[doc = "6: AIN5"] + ANALOGINPUT5 = 6, + #[doc = "7: AIN6"] + ANALOGINPUT6 = 7, + #[doc = "8: AIN7"] + ANALOGINPUT7 = 8, + #[doc = "9: VDD"] + VDD = 9, +} +impl From for u8 { + #[inline(always)] + fn from(variant: PSELN_A) -> Self { + variant as _ + } +} +#[doc = "Field `PSELN` reader - Analog negative input, enables differential channel"] +pub struct PSELN_R(crate::FieldReader); +impl PSELN_R { + pub(crate) fn new(bits: u8) -> Self { + PSELN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(PSELN_A::NC), + 1 => Some(PSELN_A::ANALOGINPUT0), + 2 => Some(PSELN_A::ANALOGINPUT1), + 3 => Some(PSELN_A::ANALOGINPUT2), + 4 => Some(PSELN_A::ANALOGINPUT3), + 5 => Some(PSELN_A::ANALOGINPUT4), + 6 => Some(PSELN_A::ANALOGINPUT5), + 7 => Some(PSELN_A::ANALOGINPUT6), + 8 => Some(PSELN_A::ANALOGINPUT7), + 9 => Some(PSELN_A::VDD), + _ => None, + } + } + #[doc = "Checks if the value of the field is `NC`"] + #[inline(always)] + pub fn is_nc(&self) -> bool { + **self == PSELN_A::NC + } + #[doc = "Checks if the value of the field is `ANALOGINPUT0`"] + #[inline(always)] + pub fn is_analog_input0(&self) -> bool { + **self == PSELN_A::ANALOGINPUT0 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT1`"] + #[inline(always)] + pub fn is_analog_input1(&self) -> bool { + **self == PSELN_A::ANALOGINPUT1 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT2`"] + #[inline(always)] + pub fn is_analog_input2(&self) -> bool { + **self == PSELN_A::ANALOGINPUT2 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT3`"] + #[inline(always)] + pub fn is_analog_input3(&self) -> bool { + **self == PSELN_A::ANALOGINPUT3 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT4`"] + #[inline(always)] + pub fn is_analog_input4(&self) -> bool { + **self == PSELN_A::ANALOGINPUT4 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT5`"] + #[inline(always)] + pub fn is_analog_input5(&self) -> bool { + **self == PSELN_A::ANALOGINPUT5 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT6`"] + #[inline(always)] + pub fn is_analog_input6(&self) -> bool { + **self == PSELN_A::ANALOGINPUT6 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT7`"] + #[inline(always)] + pub fn is_analog_input7(&self) -> bool { + **self == PSELN_A::ANALOGINPUT7 + } + #[doc = "Checks if the value of the field is `VDD`"] + #[inline(always)] + pub fn is_vdd(&self) -> bool { + **self == PSELN_A::VDD + } +} +impl core::ops::Deref for PSELN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PSELN` writer - Analog negative input, enables differential channel"] +pub struct PSELN_W<'a> { + w: &'a mut W, +} +impl<'a> PSELN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PSELN_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Not connected"] + #[inline(always)] + pub fn nc(self) -> &'a mut W { + self.variant(PSELN_A::NC) + } + #[doc = "AIN0"] + #[inline(always)] + pub fn analog_input0(self) -> &'a mut W { + self.variant(PSELN_A::ANALOGINPUT0) + } + #[doc = "AIN1"] + #[inline(always)] + pub fn analog_input1(self) -> &'a mut W { + self.variant(PSELN_A::ANALOGINPUT1) + } + #[doc = "AIN2"] + #[inline(always)] + pub fn analog_input2(self) -> &'a mut W { + self.variant(PSELN_A::ANALOGINPUT2) + } + #[doc = "AIN3"] + #[inline(always)] + pub fn analog_input3(self) -> &'a mut W { + self.variant(PSELN_A::ANALOGINPUT3) + } + #[doc = "AIN4"] + #[inline(always)] + pub fn analog_input4(self) -> &'a mut W { + self.variant(PSELN_A::ANALOGINPUT4) + } + #[doc = "AIN5"] + #[inline(always)] + pub fn analog_input5(self) -> &'a mut W { + self.variant(PSELN_A::ANALOGINPUT5) + } + #[doc = "AIN6"] + #[inline(always)] + pub fn analog_input6(self) -> &'a mut W { + self.variant(PSELN_A::ANALOGINPUT6) + } + #[doc = "AIN7"] + #[inline(always)] + pub fn analog_input7(self) -> &'a mut W { + self.variant(PSELN_A::ANALOGINPUT7) + } + #[doc = "VDD"] + #[inline(always)] + pub fn vdd(self) -> &'a mut W { + self.variant(PSELN_A::VDD) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Analog negative input, enables differential channel"] + #[inline(always)] + pub fn pseln(&self) -> PSELN_R { + PSELN_R::new((self.bits & 0x1f) as u8) + } +} +impl W { + #[doc = "Bits 0:4 - Analog negative input, enables differential channel"] + #[inline(always)] + pub fn pseln(&mut self) -> PSELN_W { + PSELN_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description cluster\\[0\\]: Input negative pin selection for CH\\[0\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pseln](index.html) module"] +pub struct PSELN_SPEC; +impl crate::RegisterSpec for PSELN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pseln::R](R) reader structure"] +impl crate::Readable for PSELN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pseln::W](W) writer structure"] +impl crate::Writable for PSELN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PSELN to value 0"] +impl crate::Resettable for PSELN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/saadc/ch/pselp.rs b/src/saadc/ch/pselp.rs new file mode 100644 index 0000000..3da8082 --- /dev/null +++ b/src/saadc/ch/pselp.rs @@ -0,0 +1,255 @@ +#[doc = "Register `PSELP` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PSELP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Analog positive input channel\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum PSELP_A { + #[doc = "0: Not connected"] + NC = 0, + #[doc = "1: AIN0"] + ANALOGINPUT0 = 1, + #[doc = "2: AIN1"] + ANALOGINPUT1 = 2, + #[doc = "3: AIN2"] + ANALOGINPUT2 = 3, + #[doc = "4: AIN3"] + ANALOGINPUT3 = 4, + #[doc = "5: AIN4"] + ANALOGINPUT4 = 5, + #[doc = "6: AIN5"] + ANALOGINPUT5 = 6, + #[doc = "7: AIN6"] + ANALOGINPUT6 = 7, + #[doc = "8: AIN7"] + ANALOGINPUT7 = 8, + #[doc = "9: VDD"] + VDD = 9, +} +impl From for u8 { + #[inline(always)] + fn from(variant: PSELP_A) -> Self { + variant as _ + } +} +#[doc = "Field `PSELP` reader - Analog positive input channel"] +pub struct PSELP_R(crate::FieldReader); +impl PSELP_R { + pub(crate) fn new(bits: u8) -> Self { + PSELP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(PSELP_A::NC), + 1 => Some(PSELP_A::ANALOGINPUT0), + 2 => Some(PSELP_A::ANALOGINPUT1), + 3 => Some(PSELP_A::ANALOGINPUT2), + 4 => Some(PSELP_A::ANALOGINPUT3), + 5 => Some(PSELP_A::ANALOGINPUT4), + 6 => Some(PSELP_A::ANALOGINPUT5), + 7 => Some(PSELP_A::ANALOGINPUT6), + 8 => Some(PSELP_A::ANALOGINPUT7), + 9 => Some(PSELP_A::VDD), + _ => None, + } + } + #[doc = "Checks if the value of the field is `NC`"] + #[inline(always)] + pub fn is_nc(&self) -> bool { + **self == PSELP_A::NC + } + #[doc = "Checks if the value of the field is `ANALOGINPUT0`"] + #[inline(always)] + pub fn is_analog_input0(&self) -> bool { + **self == PSELP_A::ANALOGINPUT0 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT1`"] + #[inline(always)] + pub fn is_analog_input1(&self) -> bool { + **self == PSELP_A::ANALOGINPUT1 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT2`"] + #[inline(always)] + pub fn is_analog_input2(&self) -> bool { + **self == PSELP_A::ANALOGINPUT2 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT3`"] + #[inline(always)] + pub fn is_analog_input3(&self) -> bool { + **self == PSELP_A::ANALOGINPUT3 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT4`"] + #[inline(always)] + pub fn is_analog_input4(&self) -> bool { + **self == PSELP_A::ANALOGINPUT4 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT5`"] + #[inline(always)] + pub fn is_analog_input5(&self) -> bool { + **self == PSELP_A::ANALOGINPUT5 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT6`"] + #[inline(always)] + pub fn is_analog_input6(&self) -> bool { + **self == PSELP_A::ANALOGINPUT6 + } + #[doc = "Checks if the value of the field is `ANALOGINPUT7`"] + #[inline(always)] + pub fn is_analog_input7(&self) -> bool { + **self == PSELP_A::ANALOGINPUT7 + } + #[doc = "Checks if the value of the field is `VDD`"] + #[inline(always)] + pub fn is_vdd(&self) -> bool { + **self == PSELP_A::VDD + } +} +impl core::ops::Deref for PSELP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PSELP` writer - Analog positive input channel"] +pub struct PSELP_W<'a> { + w: &'a mut W, +} +impl<'a> PSELP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PSELP_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Not connected"] + #[inline(always)] + pub fn nc(self) -> &'a mut W { + self.variant(PSELP_A::NC) + } + #[doc = "AIN0"] + #[inline(always)] + pub fn analog_input0(self) -> &'a mut W { + self.variant(PSELP_A::ANALOGINPUT0) + } + #[doc = "AIN1"] + #[inline(always)] + pub fn analog_input1(self) -> &'a mut W { + self.variant(PSELP_A::ANALOGINPUT1) + } + #[doc = "AIN2"] + #[inline(always)] + pub fn analog_input2(self) -> &'a mut W { + self.variant(PSELP_A::ANALOGINPUT2) + } + #[doc = "AIN3"] + #[inline(always)] + pub fn analog_input3(self) -> &'a mut W { + self.variant(PSELP_A::ANALOGINPUT3) + } + #[doc = "AIN4"] + #[inline(always)] + pub fn analog_input4(self) -> &'a mut W { + self.variant(PSELP_A::ANALOGINPUT4) + } + #[doc = "AIN5"] + #[inline(always)] + pub fn analog_input5(self) -> &'a mut W { + self.variant(PSELP_A::ANALOGINPUT5) + } + #[doc = "AIN6"] + #[inline(always)] + pub fn analog_input6(self) -> &'a mut W { + self.variant(PSELP_A::ANALOGINPUT6) + } + #[doc = "AIN7"] + #[inline(always)] + pub fn analog_input7(self) -> &'a mut W { + self.variant(PSELP_A::ANALOGINPUT7) + } + #[doc = "VDD"] + #[inline(always)] + pub fn vdd(self) -> &'a mut W { + self.variant(PSELP_A::VDD) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Analog positive input channel"] + #[inline(always)] + pub fn pselp(&self) -> PSELP_R { + PSELP_R::new((self.bits & 0x1f) as u8) + } +} +impl W { + #[doc = "Bits 0:4 - Analog positive input channel"] + #[inline(always)] + pub fn pselp(&mut self) -> PSELP_W { + PSELP_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description cluster\\[0\\]: Input positive pin selection for CH\\[0\\]\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pselp](index.html) module"] +pub struct PSELP_SPEC; +impl crate::RegisterSpec for PSELP_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pselp::R](R) reader structure"] +impl crate::Readable for PSELP_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pselp::W](W) writer structure"] +impl crate::Writable for PSELP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PSELP to value 0"] +impl crate::Resettable for PSELP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/saadc/enable.rs b/src/saadc/enable.rs new file mode 100644 index 0000000..0655da9 --- /dev/null +++ b/src/saadc/enable.rs @@ -0,0 +1,159 @@ +#[doc = "Register `ENABLE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ENABLE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable ADC\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENABLE_A { + #[doc = "0: Disable ADC"] + DISABLED = 0, + #[doc = "1: Enable ADC"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENABLE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENABLE` reader - Enable or disable ADC"] +pub struct ENABLE_R(crate::FieldReader); +impl ENABLE_R { + pub(crate) fn new(bits: bool) -> Self { + ENABLE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENABLE_A { + match self.bits { + false => ENABLE_A::DISABLED, + true => ENABLE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENABLE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENABLE_A::ENABLED + } +} +impl core::ops::Deref for ENABLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENABLE` writer - Enable or disable ADC"] +pub struct ENABLE_W<'a> { + w: &'a mut W, +} +impl<'a> ENABLE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENABLE_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable ADC"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENABLE_A::DISABLED) + } + #[doc = "Enable ADC"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENABLE_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable or disable ADC"] + #[inline(always)] + pub fn enable(&self) -> ENABLE_R { + ENABLE_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Enable or disable ADC"] + #[inline(always)] + pub fn enable(&mut self) -> ENABLE_W { + ENABLE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable or disable ADC\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [enable](index.html) module"] +pub struct ENABLE_SPEC; +impl crate::RegisterSpec for ENABLE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [enable::R](R) reader structure"] +impl crate::Readable for ENABLE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [enable::W](W) writer structure"] +impl crate::Writable for ENABLE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ENABLE to value 0"] +impl crate::Resettable for ENABLE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/saadc/events_calibratedone.rs b/src/saadc/events_calibratedone.rs new file mode 100644 index 0000000..0e768a4 --- /dev/null +++ b/src/saadc/events_calibratedone.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_CALIBRATEDONE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_CALIBRATEDONE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Calibration is complete\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_calibratedone](index.html) module"] +pub struct EVENTS_CALIBRATEDONE_SPEC; +impl crate::RegisterSpec for EVENTS_CALIBRATEDONE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_calibratedone::R](R) reader structure"] +impl crate::Readable for EVENTS_CALIBRATEDONE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_calibratedone::W](W) writer structure"] +impl crate::Writable for EVENTS_CALIBRATEDONE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_CALIBRATEDONE to value 0"] +impl crate::Resettable for EVENTS_CALIBRATEDONE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/saadc/events_ch.rs b/src/saadc/events_ch.rs new file mode 100644 index 0000000..628f275 --- /dev/null +++ b/src/saadc/events_ch.rs @@ -0,0 +1,8 @@ +#[doc = "LIMITH register accessor: an alias for `Reg`"] +pub type LIMITH = crate::Reg; +#[doc = "Description cluster\\[0\\]: Last results is equal or above CH\\[0\\].LIMIT.HIGH"] +pub mod limith; +#[doc = "LIMITL register accessor: an alias for `Reg`"] +pub type LIMITL = crate::Reg; +#[doc = "Description cluster\\[0\\]: Last results is equal or below CH\\[0\\].LIMIT.LOW"] +pub mod limitl; diff --git a/src/saadc/events_ch/limith.rs b/src/saadc/events_ch/limith.rs new file mode 100644 index 0000000..ade165f --- /dev/null +++ b/src/saadc/events_ch/limith.rs @@ -0,0 +1,64 @@ +#[doc = "Register `LIMITH` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `LIMITH` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description cluster\\[0\\]: Last results is equal or above CH\\[0\\].LIMIT.HIGH\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [limith](index.html) module"] +pub struct LIMITH_SPEC; +impl crate::RegisterSpec for LIMITH_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [limith::R](R) reader structure"] +impl crate::Readable for LIMITH_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [limith::W](W) writer structure"] +impl crate::Writable for LIMITH_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LIMITH to value 0"] +impl crate::Resettable for LIMITH_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/saadc/events_ch/limitl.rs b/src/saadc/events_ch/limitl.rs new file mode 100644 index 0000000..393e838 --- /dev/null +++ b/src/saadc/events_ch/limitl.rs @@ -0,0 +1,64 @@ +#[doc = "Register `LIMITL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `LIMITL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description cluster\\[0\\]: Last results is equal or below CH\\[0\\].LIMIT.LOW\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [limitl](index.html) module"] +pub struct LIMITL_SPEC; +impl crate::RegisterSpec for LIMITL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [limitl::R](R) reader structure"] +impl crate::Readable for LIMITL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [limitl::W](W) writer structure"] +impl crate::Writable for LIMITL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LIMITL to value 0"] +impl crate::Resettable for LIMITL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/saadc/events_done.rs b/src/saadc/events_done.rs new file mode 100644 index 0000000..d88d440 --- /dev/null +++ b/src/saadc/events_done.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_DONE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_DONE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "A conversion task has been completed. Depending on the mode, multiple conversions might be needed for a result to be transferred to RAM.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_done](index.html) module"] +pub struct EVENTS_DONE_SPEC; +impl crate::RegisterSpec for EVENTS_DONE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_done::R](R) reader structure"] +impl crate::Readable for EVENTS_DONE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_done::W](W) writer structure"] +impl crate::Writable for EVENTS_DONE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_DONE to value 0"] +impl crate::Resettable for EVENTS_DONE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/saadc/events_end.rs b/src/saadc/events_end.rs new file mode 100644 index 0000000..80487cf --- /dev/null +++ b/src/saadc/events_end.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_END` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_END` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "The ADC has filled up the Result buffer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_end](index.html) module"] +pub struct EVENTS_END_SPEC; +impl crate::RegisterSpec for EVENTS_END_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_end::R](R) reader structure"] +impl crate::Readable for EVENTS_END_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_end::W](W) writer structure"] +impl crate::Writable for EVENTS_END_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_END to value 0"] +impl crate::Resettable for EVENTS_END_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/saadc/events_resultdone.rs b/src/saadc/events_resultdone.rs new file mode 100644 index 0000000..0f72e77 --- /dev/null +++ b/src/saadc/events_resultdone.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_RESULTDONE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_RESULTDONE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "A result is ready to get transferred to RAM.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_resultdone](index.html) module"] +pub struct EVENTS_RESULTDONE_SPEC; +impl crate::RegisterSpec for EVENTS_RESULTDONE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_resultdone::R](R) reader structure"] +impl crate::Readable for EVENTS_RESULTDONE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_resultdone::W](W) writer structure"] +impl crate::Writable for EVENTS_RESULTDONE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_RESULTDONE to value 0"] +impl crate::Resettable for EVENTS_RESULTDONE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/saadc/events_started.rs b/src/saadc/events_started.rs new file mode 100644 index 0000000..a7c5d1a --- /dev/null +++ b/src/saadc/events_started.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_STARTED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_STARTED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "The ADC has started\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_started](index.html) module"] +pub struct EVENTS_STARTED_SPEC; +impl crate::RegisterSpec for EVENTS_STARTED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_started::R](R) reader structure"] +impl crate::Readable for EVENTS_STARTED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_started::W](W) writer structure"] +impl crate::Writable for EVENTS_STARTED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_STARTED to value 0"] +impl crate::Resettable for EVENTS_STARTED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/saadc/events_stopped.rs b/src/saadc/events_stopped.rs new file mode 100644 index 0000000..a9c1d25 --- /dev/null +++ b/src/saadc/events_stopped.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_STOPPED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_STOPPED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "The ADC has stopped\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_stopped](index.html) module"] +pub struct EVENTS_STOPPED_SPEC; +impl crate::RegisterSpec for EVENTS_STOPPED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_stopped::R](R) reader structure"] +impl crate::Readable for EVENTS_STOPPED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_stopped::W](W) writer structure"] +impl crate::Writable for EVENTS_STOPPED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_STOPPED to value 0"] +impl crate::Resettable for EVENTS_STOPPED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/saadc/inten.rs b/src/saadc/inten.rs new file mode 100644 index 0000000..9751dcb --- /dev/null +++ b/src/saadc/inten.rs @@ -0,0 +1,2112 @@ +#[doc = "Register `INTEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable interrupt for STARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STARTED_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STARTED` reader - Enable or disable interrupt for STARTED event"] +pub struct STARTED_R(crate::FieldReader); +impl STARTED_R { + pub(crate) fn new(bits: bool) -> Self { + STARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STARTED_A { + match self.bits { + false => STARTED_A::DISABLED, + true => STARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STARTED_A::ENABLED + } +} +impl core::ops::Deref for STARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STARTED` writer - Enable or disable interrupt for STARTED event"] +pub struct STARTED_W<'a> { + w: &'a mut W, +} +impl<'a> STARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STARTED_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(STARTED_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(STARTED_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Enable or disable interrupt for END event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END` reader - Enable or disable interrupt for END event"] +pub struct END_R(crate::FieldReader); +impl END_R { + pub(crate) fn new(bits: bool) -> Self { + END_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> END_A { + match self.bits { + false => END_A::DISABLED, + true => END_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == END_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == END_A::ENABLED + } +} +impl core::ops::Deref for END_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `END` writer - Enable or disable interrupt for END event"] +pub struct END_W<'a> { + w: &'a mut W, +} +impl<'a> END_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: END_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(END_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(END_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Enable or disable interrupt for DONE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DONE_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DONE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DONE` reader - Enable or disable interrupt for DONE event"] +pub struct DONE_R(crate::FieldReader); +impl DONE_R { + pub(crate) fn new(bits: bool) -> Self { + DONE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DONE_A { + match self.bits { + false => DONE_A::DISABLED, + true => DONE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DONE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DONE_A::ENABLED + } +} +impl core::ops::Deref for DONE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DONE` writer - Enable or disable interrupt for DONE event"] +pub struct DONE_W<'a> { + w: &'a mut W, +} +impl<'a> DONE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DONE_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(DONE_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(DONE_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Enable or disable interrupt for RESULTDONE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RESULTDONE_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RESULTDONE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RESULTDONE` reader - Enable or disable interrupt for RESULTDONE event"] +pub struct RESULTDONE_R(crate::FieldReader); +impl RESULTDONE_R { + pub(crate) fn new(bits: bool) -> Self { + RESULTDONE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RESULTDONE_A { + match self.bits { + false => RESULTDONE_A::DISABLED, + true => RESULTDONE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RESULTDONE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RESULTDONE_A::ENABLED + } +} +impl core::ops::Deref for RESULTDONE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RESULTDONE` writer - Enable or disable interrupt for RESULTDONE event"] +pub struct RESULTDONE_W<'a> { + w: &'a mut W, +} +impl<'a> RESULTDONE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RESULTDONE_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(RESULTDONE_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(RESULTDONE_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Enable or disable interrupt for CALIBRATEDONE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CALIBRATEDONE_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CALIBRATEDONE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CALIBRATEDONE` reader - Enable or disable interrupt for CALIBRATEDONE event"] +pub struct CALIBRATEDONE_R(crate::FieldReader); +impl CALIBRATEDONE_R { + pub(crate) fn new(bits: bool) -> Self { + CALIBRATEDONE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CALIBRATEDONE_A { + match self.bits { + false => CALIBRATEDONE_A::DISABLED, + true => CALIBRATEDONE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CALIBRATEDONE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CALIBRATEDONE_A::ENABLED + } +} +impl core::ops::Deref for CALIBRATEDONE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CALIBRATEDONE` writer - Enable or disable interrupt for CALIBRATEDONE event"] +pub struct CALIBRATEDONE_W<'a> { + w: &'a mut W, +} +impl<'a> CALIBRATEDONE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CALIBRATEDONE_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CALIBRATEDONE_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CALIBRATEDONE_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Enable or disable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` reader - Enable or disable interrupt for STOPPED event"] +pub struct STOPPED_R(crate::FieldReader); +impl STOPPED_R { + pub(crate) fn new(bits: bool) -> Self { + STOPPED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STOPPED_A { + match self.bits { + false => STOPPED_A::DISABLED, + true => STOPPED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STOPPED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STOPPED_A::ENABLED + } +} +impl core::ops::Deref for STOPPED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STOPPED` writer - Enable or disable interrupt for STOPPED event"] +pub struct STOPPED_W<'a> { + w: &'a mut W, +} +impl<'a> STOPPED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STOPPED_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(STOPPED_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(STOPPED_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Enable or disable interrupt for CH\\[0\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH0LIMITH_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH0LIMITH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH0LIMITH` reader - Enable or disable interrupt for CH\\[0\\].LIMITH event"] +pub struct CH0LIMITH_R(crate::FieldReader); +impl CH0LIMITH_R { + pub(crate) fn new(bits: bool) -> Self { + CH0LIMITH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH0LIMITH_A { + match self.bits { + false => CH0LIMITH_A::DISABLED, + true => CH0LIMITH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH0LIMITH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH0LIMITH_A::ENABLED + } +} +impl core::ops::Deref for CH0LIMITH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH0LIMITH` writer - Enable or disable interrupt for CH\\[0\\].LIMITH event"] +pub struct CH0LIMITH_W<'a> { + w: &'a mut W, +} +impl<'a> CH0LIMITH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH0LIMITH_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH0LIMITH_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH0LIMITH_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Enable or disable interrupt for CH\\[0\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH0LIMITL_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH0LIMITL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH0LIMITL` reader - Enable or disable interrupt for CH\\[0\\].LIMITL event"] +pub struct CH0LIMITL_R(crate::FieldReader); +impl CH0LIMITL_R { + pub(crate) fn new(bits: bool) -> Self { + CH0LIMITL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH0LIMITL_A { + match self.bits { + false => CH0LIMITL_A::DISABLED, + true => CH0LIMITL_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH0LIMITL_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH0LIMITL_A::ENABLED + } +} +impl core::ops::Deref for CH0LIMITL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH0LIMITL` writer - Enable or disable interrupt for CH\\[0\\].LIMITL event"] +pub struct CH0LIMITL_W<'a> { + w: &'a mut W, +} +impl<'a> CH0LIMITL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH0LIMITL_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH0LIMITL_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH0LIMITL_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Enable or disable interrupt for CH\\[1\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH1LIMITH_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH1LIMITH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH1LIMITH` reader - Enable or disable interrupt for CH\\[1\\].LIMITH event"] +pub struct CH1LIMITH_R(crate::FieldReader); +impl CH1LIMITH_R { + pub(crate) fn new(bits: bool) -> Self { + CH1LIMITH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH1LIMITH_A { + match self.bits { + false => CH1LIMITH_A::DISABLED, + true => CH1LIMITH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH1LIMITH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH1LIMITH_A::ENABLED + } +} +impl core::ops::Deref for CH1LIMITH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH1LIMITH` writer - Enable or disable interrupt for CH\\[1\\].LIMITH event"] +pub struct CH1LIMITH_W<'a> { + w: &'a mut W, +} +impl<'a> CH1LIMITH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH1LIMITH_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH1LIMITH_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH1LIMITH_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Enable or disable interrupt for CH\\[1\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH1LIMITL_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH1LIMITL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH1LIMITL` reader - Enable or disable interrupt for CH\\[1\\].LIMITL event"] +pub struct CH1LIMITL_R(crate::FieldReader); +impl CH1LIMITL_R { + pub(crate) fn new(bits: bool) -> Self { + CH1LIMITL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH1LIMITL_A { + match self.bits { + false => CH1LIMITL_A::DISABLED, + true => CH1LIMITL_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH1LIMITL_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH1LIMITL_A::ENABLED + } +} +impl core::ops::Deref for CH1LIMITL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH1LIMITL` writer - Enable or disable interrupt for CH\\[1\\].LIMITL event"] +pub struct CH1LIMITL_W<'a> { + w: &'a mut W, +} +impl<'a> CH1LIMITL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH1LIMITL_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH1LIMITL_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH1LIMITL_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Enable or disable interrupt for CH\\[2\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH2LIMITH_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH2LIMITH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH2LIMITH` reader - Enable or disable interrupt for CH\\[2\\].LIMITH event"] +pub struct CH2LIMITH_R(crate::FieldReader); +impl CH2LIMITH_R { + pub(crate) fn new(bits: bool) -> Self { + CH2LIMITH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH2LIMITH_A { + match self.bits { + false => CH2LIMITH_A::DISABLED, + true => CH2LIMITH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH2LIMITH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH2LIMITH_A::ENABLED + } +} +impl core::ops::Deref for CH2LIMITH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH2LIMITH` writer - Enable or disable interrupt for CH\\[2\\].LIMITH event"] +pub struct CH2LIMITH_W<'a> { + w: &'a mut W, +} +impl<'a> CH2LIMITH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH2LIMITH_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH2LIMITH_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH2LIMITH_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Enable or disable interrupt for CH\\[2\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH2LIMITL_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH2LIMITL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH2LIMITL` reader - Enable or disable interrupt for CH\\[2\\].LIMITL event"] +pub struct CH2LIMITL_R(crate::FieldReader); +impl CH2LIMITL_R { + pub(crate) fn new(bits: bool) -> Self { + CH2LIMITL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH2LIMITL_A { + match self.bits { + false => CH2LIMITL_A::DISABLED, + true => CH2LIMITL_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH2LIMITL_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH2LIMITL_A::ENABLED + } +} +impl core::ops::Deref for CH2LIMITL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH2LIMITL` writer - Enable or disable interrupt for CH\\[2\\].LIMITL event"] +pub struct CH2LIMITL_W<'a> { + w: &'a mut W, +} +impl<'a> CH2LIMITL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH2LIMITL_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH2LIMITL_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH2LIMITL_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Enable or disable interrupt for CH\\[3\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH3LIMITH_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH3LIMITH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH3LIMITH` reader - Enable or disable interrupt for CH\\[3\\].LIMITH event"] +pub struct CH3LIMITH_R(crate::FieldReader); +impl CH3LIMITH_R { + pub(crate) fn new(bits: bool) -> Self { + CH3LIMITH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH3LIMITH_A { + match self.bits { + false => CH3LIMITH_A::DISABLED, + true => CH3LIMITH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH3LIMITH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH3LIMITH_A::ENABLED + } +} +impl core::ops::Deref for CH3LIMITH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH3LIMITH` writer - Enable or disable interrupt for CH\\[3\\].LIMITH event"] +pub struct CH3LIMITH_W<'a> { + w: &'a mut W, +} +impl<'a> CH3LIMITH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH3LIMITH_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH3LIMITH_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH3LIMITH_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Enable or disable interrupt for CH\\[3\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH3LIMITL_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH3LIMITL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH3LIMITL` reader - Enable or disable interrupt for CH\\[3\\].LIMITL event"] +pub struct CH3LIMITL_R(crate::FieldReader); +impl CH3LIMITL_R { + pub(crate) fn new(bits: bool) -> Self { + CH3LIMITL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH3LIMITL_A { + match self.bits { + false => CH3LIMITL_A::DISABLED, + true => CH3LIMITL_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH3LIMITL_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH3LIMITL_A::ENABLED + } +} +impl core::ops::Deref for CH3LIMITL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH3LIMITL` writer - Enable or disable interrupt for CH\\[3\\].LIMITL event"] +pub struct CH3LIMITL_W<'a> { + w: &'a mut W, +} +impl<'a> CH3LIMITL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH3LIMITL_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH3LIMITL_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH3LIMITL_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Enable or disable interrupt for CH\\[4\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH4LIMITH_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH4LIMITH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH4LIMITH` reader - Enable or disable interrupt for CH\\[4\\].LIMITH event"] +pub struct CH4LIMITH_R(crate::FieldReader); +impl CH4LIMITH_R { + pub(crate) fn new(bits: bool) -> Self { + CH4LIMITH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH4LIMITH_A { + match self.bits { + false => CH4LIMITH_A::DISABLED, + true => CH4LIMITH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH4LIMITH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH4LIMITH_A::ENABLED + } +} +impl core::ops::Deref for CH4LIMITH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH4LIMITH` writer - Enable or disable interrupt for CH\\[4\\].LIMITH event"] +pub struct CH4LIMITH_W<'a> { + w: &'a mut W, +} +impl<'a> CH4LIMITH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH4LIMITH_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH4LIMITH_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH4LIMITH_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Enable or disable interrupt for CH\\[4\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH4LIMITL_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH4LIMITL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH4LIMITL` reader - Enable or disable interrupt for CH\\[4\\].LIMITL event"] +pub struct CH4LIMITL_R(crate::FieldReader); +impl CH4LIMITL_R { + pub(crate) fn new(bits: bool) -> Self { + CH4LIMITL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH4LIMITL_A { + match self.bits { + false => CH4LIMITL_A::DISABLED, + true => CH4LIMITL_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH4LIMITL_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH4LIMITL_A::ENABLED + } +} +impl core::ops::Deref for CH4LIMITL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH4LIMITL` writer - Enable or disable interrupt for CH\\[4\\].LIMITL event"] +pub struct CH4LIMITL_W<'a> { + w: &'a mut W, +} +impl<'a> CH4LIMITL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH4LIMITL_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH4LIMITL_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH4LIMITL_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Enable or disable interrupt for CH\\[5\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH5LIMITH_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH5LIMITH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH5LIMITH` reader - Enable or disable interrupt for CH\\[5\\].LIMITH event"] +pub struct CH5LIMITH_R(crate::FieldReader); +impl CH5LIMITH_R { + pub(crate) fn new(bits: bool) -> Self { + CH5LIMITH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH5LIMITH_A { + match self.bits { + false => CH5LIMITH_A::DISABLED, + true => CH5LIMITH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH5LIMITH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH5LIMITH_A::ENABLED + } +} +impl core::ops::Deref for CH5LIMITH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH5LIMITH` writer - Enable or disable interrupt for CH\\[5\\].LIMITH event"] +pub struct CH5LIMITH_W<'a> { + w: &'a mut W, +} +impl<'a> CH5LIMITH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH5LIMITH_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH5LIMITH_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH5LIMITH_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Enable or disable interrupt for CH\\[5\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH5LIMITL_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH5LIMITL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH5LIMITL` reader - Enable or disable interrupt for CH\\[5\\].LIMITL event"] +pub struct CH5LIMITL_R(crate::FieldReader); +impl CH5LIMITL_R { + pub(crate) fn new(bits: bool) -> Self { + CH5LIMITL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH5LIMITL_A { + match self.bits { + false => CH5LIMITL_A::DISABLED, + true => CH5LIMITL_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH5LIMITL_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH5LIMITL_A::ENABLED + } +} +impl core::ops::Deref for CH5LIMITL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH5LIMITL` writer - Enable or disable interrupt for CH\\[5\\].LIMITL event"] +pub struct CH5LIMITL_W<'a> { + w: &'a mut W, +} +impl<'a> CH5LIMITL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH5LIMITL_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH5LIMITL_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH5LIMITL_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Enable or disable interrupt for CH\\[6\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH6LIMITH_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH6LIMITH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH6LIMITH` reader - Enable or disable interrupt for CH\\[6\\].LIMITH event"] +pub struct CH6LIMITH_R(crate::FieldReader); +impl CH6LIMITH_R { + pub(crate) fn new(bits: bool) -> Self { + CH6LIMITH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH6LIMITH_A { + match self.bits { + false => CH6LIMITH_A::DISABLED, + true => CH6LIMITH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH6LIMITH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH6LIMITH_A::ENABLED + } +} +impl core::ops::Deref for CH6LIMITH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH6LIMITH` writer - Enable or disable interrupt for CH\\[6\\].LIMITH event"] +pub struct CH6LIMITH_W<'a> { + w: &'a mut W, +} +impl<'a> CH6LIMITH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH6LIMITH_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH6LIMITH_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH6LIMITH_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Enable or disable interrupt for CH\\[6\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH6LIMITL_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH6LIMITL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH6LIMITL` reader - Enable or disable interrupt for CH\\[6\\].LIMITL event"] +pub struct CH6LIMITL_R(crate::FieldReader); +impl CH6LIMITL_R { + pub(crate) fn new(bits: bool) -> Self { + CH6LIMITL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH6LIMITL_A { + match self.bits { + false => CH6LIMITL_A::DISABLED, + true => CH6LIMITL_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH6LIMITL_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH6LIMITL_A::ENABLED + } +} +impl core::ops::Deref for CH6LIMITL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH6LIMITL` writer - Enable or disable interrupt for CH\\[6\\].LIMITL event"] +pub struct CH6LIMITL_W<'a> { + w: &'a mut W, +} +impl<'a> CH6LIMITL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH6LIMITL_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH6LIMITL_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH6LIMITL_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Enable or disable interrupt for CH\\[7\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH7LIMITH_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH7LIMITH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH7LIMITH` reader - Enable or disable interrupt for CH\\[7\\].LIMITH event"] +pub struct CH7LIMITH_R(crate::FieldReader); +impl CH7LIMITH_R { + pub(crate) fn new(bits: bool) -> Self { + CH7LIMITH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH7LIMITH_A { + match self.bits { + false => CH7LIMITH_A::DISABLED, + true => CH7LIMITH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH7LIMITH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH7LIMITH_A::ENABLED + } +} +impl core::ops::Deref for CH7LIMITH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH7LIMITH` writer - Enable or disable interrupt for CH\\[7\\].LIMITH event"] +pub struct CH7LIMITH_W<'a> { + w: &'a mut W, +} +impl<'a> CH7LIMITH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH7LIMITH_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH7LIMITH_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH7LIMITH_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Enable or disable interrupt for CH\\[7\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH7LIMITL_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH7LIMITL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH7LIMITL` reader - Enable or disable interrupt for CH\\[7\\].LIMITL event"] +pub struct CH7LIMITL_R(crate::FieldReader); +impl CH7LIMITL_R { + pub(crate) fn new(bits: bool) -> Self { + CH7LIMITL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH7LIMITL_A { + match self.bits { + false => CH7LIMITL_A::DISABLED, + true => CH7LIMITL_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH7LIMITL_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH7LIMITL_A::ENABLED + } +} +impl core::ops::Deref for CH7LIMITL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CH7LIMITL` writer - Enable or disable interrupt for CH\\[7\\].LIMITL event"] +pub struct CH7LIMITL_W<'a> { + w: &'a mut W, +} +impl<'a> CH7LIMITL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH7LIMITL_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CH7LIMITL_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CH7LIMITL_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable or disable interrupt for STARTED event"] + #[inline(always)] + pub fn started(&self) -> STARTED_R { + STARTED_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Enable or disable interrupt for END event"] + #[inline(always)] + pub fn end(&self) -> END_R { + END_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Enable or disable interrupt for DONE event"] + #[inline(always)] + pub fn done(&self) -> DONE_R { + DONE_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Enable or disable interrupt for RESULTDONE event"] + #[inline(always)] + pub fn resultdone(&self) -> RESULTDONE_R { + RESULTDONE_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Enable or disable interrupt for CALIBRATEDONE event"] + #[inline(always)] + pub fn calibratedone(&self) -> CALIBRATEDONE_R { + CALIBRATEDONE_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Enable or disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&self) -> STOPPED_R { + STOPPED_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Enable or disable interrupt for CH\\[0\\].LIMITH event"] + #[inline(always)] + pub fn ch0limith(&self) -> CH0LIMITH_R { + CH0LIMITH_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Enable or disable interrupt for CH\\[0\\].LIMITL event"] + #[inline(always)] + pub fn ch0limitl(&self) -> CH0LIMITL_R { + CH0LIMITL_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Enable or disable interrupt for CH\\[1\\].LIMITH event"] + #[inline(always)] + pub fn ch1limith(&self) -> CH1LIMITH_R { + CH1LIMITH_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Enable or disable interrupt for CH\\[1\\].LIMITL event"] + #[inline(always)] + pub fn ch1limitl(&self) -> CH1LIMITL_R { + CH1LIMITL_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Enable or disable interrupt for CH\\[2\\].LIMITH event"] + #[inline(always)] + pub fn ch2limith(&self) -> CH2LIMITH_R { + CH2LIMITH_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Enable or disable interrupt for CH\\[2\\].LIMITL event"] + #[inline(always)] + pub fn ch2limitl(&self) -> CH2LIMITL_R { + CH2LIMITL_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Enable or disable interrupt for CH\\[3\\].LIMITH event"] + #[inline(always)] + pub fn ch3limith(&self) -> CH3LIMITH_R { + CH3LIMITH_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Enable or disable interrupt for CH\\[3\\].LIMITL event"] + #[inline(always)] + pub fn ch3limitl(&self) -> CH3LIMITL_R { + CH3LIMITL_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Enable or disable interrupt for CH\\[4\\].LIMITH event"] + #[inline(always)] + pub fn ch4limith(&self) -> CH4LIMITH_R { + CH4LIMITH_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Enable or disable interrupt for CH\\[4\\].LIMITL event"] + #[inline(always)] + pub fn ch4limitl(&self) -> CH4LIMITL_R { + CH4LIMITL_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Enable or disable interrupt for CH\\[5\\].LIMITH event"] + #[inline(always)] + pub fn ch5limith(&self) -> CH5LIMITH_R { + CH5LIMITH_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Enable or disable interrupt for CH\\[5\\].LIMITL event"] + #[inline(always)] + pub fn ch5limitl(&self) -> CH5LIMITL_R { + CH5LIMITL_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Enable or disable interrupt for CH\\[6\\].LIMITH event"] + #[inline(always)] + pub fn ch6limith(&self) -> CH6LIMITH_R { + CH6LIMITH_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Enable or disable interrupt for CH\\[6\\].LIMITL event"] + #[inline(always)] + pub fn ch6limitl(&self) -> CH6LIMITL_R { + CH6LIMITL_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Enable or disable interrupt for CH\\[7\\].LIMITH event"] + #[inline(always)] + pub fn ch7limith(&self) -> CH7LIMITH_R { + CH7LIMITH_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 21 - Enable or disable interrupt for CH\\[7\\].LIMITL event"] + #[inline(always)] + pub fn ch7limitl(&self) -> CH7LIMITL_R { + CH7LIMITL_R::new(((self.bits >> 21) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Enable or disable interrupt for STARTED event"] + #[inline(always)] + pub fn started(&mut self) -> STARTED_W { + STARTED_W { w: self } + } + #[doc = "Bit 1 - Enable or disable interrupt for END event"] + #[inline(always)] + pub fn end(&mut self) -> END_W { + END_W { w: self } + } + #[doc = "Bit 2 - Enable or disable interrupt for DONE event"] + #[inline(always)] + pub fn done(&mut self) -> DONE_W { + DONE_W { w: self } + } + #[doc = "Bit 3 - Enable or disable interrupt for RESULTDONE event"] + #[inline(always)] + pub fn resultdone(&mut self) -> RESULTDONE_W { + RESULTDONE_W { w: self } + } + #[doc = "Bit 4 - Enable or disable interrupt for CALIBRATEDONE event"] + #[inline(always)] + pub fn calibratedone(&mut self) -> CALIBRATEDONE_W { + CALIBRATEDONE_W { w: self } + } + #[doc = "Bit 5 - Enable or disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&mut self) -> STOPPED_W { + STOPPED_W { w: self } + } + #[doc = "Bit 6 - Enable or disable interrupt for CH\\[0\\].LIMITH event"] + #[inline(always)] + pub fn ch0limith(&mut self) -> CH0LIMITH_W { + CH0LIMITH_W { w: self } + } + #[doc = "Bit 7 - Enable or disable interrupt for CH\\[0\\].LIMITL event"] + #[inline(always)] + pub fn ch0limitl(&mut self) -> CH0LIMITL_W { + CH0LIMITL_W { w: self } + } + #[doc = "Bit 8 - Enable or disable interrupt for CH\\[1\\].LIMITH event"] + #[inline(always)] + pub fn ch1limith(&mut self) -> CH1LIMITH_W { + CH1LIMITH_W { w: self } + } + #[doc = "Bit 9 - Enable or disable interrupt for CH\\[1\\].LIMITL event"] + #[inline(always)] + pub fn ch1limitl(&mut self) -> CH1LIMITL_W { + CH1LIMITL_W { w: self } + } + #[doc = "Bit 10 - Enable or disable interrupt for CH\\[2\\].LIMITH event"] + #[inline(always)] + pub fn ch2limith(&mut self) -> CH2LIMITH_W { + CH2LIMITH_W { w: self } + } + #[doc = "Bit 11 - Enable or disable interrupt for CH\\[2\\].LIMITL event"] + #[inline(always)] + pub fn ch2limitl(&mut self) -> CH2LIMITL_W { + CH2LIMITL_W { w: self } + } + #[doc = "Bit 12 - Enable or disable interrupt for CH\\[3\\].LIMITH event"] + #[inline(always)] + pub fn ch3limith(&mut self) -> CH3LIMITH_W { + CH3LIMITH_W { w: self } + } + #[doc = "Bit 13 - Enable or disable interrupt for CH\\[3\\].LIMITL event"] + #[inline(always)] + pub fn ch3limitl(&mut self) -> CH3LIMITL_W { + CH3LIMITL_W { w: self } + } + #[doc = "Bit 14 - Enable or disable interrupt for CH\\[4\\].LIMITH event"] + #[inline(always)] + pub fn ch4limith(&mut self) -> CH4LIMITH_W { + CH4LIMITH_W { w: self } + } + #[doc = "Bit 15 - Enable or disable interrupt for CH\\[4\\].LIMITL event"] + #[inline(always)] + pub fn ch4limitl(&mut self) -> CH4LIMITL_W { + CH4LIMITL_W { w: self } + } + #[doc = "Bit 16 - Enable or disable interrupt for CH\\[5\\].LIMITH event"] + #[inline(always)] + pub fn ch5limith(&mut self) -> CH5LIMITH_W { + CH5LIMITH_W { w: self } + } + #[doc = "Bit 17 - Enable or disable interrupt for CH\\[5\\].LIMITL event"] + #[inline(always)] + pub fn ch5limitl(&mut self) -> CH5LIMITL_W { + CH5LIMITL_W { w: self } + } + #[doc = "Bit 18 - Enable or disable interrupt for CH\\[6\\].LIMITH event"] + #[inline(always)] + pub fn ch6limith(&mut self) -> CH6LIMITH_W { + CH6LIMITH_W { w: self } + } + #[doc = "Bit 19 - Enable or disable interrupt for CH\\[6\\].LIMITL event"] + #[inline(always)] + pub fn ch6limitl(&mut self) -> CH6LIMITL_W { + CH6LIMITL_W { w: self } + } + #[doc = "Bit 20 - Enable or disable interrupt for CH\\[7\\].LIMITH event"] + #[inline(always)] + pub fn ch7limith(&mut self) -> CH7LIMITH_W { + CH7LIMITH_W { w: self } + } + #[doc = "Bit 21 - Enable or disable interrupt for CH\\[7\\].LIMITL event"] + #[inline(always)] + pub fn ch7limitl(&mut self) -> CH7LIMITL_W { + CH7LIMITL_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable or disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [inten](index.html) module"] +pub struct INTEN_SPEC; +impl crate::RegisterSpec for INTEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [inten::R](R) reader structure"] +impl crate::Readable for INTEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [inten::W](W) writer structure"] +impl crate::Writable for INTEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTEN to value 0"] +impl crate::Resettable for INTEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/saadc/intenclr.rs b/src/saadc/intenclr.rs new file mode 100644 index 0000000..2a878b3 --- /dev/null +++ b/src/saadc/intenclr.rs @@ -0,0 +1,2266 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for STARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STARTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STARTED` reader - Write '1' to Disable interrupt for STARTED event"] +pub struct STARTED_R(crate::FieldReader); +impl STARTED_R { + pub(crate) fn new(bits: bool) -> Self { + STARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STARTED_A { + match self.bits { + false => STARTED_A::DISABLED, + true => STARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STARTED_A::ENABLED + } +} +impl core::ops::Deref for STARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for STARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STARTED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STARTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STARTED` writer - Write '1' to Disable interrupt for STARTED event"] +pub struct STARTED_W<'a> { + w: &'a mut W, +} +impl<'a> STARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STARTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(STARTED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for END event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END` reader - Write '1' to Disable interrupt for END event"] +pub struct END_R(crate::FieldReader); +impl END_R { + pub(crate) fn new(bits: bool) -> Self { + END_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> END_A { + match self.bits { + false => END_A::DISABLED, + true => END_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == END_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == END_A::ENABLED + } +} +impl core::ops::Deref for END_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for END event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END` writer - Write '1' to Disable interrupt for END event"] +pub struct END_W<'a> { + w: &'a mut W, +} +impl<'a> END_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: END_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(END_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for DONE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DONE_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DONE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DONE` reader - Write '1' to Disable interrupt for DONE event"] +pub struct DONE_R(crate::FieldReader); +impl DONE_R { + pub(crate) fn new(bits: bool) -> Self { + DONE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DONE_A { + match self.bits { + false => DONE_A::DISABLED, + true => DONE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DONE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DONE_A::ENABLED + } +} +impl core::ops::Deref for DONE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for DONE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DONE_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DONE_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DONE` writer - Write '1' to Disable interrupt for DONE event"] +pub struct DONE_W<'a> { + w: &'a mut W, +} +impl<'a> DONE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DONE_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(DONE_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for RESULTDONE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RESULTDONE_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RESULTDONE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RESULTDONE` reader - Write '1' to Disable interrupt for RESULTDONE event"] +pub struct RESULTDONE_R(crate::FieldReader); +impl RESULTDONE_R { + pub(crate) fn new(bits: bool) -> Self { + RESULTDONE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RESULTDONE_A { + match self.bits { + false => RESULTDONE_A::DISABLED, + true => RESULTDONE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RESULTDONE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RESULTDONE_A::ENABLED + } +} +impl core::ops::Deref for RESULTDONE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for RESULTDONE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RESULTDONE_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RESULTDONE_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RESULTDONE` writer - Write '1' to Disable interrupt for RESULTDONE event"] +pub struct RESULTDONE_W<'a> { + w: &'a mut W, +} +impl<'a> RESULTDONE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RESULTDONE_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(RESULTDONE_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for CALIBRATEDONE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CALIBRATEDONE_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CALIBRATEDONE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CALIBRATEDONE` reader - Write '1' to Disable interrupt for CALIBRATEDONE event"] +pub struct CALIBRATEDONE_R(crate::FieldReader); +impl CALIBRATEDONE_R { + pub(crate) fn new(bits: bool) -> Self { + CALIBRATEDONE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CALIBRATEDONE_A { + match self.bits { + false => CALIBRATEDONE_A::DISABLED, + true => CALIBRATEDONE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CALIBRATEDONE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CALIBRATEDONE_A::ENABLED + } +} +impl core::ops::Deref for CALIBRATEDONE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for CALIBRATEDONE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CALIBRATEDONE_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CALIBRATEDONE_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CALIBRATEDONE` writer - Write '1' to Disable interrupt for CALIBRATEDONE event"] +pub struct CALIBRATEDONE_W<'a> { + w: &'a mut W, +} +impl<'a> CALIBRATEDONE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CALIBRATEDONE_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CALIBRATEDONE_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` reader - Write '1' to Disable interrupt for STOPPED event"] +pub struct STOPPED_R(crate::FieldReader); +impl STOPPED_R { + pub(crate) fn new(bits: bool) -> Self { + STOPPED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STOPPED_A { + match self.bits { + false => STOPPED_A::DISABLED, + true => STOPPED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STOPPED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STOPPED_A::ENABLED + } +} +impl core::ops::Deref for STOPPED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` writer - Write '1' to Disable interrupt for STOPPED event"] +pub struct STOPPED_W<'a> { + w: &'a mut W, +} +impl<'a> STOPPED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STOPPED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(STOPPED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[0\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH0LIMITH_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH0LIMITH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH0LIMITH` reader - Write '1' to Disable interrupt for CH\\[0\\].LIMITH event"] +pub struct CH0LIMITH_R(crate::FieldReader); +impl CH0LIMITH_R { + pub(crate) fn new(bits: bool) -> Self { + CH0LIMITH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH0LIMITH_A { + match self.bits { + false => CH0LIMITH_A::DISABLED, + true => CH0LIMITH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH0LIMITH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH0LIMITH_A::ENABLED + } +} +impl core::ops::Deref for CH0LIMITH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[0\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH0LIMITH_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH0LIMITH_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH0LIMITH` writer - Write '1' to Disable interrupt for CH\\[0\\].LIMITH event"] +pub struct CH0LIMITH_W<'a> { + w: &'a mut W, +} +impl<'a> CH0LIMITH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH0LIMITH_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH0LIMITH_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[0\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH0LIMITL_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH0LIMITL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH0LIMITL` reader - Write '1' to Disable interrupt for CH\\[0\\].LIMITL event"] +pub struct CH0LIMITL_R(crate::FieldReader); +impl CH0LIMITL_R { + pub(crate) fn new(bits: bool) -> Self { + CH0LIMITL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH0LIMITL_A { + match self.bits { + false => CH0LIMITL_A::DISABLED, + true => CH0LIMITL_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH0LIMITL_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH0LIMITL_A::ENABLED + } +} +impl core::ops::Deref for CH0LIMITL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[0\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH0LIMITL_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH0LIMITL_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH0LIMITL` writer - Write '1' to Disable interrupt for CH\\[0\\].LIMITL event"] +pub struct CH0LIMITL_W<'a> { + w: &'a mut W, +} +impl<'a> CH0LIMITL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH0LIMITL_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH0LIMITL_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[1\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH1LIMITH_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH1LIMITH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH1LIMITH` reader - Write '1' to Disable interrupt for CH\\[1\\].LIMITH event"] +pub struct CH1LIMITH_R(crate::FieldReader); +impl CH1LIMITH_R { + pub(crate) fn new(bits: bool) -> Self { + CH1LIMITH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH1LIMITH_A { + match self.bits { + false => CH1LIMITH_A::DISABLED, + true => CH1LIMITH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH1LIMITH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH1LIMITH_A::ENABLED + } +} +impl core::ops::Deref for CH1LIMITH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[1\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH1LIMITH_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH1LIMITH_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH1LIMITH` writer - Write '1' to Disable interrupt for CH\\[1\\].LIMITH event"] +pub struct CH1LIMITH_W<'a> { + w: &'a mut W, +} +impl<'a> CH1LIMITH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH1LIMITH_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH1LIMITH_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[1\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH1LIMITL_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH1LIMITL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH1LIMITL` reader - Write '1' to Disable interrupt for CH\\[1\\].LIMITL event"] +pub struct CH1LIMITL_R(crate::FieldReader); +impl CH1LIMITL_R { + pub(crate) fn new(bits: bool) -> Self { + CH1LIMITL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH1LIMITL_A { + match self.bits { + false => CH1LIMITL_A::DISABLED, + true => CH1LIMITL_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH1LIMITL_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH1LIMITL_A::ENABLED + } +} +impl core::ops::Deref for CH1LIMITL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[1\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH1LIMITL_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH1LIMITL_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH1LIMITL` writer - Write '1' to Disable interrupt for CH\\[1\\].LIMITL event"] +pub struct CH1LIMITL_W<'a> { + w: &'a mut W, +} +impl<'a> CH1LIMITL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH1LIMITL_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH1LIMITL_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[2\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH2LIMITH_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH2LIMITH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH2LIMITH` reader - Write '1' to Disable interrupt for CH\\[2\\].LIMITH event"] +pub struct CH2LIMITH_R(crate::FieldReader); +impl CH2LIMITH_R { + pub(crate) fn new(bits: bool) -> Self { + CH2LIMITH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH2LIMITH_A { + match self.bits { + false => CH2LIMITH_A::DISABLED, + true => CH2LIMITH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH2LIMITH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH2LIMITH_A::ENABLED + } +} +impl core::ops::Deref for CH2LIMITH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[2\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH2LIMITH_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH2LIMITH_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH2LIMITH` writer - Write '1' to Disable interrupt for CH\\[2\\].LIMITH event"] +pub struct CH2LIMITH_W<'a> { + w: &'a mut W, +} +impl<'a> CH2LIMITH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH2LIMITH_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH2LIMITH_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[2\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH2LIMITL_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH2LIMITL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH2LIMITL` reader - Write '1' to Disable interrupt for CH\\[2\\].LIMITL event"] +pub struct CH2LIMITL_R(crate::FieldReader); +impl CH2LIMITL_R { + pub(crate) fn new(bits: bool) -> Self { + CH2LIMITL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH2LIMITL_A { + match self.bits { + false => CH2LIMITL_A::DISABLED, + true => CH2LIMITL_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH2LIMITL_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH2LIMITL_A::ENABLED + } +} +impl core::ops::Deref for CH2LIMITL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[2\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH2LIMITL_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH2LIMITL_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH2LIMITL` writer - Write '1' to Disable interrupt for CH\\[2\\].LIMITL event"] +pub struct CH2LIMITL_W<'a> { + w: &'a mut W, +} +impl<'a> CH2LIMITL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH2LIMITL_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH2LIMITL_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[3\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH3LIMITH_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH3LIMITH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH3LIMITH` reader - Write '1' to Disable interrupt for CH\\[3\\].LIMITH event"] +pub struct CH3LIMITH_R(crate::FieldReader); +impl CH3LIMITH_R { + pub(crate) fn new(bits: bool) -> Self { + CH3LIMITH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH3LIMITH_A { + match self.bits { + false => CH3LIMITH_A::DISABLED, + true => CH3LIMITH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH3LIMITH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH3LIMITH_A::ENABLED + } +} +impl core::ops::Deref for CH3LIMITH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[3\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH3LIMITH_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH3LIMITH_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH3LIMITH` writer - Write '1' to Disable interrupt for CH\\[3\\].LIMITH event"] +pub struct CH3LIMITH_W<'a> { + w: &'a mut W, +} +impl<'a> CH3LIMITH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH3LIMITH_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH3LIMITH_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[3\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH3LIMITL_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH3LIMITL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH3LIMITL` reader - Write '1' to Disable interrupt for CH\\[3\\].LIMITL event"] +pub struct CH3LIMITL_R(crate::FieldReader); +impl CH3LIMITL_R { + pub(crate) fn new(bits: bool) -> Self { + CH3LIMITL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH3LIMITL_A { + match self.bits { + false => CH3LIMITL_A::DISABLED, + true => CH3LIMITL_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH3LIMITL_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH3LIMITL_A::ENABLED + } +} +impl core::ops::Deref for CH3LIMITL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[3\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH3LIMITL_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH3LIMITL_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH3LIMITL` writer - Write '1' to Disable interrupt for CH\\[3\\].LIMITL event"] +pub struct CH3LIMITL_W<'a> { + w: &'a mut W, +} +impl<'a> CH3LIMITL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH3LIMITL_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH3LIMITL_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[4\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH4LIMITH_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH4LIMITH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH4LIMITH` reader - Write '1' to Disable interrupt for CH\\[4\\].LIMITH event"] +pub struct CH4LIMITH_R(crate::FieldReader); +impl CH4LIMITH_R { + pub(crate) fn new(bits: bool) -> Self { + CH4LIMITH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH4LIMITH_A { + match self.bits { + false => CH4LIMITH_A::DISABLED, + true => CH4LIMITH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH4LIMITH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH4LIMITH_A::ENABLED + } +} +impl core::ops::Deref for CH4LIMITH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[4\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH4LIMITH_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH4LIMITH_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH4LIMITH` writer - Write '1' to Disable interrupt for CH\\[4\\].LIMITH event"] +pub struct CH4LIMITH_W<'a> { + w: &'a mut W, +} +impl<'a> CH4LIMITH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH4LIMITH_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH4LIMITH_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[4\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH4LIMITL_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH4LIMITL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH4LIMITL` reader - Write '1' to Disable interrupt for CH\\[4\\].LIMITL event"] +pub struct CH4LIMITL_R(crate::FieldReader); +impl CH4LIMITL_R { + pub(crate) fn new(bits: bool) -> Self { + CH4LIMITL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH4LIMITL_A { + match self.bits { + false => CH4LIMITL_A::DISABLED, + true => CH4LIMITL_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH4LIMITL_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH4LIMITL_A::ENABLED + } +} +impl core::ops::Deref for CH4LIMITL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[4\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH4LIMITL_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH4LIMITL_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH4LIMITL` writer - Write '1' to Disable interrupt for CH\\[4\\].LIMITL event"] +pub struct CH4LIMITL_W<'a> { + w: &'a mut W, +} +impl<'a> CH4LIMITL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH4LIMITL_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH4LIMITL_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[5\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH5LIMITH_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH5LIMITH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH5LIMITH` reader - Write '1' to Disable interrupt for CH\\[5\\].LIMITH event"] +pub struct CH5LIMITH_R(crate::FieldReader); +impl CH5LIMITH_R { + pub(crate) fn new(bits: bool) -> Self { + CH5LIMITH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH5LIMITH_A { + match self.bits { + false => CH5LIMITH_A::DISABLED, + true => CH5LIMITH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH5LIMITH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH5LIMITH_A::ENABLED + } +} +impl core::ops::Deref for CH5LIMITH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[5\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH5LIMITH_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH5LIMITH_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH5LIMITH` writer - Write '1' to Disable interrupt for CH\\[5\\].LIMITH event"] +pub struct CH5LIMITH_W<'a> { + w: &'a mut W, +} +impl<'a> CH5LIMITH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH5LIMITH_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH5LIMITH_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[5\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH5LIMITL_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH5LIMITL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH5LIMITL` reader - Write '1' to Disable interrupt for CH\\[5\\].LIMITL event"] +pub struct CH5LIMITL_R(crate::FieldReader); +impl CH5LIMITL_R { + pub(crate) fn new(bits: bool) -> Self { + CH5LIMITL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH5LIMITL_A { + match self.bits { + false => CH5LIMITL_A::DISABLED, + true => CH5LIMITL_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH5LIMITL_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH5LIMITL_A::ENABLED + } +} +impl core::ops::Deref for CH5LIMITL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[5\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH5LIMITL_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH5LIMITL_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH5LIMITL` writer - Write '1' to Disable interrupt for CH\\[5\\].LIMITL event"] +pub struct CH5LIMITL_W<'a> { + w: &'a mut W, +} +impl<'a> CH5LIMITL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH5LIMITL_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH5LIMITL_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[6\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH6LIMITH_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH6LIMITH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH6LIMITH` reader - Write '1' to Disable interrupt for CH\\[6\\].LIMITH event"] +pub struct CH6LIMITH_R(crate::FieldReader); +impl CH6LIMITH_R { + pub(crate) fn new(bits: bool) -> Self { + CH6LIMITH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH6LIMITH_A { + match self.bits { + false => CH6LIMITH_A::DISABLED, + true => CH6LIMITH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH6LIMITH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH6LIMITH_A::ENABLED + } +} +impl core::ops::Deref for CH6LIMITH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[6\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH6LIMITH_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH6LIMITH_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH6LIMITH` writer - Write '1' to Disable interrupt for CH\\[6\\].LIMITH event"] +pub struct CH6LIMITH_W<'a> { + w: &'a mut W, +} +impl<'a> CH6LIMITH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH6LIMITH_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH6LIMITH_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[6\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH6LIMITL_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH6LIMITL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH6LIMITL` reader - Write '1' to Disable interrupt for CH\\[6\\].LIMITL event"] +pub struct CH6LIMITL_R(crate::FieldReader); +impl CH6LIMITL_R { + pub(crate) fn new(bits: bool) -> Self { + CH6LIMITL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH6LIMITL_A { + match self.bits { + false => CH6LIMITL_A::DISABLED, + true => CH6LIMITL_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH6LIMITL_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH6LIMITL_A::ENABLED + } +} +impl core::ops::Deref for CH6LIMITL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[6\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH6LIMITL_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH6LIMITL_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH6LIMITL` writer - Write '1' to Disable interrupt for CH\\[6\\].LIMITL event"] +pub struct CH6LIMITL_W<'a> { + w: &'a mut W, +} +impl<'a> CH6LIMITL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH6LIMITL_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH6LIMITL_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[7\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH7LIMITH_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH7LIMITH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH7LIMITH` reader - Write '1' to Disable interrupt for CH\\[7\\].LIMITH event"] +pub struct CH7LIMITH_R(crate::FieldReader); +impl CH7LIMITH_R { + pub(crate) fn new(bits: bool) -> Self { + CH7LIMITH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH7LIMITH_A { + match self.bits { + false => CH7LIMITH_A::DISABLED, + true => CH7LIMITH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH7LIMITH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH7LIMITH_A::ENABLED + } +} +impl core::ops::Deref for CH7LIMITH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[7\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH7LIMITH_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH7LIMITH_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH7LIMITH` writer - Write '1' to Disable interrupt for CH\\[7\\].LIMITH event"] +pub struct CH7LIMITH_W<'a> { + w: &'a mut W, +} +impl<'a> CH7LIMITH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH7LIMITH_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH7LIMITH_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[7\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH7LIMITL_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH7LIMITL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH7LIMITL` reader - Write '1' to Disable interrupt for CH\\[7\\].LIMITL event"] +pub struct CH7LIMITL_R(crate::FieldReader); +impl CH7LIMITL_R { + pub(crate) fn new(bits: bool) -> Self { + CH7LIMITL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH7LIMITL_A { + match self.bits { + false => CH7LIMITL_A::DISABLED, + true => CH7LIMITL_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH7LIMITL_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH7LIMITL_A::ENABLED + } +} +impl core::ops::Deref for CH7LIMITL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for CH\\[7\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH7LIMITL_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH7LIMITL_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH7LIMITL` writer - Write '1' to Disable interrupt for CH\\[7\\].LIMITL event"] +pub struct CH7LIMITL_W<'a> { + w: &'a mut W, +} +impl<'a> CH7LIMITL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH7LIMITL_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CH7LIMITL_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Disable interrupt for STARTED event"] + #[inline(always)] + pub fn started(&self) -> STARTED_R { + STARTED_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for END event"] + #[inline(always)] + pub fn end(&self) -> END_R { + END_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for DONE event"] + #[inline(always)] + pub fn done(&self) -> DONE_R { + DONE_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Write '1' to Disable interrupt for RESULTDONE event"] + #[inline(always)] + pub fn resultdone(&self) -> RESULTDONE_R { + RESULTDONE_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Write '1' to Disable interrupt for CALIBRATEDONE event"] + #[inline(always)] + pub fn calibratedone(&self) -> CALIBRATEDONE_R { + CALIBRATEDONE_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Write '1' to Disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&self) -> STOPPED_R { + STOPPED_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Write '1' to Disable interrupt for CH\\[0\\].LIMITH event"] + #[inline(always)] + pub fn ch0limith(&self) -> CH0LIMITH_R { + CH0LIMITH_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Write '1' to Disable interrupt for CH\\[0\\].LIMITL event"] + #[inline(always)] + pub fn ch0limitl(&self) -> CH0LIMITL_R { + CH0LIMITL_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Write '1' to Disable interrupt for CH\\[1\\].LIMITH event"] + #[inline(always)] + pub fn ch1limith(&self) -> CH1LIMITH_R { + CH1LIMITH_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Write '1' to Disable interrupt for CH\\[1\\].LIMITL event"] + #[inline(always)] + pub fn ch1limitl(&self) -> CH1LIMITL_R { + CH1LIMITL_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Write '1' to Disable interrupt for CH\\[2\\].LIMITH event"] + #[inline(always)] + pub fn ch2limith(&self) -> CH2LIMITH_R { + CH2LIMITH_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Write '1' to Disable interrupt for CH\\[2\\].LIMITL event"] + #[inline(always)] + pub fn ch2limitl(&self) -> CH2LIMITL_R { + CH2LIMITL_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Write '1' to Disable interrupt for CH\\[3\\].LIMITH event"] + #[inline(always)] + pub fn ch3limith(&self) -> CH3LIMITH_R { + CH3LIMITH_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Write '1' to Disable interrupt for CH\\[3\\].LIMITL event"] + #[inline(always)] + pub fn ch3limitl(&self) -> CH3LIMITL_R { + CH3LIMITL_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Write '1' to Disable interrupt for CH\\[4\\].LIMITH event"] + #[inline(always)] + pub fn ch4limith(&self) -> CH4LIMITH_R { + CH4LIMITH_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Write '1' to Disable interrupt for CH\\[4\\].LIMITL event"] + #[inline(always)] + pub fn ch4limitl(&self) -> CH4LIMITL_R { + CH4LIMITL_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Write '1' to Disable interrupt for CH\\[5\\].LIMITH event"] + #[inline(always)] + pub fn ch5limith(&self) -> CH5LIMITH_R { + CH5LIMITH_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Write '1' to Disable interrupt for CH\\[5\\].LIMITL event"] + #[inline(always)] + pub fn ch5limitl(&self) -> CH5LIMITL_R { + CH5LIMITL_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Write '1' to Disable interrupt for CH\\[6\\].LIMITH event"] + #[inline(always)] + pub fn ch6limith(&self) -> CH6LIMITH_R { + CH6LIMITH_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Write '1' to Disable interrupt for CH\\[6\\].LIMITL event"] + #[inline(always)] + pub fn ch6limitl(&self) -> CH6LIMITL_R { + CH6LIMITL_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Write '1' to Disable interrupt for CH\\[7\\].LIMITH event"] + #[inline(always)] + pub fn ch7limith(&self) -> CH7LIMITH_R { + CH7LIMITH_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 21 - Write '1' to Disable interrupt for CH\\[7\\].LIMITL event"] + #[inline(always)] + pub fn ch7limitl(&self) -> CH7LIMITL_R { + CH7LIMITL_R::new(((self.bits >> 21) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Disable interrupt for STARTED event"] + #[inline(always)] + pub fn started(&mut self) -> STARTED_W { + STARTED_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for END event"] + #[inline(always)] + pub fn end(&mut self) -> END_W { + END_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for DONE event"] + #[inline(always)] + pub fn done(&mut self) -> DONE_W { + DONE_W { w: self } + } + #[doc = "Bit 3 - Write '1' to Disable interrupt for RESULTDONE event"] + #[inline(always)] + pub fn resultdone(&mut self) -> RESULTDONE_W { + RESULTDONE_W { w: self } + } + #[doc = "Bit 4 - Write '1' to Disable interrupt for CALIBRATEDONE event"] + #[inline(always)] + pub fn calibratedone(&mut self) -> CALIBRATEDONE_W { + CALIBRATEDONE_W { w: self } + } + #[doc = "Bit 5 - Write '1' to Disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&mut self) -> STOPPED_W { + STOPPED_W { w: self } + } + #[doc = "Bit 6 - Write '1' to Disable interrupt for CH\\[0\\].LIMITH event"] + #[inline(always)] + pub fn ch0limith(&mut self) -> CH0LIMITH_W { + CH0LIMITH_W { w: self } + } + #[doc = "Bit 7 - Write '1' to Disable interrupt for CH\\[0\\].LIMITL event"] + #[inline(always)] + pub fn ch0limitl(&mut self) -> CH0LIMITL_W { + CH0LIMITL_W { w: self } + } + #[doc = "Bit 8 - Write '1' to Disable interrupt for CH\\[1\\].LIMITH event"] + #[inline(always)] + pub fn ch1limith(&mut self) -> CH1LIMITH_W { + CH1LIMITH_W { w: self } + } + #[doc = "Bit 9 - Write '1' to Disable interrupt for CH\\[1\\].LIMITL event"] + #[inline(always)] + pub fn ch1limitl(&mut self) -> CH1LIMITL_W { + CH1LIMITL_W { w: self } + } + #[doc = "Bit 10 - Write '1' to Disable interrupt for CH\\[2\\].LIMITH event"] + #[inline(always)] + pub fn ch2limith(&mut self) -> CH2LIMITH_W { + CH2LIMITH_W { w: self } + } + #[doc = "Bit 11 - Write '1' to Disable interrupt for CH\\[2\\].LIMITL event"] + #[inline(always)] + pub fn ch2limitl(&mut self) -> CH2LIMITL_W { + CH2LIMITL_W { w: self } + } + #[doc = "Bit 12 - Write '1' to Disable interrupt for CH\\[3\\].LIMITH event"] + #[inline(always)] + pub fn ch3limith(&mut self) -> CH3LIMITH_W { + CH3LIMITH_W { w: self } + } + #[doc = "Bit 13 - Write '1' to Disable interrupt for CH\\[3\\].LIMITL event"] + #[inline(always)] + pub fn ch3limitl(&mut self) -> CH3LIMITL_W { + CH3LIMITL_W { w: self } + } + #[doc = "Bit 14 - Write '1' to Disable interrupt for CH\\[4\\].LIMITH event"] + #[inline(always)] + pub fn ch4limith(&mut self) -> CH4LIMITH_W { + CH4LIMITH_W { w: self } + } + #[doc = "Bit 15 - Write '1' to Disable interrupt for CH\\[4\\].LIMITL event"] + #[inline(always)] + pub fn ch4limitl(&mut self) -> CH4LIMITL_W { + CH4LIMITL_W { w: self } + } + #[doc = "Bit 16 - Write '1' to Disable interrupt for CH\\[5\\].LIMITH event"] + #[inline(always)] + pub fn ch5limith(&mut self) -> CH5LIMITH_W { + CH5LIMITH_W { w: self } + } + #[doc = "Bit 17 - Write '1' to Disable interrupt for CH\\[5\\].LIMITL event"] + #[inline(always)] + pub fn ch5limitl(&mut self) -> CH5LIMITL_W { + CH5LIMITL_W { w: self } + } + #[doc = "Bit 18 - Write '1' to Disable interrupt for CH\\[6\\].LIMITH event"] + #[inline(always)] + pub fn ch6limith(&mut self) -> CH6LIMITH_W { + CH6LIMITH_W { w: self } + } + #[doc = "Bit 19 - Write '1' to Disable interrupt for CH\\[6\\].LIMITL event"] + #[inline(always)] + pub fn ch6limitl(&mut self) -> CH6LIMITL_W { + CH6LIMITL_W { w: self } + } + #[doc = "Bit 20 - Write '1' to Disable interrupt for CH\\[7\\].LIMITH event"] + #[inline(always)] + pub fn ch7limith(&mut self) -> CH7LIMITH_W { + CH7LIMITH_W { w: self } + } + #[doc = "Bit 21 - Write '1' to Disable interrupt for CH\\[7\\].LIMITL event"] + #[inline(always)] + pub fn ch7limitl(&mut self) -> CH7LIMITL_W { + CH7LIMITL_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/saadc/intenset.rs b/src/saadc/intenset.rs new file mode 100644 index 0000000..6165d16 --- /dev/null +++ b/src/saadc/intenset.rs @@ -0,0 +1,2266 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for STARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STARTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STARTED` reader - Write '1' to Enable interrupt for STARTED event"] +pub struct STARTED_R(crate::FieldReader); +impl STARTED_R { + pub(crate) fn new(bits: bool) -> Self { + STARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STARTED_A { + match self.bits { + false => STARTED_A::DISABLED, + true => STARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STARTED_A::ENABLED + } +} +impl core::ops::Deref for STARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for STARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STARTED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STARTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STARTED` writer - Write '1' to Enable interrupt for STARTED event"] +pub struct STARTED_W<'a> { + w: &'a mut W, +} +impl<'a> STARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STARTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(STARTED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for END event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END` reader - Write '1' to Enable interrupt for END event"] +pub struct END_R(crate::FieldReader); +impl END_R { + pub(crate) fn new(bits: bool) -> Self { + END_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> END_A { + match self.bits { + false => END_A::DISABLED, + true => END_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == END_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == END_A::ENABLED + } +} +impl core::ops::Deref for END_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for END event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END` writer - Write '1' to Enable interrupt for END event"] +pub struct END_W<'a> { + w: &'a mut W, +} +impl<'a> END_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: END_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(END_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for DONE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DONE_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DONE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DONE` reader - Write '1' to Enable interrupt for DONE event"] +pub struct DONE_R(crate::FieldReader); +impl DONE_R { + pub(crate) fn new(bits: bool) -> Self { + DONE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DONE_A { + match self.bits { + false => DONE_A::DISABLED, + true => DONE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DONE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DONE_A::ENABLED + } +} +impl core::ops::Deref for DONE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for DONE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DONE_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DONE_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DONE` writer - Write '1' to Enable interrupt for DONE event"] +pub struct DONE_W<'a> { + w: &'a mut W, +} +impl<'a> DONE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DONE_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(DONE_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for RESULTDONE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RESULTDONE_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RESULTDONE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RESULTDONE` reader - Write '1' to Enable interrupt for RESULTDONE event"] +pub struct RESULTDONE_R(crate::FieldReader); +impl RESULTDONE_R { + pub(crate) fn new(bits: bool) -> Self { + RESULTDONE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RESULTDONE_A { + match self.bits { + false => RESULTDONE_A::DISABLED, + true => RESULTDONE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RESULTDONE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RESULTDONE_A::ENABLED + } +} +impl core::ops::Deref for RESULTDONE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for RESULTDONE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RESULTDONE_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RESULTDONE_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RESULTDONE` writer - Write '1' to Enable interrupt for RESULTDONE event"] +pub struct RESULTDONE_W<'a> { + w: &'a mut W, +} +impl<'a> RESULTDONE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RESULTDONE_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(RESULTDONE_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for CALIBRATEDONE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CALIBRATEDONE_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CALIBRATEDONE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CALIBRATEDONE` reader - Write '1' to Enable interrupt for CALIBRATEDONE event"] +pub struct CALIBRATEDONE_R(crate::FieldReader); +impl CALIBRATEDONE_R { + pub(crate) fn new(bits: bool) -> Self { + CALIBRATEDONE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CALIBRATEDONE_A { + match self.bits { + false => CALIBRATEDONE_A::DISABLED, + true => CALIBRATEDONE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CALIBRATEDONE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CALIBRATEDONE_A::ENABLED + } +} +impl core::ops::Deref for CALIBRATEDONE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for CALIBRATEDONE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CALIBRATEDONE_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CALIBRATEDONE_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CALIBRATEDONE` writer - Write '1' to Enable interrupt for CALIBRATEDONE event"] +pub struct CALIBRATEDONE_W<'a> { + w: &'a mut W, +} +impl<'a> CALIBRATEDONE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CALIBRATEDONE_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CALIBRATEDONE_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` reader - Write '1' to Enable interrupt for STOPPED event"] +pub struct STOPPED_R(crate::FieldReader); +impl STOPPED_R { + pub(crate) fn new(bits: bool) -> Self { + STOPPED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STOPPED_A { + match self.bits { + false => STOPPED_A::DISABLED, + true => STOPPED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STOPPED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STOPPED_A::ENABLED + } +} +impl core::ops::Deref for STOPPED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` writer - Write '1' to Enable interrupt for STOPPED event"] +pub struct STOPPED_W<'a> { + w: &'a mut W, +} +impl<'a> STOPPED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STOPPED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(STOPPED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[0\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH0LIMITH_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH0LIMITH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH0LIMITH` reader - Write '1' to Enable interrupt for CH\\[0\\].LIMITH event"] +pub struct CH0LIMITH_R(crate::FieldReader); +impl CH0LIMITH_R { + pub(crate) fn new(bits: bool) -> Self { + CH0LIMITH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH0LIMITH_A { + match self.bits { + false => CH0LIMITH_A::DISABLED, + true => CH0LIMITH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH0LIMITH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH0LIMITH_A::ENABLED + } +} +impl core::ops::Deref for CH0LIMITH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[0\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH0LIMITH_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH0LIMITH_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH0LIMITH` writer - Write '1' to Enable interrupt for CH\\[0\\].LIMITH event"] +pub struct CH0LIMITH_W<'a> { + w: &'a mut W, +} +impl<'a> CH0LIMITH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH0LIMITH_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH0LIMITH_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[0\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH0LIMITL_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH0LIMITL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH0LIMITL` reader - Write '1' to Enable interrupt for CH\\[0\\].LIMITL event"] +pub struct CH0LIMITL_R(crate::FieldReader); +impl CH0LIMITL_R { + pub(crate) fn new(bits: bool) -> Self { + CH0LIMITL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH0LIMITL_A { + match self.bits { + false => CH0LIMITL_A::DISABLED, + true => CH0LIMITL_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH0LIMITL_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH0LIMITL_A::ENABLED + } +} +impl core::ops::Deref for CH0LIMITL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[0\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH0LIMITL_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH0LIMITL_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH0LIMITL` writer - Write '1' to Enable interrupt for CH\\[0\\].LIMITL event"] +pub struct CH0LIMITL_W<'a> { + w: &'a mut W, +} +impl<'a> CH0LIMITL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH0LIMITL_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH0LIMITL_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[1\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH1LIMITH_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH1LIMITH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH1LIMITH` reader - Write '1' to Enable interrupt for CH\\[1\\].LIMITH event"] +pub struct CH1LIMITH_R(crate::FieldReader); +impl CH1LIMITH_R { + pub(crate) fn new(bits: bool) -> Self { + CH1LIMITH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH1LIMITH_A { + match self.bits { + false => CH1LIMITH_A::DISABLED, + true => CH1LIMITH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH1LIMITH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH1LIMITH_A::ENABLED + } +} +impl core::ops::Deref for CH1LIMITH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[1\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH1LIMITH_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH1LIMITH_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH1LIMITH` writer - Write '1' to Enable interrupt for CH\\[1\\].LIMITH event"] +pub struct CH1LIMITH_W<'a> { + w: &'a mut W, +} +impl<'a> CH1LIMITH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH1LIMITH_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH1LIMITH_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[1\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH1LIMITL_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH1LIMITL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH1LIMITL` reader - Write '1' to Enable interrupt for CH\\[1\\].LIMITL event"] +pub struct CH1LIMITL_R(crate::FieldReader); +impl CH1LIMITL_R { + pub(crate) fn new(bits: bool) -> Self { + CH1LIMITL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH1LIMITL_A { + match self.bits { + false => CH1LIMITL_A::DISABLED, + true => CH1LIMITL_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH1LIMITL_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH1LIMITL_A::ENABLED + } +} +impl core::ops::Deref for CH1LIMITL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[1\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH1LIMITL_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH1LIMITL_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH1LIMITL` writer - Write '1' to Enable interrupt for CH\\[1\\].LIMITL event"] +pub struct CH1LIMITL_W<'a> { + w: &'a mut W, +} +impl<'a> CH1LIMITL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH1LIMITL_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH1LIMITL_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[2\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH2LIMITH_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH2LIMITH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH2LIMITH` reader - Write '1' to Enable interrupt for CH\\[2\\].LIMITH event"] +pub struct CH2LIMITH_R(crate::FieldReader); +impl CH2LIMITH_R { + pub(crate) fn new(bits: bool) -> Self { + CH2LIMITH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH2LIMITH_A { + match self.bits { + false => CH2LIMITH_A::DISABLED, + true => CH2LIMITH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH2LIMITH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH2LIMITH_A::ENABLED + } +} +impl core::ops::Deref for CH2LIMITH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[2\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH2LIMITH_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH2LIMITH_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH2LIMITH` writer - Write '1' to Enable interrupt for CH\\[2\\].LIMITH event"] +pub struct CH2LIMITH_W<'a> { + w: &'a mut W, +} +impl<'a> CH2LIMITH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH2LIMITH_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH2LIMITH_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[2\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH2LIMITL_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH2LIMITL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH2LIMITL` reader - Write '1' to Enable interrupt for CH\\[2\\].LIMITL event"] +pub struct CH2LIMITL_R(crate::FieldReader); +impl CH2LIMITL_R { + pub(crate) fn new(bits: bool) -> Self { + CH2LIMITL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH2LIMITL_A { + match self.bits { + false => CH2LIMITL_A::DISABLED, + true => CH2LIMITL_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH2LIMITL_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH2LIMITL_A::ENABLED + } +} +impl core::ops::Deref for CH2LIMITL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[2\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH2LIMITL_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH2LIMITL_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH2LIMITL` writer - Write '1' to Enable interrupt for CH\\[2\\].LIMITL event"] +pub struct CH2LIMITL_W<'a> { + w: &'a mut W, +} +impl<'a> CH2LIMITL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH2LIMITL_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH2LIMITL_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[3\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH3LIMITH_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH3LIMITH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH3LIMITH` reader - Write '1' to Enable interrupt for CH\\[3\\].LIMITH event"] +pub struct CH3LIMITH_R(crate::FieldReader); +impl CH3LIMITH_R { + pub(crate) fn new(bits: bool) -> Self { + CH3LIMITH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH3LIMITH_A { + match self.bits { + false => CH3LIMITH_A::DISABLED, + true => CH3LIMITH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH3LIMITH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH3LIMITH_A::ENABLED + } +} +impl core::ops::Deref for CH3LIMITH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[3\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH3LIMITH_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH3LIMITH_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH3LIMITH` writer - Write '1' to Enable interrupt for CH\\[3\\].LIMITH event"] +pub struct CH3LIMITH_W<'a> { + w: &'a mut W, +} +impl<'a> CH3LIMITH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH3LIMITH_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH3LIMITH_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[3\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH3LIMITL_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH3LIMITL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH3LIMITL` reader - Write '1' to Enable interrupt for CH\\[3\\].LIMITL event"] +pub struct CH3LIMITL_R(crate::FieldReader); +impl CH3LIMITL_R { + pub(crate) fn new(bits: bool) -> Self { + CH3LIMITL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH3LIMITL_A { + match self.bits { + false => CH3LIMITL_A::DISABLED, + true => CH3LIMITL_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH3LIMITL_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH3LIMITL_A::ENABLED + } +} +impl core::ops::Deref for CH3LIMITL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[3\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH3LIMITL_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH3LIMITL_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH3LIMITL` writer - Write '1' to Enable interrupt for CH\\[3\\].LIMITL event"] +pub struct CH3LIMITL_W<'a> { + w: &'a mut W, +} +impl<'a> CH3LIMITL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH3LIMITL_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH3LIMITL_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[4\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH4LIMITH_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH4LIMITH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH4LIMITH` reader - Write '1' to Enable interrupt for CH\\[4\\].LIMITH event"] +pub struct CH4LIMITH_R(crate::FieldReader); +impl CH4LIMITH_R { + pub(crate) fn new(bits: bool) -> Self { + CH4LIMITH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH4LIMITH_A { + match self.bits { + false => CH4LIMITH_A::DISABLED, + true => CH4LIMITH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH4LIMITH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH4LIMITH_A::ENABLED + } +} +impl core::ops::Deref for CH4LIMITH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[4\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH4LIMITH_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH4LIMITH_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH4LIMITH` writer - Write '1' to Enable interrupt for CH\\[4\\].LIMITH event"] +pub struct CH4LIMITH_W<'a> { + w: &'a mut W, +} +impl<'a> CH4LIMITH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH4LIMITH_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH4LIMITH_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[4\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH4LIMITL_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH4LIMITL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH4LIMITL` reader - Write '1' to Enable interrupt for CH\\[4\\].LIMITL event"] +pub struct CH4LIMITL_R(crate::FieldReader); +impl CH4LIMITL_R { + pub(crate) fn new(bits: bool) -> Self { + CH4LIMITL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH4LIMITL_A { + match self.bits { + false => CH4LIMITL_A::DISABLED, + true => CH4LIMITL_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH4LIMITL_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH4LIMITL_A::ENABLED + } +} +impl core::ops::Deref for CH4LIMITL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[4\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH4LIMITL_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH4LIMITL_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH4LIMITL` writer - Write '1' to Enable interrupt for CH\\[4\\].LIMITL event"] +pub struct CH4LIMITL_W<'a> { + w: &'a mut W, +} +impl<'a> CH4LIMITL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH4LIMITL_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH4LIMITL_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 15)) | ((value as u32 & 0x01) << 15); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[5\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH5LIMITH_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH5LIMITH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH5LIMITH` reader - Write '1' to Enable interrupt for CH\\[5\\].LIMITH event"] +pub struct CH5LIMITH_R(crate::FieldReader); +impl CH5LIMITH_R { + pub(crate) fn new(bits: bool) -> Self { + CH5LIMITH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH5LIMITH_A { + match self.bits { + false => CH5LIMITH_A::DISABLED, + true => CH5LIMITH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH5LIMITH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH5LIMITH_A::ENABLED + } +} +impl core::ops::Deref for CH5LIMITH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[5\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH5LIMITH_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH5LIMITH_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH5LIMITH` writer - Write '1' to Enable interrupt for CH\\[5\\].LIMITH event"] +pub struct CH5LIMITH_W<'a> { + w: &'a mut W, +} +impl<'a> CH5LIMITH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH5LIMITH_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH5LIMITH_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[5\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH5LIMITL_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH5LIMITL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH5LIMITL` reader - Write '1' to Enable interrupt for CH\\[5\\].LIMITL event"] +pub struct CH5LIMITL_R(crate::FieldReader); +impl CH5LIMITL_R { + pub(crate) fn new(bits: bool) -> Self { + CH5LIMITL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH5LIMITL_A { + match self.bits { + false => CH5LIMITL_A::DISABLED, + true => CH5LIMITL_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH5LIMITL_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH5LIMITL_A::ENABLED + } +} +impl core::ops::Deref for CH5LIMITL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[5\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH5LIMITL_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH5LIMITL_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH5LIMITL` writer - Write '1' to Enable interrupt for CH\\[5\\].LIMITL event"] +pub struct CH5LIMITL_W<'a> { + w: &'a mut W, +} +impl<'a> CH5LIMITL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH5LIMITL_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH5LIMITL_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[6\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH6LIMITH_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH6LIMITH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH6LIMITH` reader - Write '1' to Enable interrupt for CH\\[6\\].LIMITH event"] +pub struct CH6LIMITH_R(crate::FieldReader); +impl CH6LIMITH_R { + pub(crate) fn new(bits: bool) -> Self { + CH6LIMITH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH6LIMITH_A { + match self.bits { + false => CH6LIMITH_A::DISABLED, + true => CH6LIMITH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH6LIMITH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH6LIMITH_A::ENABLED + } +} +impl core::ops::Deref for CH6LIMITH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[6\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH6LIMITH_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH6LIMITH_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH6LIMITH` writer - Write '1' to Enable interrupt for CH\\[6\\].LIMITH event"] +pub struct CH6LIMITH_W<'a> { + w: &'a mut W, +} +impl<'a> CH6LIMITH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH6LIMITH_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH6LIMITH_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[6\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH6LIMITL_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH6LIMITL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH6LIMITL` reader - Write '1' to Enable interrupt for CH\\[6\\].LIMITL event"] +pub struct CH6LIMITL_R(crate::FieldReader); +impl CH6LIMITL_R { + pub(crate) fn new(bits: bool) -> Self { + CH6LIMITL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH6LIMITL_A { + match self.bits { + false => CH6LIMITL_A::DISABLED, + true => CH6LIMITL_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH6LIMITL_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH6LIMITL_A::ENABLED + } +} +impl core::ops::Deref for CH6LIMITL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[6\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH6LIMITL_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH6LIMITL_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH6LIMITL` writer - Write '1' to Enable interrupt for CH\\[6\\].LIMITL event"] +pub struct CH6LIMITL_W<'a> { + w: &'a mut W, +} +impl<'a> CH6LIMITL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH6LIMITL_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH6LIMITL_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[7\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH7LIMITH_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH7LIMITH_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH7LIMITH` reader - Write '1' to Enable interrupt for CH\\[7\\].LIMITH event"] +pub struct CH7LIMITH_R(crate::FieldReader); +impl CH7LIMITH_R { + pub(crate) fn new(bits: bool) -> Self { + CH7LIMITH_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH7LIMITH_A { + match self.bits { + false => CH7LIMITH_A::DISABLED, + true => CH7LIMITH_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH7LIMITH_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH7LIMITH_A::ENABLED + } +} +impl core::ops::Deref for CH7LIMITH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[7\\].LIMITH event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH7LIMITH_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH7LIMITH_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH7LIMITH` writer - Write '1' to Enable interrupt for CH\\[7\\].LIMITH event"] +pub struct CH7LIMITH_W<'a> { + w: &'a mut W, +} +impl<'a> CH7LIMITH_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH7LIMITH_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH7LIMITH_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[7\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH7LIMITL_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH7LIMITL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH7LIMITL` reader - Write '1' to Enable interrupt for CH\\[7\\].LIMITL event"] +pub struct CH7LIMITL_R(crate::FieldReader); +impl CH7LIMITL_R { + pub(crate) fn new(bits: bool) -> Self { + CH7LIMITL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CH7LIMITL_A { + match self.bits { + false => CH7LIMITL_A::DISABLED, + true => CH7LIMITL_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CH7LIMITL_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CH7LIMITL_A::ENABLED + } +} +impl core::ops::Deref for CH7LIMITL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for CH\\[7\\].LIMITL event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CH7LIMITL_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CH7LIMITL_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CH7LIMITL` writer - Write '1' to Enable interrupt for CH\\[7\\].LIMITL event"] +pub struct CH7LIMITL_W<'a> { + w: &'a mut W, +} +impl<'a> CH7LIMITL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CH7LIMITL_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CH7LIMITL_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Enable interrupt for STARTED event"] + #[inline(always)] + pub fn started(&self) -> STARTED_R { + STARTED_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for END event"] + #[inline(always)] + pub fn end(&self) -> END_R { + END_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for DONE event"] + #[inline(always)] + pub fn done(&self) -> DONE_R { + DONE_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Write '1' to Enable interrupt for RESULTDONE event"] + #[inline(always)] + pub fn resultdone(&self) -> RESULTDONE_R { + RESULTDONE_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Write '1' to Enable interrupt for CALIBRATEDONE event"] + #[inline(always)] + pub fn calibratedone(&self) -> CALIBRATEDONE_R { + CALIBRATEDONE_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Write '1' to Enable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&self) -> STOPPED_R { + STOPPED_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Write '1' to Enable interrupt for CH\\[0\\].LIMITH event"] + #[inline(always)] + pub fn ch0limith(&self) -> CH0LIMITH_R { + CH0LIMITH_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Write '1' to Enable interrupt for CH\\[0\\].LIMITL event"] + #[inline(always)] + pub fn ch0limitl(&self) -> CH0LIMITL_R { + CH0LIMITL_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Write '1' to Enable interrupt for CH\\[1\\].LIMITH event"] + #[inline(always)] + pub fn ch1limith(&self) -> CH1LIMITH_R { + CH1LIMITH_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Write '1' to Enable interrupt for CH\\[1\\].LIMITL event"] + #[inline(always)] + pub fn ch1limitl(&self) -> CH1LIMITL_R { + CH1LIMITL_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Write '1' to Enable interrupt for CH\\[2\\].LIMITH event"] + #[inline(always)] + pub fn ch2limith(&self) -> CH2LIMITH_R { + CH2LIMITH_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Write '1' to Enable interrupt for CH\\[2\\].LIMITL event"] + #[inline(always)] + pub fn ch2limitl(&self) -> CH2LIMITL_R { + CH2LIMITL_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Write '1' to Enable interrupt for CH\\[3\\].LIMITH event"] + #[inline(always)] + pub fn ch3limith(&self) -> CH3LIMITH_R { + CH3LIMITH_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Write '1' to Enable interrupt for CH\\[3\\].LIMITL event"] + #[inline(always)] + pub fn ch3limitl(&self) -> CH3LIMITL_R { + CH3LIMITL_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Write '1' to Enable interrupt for CH\\[4\\].LIMITH event"] + #[inline(always)] + pub fn ch4limith(&self) -> CH4LIMITH_R { + CH4LIMITH_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 15 - Write '1' to Enable interrupt for CH\\[4\\].LIMITL event"] + #[inline(always)] + pub fn ch4limitl(&self) -> CH4LIMITL_R { + CH4LIMITL_R::new(((self.bits >> 15) & 0x01) != 0) + } + #[doc = "Bit 16 - Write '1' to Enable interrupt for CH\\[5\\].LIMITH event"] + #[inline(always)] + pub fn ch5limith(&self) -> CH5LIMITH_R { + CH5LIMITH_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Write '1' to Enable interrupt for CH\\[5\\].LIMITL event"] + #[inline(always)] + pub fn ch5limitl(&self) -> CH5LIMITL_R { + CH5LIMITL_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Write '1' to Enable interrupt for CH\\[6\\].LIMITH event"] + #[inline(always)] + pub fn ch6limith(&self) -> CH6LIMITH_R { + CH6LIMITH_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Write '1' to Enable interrupt for CH\\[6\\].LIMITL event"] + #[inline(always)] + pub fn ch6limitl(&self) -> CH6LIMITL_R { + CH6LIMITL_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Write '1' to Enable interrupt for CH\\[7\\].LIMITH event"] + #[inline(always)] + pub fn ch7limith(&self) -> CH7LIMITH_R { + CH7LIMITH_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 21 - Write '1' to Enable interrupt for CH\\[7\\].LIMITL event"] + #[inline(always)] + pub fn ch7limitl(&self) -> CH7LIMITL_R { + CH7LIMITL_R::new(((self.bits >> 21) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Enable interrupt for STARTED event"] + #[inline(always)] + pub fn started(&mut self) -> STARTED_W { + STARTED_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for END event"] + #[inline(always)] + pub fn end(&mut self) -> END_W { + END_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for DONE event"] + #[inline(always)] + pub fn done(&mut self) -> DONE_W { + DONE_W { w: self } + } + #[doc = "Bit 3 - Write '1' to Enable interrupt for RESULTDONE event"] + #[inline(always)] + pub fn resultdone(&mut self) -> RESULTDONE_W { + RESULTDONE_W { w: self } + } + #[doc = "Bit 4 - Write '1' to Enable interrupt for CALIBRATEDONE event"] + #[inline(always)] + pub fn calibratedone(&mut self) -> CALIBRATEDONE_W { + CALIBRATEDONE_W { w: self } + } + #[doc = "Bit 5 - Write '1' to Enable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&mut self) -> STOPPED_W { + STOPPED_W { w: self } + } + #[doc = "Bit 6 - Write '1' to Enable interrupt for CH\\[0\\].LIMITH event"] + #[inline(always)] + pub fn ch0limith(&mut self) -> CH0LIMITH_W { + CH0LIMITH_W { w: self } + } + #[doc = "Bit 7 - Write '1' to Enable interrupt for CH\\[0\\].LIMITL event"] + #[inline(always)] + pub fn ch0limitl(&mut self) -> CH0LIMITL_W { + CH0LIMITL_W { w: self } + } + #[doc = "Bit 8 - Write '1' to Enable interrupt for CH\\[1\\].LIMITH event"] + #[inline(always)] + pub fn ch1limith(&mut self) -> CH1LIMITH_W { + CH1LIMITH_W { w: self } + } + #[doc = "Bit 9 - Write '1' to Enable interrupt for CH\\[1\\].LIMITL event"] + #[inline(always)] + pub fn ch1limitl(&mut self) -> CH1LIMITL_W { + CH1LIMITL_W { w: self } + } + #[doc = "Bit 10 - Write '1' to Enable interrupt for CH\\[2\\].LIMITH event"] + #[inline(always)] + pub fn ch2limith(&mut self) -> CH2LIMITH_W { + CH2LIMITH_W { w: self } + } + #[doc = "Bit 11 - Write '1' to Enable interrupt for CH\\[2\\].LIMITL event"] + #[inline(always)] + pub fn ch2limitl(&mut self) -> CH2LIMITL_W { + CH2LIMITL_W { w: self } + } + #[doc = "Bit 12 - Write '1' to Enable interrupt for CH\\[3\\].LIMITH event"] + #[inline(always)] + pub fn ch3limith(&mut self) -> CH3LIMITH_W { + CH3LIMITH_W { w: self } + } + #[doc = "Bit 13 - Write '1' to Enable interrupt for CH\\[3\\].LIMITL event"] + #[inline(always)] + pub fn ch3limitl(&mut self) -> CH3LIMITL_W { + CH3LIMITL_W { w: self } + } + #[doc = "Bit 14 - Write '1' to Enable interrupt for CH\\[4\\].LIMITH event"] + #[inline(always)] + pub fn ch4limith(&mut self) -> CH4LIMITH_W { + CH4LIMITH_W { w: self } + } + #[doc = "Bit 15 - Write '1' to Enable interrupt for CH\\[4\\].LIMITL event"] + #[inline(always)] + pub fn ch4limitl(&mut self) -> CH4LIMITL_W { + CH4LIMITL_W { w: self } + } + #[doc = "Bit 16 - Write '1' to Enable interrupt for CH\\[5\\].LIMITH event"] + #[inline(always)] + pub fn ch5limith(&mut self) -> CH5LIMITH_W { + CH5LIMITH_W { w: self } + } + #[doc = "Bit 17 - Write '1' to Enable interrupt for CH\\[5\\].LIMITL event"] + #[inline(always)] + pub fn ch5limitl(&mut self) -> CH5LIMITL_W { + CH5LIMITL_W { w: self } + } + #[doc = "Bit 18 - Write '1' to Enable interrupt for CH\\[6\\].LIMITH event"] + #[inline(always)] + pub fn ch6limith(&mut self) -> CH6LIMITH_W { + CH6LIMITH_W { w: self } + } + #[doc = "Bit 19 - Write '1' to Enable interrupt for CH\\[6\\].LIMITL event"] + #[inline(always)] + pub fn ch6limitl(&mut self) -> CH6LIMITL_W { + CH6LIMITL_W { w: self } + } + #[doc = "Bit 20 - Write '1' to Enable interrupt for CH\\[7\\].LIMITH event"] + #[inline(always)] + pub fn ch7limith(&mut self) -> CH7LIMITH_W { + CH7LIMITH_W { w: self } + } + #[doc = "Bit 21 - Write '1' to Enable interrupt for CH\\[7\\].LIMITL event"] + #[inline(always)] + pub fn ch7limitl(&mut self) -> CH7LIMITL_W { + CH7LIMITL_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/saadc/oversample.rs b/src/saadc/oversample.rs new file mode 100644 index 0000000..ffee66a --- /dev/null +++ b/src/saadc/oversample.rs @@ -0,0 +1,242 @@ +#[doc = "Register `OVERSAMPLE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `OVERSAMPLE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Oversample control\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum OVERSAMPLE_A { + #[doc = "0: Bypass oversampling"] + BYPASS = 0, + #[doc = "1: Oversample 2x"] + OVER2X = 1, + #[doc = "2: Oversample 4x"] + OVER4X = 2, + #[doc = "3: Oversample 8x"] + OVER8X = 3, + #[doc = "4: Oversample 16x"] + OVER16X = 4, + #[doc = "5: Oversample 32x"] + OVER32X = 5, + #[doc = "6: Oversample 64x"] + OVER64X = 6, + #[doc = "7: Oversample 128x"] + OVER128X = 7, + #[doc = "8: Oversample 256x"] + OVER256X = 8, +} +impl From for u8 { + #[inline(always)] + fn from(variant: OVERSAMPLE_A) -> Self { + variant as _ + } +} +#[doc = "Field `OVERSAMPLE` reader - Oversample control"] +pub struct OVERSAMPLE_R(crate::FieldReader); +impl OVERSAMPLE_R { + pub(crate) fn new(bits: u8) -> Self { + OVERSAMPLE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(OVERSAMPLE_A::BYPASS), + 1 => Some(OVERSAMPLE_A::OVER2X), + 2 => Some(OVERSAMPLE_A::OVER4X), + 3 => Some(OVERSAMPLE_A::OVER8X), + 4 => Some(OVERSAMPLE_A::OVER16X), + 5 => Some(OVERSAMPLE_A::OVER32X), + 6 => Some(OVERSAMPLE_A::OVER64X), + 7 => Some(OVERSAMPLE_A::OVER128X), + 8 => Some(OVERSAMPLE_A::OVER256X), + _ => None, + } + } + #[doc = "Checks if the value of the field is `BYPASS`"] + #[inline(always)] + pub fn is_bypass(&self) -> bool { + **self == OVERSAMPLE_A::BYPASS + } + #[doc = "Checks if the value of the field is `OVER2X`"] + #[inline(always)] + pub fn is_over2x(&self) -> bool { + **self == OVERSAMPLE_A::OVER2X + } + #[doc = "Checks if the value of the field is `OVER4X`"] + #[inline(always)] + pub fn is_over4x(&self) -> bool { + **self == OVERSAMPLE_A::OVER4X + } + #[doc = "Checks if the value of the field is `OVER8X`"] + #[inline(always)] + pub fn is_over8x(&self) -> bool { + **self == OVERSAMPLE_A::OVER8X + } + #[doc = "Checks if the value of the field is `OVER16X`"] + #[inline(always)] + pub fn is_over16x(&self) -> bool { + **self == OVERSAMPLE_A::OVER16X + } + #[doc = "Checks if the value of the field is `OVER32X`"] + #[inline(always)] + pub fn is_over32x(&self) -> bool { + **self == OVERSAMPLE_A::OVER32X + } + #[doc = "Checks if the value of the field is `OVER64X`"] + #[inline(always)] + pub fn is_over64x(&self) -> bool { + **self == OVERSAMPLE_A::OVER64X + } + #[doc = "Checks if the value of the field is `OVER128X`"] + #[inline(always)] + pub fn is_over128x(&self) -> bool { + **self == OVERSAMPLE_A::OVER128X + } + #[doc = "Checks if the value of the field is `OVER256X`"] + #[inline(always)] + pub fn is_over256x(&self) -> bool { + **self == OVERSAMPLE_A::OVER256X + } +} +impl core::ops::Deref for OVERSAMPLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OVERSAMPLE` writer - Oversample control"] +pub struct OVERSAMPLE_W<'a> { + w: &'a mut W, +} +impl<'a> OVERSAMPLE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: OVERSAMPLE_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Bypass oversampling"] + #[inline(always)] + pub fn bypass(self) -> &'a mut W { + self.variant(OVERSAMPLE_A::BYPASS) + } + #[doc = "Oversample 2x"] + #[inline(always)] + pub fn over2x(self) -> &'a mut W { + self.variant(OVERSAMPLE_A::OVER2X) + } + #[doc = "Oversample 4x"] + #[inline(always)] + pub fn over4x(self) -> &'a mut W { + self.variant(OVERSAMPLE_A::OVER4X) + } + #[doc = "Oversample 8x"] + #[inline(always)] + pub fn over8x(self) -> &'a mut W { + self.variant(OVERSAMPLE_A::OVER8X) + } + #[doc = "Oversample 16x"] + #[inline(always)] + pub fn over16x(self) -> &'a mut W { + self.variant(OVERSAMPLE_A::OVER16X) + } + #[doc = "Oversample 32x"] + #[inline(always)] + pub fn over32x(self) -> &'a mut W { + self.variant(OVERSAMPLE_A::OVER32X) + } + #[doc = "Oversample 64x"] + #[inline(always)] + pub fn over64x(self) -> &'a mut W { + self.variant(OVERSAMPLE_A::OVER64X) + } + #[doc = "Oversample 128x"] + #[inline(always)] + pub fn over128x(self) -> &'a mut W { + self.variant(OVERSAMPLE_A::OVER128X) + } + #[doc = "Oversample 256x"] + #[inline(always)] + pub fn over256x(self) -> &'a mut W { + self.variant(OVERSAMPLE_A::OVER256X) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); + self.w + } +} +impl R { + #[doc = "Bits 0:3 - Oversample control"] + #[inline(always)] + pub fn oversample(&self) -> OVERSAMPLE_R { + OVERSAMPLE_R::new((self.bits & 0x0f) as u8) + } +} +impl W { + #[doc = "Bits 0:3 - Oversample control"] + #[inline(always)] + pub fn oversample(&mut self) -> OVERSAMPLE_W { + OVERSAMPLE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Oversampling configuration. OVERSAMPLE should not be combined with SCAN. The RESOLUTION is applied before averaging, thus for high OVERSAMPLE a higher RESOLUTION should be used.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [oversample](index.html) module"] +pub struct OVERSAMPLE_SPEC; +impl crate::RegisterSpec for OVERSAMPLE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [oversample::R](R) reader structure"] +impl crate::Readable for OVERSAMPLE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [oversample::W](W) writer structure"] +impl crate::Writable for OVERSAMPLE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets OVERSAMPLE to value 0"] +impl crate::Resettable for OVERSAMPLE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/saadc/resolution.rs b/src/saadc/resolution.rs new file mode 100644 index 0000000..990f8bb --- /dev/null +++ b/src/saadc/resolution.rs @@ -0,0 +1,177 @@ +#[doc = "Register `RESOLUTION` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `RESOLUTION` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Set the resolution\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum VAL_A { + #[doc = "0: 8 bit"] + _8BIT = 0, + #[doc = "1: 10 bit"] + _10BIT = 1, + #[doc = "2: 12 bit"] + _12BIT = 2, + #[doc = "3: 14 bit"] + _14BIT = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: VAL_A) -> Self { + variant as _ + } +} +#[doc = "Field `VAL` reader - Set the resolution"] +pub struct VAL_R(crate::FieldReader); +impl VAL_R { + pub(crate) fn new(bits: u8) -> Self { + VAL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(VAL_A::_8BIT), + 1 => Some(VAL_A::_10BIT), + 2 => Some(VAL_A::_12BIT), + 3 => Some(VAL_A::_14BIT), + _ => None, + } + } + #[doc = "Checks if the value of the field is `_8BIT`"] + #[inline(always)] + pub fn is_8bit(&self) -> bool { + **self == VAL_A::_8BIT + } + #[doc = "Checks if the value of the field is `_10BIT`"] + #[inline(always)] + pub fn is_10bit(&self) -> bool { + **self == VAL_A::_10BIT + } + #[doc = "Checks if the value of the field is `_12BIT`"] + #[inline(always)] + pub fn is_12bit(&self) -> bool { + **self == VAL_A::_12BIT + } + #[doc = "Checks if the value of the field is `_14BIT`"] + #[inline(always)] + pub fn is_14bit(&self) -> bool { + **self == VAL_A::_14BIT + } +} +impl core::ops::Deref for VAL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `VAL` writer - Set the resolution"] +pub struct VAL_W<'a> { + w: &'a mut W, +} +impl<'a> VAL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: VAL_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "8 bit"] + #[inline(always)] + pub fn _8bit(self) -> &'a mut W { + self.variant(VAL_A::_8BIT) + } + #[doc = "10 bit"] + #[inline(always)] + pub fn _10bit(self) -> &'a mut W { + self.variant(VAL_A::_10BIT) + } + #[doc = "12 bit"] + #[inline(always)] + pub fn _12bit(self) -> &'a mut W { + self.variant(VAL_A::_12BIT) + } + #[doc = "14 bit"] + #[inline(always)] + pub fn _14bit(self) -> &'a mut W { + self.variant(VAL_A::_14BIT) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); + self.w + } +} +impl R { + #[doc = "Bits 0:2 - Set the resolution"] + #[inline(always)] + pub fn val(&self) -> VAL_R { + VAL_R::new((self.bits & 0x07) as u8) + } +} +impl W { + #[doc = "Bits 0:2 - Set the resolution"] + #[inline(always)] + pub fn val(&mut self) -> VAL_W { + VAL_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Resolution configuration\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [resolution](index.html) module"] +pub struct RESOLUTION_SPEC; +impl crate::RegisterSpec for RESOLUTION_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [resolution::R](R) reader structure"] +impl crate::Readable for RESOLUTION_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [resolution::W](W) writer structure"] +impl crate::Writable for RESOLUTION_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets RESOLUTION to value 0x01"] +impl crate::Resettable for RESOLUTION_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x01 + } +} diff --git a/src/saadc/result.rs b/src/saadc/result.rs new file mode 100644 index 0000000..cf4fe96 --- /dev/null +++ b/src/saadc/result.rs @@ -0,0 +1,12 @@ +#[doc = "PTR register accessor: an alias for `Reg`"] +pub type PTR = crate::Reg; +#[doc = "Data pointer"] +pub mod ptr; +#[doc = "MAXCNT register accessor: an alias for `Reg`"] +pub type MAXCNT = crate::Reg; +#[doc = "Maximum number of buffer words to transfer"] +pub mod maxcnt; +#[doc = "AMOUNT register accessor: an alias for `Reg`"] +pub type AMOUNT = crate::Reg; +#[doc = "Number of buffer words transferred since last START"] +pub mod amount; diff --git a/src/saadc/result/amount.rs b/src/saadc/result/amount.rs new file mode 100644 index 0000000..dc7a316 --- /dev/null +++ b/src/saadc/result/amount.rs @@ -0,0 +1,52 @@ +#[doc = "Register `AMOUNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `AMOUNT` reader - Number of buffer words transferred since last START. This register can be read after an END or STOPPED event."] +pub struct AMOUNT_R(crate::FieldReader); +impl AMOUNT_R { + pub(crate) fn new(bits: u16) -> Self { + AMOUNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AMOUNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:14 - Number of buffer words transferred since last START. This register can be read after an END or STOPPED event."] + #[inline(always)] + pub fn amount(&self) -> AMOUNT_R { + AMOUNT_R::new((self.bits & 0x7fff) as u16) + } +} +#[doc = "Number of buffer words transferred since last START\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 [amount](index.html) module"] +pub struct AMOUNT_SPEC; +impl crate::RegisterSpec for AMOUNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [amount::R](R) reader structure"] +impl crate::Readable for AMOUNT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets AMOUNT to value 0"] +impl crate::Resettable for AMOUNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/saadc/result/maxcnt.rs b/src/saadc/result/maxcnt.rs new file mode 100644 index 0000000..23841ed --- /dev/null +++ b/src/saadc/result/maxcnt.rs @@ -0,0 +1,102 @@ +#[doc = "Register `MAXCNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MAXCNT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `MAXCNT` reader - Maximum number of buffer words to transfer"] +pub struct MAXCNT_R(crate::FieldReader); +impl MAXCNT_R { + pub(crate) fn new(bits: u16) -> Self { + MAXCNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MAXCNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MAXCNT` writer - Maximum number of buffer words to transfer"] +pub struct MAXCNT_W<'a> { + w: &'a mut W, +} +impl<'a> MAXCNT_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !0x7fff) | (value as u32 & 0x7fff); + self.w + } +} +impl R { + #[doc = "Bits 0:14 - Maximum number of buffer words to transfer"] + #[inline(always)] + pub fn maxcnt(&self) -> MAXCNT_R { + MAXCNT_R::new((self.bits & 0x7fff) as u16) + } +} +impl W { + #[doc = "Bits 0:14 - Maximum number of buffer words to transfer"] + #[inline(always)] + pub fn maxcnt(&mut self) -> MAXCNT_W { + MAXCNT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Maximum number of buffer words to transfer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [maxcnt](index.html) module"] +pub struct MAXCNT_SPEC; +impl crate::RegisterSpec for MAXCNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [maxcnt::R](R) reader structure"] +impl crate::Readable for MAXCNT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [maxcnt::W](W) writer structure"] +impl crate::Writable for MAXCNT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MAXCNT to value 0"] +impl crate::Resettable for MAXCNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/saadc/result/ptr.rs b/src/saadc/result/ptr.rs new file mode 100644 index 0000000..681f382 --- /dev/null +++ b/src/saadc/result/ptr.rs @@ -0,0 +1,102 @@ +#[doc = "Register `PTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PTR` reader - Data pointer"] +pub struct PTR_R(crate::FieldReader); +impl PTR_R { + pub(crate) fn new(bits: u32) -> Self { + PTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PTR` writer - Data pointer"] +pub struct PTR_W<'a> { + w: &'a mut W, +} +impl<'a> PTR_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Data pointer"] + #[inline(always)] + pub fn ptr(&self) -> PTR_R { + PTR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Data pointer"] + #[inline(always)] + pub fn ptr(&mut self) -> PTR_W { + PTR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Data pointer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ptr](index.html) module"] +pub struct PTR_SPEC; +impl crate::RegisterSpec for PTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ptr::R](R) reader structure"] +impl crate::Readable for PTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ptr::W](W) writer structure"] +impl crate::Writable for PTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PTR to value 0"] +impl crate::Resettable for PTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/saadc/samplerate.rs b/src/saadc/samplerate.rs new file mode 100644 index 0000000..2c34655 --- /dev/null +++ b/src/saadc/samplerate.rs @@ -0,0 +1,195 @@ +#[doc = "Register `SAMPLERATE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SAMPLERATE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CC` reader - Capture and compare value. Sample rate is 16 MHz/CC"] +pub struct CC_R(crate::FieldReader); +impl CC_R { + pub(crate) fn new(bits: u16) -> Self { + CC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CC` writer - Capture and compare value. Sample rate is 16 MHz/CC"] +pub struct CC_W<'a> { + w: &'a mut W, +} +impl<'a> CC_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !0x07ff) | (value as u32 & 0x07ff); + self.w + } +} +#[doc = "Select mode for sample rate control\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum MODE_A { + #[doc = "0: Rate is controlled from SAMPLE task"] + TASK = 0, + #[doc = "1: Rate is controlled from local timer (use CC to control the rate)"] + TIMERS = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: MODE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `MODE` reader - Select mode for sample rate control"] +pub struct MODE_R(crate::FieldReader); +impl MODE_R { + pub(crate) fn new(bits: bool) -> Self { + MODE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> MODE_A { + match self.bits { + false => MODE_A::TASK, + true => MODE_A::TIMERS, + } + } + #[doc = "Checks if the value of the field is `TASK`"] + #[inline(always)] + pub fn is_task(&self) -> bool { + **self == MODE_A::TASK + } + #[doc = "Checks if the value of the field is `TIMERS`"] + #[inline(always)] + pub fn is_timers(&self) -> bool { + **self == MODE_A::TIMERS + } +} +impl core::ops::Deref for MODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MODE` writer - Select mode for sample rate control"] +pub struct MODE_W<'a> { + w: &'a mut W, +} +impl<'a> MODE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: MODE_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Rate is controlled from SAMPLE task"] + #[inline(always)] + pub fn task(self) -> &'a mut W { + self.variant(MODE_A::TASK) + } + #[doc = "Rate is controlled from local timer (use CC to control the rate)"] + #[inline(always)] + pub fn timers(self) -> &'a mut W { + self.variant(MODE_A::TIMERS) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +impl R { + #[doc = "Bits 0:10 - Capture and compare value. Sample rate is 16 MHz/CC"] + #[inline(always)] + pub fn cc(&self) -> CC_R { + CC_R::new((self.bits & 0x07ff) as u16) + } + #[doc = "Bit 12 - Select mode for sample rate control"] + #[inline(always)] + pub fn mode(&self) -> MODE_R { + MODE_R::new(((self.bits >> 12) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:10 - Capture and compare value. Sample rate is 16 MHz/CC"] + #[inline(always)] + pub fn cc(&mut self) -> CC_W { + CC_W { w: self } + } + #[doc = "Bit 12 - Select mode for sample rate control"] + #[inline(always)] + pub fn mode(&mut self) -> MODE_W { + MODE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Controls normal or continuous sample rate\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [samplerate](index.html) module"] +pub struct SAMPLERATE_SPEC; +impl crate::RegisterSpec for SAMPLERATE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [samplerate::R](R) reader structure"] +impl crate::Readable for SAMPLERATE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [samplerate::W](W) writer structure"] +impl crate::Writable for SAMPLERATE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SAMPLERATE to value 0"] +impl crate::Resettable for SAMPLERATE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/saadc/status.rs b/src/saadc/status.rs new file mode 100644 index 0000000..495e310 --- /dev/null +++ b/src/saadc/status.rs @@ -0,0 +1,84 @@ +#[doc = "Register `STATUS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Status\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STATUS_A { + #[doc = "0: ADC is ready. No on-going conversion."] + READY = 0, + #[doc = "1: ADC is busy. Conversion in progress."] + BUSY = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STATUS_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STATUS` reader - Status"] +pub struct STATUS_R(crate::FieldReader); +impl STATUS_R { + pub(crate) fn new(bits: bool) -> Self { + STATUS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STATUS_A { + match self.bits { + false => STATUS_A::READY, + true => STATUS_A::BUSY, + } + } + #[doc = "Checks if the value of the field is `READY`"] + #[inline(always)] + pub fn is_ready(&self) -> bool { + **self == STATUS_A::READY + } + #[doc = "Checks if the value of the field is `BUSY`"] + #[inline(always)] + pub fn is_busy(&self) -> bool { + **self == STATUS_A::BUSY + } +} +impl core::ops::Deref for STATUS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bit 0 - Status"] + #[inline(always)] + pub fn status(&self) -> STATUS_R { + STATUS_R::new((self.bits & 0x01) != 0) + } +} +#[doc = "Status\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 [status](index.html) module"] +pub struct STATUS_SPEC; +impl crate::RegisterSpec for STATUS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [status::R](R) reader structure"] +impl crate::Readable for STATUS_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets STATUS to value 0"] +impl crate::Resettable for STATUS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/saadc/tasks_calibrateoffset.rs b/src/saadc/tasks_calibrateoffset.rs new file mode 100644 index 0000000..80f7c5d --- /dev/null +++ b/src/saadc/tasks_calibrateoffset.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_CALIBRATEOFFSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Starts offset auto-calibration\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_calibrateoffset](index.html) module"] +pub struct TASKS_CALIBRATEOFFSET_SPEC; +impl crate::RegisterSpec for TASKS_CALIBRATEOFFSET_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_calibrateoffset::W](W) writer structure"] +impl crate::Writable for TASKS_CALIBRATEOFFSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_CALIBRATEOFFSET to value 0"] +impl crate::Resettable for TASKS_CALIBRATEOFFSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/saadc/tasks_sample.rs b/src/saadc/tasks_sample.rs new file mode 100644 index 0000000..c83f925 --- /dev/null +++ b/src/saadc/tasks_sample.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_SAMPLE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Take one ADC sample, if scan is enabled all channels are sampled\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_sample](index.html) module"] +pub struct TASKS_SAMPLE_SPEC; +impl crate::RegisterSpec for TASKS_SAMPLE_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_sample::W](W) writer structure"] +impl crate::Writable for TASKS_SAMPLE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_SAMPLE to value 0"] +impl crate::Resettable for TASKS_SAMPLE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/saadc/tasks_start.rs b/src/saadc/tasks_start.rs new file mode 100644 index 0000000..e3601d7 --- /dev/null +++ b/src/saadc/tasks_start.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_START` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start the ADC and prepare the result buffer in RAM\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_start](index.html) module"] +pub struct TASKS_START_SPEC; +impl crate::RegisterSpec for TASKS_START_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_start::W](W) writer structure"] +impl crate::Writable for TASKS_START_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_START to value 0"] +impl crate::Resettable for TASKS_START_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/saadc/tasks_stop.rs b/src/saadc/tasks_stop.rs new file mode 100644 index 0000000..0e0b459 --- /dev/null +++ b/src/saadc/tasks_stop.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STOP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Stop the ADC and terminate any on-going conversion\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_stop](index.html) module"] +pub struct TASKS_STOP_SPEC; +impl crate::RegisterSpec for TASKS_STOP_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_stop::W](W) writer structure"] +impl crate::Writable for TASKS_STOP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STOP to value 0"] +impl crate::Resettable for TASKS_STOP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spi0.rs b/src/spi0.rs new file mode 100644 index 0000000..e8be75e --- /dev/null +++ b/src/spi0.rs @@ -0,0 +1,74 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + _reserved0: [u8; 0x0108], + #[doc = "0x108 - TXD byte sent and RXD byte received"] + pub events_ready: crate::Reg, + _reserved1: [u8; 0x01f8], + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved3: [u8; 0x01f4], + #[doc = "0x500 - Enable SPI"] + pub enable: crate::Reg, + _reserved4: [u8; 0x04], + #[doc = "0x508..0x514 - Unspecified"] + pub psel: PSEL, + _reserved5: [u8; 0x04], + #[doc = "0x518 - RXD register"] + pub rxd: crate::Reg, + #[doc = "0x51c - TXD register"] + pub txd: crate::Reg, + _reserved7: [u8; 0x04], + #[doc = "0x524 - SPI frequency"] + pub frequency: crate::Reg, + _reserved8: [u8; 0x2c], + #[doc = "0x554 - Configuration register"] + pub config: crate::Reg, +} +#[doc = r"Register block"] +#[repr(C)] +pub struct PSEL { + #[doc = "0x00 - Pin select for SCK"] + pub sck: crate::Reg, + #[doc = "0x04 - Pin select for MOSI"] + pub mosi: crate::Reg, + #[doc = "0x08 - Pin select for MISO"] + pub miso: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod psel; +#[doc = "EVENTS_READY register accessor: an alias for `Reg`"] +pub type EVENTS_READY = crate::Reg; +#[doc = "TXD byte sent and RXD byte received"] +pub mod events_ready; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "ENABLE register accessor: an alias for `Reg`"] +pub type ENABLE = crate::Reg; +#[doc = "Enable SPI"] +pub mod enable; +#[doc = "RXD register accessor: an alias for `Reg`"] +pub type RXD = crate::Reg; +#[doc = "RXD register"] +pub mod rxd; +#[doc = "TXD register accessor: an alias for `Reg`"] +pub type TXD = crate::Reg; +#[doc = "TXD register"] +pub mod txd; +#[doc = "FREQUENCY register accessor: an alias for `Reg`"] +pub type FREQUENCY = crate::Reg; +#[doc = "SPI frequency"] +pub mod frequency; +#[doc = "CONFIG register accessor: an alias for `Reg`"] +pub type CONFIG = crate::Reg; +#[doc = "Configuration register"] +pub mod config; diff --git a/src/spi0/config.rs b/src/spi0/config.rs new file mode 100644 index 0000000..14669c0 --- /dev/null +++ b/src/spi0/config.rs @@ -0,0 +1,345 @@ +#[doc = "Register `CONFIG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CONFIG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Bit order\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ORDER_A { + #[doc = "0: Most significant bit shifted out first"] + MSBFIRST = 0, + #[doc = "1: Least significant bit shifted out first"] + LSBFIRST = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ORDER_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ORDER` reader - Bit order"] +pub struct ORDER_R(crate::FieldReader); +impl ORDER_R { + pub(crate) fn new(bits: bool) -> Self { + ORDER_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ORDER_A { + match self.bits { + false => ORDER_A::MSBFIRST, + true => ORDER_A::LSBFIRST, + } + } + #[doc = "Checks if the value of the field is `MSBFIRST`"] + #[inline(always)] + pub fn is_msb_first(&self) -> bool { + **self == ORDER_A::MSBFIRST + } + #[doc = "Checks if the value of the field is `LSBFIRST`"] + #[inline(always)] + pub fn is_lsb_first(&self) -> bool { + **self == ORDER_A::LSBFIRST + } +} +impl core::ops::Deref for ORDER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ORDER` writer - Bit order"] +pub struct ORDER_W<'a> { + w: &'a mut W, +} +impl<'a> ORDER_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ORDER_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Most significant bit shifted out first"] + #[inline(always)] + pub fn msb_first(self) -> &'a mut W { + self.variant(ORDER_A::MSBFIRST) + } + #[doc = "Least significant bit shifted out first"] + #[inline(always)] + pub fn lsb_first(self) -> &'a mut W { + self.variant(ORDER_A::LSBFIRST) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Serial clock (SCK) phase\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CPHA_A { + #[doc = "0: Sample on leading edge of clock, shift serial data on trailing edge"] + LEADING = 0, + #[doc = "1: Sample on trailing edge of clock, shift serial data on leading edge"] + TRAILING = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CPHA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CPHA` reader - Serial clock (SCK) phase"] +pub struct CPHA_R(crate::FieldReader); +impl CPHA_R { + pub(crate) fn new(bits: bool) -> Self { + CPHA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CPHA_A { + match self.bits { + false => CPHA_A::LEADING, + true => CPHA_A::TRAILING, + } + } + #[doc = "Checks if the value of the field is `LEADING`"] + #[inline(always)] + pub fn is_leading(&self) -> bool { + **self == CPHA_A::LEADING + } + #[doc = "Checks if the value of the field is `TRAILING`"] + #[inline(always)] + pub fn is_trailing(&self) -> bool { + **self == CPHA_A::TRAILING + } +} +impl core::ops::Deref for CPHA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CPHA` writer - Serial clock (SCK) phase"] +pub struct CPHA_W<'a> { + w: &'a mut W, +} +impl<'a> CPHA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CPHA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Sample on leading edge of clock, shift serial data on trailing edge"] + #[inline(always)] + pub fn leading(self) -> &'a mut W { + self.variant(CPHA_A::LEADING) + } + #[doc = "Sample on trailing edge of clock, shift serial data on leading edge"] + #[inline(always)] + pub fn trailing(self) -> &'a mut W { + self.variant(CPHA_A::TRAILING) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Serial clock (SCK) polarity\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CPOL_A { + #[doc = "0: Active high"] + ACTIVEHIGH = 0, + #[doc = "1: Active low"] + ACTIVELOW = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CPOL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CPOL` reader - Serial clock (SCK) polarity"] +pub struct CPOL_R(crate::FieldReader); +impl CPOL_R { + pub(crate) fn new(bits: bool) -> Self { + CPOL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CPOL_A { + match self.bits { + false => CPOL_A::ACTIVEHIGH, + true => CPOL_A::ACTIVELOW, + } + } + #[doc = "Checks if the value of the field is `ACTIVEHIGH`"] + #[inline(always)] + pub fn is_active_high(&self) -> bool { + **self == CPOL_A::ACTIVEHIGH + } + #[doc = "Checks if the value of the field is `ACTIVELOW`"] + #[inline(always)] + pub fn is_active_low(&self) -> bool { + **self == CPOL_A::ACTIVELOW + } +} +impl core::ops::Deref for CPOL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CPOL` writer - Serial clock (SCK) polarity"] +pub struct CPOL_W<'a> { + w: &'a mut W, +} +impl<'a> CPOL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CPOL_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Active high"] + #[inline(always)] + pub fn active_high(self) -> &'a mut W { + self.variant(CPOL_A::ACTIVEHIGH) + } + #[doc = "Active low"] + #[inline(always)] + pub fn active_low(self) -> &'a mut W { + self.variant(CPOL_A::ACTIVELOW) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +impl R { + #[doc = "Bit 0 - Bit order"] + #[inline(always)] + pub fn order(&self) -> ORDER_R { + ORDER_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Serial clock (SCK) phase"] + #[inline(always)] + pub fn cpha(&self) -> CPHA_R { + CPHA_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Serial clock (SCK) polarity"] + #[inline(always)] + pub fn cpol(&self) -> CPOL_R { + CPOL_R::new(((self.bits >> 2) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Bit order"] + #[inline(always)] + pub fn order(&mut self) -> ORDER_W { + ORDER_W { w: self } + } + #[doc = "Bit 1 - Serial clock (SCK) phase"] + #[inline(always)] + pub fn cpha(&mut self) -> CPHA_W { + CPHA_W { w: self } + } + #[doc = "Bit 2 - Serial clock (SCK) polarity"] + #[inline(always)] + pub fn cpol(&mut self) -> CPOL_W { + CPOL_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Configuration register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [config](index.html) module"] +pub struct CONFIG_SPEC; +impl crate::RegisterSpec for CONFIG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [config::R](R) reader structure"] +impl crate::Readable for CONFIG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [config::W](W) writer structure"] +impl crate::Writable for CONFIG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CONFIG to value 0"] +impl crate::Resettable for CONFIG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spi0/enable.rs b/src/spi0/enable.rs new file mode 100644 index 0000000..e953111 --- /dev/null +++ b/src/spi0/enable.rs @@ -0,0 +1,151 @@ +#[doc = "Register `ENABLE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ENABLE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable SPI\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum ENABLE_A { + #[doc = "0: Disable SPI"] + DISABLED = 0, + #[doc = "1: Enable SPI"] + ENABLED = 1, +} +impl From for u8 { + #[inline(always)] + fn from(variant: ENABLE_A) -> Self { + variant as _ + } +} +#[doc = "Field `ENABLE` reader - Enable or disable SPI"] +pub struct ENABLE_R(crate::FieldReader); +impl ENABLE_R { + pub(crate) fn new(bits: u8) -> Self { + ENABLE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(ENABLE_A::DISABLED), + 1 => Some(ENABLE_A::ENABLED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENABLE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENABLE_A::ENABLED + } +} +impl core::ops::Deref for ENABLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENABLE` writer - Enable or disable SPI"] +pub struct ENABLE_W<'a> { + w: &'a mut W, +} +impl<'a> ENABLE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENABLE_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Disable SPI"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENABLE_A::DISABLED) + } + #[doc = "Enable SPI"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENABLE_A::ENABLED) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); + self.w + } +} +impl R { + #[doc = "Bits 0:3 - Enable or disable SPI"] + #[inline(always)] + pub fn enable(&self) -> ENABLE_R { + ENABLE_R::new((self.bits & 0x0f) as u8) + } +} +impl W { + #[doc = "Bits 0:3 - Enable or disable SPI"] + #[inline(always)] + pub fn enable(&mut self) -> ENABLE_W { + ENABLE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable SPI\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [enable](index.html) module"] +pub struct ENABLE_SPEC; +impl crate::RegisterSpec for ENABLE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [enable::R](R) reader structure"] +impl crate::Readable for ENABLE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [enable::W](W) writer structure"] +impl crate::Writable for ENABLE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ENABLE to value 0"] +impl crate::Resettable for ENABLE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spi0/events_ready.rs b/src/spi0/events_ready.rs new file mode 100644 index 0000000..047e449 --- /dev/null +++ b/src/spi0/events_ready.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_READY` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_READY` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "TXD byte sent and RXD byte received\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_ready](index.html) module"] +pub struct EVENTS_READY_SPEC; +impl crate::RegisterSpec for EVENTS_READY_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_ready::R](R) reader structure"] +impl crate::Readable for EVENTS_READY_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_ready::W](W) writer structure"] +impl crate::Writable for EVENTS_READY_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_READY to value 0"] +impl crate::Resettable for EVENTS_READY_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spi0/frequency.rs b/src/spi0/frequency.rs new file mode 100644 index 0000000..36c84f6 --- /dev/null +++ b/src/spi0/frequency.rs @@ -0,0 +1,216 @@ +#[doc = "Register `FREQUENCY` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `FREQUENCY` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "SPI master data rate\n\nValue on reset: 67108864"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u32)] +pub enum FREQUENCY_A { + #[doc = "33554432: 125 kbps"] + K125 = 33554432, + #[doc = "67108864: 250 kbps"] + K250 = 67108864, + #[doc = "134217728: 500 kbps"] + K500 = 134217728, + #[doc = "268435456: 1 Mbps"] + M1 = 268435456, + #[doc = "536870912: 2 Mbps"] + M2 = 536870912, + #[doc = "1073741824: 4 Mbps"] + M4 = 1073741824, + #[doc = "2147483648: 8 Mbps"] + M8 = 2147483648, +} +impl From for u32 { + #[inline(always)] + fn from(variant: FREQUENCY_A) -> Self { + variant as _ + } +} +#[doc = "Field `FREQUENCY` reader - SPI master data rate"] +pub struct FREQUENCY_R(crate::FieldReader); +impl FREQUENCY_R { + pub(crate) fn new(bits: u32) -> Self { + FREQUENCY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 33554432 => Some(FREQUENCY_A::K125), + 67108864 => Some(FREQUENCY_A::K250), + 134217728 => Some(FREQUENCY_A::K500), + 268435456 => Some(FREQUENCY_A::M1), + 536870912 => Some(FREQUENCY_A::M2), + 1073741824 => Some(FREQUENCY_A::M4), + 2147483648 => Some(FREQUENCY_A::M8), + _ => None, + } + } + #[doc = "Checks if the value of the field is `K125`"] + #[inline(always)] + pub fn is_k125(&self) -> bool { + **self == FREQUENCY_A::K125 + } + #[doc = "Checks if the value of the field is `K250`"] + #[inline(always)] + pub fn is_k250(&self) -> bool { + **self == FREQUENCY_A::K250 + } + #[doc = "Checks if the value of the field is `K500`"] + #[inline(always)] + pub fn is_k500(&self) -> bool { + **self == FREQUENCY_A::K500 + } + #[doc = "Checks if the value of the field is `M1`"] + #[inline(always)] + pub fn is_m1(&self) -> bool { + **self == FREQUENCY_A::M1 + } + #[doc = "Checks if the value of the field is `M2`"] + #[inline(always)] + pub fn is_m2(&self) -> bool { + **self == FREQUENCY_A::M2 + } + #[doc = "Checks if the value of the field is `M4`"] + #[inline(always)] + pub fn is_m4(&self) -> bool { + **self == FREQUENCY_A::M4 + } + #[doc = "Checks if the value of the field is `M8`"] + #[inline(always)] + pub fn is_m8(&self) -> bool { + **self == FREQUENCY_A::M8 + } +} +impl core::ops::Deref for FREQUENCY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FREQUENCY` writer - SPI master data rate"] +pub struct FREQUENCY_W<'a> { + w: &'a mut W, +} +impl<'a> FREQUENCY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: FREQUENCY_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "125 kbps"] + #[inline(always)] + pub fn k125(self) -> &'a mut W { + self.variant(FREQUENCY_A::K125) + } + #[doc = "250 kbps"] + #[inline(always)] + pub fn k250(self) -> &'a mut W { + self.variant(FREQUENCY_A::K250) + } + #[doc = "500 kbps"] + #[inline(always)] + pub fn k500(self) -> &'a mut W { + self.variant(FREQUENCY_A::K500) + } + #[doc = "1 Mbps"] + #[inline(always)] + pub fn m1(self) -> &'a mut W { + self.variant(FREQUENCY_A::M1) + } + #[doc = "2 Mbps"] + #[inline(always)] + pub fn m2(self) -> &'a mut W { + self.variant(FREQUENCY_A::M2) + } + #[doc = "4 Mbps"] + #[inline(always)] + pub fn m4(self) -> &'a mut W { + self.variant(FREQUENCY_A::M4) + } + #[doc = "8 Mbps"] + #[inline(always)] + pub fn m8(self) -> &'a mut W { + self.variant(FREQUENCY_A::M8) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - SPI master data rate"] + #[inline(always)] + pub fn frequency(&self) -> FREQUENCY_R { + FREQUENCY_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - SPI master data rate"] + #[inline(always)] + pub fn frequency(&mut self) -> FREQUENCY_W { + FREQUENCY_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "SPI frequency\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [frequency](index.html) module"] +pub struct FREQUENCY_SPEC; +impl crate::RegisterSpec for FREQUENCY_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [frequency::R](R) reader structure"] +impl crate::Readable for FREQUENCY_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [frequency::W](W) writer structure"] +impl crate::Writable for FREQUENCY_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets FREQUENCY to value 0x0400_0000"] +impl crate::Resettable for FREQUENCY_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0400_0000 + } +} diff --git a/src/spi0/intenclr.rs b/src/spi0/intenclr.rs new file mode 100644 index 0000000..1cf8159 --- /dev/null +++ b/src/spi0/intenclr.rs @@ -0,0 +1,166 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for READY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY` reader - Write '1' to Disable interrupt for READY event"] +pub struct READY_R(crate::FieldReader); +impl READY_R { + pub(crate) fn new(bits: bool) -> Self { + READY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> READY_A { + match self.bits { + false => READY_A::DISABLED, + true => READY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == READY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == READY_A::ENABLED + } +} +impl core::ops::Deref for READY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for READY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY` writer - Write '1' to Disable interrupt for READY event"] +pub struct READY_W<'a> { + w: &'a mut W, +} +impl<'a> READY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: READY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(READY_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +impl R { + #[doc = "Bit 2 - Write '1' to Disable interrupt for READY event"] + #[inline(always)] + pub fn ready(&self) -> READY_R { + READY_R::new(((self.bits >> 2) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 2 - Write '1' to Disable interrupt for READY event"] + #[inline(always)] + pub fn ready(&mut self) -> READY_W { + READY_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spi0/intenset.rs b/src/spi0/intenset.rs new file mode 100644 index 0000000..19d71ec --- /dev/null +++ b/src/spi0/intenset.rs @@ -0,0 +1,166 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for READY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY` reader - Write '1' to Enable interrupt for READY event"] +pub struct READY_R(crate::FieldReader); +impl READY_R { + pub(crate) fn new(bits: bool) -> Self { + READY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> READY_A { + match self.bits { + false => READY_A::DISABLED, + true => READY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == READY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == READY_A::ENABLED + } +} +impl core::ops::Deref for READY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for READY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READY_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READY` writer - Write '1' to Enable interrupt for READY event"] +pub struct READY_W<'a> { + w: &'a mut W, +} +impl<'a> READY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: READY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(READY_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +impl R { + #[doc = "Bit 2 - Write '1' to Enable interrupt for READY event"] + #[inline(always)] + pub fn ready(&self) -> READY_R { + READY_R::new(((self.bits >> 2) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 2 - Write '1' to Enable interrupt for READY event"] + #[inline(always)] + pub fn ready(&mut self) -> READY_W { + READY_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spi0/psel.rs b/src/spi0/psel.rs new file mode 100644 index 0000000..8b39684 --- /dev/null +++ b/src/spi0/psel.rs @@ -0,0 +1,12 @@ +#[doc = "SCK register accessor: an alias for `Reg`"] +pub type SCK = crate::Reg; +#[doc = "Pin select for SCK"] +pub mod sck; +#[doc = "MOSI register accessor: an alias for `Reg`"] +pub type MOSI = crate::Reg; +#[doc = "Pin select for MOSI"] +pub mod mosi; +#[doc = "MISO register accessor: an alias for `Reg`"] +pub type MISO = crate::Reg; +#[doc = "Pin select for MISO"] +pub mod miso; diff --git a/src/spi0/psel/miso.rs b/src/spi0/psel/miso.rs new file mode 100644 index 0000000..8711f23 --- /dev/null +++ b/src/spi0/psel/miso.rs @@ -0,0 +1,138 @@ +#[doc = "Register `MISO` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MISO` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Pin number configuration for SPI MISO signal\n\nValue on reset: 4294967295"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u32)] +pub enum PSELMISO_A { + #[doc = "4294967295: Disconnect"] + DISCONNECTED = 4294967295, +} +impl From for u32 { + #[inline(always)] + fn from(variant: PSELMISO_A) -> Self { + variant as _ + } +} +#[doc = "Field `PSELMISO` reader - Pin number configuration for SPI MISO signal"] +pub struct PSELMISO_R(crate::FieldReader); +impl PSELMISO_R { + pub(crate) fn new(bits: u32) -> Self { + PSELMISO_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 4294967295 => Some(PSELMISO_A::DISCONNECTED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == PSELMISO_A::DISCONNECTED + } +} +impl core::ops::Deref for PSELMISO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PSELMISO` writer - Pin number configuration for SPI MISO signal"] +pub struct PSELMISO_W<'a> { + w: &'a mut W, +} +impl<'a> PSELMISO_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PSELMISO_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(PSELMISO_A::DISCONNECTED) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Pin number configuration for SPI MISO signal"] + #[inline(always)] + pub fn pselmiso(&self) -> PSELMISO_R { + PSELMISO_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Pin number configuration for SPI MISO signal"] + #[inline(always)] + pub fn pselmiso(&mut self) -> PSELMISO_W { + PSELMISO_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for MISO\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [miso](index.html) module"] +pub struct MISO_SPEC; +impl crate::RegisterSpec for MISO_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [miso::R](R) reader structure"] +impl crate::Readable for MISO_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [miso::W](W) writer structure"] +impl crate::Writable for MISO_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MISO to value 0xffff_ffff"] +impl crate::Resettable for MISO_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/spi0/psel/mosi.rs b/src/spi0/psel/mosi.rs new file mode 100644 index 0000000..ec0f2aa --- /dev/null +++ b/src/spi0/psel/mosi.rs @@ -0,0 +1,138 @@ +#[doc = "Register `MOSI` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MOSI` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Pin number configuration for SPI MOSI signal\n\nValue on reset: 4294967295"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u32)] +pub enum PSELMOSI_A { + #[doc = "4294967295: Disconnect"] + DISCONNECTED = 4294967295, +} +impl From for u32 { + #[inline(always)] + fn from(variant: PSELMOSI_A) -> Self { + variant as _ + } +} +#[doc = "Field `PSELMOSI` reader - Pin number configuration for SPI MOSI signal"] +pub struct PSELMOSI_R(crate::FieldReader); +impl PSELMOSI_R { + pub(crate) fn new(bits: u32) -> Self { + PSELMOSI_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 4294967295 => Some(PSELMOSI_A::DISCONNECTED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == PSELMOSI_A::DISCONNECTED + } +} +impl core::ops::Deref for PSELMOSI_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PSELMOSI` writer - Pin number configuration for SPI MOSI signal"] +pub struct PSELMOSI_W<'a> { + w: &'a mut W, +} +impl<'a> PSELMOSI_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PSELMOSI_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(PSELMOSI_A::DISCONNECTED) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Pin number configuration for SPI MOSI signal"] + #[inline(always)] + pub fn pselmosi(&self) -> PSELMOSI_R { + PSELMOSI_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Pin number configuration for SPI MOSI signal"] + #[inline(always)] + pub fn pselmosi(&mut self) -> PSELMOSI_W { + PSELMOSI_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for MOSI\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mosi](index.html) module"] +pub struct MOSI_SPEC; +impl crate::RegisterSpec for MOSI_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mosi::R](R) reader structure"] +impl crate::Readable for MOSI_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mosi::W](W) writer structure"] +impl crate::Writable for MOSI_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MOSI to value 0xffff_ffff"] +impl crate::Resettable for MOSI_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/spi0/psel/sck.rs b/src/spi0/psel/sck.rs new file mode 100644 index 0000000..d9f789e --- /dev/null +++ b/src/spi0/psel/sck.rs @@ -0,0 +1,138 @@ +#[doc = "Register `SCK` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SCK` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Pin number configuration for SPI SCK signal\n\nValue on reset: 4294967295"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u32)] +pub enum PSELSCK_A { + #[doc = "4294967295: Disconnect"] + DISCONNECTED = 4294967295, +} +impl From for u32 { + #[inline(always)] + fn from(variant: PSELSCK_A) -> Self { + variant as _ + } +} +#[doc = "Field `PSELSCK` reader - Pin number configuration for SPI SCK signal"] +pub struct PSELSCK_R(crate::FieldReader); +impl PSELSCK_R { + pub(crate) fn new(bits: u32) -> Self { + PSELSCK_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 4294967295 => Some(PSELSCK_A::DISCONNECTED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == PSELSCK_A::DISCONNECTED + } +} +impl core::ops::Deref for PSELSCK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PSELSCK` writer - Pin number configuration for SPI SCK signal"] +pub struct PSELSCK_W<'a> { + w: &'a mut W, +} +impl<'a> PSELSCK_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PSELSCK_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(PSELSCK_A::DISCONNECTED) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Pin number configuration for SPI SCK signal"] + #[inline(always)] + pub fn pselsck(&self) -> PSELSCK_R { + PSELSCK_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Pin number configuration for SPI SCK signal"] + #[inline(always)] + pub fn pselsck(&mut self) -> PSELSCK_W { + PSELSCK_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for SCK\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sck](index.html) module"] +pub struct SCK_SPEC; +impl crate::RegisterSpec for SCK_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sck::R](R) reader structure"] +impl crate::Readable for SCK_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sck::W](W) writer structure"] +impl crate::Writable for SCK_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SCK to value 0xffff_ffff"] +impl crate::Resettable for SCK_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/spi0/rxd.rs b/src/spi0/rxd.rs new file mode 100644 index 0000000..d74e170 --- /dev/null +++ b/src/spi0/rxd.rs @@ -0,0 +1,52 @@ +#[doc = "Register `RXD` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `RXD` reader - RX data received. Double buffered"] +pub struct RXD_R(crate::FieldReader); +impl RXD_R { + pub(crate) fn new(bits: u8) -> Self { + RXD_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RXD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:7 - RX data received. Double buffered"] + #[inline(always)] + pub fn rxd(&self) -> RXD_R { + RXD_R::new((self.bits & 0xff) as u8) + } +} +#[doc = "RXD register\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 [rxd](index.html) module"] +pub struct RXD_SPEC; +impl crate::RegisterSpec for RXD_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rxd::R](R) reader structure"] +impl crate::Readable for RXD_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets RXD to value 0"] +impl crate::Resettable for RXD_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spi0/txd.rs b/src/spi0/txd.rs new file mode 100644 index 0000000..ed2aea5 --- /dev/null +++ b/src/spi0/txd.rs @@ -0,0 +1,102 @@ +#[doc = "Register `TXD` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `TXD` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `TXD` reader - TX data to send. Double buffered"] +pub struct TXD_R(crate::FieldReader); +impl TXD_R { + pub(crate) fn new(bits: u8) -> Self { + TXD_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TXD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TXD` writer - TX data to send. Double buffered"] +pub struct TXD_W<'a> { + w: &'a mut W, +} +impl<'a> TXD_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - TX data to send. Double buffered"] + #[inline(always)] + pub fn txd(&self) -> TXD_R { + TXD_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - TX data to send. Double buffered"] + #[inline(always)] + pub fn txd(&mut self) -> TXD_W { + TXD_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "TXD register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [txd](index.html) module"] +pub struct TXD_SPEC; +impl crate::RegisterSpec for TXD_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [txd::R](R) reader structure"] +impl crate::Readable for TXD_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [txd::W](W) writer structure"] +impl crate::Writable for TXD_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TXD to value 0"] +impl crate::Resettable for TXD_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spim0.rs b/src/spim0.rs new file mode 100644 index 0000000..3f636bd --- /dev/null +++ b/src/spim0.rs @@ -0,0 +1,163 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + _reserved0: [u8; 0x10], + #[doc = "0x10 - Start SPI transaction"] + pub tasks_start: crate::Reg, + #[doc = "0x14 - Stop SPI transaction"] + pub tasks_stop: crate::Reg, + _reserved2: [u8; 0x04], + #[doc = "0x1c - Suspend SPI transaction"] + pub tasks_suspend: crate::Reg, + #[doc = "0x20 - Resume SPI transaction"] + pub tasks_resume: crate::Reg, + _reserved4: [u8; 0xe0], + #[doc = "0x104 - SPI transaction has stopped"] + pub events_stopped: crate::Reg, + _reserved5: [u8; 0x08], + #[doc = "0x110 - End of RXD buffer reached"] + pub events_endrx: crate::Reg, + _reserved6: [u8; 0x04], + #[doc = "0x118 - End of RXD buffer and TXD buffer reached"] + pub events_end: crate::Reg, + _reserved7: [u8; 0x04], + #[doc = "0x120 - End of TXD buffer reached"] + pub events_endtx: crate::Reg, + _reserved8: [u8; 0x28], + #[doc = "0x14c - Transaction started"] + pub events_started: crate::Reg, + _reserved9: [u8; 0xb0], + #[doc = "0x200 - Shortcut register"] + pub shorts: crate::Reg, + _reserved10: [u8; 0x0100], + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved12: [u8; 0x01f4], + #[doc = "0x500 - Enable SPIM"] + pub enable: crate::Reg, + _reserved13: [u8; 0x04], + #[doc = "0x508..0x514 - Unspecified"] + pub psel: PSEL, + _reserved14: [u8; 0x10], + #[doc = "0x524 - SPI frequency. Accuracy depends on the HFCLK source selected."] + pub frequency: crate::Reg, + _reserved15: [u8; 0x0c], + #[doc = "0x534..0x544 - RXD EasyDMA channel"] + pub rxd: RXD, + #[doc = "0x544..0x554 - TXD EasyDMA channel"] + pub txd: TXD, + #[doc = "0x554 - Configuration register"] + pub config: crate::Reg, + _reserved18: [u8; 0x68], + #[doc = "0x5c0 - Over-read character. Character clocked out in case and over-read of the TXD buffer."] + pub orc: crate::Reg, +} +#[doc = r"Register block"] +#[repr(C)] +pub struct PSEL { + #[doc = "0x00 - Pin select for SCK"] + pub sck: crate::Reg, + #[doc = "0x04 - Pin select for MOSI signal"] + pub mosi: crate::Reg, + #[doc = "0x08 - Pin select for MISO signal"] + pub miso: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod psel; +#[doc = r"Register block"] +#[repr(C)] +pub struct RXD { + #[doc = "0x00 - Data pointer"] + pub ptr: crate::Reg, + #[doc = "0x04 - Maximum number of bytes in receive buffer"] + pub maxcnt: crate::Reg, + #[doc = "0x08 - Number of bytes transferred in the last transaction"] + pub amount: crate::Reg, + #[doc = "0x0c - EasyDMA list type"] + pub list: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "RXD EasyDMA channel"] +pub mod rxd; +#[doc = r"Register block"] +#[repr(C)] +pub struct TXD { + #[doc = "0x00 - Data pointer"] + pub ptr: crate::Reg, + #[doc = "0x04 - Maximum number of bytes in transmit buffer"] + pub maxcnt: crate::Reg, + #[doc = "0x08 - Number of bytes transferred in the last transaction"] + pub amount: crate::Reg, + #[doc = "0x0c - EasyDMA list type"] + pub list: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "TXD EasyDMA channel"] +pub mod txd; +#[doc = "TASKS_START register accessor: an alias for `Reg`"] +pub type TASKS_START = crate::Reg; +#[doc = "Start SPI transaction"] +pub mod tasks_start; +#[doc = "TASKS_STOP register accessor: an alias for `Reg`"] +pub type TASKS_STOP = crate::Reg; +#[doc = "Stop SPI transaction"] +pub mod tasks_stop; +#[doc = "TASKS_SUSPEND register accessor: an alias for `Reg`"] +pub type TASKS_SUSPEND = crate::Reg; +#[doc = "Suspend SPI transaction"] +pub mod tasks_suspend; +#[doc = "TASKS_RESUME register accessor: an alias for `Reg`"] +pub type TASKS_RESUME = crate::Reg; +#[doc = "Resume SPI transaction"] +pub mod tasks_resume; +#[doc = "EVENTS_STOPPED register accessor: an alias for `Reg`"] +pub type EVENTS_STOPPED = crate::Reg; +#[doc = "SPI transaction has stopped"] +pub mod events_stopped; +#[doc = "EVENTS_ENDRX register accessor: an alias for `Reg`"] +pub type EVENTS_ENDRX = crate::Reg; +#[doc = "End of RXD buffer reached"] +pub mod events_endrx; +#[doc = "EVENTS_END register accessor: an alias for `Reg`"] +pub type EVENTS_END = crate::Reg; +#[doc = "End of RXD buffer and TXD buffer reached"] +pub mod events_end; +#[doc = "EVENTS_ENDTX register accessor: an alias for `Reg`"] +pub type EVENTS_ENDTX = crate::Reg; +#[doc = "End of TXD buffer reached"] +pub mod events_endtx; +#[doc = "EVENTS_STARTED register accessor: an alias for `Reg`"] +pub type EVENTS_STARTED = crate::Reg; +#[doc = "Transaction started"] +pub mod events_started; +#[doc = "SHORTS register accessor: an alias for `Reg`"] +pub type SHORTS = crate::Reg; +#[doc = "Shortcut register"] +pub mod shorts; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "ENABLE register accessor: an alias for `Reg`"] +pub type ENABLE = crate::Reg; +#[doc = "Enable SPIM"] +pub mod enable; +#[doc = "FREQUENCY register accessor: an alias for `Reg`"] +pub type FREQUENCY = crate::Reg; +#[doc = "SPI frequency. Accuracy depends on the HFCLK source selected."] +pub mod frequency; +#[doc = "CONFIG register accessor: an alias for `Reg`"] +pub type CONFIG = crate::Reg; +#[doc = "Configuration register"] +pub mod config; +#[doc = "ORC register accessor: an alias for `Reg`"] +pub type ORC = crate::Reg; +#[doc = "Over-read character. Character clocked out in case and over-read of the TXD buffer."] +pub mod orc; diff --git a/src/spim0/config.rs b/src/spim0/config.rs new file mode 100644 index 0000000..14669c0 --- /dev/null +++ b/src/spim0/config.rs @@ -0,0 +1,345 @@ +#[doc = "Register `CONFIG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CONFIG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Bit order\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ORDER_A { + #[doc = "0: Most significant bit shifted out first"] + MSBFIRST = 0, + #[doc = "1: Least significant bit shifted out first"] + LSBFIRST = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ORDER_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ORDER` reader - Bit order"] +pub struct ORDER_R(crate::FieldReader); +impl ORDER_R { + pub(crate) fn new(bits: bool) -> Self { + ORDER_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ORDER_A { + match self.bits { + false => ORDER_A::MSBFIRST, + true => ORDER_A::LSBFIRST, + } + } + #[doc = "Checks if the value of the field is `MSBFIRST`"] + #[inline(always)] + pub fn is_msb_first(&self) -> bool { + **self == ORDER_A::MSBFIRST + } + #[doc = "Checks if the value of the field is `LSBFIRST`"] + #[inline(always)] + pub fn is_lsb_first(&self) -> bool { + **self == ORDER_A::LSBFIRST + } +} +impl core::ops::Deref for ORDER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ORDER` writer - Bit order"] +pub struct ORDER_W<'a> { + w: &'a mut W, +} +impl<'a> ORDER_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ORDER_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Most significant bit shifted out first"] + #[inline(always)] + pub fn msb_first(self) -> &'a mut W { + self.variant(ORDER_A::MSBFIRST) + } + #[doc = "Least significant bit shifted out first"] + #[inline(always)] + pub fn lsb_first(self) -> &'a mut W { + self.variant(ORDER_A::LSBFIRST) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Serial clock (SCK) phase\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CPHA_A { + #[doc = "0: Sample on leading edge of clock, shift serial data on trailing edge"] + LEADING = 0, + #[doc = "1: Sample on trailing edge of clock, shift serial data on leading edge"] + TRAILING = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CPHA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CPHA` reader - Serial clock (SCK) phase"] +pub struct CPHA_R(crate::FieldReader); +impl CPHA_R { + pub(crate) fn new(bits: bool) -> Self { + CPHA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CPHA_A { + match self.bits { + false => CPHA_A::LEADING, + true => CPHA_A::TRAILING, + } + } + #[doc = "Checks if the value of the field is `LEADING`"] + #[inline(always)] + pub fn is_leading(&self) -> bool { + **self == CPHA_A::LEADING + } + #[doc = "Checks if the value of the field is `TRAILING`"] + #[inline(always)] + pub fn is_trailing(&self) -> bool { + **self == CPHA_A::TRAILING + } +} +impl core::ops::Deref for CPHA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CPHA` writer - Serial clock (SCK) phase"] +pub struct CPHA_W<'a> { + w: &'a mut W, +} +impl<'a> CPHA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CPHA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Sample on leading edge of clock, shift serial data on trailing edge"] + #[inline(always)] + pub fn leading(self) -> &'a mut W { + self.variant(CPHA_A::LEADING) + } + #[doc = "Sample on trailing edge of clock, shift serial data on leading edge"] + #[inline(always)] + pub fn trailing(self) -> &'a mut W { + self.variant(CPHA_A::TRAILING) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Serial clock (SCK) polarity\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CPOL_A { + #[doc = "0: Active high"] + ACTIVEHIGH = 0, + #[doc = "1: Active low"] + ACTIVELOW = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CPOL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CPOL` reader - Serial clock (SCK) polarity"] +pub struct CPOL_R(crate::FieldReader); +impl CPOL_R { + pub(crate) fn new(bits: bool) -> Self { + CPOL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CPOL_A { + match self.bits { + false => CPOL_A::ACTIVEHIGH, + true => CPOL_A::ACTIVELOW, + } + } + #[doc = "Checks if the value of the field is `ACTIVEHIGH`"] + #[inline(always)] + pub fn is_active_high(&self) -> bool { + **self == CPOL_A::ACTIVEHIGH + } + #[doc = "Checks if the value of the field is `ACTIVELOW`"] + #[inline(always)] + pub fn is_active_low(&self) -> bool { + **self == CPOL_A::ACTIVELOW + } +} +impl core::ops::Deref for CPOL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CPOL` writer - Serial clock (SCK) polarity"] +pub struct CPOL_W<'a> { + w: &'a mut W, +} +impl<'a> CPOL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CPOL_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Active high"] + #[inline(always)] + pub fn active_high(self) -> &'a mut W { + self.variant(CPOL_A::ACTIVEHIGH) + } + #[doc = "Active low"] + #[inline(always)] + pub fn active_low(self) -> &'a mut W { + self.variant(CPOL_A::ACTIVELOW) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +impl R { + #[doc = "Bit 0 - Bit order"] + #[inline(always)] + pub fn order(&self) -> ORDER_R { + ORDER_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Serial clock (SCK) phase"] + #[inline(always)] + pub fn cpha(&self) -> CPHA_R { + CPHA_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Serial clock (SCK) polarity"] + #[inline(always)] + pub fn cpol(&self) -> CPOL_R { + CPOL_R::new(((self.bits >> 2) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Bit order"] + #[inline(always)] + pub fn order(&mut self) -> ORDER_W { + ORDER_W { w: self } + } + #[doc = "Bit 1 - Serial clock (SCK) phase"] + #[inline(always)] + pub fn cpha(&mut self) -> CPHA_W { + CPHA_W { w: self } + } + #[doc = "Bit 2 - Serial clock (SCK) polarity"] + #[inline(always)] + pub fn cpol(&mut self) -> CPOL_W { + CPOL_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Configuration register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [config](index.html) module"] +pub struct CONFIG_SPEC; +impl crate::RegisterSpec for CONFIG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [config::R](R) reader structure"] +impl crate::Readable for CONFIG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [config::W](W) writer structure"] +impl crate::Writable for CONFIG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CONFIG to value 0"] +impl crate::Resettable for CONFIG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spim0/enable.rs b/src/spim0/enable.rs new file mode 100644 index 0000000..627bbcb --- /dev/null +++ b/src/spim0/enable.rs @@ -0,0 +1,151 @@ +#[doc = "Register `ENABLE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ENABLE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable SPIM\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum ENABLE_A { + #[doc = "0: Disable SPIM"] + DISABLED = 0, + #[doc = "7: Enable SPIM"] + ENABLED = 7, +} +impl From for u8 { + #[inline(always)] + fn from(variant: ENABLE_A) -> Self { + variant as _ + } +} +#[doc = "Field `ENABLE` reader - Enable or disable SPIM"] +pub struct ENABLE_R(crate::FieldReader); +impl ENABLE_R { + pub(crate) fn new(bits: u8) -> Self { + ENABLE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(ENABLE_A::DISABLED), + 7 => Some(ENABLE_A::ENABLED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENABLE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENABLE_A::ENABLED + } +} +impl core::ops::Deref for ENABLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENABLE` writer - Enable or disable SPIM"] +pub struct ENABLE_W<'a> { + w: &'a mut W, +} +impl<'a> ENABLE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENABLE_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Disable SPIM"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENABLE_A::DISABLED) + } + #[doc = "Enable SPIM"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENABLE_A::ENABLED) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); + self.w + } +} +impl R { + #[doc = "Bits 0:3 - Enable or disable SPIM"] + #[inline(always)] + pub fn enable(&self) -> ENABLE_R { + ENABLE_R::new((self.bits & 0x0f) as u8) + } +} +impl W { + #[doc = "Bits 0:3 - Enable or disable SPIM"] + #[inline(always)] + pub fn enable(&mut self) -> ENABLE_W { + ENABLE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable SPIM\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [enable](index.html) module"] +pub struct ENABLE_SPEC; +impl crate::RegisterSpec for ENABLE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [enable::R](R) reader structure"] +impl crate::Readable for ENABLE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [enable::W](W) writer structure"] +impl crate::Writable for ENABLE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ENABLE to value 0"] +impl crate::Resettable for ENABLE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spim0/events_end.rs b/src/spim0/events_end.rs new file mode 100644 index 0000000..5933751 --- /dev/null +++ b/src/spim0/events_end.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_END` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_END` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "End of RXD buffer and TXD buffer reached\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_end](index.html) module"] +pub struct EVENTS_END_SPEC; +impl crate::RegisterSpec for EVENTS_END_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_end::R](R) reader structure"] +impl crate::Readable for EVENTS_END_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_end::W](W) writer structure"] +impl crate::Writable for EVENTS_END_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_END to value 0"] +impl crate::Resettable for EVENTS_END_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spim0/events_endrx.rs b/src/spim0/events_endrx.rs new file mode 100644 index 0000000..de44609 --- /dev/null +++ b/src/spim0/events_endrx.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_ENDRX` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_ENDRX` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "End of RXD buffer reached\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_endrx](index.html) module"] +pub struct EVENTS_ENDRX_SPEC; +impl crate::RegisterSpec for EVENTS_ENDRX_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_endrx::R](R) reader structure"] +impl crate::Readable for EVENTS_ENDRX_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_endrx::W](W) writer structure"] +impl crate::Writable for EVENTS_ENDRX_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_ENDRX to value 0"] +impl crate::Resettable for EVENTS_ENDRX_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spim0/events_endtx.rs b/src/spim0/events_endtx.rs new file mode 100644 index 0000000..f84ab2c --- /dev/null +++ b/src/spim0/events_endtx.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_ENDTX` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_ENDTX` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "End of TXD buffer reached\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_endtx](index.html) module"] +pub struct EVENTS_ENDTX_SPEC; +impl crate::RegisterSpec for EVENTS_ENDTX_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_endtx::R](R) reader structure"] +impl crate::Readable for EVENTS_ENDTX_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_endtx::W](W) writer structure"] +impl crate::Writable for EVENTS_ENDTX_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_ENDTX to value 0"] +impl crate::Resettable for EVENTS_ENDTX_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spim0/events_started.rs b/src/spim0/events_started.rs new file mode 100644 index 0000000..2f96c4f --- /dev/null +++ b/src/spim0/events_started.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_STARTED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_STARTED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Transaction started\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_started](index.html) module"] +pub struct EVENTS_STARTED_SPEC; +impl crate::RegisterSpec for EVENTS_STARTED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_started::R](R) reader structure"] +impl crate::Readable for EVENTS_STARTED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_started::W](W) writer structure"] +impl crate::Writable for EVENTS_STARTED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_STARTED to value 0"] +impl crate::Resettable for EVENTS_STARTED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spim0/events_stopped.rs b/src/spim0/events_stopped.rs new file mode 100644 index 0000000..ee2b42f --- /dev/null +++ b/src/spim0/events_stopped.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_STOPPED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_STOPPED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "SPI transaction has stopped\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_stopped](index.html) module"] +pub struct EVENTS_STOPPED_SPEC; +impl crate::RegisterSpec for EVENTS_STOPPED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_stopped::R](R) reader structure"] +impl crate::Readable for EVENTS_STOPPED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_stopped::W](W) writer structure"] +impl crate::Writable for EVENTS_STOPPED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_STOPPED to value 0"] +impl crate::Resettable for EVENTS_STOPPED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spim0/frequency.rs b/src/spim0/frequency.rs new file mode 100644 index 0000000..dfb29d6 --- /dev/null +++ b/src/spim0/frequency.rs @@ -0,0 +1,216 @@ +#[doc = "Register `FREQUENCY` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `FREQUENCY` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "SPI master data rate\n\nValue on reset: 67108864"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u32)] +pub enum FREQUENCY_A { + #[doc = "33554432: 125 kbps"] + K125 = 33554432, + #[doc = "67108864: 250 kbps"] + K250 = 67108864, + #[doc = "134217728: 500 kbps"] + K500 = 134217728, + #[doc = "268435456: 1 Mbps"] + M1 = 268435456, + #[doc = "536870912: 2 Mbps"] + M2 = 536870912, + #[doc = "1073741824: 4 Mbps"] + M4 = 1073741824, + #[doc = "2147483648: 8 Mbps"] + M8 = 2147483648, +} +impl From for u32 { + #[inline(always)] + fn from(variant: FREQUENCY_A) -> Self { + variant as _ + } +} +#[doc = "Field `FREQUENCY` reader - SPI master data rate"] +pub struct FREQUENCY_R(crate::FieldReader); +impl FREQUENCY_R { + pub(crate) fn new(bits: u32) -> Self { + FREQUENCY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 33554432 => Some(FREQUENCY_A::K125), + 67108864 => Some(FREQUENCY_A::K250), + 134217728 => Some(FREQUENCY_A::K500), + 268435456 => Some(FREQUENCY_A::M1), + 536870912 => Some(FREQUENCY_A::M2), + 1073741824 => Some(FREQUENCY_A::M4), + 2147483648 => Some(FREQUENCY_A::M8), + _ => None, + } + } + #[doc = "Checks if the value of the field is `K125`"] + #[inline(always)] + pub fn is_k125(&self) -> bool { + **self == FREQUENCY_A::K125 + } + #[doc = "Checks if the value of the field is `K250`"] + #[inline(always)] + pub fn is_k250(&self) -> bool { + **self == FREQUENCY_A::K250 + } + #[doc = "Checks if the value of the field is `K500`"] + #[inline(always)] + pub fn is_k500(&self) -> bool { + **self == FREQUENCY_A::K500 + } + #[doc = "Checks if the value of the field is `M1`"] + #[inline(always)] + pub fn is_m1(&self) -> bool { + **self == FREQUENCY_A::M1 + } + #[doc = "Checks if the value of the field is `M2`"] + #[inline(always)] + pub fn is_m2(&self) -> bool { + **self == FREQUENCY_A::M2 + } + #[doc = "Checks if the value of the field is `M4`"] + #[inline(always)] + pub fn is_m4(&self) -> bool { + **self == FREQUENCY_A::M4 + } + #[doc = "Checks if the value of the field is `M8`"] + #[inline(always)] + pub fn is_m8(&self) -> bool { + **self == FREQUENCY_A::M8 + } +} +impl core::ops::Deref for FREQUENCY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FREQUENCY` writer - SPI master data rate"] +pub struct FREQUENCY_W<'a> { + w: &'a mut W, +} +impl<'a> FREQUENCY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: FREQUENCY_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "125 kbps"] + #[inline(always)] + pub fn k125(self) -> &'a mut W { + self.variant(FREQUENCY_A::K125) + } + #[doc = "250 kbps"] + #[inline(always)] + pub fn k250(self) -> &'a mut W { + self.variant(FREQUENCY_A::K250) + } + #[doc = "500 kbps"] + #[inline(always)] + pub fn k500(self) -> &'a mut W { + self.variant(FREQUENCY_A::K500) + } + #[doc = "1 Mbps"] + #[inline(always)] + pub fn m1(self) -> &'a mut W { + self.variant(FREQUENCY_A::M1) + } + #[doc = "2 Mbps"] + #[inline(always)] + pub fn m2(self) -> &'a mut W { + self.variant(FREQUENCY_A::M2) + } + #[doc = "4 Mbps"] + #[inline(always)] + pub fn m4(self) -> &'a mut W { + self.variant(FREQUENCY_A::M4) + } + #[doc = "8 Mbps"] + #[inline(always)] + pub fn m8(self) -> &'a mut W { + self.variant(FREQUENCY_A::M8) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - SPI master data rate"] + #[inline(always)] + pub fn frequency(&self) -> FREQUENCY_R { + FREQUENCY_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - SPI master data rate"] + #[inline(always)] + pub fn frequency(&mut self) -> FREQUENCY_W { + FREQUENCY_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "SPI frequency. Accuracy depends on the HFCLK source selected.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [frequency](index.html) module"] +pub struct FREQUENCY_SPEC; +impl crate::RegisterSpec for FREQUENCY_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [frequency::R](R) reader structure"] +impl crate::Readable for FREQUENCY_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [frequency::W](W) writer structure"] +impl crate::Writable for FREQUENCY_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets FREQUENCY to value 0x0400_0000"] +impl crate::Resettable for FREQUENCY_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0400_0000 + } +} diff --git a/src/spim0/intenclr.rs b/src/spim0/intenclr.rs new file mode 100644 index 0000000..cf5954a --- /dev/null +++ b/src/spim0/intenclr.rs @@ -0,0 +1,566 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` reader - Write '1' to Disable interrupt for STOPPED event"] +pub struct STOPPED_R(crate::FieldReader); +impl STOPPED_R { + pub(crate) fn new(bits: bool) -> Self { + STOPPED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STOPPED_A { + match self.bits { + false => STOPPED_A::DISABLED, + true => STOPPED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STOPPED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STOPPED_A::ENABLED + } +} +impl core::ops::Deref for STOPPED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` writer - Write '1' to Disable interrupt for STOPPED event"] +pub struct STOPPED_W<'a> { + w: &'a mut W, +} +impl<'a> STOPPED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STOPPED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(STOPPED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for ENDRX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDRX_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDRX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDRX` reader - Write '1' to Disable interrupt for ENDRX event"] +pub struct ENDRX_R(crate::FieldReader); +impl ENDRX_R { + pub(crate) fn new(bits: bool) -> Self { + ENDRX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDRX_A { + match self.bits { + false => ENDRX_A::DISABLED, + true => ENDRX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENDRX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENDRX_A::ENABLED + } +} +impl core::ops::Deref for ENDRX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for ENDRX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDRX_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDRX_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDRX` writer - Write '1' to Disable interrupt for ENDRX event"] +pub struct ENDRX_W<'a> { + w: &'a mut W, +} +impl<'a> ENDRX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDRX_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(ENDRX_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for END event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END` reader - Write '1' to Disable interrupt for END event"] +pub struct END_R(crate::FieldReader); +impl END_R { + pub(crate) fn new(bits: bool) -> Self { + END_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> END_A { + match self.bits { + false => END_A::DISABLED, + true => END_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == END_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == END_A::ENABLED + } +} +impl core::ops::Deref for END_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for END event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END` writer - Write '1' to Disable interrupt for END event"] +pub struct END_W<'a> { + w: &'a mut W, +} +impl<'a> END_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: END_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(END_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for ENDTX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDTX_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDTX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDTX` reader - Write '1' to Disable interrupt for ENDTX event"] +pub struct ENDTX_R(crate::FieldReader); +impl ENDTX_R { + pub(crate) fn new(bits: bool) -> Self { + ENDTX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDTX_A { + match self.bits { + false => ENDTX_A::DISABLED, + true => ENDTX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENDTX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENDTX_A::ENABLED + } +} +impl core::ops::Deref for ENDTX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for ENDTX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDTX_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDTX_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDTX` writer - Write '1' to Disable interrupt for ENDTX event"] +pub struct ENDTX_W<'a> { + w: &'a mut W, +} +impl<'a> ENDTX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDTX_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(ENDTX_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for STARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STARTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STARTED` reader - Write '1' to Disable interrupt for STARTED event"] +pub struct STARTED_R(crate::FieldReader); +impl STARTED_R { + pub(crate) fn new(bits: bool) -> Self { + STARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STARTED_A { + match self.bits { + false => STARTED_A::DISABLED, + true => STARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STARTED_A::ENABLED + } +} +impl core::ops::Deref for STARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for STARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STARTED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STARTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STARTED` writer - Write '1' to Disable interrupt for STARTED event"] +pub struct STARTED_W<'a> { + w: &'a mut W, +} +impl<'a> STARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STARTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(STARTED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +impl R { + #[doc = "Bit 1 - Write '1' to Disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&self) -> STOPPED_R { + STOPPED_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 4 - Write '1' to Disable interrupt for ENDRX event"] + #[inline(always)] + pub fn endrx(&self) -> ENDRX_R { + ENDRX_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 6 - Write '1' to Disable interrupt for END event"] + #[inline(always)] + pub fn end(&self) -> END_R { + END_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 8 - Write '1' to Disable interrupt for ENDTX event"] + #[inline(always)] + pub fn endtx(&self) -> ENDTX_R { + ENDTX_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 19 - Write '1' to Disable interrupt for STARTED event"] + #[inline(always)] + pub fn started(&self) -> STARTED_R { + STARTED_R::new(((self.bits >> 19) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 1 - Write '1' to Disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&mut self) -> STOPPED_W { + STOPPED_W { w: self } + } + #[doc = "Bit 4 - Write '1' to Disable interrupt for ENDRX event"] + #[inline(always)] + pub fn endrx(&mut self) -> ENDRX_W { + ENDRX_W { w: self } + } + #[doc = "Bit 6 - Write '1' to Disable interrupt for END event"] + #[inline(always)] + pub fn end(&mut self) -> END_W { + END_W { w: self } + } + #[doc = "Bit 8 - Write '1' to Disable interrupt for ENDTX event"] + #[inline(always)] + pub fn endtx(&mut self) -> ENDTX_W { + ENDTX_W { w: self } + } + #[doc = "Bit 19 - Write '1' to Disable interrupt for STARTED event"] + #[inline(always)] + pub fn started(&mut self) -> STARTED_W { + STARTED_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spim0/intenset.rs b/src/spim0/intenset.rs new file mode 100644 index 0000000..8a7ee7b --- /dev/null +++ b/src/spim0/intenset.rs @@ -0,0 +1,566 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` reader - Write '1' to Enable interrupt for STOPPED event"] +pub struct STOPPED_R(crate::FieldReader); +impl STOPPED_R { + pub(crate) fn new(bits: bool) -> Self { + STOPPED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STOPPED_A { + match self.bits { + false => STOPPED_A::DISABLED, + true => STOPPED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STOPPED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STOPPED_A::ENABLED + } +} +impl core::ops::Deref for STOPPED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` writer - Write '1' to Enable interrupt for STOPPED event"] +pub struct STOPPED_W<'a> { + w: &'a mut W, +} +impl<'a> STOPPED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STOPPED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(STOPPED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for ENDRX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDRX_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDRX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDRX` reader - Write '1' to Enable interrupt for ENDRX event"] +pub struct ENDRX_R(crate::FieldReader); +impl ENDRX_R { + pub(crate) fn new(bits: bool) -> Self { + ENDRX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDRX_A { + match self.bits { + false => ENDRX_A::DISABLED, + true => ENDRX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENDRX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENDRX_A::ENABLED + } +} +impl core::ops::Deref for ENDRX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for ENDRX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDRX_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDRX_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDRX` writer - Write '1' to Enable interrupt for ENDRX event"] +pub struct ENDRX_W<'a> { + w: &'a mut W, +} +impl<'a> ENDRX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDRX_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(ENDRX_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for END event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END` reader - Write '1' to Enable interrupt for END event"] +pub struct END_R(crate::FieldReader); +impl END_R { + pub(crate) fn new(bits: bool) -> Self { + END_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> END_A { + match self.bits { + false => END_A::DISABLED, + true => END_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == END_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == END_A::ENABLED + } +} +impl core::ops::Deref for END_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for END event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END` writer - Write '1' to Enable interrupt for END event"] +pub struct END_W<'a> { + w: &'a mut W, +} +impl<'a> END_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: END_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(END_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for ENDTX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDTX_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDTX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDTX` reader - Write '1' to Enable interrupt for ENDTX event"] +pub struct ENDTX_R(crate::FieldReader); +impl ENDTX_R { + pub(crate) fn new(bits: bool) -> Self { + ENDTX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDTX_A { + match self.bits { + false => ENDTX_A::DISABLED, + true => ENDTX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENDTX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENDTX_A::ENABLED + } +} +impl core::ops::Deref for ENDTX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for ENDTX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDTX_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDTX_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDTX` writer - Write '1' to Enable interrupt for ENDTX event"] +pub struct ENDTX_W<'a> { + w: &'a mut W, +} +impl<'a> ENDTX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDTX_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(ENDTX_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for STARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STARTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STARTED` reader - Write '1' to Enable interrupt for STARTED event"] +pub struct STARTED_R(crate::FieldReader); +impl STARTED_R { + pub(crate) fn new(bits: bool) -> Self { + STARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STARTED_A { + match self.bits { + false => STARTED_A::DISABLED, + true => STARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STARTED_A::ENABLED + } +} +impl core::ops::Deref for STARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for STARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STARTED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STARTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STARTED` writer - Write '1' to Enable interrupt for STARTED event"] +pub struct STARTED_W<'a> { + w: &'a mut W, +} +impl<'a> STARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STARTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(STARTED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +impl R { + #[doc = "Bit 1 - Write '1' to Enable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&self) -> STOPPED_R { + STOPPED_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 4 - Write '1' to Enable interrupt for ENDRX event"] + #[inline(always)] + pub fn endrx(&self) -> ENDRX_R { + ENDRX_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 6 - Write '1' to Enable interrupt for END event"] + #[inline(always)] + pub fn end(&self) -> END_R { + END_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 8 - Write '1' to Enable interrupt for ENDTX event"] + #[inline(always)] + pub fn endtx(&self) -> ENDTX_R { + ENDTX_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 19 - Write '1' to Enable interrupt for STARTED event"] + #[inline(always)] + pub fn started(&self) -> STARTED_R { + STARTED_R::new(((self.bits >> 19) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 1 - Write '1' to Enable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&mut self) -> STOPPED_W { + STOPPED_W { w: self } + } + #[doc = "Bit 4 - Write '1' to Enable interrupt for ENDRX event"] + #[inline(always)] + pub fn endrx(&mut self) -> ENDRX_W { + ENDRX_W { w: self } + } + #[doc = "Bit 6 - Write '1' to Enable interrupt for END event"] + #[inline(always)] + pub fn end(&mut self) -> END_W { + END_W { w: self } + } + #[doc = "Bit 8 - Write '1' to Enable interrupt for ENDTX event"] + #[inline(always)] + pub fn endtx(&mut self) -> ENDTX_W { + ENDTX_W { w: self } + } + #[doc = "Bit 19 - Write '1' to Enable interrupt for STARTED event"] + #[inline(always)] + pub fn started(&mut self) -> STARTED_W { + STARTED_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spim0/orc.rs b/src/spim0/orc.rs new file mode 100644 index 0000000..dc13ed0 --- /dev/null +++ b/src/spim0/orc.rs @@ -0,0 +1,102 @@ +#[doc = "Register `ORC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ORC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `ORC` reader - Over-read character. Character clocked out in case and over-read of the TXD buffer."] +pub struct ORC_R(crate::FieldReader); +impl ORC_R { + pub(crate) fn new(bits: u8) -> Self { + ORC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ORC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ORC` writer - Over-read character. Character clocked out in case and over-read of the TXD buffer."] +pub struct ORC_W<'a> { + w: &'a mut W, +} +impl<'a> ORC_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - Over-read character. Character clocked out in case and over-read of the TXD buffer."] + #[inline(always)] + pub fn orc(&self) -> ORC_R { + ORC_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - Over-read character. Character clocked out in case and over-read of the TXD buffer."] + #[inline(always)] + pub fn orc(&mut self) -> ORC_W { + ORC_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Over-read character. Character clocked out in case and over-read of the TXD buffer.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [orc](index.html) module"] +pub struct ORC_SPEC; +impl crate::RegisterSpec for ORC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [orc::R](R) reader structure"] +impl crate::Readable for ORC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [orc::W](W) writer structure"] +impl crate::Writable for ORC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ORC to value 0"] +impl crate::Resettable for ORC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spim0/psel.rs b/src/spim0/psel.rs new file mode 100644 index 0000000..a316d55 --- /dev/null +++ b/src/spim0/psel.rs @@ -0,0 +1,12 @@ +#[doc = "SCK register accessor: an alias for `Reg`"] +pub type SCK = crate::Reg; +#[doc = "Pin select for SCK"] +pub mod sck; +#[doc = "MOSI register accessor: an alias for `Reg`"] +pub type MOSI = crate::Reg; +#[doc = "Pin select for MOSI signal"] +pub mod mosi; +#[doc = "MISO register accessor: an alias for `Reg`"] +pub type MISO = crate::Reg; +#[doc = "Pin select for MISO signal"] +pub mod miso; diff --git a/src/spim0/psel/miso.rs b/src/spim0/psel/miso.rs new file mode 100644 index 0000000..d01d145 --- /dev/null +++ b/src/spim0/psel/miso.rs @@ -0,0 +1,195 @@ +#[doc = "Register `MISO` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MISO` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PIN` reader - Pin number"] +pub struct PIN_R(crate::FieldReader); +impl PIN_R { + pub(crate) fn new(bits: u8) -> Self { + PIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN` writer - Pin number"] +pub struct PIN_W<'a> { + w: &'a mut W, +} +impl<'a> PIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Connection\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CONNECT_A { + #[doc = "1: Disconnect"] + DISCONNECTED = 1, + #[doc = "0: Connect"] + CONNECTED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: CONNECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CONNECT` reader - Connection"] +pub struct CONNECT_R(crate::FieldReader); +impl CONNECT_R { + pub(crate) fn new(bits: bool) -> Self { + CONNECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CONNECT_A { + match self.bits { + true => CONNECT_A::DISCONNECTED, + false => CONNECT_A::CONNECTED, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == CONNECT_A::DISCONNECTED + } + #[doc = "Checks if the value of the field is `CONNECTED`"] + #[inline(always)] + pub fn is_connected(&self) -> bool { + **self == CONNECT_A::CONNECTED + } +} +impl core::ops::Deref for CONNECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONNECT` writer - Connection"] +pub struct CONNECT_W<'a> { + w: &'a mut W, +} +impl<'a> CONNECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CONNECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(CONNECT_A::DISCONNECTED) + } + #[doc = "Connect"] + #[inline(always)] + pub fn connected(self) -> &'a mut W { + self.variant(CONNECT_A::CONNECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&self) -> PIN_R { + PIN_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&self) -> CONNECT_R { + CONNECT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&mut self) -> PIN_W { + PIN_W { w: self } + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&mut self) -> CONNECT_W { + CONNECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for MISO signal\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [miso](index.html) module"] +pub struct MISO_SPEC; +impl crate::RegisterSpec for MISO_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [miso::R](R) reader structure"] +impl crate::Readable for MISO_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [miso::W](W) writer structure"] +impl crate::Writable for MISO_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MISO to value 0xffff_ffff"] +impl crate::Resettable for MISO_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/spim0/psel/mosi.rs b/src/spim0/psel/mosi.rs new file mode 100644 index 0000000..d63d254 --- /dev/null +++ b/src/spim0/psel/mosi.rs @@ -0,0 +1,195 @@ +#[doc = "Register `MOSI` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MOSI` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PIN` reader - Pin number"] +pub struct PIN_R(crate::FieldReader); +impl PIN_R { + pub(crate) fn new(bits: u8) -> Self { + PIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN` writer - Pin number"] +pub struct PIN_W<'a> { + w: &'a mut W, +} +impl<'a> PIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Connection\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CONNECT_A { + #[doc = "1: Disconnect"] + DISCONNECTED = 1, + #[doc = "0: Connect"] + CONNECTED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: CONNECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CONNECT` reader - Connection"] +pub struct CONNECT_R(crate::FieldReader); +impl CONNECT_R { + pub(crate) fn new(bits: bool) -> Self { + CONNECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CONNECT_A { + match self.bits { + true => CONNECT_A::DISCONNECTED, + false => CONNECT_A::CONNECTED, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == CONNECT_A::DISCONNECTED + } + #[doc = "Checks if the value of the field is `CONNECTED`"] + #[inline(always)] + pub fn is_connected(&self) -> bool { + **self == CONNECT_A::CONNECTED + } +} +impl core::ops::Deref for CONNECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONNECT` writer - Connection"] +pub struct CONNECT_W<'a> { + w: &'a mut W, +} +impl<'a> CONNECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CONNECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(CONNECT_A::DISCONNECTED) + } + #[doc = "Connect"] + #[inline(always)] + pub fn connected(self) -> &'a mut W { + self.variant(CONNECT_A::CONNECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&self) -> PIN_R { + PIN_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&self) -> CONNECT_R { + CONNECT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&mut self) -> PIN_W { + PIN_W { w: self } + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&mut self) -> CONNECT_W { + CONNECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for MOSI signal\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mosi](index.html) module"] +pub struct MOSI_SPEC; +impl crate::RegisterSpec for MOSI_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mosi::R](R) reader structure"] +impl crate::Readable for MOSI_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mosi::W](W) writer structure"] +impl crate::Writable for MOSI_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MOSI to value 0xffff_ffff"] +impl crate::Resettable for MOSI_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/spim0/psel/sck.rs b/src/spim0/psel/sck.rs new file mode 100644 index 0000000..15f6a67 --- /dev/null +++ b/src/spim0/psel/sck.rs @@ -0,0 +1,195 @@ +#[doc = "Register `SCK` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SCK` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PIN` reader - Pin number"] +pub struct PIN_R(crate::FieldReader); +impl PIN_R { + pub(crate) fn new(bits: u8) -> Self { + PIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN` writer - Pin number"] +pub struct PIN_W<'a> { + w: &'a mut W, +} +impl<'a> PIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Connection\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CONNECT_A { + #[doc = "1: Disconnect"] + DISCONNECTED = 1, + #[doc = "0: Connect"] + CONNECTED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: CONNECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CONNECT` reader - Connection"] +pub struct CONNECT_R(crate::FieldReader); +impl CONNECT_R { + pub(crate) fn new(bits: bool) -> Self { + CONNECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CONNECT_A { + match self.bits { + true => CONNECT_A::DISCONNECTED, + false => CONNECT_A::CONNECTED, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == CONNECT_A::DISCONNECTED + } + #[doc = "Checks if the value of the field is `CONNECTED`"] + #[inline(always)] + pub fn is_connected(&self) -> bool { + **self == CONNECT_A::CONNECTED + } +} +impl core::ops::Deref for CONNECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONNECT` writer - Connection"] +pub struct CONNECT_W<'a> { + w: &'a mut W, +} +impl<'a> CONNECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CONNECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(CONNECT_A::DISCONNECTED) + } + #[doc = "Connect"] + #[inline(always)] + pub fn connected(self) -> &'a mut W { + self.variant(CONNECT_A::CONNECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&self) -> PIN_R { + PIN_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&self) -> CONNECT_R { + CONNECT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&mut self) -> PIN_W { + PIN_W { w: self } + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&mut self) -> CONNECT_W { + CONNECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for SCK\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sck](index.html) module"] +pub struct SCK_SPEC; +impl crate::RegisterSpec for SCK_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sck::R](R) reader structure"] +impl crate::Readable for SCK_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sck::W](W) writer structure"] +impl crate::Writable for SCK_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SCK to value 0xffff_ffff"] +impl crate::Resettable for SCK_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/spim0/rxd.rs b/src/spim0/rxd.rs new file mode 100644 index 0000000..aa82022 --- /dev/null +++ b/src/spim0/rxd.rs @@ -0,0 +1,16 @@ +#[doc = "PTR register accessor: an alias for `Reg`"] +pub type PTR = crate::Reg; +#[doc = "Data pointer"] +pub mod ptr; +#[doc = "MAXCNT register accessor: an alias for `Reg`"] +pub type MAXCNT = crate::Reg; +#[doc = "Maximum number of bytes in receive buffer"] +pub mod maxcnt; +#[doc = "AMOUNT register accessor: an alias for `Reg`"] +pub type AMOUNT = crate::Reg; +#[doc = "Number of bytes transferred in the last transaction"] +pub mod amount; +#[doc = "LIST register accessor: an alias for `Reg`"] +pub type LIST = crate::Reg; +#[doc = "EasyDMA list type"] +pub mod list; diff --git a/src/spim0/rxd/amount.rs b/src/spim0/rxd/amount.rs new file mode 100644 index 0000000..6e7cc9c --- /dev/null +++ b/src/spim0/rxd/amount.rs @@ -0,0 +1,52 @@ +#[doc = "Register `AMOUNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `AMOUNT` reader - Number of bytes transferred in the last transaction"] +pub struct AMOUNT_R(crate::FieldReader); +impl AMOUNT_R { + pub(crate) fn new(bits: u8) -> Self { + AMOUNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AMOUNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:7 - Number of bytes transferred in the last transaction"] + #[inline(always)] + pub fn amount(&self) -> AMOUNT_R { + AMOUNT_R::new((self.bits & 0xff) as u8) + } +} +#[doc = "Number of bytes transferred in the last transaction\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 [amount](index.html) module"] +pub struct AMOUNT_SPEC; +impl crate::RegisterSpec for AMOUNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [amount::R](R) reader structure"] +impl crate::Readable for AMOUNT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets AMOUNT to value 0"] +impl crate::Resettable for AMOUNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spim0/rxd/list.rs b/src/spim0/rxd/list.rs new file mode 100644 index 0000000..0483340 --- /dev/null +++ b/src/spim0/rxd/list.rs @@ -0,0 +1,151 @@ +#[doc = "Register `LIST` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `LIST` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "List type\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum LIST_A { + #[doc = "0: Disable EasyDMA list"] + DISABLED = 0, + #[doc = "1: Use array list"] + ARRAYLIST = 1, +} +impl From for u8 { + #[inline(always)] + fn from(variant: LIST_A) -> Self { + variant as _ + } +} +#[doc = "Field `LIST` reader - List type"] +pub struct LIST_R(crate::FieldReader); +impl LIST_R { + pub(crate) fn new(bits: u8) -> Self { + LIST_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(LIST_A::DISABLED), + 1 => Some(LIST_A::ARRAYLIST), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == LIST_A::DISABLED + } + #[doc = "Checks if the value of the field is `ARRAYLIST`"] + #[inline(always)] + pub fn is_array_list(&self) -> bool { + **self == LIST_A::ARRAYLIST + } +} +impl core::ops::Deref for LIST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LIST` writer - List type"] +pub struct LIST_W<'a> { + w: &'a mut W, +} +impl<'a> LIST_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LIST_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Disable EasyDMA list"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(LIST_A::DISABLED) + } + #[doc = "Use array list"] + #[inline(always)] + pub fn array_list(self) -> &'a mut W { + self.variant(LIST_A::ARRAYLIST) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); + self.w + } +} +impl R { + #[doc = "Bits 0:2 - List type"] + #[inline(always)] + pub fn list(&self) -> LIST_R { + LIST_R::new((self.bits & 0x07) as u8) + } +} +impl W { + #[doc = "Bits 0:2 - List type"] + #[inline(always)] + pub fn list(&mut self) -> LIST_W { + LIST_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "EasyDMA list type\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [list](index.html) module"] +pub struct LIST_SPEC; +impl crate::RegisterSpec for LIST_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [list::R](R) reader structure"] +impl crate::Readable for LIST_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [list::W](W) writer structure"] +impl crate::Writable for LIST_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LIST to value 0"] +impl crate::Resettable for LIST_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spim0/rxd/maxcnt.rs b/src/spim0/rxd/maxcnt.rs new file mode 100644 index 0000000..b005494 --- /dev/null +++ b/src/spim0/rxd/maxcnt.rs @@ -0,0 +1,102 @@ +#[doc = "Register `MAXCNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MAXCNT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `MAXCNT` reader - Maximum number of bytes in receive buffer"] +pub struct MAXCNT_R(crate::FieldReader); +impl MAXCNT_R { + pub(crate) fn new(bits: u8) -> Self { + MAXCNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MAXCNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MAXCNT` writer - Maximum number of bytes in receive buffer"] +pub struct MAXCNT_W<'a> { + w: &'a mut W, +} +impl<'a> MAXCNT_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - Maximum number of bytes in receive buffer"] + #[inline(always)] + pub fn maxcnt(&self) -> MAXCNT_R { + MAXCNT_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - Maximum number of bytes in receive buffer"] + #[inline(always)] + pub fn maxcnt(&mut self) -> MAXCNT_W { + MAXCNT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Maximum number of bytes in receive buffer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [maxcnt](index.html) module"] +pub struct MAXCNT_SPEC; +impl crate::RegisterSpec for MAXCNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [maxcnt::R](R) reader structure"] +impl crate::Readable for MAXCNT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [maxcnt::W](W) writer structure"] +impl crate::Writable for MAXCNT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MAXCNT to value 0"] +impl crate::Resettable for MAXCNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spim0/rxd/ptr.rs b/src/spim0/rxd/ptr.rs new file mode 100644 index 0000000..681f382 --- /dev/null +++ b/src/spim0/rxd/ptr.rs @@ -0,0 +1,102 @@ +#[doc = "Register `PTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PTR` reader - Data pointer"] +pub struct PTR_R(crate::FieldReader); +impl PTR_R { + pub(crate) fn new(bits: u32) -> Self { + PTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PTR` writer - Data pointer"] +pub struct PTR_W<'a> { + w: &'a mut W, +} +impl<'a> PTR_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Data pointer"] + #[inline(always)] + pub fn ptr(&self) -> PTR_R { + PTR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Data pointer"] + #[inline(always)] + pub fn ptr(&mut self) -> PTR_W { + PTR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Data pointer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ptr](index.html) module"] +pub struct PTR_SPEC; +impl crate::RegisterSpec for PTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ptr::R](R) reader structure"] +impl crate::Readable for PTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ptr::W](W) writer structure"] +impl crate::Writable for PTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PTR to value 0"] +impl crate::Resettable for PTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spim0/shorts.rs b/src/spim0/shorts.rs new file mode 100644 index 0000000..1a87e99 --- /dev/null +++ b/src/spim0/shorts.rs @@ -0,0 +1,159 @@ +#[doc = "Register `SHORTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SHORTS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Shortcut between END event and START task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_START_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_START_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END_START` reader - Shortcut between END event and START task"] +pub struct END_START_R(crate::FieldReader); +impl END_START_R { + pub(crate) fn new(bits: bool) -> Self { + END_START_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> END_START_A { + match self.bits { + false => END_START_A::DISABLED, + true => END_START_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == END_START_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == END_START_A::ENABLED + } +} +impl core::ops::Deref for END_START_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `END_START` writer - Shortcut between END event and START task"] +pub struct END_START_W<'a> { + w: &'a mut W, +} +impl<'a> END_START_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: END_START_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(END_START_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(END_START_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +impl R { + #[doc = "Bit 17 - Shortcut between END event and START task"] + #[inline(always)] + pub fn end_start(&self) -> END_START_R { + END_START_R::new(((self.bits >> 17) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 17 - Shortcut between END event and START task"] + #[inline(always)] + pub fn end_start(&mut self) -> END_START_W { + END_START_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Shortcut register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [shorts](index.html) module"] +pub struct SHORTS_SPEC; +impl crate::RegisterSpec for SHORTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [shorts::R](R) reader structure"] +impl crate::Readable for SHORTS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [shorts::W](W) writer structure"] +impl crate::Writable for SHORTS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SHORTS to value 0"] +impl crate::Resettable for SHORTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spim0/tasks_resume.rs b/src/spim0/tasks_resume.rs new file mode 100644 index 0000000..e657a45 --- /dev/null +++ b/src/spim0/tasks_resume.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_RESUME` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Resume SPI transaction\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_resume](index.html) module"] +pub struct TASKS_RESUME_SPEC; +impl crate::RegisterSpec for TASKS_RESUME_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_resume::W](W) writer structure"] +impl crate::Writable for TASKS_RESUME_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_RESUME to value 0"] +impl crate::Resettable for TASKS_RESUME_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spim0/tasks_start.rs b/src/spim0/tasks_start.rs new file mode 100644 index 0000000..b84a64f --- /dev/null +++ b/src/spim0/tasks_start.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_START` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start SPI transaction\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_start](index.html) module"] +pub struct TASKS_START_SPEC; +impl crate::RegisterSpec for TASKS_START_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_start::W](W) writer structure"] +impl crate::Writable for TASKS_START_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_START to value 0"] +impl crate::Resettable for TASKS_START_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spim0/tasks_stop.rs b/src/spim0/tasks_stop.rs new file mode 100644 index 0000000..5a438fa --- /dev/null +++ b/src/spim0/tasks_stop.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STOP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Stop SPI transaction\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_stop](index.html) module"] +pub struct TASKS_STOP_SPEC; +impl crate::RegisterSpec for TASKS_STOP_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_stop::W](W) writer structure"] +impl crate::Writable for TASKS_STOP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STOP to value 0"] +impl crate::Resettable for TASKS_STOP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spim0/tasks_suspend.rs b/src/spim0/tasks_suspend.rs new file mode 100644 index 0000000..e133cde --- /dev/null +++ b/src/spim0/tasks_suspend.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_SUSPEND` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Suspend SPI transaction\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_suspend](index.html) module"] +pub struct TASKS_SUSPEND_SPEC; +impl crate::RegisterSpec for TASKS_SUSPEND_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_suspend::W](W) writer structure"] +impl crate::Writable for TASKS_SUSPEND_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_SUSPEND to value 0"] +impl crate::Resettable for TASKS_SUSPEND_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spim0/txd.rs b/src/spim0/txd.rs new file mode 100644 index 0000000..7dafa96 --- /dev/null +++ b/src/spim0/txd.rs @@ -0,0 +1,16 @@ +#[doc = "PTR register accessor: an alias for `Reg`"] +pub type PTR = crate::Reg; +#[doc = "Data pointer"] +pub mod ptr; +#[doc = "MAXCNT register accessor: an alias for `Reg`"] +pub type MAXCNT = crate::Reg; +#[doc = "Maximum number of bytes in transmit buffer"] +pub mod maxcnt; +#[doc = "AMOUNT register accessor: an alias for `Reg`"] +pub type AMOUNT = crate::Reg; +#[doc = "Number of bytes transferred in the last transaction"] +pub mod amount; +#[doc = "LIST register accessor: an alias for `Reg`"] +pub type LIST = crate::Reg; +#[doc = "EasyDMA list type"] +pub mod list; diff --git a/src/spim0/txd/amount.rs b/src/spim0/txd/amount.rs new file mode 100644 index 0000000..6e7cc9c --- /dev/null +++ b/src/spim0/txd/amount.rs @@ -0,0 +1,52 @@ +#[doc = "Register `AMOUNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `AMOUNT` reader - Number of bytes transferred in the last transaction"] +pub struct AMOUNT_R(crate::FieldReader); +impl AMOUNT_R { + pub(crate) fn new(bits: u8) -> Self { + AMOUNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AMOUNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:7 - Number of bytes transferred in the last transaction"] + #[inline(always)] + pub fn amount(&self) -> AMOUNT_R { + AMOUNT_R::new((self.bits & 0xff) as u8) + } +} +#[doc = "Number of bytes transferred in the last transaction\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 [amount](index.html) module"] +pub struct AMOUNT_SPEC; +impl crate::RegisterSpec for AMOUNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [amount::R](R) reader structure"] +impl crate::Readable for AMOUNT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets AMOUNT to value 0"] +impl crate::Resettable for AMOUNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spim0/txd/list.rs b/src/spim0/txd/list.rs new file mode 100644 index 0000000..0483340 --- /dev/null +++ b/src/spim0/txd/list.rs @@ -0,0 +1,151 @@ +#[doc = "Register `LIST` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `LIST` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "List type\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum LIST_A { + #[doc = "0: Disable EasyDMA list"] + DISABLED = 0, + #[doc = "1: Use array list"] + ARRAYLIST = 1, +} +impl From for u8 { + #[inline(always)] + fn from(variant: LIST_A) -> Self { + variant as _ + } +} +#[doc = "Field `LIST` reader - List type"] +pub struct LIST_R(crate::FieldReader); +impl LIST_R { + pub(crate) fn new(bits: u8) -> Self { + LIST_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(LIST_A::DISABLED), + 1 => Some(LIST_A::ARRAYLIST), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == LIST_A::DISABLED + } + #[doc = "Checks if the value of the field is `ARRAYLIST`"] + #[inline(always)] + pub fn is_array_list(&self) -> bool { + **self == LIST_A::ARRAYLIST + } +} +impl core::ops::Deref for LIST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LIST` writer - List type"] +pub struct LIST_W<'a> { + w: &'a mut W, +} +impl<'a> LIST_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LIST_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Disable EasyDMA list"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(LIST_A::DISABLED) + } + #[doc = "Use array list"] + #[inline(always)] + pub fn array_list(self) -> &'a mut W { + self.variant(LIST_A::ARRAYLIST) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); + self.w + } +} +impl R { + #[doc = "Bits 0:2 - List type"] + #[inline(always)] + pub fn list(&self) -> LIST_R { + LIST_R::new((self.bits & 0x07) as u8) + } +} +impl W { + #[doc = "Bits 0:2 - List type"] + #[inline(always)] + pub fn list(&mut self) -> LIST_W { + LIST_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "EasyDMA list type\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [list](index.html) module"] +pub struct LIST_SPEC; +impl crate::RegisterSpec for LIST_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [list::R](R) reader structure"] +impl crate::Readable for LIST_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [list::W](W) writer structure"] +impl crate::Writable for LIST_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LIST to value 0"] +impl crate::Resettable for LIST_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spim0/txd/maxcnt.rs b/src/spim0/txd/maxcnt.rs new file mode 100644 index 0000000..c9a377b --- /dev/null +++ b/src/spim0/txd/maxcnt.rs @@ -0,0 +1,102 @@ +#[doc = "Register `MAXCNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MAXCNT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `MAXCNT` reader - Maximum number of bytes in transmit buffer"] +pub struct MAXCNT_R(crate::FieldReader); +impl MAXCNT_R { + pub(crate) fn new(bits: u8) -> Self { + MAXCNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MAXCNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MAXCNT` writer - Maximum number of bytes in transmit buffer"] +pub struct MAXCNT_W<'a> { + w: &'a mut W, +} +impl<'a> MAXCNT_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - Maximum number of bytes in transmit buffer"] + #[inline(always)] + pub fn maxcnt(&self) -> MAXCNT_R { + MAXCNT_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - Maximum number of bytes in transmit buffer"] + #[inline(always)] + pub fn maxcnt(&mut self) -> MAXCNT_W { + MAXCNT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Maximum number of bytes in transmit buffer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [maxcnt](index.html) module"] +pub struct MAXCNT_SPEC; +impl crate::RegisterSpec for MAXCNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [maxcnt::R](R) reader structure"] +impl crate::Readable for MAXCNT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [maxcnt::W](W) writer structure"] +impl crate::Writable for MAXCNT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MAXCNT to value 0"] +impl crate::Resettable for MAXCNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spim0/txd/ptr.rs b/src/spim0/txd/ptr.rs new file mode 100644 index 0000000..681f382 --- /dev/null +++ b/src/spim0/txd/ptr.rs @@ -0,0 +1,102 @@ +#[doc = "Register `PTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PTR` reader - Data pointer"] +pub struct PTR_R(crate::FieldReader); +impl PTR_R { + pub(crate) fn new(bits: u32) -> Self { + PTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PTR` writer - Data pointer"] +pub struct PTR_W<'a> { + w: &'a mut W, +} +impl<'a> PTR_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Data pointer"] + #[inline(always)] + pub fn ptr(&self) -> PTR_R { + PTR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Data pointer"] + #[inline(always)] + pub fn ptr(&mut self) -> PTR_W { + PTR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Data pointer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ptr](index.html) module"] +pub struct PTR_SPEC; +impl crate::RegisterSpec for PTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ptr::R](R) reader structure"] +impl crate::Readable for PTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ptr::W](W) writer structure"] +impl crate::Writable for PTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PTR to value 0"] +impl crate::Resettable for PTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spis0.rs b/src/spis0.rs new file mode 100644 index 0000000..811394b --- /dev/null +++ b/src/spis0.rs @@ -0,0 +1,150 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + _reserved0: [u8; 0x24], + #[doc = "0x24 - Acquire SPI semaphore"] + pub tasks_acquire: crate::Reg, + #[doc = "0x28 - Release SPI semaphore, enabling the SPI slave to acquire it"] + pub tasks_release: crate::Reg, + _reserved2: [u8; 0xd8], + #[doc = "0x104 - Granted transaction completed"] + pub events_end: crate::Reg, + _reserved3: [u8; 0x08], + #[doc = "0x110 - End of RXD buffer reached"] + pub events_endrx: crate::Reg, + _reserved4: [u8; 0x14], + #[doc = "0x128 - Semaphore acquired"] + pub events_acquired: crate::Reg, + _reserved5: [u8; 0xd4], + #[doc = "0x200 - Shortcut register"] + pub shorts: crate::Reg, + _reserved6: [u8; 0x0100], + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved8: [u8; 0xf4], + #[doc = "0x400 - Semaphore status register"] + pub semstat: crate::Reg, + _reserved9: [u8; 0x3c], + #[doc = "0x440 - Status from last transaction"] + pub status: crate::Reg, + _reserved10: [u8; 0xbc], + #[doc = "0x500 - Enable SPI slave"] + pub enable: crate::Reg, + _reserved11: [u8; 0x04], + #[doc = "0x508..0x518 - Unspecified"] + pub psel: PSEL, + _reserved12: [u8; 0x1c], + #[doc = "0x534..0x540 - Unspecified"] + pub rxd: RXD, + _reserved13: [u8; 0x04], + #[doc = "0x544..0x550 - Unspecified"] + pub txd: TXD, + _reserved14: [u8; 0x04], + #[doc = "0x554 - Configuration register"] + pub config: crate::Reg, + _reserved15: [u8; 0x04], + #[doc = "0x55c - Default character. Character clocked out in case of an ignored transaction."] + pub def: crate::Reg, + _reserved16: [u8; 0x60], + #[doc = "0x5c0 - Over-read character"] + pub orc: crate::Reg, +} +#[doc = r"Register block"] +#[repr(C)] +pub struct PSEL { + #[doc = "0x00 - Pin select for SCK"] + pub sck: crate::Reg, + #[doc = "0x04 - Pin select for MISO signal"] + pub miso: crate::Reg, + #[doc = "0x08 - Pin select for MOSI signal"] + pub mosi: crate::Reg, + #[doc = "0x0c - Pin select for CSN signal"] + pub csn: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod psel; +#[doc = r"Register block"] +#[repr(C)] +pub struct RXD { + #[doc = "0x00 - RXD data pointer"] + pub ptr: crate::Reg, + #[doc = "0x04 - Maximum number of bytes in receive buffer"] + pub maxcnt: crate::Reg, + #[doc = "0x08 - Number of bytes received in last granted transaction"] + pub amount: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod rxd; +#[doc = r"Register block"] +#[repr(C)] +pub struct TXD { + #[doc = "0x00 - TXD data pointer"] + pub ptr: crate::Reg, + #[doc = "0x04 - Maximum number of bytes in transmit buffer"] + pub maxcnt: crate::Reg, + #[doc = "0x08 - Number of bytes transmitted in last granted transaction"] + pub amount: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod txd; +#[doc = "TASKS_ACQUIRE register accessor: an alias for `Reg`"] +pub type TASKS_ACQUIRE = crate::Reg; +#[doc = "Acquire SPI semaphore"] +pub mod tasks_acquire; +#[doc = "TASKS_RELEASE register accessor: an alias for `Reg`"] +pub type TASKS_RELEASE = crate::Reg; +#[doc = "Release SPI semaphore, enabling the SPI slave to acquire it"] +pub mod tasks_release; +#[doc = "EVENTS_END register accessor: an alias for `Reg`"] +pub type EVENTS_END = crate::Reg; +#[doc = "Granted transaction completed"] +pub mod events_end; +#[doc = "EVENTS_ENDRX register accessor: an alias for `Reg`"] +pub type EVENTS_ENDRX = crate::Reg; +#[doc = "End of RXD buffer reached"] +pub mod events_endrx; +#[doc = "EVENTS_ACQUIRED register accessor: an alias for `Reg`"] +pub type EVENTS_ACQUIRED = crate::Reg; +#[doc = "Semaphore acquired"] +pub mod events_acquired; +#[doc = "SHORTS register accessor: an alias for `Reg`"] +pub type SHORTS = crate::Reg; +#[doc = "Shortcut register"] +pub mod shorts; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "SEMSTAT register accessor: an alias for `Reg`"] +pub type SEMSTAT = crate::Reg; +#[doc = "Semaphore status register"] +pub mod semstat; +#[doc = "STATUS register accessor: an alias for `Reg`"] +pub type STATUS = crate::Reg; +#[doc = "Status from last transaction"] +pub mod status; +#[doc = "ENABLE register accessor: an alias for `Reg`"] +pub type ENABLE = crate::Reg; +#[doc = "Enable SPI slave"] +pub mod enable; +#[doc = "CONFIG register accessor: an alias for `Reg`"] +pub type CONFIG = crate::Reg; +#[doc = "Configuration register"] +pub mod config; +#[doc = "DEF register accessor: an alias for `Reg`"] +pub type DEF = crate::Reg; +#[doc = "Default character. Character clocked out in case of an ignored transaction."] +pub mod def; +#[doc = "ORC register accessor: an alias for `Reg`"] +pub type ORC = crate::Reg; +#[doc = "Over-read character"] +pub mod orc; diff --git a/src/spis0/config.rs b/src/spis0/config.rs new file mode 100644 index 0000000..14669c0 --- /dev/null +++ b/src/spis0/config.rs @@ -0,0 +1,345 @@ +#[doc = "Register `CONFIG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CONFIG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Bit order\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ORDER_A { + #[doc = "0: Most significant bit shifted out first"] + MSBFIRST = 0, + #[doc = "1: Least significant bit shifted out first"] + LSBFIRST = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ORDER_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ORDER` reader - Bit order"] +pub struct ORDER_R(crate::FieldReader); +impl ORDER_R { + pub(crate) fn new(bits: bool) -> Self { + ORDER_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ORDER_A { + match self.bits { + false => ORDER_A::MSBFIRST, + true => ORDER_A::LSBFIRST, + } + } + #[doc = "Checks if the value of the field is `MSBFIRST`"] + #[inline(always)] + pub fn is_msb_first(&self) -> bool { + **self == ORDER_A::MSBFIRST + } + #[doc = "Checks if the value of the field is `LSBFIRST`"] + #[inline(always)] + pub fn is_lsb_first(&self) -> bool { + **self == ORDER_A::LSBFIRST + } +} +impl core::ops::Deref for ORDER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ORDER` writer - Bit order"] +pub struct ORDER_W<'a> { + w: &'a mut W, +} +impl<'a> ORDER_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ORDER_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Most significant bit shifted out first"] + #[inline(always)] + pub fn msb_first(self) -> &'a mut W { + self.variant(ORDER_A::MSBFIRST) + } + #[doc = "Least significant bit shifted out first"] + #[inline(always)] + pub fn lsb_first(self) -> &'a mut W { + self.variant(ORDER_A::LSBFIRST) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Serial clock (SCK) phase\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CPHA_A { + #[doc = "0: Sample on leading edge of clock, shift serial data on trailing edge"] + LEADING = 0, + #[doc = "1: Sample on trailing edge of clock, shift serial data on leading edge"] + TRAILING = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CPHA_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CPHA` reader - Serial clock (SCK) phase"] +pub struct CPHA_R(crate::FieldReader); +impl CPHA_R { + pub(crate) fn new(bits: bool) -> Self { + CPHA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CPHA_A { + match self.bits { + false => CPHA_A::LEADING, + true => CPHA_A::TRAILING, + } + } + #[doc = "Checks if the value of the field is `LEADING`"] + #[inline(always)] + pub fn is_leading(&self) -> bool { + **self == CPHA_A::LEADING + } + #[doc = "Checks if the value of the field is `TRAILING`"] + #[inline(always)] + pub fn is_trailing(&self) -> bool { + **self == CPHA_A::TRAILING + } +} +impl core::ops::Deref for CPHA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CPHA` writer - Serial clock (SCK) phase"] +pub struct CPHA_W<'a> { + w: &'a mut W, +} +impl<'a> CPHA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CPHA_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Sample on leading edge of clock, shift serial data on trailing edge"] + #[inline(always)] + pub fn leading(self) -> &'a mut W { + self.variant(CPHA_A::LEADING) + } + #[doc = "Sample on trailing edge of clock, shift serial data on leading edge"] + #[inline(always)] + pub fn trailing(self) -> &'a mut W { + self.variant(CPHA_A::TRAILING) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Serial clock (SCK) polarity\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CPOL_A { + #[doc = "0: Active high"] + ACTIVEHIGH = 0, + #[doc = "1: Active low"] + ACTIVELOW = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CPOL_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CPOL` reader - Serial clock (SCK) polarity"] +pub struct CPOL_R(crate::FieldReader); +impl CPOL_R { + pub(crate) fn new(bits: bool) -> Self { + CPOL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CPOL_A { + match self.bits { + false => CPOL_A::ACTIVEHIGH, + true => CPOL_A::ACTIVELOW, + } + } + #[doc = "Checks if the value of the field is `ACTIVEHIGH`"] + #[inline(always)] + pub fn is_active_high(&self) -> bool { + **self == CPOL_A::ACTIVEHIGH + } + #[doc = "Checks if the value of the field is `ACTIVELOW`"] + #[inline(always)] + pub fn is_active_low(&self) -> bool { + **self == CPOL_A::ACTIVELOW + } +} +impl core::ops::Deref for CPOL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CPOL` writer - Serial clock (SCK) polarity"] +pub struct CPOL_W<'a> { + w: &'a mut W, +} +impl<'a> CPOL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CPOL_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Active high"] + #[inline(always)] + pub fn active_high(self) -> &'a mut W { + self.variant(CPOL_A::ACTIVEHIGH) + } + #[doc = "Active low"] + #[inline(always)] + pub fn active_low(self) -> &'a mut W { + self.variant(CPOL_A::ACTIVELOW) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +impl R { + #[doc = "Bit 0 - Bit order"] + #[inline(always)] + pub fn order(&self) -> ORDER_R { + ORDER_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Serial clock (SCK) phase"] + #[inline(always)] + pub fn cpha(&self) -> CPHA_R { + CPHA_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Serial clock (SCK) polarity"] + #[inline(always)] + pub fn cpol(&self) -> CPOL_R { + CPOL_R::new(((self.bits >> 2) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Bit order"] + #[inline(always)] + pub fn order(&mut self) -> ORDER_W { + ORDER_W { w: self } + } + #[doc = "Bit 1 - Serial clock (SCK) phase"] + #[inline(always)] + pub fn cpha(&mut self) -> CPHA_W { + CPHA_W { w: self } + } + #[doc = "Bit 2 - Serial clock (SCK) polarity"] + #[inline(always)] + pub fn cpol(&mut self) -> CPOL_W { + CPOL_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Configuration register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [config](index.html) module"] +pub struct CONFIG_SPEC; +impl crate::RegisterSpec for CONFIG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [config::R](R) reader structure"] +impl crate::Readable for CONFIG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [config::W](W) writer structure"] +impl crate::Writable for CONFIG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CONFIG to value 0"] +impl crate::Resettable for CONFIG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spis0/def.rs b/src/spis0/def.rs new file mode 100644 index 0000000..f54e2bb --- /dev/null +++ b/src/spis0/def.rs @@ -0,0 +1,102 @@ +#[doc = "Register `DEF` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `DEF` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `DEF` reader - Default character. Character clocked out in case of an ignored transaction."] +pub struct DEF_R(crate::FieldReader); +impl DEF_R { + pub(crate) fn new(bits: u8) -> Self { + DEF_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for DEF_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DEF` writer - Default character. Character clocked out in case of an ignored transaction."] +pub struct DEF_W<'a> { + w: &'a mut W, +} +impl<'a> DEF_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - Default character. Character clocked out in case of an ignored transaction."] + #[inline(always)] + pub fn def(&self) -> DEF_R { + DEF_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - Default character. Character clocked out in case of an ignored transaction."] + #[inline(always)] + pub fn def(&mut self) -> DEF_W { + DEF_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Default character. Character clocked out in case of an ignored transaction.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [def](index.html) module"] +pub struct DEF_SPEC; +impl crate::RegisterSpec for DEF_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [def::R](R) reader structure"] +impl crate::Readable for DEF_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [def::W](W) writer structure"] +impl crate::Writable for DEF_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets DEF to value 0"] +impl crate::Resettable for DEF_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spis0/enable.rs b/src/spis0/enable.rs new file mode 100644 index 0000000..2baf4dc --- /dev/null +++ b/src/spis0/enable.rs @@ -0,0 +1,151 @@ +#[doc = "Register `ENABLE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ENABLE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable SPI slave\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum ENABLE_A { + #[doc = "0: Disable SPI slave"] + DISABLED = 0, + #[doc = "2: Enable SPI slave"] + ENABLED = 2, +} +impl From for u8 { + #[inline(always)] + fn from(variant: ENABLE_A) -> Self { + variant as _ + } +} +#[doc = "Field `ENABLE` reader - Enable or disable SPI slave"] +pub struct ENABLE_R(crate::FieldReader); +impl ENABLE_R { + pub(crate) fn new(bits: u8) -> Self { + ENABLE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(ENABLE_A::DISABLED), + 2 => Some(ENABLE_A::ENABLED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENABLE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENABLE_A::ENABLED + } +} +impl core::ops::Deref for ENABLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENABLE` writer - Enable or disable SPI slave"] +pub struct ENABLE_W<'a> { + w: &'a mut W, +} +impl<'a> ENABLE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENABLE_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Disable SPI slave"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENABLE_A::DISABLED) + } + #[doc = "Enable SPI slave"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENABLE_A::ENABLED) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); + self.w + } +} +impl R { + #[doc = "Bits 0:3 - Enable or disable SPI slave"] + #[inline(always)] + pub fn enable(&self) -> ENABLE_R { + ENABLE_R::new((self.bits & 0x0f) as u8) + } +} +impl W { + #[doc = "Bits 0:3 - Enable or disable SPI slave"] + #[inline(always)] + pub fn enable(&mut self) -> ENABLE_W { + ENABLE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable SPI slave\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [enable](index.html) module"] +pub struct ENABLE_SPEC; +impl crate::RegisterSpec for ENABLE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [enable::R](R) reader structure"] +impl crate::Readable for ENABLE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [enable::W](W) writer structure"] +impl crate::Writable for ENABLE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ENABLE to value 0"] +impl crate::Resettable for ENABLE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spis0/events_acquired.rs b/src/spis0/events_acquired.rs new file mode 100644 index 0000000..b048c6e --- /dev/null +++ b/src/spis0/events_acquired.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_ACQUIRED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_ACQUIRED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Semaphore acquired\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_acquired](index.html) module"] +pub struct EVENTS_ACQUIRED_SPEC; +impl crate::RegisterSpec for EVENTS_ACQUIRED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_acquired::R](R) reader structure"] +impl crate::Readable for EVENTS_ACQUIRED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_acquired::W](W) writer structure"] +impl crate::Writable for EVENTS_ACQUIRED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_ACQUIRED to value 0"] +impl crate::Resettable for EVENTS_ACQUIRED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spis0/events_end.rs b/src/spis0/events_end.rs new file mode 100644 index 0000000..7e11bf4 --- /dev/null +++ b/src/spis0/events_end.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_END` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_END` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Granted transaction completed\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_end](index.html) module"] +pub struct EVENTS_END_SPEC; +impl crate::RegisterSpec for EVENTS_END_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_end::R](R) reader structure"] +impl crate::Readable for EVENTS_END_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_end::W](W) writer structure"] +impl crate::Writable for EVENTS_END_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_END to value 0"] +impl crate::Resettable for EVENTS_END_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spis0/events_endrx.rs b/src/spis0/events_endrx.rs new file mode 100644 index 0000000..de44609 --- /dev/null +++ b/src/spis0/events_endrx.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_ENDRX` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_ENDRX` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "End of RXD buffer reached\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_endrx](index.html) module"] +pub struct EVENTS_ENDRX_SPEC; +impl crate::RegisterSpec for EVENTS_ENDRX_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_endrx::R](R) reader structure"] +impl crate::Readable for EVENTS_ENDRX_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_endrx::W](W) writer structure"] +impl crate::Writable for EVENTS_ENDRX_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_ENDRX to value 0"] +impl crate::Resettable for EVENTS_ENDRX_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spis0/intenclr.rs b/src/spis0/intenclr.rs new file mode 100644 index 0000000..a804b3e --- /dev/null +++ b/src/spis0/intenclr.rs @@ -0,0 +1,366 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for END event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END` reader - Write '1' to Disable interrupt for END event"] +pub struct END_R(crate::FieldReader); +impl END_R { + pub(crate) fn new(bits: bool) -> Self { + END_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> END_A { + match self.bits { + false => END_A::DISABLED, + true => END_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == END_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == END_A::ENABLED + } +} +impl core::ops::Deref for END_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for END event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END` writer - Write '1' to Disable interrupt for END event"] +pub struct END_W<'a> { + w: &'a mut W, +} +impl<'a> END_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: END_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(END_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for ENDRX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDRX_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDRX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDRX` reader - Write '1' to Disable interrupt for ENDRX event"] +pub struct ENDRX_R(crate::FieldReader); +impl ENDRX_R { + pub(crate) fn new(bits: bool) -> Self { + ENDRX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDRX_A { + match self.bits { + false => ENDRX_A::DISABLED, + true => ENDRX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENDRX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENDRX_A::ENABLED + } +} +impl core::ops::Deref for ENDRX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for ENDRX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDRX_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDRX_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDRX` writer - Write '1' to Disable interrupt for ENDRX event"] +pub struct ENDRX_W<'a> { + w: &'a mut W, +} +impl<'a> ENDRX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDRX_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(ENDRX_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for ACQUIRED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ACQUIRED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ACQUIRED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ACQUIRED` reader - Write '1' to Disable interrupt for ACQUIRED event"] +pub struct ACQUIRED_R(crate::FieldReader); +impl ACQUIRED_R { + pub(crate) fn new(bits: bool) -> Self { + ACQUIRED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ACQUIRED_A { + match self.bits { + false => ACQUIRED_A::DISABLED, + true => ACQUIRED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ACQUIRED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ACQUIRED_A::ENABLED + } +} +impl core::ops::Deref for ACQUIRED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for ACQUIRED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ACQUIRED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ACQUIRED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ACQUIRED` writer - Write '1' to Disable interrupt for ACQUIRED event"] +pub struct ACQUIRED_W<'a> { + w: &'a mut W, +} +impl<'a> ACQUIRED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ACQUIRED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(ACQUIRED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +impl R { + #[doc = "Bit 1 - Write '1' to Disable interrupt for END event"] + #[inline(always)] + pub fn end(&self) -> END_R { + END_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 4 - Write '1' to Disable interrupt for ENDRX event"] + #[inline(always)] + pub fn endrx(&self) -> ENDRX_R { + ENDRX_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 10 - Write '1' to Disable interrupt for ACQUIRED event"] + #[inline(always)] + pub fn acquired(&self) -> ACQUIRED_R { + ACQUIRED_R::new(((self.bits >> 10) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 1 - Write '1' to Disable interrupt for END event"] + #[inline(always)] + pub fn end(&mut self) -> END_W { + END_W { w: self } + } + #[doc = "Bit 4 - Write '1' to Disable interrupt for ENDRX event"] + #[inline(always)] + pub fn endrx(&mut self) -> ENDRX_W { + ENDRX_W { w: self } + } + #[doc = "Bit 10 - Write '1' to Disable interrupt for ACQUIRED event"] + #[inline(always)] + pub fn acquired(&mut self) -> ACQUIRED_W { + ACQUIRED_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spis0/intenset.rs b/src/spis0/intenset.rs new file mode 100644 index 0000000..7b86009 --- /dev/null +++ b/src/spis0/intenset.rs @@ -0,0 +1,366 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for END event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END` reader - Write '1' to Enable interrupt for END event"] +pub struct END_R(crate::FieldReader); +impl END_R { + pub(crate) fn new(bits: bool) -> Self { + END_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> END_A { + match self.bits { + false => END_A::DISABLED, + true => END_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == END_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == END_A::ENABLED + } +} +impl core::ops::Deref for END_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for END event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END` writer - Write '1' to Enable interrupt for END event"] +pub struct END_W<'a> { + w: &'a mut W, +} +impl<'a> END_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: END_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(END_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for ENDRX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDRX_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDRX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDRX` reader - Write '1' to Enable interrupt for ENDRX event"] +pub struct ENDRX_R(crate::FieldReader); +impl ENDRX_R { + pub(crate) fn new(bits: bool) -> Self { + ENDRX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDRX_A { + match self.bits { + false => ENDRX_A::DISABLED, + true => ENDRX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENDRX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENDRX_A::ENABLED + } +} +impl core::ops::Deref for ENDRX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for ENDRX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDRX_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDRX_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDRX` writer - Write '1' to Enable interrupt for ENDRX event"] +pub struct ENDRX_W<'a> { + w: &'a mut W, +} +impl<'a> ENDRX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDRX_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(ENDRX_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for ACQUIRED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ACQUIRED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ACQUIRED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ACQUIRED` reader - Write '1' to Enable interrupt for ACQUIRED event"] +pub struct ACQUIRED_R(crate::FieldReader); +impl ACQUIRED_R { + pub(crate) fn new(bits: bool) -> Self { + ACQUIRED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ACQUIRED_A { + match self.bits { + false => ACQUIRED_A::DISABLED, + true => ACQUIRED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ACQUIRED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ACQUIRED_A::ENABLED + } +} +impl core::ops::Deref for ACQUIRED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for ACQUIRED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ACQUIRED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ACQUIRED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ACQUIRED` writer - Write '1' to Enable interrupt for ACQUIRED event"] +pub struct ACQUIRED_W<'a> { + w: &'a mut W, +} +impl<'a> ACQUIRED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ACQUIRED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(ACQUIRED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +impl R { + #[doc = "Bit 1 - Write '1' to Enable interrupt for END event"] + #[inline(always)] + pub fn end(&self) -> END_R { + END_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 4 - Write '1' to Enable interrupt for ENDRX event"] + #[inline(always)] + pub fn endrx(&self) -> ENDRX_R { + ENDRX_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 10 - Write '1' to Enable interrupt for ACQUIRED event"] + #[inline(always)] + pub fn acquired(&self) -> ACQUIRED_R { + ACQUIRED_R::new(((self.bits >> 10) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 1 - Write '1' to Enable interrupt for END event"] + #[inline(always)] + pub fn end(&mut self) -> END_W { + END_W { w: self } + } + #[doc = "Bit 4 - Write '1' to Enable interrupt for ENDRX event"] + #[inline(always)] + pub fn endrx(&mut self) -> ENDRX_W { + ENDRX_W { w: self } + } + #[doc = "Bit 10 - Write '1' to Enable interrupt for ACQUIRED event"] + #[inline(always)] + pub fn acquired(&mut self) -> ACQUIRED_W { + ACQUIRED_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spis0/orc.rs b/src/spis0/orc.rs new file mode 100644 index 0000000..992a733 --- /dev/null +++ b/src/spis0/orc.rs @@ -0,0 +1,102 @@ +#[doc = "Register `ORC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ORC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `ORC` reader - Over-read character. Character clocked out after an over-read of the transmit buffer."] +pub struct ORC_R(crate::FieldReader); +impl ORC_R { + pub(crate) fn new(bits: u8) -> Self { + ORC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ORC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ORC` writer - Over-read character. Character clocked out after an over-read of the transmit buffer."] +pub struct ORC_W<'a> { + w: &'a mut W, +} +impl<'a> ORC_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - Over-read character. Character clocked out after an over-read of the transmit buffer."] + #[inline(always)] + pub fn orc(&self) -> ORC_R { + ORC_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - Over-read character. Character clocked out after an over-read of the transmit buffer."] + #[inline(always)] + pub fn orc(&mut self) -> ORC_W { + ORC_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Over-read character\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [orc](index.html) module"] +pub struct ORC_SPEC; +impl crate::RegisterSpec for ORC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [orc::R](R) reader structure"] +impl crate::Readable for ORC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [orc::W](W) writer structure"] +impl crate::Writable for ORC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ORC to value 0"] +impl crate::Resettable for ORC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spis0/psel.rs b/src/spis0/psel.rs new file mode 100644 index 0000000..786b829 --- /dev/null +++ b/src/spis0/psel.rs @@ -0,0 +1,16 @@ +#[doc = "SCK register accessor: an alias for `Reg`"] +pub type SCK = crate::Reg; +#[doc = "Pin select for SCK"] +pub mod sck; +#[doc = "MISO register accessor: an alias for `Reg`"] +pub type MISO = crate::Reg; +#[doc = "Pin select for MISO signal"] +pub mod miso; +#[doc = "MOSI register accessor: an alias for `Reg`"] +pub type MOSI = crate::Reg; +#[doc = "Pin select for MOSI signal"] +pub mod mosi; +#[doc = "CSN register accessor: an alias for `Reg`"] +pub type CSN = crate::Reg; +#[doc = "Pin select for CSN signal"] +pub mod csn; diff --git a/src/spis0/psel/csn.rs b/src/spis0/psel/csn.rs new file mode 100644 index 0000000..c14a8cb --- /dev/null +++ b/src/spis0/psel/csn.rs @@ -0,0 +1,195 @@ +#[doc = "Register `CSN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CSN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PIN` reader - Pin number"] +pub struct PIN_R(crate::FieldReader); +impl PIN_R { + pub(crate) fn new(bits: u8) -> Self { + PIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN` writer - Pin number"] +pub struct PIN_W<'a> { + w: &'a mut W, +} +impl<'a> PIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Connection\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CONNECT_A { + #[doc = "1: Disconnect"] + DISCONNECTED = 1, + #[doc = "0: Connect"] + CONNECTED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: CONNECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CONNECT` reader - Connection"] +pub struct CONNECT_R(crate::FieldReader); +impl CONNECT_R { + pub(crate) fn new(bits: bool) -> Self { + CONNECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CONNECT_A { + match self.bits { + true => CONNECT_A::DISCONNECTED, + false => CONNECT_A::CONNECTED, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == CONNECT_A::DISCONNECTED + } + #[doc = "Checks if the value of the field is `CONNECTED`"] + #[inline(always)] + pub fn is_connected(&self) -> bool { + **self == CONNECT_A::CONNECTED + } +} +impl core::ops::Deref for CONNECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONNECT` writer - Connection"] +pub struct CONNECT_W<'a> { + w: &'a mut W, +} +impl<'a> CONNECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CONNECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(CONNECT_A::DISCONNECTED) + } + #[doc = "Connect"] + #[inline(always)] + pub fn connected(self) -> &'a mut W { + self.variant(CONNECT_A::CONNECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&self) -> PIN_R { + PIN_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&self) -> CONNECT_R { + CONNECT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&mut self) -> PIN_W { + PIN_W { w: self } + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&mut self) -> CONNECT_W { + CONNECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for CSN signal\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [csn](index.html) module"] +pub struct CSN_SPEC; +impl crate::RegisterSpec for CSN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [csn::R](R) reader structure"] +impl crate::Readable for CSN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [csn::W](W) writer structure"] +impl crate::Writable for CSN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CSN to value 0xffff_ffff"] +impl crate::Resettable for CSN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/spis0/psel/miso.rs b/src/spis0/psel/miso.rs new file mode 100644 index 0000000..d01d145 --- /dev/null +++ b/src/spis0/psel/miso.rs @@ -0,0 +1,195 @@ +#[doc = "Register `MISO` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MISO` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PIN` reader - Pin number"] +pub struct PIN_R(crate::FieldReader); +impl PIN_R { + pub(crate) fn new(bits: u8) -> Self { + PIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN` writer - Pin number"] +pub struct PIN_W<'a> { + w: &'a mut W, +} +impl<'a> PIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Connection\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CONNECT_A { + #[doc = "1: Disconnect"] + DISCONNECTED = 1, + #[doc = "0: Connect"] + CONNECTED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: CONNECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CONNECT` reader - Connection"] +pub struct CONNECT_R(crate::FieldReader); +impl CONNECT_R { + pub(crate) fn new(bits: bool) -> Self { + CONNECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CONNECT_A { + match self.bits { + true => CONNECT_A::DISCONNECTED, + false => CONNECT_A::CONNECTED, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == CONNECT_A::DISCONNECTED + } + #[doc = "Checks if the value of the field is `CONNECTED`"] + #[inline(always)] + pub fn is_connected(&self) -> bool { + **self == CONNECT_A::CONNECTED + } +} +impl core::ops::Deref for CONNECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONNECT` writer - Connection"] +pub struct CONNECT_W<'a> { + w: &'a mut W, +} +impl<'a> CONNECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CONNECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(CONNECT_A::DISCONNECTED) + } + #[doc = "Connect"] + #[inline(always)] + pub fn connected(self) -> &'a mut W { + self.variant(CONNECT_A::CONNECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&self) -> PIN_R { + PIN_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&self) -> CONNECT_R { + CONNECT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&mut self) -> PIN_W { + PIN_W { w: self } + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&mut self) -> CONNECT_W { + CONNECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for MISO signal\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [miso](index.html) module"] +pub struct MISO_SPEC; +impl crate::RegisterSpec for MISO_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [miso::R](R) reader structure"] +impl crate::Readable for MISO_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [miso::W](W) writer structure"] +impl crate::Writable for MISO_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MISO to value 0xffff_ffff"] +impl crate::Resettable for MISO_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/spis0/psel/mosi.rs b/src/spis0/psel/mosi.rs new file mode 100644 index 0000000..d63d254 --- /dev/null +++ b/src/spis0/psel/mosi.rs @@ -0,0 +1,195 @@ +#[doc = "Register `MOSI` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MOSI` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PIN` reader - Pin number"] +pub struct PIN_R(crate::FieldReader); +impl PIN_R { + pub(crate) fn new(bits: u8) -> Self { + PIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN` writer - Pin number"] +pub struct PIN_W<'a> { + w: &'a mut W, +} +impl<'a> PIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Connection\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CONNECT_A { + #[doc = "1: Disconnect"] + DISCONNECTED = 1, + #[doc = "0: Connect"] + CONNECTED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: CONNECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CONNECT` reader - Connection"] +pub struct CONNECT_R(crate::FieldReader); +impl CONNECT_R { + pub(crate) fn new(bits: bool) -> Self { + CONNECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CONNECT_A { + match self.bits { + true => CONNECT_A::DISCONNECTED, + false => CONNECT_A::CONNECTED, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == CONNECT_A::DISCONNECTED + } + #[doc = "Checks if the value of the field is `CONNECTED`"] + #[inline(always)] + pub fn is_connected(&self) -> bool { + **self == CONNECT_A::CONNECTED + } +} +impl core::ops::Deref for CONNECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONNECT` writer - Connection"] +pub struct CONNECT_W<'a> { + w: &'a mut W, +} +impl<'a> CONNECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CONNECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(CONNECT_A::DISCONNECTED) + } + #[doc = "Connect"] + #[inline(always)] + pub fn connected(self) -> &'a mut W { + self.variant(CONNECT_A::CONNECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&self) -> PIN_R { + PIN_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&self) -> CONNECT_R { + CONNECT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&mut self) -> PIN_W { + PIN_W { w: self } + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&mut self) -> CONNECT_W { + CONNECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for MOSI signal\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mosi](index.html) module"] +pub struct MOSI_SPEC; +impl crate::RegisterSpec for MOSI_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mosi::R](R) reader structure"] +impl crate::Readable for MOSI_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mosi::W](W) writer structure"] +impl crate::Writable for MOSI_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MOSI to value 0xffff_ffff"] +impl crate::Resettable for MOSI_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/spis0/psel/sck.rs b/src/spis0/psel/sck.rs new file mode 100644 index 0000000..15f6a67 --- /dev/null +++ b/src/spis0/psel/sck.rs @@ -0,0 +1,195 @@ +#[doc = "Register `SCK` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SCK` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PIN` reader - Pin number"] +pub struct PIN_R(crate::FieldReader); +impl PIN_R { + pub(crate) fn new(bits: u8) -> Self { + PIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN` writer - Pin number"] +pub struct PIN_W<'a> { + w: &'a mut W, +} +impl<'a> PIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Connection\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CONNECT_A { + #[doc = "1: Disconnect"] + DISCONNECTED = 1, + #[doc = "0: Connect"] + CONNECTED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: CONNECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CONNECT` reader - Connection"] +pub struct CONNECT_R(crate::FieldReader); +impl CONNECT_R { + pub(crate) fn new(bits: bool) -> Self { + CONNECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CONNECT_A { + match self.bits { + true => CONNECT_A::DISCONNECTED, + false => CONNECT_A::CONNECTED, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == CONNECT_A::DISCONNECTED + } + #[doc = "Checks if the value of the field is `CONNECTED`"] + #[inline(always)] + pub fn is_connected(&self) -> bool { + **self == CONNECT_A::CONNECTED + } +} +impl core::ops::Deref for CONNECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONNECT` writer - Connection"] +pub struct CONNECT_W<'a> { + w: &'a mut W, +} +impl<'a> CONNECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CONNECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(CONNECT_A::DISCONNECTED) + } + #[doc = "Connect"] + #[inline(always)] + pub fn connected(self) -> &'a mut W { + self.variant(CONNECT_A::CONNECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&self) -> PIN_R { + PIN_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&self) -> CONNECT_R { + CONNECT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&mut self) -> PIN_W { + PIN_W { w: self } + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&mut self) -> CONNECT_W { + CONNECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for SCK\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sck](index.html) module"] +pub struct SCK_SPEC; +impl crate::RegisterSpec for SCK_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sck::R](R) reader structure"] +impl crate::Readable for SCK_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sck::W](W) writer structure"] +impl crate::Writable for SCK_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SCK to value 0xffff_ffff"] +impl crate::Resettable for SCK_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/spis0/rxd.rs b/src/spis0/rxd.rs new file mode 100644 index 0000000..1e60b6d --- /dev/null +++ b/src/spis0/rxd.rs @@ -0,0 +1,12 @@ +#[doc = "PTR register accessor: an alias for `Reg`"] +pub type PTR = crate::Reg; +#[doc = "RXD data pointer"] +pub mod ptr; +#[doc = "MAXCNT register accessor: an alias for `Reg`"] +pub type MAXCNT = crate::Reg; +#[doc = "Maximum number of bytes in receive buffer"] +pub mod maxcnt; +#[doc = "AMOUNT register accessor: an alias for `Reg`"] +pub type AMOUNT = crate::Reg; +#[doc = "Number of bytes received in last granted transaction"] +pub mod amount; diff --git a/src/spis0/rxd/amount.rs b/src/spis0/rxd/amount.rs new file mode 100644 index 0000000..881f71a --- /dev/null +++ b/src/spis0/rxd/amount.rs @@ -0,0 +1,52 @@ +#[doc = "Register `AMOUNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `AMOUNT` reader - Number of bytes received in the last granted transaction"] +pub struct AMOUNT_R(crate::FieldReader); +impl AMOUNT_R { + pub(crate) fn new(bits: u8) -> Self { + AMOUNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AMOUNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:7 - Number of bytes received in the last granted transaction"] + #[inline(always)] + pub fn amount(&self) -> AMOUNT_R { + AMOUNT_R::new((self.bits & 0xff) as u8) + } +} +#[doc = "Number of bytes received in last granted transaction\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 [amount](index.html) module"] +pub struct AMOUNT_SPEC; +impl crate::RegisterSpec for AMOUNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [amount::R](R) reader structure"] +impl crate::Readable for AMOUNT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets AMOUNT to value 0"] +impl crate::Resettable for AMOUNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spis0/rxd/maxcnt.rs b/src/spis0/rxd/maxcnt.rs new file mode 100644 index 0000000..b005494 --- /dev/null +++ b/src/spis0/rxd/maxcnt.rs @@ -0,0 +1,102 @@ +#[doc = "Register `MAXCNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MAXCNT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `MAXCNT` reader - Maximum number of bytes in receive buffer"] +pub struct MAXCNT_R(crate::FieldReader); +impl MAXCNT_R { + pub(crate) fn new(bits: u8) -> Self { + MAXCNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MAXCNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MAXCNT` writer - Maximum number of bytes in receive buffer"] +pub struct MAXCNT_W<'a> { + w: &'a mut W, +} +impl<'a> MAXCNT_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - Maximum number of bytes in receive buffer"] + #[inline(always)] + pub fn maxcnt(&self) -> MAXCNT_R { + MAXCNT_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - Maximum number of bytes in receive buffer"] + #[inline(always)] + pub fn maxcnt(&mut self) -> MAXCNT_W { + MAXCNT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Maximum number of bytes in receive buffer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [maxcnt](index.html) module"] +pub struct MAXCNT_SPEC; +impl crate::RegisterSpec for MAXCNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [maxcnt::R](R) reader structure"] +impl crate::Readable for MAXCNT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [maxcnt::W](W) writer structure"] +impl crate::Writable for MAXCNT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MAXCNT to value 0"] +impl crate::Resettable for MAXCNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spis0/rxd/ptr.rs b/src/spis0/rxd/ptr.rs new file mode 100644 index 0000000..6a022cc --- /dev/null +++ b/src/spis0/rxd/ptr.rs @@ -0,0 +1,102 @@ +#[doc = "Register `PTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PTR` reader - RXD data pointer"] +pub struct PTR_R(crate::FieldReader); +impl PTR_R { + pub(crate) fn new(bits: u32) -> Self { + PTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PTR` writer - RXD data pointer"] +pub struct PTR_W<'a> { + w: &'a mut W, +} +impl<'a> PTR_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - RXD data pointer"] + #[inline(always)] + pub fn ptr(&self) -> PTR_R { + PTR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - RXD data pointer"] + #[inline(always)] + pub fn ptr(&mut self) -> PTR_W { + PTR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "RXD data pointer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ptr](index.html) module"] +pub struct PTR_SPEC; +impl crate::RegisterSpec for PTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ptr::R](R) reader structure"] +impl crate::Readable for PTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ptr::W](W) writer structure"] +impl crate::Writable for PTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PTR to value 0"] +impl crate::Resettable for PTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spis0/semstat.rs b/src/spis0/semstat.rs new file mode 100644 index 0000000..a16b6e4 --- /dev/null +++ b/src/spis0/semstat.rs @@ -0,0 +1,102 @@ +#[doc = "Register `SEMSTAT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Semaphore status\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum SEMSTAT_A { + #[doc = "0: Semaphore is free"] + FREE = 0, + #[doc = "1: Semaphore is assigned to CPU"] + CPU = 1, + #[doc = "2: Semaphore is assigned to SPI slave"] + SPIS = 2, + #[doc = "3: Semaphore is assigned to SPI but a handover to the CPU is pending"] + CPUPENDING = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: SEMSTAT_A) -> Self { + variant as _ + } +} +#[doc = "Field `SEMSTAT` reader - Semaphore status"] +pub struct SEMSTAT_R(crate::FieldReader); +impl SEMSTAT_R { + pub(crate) fn new(bits: u8) -> Self { + SEMSTAT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SEMSTAT_A { + match self.bits { + 0 => SEMSTAT_A::FREE, + 1 => SEMSTAT_A::CPU, + 2 => SEMSTAT_A::SPIS, + 3 => SEMSTAT_A::CPUPENDING, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `FREE`"] + #[inline(always)] + pub fn is_free(&self) -> bool { + **self == SEMSTAT_A::FREE + } + #[doc = "Checks if the value of the field is `CPU`"] + #[inline(always)] + pub fn is_cpu(&self) -> bool { + **self == SEMSTAT_A::CPU + } + #[doc = "Checks if the value of the field is `SPIS`"] + #[inline(always)] + pub fn is_spis(&self) -> bool { + **self == SEMSTAT_A::SPIS + } + #[doc = "Checks if the value of the field is `CPUPENDING`"] + #[inline(always)] + pub fn is_cpupending(&self) -> bool { + **self == SEMSTAT_A::CPUPENDING + } +} +impl core::ops::Deref for SEMSTAT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:1 - Semaphore status"] + #[inline(always)] + pub fn semstat(&self) -> SEMSTAT_R { + SEMSTAT_R::new((self.bits & 0x03) as u8) + } +} +#[doc = "Semaphore status register\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 [semstat](index.html) module"] +pub struct SEMSTAT_SPEC; +impl crate::RegisterSpec for SEMSTAT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [semstat::R](R) reader structure"] +impl crate::Readable for SEMSTAT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets SEMSTAT to value 0x01"] +impl crate::Resettable for SEMSTAT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x01 + } +} diff --git a/src/spis0/shorts.rs b/src/spis0/shorts.rs new file mode 100644 index 0000000..6b05b76 --- /dev/null +++ b/src/spis0/shorts.rs @@ -0,0 +1,159 @@ +#[doc = "Register `SHORTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SHORTS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Shortcut between END event and ACQUIRE task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum END_ACQUIRE_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: END_ACQUIRE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `END_ACQUIRE` reader - Shortcut between END event and ACQUIRE task"] +pub struct END_ACQUIRE_R(crate::FieldReader); +impl END_ACQUIRE_R { + pub(crate) fn new(bits: bool) -> Self { + END_ACQUIRE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> END_ACQUIRE_A { + match self.bits { + false => END_ACQUIRE_A::DISABLED, + true => END_ACQUIRE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == END_ACQUIRE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == END_ACQUIRE_A::ENABLED + } +} +impl core::ops::Deref for END_ACQUIRE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `END_ACQUIRE` writer - Shortcut between END event and ACQUIRE task"] +pub struct END_ACQUIRE_W<'a> { + w: &'a mut W, +} +impl<'a> END_ACQUIRE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: END_ACQUIRE_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(END_ACQUIRE_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(END_ACQUIRE_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +impl R { + #[doc = "Bit 2 - Shortcut between END event and ACQUIRE task"] + #[inline(always)] + pub fn end_acquire(&self) -> END_ACQUIRE_R { + END_ACQUIRE_R::new(((self.bits >> 2) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 2 - Shortcut between END event and ACQUIRE task"] + #[inline(always)] + pub fn end_acquire(&mut self) -> END_ACQUIRE_W { + END_ACQUIRE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Shortcut register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [shorts](index.html) module"] +pub struct SHORTS_SPEC; +impl crate::RegisterSpec for SHORTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [shorts::R](R) reader structure"] +impl crate::Readable for SHORTS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [shorts::W](W) writer structure"] +impl crate::Writable for SHORTS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SHORTS to value 0"] +impl crate::Resettable for SHORTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spis0/status.rs b/src/spis0/status.rs new file mode 100644 index 0000000..a481fe9 --- /dev/null +++ b/src/spis0/status.rs @@ -0,0 +1,266 @@ +#[doc = "Register `STATUS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `STATUS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "TX buffer over-read detected, and prevented\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OVERREAD_A { + #[doc = "0: Read: error not present"] + NOTPRESENT = 0, + #[doc = "1: Read: error present"] + PRESENT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OVERREAD_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OVERREAD` reader - TX buffer over-read detected, and prevented"] +pub struct OVERREAD_R(crate::FieldReader); +impl OVERREAD_R { + pub(crate) fn new(bits: bool) -> Self { + OVERREAD_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> OVERREAD_A { + match self.bits { + false => OVERREAD_A::NOTPRESENT, + true => OVERREAD_A::PRESENT, + } + } + #[doc = "Checks if the value of the field is `NOTPRESENT`"] + #[inline(always)] + pub fn is_not_present(&self) -> bool { + **self == OVERREAD_A::NOTPRESENT + } + #[doc = "Checks if the value of the field is `PRESENT`"] + #[inline(always)] + pub fn is_present(&self) -> bool { + **self == OVERREAD_A::PRESENT + } +} +impl core::ops::Deref for OVERREAD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "TX buffer over-read detected, and prevented\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OVERREAD_AW { + #[doc = "1: Write: clear error on writing '1'"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OVERREAD_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OVERREAD` writer - TX buffer over-read detected, and prevented"] +pub struct OVERREAD_W<'a> { + w: &'a mut W, +} +impl<'a> OVERREAD_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: OVERREAD_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: clear error on writing '1'"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(OVERREAD_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "RX buffer overflow detected, and prevented\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OVERFLOW_A { + #[doc = "0: Read: error not present"] + NOTPRESENT = 0, + #[doc = "1: Read: error present"] + PRESENT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OVERFLOW_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OVERFLOW` reader - RX buffer overflow detected, and prevented"] +pub struct OVERFLOW_R(crate::FieldReader); +impl OVERFLOW_R { + pub(crate) fn new(bits: bool) -> Self { + OVERFLOW_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> OVERFLOW_A { + match self.bits { + false => OVERFLOW_A::NOTPRESENT, + true => OVERFLOW_A::PRESENT, + } + } + #[doc = "Checks if the value of the field is `NOTPRESENT`"] + #[inline(always)] + pub fn is_not_present(&self) -> bool { + **self == OVERFLOW_A::NOTPRESENT + } + #[doc = "Checks if the value of the field is `PRESENT`"] + #[inline(always)] + pub fn is_present(&self) -> bool { + **self == OVERFLOW_A::PRESENT + } +} +impl core::ops::Deref for OVERFLOW_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "RX buffer overflow detected, and prevented\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OVERFLOW_AW { + #[doc = "1: Write: clear error on writing '1'"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OVERFLOW_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OVERFLOW` writer - RX buffer overflow detected, and prevented"] +pub struct OVERFLOW_W<'a> { + w: &'a mut W, +} +impl<'a> OVERFLOW_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: OVERFLOW_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: clear error on writing '1'"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(OVERFLOW_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +impl R { + #[doc = "Bit 0 - TX buffer over-read detected, and prevented"] + #[inline(always)] + pub fn overread(&self) -> OVERREAD_R { + OVERREAD_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - RX buffer overflow detected, and prevented"] + #[inline(always)] + pub fn overflow(&self) -> OVERFLOW_R { + OVERFLOW_R::new(((self.bits >> 1) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - TX buffer over-read detected, and prevented"] + #[inline(always)] + pub fn overread(&mut self) -> OVERREAD_W { + OVERREAD_W { w: self } + } + #[doc = "Bit 1 - RX buffer overflow detected, and prevented"] + #[inline(always)] + pub fn overflow(&mut self) -> OVERFLOW_W { + OVERFLOW_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Status from last transaction\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [status](index.html) module"] +pub struct STATUS_SPEC; +impl crate::RegisterSpec for STATUS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [status::R](R) reader structure"] +impl crate::Readable for STATUS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [status::W](W) writer structure"] +impl crate::Writable for STATUS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets STATUS to value 0"] +impl crate::Resettable for STATUS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spis0/tasks_acquire.rs b/src/spis0/tasks_acquire.rs new file mode 100644 index 0000000..fe18094 --- /dev/null +++ b/src/spis0/tasks_acquire.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_ACQUIRE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Acquire SPI semaphore\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_acquire](index.html) module"] +pub struct TASKS_ACQUIRE_SPEC; +impl crate::RegisterSpec for TASKS_ACQUIRE_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_acquire::W](W) writer structure"] +impl crate::Writable for TASKS_ACQUIRE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_ACQUIRE to value 0"] +impl crate::Resettable for TASKS_ACQUIRE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spis0/tasks_release.rs b/src/spis0/tasks_release.rs new file mode 100644 index 0000000..e0ee70b --- /dev/null +++ b/src/spis0/tasks_release.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_RELEASE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Release SPI semaphore, enabling the SPI slave to acquire it\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_release](index.html) module"] +pub struct TASKS_RELEASE_SPEC; +impl crate::RegisterSpec for TASKS_RELEASE_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_release::W](W) writer structure"] +impl crate::Writable for TASKS_RELEASE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_RELEASE to value 0"] +impl crate::Resettable for TASKS_RELEASE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spis0/txd.rs b/src/spis0/txd.rs new file mode 100644 index 0000000..6f12216 --- /dev/null +++ b/src/spis0/txd.rs @@ -0,0 +1,12 @@ +#[doc = "PTR register accessor: an alias for `Reg`"] +pub type PTR = crate::Reg; +#[doc = "TXD data pointer"] +pub mod ptr; +#[doc = "MAXCNT register accessor: an alias for `Reg`"] +pub type MAXCNT = crate::Reg; +#[doc = "Maximum number of bytes in transmit buffer"] +pub mod maxcnt; +#[doc = "AMOUNT register accessor: an alias for `Reg`"] +pub type AMOUNT = crate::Reg; +#[doc = "Number of bytes transmitted in last granted transaction"] +pub mod amount; diff --git a/src/spis0/txd/amount.rs b/src/spis0/txd/amount.rs new file mode 100644 index 0000000..4b56cad --- /dev/null +++ b/src/spis0/txd/amount.rs @@ -0,0 +1,52 @@ +#[doc = "Register `AMOUNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `AMOUNT` reader - Number of bytes transmitted in last granted transaction"] +pub struct AMOUNT_R(crate::FieldReader); +impl AMOUNT_R { + pub(crate) fn new(bits: u8) -> Self { + AMOUNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AMOUNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:7 - Number of bytes transmitted in last granted transaction"] + #[inline(always)] + pub fn amount(&self) -> AMOUNT_R { + AMOUNT_R::new((self.bits & 0xff) as u8) + } +} +#[doc = "Number of bytes transmitted in last granted transaction\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 [amount](index.html) module"] +pub struct AMOUNT_SPEC; +impl crate::RegisterSpec for AMOUNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [amount::R](R) reader structure"] +impl crate::Readable for AMOUNT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets AMOUNT to value 0"] +impl crate::Resettable for AMOUNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spis0/txd/maxcnt.rs b/src/spis0/txd/maxcnt.rs new file mode 100644 index 0000000..c9a377b --- /dev/null +++ b/src/spis0/txd/maxcnt.rs @@ -0,0 +1,102 @@ +#[doc = "Register `MAXCNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MAXCNT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `MAXCNT` reader - Maximum number of bytes in transmit buffer"] +pub struct MAXCNT_R(crate::FieldReader); +impl MAXCNT_R { + pub(crate) fn new(bits: u8) -> Self { + MAXCNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MAXCNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MAXCNT` writer - Maximum number of bytes in transmit buffer"] +pub struct MAXCNT_W<'a> { + w: &'a mut W, +} +impl<'a> MAXCNT_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - Maximum number of bytes in transmit buffer"] + #[inline(always)] + pub fn maxcnt(&self) -> MAXCNT_R { + MAXCNT_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - Maximum number of bytes in transmit buffer"] + #[inline(always)] + pub fn maxcnt(&mut self) -> MAXCNT_W { + MAXCNT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Maximum number of bytes in transmit buffer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [maxcnt](index.html) module"] +pub struct MAXCNT_SPEC; +impl crate::RegisterSpec for MAXCNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [maxcnt::R](R) reader structure"] +impl crate::Readable for MAXCNT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [maxcnt::W](W) writer structure"] +impl crate::Writable for MAXCNT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MAXCNT to value 0"] +impl crate::Resettable for MAXCNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/spis0/txd/ptr.rs b/src/spis0/txd/ptr.rs new file mode 100644 index 0000000..ccf8e57 --- /dev/null +++ b/src/spis0/txd/ptr.rs @@ -0,0 +1,102 @@ +#[doc = "Register `PTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PTR` reader - TXD data pointer"] +pub struct PTR_R(crate::FieldReader); +impl PTR_R { + pub(crate) fn new(bits: u32) -> Self { + PTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PTR` writer - TXD data pointer"] +pub struct PTR_W<'a> { + w: &'a mut W, +} +impl<'a> PTR_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - TXD data pointer"] + #[inline(always)] + pub fn ptr(&self) -> PTR_R { + PTR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - TXD data pointer"] + #[inline(always)] + pub fn ptr(&mut self) -> PTR_W { + PTR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "TXD data pointer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ptr](index.html) module"] +pub struct PTR_SPEC; +impl crate::RegisterSpec for PTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ptr::R](R) reader structure"] +impl crate::Readable for PTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ptr::W](W) writer structure"] +impl crate::Writable for PTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PTR to value 0"] +impl crate::Resettable for PTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/swi0.rs b/src/swi0.rs new file mode 100644 index 0000000..681f0c7 --- /dev/null +++ b/src/swi0.rs @@ -0,0 +1,10 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "0x00 - Unused."] + pub unused: crate::Reg, +} +#[doc = "UNUSED register accessor: an alias for `Reg`"] +pub type UNUSED = crate::Reg; +#[doc = "Unused."] +pub mod unused; diff --git a/src/swi0/unused.rs b/src/swi0/unused.rs new file mode 100644 index 0000000..fe6dc9f --- /dev/null +++ b/src/swi0/unused.rs @@ -0,0 +1,31 @@ +#[doc = "Register `UNUSED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Unused.\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 [unused](index.html) module"] +pub struct UNUSED_SPEC; +impl crate::RegisterSpec for UNUSED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [unused::R](R) reader structure"] +impl crate::Readable for UNUSED_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets UNUSED to value 0"] +impl crate::Resettable for UNUSED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/temp.rs b/src/temp.rs new file mode 100644 index 0000000..c6dbbf5 --- /dev/null +++ b/src/temp.rs @@ -0,0 +1,148 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "0x00 - Start temperature measurement"] + pub tasks_start: crate::Reg, + #[doc = "0x04 - Stop temperature measurement"] + pub tasks_stop: crate::Reg, + _reserved2: [u8; 0xf8], + #[doc = "0x100 - Temperature measurement complete, data ready"] + pub events_datardy: crate::Reg, + _reserved3: [u8; 0x0200], + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved5: [u8; 0x01fc], + #[doc = "0x508 - Temperature in degC (0.25deg steps)"] + pub temp: crate::Reg, + _reserved6: [u8; 0x14], + #[doc = "0x520 - Slope of 1st piece wise linear function"] + pub a0: crate::Reg, + #[doc = "0x524 - Slope of 2nd piece wise linear function"] + pub a1: crate::Reg, + #[doc = "0x528 - Slope of 3rd piece wise linear function"] + pub a2: crate::Reg, + #[doc = "0x52c - Slope of 4th piece wise linear function"] + pub a3: crate::Reg, + #[doc = "0x530 - Slope of 5th piece wise linear function"] + pub a4: crate::Reg, + #[doc = "0x534 - Slope of 6th piece wise linear function"] + pub a5: crate::Reg, + _reserved12: [u8; 0x08], + #[doc = "0x540 - y-intercept of 1st piece wise linear function"] + pub b0: crate::Reg, + #[doc = "0x544 - y-intercept of 2nd piece wise linear function"] + pub b1: crate::Reg, + #[doc = "0x548 - y-intercept of 3rd piece wise linear function"] + pub b2: crate::Reg, + #[doc = "0x54c - y-intercept of 4th piece wise linear function"] + pub b3: crate::Reg, + #[doc = "0x550 - y-intercept of 5th piece wise linear function"] + pub b4: crate::Reg, + #[doc = "0x554 - y-intercept of 6th piece wise linear function"] + pub b5: crate::Reg, + _reserved18: [u8; 0x08], + #[doc = "0x560 - End point of 1st piece wise linear function"] + pub t0: crate::Reg, + #[doc = "0x564 - End point of 2nd piece wise linear function"] + pub t1: crate::Reg, + #[doc = "0x568 - End point of 3rd piece wise linear function"] + pub t2: crate::Reg, + #[doc = "0x56c - End point of 4th piece wise linear function"] + pub t3: crate::Reg, + #[doc = "0x570 - End point of 5th piece wise linear function"] + pub t4: crate::Reg, +} +#[doc = "TASKS_START register accessor: an alias for `Reg`"] +pub type TASKS_START = crate::Reg; +#[doc = "Start temperature measurement"] +pub mod tasks_start; +#[doc = "TASKS_STOP register accessor: an alias for `Reg`"] +pub type TASKS_STOP = crate::Reg; +#[doc = "Stop temperature measurement"] +pub mod tasks_stop; +#[doc = "EVENTS_DATARDY register accessor: an alias for `Reg`"] +pub type EVENTS_DATARDY = crate::Reg; +#[doc = "Temperature measurement complete, data ready"] +pub mod events_datardy; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "TEMP register accessor: an alias for `Reg`"] +pub type TEMP = crate::Reg; +#[doc = "Temperature in degC (0.25deg steps)"] +pub mod temp; +#[doc = "A0 register accessor: an alias for `Reg`"] +pub type A0 = crate::Reg; +#[doc = "Slope of 1st piece wise linear function"] +pub mod a0; +#[doc = "A1 register accessor: an alias for `Reg`"] +pub type A1 = crate::Reg; +#[doc = "Slope of 2nd piece wise linear function"] +pub mod a1; +#[doc = "A2 register accessor: an alias for `Reg`"] +pub type A2 = crate::Reg; +#[doc = "Slope of 3rd piece wise linear function"] +pub mod a2; +#[doc = "A3 register accessor: an alias for `Reg`"] +pub type A3 = crate::Reg; +#[doc = "Slope of 4th piece wise linear function"] +pub mod a3; +#[doc = "A4 register accessor: an alias for `Reg`"] +pub type A4 = crate::Reg; +#[doc = "Slope of 5th piece wise linear function"] +pub mod a4; +#[doc = "A5 register accessor: an alias for `Reg`"] +pub type A5 = crate::Reg; +#[doc = "Slope of 6th piece wise linear function"] +pub mod a5; +#[doc = "B0 register accessor: an alias for `Reg`"] +pub type B0 = crate::Reg; +#[doc = "y-intercept of 1st piece wise linear function"] +pub mod b0; +#[doc = "B1 register accessor: an alias for `Reg`"] +pub type B1 = crate::Reg; +#[doc = "y-intercept of 2nd piece wise linear function"] +pub mod b1; +#[doc = "B2 register accessor: an alias for `Reg`"] +pub type B2 = crate::Reg; +#[doc = "y-intercept of 3rd piece wise linear function"] +pub mod b2; +#[doc = "B3 register accessor: an alias for `Reg`"] +pub type B3 = crate::Reg; +#[doc = "y-intercept of 4th piece wise linear function"] +pub mod b3; +#[doc = "B4 register accessor: an alias for `Reg`"] +pub type B4 = crate::Reg; +#[doc = "y-intercept of 5th piece wise linear function"] +pub mod b4; +#[doc = "B5 register accessor: an alias for `Reg`"] +pub type B5 = crate::Reg; +#[doc = "y-intercept of 6th piece wise linear function"] +pub mod b5; +#[doc = "T0 register accessor: an alias for `Reg`"] +pub type T0 = crate::Reg; +#[doc = "End point of 1st piece wise linear function"] +pub mod t0; +#[doc = "T1 register accessor: an alias for `Reg`"] +pub type T1 = crate::Reg; +#[doc = "End point of 2nd piece wise linear function"] +pub mod t1; +#[doc = "T2 register accessor: an alias for `Reg`"] +pub type T2 = crate::Reg; +#[doc = "End point of 3rd piece wise linear function"] +pub mod t2; +#[doc = "T3 register accessor: an alias for `Reg`"] +pub type T3 = crate::Reg; +#[doc = "End point of 4th piece wise linear function"] +pub mod t3; +#[doc = "T4 register accessor: an alias for `Reg`"] +pub type T4 = crate::Reg; +#[doc = "End point of 5th piece wise linear function"] +pub mod t4; diff --git a/src/temp/a0.rs b/src/temp/a0.rs new file mode 100644 index 0000000..71e72e7 --- /dev/null +++ b/src/temp/a0.rs @@ -0,0 +1,102 @@ +#[doc = "Register `A0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `A0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `A0` reader - Slope of 1st piece wise linear function"] +pub struct A0_R(crate::FieldReader); +impl A0_R { + pub(crate) fn new(bits: u16) -> Self { + A0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for A0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `A0` writer - Slope of 1st piece wise linear function"] +pub struct A0_W<'a> { + w: &'a mut W, +} +impl<'a> A0_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !0x0fff) | (value as u32 & 0x0fff); + self.w + } +} +impl R { + #[doc = "Bits 0:11 - Slope of 1st piece wise linear function"] + #[inline(always)] + pub fn a0(&self) -> A0_R { + A0_R::new((self.bits & 0x0fff) as u16) + } +} +impl W { + #[doc = "Bits 0:11 - Slope of 1st piece wise linear function"] + #[inline(always)] + pub fn a0(&mut self) -> A0_W { + A0_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Slope of 1st piece wise linear function\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [a0](index.html) module"] +pub struct A0_SPEC; +impl crate::RegisterSpec for A0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [a0::R](R) reader structure"] +impl crate::Readable for A0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [a0::W](W) writer structure"] +impl crate::Writable for A0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets A0 to value 0x0320"] +impl crate::Resettable for A0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0320 + } +} diff --git a/src/temp/a1.rs b/src/temp/a1.rs new file mode 100644 index 0000000..85d64ad --- /dev/null +++ b/src/temp/a1.rs @@ -0,0 +1,102 @@ +#[doc = "Register `A1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `A1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `A1` reader - Slope of 2nd piece wise linear function"] +pub struct A1_R(crate::FieldReader); +impl A1_R { + pub(crate) fn new(bits: u16) -> Self { + A1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for A1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `A1` writer - Slope of 2nd piece wise linear function"] +pub struct A1_W<'a> { + w: &'a mut W, +} +impl<'a> A1_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !0x0fff) | (value as u32 & 0x0fff); + self.w + } +} +impl R { + #[doc = "Bits 0:11 - Slope of 2nd piece wise linear function"] + #[inline(always)] + pub fn a1(&self) -> A1_R { + A1_R::new((self.bits & 0x0fff) as u16) + } +} +impl W { + #[doc = "Bits 0:11 - Slope of 2nd piece wise linear function"] + #[inline(always)] + pub fn a1(&mut self) -> A1_W { + A1_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Slope of 2nd piece wise linear function\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [a1](index.html) module"] +pub struct A1_SPEC; +impl crate::RegisterSpec for A1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [a1::R](R) reader structure"] +impl crate::Readable for A1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [a1::W](W) writer structure"] +impl crate::Writable for A1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets A1 to value 0x0343"] +impl crate::Resettable for A1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0343 + } +} diff --git a/src/temp/a2.rs b/src/temp/a2.rs new file mode 100644 index 0000000..2c55b33 --- /dev/null +++ b/src/temp/a2.rs @@ -0,0 +1,102 @@ +#[doc = "Register `A2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `A2` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `A2` reader - Slope of 3rd piece wise linear function"] +pub struct A2_R(crate::FieldReader); +impl A2_R { + pub(crate) fn new(bits: u16) -> Self { + A2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for A2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `A2` writer - Slope of 3rd piece wise linear function"] +pub struct A2_W<'a> { + w: &'a mut W, +} +impl<'a> A2_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !0x0fff) | (value as u32 & 0x0fff); + self.w + } +} +impl R { + #[doc = "Bits 0:11 - Slope of 3rd piece wise linear function"] + #[inline(always)] + pub fn a2(&self) -> A2_R { + A2_R::new((self.bits & 0x0fff) as u16) + } +} +impl W { + #[doc = "Bits 0:11 - Slope of 3rd piece wise linear function"] + #[inline(always)] + pub fn a2(&mut self) -> A2_W { + A2_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Slope of 3rd piece wise linear function\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [a2](index.html) module"] +pub struct A2_SPEC; +impl crate::RegisterSpec for A2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [a2::R](R) reader structure"] +impl crate::Readable for A2_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [a2::W](W) writer structure"] +impl crate::Writable for A2_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets A2 to value 0x035d"] +impl crate::Resettable for A2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x035d + } +} diff --git a/src/temp/a3.rs b/src/temp/a3.rs new file mode 100644 index 0000000..df5eb7c --- /dev/null +++ b/src/temp/a3.rs @@ -0,0 +1,102 @@ +#[doc = "Register `A3` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `A3` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `A3` reader - Slope of 4th piece wise linear function"] +pub struct A3_R(crate::FieldReader); +impl A3_R { + pub(crate) fn new(bits: u16) -> Self { + A3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for A3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `A3` writer - Slope of 4th piece wise linear function"] +pub struct A3_W<'a> { + w: &'a mut W, +} +impl<'a> A3_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !0x0fff) | (value as u32 & 0x0fff); + self.w + } +} +impl R { + #[doc = "Bits 0:11 - Slope of 4th piece wise linear function"] + #[inline(always)] + pub fn a3(&self) -> A3_R { + A3_R::new((self.bits & 0x0fff) as u16) + } +} +impl W { + #[doc = "Bits 0:11 - Slope of 4th piece wise linear function"] + #[inline(always)] + pub fn a3(&mut self) -> A3_W { + A3_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Slope of 4th piece wise linear function\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [a3](index.html) module"] +pub struct A3_SPEC; +impl crate::RegisterSpec for A3_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [a3::R](R) reader structure"] +impl crate::Readable for A3_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [a3::W](W) writer structure"] +impl crate::Writable for A3_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets A3 to value 0x0400"] +impl crate::Resettable for A3_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0400 + } +} diff --git a/src/temp/a4.rs b/src/temp/a4.rs new file mode 100644 index 0000000..ccd9ffe --- /dev/null +++ b/src/temp/a4.rs @@ -0,0 +1,102 @@ +#[doc = "Register `A4` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `A4` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `A4` reader - Slope of 5th piece wise linear function"] +pub struct A4_R(crate::FieldReader); +impl A4_R { + pub(crate) fn new(bits: u16) -> Self { + A4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for A4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `A4` writer - Slope of 5th piece wise linear function"] +pub struct A4_W<'a> { + w: &'a mut W, +} +impl<'a> A4_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !0x0fff) | (value as u32 & 0x0fff); + self.w + } +} +impl R { + #[doc = "Bits 0:11 - Slope of 5th piece wise linear function"] + #[inline(always)] + pub fn a4(&self) -> A4_R { + A4_R::new((self.bits & 0x0fff) as u16) + } +} +impl W { + #[doc = "Bits 0:11 - Slope of 5th piece wise linear function"] + #[inline(always)] + pub fn a4(&mut self) -> A4_W { + A4_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Slope of 5th piece wise linear function\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [a4](index.html) module"] +pub struct A4_SPEC; +impl crate::RegisterSpec for A4_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [a4::R](R) reader structure"] +impl crate::Readable for A4_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [a4::W](W) writer structure"] +impl crate::Writable for A4_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets A4 to value 0x047f"] +impl crate::Resettable for A4_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x047f + } +} diff --git a/src/temp/a5.rs b/src/temp/a5.rs new file mode 100644 index 0000000..d14f539 --- /dev/null +++ b/src/temp/a5.rs @@ -0,0 +1,102 @@ +#[doc = "Register `A5` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `A5` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `A5` reader - Slope of 6th piece wise linear function"] +pub struct A5_R(crate::FieldReader); +impl A5_R { + pub(crate) fn new(bits: u16) -> Self { + A5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for A5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `A5` writer - Slope of 6th piece wise linear function"] +pub struct A5_W<'a> { + w: &'a mut W, +} +impl<'a> A5_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !0x0fff) | (value as u32 & 0x0fff); + self.w + } +} +impl R { + #[doc = "Bits 0:11 - Slope of 6th piece wise linear function"] + #[inline(always)] + pub fn a5(&self) -> A5_R { + A5_R::new((self.bits & 0x0fff) as u16) + } +} +impl W { + #[doc = "Bits 0:11 - Slope of 6th piece wise linear function"] + #[inline(always)] + pub fn a5(&mut self) -> A5_W { + A5_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Slope of 6th piece wise linear function\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [a5](index.html) module"] +pub struct A5_SPEC; +impl crate::RegisterSpec for A5_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [a5::R](R) reader structure"] +impl crate::Readable for A5_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [a5::W](W) writer structure"] +impl crate::Writable for A5_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets A5 to value 0x037b"] +impl crate::Resettable for A5_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x037b + } +} diff --git a/src/temp/b0.rs b/src/temp/b0.rs new file mode 100644 index 0000000..082e87b --- /dev/null +++ b/src/temp/b0.rs @@ -0,0 +1,102 @@ +#[doc = "Register `B0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `B0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `B0` reader - y-intercept of 1st piece wise linear function"] +pub struct B0_R(crate::FieldReader); +impl B0_R { + pub(crate) fn new(bits: u16) -> Self { + B0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for B0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `B0` writer - y-intercept of 1st piece wise linear function"] +pub struct B0_W<'a> { + w: &'a mut W, +} +impl<'a> B0_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !0x3fff) | (value as u32 & 0x3fff); + self.w + } +} +impl R { + #[doc = "Bits 0:13 - y-intercept of 1st piece wise linear function"] + #[inline(always)] + pub fn b0(&self) -> B0_R { + B0_R::new((self.bits & 0x3fff) as u16) + } +} +impl W { + #[doc = "Bits 0:13 - y-intercept of 1st piece wise linear function"] + #[inline(always)] + pub fn b0(&mut self) -> B0_W { + B0_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "y-intercept of 1st piece wise linear function\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [b0](index.html) module"] +pub struct B0_SPEC; +impl crate::RegisterSpec for B0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [b0::R](R) reader structure"] +impl crate::Readable for B0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [b0::W](W) writer structure"] +impl crate::Writable for B0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets B0 to value 0x3fcc"] +impl crate::Resettable for B0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x3fcc + } +} diff --git a/src/temp/b1.rs b/src/temp/b1.rs new file mode 100644 index 0000000..1f7809d --- /dev/null +++ b/src/temp/b1.rs @@ -0,0 +1,102 @@ +#[doc = "Register `B1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `B1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `B1` reader - y-intercept of 2nd piece wise linear function"] +pub struct B1_R(crate::FieldReader); +impl B1_R { + pub(crate) fn new(bits: u16) -> Self { + B1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for B1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `B1` writer - y-intercept of 2nd piece wise linear function"] +pub struct B1_W<'a> { + w: &'a mut W, +} +impl<'a> B1_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !0x3fff) | (value as u32 & 0x3fff); + self.w + } +} +impl R { + #[doc = "Bits 0:13 - y-intercept of 2nd piece wise linear function"] + #[inline(always)] + pub fn b1(&self) -> B1_R { + B1_R::new((self.bits & 0x3fff) as u16) + } +} +impl W { + #[doc = "Bits 0:13 - y-intercept of 2nd piece wise linear function"] + #[inline(always)] + pub fn b1(&mut self) -> B1_W { + B1_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "y-intercept of 2nd piece wise linear function\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [b1](index.html) module"] +pub struct B1_SPEC; +impl crate::RegisterSpec for B1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [b1::R](R) reader structure"] +impl crate::Readable for B1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [b1::W](W) writer structure"] +impl crate::Writable for B1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets B1 to value 0x3f98"] +impl crate::Resettable for B1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x3f98 + } +} diff --git a/src/temp/b2.rs b/src/temp/b2.rs new file mode 100644 index 0000000..4b26f39 --- /dev/null +++ b/src/temp/b2.rs @@ -0,0 +1,102 @@ +#[doc = "Register `B2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `B2` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `B2` reader - y-intercept of 3rd piece wise linear function"] +pub struct B2_R(crate::FieldReader); +impl B2_R { + pub(crate) fn new(bits: u16) -> Self { + B2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for B2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `B2` writer - y-intercept of 3rd piece wise linear function"] +pub struct B2_W<'a> { + w: &'a mut W, +} +impl<'a> B2_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !0x3fff) | (value as u32 & 0x3fff); + self.w + } +} +impl R { + #[doc = "Bits 0:13 - y-intercept of 3rd piece wise linear function"] + #[inline(always)] + pub fn b2(&self) -> B2_R { + B2_R::new((self.bits & 0x3fff) as u16) + } +} +impl W { + #[doc = "Bits 0:13 - y-intercept of 3rd piece wise linear function"] + #[inline(always)] + pub fn b2(&mut self) -> B2_W { + B2_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "y-intercept of 3rd piece wise linear function\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [b2](index.html) module"] +pub struct B2_SPEC; +impl crate::RegisterSpec for B2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [b2::R](R) reader structure"] +impl crate::Readable for B2_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [b2::W](W) writer structure"] +impl crate::Writable for B2_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets B2 to value 0x3f98"] +impl crate::Resettable for B2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x3f98 + } +} diff --git a/src/temp/b3.rs b/src/temp/b3.rs new file mode 100644 index 0000000..c851d6c --- /dev/null +++ b/src/temp/b3.rs @@ -0,0 +1,102 @@ +#[doc = "Register `B3` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `B3` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `B3` reader - y-intercept of 4th piece wise linear function"] +pub struct B3_R(crate::FieldReader); +impl B3_R { + pub(crate) fn new(bits: u16) -> Self { + B3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for B3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `B3` writer - y-intercept of 4th piece wise linear function"] +pub struct B3_W<'a> { + w: &'a mut W, +} +impl<'a> B3_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !0x3fff) | (value as u32 & 0x3fff); + self.w + } +} +impl R { + #[doc = "Bits 0:13 - y-intercept of 4th piece wise linear function"] + #[inline(always)] + pub fn b3(&self) -> B3_R { + B3_R::new((self.bits & 0x3fff) as u16) + } +} +impl W { + #[doc = "Bits 0:13 - y-intercept of 4th piece wise linear function"] + #[inline(always)] + pub fn b3(&mut self) -> B3_W { + B3_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "y-intercept of 4th piece wise linear function\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [b3](index.html) module"] +pub struct B3_SPEC; +impl crate::RegisterSpec for B3_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [b3::R](R) reader structure"] +impl crate::Readable for B3_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [b3::W](W) writer structure"] +impl crate::Writable for B3_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets B3 to value 0x12"] +impl crate::Resettable for B3_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x12 + } +} diff --git a/src/temp/b4.rs b/src/temp/b4.rs new file mode 100644 index 0000000..4d4ec70 --- /dev/null +++ b/src/temp/b4.rs @@ -0,0 +1,102 @@ +#[doc = "Register `B4` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `B4` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `B4` reader - y-intercept of 5th piece wise linear function"] +pub struct B4_R(crate::FieldReader); +impl B4_R { + pub(crate) fn new(bits: u16) -> Self { + B4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for B4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `B4` writer - y-intercept of 5th piece wise linear function"] +pub struct B4_W<'a> { + w: &'a mut W, +} +impl<'a> B4_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !0x3fff) | (value as u32 & 0x3fff); + self.w + } +} +impl R { + #[doc = "Bits 0:13 - y-intercept of 5th piece wise linear function"] + #[inline(always)] + pub fn b4(&self) -> B4_R { + B4_R::new((self.bits & 0x3fff) as u16) + } +} +impl W { + #[doc = "Bits 0:13 - y-intercept of 5th piece wise linear function"] + #[inline(always)] + pub fn b4(&mut self) -> B4_W { + B4_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "y-intercept of 5th piece wise linear function\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [b4](index.html) module"] +pub struct B4_SPEC; +impl crate::RegisterSpec for B4_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [b4::R](R) reader structure"] +impl crate::Readable for B4_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [b4::W](W) writer structure"] +impl crate::Writable for B4_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets B4 to value 0x6a"] +impl crate::Resettable for B4_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x6a + } +} diff --git a/src/temp/b5.rs b/src/temp/b5.rs new file mode 100644 index 0000000..df72564 --- /dev/null +++ b/src/temp/b5.rs @@ -0,0 +1,102 @@ +#[doc = "Register `B5` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `B5` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `B5` reader - y-intercept of 6th piece wise linear function"] +pub struct B5_R(crate::FieldReader); +impl B5_R { + pub(crate) fn new(bits: u16) -> Self { + B5_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for B5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `B5` writer - y-intercept of 6th piece wise linear function"] +pub struct B5_W<'a> { + w: &'a mut W, +} +impl<'a> B5_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u16) -> &'a mut W { + self.w.bits = (self.w.bits & !0x3fff) | (value as u32 & 0x3fff); + self.w + } +} +impl R { + #[doc = "Bits 0:13 - y-intercept of 6th piece wise linear function"] + #[inline(always)] + pub fn b5(&self) -> B5_R { + B5_R::new((self.bits & 0x3fff) as u16) + } +} +impl W { + #[doc = "Bits 0:13 - y-intercept of 6th piece wise linear function"] + #[inline(always)] + pub fn b5(&mut self) -> B5_W { + B5_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "y-intercept of 6th piece wise linear function\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [b5](index.html) module"] +pub struct B5_SPEC; +impl crate::RegisterSpec for B5_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [b5::R](R) reader structure"] +impl crate::Readable for B5_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [b5::W](W) writer structure"] +impl crate::Writable for B5_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets B5 to value 0x3dd0"] +impl crate::Resettable for B5_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x3dd0 + } +} diff --git a/src/temp/events_datardy.rs b/src/temp/events_datardy.rs new file mode 100644 index 0000000..ffc5cd4 --- /dev/null +++ b/src/temp/events_datardy.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_DATARDY` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_DATARDY` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Temperature measurement complete, data ready\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_datardy](index.html) module"] +pub struct EVENTS_DATARDY_SPEC; +impl crate::RegisterSpec for EVENTS_DATARDY_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_datardy::R](R) reader structure"] +impl crate::Readable for EVENTS_DATARDY_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_datardy::W](W) writer structure"] +impl crate::Writable for EVENTS_DATARDY_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_DATARDY to value 0"] +impl crate::Resettable for EVENTS_DATARDY_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/temp/intenclr.rs b/src/temp/intenclr.rs new file mode 100644 index 0000000..0b5471b --- /dev/null +++ b/src/temp/intenclr.rs @@ -0,0 +1,166 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for DATARDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DATARDY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DATARDY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DATARDY` reader - Write '1' to Disable interrupt for DATARDY event"] +pub struct DATARDY_R(crate::FieldReader); +impl DATARDY_R { + pub(crate) fn new(bits: bool) -> Self { + DATARDY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DATARDY_A { + match self.bits { + false => DATARDY_A::DISABLED, + true => DATARDY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DATARDY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DATARDY_A::ENABLED + } +} +impl core::ops::Deref for DATARDY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for DATARDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DATARDY_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DATARDY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DATARDY` writer - Write '1' to Disable interrupt for DATARDY event"] +pub struct DATARDY_W<'a> { + w: &'a mut W, +} +impl<'a> DATARDY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DATARDY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(DATARDY_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Disable interrupt for DATARDY event"] + #[inline(always)] + pub fn datardy(&self) -> DATARDY_R { + DATARDY_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Disable interrupt for DATARDY event"] + #[inline(always)] + pub fn datardy(&mut self) -> DATARDY_W { + DATARDY_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/temp/intenset.rs b/src/temp/intenset.rs new file mode 100644 index 0000000..956b749 --- /dev/null +++ b/src/temp/intenset.rs @@ -0,0 +1,166 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for DATARDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DATARDY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DATARDY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DATARDY` reader - Write '1' to Enable interrupt for DATARDY event"] +pub struct DATARDY_R(crate::FieldReader); +impl DATARDY_R { + pub(crate) fn new(bits: bool) -> Self { + DATARDY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DATARDY_A { + match self.bits { + false => DATARDY_A::DISABLED, + true => DATARDY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == DATARDY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == DATARDY_A::ENABLED + } +} +impl core::ops::Deref for DATARDY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for DATARDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DATARDY_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DATARDY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DATARDY` writer - Write '1' to Enable interrupt for DATARDY event"] +pub struct DATARDY_W<'a> { + w: &'a mut W, +} +impl<'a> DATARDY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DATARDY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(DATARDY_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Enable interrupt for DATARDY event"] + #[inline(always)] + pub fn datardy(&self) -> DATARDY_R { + DATARDY_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Enable interrupt for DATARDY event"] + #[inline(always)] + pub fn datardy(&mut self) -> DATARDY_W { + DATARDY_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/temp/t0.rs b/src/temp/t0.rs new file mode 100644 index 0000000..d52a268 --- /dev/null +++ b/src/temp/t0.rs @@ -0,0 +1,102 @@ +#[doc = "Register `T0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `T0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `T0` reader - End point of 1st piece wise linear function"] +pub struct T0_R(crate::FieldReader); +impl T0_R { + pub(crate) fn new(bits: u8) -> Self { + T0_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for T0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `T0` writer - End point of 1st piece wise linear function"] +pub struct T0_W<'a> { + w: &'a mut W, +} +impl<'a> T0_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - End point of 1st piece wise linear function"] + #[inline(always)] + pub fn t0(&self) -> T0_R { + T0_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - End point of 1st piece wise linear function"] + #[inline(always)] + pub fn t0(&mut self) -> T0_W { + T0_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "End point of 1st piece wise linear function\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [t0](index.html) module"] +pub struct T0_SPEC; +impl crate::RegisterSpec for T0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [t0::R](R) reader structure"] +impl crate::Readable for T0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [t0::W](W) writer structure"] +impl crate::Writable for T0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets T0 to value 0xe2"] +impl crate::Resettable for T0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xe2 + } +} diff --git a/src/temp/t1.rs b/src/temp/t1.rs new file mode 100644 index 0000000..f953eda --- /dev/null +++ b/src/temp/t1.rs @@ -0,0 +1,102 @@ +#[doc = "Register `T1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `T1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `T1` reader - End point of 2nd piece wise linear function"] +pub struct T1_R(crate::FieldReader); +impl T1_R { + pub(crate) fn new(bits: u8) -> Self { + T1_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for T1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `T1` writer - End point of 2nd piece wise linear function"] +pub struct T1_W<'a> { + w: &'a mut W, +} +impl<'a> T1_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - End point of 2nd piece wise linear function"] + #[inline(always)] + pub fn t1(&self) -> T1_R { + T1_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - End point of 2nd piece wise linear function"] + #[inline(always)] + pub fn t1(&mut self) -> T1_W { + T1_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "End point of 2nd piece wise linear function\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [t1](index.html) module"] +pub struct T1_SPEC; +impl crate::RegisterSpec for T1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [t1::R](R) reader structure"] +impl crate::Readable for T1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [t1::W](W) writer structure"] +impl crate::Writable for T1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets T1 to value 0"] +impl crate::Resettable for T1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/temp/t2.rs b/src/temp/t2.rs new file mode 100644 index 0000000..4597256 --- /dev/null +++ b/src/temp/t2.rs @@ -0,0 +1,102 @@ +#[doc = "Register `T2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `T2` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `T2` reader - End point of 3rd piece wise linear function"] +pub struct T2_R(crate::FieldReader); +impl T2_R { + pub(crate) fn new(bits: u8) -> Self { + T2_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for T2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `T2` writer - End point of 3rd piece wise linear function"] +pub struct T2_W<'a> { + w: &'a mut W, +} +impl<'a> T2_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - End point of 3rd piece wise linear function"] + #[inline(always)] + pub fn t2(&self) -> T2_R { + T2_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - End point of 3rd piece wise linear function"] + #[inline(always)] + pub fn t2(&mut self) -> T2_W { + T2_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "End point of 3rd piece wise linear function\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [t2](index.html) module"] +pub struct T2_SPEC; +impl crate::RegisterSpec for T2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [t2::R](R) reader structure"] +impl crate::Readable for T2_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [t2::W](W) writer structure"] +impl crate::Writable for T2_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets T2 to value 0x14"] +impl crate::Resettable for T2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x14 + } +} diff --git a/src/temp/t3.rs b/src/temp/t3.rs new file mode 100644 index 0000000..4b4a989 --- /dev/null +++ b/src/temp/t3.rs @@ -0,0 +1,102 @@ +#[doc = "Register `T3` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `T3` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `T3` reader - End point of 4th piece wise linear function"] +pub struct T3_R(crate::FieldReader); +impl T3_R { + pub(crate) fn new(bits: u8) -> Self { + T3_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for T3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `T3` writer - End point of 4th piece wise linear function"] +pub struct T3_W<'a> { + w: &'a mut W, +} +impl<'a> T3_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - End point of 4th piece wise linear function"] + #[inline(always)] + pub fn t3(&self) -> T3_R { + T3_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - End point of 4th piece wise linear function"] + #[inline(always)] + pub fn t3(&mut self) -> T3_W { + T3_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "End point of 4th piece wise linear function\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [t3](index.html) module"] +pub struct T3_SPEC; +impl crate::RegisterSpec for T3_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [t3::R](R) reader structure"] +impl crate::Readable for T3_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [t3::W](W) writer structure"] +impl crate::Writable for T3_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets T3 to value 0x19"] +impl crate::Resettable for T3_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x19 + } +} diff --git a/src/temp/t4.rs b/src/temp/t4.rs new file mode 100644 index 0000000..6631d5b --- /dev/null +++ b/src/temp/t4.rs @@ -0,0 +1,102 @@ +#[doc = "Register `T4` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `T4` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `T4` reader - End point of 5th piece wise linear function"] +pub struct T4_R(crate::FieldReader); +impl T4_R { + pub(crate) fn new(bits: u8) -> Self { + T4_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for T4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `T4` writer - End point of 5th piece wise linear function"] +pub struct T4_W<'a> { + w: &'a mut W, +} +impl<'a> T4_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - End point of 5th piece wise linear function"] + #[inline(always)] + pub fn t4(&self) -> T4_R { + T4_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - End point of 5th piece wise linear function"] + #[inline(always)] + pub fn t4(&mut self) -> T4_W { + T4_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "End point of 5th piece wise linear function\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [t4](index.html) module"] +pub struct T4_SPEC; +impl crate::RegisterSpec for T4_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [t4::R](R) reader structure"] +impl crate::Readable for T4_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [t4::W](W) writer structure"] +impl crate::Writable for T4_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets T4 to value 0x50"] +impl crate::Resettable for T4_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x50 + } +} diff --git a/src/temp/tasks_start.rs b/src/temp/tasks_start.rs new file mode 100644 index 0000000..3ee8137 --- /dev/null +++ b/src/temp/tasks_start.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_START` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start temperature measurement\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_start](index.html) module"] +pub struct TASKS_START_SPEC; +impl crate::RegisterSpec for TASKS_START_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_start::W](W) writer structure"] +impl crate::Writable for TASKS_START_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_START to value 0"] +impl crate::Resettable for TASKS_START_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/temp/tasks_stop.rs b/src/temp/tasks_stop.rs new file mode 100644 index 0000000..c526e6b --- /dev/null +++ b/src/temp/tasks_stop.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STOP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Stop temperature measurement\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_stop](index.html) module"] +pub struct TASKS_STOP_SPEC; +impl crate::RegisterSpec for TASKS_STOP_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_stop::W](W) writer structure"] +impl crate::Writable for TASKS_STOP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STOP to value 0"] +impl crate::Resettable for TASKS_STOP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/temp/temp.rs b/src/temp/temp.rs new file mode 100644 index 0000000..c816e8e --- /dev/null +++ b/src/temp/temp.rs @@ -0,0 +1,52 @@ +#[doc = "Register `TEMP` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `TEMP` reader - Temperature in degC (0.25deg steps)"] +pub struct TEMP_R(crate::FieldReader); +impl TEMP_R { + pub(crate) fn new(bits: u32) -> Self { + TEMP_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TEMP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:31 - Temperature in degC (0.25deg steps)"] + #[inline(always)] + pub fn temp(&self) -> TEMP_R { + TEMP_R::new((self.bits & 0xffff_ffff) as u32) + } +} +#[doc = "Temperature in degC (0.25deg steps)\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 [temp](index.html) module"] +pub struct TEMP_SPEC; +impl crate::RegisterSpec for TEMP_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [temp::R](R) reader structure"] +impl crate::Readable for TEMP_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets TEMP to value 0"] +impl crate::Resettable for TEMP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/timer0.rs b/src/timer0.rs new file mode 100644 index 0000000..974e82e --- /dev/null +++ b/src/timer0.rs @@ -0,0 +1,99 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "0x00 - Start Timer"] + pub tasks_start: crate::Reg, + #[doc = "0x04 - Stop Timer"] + pub tasks_stop: crate::Reg, + #[doc = "0x08 - Increment Timer (Counter mode only)"] + pub tasks_count: crate::Reg, + #[doc = "0x0c - Clear time"] + pub tasks_clear: crate::Reg, + #[doc = "0x10 - Deprecated register - Shut down timer"] + pub tasks_shutdown: crate::Reg, + _reserved5: [u8; 0x2c], + #[doc = "0x40..0x58 - Description collection\\[0\\]: Capture Timer value to CC\\[0\\] +register"] + pub tasks_capture: [crate::Reg; 6], + _reserved6: [u8; 0xe8], + #[doc = "0x140..0x158 - Description collection\\[0\\]: Compare event on CC\\[0\\] +match"] + pub events_compare: [crate::Reg; 6], + _reserved7: [u8; 0xa8], + #[doc = "0x200 - Shortcut register"] + pub shorts: crate::Reg, + _reserved8: [u8; 0x0100], + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved10: [u8; 0x01f8], + #[doc = "0x504 - Timer mode selection"] + pub mode: crate::Reg, + #[doc = "0x508 - Configure the number of bits used by the TIMER"] + pub bitmode: crate::Reg, + _reserved12: [u8; 0x04], + #[doc = "0x510 - Timer prescaler register"] + pub prescaler: crate::Reg, + _reserved13: [u8; 0x2c], + #[doc = "0x540..0x558 - Description collection\\[0\\]: Capture/Compare register 0"] + pub cc: [crate::Reg; 6], +} +#[doc = "TASKS_START register accessor: an alias for `Reg`"] +pub type TASKS_START = crate::Reg; +#[doc = "Start Timer"] +pub mod tasks_start; +#[doc = "TASKS_STOP register accessor: an alias for `Reg`"] +pub type TASKS_STOP = crate::Reg; +#[doc = "Stop Timer"] +pub mod tasks_stop; +#[doc = "TASKS_COUNT register accessor: an alias for `Reg`"] +pub type TASKS_COUNT = crate::Reg; +#[doc = "Increment Timer (Counter mode only)"] +pub mod tasks_count; +#[doc = "TASKS_CLEAR register accessor: an alias for `Reg`"] +pub type TASKS_CLEAR = crate::Reg; +#[doc = "Clear time"] +pub mod tasks_clear; +#[doc = "TASKS_SHUTDOWN register accessor: an alias for `Reg`"] +pub type TASKS_SHUTDOWN = crate::Reg; +#[doc = "Deprecated register - Shut down timer"] +pub mod tasks_shutdown; +#[doc = "TASKS_CAPTURE register accessor: an alias for `Reg`"] +pub type TASKS_CAPTURE = crate::Reg; +#[doc = "Description collection\\[0\\]: Capture Timer value to CC\\[0\\] +register"] +pub mod tasks_capture; +#[doc = "EVENTS_COMPARE register accessor: an alias for `Reg`"] +pub type EVENTS_COMPARE = crate::Reg; +#[doc = "Description collection\\[0\\]: Compare event on CC\\[0\\] +match"] +pub mod events_compare; +#[doc = "SHORTS register accessor: an alias for `Reg`"] +pub type SHORTS = crate::Reg; +#[doc = "Shortcut register"] +pub mod shorts; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "MODE register accessor: an alias for `Reg`"] +pub type MODE = crate::Reg; +#[doc = "Timer mode selection"] +pub mod mode; +#[doc = "BITMODE register accessor: an alias for `Reg`"] +pub type BITMODE = crate::Reg; +#[doc = "Configure the number of bits used by the TIMER"] +pub mod bitmode; +#[doc = "PRESCALER register accessor: an alias for `Reg`"] +pub type PRESCALER = crate::Reg; +#[doc = "Timer prescaler register"] +pub mod prescaler; +#[doc = "CC register accessor: an alias for `Reg`"] +pub type CC = crate::Reg; +#[doc = "Description collection\\[0\\]: Capture/Compare register 0"] +pub mod cc; diff --git a/src/timer0/bitmode.rs b/src/timer0/bitmode.rs new file mode 100644 index 0000000..8d2f465 --- /dev/null +++ b/src/timer0/bitmode.rs @@ -0,0 +1,177 @@ +#[doc = "Register `BITMODE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `BITMODE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Timer bit width\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum BITMODE_A { + #[doc = "0: 16 bit timer bit width"] + _16BIT = 0, + #[doc = "1: 8 bit timer bit width"] + _08BIT = 1, + #[doc = "2: 24 bit timer bit width"] + _24BIT = 2, + #[doc = "3: 32 bit timer bit width"] + _32BIT = 3, +} +impl From for u8 { + #[inline(always)] + fn from(variant: BITMODE_A) -> Self { + variant as _ + } +} +#[doc = "Field `BITMODE` reader - Timer bit width"] +pub struct BITMODE_R(crate::FieldReader); +impl BITMODE_R { + pub(crate) fn new(bits: u8) -> Self { + BITMODE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> BITMODE_A { + match self.bits { + 0 => BITMODE_A::_16BIT, + 1 => BITMODE_A::_08BIT, + 2 => BITMODE_A::_24BIT, + 3 => BITMODE_A::_32BIT, + _ => unreachable!(), + } + } + #[doc = "Checks if the value of the field is `_16BIT`"] + #[inline(always)] + pub fn is_16bit(&self) -> bool { + **self == BITMODE_A::_16BIT + } + #[doc = "Checks if the value of the field is `_08BIT`"] + #[inline(always)] + pub fn is_08bit(&self) -> bool { + **self == BITMODE_A::_08BIT + } + #[doc = "Checks if the value of the field is `_24BIT`"] + #[inline(always)] + pub fn is_24bit(&self) -> bool { + **self == BITMODE_A::_24BIT + } + #[doc = "Checks if the value of the field is `_32BIT`"] + #[inline(always)] + pub fn is_32bit(&self) -> bool { + **self == BITMODE_A::_32BIT + } +} +impl core::ops::Deref for BITMODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BITMODE` writer - Timer bit width"] +pub struct BITMODE_W<'a> { + w: &'a mut W, +} +impl<'a> BITMODE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: BITMODE_A) -> &'a mut W { + self.bits(variant.into()) + } + #[doc = "16 bit timer bit width"] + #[inline(always)] + pub fn _16bit(self) -> &'a mut W { + self.variant(BITMODE_A::_16BIT) + } + #[doc = "8 bit timer bit width"] + #[inline(always)] + pub fn _08bit(self) -> &'a mut W { + self.variant(BITMODE_A::_08BIT) + } + #[doc = "24 bit timer bit width"] + #[inline(always)] + pub fn _24bit(self) -> &'a mut W { + self.variant(BITMODE_A::_24BIT) + } + #[doc = "32 bit timer bit width"] + #[inline(always)] + pub fn _32bit(self) -> &'a mut W { + self.variant(BITMODE_A::_32BIT) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); + self.w + } +} +impl R { + #[doc = "Bits 0:1 - Timer bit width"] + #[inline(always)] + pub fn bitmode(&self) -> BITMODE_R { + BITMODE_R::new((self.bits & 0x03) as u8) + } +} +impl W { + #[doc = "Bits 0:1 - Timer bit width"] + #[inline(always)] + pub fn bitmode(&mut self) -> BITMODE_W { + BITMODE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Configure the number of bits used by the TIMER\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [bitmode](index.html) module"] +pub struct BITMODE_SPEC; +impl crate::RegisterSpec for BITMODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [bitmode::R](R) reader structure"] +impl crate::Readable for BITMODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [bitmode::W](W) writer structure"] +impl crate::Writable for BITMODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets BITMODE to value 0"] +impl crate::Resettable for BITMODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/timer0/cc.rs b/src/timer0/cc.rs new file mode 100644 index 0000000..d12f5f0 --- /dev/null +++ b/src/timer0/cc.rs @@ -0,0 +1,103 @@ +#[doc = "Register `CC[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CC[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CC` reader - Capture/Compare value"] +pub struct CC_R(crate::FieldReader); +impl CC_R { + pub(crate) fn new(bits: u32) -> Self { + CC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CC` writer - Capture/Compare value"] +pub struct CC_W<'a> { + w: &'a mut W, +} +impl<'a> CC_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Capture/Compare value"] + #[inline(always)] + pub fn cc(&self) -> CC_R { + CC_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Capture/Compare value"] + #[inline(always)] + pub fn cc(&mut self) -> CC_W { + CC_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description collection\\[0\\]: Capture/Compare register 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cc](index.html) module"] +pub struct CC_SPEC; +impl crate::RegisterSpec for CC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cc::R](R) reader structure"] +impl crate::Readable for CC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [cc::W](W) writer structure"] +impl crate::Writable for CC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CC[%s] +to value 0"] +impl crate::Resettable for CC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/timer0/events_compare.rs b/src/timer0/events_compare.rs new file mode 100644 index 0000000..a523d4b --- /dev/null +++ b/src/timer0/events_compare.rs @@ -0,0 +1,66 @@ +#[doc = "Register `EVENTS_COMPARE[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_COMPARE[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description collection\\[0\\]: Compare event on CC\\[0\\] +match\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_compare](index.html) module"] +pub struct EVENTS_COMPARE_SPEC; +impl crate::RegisterSpec for EVENTS_COMPARE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_compare::R](R) reader structure"] +impl crate::Readable for EVENTS_COMPARE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_compare::W](W) writer structure"] +impl crate::Writable for EVENTS_COMPARE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_COMPARE[%s] +to value 0"] +impl crate::Resettable for EVENTS_COMPARE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/timer0/intenclr.rs b/src/timer0/intenclr.rs new file mode 100644 index 0000000..a1a48a5 --- /dev/null +++ b/src/timer0/intenclr.rs @@ -0,0 +1,702 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for COMPARE\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE0_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE0` reader - Write '1' to Disable interrupt for COMPARE\\[0\\] +event"] +pub struct COMPARE0_R(crate::FieldReader); +impl COMPARE0_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE0_A { + match self.bits { + false => COMPARE0_A::DISABLED, + true => COMPARE0_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE0_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE0_A::ENABLED + } +} +impl core::ops::Deref for COMPARE0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for COMPARE\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE0_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE0_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE0` writer - Write '1' to Disable interrupt for COMPARE\\[0\\] +event"] +pub struct COMPARE0_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE0_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(COMPARE0_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for COMPARE\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE1_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE1` reader - Write '1' to Disable interrupt for COMPARE\\[1\\] +event"] +pub struct COMPARE1_R(crate::FieldReader); +impl COMPARE1_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE1_A { + match self.bits { + false => COMPARE1_A::DISABLED, + true => COMPARE1_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE1_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE1_A::ENABLED + } +} +impl core::ops::Deref for COMPARE1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for COMPARE\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE1_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE1_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE1` writer - Write '1' to Disable interrupt for COMPARE\\[1\\] +event"] +pub struct COMPARE1_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE1_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(COMPARE1_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for COMPARE\\[2\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE2_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE2` reader - Write '1' to Disable interrupt for COMPARE\\[2\\] +event"] +pub struct COMPARE2_R(crate::FieldReader); +impl COMPARE2_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE2_A { + match self.bits { + false => COMPARE2_A::DISABLED, + true => COMPARE2_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE2_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE2_A::ENABLED + } +} +impl core::ops::Deref for COMPARE2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for COMPARE\\[2\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE2_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE2_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE2` writer - Write '1' to Disable interrupt for COMPARE\\[2\\] +event"] +pub struct COMPARE2_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE2_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(COMPARE2_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for COMPARE\\[3\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE3_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE3` reader - Write '1' to Disable interrupt for COMPARE\\[3\\] +event"] +pub struct COMPARE3_R(crate::FieldReader); +impl COMPARE3_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE3_A { + match self.bits { + false => COMPARE3_A::DISABLED, + true => COMPARE3_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE3_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE3_A::ENABLED + } +} +impl core::ops::Deref for COMPARE3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for COMPARE\\[3\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE3_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE3_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE3` writer - Write '1' to Disable interrupt for COMPARE\\[3\\] +event"] +pub struct COMPARE3_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE3_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(COMPARE3_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for COMPARE\\[4\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE4_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE4_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE4` reader - Write '1' to Disable interrupt for COMPARE\\[4\\] +event"] +pub struct COMPARE4_R(crate::FieldReader); +impl COMPARE4_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE4_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE4_A { + match self.bits { + false => COMPARE4_A::DISABLED, + true => COMPARE4_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE4_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE4_A::ENABLED + } +} +impl core::ops::Deref for COMPARE4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for COMPARE\\[4\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE4_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE4_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE4` writer - Write '1' to Disable interrupt for COMPARE\\[4\\] +event"] +pub struct COMPARE4_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE4_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE4_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(COMPARE4_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for COMPARE\\[5\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE5_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE5_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE5` reader - Write '1' to Disable interrupt for COMPARE\\[5\\] +event"] +pub struct COMPARE5_R(crate::FieldReader); +impl COMPARE5_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE5_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE5_A { + match self.bits { + false => COMPARE5_A::DISABLED, + true => COMPARE5_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE5_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE5_A::ENABLED + } +} +impl core::ops::Deref for COMPARE5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for COMPARE\\[5\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE5_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE5_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE5` writer - Write '1' to Disable interrupt for COMPARE\\[5\\] +event"] +pub struct COMPARE5_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE5_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE5_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(COMPARE5_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); + self.w + } +} +impl R { + #[doc = "Bit 16 - Write '1' to Disable interrupt for COMPARE\\[0\\] +event"] + #[inline(always)] + pub fn compare0(&self) -> COMPARE0_R { + COMPARE0_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Write '1' to Disable interrupt for COMPARE\\[1\\] +event"] + #[inline(always)] + pub fn compare1(&self) -> COMPARE1_R { + COMPARE1_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Write '1' to Disable interrupt for COMPARE\\[2\\] +event"] + #[inline(always)] + pub fn compare2(&self) -> COMPARE2_R { + COMPARE2_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Write '1' to Disable interrupt for COMPARE\\[3\\] +event"] + #[inline(always)] + pub fn compare3(&self) -> COMPARE3_R { + COMPARE3_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Write '1' to Disable interrupt for COMPARE\\[4\\] +event"] + #[inline(always)] + pub fn compare4(&self) -> COMPARE4_R { + COMPARE4_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 21 - Write '1' to Disable interrupt for COMPARE\\[5\\] +event"] + #[inline(always)] + pub fn compare5(&self) -> COMPARE5_R { + COMPARE5_R::new(((self.bits >> 21) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 16 - Write '1' to Disable interrupt for COMPARE\\[0\\] +event"] + #[inline(always)] + pub fn compare0(&mut self) -> COMPARE0_W { + COMPARE0_W { w: self } + } + #[doc = "Bit 17 - Write '1' to Disable interrupt for COMPARE\\[1\\] +event"] + #[inline(always)] + pub fn compare1(&mut self) -> COMPARE1_W { + COMPARE1_W { w: self } + } + #[doc = "Bit 18 - Write '1' to Disable interrupt for COMPARE\\[2\\] +event"] + #[inline(always)] + pub fn compare2(&mut self) -> COMPARE2_W { + COMPARE2_W { w: self } + } + #[doc = "Bit 19 - Write '1' to Disable interrupt for COMPARE\\[3\\] +event"] + #[inline(always)] + pub fn compare3(&mut self) -> COMPARE3_W { + COMPARE3_W { w: self } + } + #[doc = "Bit 20 - Write '1' to Disable interrupt for COMPARE\\[4\\] +event"] + #[inline(always)] + pub fn compare4(&mut self) -> COMPARE4_W { + COMPARE4_W { w: self } + } + #[doc = "Bit 21 - Write '1' to Disable interrupt for COMPARE\\[5\\] +event"] + #[inline(always)] + pub fn compare5(&mut self) -> COMPARE5_W { + COMPARE5_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/timer0/intenset.rs b/src/timer0/intenset.rs new file mode 100644 index 0000000..ac3019d --- /dev/null +++ b/src/timer0/intenset.rs @@ -0,0 +1,702 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for COMPARE\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE0_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE0` reader - Write '1' to Enable interrupt for COMPARE\\[0\\] +event"] +pub struct COMPARE0_R(crate::FieldReader); +impl COMPARE0_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE0_A { + match self.bits { + false => COMPARE0_A::DISABLED, + true => COMPARE0_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE0_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE0_A::ENABLED + } +} +impl core::ops::Deref for COMPARE0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for COMPARE\\[0\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE0_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE0_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE0` writer - Write '1' to Enable interrupt for COMPARE\\[0\\] +event"] +pub struct COMPARE0_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE0_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(COMPARE0_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 16)) | ((value as u32 & 0x01) << 16); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for COMPARE\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE1_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE1` reader - Write '1' to Enable interrupt for COMPARE\\[1\\] +event"] +pub struct COMPARE1_R(crate::FieldReader); +impl COMPARE1_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE1_A { + match self.bits { + false => COMPARE1_A::DISABLED, + true => COMPARE1_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE1_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE1_A::ENABLED + } +} +impl core::ops::Deref for COMPARE1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for COMPARE\\[1\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE1_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE1_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE1` writer - Write '1' to Enable interrupt for COMPARE\\[1\\] +event"] +pub struct COMPARE1_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE1_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(COMPARE1_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for COMPARE\\[2\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE2_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE2` reader - Write '1' to Enable interrupt for COMPARE\\[2\\] +event"] +pub struct COMPARE2_R(crate::FieldReader); +impl COMPARE2_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE2_A { + match self.bits { + false => COMPARE2_A::DISABLED, + true => COMPARE2_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE2_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE2_A::ENABLED + } +} +impl core::ops::Deref for COMPARE2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for COMPARE\\[2\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE2_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE2_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE2` writer - Write '1' to Enable interrupt for COMPARE\\[2\\] +event"] +pub struct COMPARE2_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE2_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(COMPARE2_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for COMPARE\\[3\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE3_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE3` reader - Write '1' to Enable interrupt for COMPARE\\[3\\] +event"] +pub struct COMPARE3_R(crate::FieldReader); +impl COMPARE3_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE3_A { + match self.bits { + false => COMPARE3_A::DISABLED, + true => COMPARE3_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE3_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE3_A::ENABLED + } +} +impl core::ops::Deref for COMPARE3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for COMPARE\\[3\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE3_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE3_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE3` writer - Write '1' to Enable interrupt for COMPARE\\[3\\] +event"] +pub struct COMPARE3_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE3_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(COMPARE3_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for COMPARE\\[4\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE4_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE4_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE4` reader - Write '1' to Enable interrupt for COMPARE\\[4\\] +event"] +pub struct COMPARE4_R(crate::FieldReader); +impl COMPARE4_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE4_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE4_A { + match self.bits { + false => COMPARE4_A::DISABLED, + true => COMPARE4_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE4_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE4_A::ENABLED + } +} +impl core::ops::Deref for COMPARE4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for COMPARE\\[4\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE4_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE4_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE4` writer - Write '1' to Enable interrupt for COMPARE\\[4\\] +event"] +pub struct COMPARE4_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE4_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE4_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(COMPARE4_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for COMPARE\\[5\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE5_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE5_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE5` reader - Write '1' to Enable interrupt for COMPARE\\[5\\] +event"] +pub struct COMPARE5_R(crate::FieldReader); +impl COMPARE5_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE5_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE5_A { + match self.bits { + false => COMPARE5_A::DISABLED, + true => COMPARE5_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE5_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE5_A::ENABLED + } +} +impl core::ops::Deref for COMPARE5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for COMPARE\\[5\\] +event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE5_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE5_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE5` writer - Write '1' to Enable interrupt for COMPARE\\[5\\] +event"] +pub struct COMPARE5_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE5_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE5_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(COMPARE5_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 21)) | ((value as u32 & 0x01) << 21); + self.w + } +} +impl R { + #[doc = "Bit 16 - Write '1' to Enable interrupt for COMPARE\\[0\\] +event"] + #[inline(always)] + pub fn compare0(&self) -> COMPARE0_R { + COMPARE0_R::new(((self.bits >> 16) & 0x01) != 0) + } + #[doc = "Bit 17 - Write '1' to Enable interrupt for COMPARE\\[1\\] +event"] + #[inline(always)] + pub fn compare1(&self) -> COMPARE1_R { + COMPARE1_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 18 - Write '1' to Enable interrupt for COMPARE\\[2\\] +event"] + #[inline(always)] + pub fn compare2(&self) -> COMPARE2_R { + COMPARE2_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Write '1' to Enable interrupt for COMPARE\\[3\\] +event"] + #[inline(always)] + pub fn compare3(&self) -> COMPARE3_R { + COMPARE3_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Write '1' to Enable interrupt for COMPARE\\[4\\] +event"] + #[inline(always)] + pub fn compare4(&self) -> COMPARE4_R { + COMPARE4_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 21 - Write '1' to Enable interrupt for COMPARE\\[5\\] +event"] + #[inline(always)] + pub fn compare5(&self) -> COMPARE5_R { + COMPARE5_R::new(((self.bits >> 21) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 16 - Write '1' to Enable interrupt for COMPARE\\[0\\] +event"] + #[inline(always)] + pub fn compare0(&mut self) -> COMPARE0_W { + COMPARE0_W { w: self } + } + #[doc = "Bit 17 - Write '1' to Enable interrupt for COMPARE\\[1\\] +event"] + #[inline(always)] + pub fn compare1(&mut self) -> COMPARE1_W { + COMPARE1_W { w: self } + } + #[doc = "Bit 18 - Write '1' to Enable interrupt for COMPARE\\[2\\] +event"] + #[inline(always)] + pub fn compare2(&mut self) -> COMPARE2_W { + COMPARE2_W { w: self } + } + #[doc = "Bit 19 - Write '1' to Enable interrupt for COMPARE\\[3\\] +event"] + #[inline(always)] + pub fn compare3(&mut self) -> COMPARE3_W { + COMPARE3_W { w: self } + } + #[doc = "Bit 20 - Write '1' to Enable interrupt for COMPARE\\[4\\] +event"] + #[inline(always)] + pub fn compare4(&mut self) -> COMPARE4_W { + COMPARE4_W { w: self } + } + #[doc = "Bit 21 - Write '1' to Enable interrupt for COMPARE\\[5\\] +event"] + #[inline(always)] + pub fn compare5(&mut self) -> COMPARE5_W { + COMPARE5_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/timer0/mode.rs b/src/timer0/mode.rs new file mode 100644 index 0000000..f09e0a9 --- /dev/null +++ b/src/timer0/mode.rs @@ -0,0 +1,164 @@ +#[doc = "Register `MODE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MODE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Timer mode\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum MODE_A { + #[doc = "0: Select Timer mode"] + TIMER = 0, + #[doc = "1: Deprecated enumerator - Select Counter mode"] + COUNTER = 1, + #[doc = "2: Select Low Power Counter mode"] + LOWPOWERCOUNTER = 2, +} +impl From for u8 { + #[inline(always)] + fn from(variant: MODE_A) -> Self { + variant as _ + } +} +#[doc = "Field `MODE` reader - Timer mode"] +pub struct MODE_R(crate::FieldReader); +impl MODE_R { + pub(crate) fn new(bits: u8) -> Self { + MODE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(MODE_A::TIMER), + 1 => Some(MODE_A::COUNTER), + 2 => Some(MODE_A::LOWPOWERCOUNTER), + _ => None, + } + } + #[doc = "Checks if the value of the field is `TIMER`"] + #[inline(always)] + pub fn is_timer(&self) -> bool { + **self == MODE_A::TIMER + } + #[doc = "Checks if the value of the field is `COUNTER`"] + #[inline(always)] + pub fn is_counter(&self) -> bool { + **self == MODE_A::COUNTER + } + #[doc = "Checks if the value of the field is `LOWPOWERCOUNTER`"] + #[inline(always)] + pub fn is_low_power_counter(&self) -> bool { + **self == MODE_A::LOWPOWERCOUNTER + } +} +impl core::ops::Deref for MODE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MODE` writer - Timer mode"] +pub struct MODE_W<'a> { + w: &'a mut W, +} +impl<'a> MODE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: MODE_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Select Timer mode"] + #[inline(always)] + pub fn timer(self) -> &'a mut W { + self.variant(MODE_A::TIMER) + } + #[doc = "Deprecated enumerator - Select Counter mode"] + #[inline(always)] + pub fn counter(self) -> &'a mut W { + self.variant(MODE_A::COUNTER) + } + #[doc = "Select Low Power Counter mode"] + #[inline(always)] + pub fn low_power_counter(self) -> &'a mut W { + self.variant(MODE_A::LOWPOWERCOUNTER) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03); + self.w + } +} +impl R { + #[doc = "Bits 0:1 - Timer mode"] + #[inline(always)] + pub fn mode(&self) -> MODE_R { + MODE_R::new((self.bits & 0x03) as u8) + } +} +impl W { + #[doc = "Bits 0:1 - Timer mode"] + #[inline(always)] + pub fn mode(&mut self) -> MODE_W { + MODE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Timer mode selection\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mode](index.html) module"] +pub struct MODE_SPEC; +impl crate::RegisterSpec for MODE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [mode::R](R) reader structure"] +impl crate::Readable for MODE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [mode::W](W) writer structure"] +impl crate::Writable for MODE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MODE to value 0"] +impl crate::Resettable for MODE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/timer0/prescaler.rs b/src/timer0/prescaler.rs new file mode 100644 index 0000000..2c4f9c2 --- /dev/null +++ b/src/timer0/prescaler.rs @@ -0,0 +1,102 @@ +#[doc = "Register `PRESCALER` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PRESCALER` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PRESCALER` reader - Prescaler value"] +pub struct PRESCALER_R(crate::FieldReader); +impl PRESCALER_R { + pub(crate) fn new(bits: u8) -> Self { + PRESCALER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PRESCALER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PRESCALER` writer - Prescaler value"] +pub struct PRESCALER_W<'a> { + w: &'a mut W, +} +impl<'a> PRESCALER_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); + self.w + } +} +impl R { + #[doc = "Bits 0:3 - Prescaler value"] + #[inline(always)] + pub fn prescaler(&self) -> PRESCALER_R { + PRESCALER_R::new((self.bits & 0x0f) as u8) + } +} +impl W { + #[doc = "Bits 0:3 - Prescaler value"] + #[inline(always)] + pub fn prescaler(&mut self) -> PRESCALER_W { + PRESCALER_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Timer prescaler register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prescaler](index.html) module"] +pub struct PRESCALER_SPEC; +impl crate::RegisterSpec for PRESCALER_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [prescaler::R](R) reader structure"] +impl crate::Readable for PRESCALER_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [prescaler::W](W) writer structure"] +impl crate::Writable for PRESCALER_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PRESCALER to value 0x04"] +impl crate::Resettable for PRESCALER_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x04 + } +} diff --git a/src/timer0/shorts.rs b/src/timer0/shorts.rs new file mode 100644 index 0000000..51e2ba2 --- /dev/null +++ b/src/timer0/shorts.rs @@ -0,0 +1,1242 @@ +#[doc = "Register `SHORTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SHORTS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Shortcut between COMPARE\\[0\\] +event and CLEAR task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE0_CLEAR_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE0_CLEAR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE0_CLEAR` reader - Shortcut between COMPARE\\[0\\] +event and CLEAR task"] +pub struct COMPARE0_CLEAR_R(crate::FieldReader); +impl COMPARE0_CLEAR_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE0_CLEAR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE0_CLEAR_A { + match self.bits { + false => COMPARE0_CLEAR_A::DISABLED, + true => COMPARE0_CLEAR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE0_CLEAR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE0_CLEAR_A::ENABLED + } +} +impl core::ops::Deref for COMPARE0_CLEAR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `COMPARE0_CLEAR` writer - Shortcut between COMPARE\\[0\\] +event and CLEAR task"] +pub struct COMPARE0_CLEAR_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE0_CLEAR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE0_CLEAR_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(COMPARE0_CLEAR_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(COMPARE0_CLEAR_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Shortcut between COMPARE\\[1\\] +event and CLEAR task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE1_CLEAR_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE1_CLEAR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE1_CLEAR` reader - Shortcut between COMPARE\\[1\\] +event and CLEAR task"] +pub struct COMPARE1_CLEAR_R(crate::FieldReader); +impl COMPARE1_CLEAR_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE1_CLEAR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE1_CLEAR_A { + match self.bits { + false => COMPARE1_CLEAR_A::DISABLED, + true => COMPARE1_CLEAR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE1_CLEAR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE1_CLEAR_A::ENABLED + } +} +impl core::ops::Deref for COMPARE1_CLEAR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `COMPARE1_CLEAR` writer - Shortcut between COMPARE\\[1\\] +event and CLEAR task"] +pub struct COMPARE1_CLEAR_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE1_CLEAR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE1_CLEAR_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(COMPARE1_CLEAR_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(COMPARE1_CLEAR_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Shortcut between COMPARE\\[2\\] +event and CLEAR task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE2_CLEAR_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE2_CLEAR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE2_CLEAR` reader - Shortcut between COMPARE\\[2\\] +event and CLEAR task"] +pub struct COMPARE2_CLEAR_R(crate::FieldReader); +impl COMPARE2_CLEAR_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE2_CLEAR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE2_CLEAR_A { + match self.bits { + false => COMPARE2_CLEAR_A::DISABLED, + true => COMPARE2_CLEAR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE2_CLEAR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE2_CLEAR_A::ENABLED + } +} +impl core::ops::Deref for COMPARE2_CLEAR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `COMPARE2_CLEAR` writer - Shortcut between COMPARE\\[2\\] +event and CLEAR task"] +pub struct COMPARE2_CLEAR_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE2_CLEAR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE2_CLEAR_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(COMPARE2_CLEAR_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(COMPARE2_CLEAR_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Shortcut between COMPARE\\[3\\] +event and CLEAR task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE3_CLEAR_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE3_CLEAR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE3_CLEAR` reader - Shortcut between COMPARE\\[3\\] +event and CLEAR task"] +pub struct COMPARE3_CLEAR_R(crate::FieldReader); +impl COMPARE3_CLEAR_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE3_CLEAR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE3_CLEAR_A { + match self.bits { + false => COMPARE3_CLEAR_A::DISABLED, + true => COMPARE3_CLEAR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE3_CLEAR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE3_CLEAR_A::ENABLED + } +} +impl core::ops::Deref for COMPARE3_CLEAR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `COMPARE3_CLEAR` writer - Shortcut between COMPARE\\[3\\] +event and CLEAR task"] +pub struct COMPARE3_CLEAR_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE3_CLEAR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE3_CLEAR_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(COMPARE3_CLEAR_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(COMPARE3_CLEAR_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Shortcut between COMPARE\\[4\\] +event and CLEAR task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE4_CLEAR_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE4_CLEAR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE4_CLEAR` reader - Shortcut between COMPARE\\[4\\] +event and CLEAR task"] +pub struct COMPARE4_CLEAR_R(crate::FieldReader); +impl COMPARE4_CLEAR_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE4_CLEAR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE4_CLEAR_A { + match self.bits { + false => COMPARE4_CLEAR_A::DISABLED, + true => COMPARE4_CLEAR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE4_CLEAR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE4_CLEAR_A::ENABLED + } +} +impl core::ops::Deref for COMPARE4_CLEAR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `COMPARE4_CLEAR` writer - Shortcut between COMPARE\\[4\\] +event and CLEAR task"] +pub struct COMPARE4_CLEAR_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE4_CLEAR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE4_CLEAR_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(COMPARE4_CLEAR_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(COMPARE4_CLEAR_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Shortcut between COMPARE\\[5\\] +event and CLEAR task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE5_CLEAR_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE5_CLEAR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE5_CLEAR` reader - Shortcut between COMPARE\\[5\\] +event and CLEAR task"] +pub struct COMPARE5_CLEAR_R(crate::FieldReader); +impl COMPARE5_CLEAR_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE5_CLEAR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE5_CLEAR_A { + match self.bits { + false => COMPARE5_CLEAR_A::DISABLED, + true => COMPARE5_CLEAR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE5_CLEAR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE5_CLEAR_A::ENABLED + } +} +impl core::ops::Deref for COMPARE5_CLEAR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `COMPARE5_CLEAR` writer - Shortcut between COMPARE\\[5\\] +event and CLEAR task"] +pub struct COMPARE5_CLEAR_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE5_CLEAR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE5_CLEAR_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(COMPARE5_CLEAR_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(COMPARE5_CLEAR_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Shortcut between COMPARE\\[0\\] +event and STOP task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE0_STOP_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE0_STOP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE0_STOP` reader - Shortcut between COMPARE\\[0\\] +event and STOP task"] +pub struct COMPARE0_STOP_R(crate::FieldReader); +impl COMPARE0_STOP_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE0_STOP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE0_STOP_A { + match self.bits { + false => COMPARE0_STOP_A::DISABLED, + true => COMPARE0_STOP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE0_STOP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE0_STOP_A::ENABLED + } +} +impl core::ops::Deref for COMPARE0_STOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `COMPARE0_STOP` writer - Shortcut between COMPARE\\[0\\] +event and STOP task"] +pub struct COMPARE0_STOP_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE0_STOP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE0_STOP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(COMPARE0_STOP_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(COMPARE0_STOP_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Shortcut between COMPARE\\[1\\] +event and STOP task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE1_STOP_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE1_STOP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE1_STOP` reader - Shortcut between COMPARE\\[1\\] +event and STOP task"] +pub struct COMPARE1_STOP_R(crate::FieldReader); +impl COMPARE1_STOP_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE1_STOP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE1_STOP_A { + match self.bits { + false => COMPARE1_STOP_A::DISABLED, + true => COMPARE1_STOP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE1_STOP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE1_STOP_A::ENABLED + } +} +impl core::ops::Deref for COMPARE1_STOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `COMPARE1_STOP` writer - Shortcut between COMPARE\\[1\\] +event and STOP task"] +pub struct COMPARE1_STOP_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE1_STOP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE1_STOP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(COMPARE1_STOP_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(COMPARE1_STOP_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Shortcut between COMPARE\\[2\\] +event and STOP task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE2_STOP_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE2_STOP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE2_STOP` reader - Shortcut between COMPARE\\[2\\] +event and STOP task"] +pub struct COMPARE2_STOP_R(crate::FieldReader); +impl COMPARE2_STOP_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE2_STOP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE2_STOP_A { + match self.bits { + false => COMPARE2_STOP_A::DISABLED, + true => COMPARE2_STOP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE2_STOP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE2_STOP_A::ENABLED + } +} +impl core::ops::Deref for COMPARE2_STOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `COMPARE2_STOP` writer - Shortcut between COMPARE\\[2\\] +event and STOP task"] +pub struct COMPARE2_STOP_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE2_STOP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE2_STOP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(COMPARE2_STOP_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(COMPARE2_STOP_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Shortcut between COMPARE\\[3\\] +event and STOP task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE3_STOP_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE3_STOP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE3_STOP` reader - Shortcut between COMPARE\\[3\\] +event and STOP task"] +pub struct COMPARE3_STOP_R(crate::FieldReader); +impl COMPARE3_STOP_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE3_STOP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE3_STOP_A { + match self.bits { + false => COMPARE3_STOP_A::DISABLED, + true => COMPARE3_STOP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE3_STOP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE3_STOP_A::ENABLED + } +} +impl core::ops::Deref for COMPARE3_STOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `COMPARE3_STOP` writer - Shortcut between COMPARE\\[3\\] +event and STOP task"] +pub struct COMPARE3_STOP_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE3_STOP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE3_STOP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(COMPARE3_STOP_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(COMPARE3_STOP_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11); + self.w + } +} +#[doc = "Shortcut between COMPARE\\[4\\] +event and STOP task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE4_STOP_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE4_STOP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE4_STOP` reader - Shortcut between COMPARE\\[4\\] +event and STOP task"] +pub struct COMPARE4_STOP_R(crate::FieldReader); +impl COMPARE4_STOP_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE4_STOP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE4_STOP_A { + match self.bits { + false => COMPARE4_STOP_A::DISABLED, + true => COMPARE4_STOP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE4_STOP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE4_STOP_A::ENABLED + } +} +impl core::ops::Deref for COMPARE4_STOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `COMPARE4_STOP` writer - Shortcut between COMPARE\\[4\\] +event and STOP task"] +pub struct COMPARE4_STOP_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE4_STOP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE4_STOP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(COMPARE4_STOP_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(COMPARE4_STOP_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +#[doc = "Shortcut between COMPARE\\[5\\] +event and STOP task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum COMPARE5_STOP_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: COMPARE5_STOP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `COMPARE5_STOP` reader - Shortcut between COMPARE\\[5\\] +event and STOP task"] +pub struct COMPARE5_STOP_R(crate::FieldReader); +impl COMPARE5_STOP_R { + pub(crate) fn new(bits: bool) -> Self { + COMPARE5_STOP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> COMPARE5_STOP_A { + match self.bits { + false => COMPARE5_STOP_A::DISABLED, + true => COMPARE5_STOP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == COMPARE5_STOP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == COMPARE5_STOP_A::ENABLED + } +} +impl core::ops::Deref for COMPARE5_STOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `COMPARE5_STOP` writer - Shortcut between COMPARE\\[5\\] +event and STOP task"] +pub struct COMPARE5_STOP_W<'a> { + w: &'a mut W, +} +impl<'a> COMPARE5_STOP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: COMPARE5_STOP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(COMPARE5_STOP_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(COMPARE5_STOP_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +impl R { + #[doc = "Bit 0 - Shortcut between COMPARE\\[0\\] +event and CLEAR task"] + #[inline(always)] + pub fn compare0_clear(&self) -> COMPARE0_CLEAR_R { + COMPARE0_CLEAR_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Shortcut between COMPARE\\[1\\] +event and CLEAR task"] + #[inline(always)] + pub fn compare1_clear(&self) -> COMPARE1_CLEAR_R { + COMPARE1_CLEAR_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Shortcut between COMPARE\\[2\\] +event and CLEAR task"] + #[inline(always)] + pub fn compare2_clear(&self) -> COMPARE2_CLEAR_R { + COMPARE2_CLEAR_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Shortcut between COMPARE\\[3\\] +event and CLEAR task"] + #[inline(always)] + pub fn compare3_clear(&self) -> COMPARE3_CLEAR_R { + COMPARE3_CLEAR_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Shortcut between COMPARE\\[4\\] +event and CLEAR task"] + #[inline(always)] + pub fn compare4_clear(&self) -> COMPARE4_CLEAR_R { + COMPARE4_CLEAR_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Shortcut between COMPARE\\[5\\] +event and CLEAR task"] + #[inline(always)] + pub fn compare5_clear(&self) -> COMPARE5_CLEAR_R { + COMPARE5_CLEAR_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 8 - Shortcut between COMPARE\\[0\\] +event and STOP task"] + #[inline(always)] + pub fn compare0_stop(&self) -> COMPARE0_STOP_R { + COMPARE0_STOP_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Shortcut between COMPARE\\[1\\] +event and STOP task"] + #[inline(always)] + pub fn compare1_stop(&self) -> COMPARE1_STOP_R { + COMPARE1_STOP_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Shortcut between COMPARE\\[2\\] +event and STOP task"] + #[inline(always)] + pub fn compare2_stop(&self) -> COMPARE2_STOP_R { + COMPARE2_STOP_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 11 - Shortcut between COMPARE\\[3\\] +event and STOP task"] + #[inline(always)] + pub fn compare3_stop(&self) -> COMPARE3_STOP_R { + COMPARE3_STOP_R::new(((self.bits >> 11) & 0x01) != 0) + } + #[doc = "Bit 12 - Shortcut between COMPARE\\[4\\] +event and STOP task"] + #[inline(always)] + pub fn compare4_stop(&self) -> COMPARE4_STOP_R { + COMPARE4_STOP_R::new(((self.bits >> 12) & 0x01) != 0) + } + #[doc = "Bit 13 - Shortcut between COMPARE\\[5\\] +event and STOP task"] + #[inline(always)] + pub fn compare5_stop(&self) -> COMPARE5_STOP_R { + COMPARE5_STOP_R::new(((self.bits >> 13) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Shortcut between COMPARE\\[0\\] +event and CLEAR task"] + #[inline(always)] + pub fn compare0_clear(&mut self) -> COMPARE0_CLEAR_W { + COMPARE0_CLEAR_W { w: self } + } + #[doc = "Bit 1 - Shortcut between COMPARE\\[1\\] +event and CLEAR task"] + #[inline(always)] + pub fn compare1_clear(&mut self) -> COMPARE1_CLEAR_W { + COMPARE1_CLEAR_W { w: self } + } + #[doc = "Bit 2 - Shortcut between COMPARE\\[2\\] +event and CLEAR task"] + #[inline(always)] + pub fn compare2_clear(&mut self) -> COMPARE2_CLEAR_W { + COMPARE2_CLEAR_W { w: self } + } + #[doc = "Bit 3 - Shortcut between COMPARE\\[3\\] +event and CLEAR task"] + #[inline(always)] + pub fn compare3_clear(&mut self) -> COMPARE3_CLEAR_W { + COMPARE3_CLEAR_W { w: self } + } + #[doc = "Bit 4 - Shortcut between COMPARE\\[4\\] +event and CLEAR task"] + #[inline(always)] + pub fn compare4_clear(&mut self) -> COMPARE4_CLEAR_W { + COMPARE4_CLEAR_W { w: self } + } + #[doc = "Bit 5 - Shortcut between COMPARE\\[5\\] +event and CLEAR task"] + #[inline(always)] + pub fn compare5_clear(&mut self) -> COMPARE5_CLEAR_W { + COMPARE5_CLEAR_W { w: self } + } + #[doc = "Bit 8 - Shortcut between COMPARE\\[0\\] +event and STOP task"] + #[inline(always)] + pub fn compare0_stop(&mut self) -> COMPARE0_STOP_W { + COMPARE0_STOP_W { w: self } + } + #[doc = "Bit 9 - Shortcut between COMPARE\\[1\\] +event and STOP task"] + #[inline(always)] + pub fn compare1_stop(&mut self) -> COMPARE1_STOP_W { + COMPARE1_STOP_W { w: self } + } + #[doc = "Bit 10 - Shortcut between COMPARE\\[2\\] +event and STOP task"] + #[inline(always)] + pub fn compare2_stop(&mut self) -> COMPARE2_STOP_W { + COMPARE2_STOP_W { w: self } + } + #[doc = "Bit 11 - Shortcut between COMPARE\\[3\\] +event and STOP task"] + #[inline(always)] + pub fn compare3_stop(&mut self) -> COMPARE3_STOP_W { + COMPARE3_STOP_W { w: self } + } + #[doc = "Bit 12 - Shortcut between COMPARE\\[4\\] +event and STOP task"] + #[inline(always)] + pub fn compare4_stop(&mut self) -> COMPARE4_STOP_W { + COMPARE4_STOP_W { w: self } + } + #[doc = "Bit 13 - Shortcut between COMPARE\\[5\\] +event and STOP task"] + #[inline(always)] + pub fn compare5_stop(&mut self) -> COMPARE5_STOP_W { + COMPARE5_STOP_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Shortcut register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [shorts](index.html) module"] +pub struct SHORTS_SPEC; +impl crate::RegisterSpec for SHORTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [shorts::R](R) reader structure"] +impl crate::Readable for SHORTS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [shorts::W](W) writer structure"] +impl crate::Writable for SHORTS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SHORTS to value 0"] +impl crate::Resettable for SHORTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/timer0/tasks_capture.rs b/src/timer0/tasks_capture.rs new file mode 100644 index 0000000..ddef017 --- /dev/null +++ b/src/timer0/tasks_capture.rs @@ -0,0 +1,47 @@ +#[doc = "Register `TASKS_CAPTURE[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description collection\\[0\\]: Capture Timer value to CC\\[0\\] +register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_capture](index.html) module"] +pub struct TASKS_CAPTURE_SPEC; +impl crate::RegisterSpec for TASKS_CAPTURE_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_capture::W](W) writer structure"] +impl crate::Writable for TASKS_CAPTURE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_CAPTURE[%s] +to value 0"] +impl crate::Resettable for TASKS_CAPTURE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/timer0/tasks_clear.rs b/src/timer0/tasks_clear.rs new file mode 100644 index 0000000..b1dc23b --- /dev/null +++ b/src/timer0/tasks_clear.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_CLEAR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Clear time\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_clear](index.html) module"] +pub struct TASKS_CLEAR_SPEC; +impl crate::RegisterSpec for TASKS_CLEAR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_clear::W](W) writer structure"] +impl crate::Writable for TASKS_CLEAR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_CLEAR to value 0"] +impl crate::Resettable for TASKS_CLEAR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/timer0/tasks_count.rs b/src/timer0/tasks_count.rs new file mode 100644 index 0000000..38f08b2 --- /dev/null +++ b/src/timer0/tasks_count.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_COUNT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Increment Timer (Counter mode only)\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_count](index.html) module"] +pub struct TASKS_COUNT_SPEC; +impl crate::RegisterSpec for TASKS_COUNT_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_count::W](W) writer structure"] +impl crate::Writable for TASKS_COUNT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_COUNT to value 0"] +impl crate::Resettable for TASKS_COUNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/timer0/tasks_shutdown.rs b/src/timer0/tasks_shutdown.rs new file mode 100644 index 0000000..168a09f --- /dev/null +++ b/src/timer0/tasks_shutdown.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_SHUTDOWN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Deprecated register - Shut down timer\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_shutdown](index.html) module"] +pub struct TASKS_SHUTDOWN_SPEC; +impl crate::RegisterSpec for TASKS_SHUTDOWN_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_shutdown::W](W) writer structure"] +impl crate::Writable for TASKS_SHUTDOWN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_SHUTDOWN to value 0"] +impl crate::Resettable for TASKS_SHUTDOWN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/timer0/tasks_start.rs b/src/timer0/tasks_start.rs new file mode 100644 index 0000000..8ea274d --- /dev/null +++ b/src/timer0/tasks_start.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_START` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start Timer\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_start](index.html) module"] +pub struct TASKS_START_SPEC; +impl crate::RegisterSpec for TASKS_START_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_start::W](W) writer structure"] +impl crate::Writable for TASKS_START_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_START to value 0"] +impl crate::Resettable for TASKS_START_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/timer0/tasks_stop.rs b/src/timer0/tasks_stop.rs new file mode 100644 index 0000000..4a2b1f6 --- /dev/null +++ b/src/timer0/tasks_stop.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STOP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Stop Timer\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_stop](index.html) module"] +pub struct TASKS_STOP_SPEC; +impl crate::RegisterSpec for TASKS_STOP_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_stop::W](W) writer structure"] +impl crate::Writable for TASKS_STOP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STOP to value 0"] +impl crate::Resettable for TASKS_STOP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twi0.rs b/src/twi0.rs new file mode 100644 index 0000000..2944b99 --- /dev/null +++ b/src/twi0.rs @@ -0,0 +1,152 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "0x00 - Start TWI receive sequence"] + pub tasks_startrx: crate::Reg, + _reserved1: [u8; 0x04], + #[doc = "0x08 - Start TWI transmit sequence"] + pub tasks_starttx: crate::Reg, + _reserved2: [u8; 0x08], + #[doc = "0x14 - Stop TWI transaction"] + pub tasks_stop: crate::Reg, + _reserved3: [u8; 0x04], + #[doc = "0x1c - Suspend TWI transaction"] + pub tasks_suspend: crate::Reg, + #[doc = "0x20 - Resume TWI transaction"] + pub tasks_resume: crate::Reg, + _reserved5: [u8; 0xe0], + #[doc = "0x104 - TWI stopped"] + pub events_stopped: crate::Reg, + #[doc = "0x108 - TWI RXD byte received"] + pub events_rxdready: crate::Reg, + _reserved7: [u8; 0x10], + #[doc = "0x11c - TWI TXD byte sent"] + pub events_txdsent: crate::Reg, + _reserved8: [u8; 0x04], + #[doc = "0x124 - TWI error"] + pub events_error: crate::Reg, + _reserved9: [u8; 0x10], + #[doc = "0x138 - TWI byte boundary, generated before each byte that is sent or received"] + pub events_bb: crate::Reg, + _reserved10: [u8; 0x0c], + #[doc = "0x148 - TWI entered the suspended state"] + pub events_suspended: crate::Reg, + _reserved11: [u8; 0xb4], + #[doc = "0x200 - Shortcut register"] + pub shorts: crate::Reg, + _reserved12: [u8; 0x0100], + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved14: [u8; 0x01b8], + #[doc = "0x4c4 - Error source"] + pub errorsrc: crate::Reg, + _reserved15: [u8; 0x38], + #[doc = "0x500 - Enable TWI"] + pub enable: crate::Reg, + _reserved16: [u8; 0x04], + #[doc = "0x508 - Pin select for SCL"] + pub pselscl: crate::Reg, + #[doc = "0x50c - Pin select for SDA"] + pub pselsda: crate::Reg, + _reserved18: [u8; 0x08], + #[doc = "0x518 - RXD register"] + pub rxd: crate::Reg, + #[doc = "0x51c - TXD register"] + pub txd: crate::Reg, + _reserved20: [u8; 0x04], + #[doc = "0x524 - TWI frequency"] + pub frequency: crate::Reg, + _reserved21: [u8; 0x60], + #[doc = "0x588 - Address used in the TWI transfer"] + pub address: crate::Reg, +} +#[doc = "TASKS_STARTRX register accessor: an alias for `Reg`"] +pub type TASKS_STARTRX = crate::Reg; +#[doc = "Start TWI receive sequence"] +pub mod tasks_startrx; +#[doc = "TASKS_STARTTX register accessor: an alias for `Reg`"] +pub type TASKS_STARTTX = crate::Reg; +#[doc = "Start TWI transmit sequence"] +pub mod tasks_starttx; +#[doc = "TASKS_STOP register accessor: an alias for `Reg`"] +pub type TASKS_STOP = crate::Reg; +#[doc = "Stop TWI transaction"] +pub mod tasks_stop; +#[doc = "TASKS_SUSPEND register accessor: an alias for `Reg`"] +pub type TASKS_SUSPEND = crate::Reg; +#[doc = "Suspend TWI transaction"] +pub mod tasks_suspend; +#[doc = "TASKS_RESUME register accessor: an alias for `Reg`"] +pub type TASKS_RESUME = crate::Reg; +#[doc = "Resume TWI transaction"] +pub mod tasks_resume; +#[doc = "EVENTS_STOPPED register accessor: an alias for `Reg`"] +pub type EVENTS_STOPPED = crate::Reg; +#[doc = "TWI stopped"] +pub mod events_stopped; +#[doc = "EVENTS_RXDREADY register accessor: an alias for `Reg`"] +pub type EVENTS_RXDREADY = crate::Reg; +#[doc = "TWI RXD byte received"] +pub mod events_rxdready; +#[doc = "EVENTS_TXDSENT register accessor: an alias for `Reg`"] +pub type EVENTS_TXDSENT = crate::Reg; +#[doc = "TWI TXD byte sent"] +pub mod events_txdsent; +#[doc = "EVENTS_ERROR register accessor: an alias for `Reg`"] +pub type EVENTS_ERROR = crate::Reg; +#[doc = "TWI error"] +pub mod events_error; +#[doc = "EVENTS_BB register accessor: an alias for `Reg`"] +pub type EVENTS_BB = crate::Reg; +#[doc = "TWI byte boundary, generated before each byte that is sent or received"] +pub mod events_bb; +#[doc = "EVENTS_SUSPENDED register accessor: an alias for `Reg`"] +pub type EVENTS_SUSPENDED = crate::Reg; +#[doc = "TWI entered the suspended state"] +pub mod events_suspended; +#[doc = "SHORTS register accessor: an alias for `Reg`"] +pub type SHORTS = crate::Reg; +#[doc = "Shortcut register"] +pub mod shorts; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "ERRORSRC register accessor: an alias for `Reg`"] +pub type ERRORSRC = crate::Reg; +#[doc = "Error source"] +pub mod errorsrc; +#[doc = "ENABLE register accessor: an alias for `Reg`"] +pub type ENABLE = crate::Reg; +#[doc = "Enable TWI"] +pub mod enable; +#[doc = "PSELSCL register accessor: an alias for `Reg`"] +pub type PSELSCL = crate::Reg; +#[doc = "Pin select for SCL"] +pub mod pselscl; +#[doc = "PSELSDA register accessor: an alias for `Reg`"] +pub type PSELSDA = crate::Reg; +#[doc = "Pin select for SDA"] +pub mod pselsda; +#[doc = "RXD register accessor: an alias for `Reg`"] +pub type RXD = crate::Reg; +#[doc = "RXD register"] +pub mod rxd; +#[doc = "TXD register accessor: an alias for `Reg`"] +pub type TXD = crate::Reg; +#[doc = "TXD register"] +pub mod txd; +#[doc = "FREQUENCY register accessor: an alias for `Reg`"] +pub type FREQUENCY = crate::Reg; +#[doc = "TWI frequency"] +pub mod frequency; +#[doc = "ADDRESS register accessor: an alias for `Reg`"] +pub type ADDRESS = crate::Reg; +#[doc = "Address used in the TWI transfer"] +pub mod address; diff --git a/src/twi0/address.rs b/src/twi0/address.rs new file mode 100644 index 0000000..4dfac50 --- /dev/null +++ b/src/twi0/address.rs @@ -0,0 +1,102 @@ +#[doc = "Register `ADDRESS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ADDRESS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `ADDRESS` reader - Address used in the TWI transfer"] +pub struct ADDRESS_R(crate::FieldReader); +impl ADDRESS_R { + pub(crate) fn new(bits: u8) -> Self { + ADDRESS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ADDRESS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ADDRESS` writer - Address used in the TWI transfer"] +pub struct ADDRESS_W<'a> { + w: &'a mut W, +} +impl<'a> ADDRESS_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x7f) | (value as u32 & 0x7f); + self.w + } +} +impl R { + #[doc = "Bits 0:6 - Address used in the TWI transfer"] + #[inline(always)] + pub fn address(&self) -> ADDRESS_R { + ADDRESS_R::new((self.bits & 0x7f) as u8) + } +} +impl W { + #[doc = "Bits 0:6 - Address used in the TWI transfer"] + #[inline(always)] + pub fn address(&mut self) -> ADDRESS_W { + ADDRESS_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Address used in the TWI transfer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [address](index.html) module"] +pub struct ADDRESS_SPEC; +impl crate::RegisterSpec for ADDRESS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [address::R](R) reader structure"] +impl crate::Readable for ADDRESS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [address::W](W) writer structure"] +impl crate::Writable for ADDRESS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ADDRESS to value 0"] +impl crate::Resettable for ADDRESS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twi0/enable.rs b/src/twi0/enable.rs new file mode 100644 index 0000000..ed777ec --- /dev/null +++ b/src/twi0/enable.rs @@ -0,0 +1,151 @@ +#[doc = "Register `ENABLE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ENABLE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable TWI\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum ENABLE_A { + #[doc = "0: Disable TWI"] + DISABLED = 0, + #[doc = "5: Enable TWI"] + ENABLED = 5, +} +impl From for u8 { + #[inline(always)] + fn from(variant: ENABLE_A) -> Self { + variant as _ + } +} +#[doc = "Field `ENABLE` reader - Enable or disable TWI"] +pub struct ENABLE_R(crate::FieldReader); +impl ENABLE_R { + pub(crate) fn new(bits: u8) -> Self { + ENABLE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(ENABLE_A::DISABLED), + 5 => Some(ENABLE_A::ENABLED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENABLE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENABLE_A::ENABLED + } +} +impl core::ops::Deref for ENABLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENABLE` writer - Enable or disable TWI"] +pub struct ENABLE_W<'a> { + w: &'a mut W, +} +impl<'a> ENABLE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENABLE_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Disable TWI"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENABLE_A::DISABLED) + } + #[doc = "Enable TWI"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENABLE_A::ENABLED) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); + self.w + } +} +impl R { + #[doc = "Bits 0:3 - Enable or disable TWI"] + #[inline(always)] + pub fn enable(&self) -> ENABLE_R { + ENABLE_R::new((self.bits & 0x0f) as u8) + } +} +impl W { + #[doc = "Bits 0:3 - Enable or disable TWI"] + #[inline(always)] + pub fn enable(&mut self) -> ENABLE_W { + ENABLE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable TWI\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [enable](index.html) module"] +pub struct ENABLE_SPEC; +impl crate::RegisterSpec for ENABLE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [enable::R](R) reader structure"] +impl crate::Readable for ENABLE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [enable::W](W) writer structure"] +impl crate::Writable for ENABLE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ENABLE to value 0"] +impl crate::Resettable for ENABLE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twi0/errorsrc.rs b/src/twi0/errorsrc.rs new file mode 100644 index 0000000..9418acd --- /dev/null +++ b/src/twi0/errorsrc.rs @@ -0,0 +1,366 @@ +#[doc = "Register `ERRORSRC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ERRORSRC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Overrun error\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OVERRUN_A { + #[doc = "0: Read: no overrun occured"] + NOTPRESENT = 0, + #[doc = "1: Read: overrun occured"] + PRESENT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OVERRUN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OVERRUN` reader - Overrun error"] +pub struct OVERRUN_R(crate::FieldReader); +impl OVERRUN_R { + pub(crate) fn new(bits: bool) -> Self { + OVERRUN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> OVERRUN_A { + match self.bits { + false => OVERRUN_A::NOTPRESENT, + true => OVERRUN_A::PRESENT, + } + } + #[doc = "Checks if the value of the field is `NOTPRESENT`"] + #[inline(always)] + pub fn is_not_present(&self) -> bool { + **self == OVERRUN_A::NOTPRESENT + } + #[doc = "Checks if the value of the field is `PRESENT`"] + #[inline(always)] + pub fn is_present(&self) -> bool { + **self == OVERRUN_A::PRESENT + } +} +impl core::ops::Deref for OVERRUN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Overrun error\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OVERRUN_AW { + #[doc = "1: Write: clear error on writing '1'"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OVERRUN_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OVERRUN` writer - Overrun error"] +pub struct OVERRUN_W<'a> { + w: &'a mut W, +} +impl<'a> OVERRUN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: OVERRUN_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: clear error on writing '1'"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(OVERRUN_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "NACK received after sending the address (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ANACK_A { + #[doc = "0: Read: error not present"] + NOTPRESENT = 0, + #[doc = "1: Read: error present"] + PRESENT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ANACK_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ANACK` reader - NACK received after sending the address (write '1' to clear)"] +pub struct ANACK_R(crate::FieldReader); +impl ANACK_R { + pub(crate) fn new(bits: bool) -> Self { + ANACK_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ANACK_A { + match self.bits { + false => ANACK_A::NOTPRESENT, + true => ANACK_A::PRESENT, + } + } + #[doc = "Checks if the value of the field is `NOTPRESENT`"] + #[inline(always)] + pub fn is_not_present(&self) -> bool { + **self == ANACK_A::NOTPRESENT + } + #[doc = "Checks if the value of the field is `PRESENT`"] + #[inline(always)] + pub fn is_present(&self) -> bool { + **self == ANACK_A::PRESENT + } +} +impl core::ops::Deref for ANACK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "NACK received after sending the address (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ANACK_AW { + #[doc = "1: Write: clear error on writing '1'"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ANACK_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ANACK` writer - NACK received after sending the address (write '1' to clear)"] +pub struct ANACK_W<'a> { + w: &'a mut W, +} +impl<'a> ANACK_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ANACK_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: clear error on writing '1'"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(ANACK_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "NACK received after sending a data byte (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DNACK_A { + #[doc = "0: Read: error not present"] + NOTPRESENT = 0, + #[doc = "1: Read: error present"] + PRESENT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DNACK_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DNACK` reader - NACK received after sending a data byte (write '1' to clear)"] +pub struct DNACK_R(crate::FieldReader); +impl DNACK_R { + pub(crate) fn new(bits: bool) -> Self { + DNACK_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DNACK_A { + match self.bits { + false => DNACK_A::NOTPRESENT, + true => DNACK_A::PRESENT, + } + } + #[doc = "Checks if the value of the field is `NOTPRESENT`"] + #[inline(always)] + pub fn is_not_present(&self) -> bool { + **self == DNACK_A::NOTPRESENT + } + #[doc = "Checks if the value of the field is `PRESENT`"] + #[inline(always)] + pub fn is_present(&self) -> bool { + **self == DNACK_A::PRESENT + } +} +impl core::ops::Deref for DNACK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "NACK received after sending a data byte (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DNACK_AW { + #[doc = "1: Write: clear error on writing '1'"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DNACK_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DNACK` writer - NACK received after sending a data byte (write '1' to clear)"] +pub struct DNACK_W<'a> { + w: &'a mut W, +} +impl<'a> DNACK_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DNACK_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Write: clear error on writing '1'"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(DNACK_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +impl R { + #[doc = "Bit 0 - Overrun error"] + #[inline(always)] + pub fn overrun(&self) -> OVERRUN_R { + OVERRUN_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - NACK received after sending the address (write '1' to clear)"] + #[inline(always)] + pub fn anack(&self) -> ANACK_R { + ANACK_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - NACK received after sending a data byte (write '1' to clear)"] + #[inline(always)] + pub fn dnack(&self) -> DNACK_R { + DNACK_R::new(((self.bits >> 2) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Overrun error"] + #[inline(always)] + pub fn overrun(&mut self) -> OVERRUN_W { + OVERRUN_W { w: self } + } + #[doc = "Bit 1 - NACK received after sending the address (write '1' to clear)"] + #[inline(always)] + pub fn anack(&mut self) -> ANACK_W { + ANACK_W { w: self } + } + #[doc = "Bit 2 - NACK received after sending a data byte (write '1' to clear)"] + #[inline(always)] + pub fn dnack(&mut self) -> DNACK_W { + DNACK_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Error source\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [errorsrc](index.html) module"] +pub struct ERRORSRC_SPEC; +impl crate::RegisterSpec for ERRORSRC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [errorsrc::R](R) reader structure"] +impl crate::Readable for ERRORSRC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [errorsrc::W](W) writer structure"] +impl crate::Writable for ERRORSRC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ERRORSRC to value 0"] +impl crate::Resettable for ERRORSRC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twi0/events_bb.rs b/src/twi0/events_bb.rs new file mode 100644 index 0000000..c9ff3c2 --- /dev/null +++ b/src/twi0/events_bb.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_BB` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_BB` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "TWI byte boundary, generated before each byte that is sent or received\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_bb](index.html) module"] +pub struct EVENTS_BB_SPEC; +impl crate::RegisterSpec for EVENTS_BB_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_bb::R](R) reader structure"] +impl crate::Readable for EVENTS_BB_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_bb::W](W) writer structure"] +impl crate::Writable for EVENTS_BB_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_BB to value 0"] +impl crate::Resettable for EVENTS_BB_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twi0/events_error.rs b/src/twi0/events_error.rs new file mode 100644 index 0000000..0fbf806 --- /dev/null +++ b/src/twi0/events_error.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_ERROR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_ERROR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "TWI error\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_error](index.html) module"] +pub struct EVENTS_ERROR_SPEC; +impl crate::RegisterSpec for EVENTS_ERROR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_error::R](R) reader structure"] +impl crate::Readable for EVENTS_ERROR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_error::W](W) writer structure"] +impl crate::Writable for EVENTS_ERROR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_ERROR to value 0"] +impl crate::Resettable for EVENTS_ERROR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twi0/events_rxdready.rs b/src/twi0/events_rxdready.rs new file mode 100644 index 0000000..4a45587 --- /dev/null +++ b/src/twi0/events_rxdready.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_RXDREADY` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_RXDREADY` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "TWI RXD byte received\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_rxdready](index.html) module"] +pub struct EVENTS_RXDREADY_SPEC; +impl crate::RegisterSpec for EVENTS_RXDREADY_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_rxdready::R](R) reader structure"] +impl crate::Readable for EVENTS_RXDREADY_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_rxdready::W](W) writer structure"] +impl crate::Writable for EVENTS_RXDREADY_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_RXDREADY to value 0"] +impl crate::Resettable for EVENTS_RXDREADY_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twi0/events_stopped.rs b/src/twi0/events_stopped.rs new file mode 100644 index 0000000..44f8ec4 --- /dev/null +++ b/src/twi0/events_stopped.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_STOPPED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_STOPPED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "TWI stopped\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_stopped](index.html) module"] +pub struct EVENTS_STOPPED_SPEC; +impl crate::RegisterSpec for EVENTS_STOPPED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_stopped::R](R) reader structure"] +impl crate::Readable for EVENTS_STOPPED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_stopped::W](W) writer structure"] +impl crate::Writable for EVENTS_STOPPED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_STOPPED to value 0"] +impl crate::Resettable for EVENTS_STOPPED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twi0/events_suspended.rs b/src/twi0/events_suspended.rs new file mode 100644 index 0000000..d0b4c8b --- /dev/null +++ b/src/twi0/events_suspended.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_SUSPENDED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_SUSPENDED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "TWI entered the suspended state\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_suspended](index.html) module"] +pub struct EVENTS_SUSPENDED_SPEC; +impl crate::RegisterSpec for EVENTS_SUSPENDED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_suspended::R](R) reader structure"] +impl crate::Readable for EVENTS_SUSPENDED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_suspended::W](W) writer structure"] +impl crate::Writable for EVENTS_SUSPENDED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_SUSPENDED to value 0"] +impl crate::Resettable for EVENTS_SUSPENDED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twi0/events_txdsent.rs b/src/twi0/events_txdsent.rs new file mode 100644 index 0000000..6b144e7 --- /dev/null +++ b/src/twi0/events_txdsent.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_TXDSENT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_TXDSENT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "TWI TXD byte sent\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_txdsent](index.html) module"] +pub struct EVENTS_TXDSENT_SPEC; +impl crate::RegisterSpec for EVENTS_TXDSENT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_txdsent::R](R) reader structure"] +impl crate::Readable for EVENTS_TXDSENT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_txdsent::W](W) writer structure"] +impl crate::Writable for EVENTS_TXDSENT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_TXDSENT to value 0"] +impl crate::Resettable for EVENTS_TXDSENT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twi0/frequency.rs b/src/twi0/frequency.rs new file mode 100644 index 0000000..c8f1ecc --- /dev/null +++ b/src/twi0/frequency.rs @@ -0,0 +1,164 @@ +#[doc = "Register `FREQUENCY` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `FREQUENCY` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "TWI master clock frequency\n\nValue on reset: 67108864"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u32)] +pub enum FREQUENCY_A { + #[doc = "26738688: 100 kbps"] + K100 = 26738688, + #[doc = "67108864: 250 kbps"] + K250 = 67108864, + #[doc = "107479040: 400 kbps (actual rate 410.256 kbps)"] + K400 = 107479040, +} +impl From for u32 { + #[inline(always)] + fn from(variant: FREQUENCY_A) -> Self { + variant as _ + } +} +#[doc = "Field `FREQUENCY` reader - TWI master clock frequency"] +pub struct FREQUENCY_R(crate::FieldReader); +impl FREQUENCY_R { + pub(crate) fn new(bits: u32) -> Self { + FREQUENCY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 26738688 => Some(FREQUENCY_A::K100), + 67108864 => Some(FREQUENCY_A::K250), + 107479040 => Some(FREQUENCY_A::K400), + _ => None, + } + } + #[doc = "Checks if the value of the field is `K100`"] + #[inline(always)] + pub fn is_k100(&self) -> bool { + **self == FREQUENCY_A::K100 + } + #[doc = "Checks if the value of the field is `K250`"] + #[inline(always)] + pub fn is_k250(&self) -> bool { + **self == FREQUENCY_A::K250 + } + #[doc = "Checks if the value of the field is `K400`"] + #[inline(always)] + pub fn is_k400(&self) -> bool { + **self == FREQUENCY_A::K400 + } +} +impl core::ops::Deref for FREQUENCY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FREQUENCY` writer - TWI master clock frequency"] +pub struct FREQUENCY_W<'a> { + w: &'a mut W, +} +impl<'a> FREQUENCY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: FREQUENCY_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "100 kbps"] + #[inline(always)] + pub fn k100(self) -> &'a mut W { + self.variant(FREQUENCY_A::K100) + } + #[doc = "250 kbps"] + #[inline(always)] + pub fn k250(self) -> &'a mut W { + self.variant(FREQUENCY_A::K250) + } + #[doc = "400 kbps (actual rate 410.256 kbps)"] + #[inline(always)] + pub fn k400(self) -> &'a mut W { + self.variant(FREQUENCY_A::K400) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - TWI master clock frequency"] + #[inline(always)] + pub fn frequency(&self) -> FREQUENCY_R { + FREQUENCY_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - TWI master clock frequency"] + #[inline(always)] + pub fn frequency(&mut self) -> FREQUENCY_W { + FREQUENCY_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "TWI frequency\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [frequency](index.html) module"] +pub struct FREQUENCY_SPEC; +impl crate::RegisterSpec for FREQUENCY_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [frequency::R](R) reader structure"] +impl crate::Readable for FREQUENCY_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [frequency::W](W) writer structure"] +impl crate::Writable for FREQUENCY_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets FREQUENCY to value 0x0400_0000"] +impl crate::Resettable for FREQUENCY_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0400_0000 + } +} diff --git a/src/twi0/intenclr.rs b/src/twi0/intenclr.rs new file mode 100644 index 0000000..081f123 --- /dev/null +++ b/src/twi0/intenclr.rs @@ -0,0 +1,666 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` reader - Write '1' to Disable interrupt for STOPPED event"] +pub struct STOPPED_R(crate::FieldReader); +impl STOPPED_R { + pub(crate) fn new(bits: bool) -> Self { + STOPPED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STOPPED_A { + match self.bits { + false => STOPPED_A::DISABLED, + true => STOPPED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STOPPED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STOPPED_A::ENABLED + } +} +impl core::ops::Deref for STOPPED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` writer - Write '1' to Disable interrupt for STOPPED event"] +pub struct STOPPED_W<'a> { + w: &'a mut W, +} +impl<'a> STOPPED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STOPPED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(STOPPED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for RXDREADY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXDREADY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXDREADY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXDREADY` reader - Write '1' to Disable interrupt for RXDREADY event"] +pub struct RXDREADY_R(crate::FieldReader); +impl RXDREADY_R { + pub(crate) fn new(bits: bool) -> Self { + RXDREADY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXDREADY_A { + match self.bits { + false => RXDREADY_A::DISABLED, + true => RXDREADY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXDREADY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXDREADY_A::ENABLED + } +} +impl core::ops::Deref for RXDREADY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for RXDREADY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXDREADY_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXDREADY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXDREADY` writer - Write '1' to Disable interrupt for RXDREADY event"] +pub struct RXDREADY_W<'a> { + w: &'a mut W, +} +impl<'a> RXDREADY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXDREADY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(RXDREADY_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for TXDSENT event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXDSENT_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXDSENT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXDSENT` reader - Write '1' to Disable interrupt for TXDSENT event"] +pub struct TXDSENT_R(crate::FieldReader); +impl TXDSENT_R { + pub(crate) fn new(bits: bool) -> Self { + TXDSENT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXDSENT_A { + match self.bits { + false => TXDSENT_A::DISABLED, + true => TXDSENT_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXDSENT_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXDSENT_A::ENABLED + } +} +impl core::ops::Deref for TXDSENT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TXDSENT event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXDSENT_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXDSENT_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXDSENT` writer - Write '1' to Disable interrupt for TXDSENT event"] +pub struct TXDSENT_W<'a> { + w: &'a mut W, +} +impl<'a> TXDSENT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXDSENT_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TXDSENT_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` reader - Write '1' to Disable interrupt for ERROR event"] +pub struct ERROR_R(crate::FieldReader); +impl ERROR_R { + pub(crate) fn new(bits: bool) -> Self { + ERROR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ERROR_A { + match self.bits { + false => ERROR_A::DISABLED, + true => ERROR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ERROR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ERROR_A::ENABLED + } +} +impl core::ops::Deref for ERROR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` writer - Write '1' to Disable interrupt for ERROR event"] +pub struct ERROR_W<'a> { + w: &'a mut W, +} +impl<'a> ERROR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ERROR_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(ERROR_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for BB event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum BB_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: BB_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `BB` reader - Write '1' to Disable interrupt for BB event"] +pub struct BB_R(crate::FieldReader); +impl BB_R { + pub(crate) fn new(bits: bool) -> Self { + BB_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> BB_A { + match self.bits { + false => BB_A::DISABLED, + true => BB_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == BB_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == BB_A::ENABLED + } +} +impl core::ops::Deref for BB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for BB event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum BB_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: BB_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `BB` writer - Write '1' to Disable interrupt for BB event"] +pub struct BB_W<'a> { + w: &'a mut W, +} +impl<'a> BB_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: BB_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(BB_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for SUSPENDED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SUSPENDED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SUSPENDED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SUSPENDED` reader - Write '1' to Disable interrupt for SUSPENDED event"] +pub struct SUSPENDED_R(crate::FieldReader); +impl SUSPENDED_R { + pub(crate) fn new(bits: bool) -> Self { + SUSPENDED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SUSPENDED_A { + match self.bits { + false => SUSPENDED_A::DISABLED, + true => SUSPENDED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SUSPENDED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SUSPENDED_A::ENABLED + } +} +impl core::ops::Deref for SUSPENDED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for SUSPENDED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SUSPENDED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SUSPENDED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SUSPENDED` writer - Write '1' to Disable interrupt for SUSPENDED event"] +pub struct SUSPENDED_W<'a> { + w: &'a mut W, +} +impl<'a> SUSPENDED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SUSPENDED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(SUSPENDED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +impl R { + #[doc = "Bit 1 - Write '1' to Disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&self) -> STOPPED_R { + STOPPED_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for RXDREADY event"] + #[inline(always)] + pub fn rxdready(&self) -> RXDREADY_R { + RXDREADY_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 7 - Write '1' to Disable interrupt for TXDSENT event"] + #[inline(always)] + pub fn txdsent(&self) -> TXDSENT_R { + TXDSENT_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 9 - Write '1' to Disable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&self) -> ERROR_R { + ERROR_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 14 - Write '1' to Disable interrupt for BB event"] + #[inline(always)] + pub fn bb(&self) -> BB_R { + BB_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 18 - Write '1' to Disable interrupt for SUSPENDED event"] + #[inline(always)] + pub fn suspended(&self) -> SUSPENDED_R { + SUSPENDED_R::new(((self.bits >> 18) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 1 - Write '1' to Disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&mut self) -> STOPPED_W { + STOPPED_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for RXDREADY event"] + #[inline(always)] + pub fn rxdready(&mut self) -> RXDREADY_W { + RXDREADY_W { w: self } + } + #[doc = "Bit 7 - Write '1' to Disable interrupt for TXDSENT event"] + #[inline(always)] + pub fn txdsent(&mut self) -> TXDSENT_W { + TXDSENT_W { w: self } + } + #[doc = "Bit 9 - Write '1' to Disable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&mut self) -> ERROR_W { + ERROR_W { w: self } + } + #[doc = "Bit 14 - Write '1' to Disable interrupt for BB event"] + #[inline(always)] + pub fn bb(&mut self) -> BB_W { + BB_W { w: self } + } + #[doc = "Bit 18 - Write '1' to Disable interrupt for SUSPENDED event"] + #[inline(always)] + pub fn suspended(&mut self) -> SUSPENDED_W { + SUSPENDED_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twi0/intenset.rs b/src/twi0/intenset.rs new file mode 100644 index 0000000..948dc77 --- /dev/null +++ b/src/twi0/intenset.rs @@ -0,0 +1,666 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` reader - Write '1' to Enable interrupt for STOPPED event"] +pub struct STOPPED_R(crate::FieldReader); +impl STOPPED_R { + pub(crate) fn new(bits: bool) -> Self { + STOPPED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STOPPED_A { + match self.bits { + false => STOPPED_A::DISABLED, + true => STOPPED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STOPPED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STOPPED_A::ENABLED + } +} +impl core::ops::Deref for STOPPED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` writer - Write '1' to Enable interrupt for STOPPED event"] +pub struct STOPPED_W<'a> { + w: &'a mut W, +} +impl<'a> STOPPED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STOPPED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(STOPPED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for RXDREADY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXDREADY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXDREADY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXDREADY` reader - Write '1' to Enable interrupt for RXDREADY event"] +pub struct RXDREADY_R(crate::FieldReader); +impl RXDREADY_R { + pub(crate) fn new(bits: bool) -> Self { + RXDREADY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXDREADY_A { + match self.bits { + false => RXDREADY_A::DISABLED, + true => RXDREADY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXDREADY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXDREADY_A::ENABLED + } +} +impl core::ops::Deref for RXDREADY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for RXDREADY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXDREADY_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXDREADY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXDREADY` writer - Write '1' to Enable interrupt for RXDREADY event"] +pub struct RXDREADY_W<'a> { + w: &'a mut W, +} +impl<'a> RXDREADY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXDREADY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(RXDREADY_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for TXDSENT event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXDSENT_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXDSENT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXDSENT` reader - Write '1' to Enable interrupt for TXDSENT event"] +pub struct TXDSENT_R(crate::FieldReader); +impl TXDSENT_R { + pub(crate) fn new(bits: bool) -> Self { + TXDSENT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXDSENT_A { + match self.bits { + false => TXDSENT_A::DISABLED, + true => TXDSENT_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXDSENT_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXDSENT_A::ENABLED + } +} +impl core::ops::Deref for TXDSENT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TXDSENT event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXDSENT_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXDSENT_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXDSENT` writer - Write '1' to Enable interrupt for TXDSENT event"] +pub struct TXDSENT_W<'a> { + w: &'a mut W, +} +impl<'a> TXDSENT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXDSENT_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TXDSENT_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` reader - Write '1' to Enable interrupt for ERROR event"] +pub struct ERROR_R(crate::FieldReader); +impl ERROR_R { + pub(crate) fn new(bits: bool) -> Self { + ERROR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ERROR_A { + match self.bits { + false => ERROR_A::DISABLED, + true => ERROR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ERROR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ERROR_A::ENABLED + } +} +impl core::ops::Deref for ERROR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` writer - Write '1' to Enable interrupt for ERROR event"] +pub struct ERROR_W<'a> { + w: &'a mut W, +} +impl<'a> ERROR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ERROR_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(ERROR_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for BB event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum BB_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: BB_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `BB` reader - Write '1' to Enable interrupt for BB event"] +pub struct BB_R(crate::FieldReader); +impl BB_R { + pub(crate) fn new(bits: bool) -> Self { + BB_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> BB_A { + match self.bits { + false => BB_A::DISABLED, + true => BB_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == BB_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == BB_A::ENABLED + } +} +impl core::ops::Deref for BB_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for BB event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum BB_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: BB_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `BB` writer - Write '1' to Enable interrupt for BB event"] +pub struct BB_W<'a> { + w: &'a mut W, +} +impl<'a> BB_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: BB_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(BB_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for SUSPENDED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SUSPENDED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SUSPENDED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SUSPENDED` reader - Write '1' to Enable interrupt for SUSPENDED event"] +pub struct SUSPENDED_R(crate::FieldReader); +impl SUSPENDED_R { + pub(crate) fn new(bits: bool) -> Self { + SUSPENDED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SUSPENDED_A { + match self.bits { + false => SUSPENDED_A::DISABLED, + true => SUSPENDED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SUSPENDED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SUSPENDED_A::ENABLED + } +} +impl core::ops::Deref for SUSPENDED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for SUSPENDED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SUSPENDED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SUSPENDED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SUSPENDED` writer - Write '1' to Enable interrupt for SUSPENDED event"] +pub struct SUSPENDED_W<'a> { + w: &'a mut W, +} +impl<'a> SUSPENDED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SUSPENDED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(SUSPENDED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +impl R { + #[doc = "Bit 1 - Write '1' to Enable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&self) -> STOPPED_R { + STOPPED_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for RXDREADY event"] + #[inline(always)] + pub fn rxdready(&self) -> RXDREADY_R { + RXDREADY_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 7 - Write '1' to Enable interrupt for TXDSENT event"] + #[inline(always)] + pub fn txdsent(&self) -> TXDSENT_R { + TXDSENT_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 9 - Write '1' to Enable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&self) -> ERROR_R { + ERROR_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 14 - Write '1' to Enable interrupt for BB event"] + #[inline(always)] + pub fn bb(&self) -> BB_R { + BB_R::new(((self.bits >> 14) & 0x01) != 0) + } + #[doc = "Bit 18 - Write '1' to Enable interrupt for SUSPENDED event"] + #[inline(always)] + pub fn suspended(&self) -> SUSPENDED_R { + SUSPENDED_R::new(((self.bits >> 18) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 1 - Write '1' to Enable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&mut self) -> STOPPED_W { + STOPPED_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for RXDREADY event"] + #[inline(always)] + pub fn rxdready(&mut self) -> RXDREADY_W { + RXDREADY_W { w: self } + } + #[doc = "Bit 7 - Write '1' to Enable interrupt for TXDSENT event"] + #[inline(always)] + pub fn txdsent(&mut self) -> TXDSENT_W { + TXDSENT_W { w: self } + } + #[doc = "Bit 9 - Write '1' to Enable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&mut self) -> ERROR_W { + ERROR_W { w: self } + } + #[doc = "Bit 14 - Write '1' to Enable interrupt for BB event"] + #[inline(always)] + pub fn bb(&mut self) -> BB_W { + BB_W { w: self } + } + #[doc = "Bit 18 - Write '1' to Enable interrupt for SUSPENDED event"] + #[inline(always)] + pub fn suspended(&mut self) -> SUSPENDED_W { + SUSPENDED_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twi0/pselscl.rs b/src/twi0/pselscl.rs new file mode 100644 index 0000000..3d0e0d0 --- /dev/null +++ b/src/twi0/pselscl.rs @@ -0,0 +1,138 @@ +#[doc = "Register `PSELSCL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PSELSCL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Pin number configuration for TWI SCL signal\n\nValue on reset: 4294967295"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u32)] +pub enum PSELSCL_A { + #[doc = "4294967295: Disconnect"] + DISCONNECTED = 4294967295, +} +impl From for u32 { + #[inline(always)] + fn from(variant: PSELSCL_A) -> Self { + variant as _ + } +} +#[doc = "Field `PSELSCL` reader - Pin number configuration for TWI SCL signal"] +pub struct PSELSCL_R(crate::FieldReader); +impl PSELSCL_R { + pub(crate) fn new(bits: u32) -> Self { + PSELSCL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 4294967295 => Some(PSELSCL_A::DISCONNECTED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == PSELSCL_A::DISCONNECTED + } +} +impl core::ops::Deref for PSELSCL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PSELSCL` writer - Pin number configuration for TWI SCL signal"] +pub struct PSELSCL_W<'a> { + w: &'a mut W, +} +impl<'a> PSELSCL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PSELSCL_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(PSELSCL_A::DISCONNECTED) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Pin number configuration for TWI SCL signal"] + #[inline(always)] + pub fn pselscl(&self) -> PSELSCL_R { + PSELSCL_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Pin number configuration for TWI SCL signal"] + #[inline(always)] + pub fn pselscl(&mut self) -> PSELSCL_W { + PSELSCL_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for SCL\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pselscl](index.html) module"] +pub struct PSELSCL_SPEC; +impl crate::RegisterSpec for PSELSCL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pselscl::R](R) reader structure"] +impl crate::Readable for PSELSCL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pselscl::W](W) writer structure"] +impl crate::Writable for PSELSCL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PSELSCL to value 0xffff_ffff"] +impl crate::Resettable for PSELSCL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/twi0/pselsda.rs b/src/twi0/pselsda.rs new file mode 100644 index 0000000..316efc0 --- /dev/null +++ b/src/twi0/pselsda.rs @@ -0,0 +1,138 @@ +#[doc = "Register `PSELSDA` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PSELSDA` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Pin number configuration for TWI SDA signal\n\nValue on reset: 4294967295"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u32)] +pub enum PSELSDA_A { + #[doc = "4294967295: Disconnect"] + DISCONNECTED = 4294967295, +} +impl From for u32 { + #[inline(always)] + fn from(variant: PSELSDA_A) -> Self { + variant as _ + } +} +#[doc = "Field `PSELSDA` reader - Pin number configuration for TWI SDA signal"] +pub struct PSELSDA_R(crate::FieldReader); +impl PSELSDA_R { + pub(crate) fn new(bits: u32) -> Self { + PSELSDA_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 4294967295 => Some(PSELSDA_A::DISCONNECTED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == PSELSDA_A::DISCONNECTED + } +} +impl core::ops::Deref for PSELSDA_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PSELSDA` writer - Pin number configuration for TWI SDA signal"] +pub struct PSELSDA_W<'a> { + w: &'a mut W, +} +impl<'a> PSELSDA_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PSELSDA_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(PSELSDA_A::DISCONNECTED) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Pin number configuration for TWI SDA signal"] + #[inline(always)] + pub fn pselsda(&self) -> PSELSDA_R { + PSELSDA_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Pin number configuration for TWI SDA signal"] + #[inline(always)] + pub fn pselsda(&mut self) -> PSELSDA_W { + PSELSDA_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for SDA\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pselsda](index.html) module"] +pub struct PSELSDA_SPEC; +impl crate::RegisterSpec for PSELSDA_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pselsda::R](R) reader structure"] +impl crate::Readable for PSELSDA_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pselsda::W](W) writer structure"] +impl crate::Writable for PSELSDA_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PSELSDA to value 0xffff_ffff"] +impl crate::Resettable for PSELSDA_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/twi0/rxd.rs b/src/twi0/rxd.rs new file mode 100644 index 0000000..b7926e6 --- /dev/null +++ b/src/twi0/rxd.rs @@ -0,0 +1,52 @@ +#[doc = "Register `RXD` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `RXD` reader - RXD register"] +pub struct RXD_R(crate::FieldReader); +impl RXD_R { + pub(crate) fn new(bits: u8) -> Self { + RXD_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RXD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:7 - RXD register"] + #[inline(always)] + pub fn rxd(&self) -> RXD_R { + RXD_R::new((self.bits & 0xff) as u8) + } +} +#[doc = "RXD register\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 [rxd](index.html) module"] +pub struct RXD_SPEC; +impl crate::RegisterSpec for RXD_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rxd::R](R) reader structure"] +impl crate::Readable for RXD_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets RXD to value 0"] +impl crate::Resettable for RXD_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twi0/shorts.rs b/src/twi0/shorts.rs new file mode 100644 index 0000000..812af09 --- /dev/null +++ b/src/twi0/shorts.rs @@ -0,0 +1,252 @@ +#[doc = "Register `SHORTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SHORTS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Shortcut between BB event and SUSPEND task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum BB_SUSPEND_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: BB_SUSPEND_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `BB_SUSPEND` reader - Shortcut between BB event and SUSPEND task"] +pub struct BB_SUSPEND_R(crate::FieldReader); +impl BB_SUSPEND_R { + pub(crate) fn new(bits: bool) -> Self { + BB_SUSPEND_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> BB_SUSPEND_A { + match self.bits { + false => BB_SUSPEND_A::DISABLED, + true => BB_SUSPEND_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == BB_SUSPEND_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == BB_SUSPEND_A::ENABLED + } +} +impl core::ops::Deref for BB_SUSPEND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BB_SUSPEND` writer - Shortcut between BB event and SUSPEND task"] +pub struct BB_SUSPEND_W<'a> { + w: &'a mut W, +} +impl<'a> BB_SUSPEND_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: BB_SUSPEND_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(BB_SUSPEND_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(BB_SUSPEND_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Shortcut between BB event and STOP task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum BB_STOP_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: BB_STOP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `BB_STOP` reader - Shortcut between BB event and STOP task"] +pub struct BB_STOP_R(crate::FieldReader); +impl BB_STOP_R { + pub(crate) fn new(bits: bool) -> Self { + BB_STOP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> BB_STOP_A { + match self.bits { + false => BB_STOP_A::DISABLED, + true => BB_STOP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == BB_STOP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == BB_STOP_A::ENABLED + } +} +impl core::ops::Deref for BB_STOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BB_STOP` writer - Shortcut between BB event and STOP task"] +pub struct BB_STOP_W<'a> { + w: &'a mut W, +} +impl<'a> BB_STOP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: BB_STOP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(BB_STOP_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(BB_STOP_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +impl R { + #[doc = "Bit 0 - Shortcut between BB event and SUSPEND task"] + #[inline(always)] + pub fn bb_suspend(&self) -> BB_SUSPEND_R { + BB_SUSPEND_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Shortcut between BB event and STOP task"] + #[inline(always)] + pub fn bb_stop(&self) -> BB_STOP_R { + BB_STOP_R::new(((self.bits >> 1) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Shortcut between BB event and SUSPEND task"] + #[inline(always)] + pub fn bb_suspend(&mut self) -> BB_SUSPEND_W { + BB_SUSPEND_W { w: self } + } + #[doc = "Bit 1 - Shortcut between BB event and STOP task"] + #[inline(always)] + pub fn bb_stop(&mut self) -> BB_STOP_W { + BB_STOP_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Shortcut register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [shorts](index.html) module"] +pub struct SHORTS_SPEC; +impl crate::RegisterSpec for SHORTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [shorts::R](R) reader structure"] +impl crate::Readable for SHORTS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [shorts::W](W) writer structure"] +impl crate::Writable for SHORTS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SHORTS to value 0"] +impl crate::Resettable for SHORTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twi0/tasks_resume.rs b/src/twi0/tasks_resume.rs new file mode 100644 index 0000000..ef482eb --- /dev/null +++ b/src/twi0/tasks_resume.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_RESUME` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Resume TWI transaction\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_resume](index.html) module"] +pub struct TASKS_RESUME_SPEC; +impl crate::RegisterSpec for TASKS_RESUME_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_resume::W](W) writer structure"] +impl crate::Writable for TASKS_RESUME_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_RESUME to value 0"] +impl crate::Resettable for TASKS_RESUME_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twi0/tasks_startrx.rs b/src/twi0/tasks_startrx.rs new file mode 100644 index 0000000..cadc869 --- /dev/null +++ b/src/twi0/tasks_startrx.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STARTRX` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start TWI receive sequence\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_startrx](index.html) module"] +pub struct TASKS_STARTRX_SPEC; +impl crate::RegisterSpec for TASKS_STARTRX_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_startrx::W](W) writer structure"] +impl crate::Writable for TASKS_STARTRX_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STARTRX to value 0"] +impl crate::Resettable for TASKS_STARTRX_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twi0/tasks_starttx.rs b/src/twi0/tasks_starttx.rs new file mode 100644 index 0000000..9901ac3 --- /dev/null +++ b/src/twi0/tasks_starttx.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STARTTX` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start TWI transmit sequence\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_starttx](index.html) module"] +pub struct TASKS_STARTTX_SPEC; +impl crate::RegisterSpec for TASKS_STARTTX_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_starttx::W](W) writer structure"] +impl crate::Writable for TASKS_STARTTX_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STARTTX to value 0"] +impl crate::Resettable for TASKS_STARTTX_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twi0/tasks_stop.rs b/src/twi0/tasks_stop.rs new file mode 100644 index 0000000..db1d287 --- /dev/null +++ b/src/twi0/tasks_stop.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STOP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Stop TWI transaction\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_stop](index.html) module"] +pub struct TASKS_STOP_SPEC; +impl crate::RegisterSpec for TASKS_STOP_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_stop::W](W) writer structure"] +impl crate::Writable for TASKS_STOP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STOP to value 0"] +impl crate::Resettable for TASKS_STOP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twi0/tasks_suspend.rs b/src/twi0/tasks_suspend.rs new file mode 100644 index 0000000..33397ec --- /dev/null +++ b/src/twi0/tasks_suspend.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_SUSPEND` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Suspend TWI transaction\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_suspend](index.html) module"] +pub struct TASKS_SUSPEND_SPEC; +impl crate::RegisterSpec for TASKS_SUSPEND_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_suspend::W](W) writer structure"] +impl crate::Writable for TASKS_SUSPEND_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_SUSPEND to value 0"] +impl crate::Resettable for TASKS_SUSPEND_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twi0/txd.rs b/src/twi0/txd.rs new file mode 100644 index 0000000..6d0f1e4 --- /dev/null +++ b/src/twi0/txd.rs @@ -0,0 +1,102 @@ +#[doc = "Register `TXD` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `TXD` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `TXD` reader - TXD register"] +pub struct TXD_R(crate::FieldReader); +impl TXD_R { + pub(crate) fn new(bits: u8) -> Self { + TXD_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for TXD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TXD` writer - TXD register"] +pub struct TXD_W<'a> { + w: &'a mut W, +} +impl<'a> TXD_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - TXD register"] + #[inline(always)] + pub fn txd(&self) -> TXD_R { + TXD_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - TXD register"] + #[inline(always)] + pub fn txd(&mut self) -> TXD_W { + TXD_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "TXD register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [txd](index.html) module"] +pub struct TXD_SPEC; +impl crate::RegisterSpec for TXD_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [txd::R](R) reader structure"] +impl crate::Readable for TXD_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [txd::W](W) writer structure"] +impl crate::Writable for TXD_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TXD to value 0"] +impl crate::Resettable for TXD_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twim0.rs b/src/twim0.rs new file mode 100644 index 0000000..517428c --- /dev/null +++ b/src/twim0.rs @@ -0,0 +1,186 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "0x00 - Start TWI receive sequence"] + pub tasks_startrx: crate::Reg, + _reserved1: [u8; 0x04], + #[doc = "0x08 - Start TWI transmit sequence"] + pub tasks_starttx: crate::Reg, + _reserved2: [u8; 0x08], + #[doc = "0x14 - Stop TWI transaction. Must be issued while the TWI master is not suspended."] + pub tasks_stop: crate::Reg, + _reserved3: [u8; 0x04], + #[doc = "0x1c - Suspend TWI transaction"] + pub tasks_suspend: crate::Reg, + #[doc = "0x20 - Resume TWI transaction"] + pub tasks_resume: crate::Reg, + _reserved5: [u8; 0xe0], + #[doc = "0x104 - TWI stopped"] + pub events_stopped: crate::Reg, + _reserved6: [u8; 0x1c], + #[doc = "0x124 - TWI error"] + pub events_error: crate::Reg, + _reserved7: [u8; 0x20], + #[doc = "0x148 - Last byte has been sent out after the SUSPEND task has been issued, TWI traffic is now suspended."] + pub events_suspended: crate::Reg, + #[doc = "0x14c - Receive sequence started"] + pub events_rxstarted: crate::Reg, + #[doc = "0x150 - Transmit sequence started"] + pub events_txstarted: crate::Reg, + _reserved10: [u8; 0x08], + #[doc = "0x15c - Byte boundary, starting to receive the last byte"] + pub events_lastrx: crate::Reg, + #[doc = "0x160 - Byte boundary, starting to transmit the last byte"] + pub events_lasttx: crate::Reg, + _reserved12: [u8; 0x9c], + #[doc = "0x200 - Shortcut register"] + pub shorts: crate::Reg, + _reserved13: [u8; 0xfc], + #[doc = "0x300 - Enable or disable interrupt"] + pub inten: crate::Reg, + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved16: [u8; 0x01b8], + #[doc = "0x4c4 - Error source"] + pub errorsrc: crate::Reg, + _reserved17: [u8; 0x38], + #[doc = "0x500 - Enable TWIM"] + pub enable: crate::Reg, + _reserved18: [u8; 0x04], + #[doc = "0x508..0x510 - Unspecified"] + pub psel: PSEL, + _reserved19: [u8; 0x14], + #[doc = "0x524 - TWI frequency"] + pub frequency: crate::Reg, + _reserved20: [u8; 0x0c], + #[doc = "0x534..0x544 - RXD EasyDMA channel"] + pub rxd: RXD, + #[doc = "0x544..0x554 - TXD EasyDMA channel"] + pub txd: TXD, + _reserved22: [u8; 0x34], + #[doc = "0x588 - Address used in the TWI transfer"] + pub address: crate::Reg, +} +#[doc = r"Register block"] +#[repr(C)] +pub struct PSEL { + #[doc = "0x00 - Pin select for SCL signal"] + pub scl: crate::Reg, + #[doc = "0x04 - Pin select for SDA signal"] + pub sda: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod psel; +#[doc = r"Register block"] +#[repr(C)] +pub struct RXD { + #[doc = "0x00 - Data pointer"] + pub ptr: crate::Reg, + #[doc = "0x04 - Maximum number of bytes in receive buffer"] + pub maxcnt: crate::Reg, + #[doc = "0x08 - Number of bytes transferred in the last transaction"] + pub amount: crate::Reg, + #[doc = "0x0c - EasyDMA list type"] + pub list: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "RXD EasyDMA channel"] +pub mod rxd; +#[doc = r"Register block"] +#[repr(C)] +pub struct TXD { + #[doc = "0x00 - Data pointer"] + pub ptr: crate::Reg, + #[doc = "0x04 - Maximum number of bytes in transmit buffer"] + pub maxcnt: crate::Reg, + #[doc = "0x08 - Number of bytes transferred in the last transaction"] + pub amount: crate::Reg, + #[doc = "0x0c - EasyDMA list type"] + pub list: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "TXD EasyDMA channel"] +pub mod txd; +#[doc = "TASKS_STARTRX register accessor: an alias for `Reg`"] +pub type TASKS_STARTRX = crate::Reg; +#[doc = "Start TWI receive sequence"] +pub mod tasks_startrx; +#[doc = "TASKS_STARTTX register accessor: an alias for `Reg`"] +pub type TASKS_STARTTX = crate::Reg; +#[doc = "Start TWI transmit sequence"] +pub mod tasks_starttx; +#[doc = "TASKS_STOP register accessor: an alias for `Reg`"] +pub type TASKS_STOP = crate::Reg; +#[doc = "Stop TWI transaction. Must be issued while the TWI master is not suspended."] +pub mod tasks_stop; +#[doc = "TASKS_SUSPEND register accessor: an alias for `Reg`"] +pub type TASKS_SUSPEND = crate::Reg; +#[doc = "Suspend TWI transaction"] +pub mod tasks_suspend; +#[doc = "TASKS_RESUME register accessor: an alias for `Reg`"] +pub type TASKS_RESUME = crate::Reg; +#[doc = "Resume TWI transaction"] +pub mod tasks_resume; +#[doc = "EVENTS_STOPPED register accessor: an alias for `Reg`"] +pub type EVENTS_STOPPED = crate::Reg; +#[doc = "TWI stopped"] +pub mod events_stopped; +#[doc = "EVENTS_ERROR register accessor: an alias for `Reg`"] +pub type EVENTS_ERROR = crate::Reg; +#[doc = "TWI error"] +pub mod events_error; +#[doc = "EVENTS_SUSPENDED register accessor: an alias for `Reg`"] +pub type EVENTS_SUSPENDED = crate::Reg; +#[doc = "Last byte has been sent out after the SUSPEND task has been issued, TWI traffic is now suspended."] +pub mod events_suspended; +#[doc = "EVENTS_RXSTARTED register accessor: an alias for `Reg`"] +pub type EVENTS_RXSTARTED = crate::Reg; +#[doc = "Receive sequence started"] +pub mod events_rxstarted; +#[doc = "EVENTS_TXSTARTED register accessor: an alias for `Reg`"] +pub type EVENTS_TXSTARTED = crate::Reg; +#[doc = "Transmit sequence started"] +pub mod events_txstarted; +#[doc = "EVENTS_LASTRX register accessor: an alias for `Reg`"] +pub type EVENTS_LASTRX = crate::Reg; +#[doc = "Byte boundary, starting to receive the last byte"] +pub mod events_lastrx; +#[doc = "EVENTS_LASTTX register accessor: an alias for `Reg`"] +pub type EVENTS_LASTTX = crate::Reg; +#[doc = "Byte boundary, starting to transmit the last byte"] +pub mod events_lasttx; +#[doc = "SHORTS register accessor: an alias for `Reg`"] +pub type SHORTS = crate::Reg; +#[doc = "Shortcut register"] +pub mod shorts; +#[doc = "INTEN register accessor: an alias for `Reg`"] +pub type INTEN = crate::Reg; +#[doc = "Enable or disable interrupt"] +pub mod inten; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "ERRORSRC register accessor: an alias for `Reg`"] +pub type ERRORSRC = crate::Reg; +#[doc = "Error source"] +pub mod errorsrc; +#[doc = "ENABLE register accessor: an alias for `Reg`"] +pub type ENABLE = crate::Reg; +#[doc = "Enable TWIM"] +pub mod enable; +#[doc = "FREQUENCY register accessor: an alias for `Reg`"] +pub type FREQUENCY = crate::Reg; +#[doc = "TWI frequency"] +pub mod frequency; +#[doc = "ADDRESS register accessor: an alias for `Reg`"] +pub type ADDRESS = crate::Reg; +#[doc = "Address used in the TWI transfer"] +pub mod address; diff --git a/src/twim0/address.rs b/src/twim0/address.rs new file mode 100644 index 0000000..4dfac50 --- /dev/null +++ b/src/twim0/address.rs @@ -0,0 +1,102 @@ +#[doc = "Register `ADDRESS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ADDRESS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `ADDRESS` reader - Address used in the TWI transfer"] +pub struct ADDRESS_R(crate::FieldReader); +impl ADDRESS_R { + pub(crate) fn new(bits: u8) -> Self { + ADDRESS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ADDRESS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ADDRESS` writer - Address used in the TWI transfer"] +pub struct ADDRESS_W<'a> { + w: &'a mut W, +} +impl<'a> ADDRESS_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x7f) | (value as u32 & 0x7f); + self.w + } +} +impl R { + #[doc = "Bits 0:6 - Address used in the TWI transfer"] + #[inline(always)] + pub fn address(&self) -> ADDRESS_R { + ADDRESS_R::new((self.bits & 0x7f) as u8) + } +} +impl W { + #[doc = "Bits 0:6 - Address used in the TWI transfer"] + #[inline(always)] + pub fn address(&mut self) -> ADDRESS_W { + ADDRESS_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Address used in the TWI transfer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [address](index.html) module"] +pub struct ADDRESS_SPEC; +impl crate::RegisterSpec for ADDRESS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [address::R](R) reader structure"] +impl crate::Readable for ADDRESS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [address::W](W) writer structure"] +impl crate::Writable for ADDRESS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ADDRESS to value 0"] +impl crate::Resettable for ADDRESS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twim0/enable.rs b/src/twim0/enable.rs new file mode 100644 index 0000000..36c1311 --- /dev/null +++ b/src/twim0/enable.rs @@ -0,0 +1,151 @@ +#[doc = "Register `ENABLE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ENABLE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable TWIM\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum ENABLE_A { + #[doc = "0: Disable TWIM"] + DISABLED = 0, + #[doc = "6: Enable TWIM"] + ENABLED = 6, +} +impl From for u8 { + #[inline(always)] + fn from(variant: ENABLE_A) -> Self { + variant as _ + } +} +#[doc = "Field `ENABLE` reader - Enable or disable TWIM"] +pub struct ENABLE_R(crate::FieldReader); +impl ENABLE_R { + pub(crate) fn new(bits: u8) -> Self { + ENABLE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(ENABLE_A::DISABLED), + 6 => Some(ENABLE_A::ENABLED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENABLE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENABLE_A::ENABLED + } +} +impl core::ops::Deref for ENABLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENABLE` writer - Enable or disable TWIM"] +pub struct ENABLE_W<'a> { + w: &'a mut W, +} +impl<'a> ENABLE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENABLE_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Disable TWIM"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENABLE_A::DISABLED) + } + #[doc = "Enable TWIM"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENABLE_A::ENABLED) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); + self.w + } +} +impl R { + #[doc = "Bits 0:3 - Enable or disable TWIM"] + #[inline(always)] + pub fn enable(&self) -> ENABLE_R { + ENABLE_R::new((self.bits & 0x0f) as u8) + } +} +impl W { + #[doc = "Bits 0:3 - Enable or disable TWIM"] + #[inline(always)] + pub fn enable(&mut self) -> ENABLE_W { + ENABLE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable TWIM\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [enable](index.html) module"] +pub struct ENABLE_SPEC; +impl crate::RegisterSpec for ENABLE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [enable::R](R) reader structure"] +impl crate::Readable for ENABLE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [enable::W](W) writer structure"] +impl crate::Writable for ENABLE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ENABLE to value 0"] +impl crate::Resettable for ENABLE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twim0/errorsrc.rs b/src/twim0/errorsrc.rs new file mode 100644 index 0000000..bd283cd --- /dev/null +++ b/src/twim0/errorsrc.rs @@ -0,0 +1,345 @@ +#[doc = "Register `ERRORSRC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ERRORSRC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Overrun error\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OVERRUN_A { + #[doc = "0: Error did not occur"] + NOTRECEIVED = 0, + #[doc = "1: Error occurred"] + RECEIVED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OVERRUN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OVERRUN` reader - Overrun error"] +pub struct OVERRUN_R(crate::FieldReader); +impl OVERRUN_R { + pub(crate) fn new(bits: bool) -> Self { + OVERRUN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> OVERRUN_A { + match self.bits { + false => OVERRUN_A::NOTRECEIVED, + true => OVERRUN_A::RECEIVED, + } + } + #[doc = "Checks if the value of the field is `NOTRECEIVED`"] + #[inline(always)] + pub fn is_not_received(&self) -> bool { + **self == OVERRUN_A::NOTRECEIVED + } + #[doc = "Checks if the value of the field is `RECEIVED`"] + #[inline(always)] + pub fn is_received(&self) -> bool { + **self == OVERRUN_A::RECEIVED + } +} +impl core::ops::Deref for OVERRUN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OVERRUN` writer - Overrun error"] +pub struct OVERRUN_W<'a> { + w: &'a mut W, +} +impl<'a> OVERRUN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: OVERRUN_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Error did not occur"] + #[inline(always)] + pub fn not_received(self) -> &'a mut W { + self.variant(OVERRUN_A::NOTRECEIVED) + } + #[doc = "Error occurred"] + #[inline(always)] + pub fn received(self) -> &'a mut W { + self.variant(OVERRUN_A::RECEIVED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "NACK received after sending the address (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ANACK_A { + #[doc = "0: Error did not occur"] + NOTRECEIVED = 0, + #[doc = "1: Error occurred"] + RECEIVED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ANACK_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ANACK` reader - NACK received after sending the address (write '1' to clear)"] +pub struct ANACK_R(crate::FieldReader); +impl ANACK_R { + pub(crate) fn new(bits: bool) -> Self { + ANACK_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ANACK_A { + match self.bits { + false => ANACK_A::NOTRECEIVED, + true => ANACK_A::RECEIVED, + } + } + #[doc = "Checks if the value of the field is `NOTRECEIVED`"] + #[inline(always)] + pub fn is_not_received(&self) -> bool { + **self == ANACK_A::NOTRECEIVED + } + #[doc = "Checks if the value of the field is `RECEIVED`"] + #[inline(always)] + pub fn is_received(&self) -> bool { + **self == ANACK_A::RECEIVED + } +} +impl core::ops::Deref for ANACK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ANACK` writer - NACK received after sending the address (write '1' to clear)"] +pub struct ANACK_W<'a> { + w: &'a mut W, +} +impl<'a> ANACK_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ANACK_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Error did not occur"] + #[inline(always)] + pub fn not_received(self) -> &'a mut W { + self.variant(ANACK_A::NOTRECEIVED) + } + #[doc = "Error occurred"] + #[inline(always)] + pub fn received(self) -> &'a mut W { + self.variant(ANACK_A::RECEIVED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "NACK received after sending a data byte (write '1' to clear)\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DNACK_A { + #[doc = "0: Error did not occur"] + NOTRECEIVED = 0, + #[doc = "1: Error occurred"] + RECEIVED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DNACK_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DNACK` reader - NACK received after sending a data byte (write '1' to clear)"] +pub struct DNACK_R(crate::FieldReader); +impl DNACK_R { + pub(crate) fn new(bits: bool) -> Self { + DNACK_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DNACK_A { + match self.bits { + false => DNACK_A::NOTRECEIVED, + true => DNACK_A::RECEIVED, + } + } + #[doc = "Checks if the value of the field is `NOTRECEIVED`"] + #[inline(always)] + pub fn is_not_received(&self) -> bool { + **self == DNACK_A::NOTRECEIVED + } + #[doc = "Checks if the value of the field is `RECEIVED`"] + #[inline(always)] + pub fn is_received(&self) -> bool { + **self == DNACK_A::RECEIVED + } +} +impl core::ops::Deref for DNACK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DNACK` writer - NACK received after sending a data byte (write '1' to clear)"] +pub struct DNACK_W<'a> { + w: &'a mut W, +} +impl<'a> DNACK_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DNACK_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Error did not occur"] + #[inline(always)] + pub fn not_received(self) -> &'a mut W { + self.variant(DNACK_A::NOTRECEIVED) + } + #[doc = "Error occurred"] + #[inline(always)] + pub fn received(self) -> &'a mut W { + self.variant(DNACK_A::RECEIVED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +impl R { + #[doc = "Bit 0 - Overrun error"] + #[inline(always)] + pub fn overrun(&self) -> OVERRUN_R { + OVERRUN_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - NACK received after sending the address (write '1' to clear)"] + #[inline(always)] + pub fn anack(&self) -> ANACK_R { + ANACK_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - NACK received after sending a data byte (write '1' to clear)"] + #[inline(always)] + pub fn dnack(&self) -> DNACK_R { + DNACK_R::new(((self.bits >> 2) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Overrun error"] + #[inline(always)] + pub fn overrun(&mut self) -> OVERRUN_W { + OVERRUN_W { w: self } + } + #[doc = "Bit 1 - NACK received after sending the address (write '1' to clear)"] + #[inline(always)] + pub fn anack(&mut self) -> ANACK_W { + ANACK_W { w: self } + } + #[doc = "Bit 2 - NACK received after sending a data byte (write '1' to clear)"] + #[inline(always)] + pub fn dnack(&mut self) -> DNACK_W { + DNACK_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Error source\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [errorsrc](index.html) module"] +pub struct ERRORSRC_SPEC; +impl crate::RegisterSpec for ERRORSRC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [errorsrc::R](R) reader structure"] +impl crate::Readable for ERRORSRC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [errorsrc::W](W) writer structure"] +impl crate::Writable for ERRORSRC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ERRORSRC to value 0"] +impl crate::Resettable for ERRORSRC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twim0/events_error.rs b/src/twim0/events_error.rs new file mode 100644 index 0000000..0fbf806 --- /dev/null +++ b/src/twim0/events_error.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_ERROR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_ERROR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "TWI error\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_error](index.html) module"] +pub struct EVENTS_ERROR_SPEC; +impl crate::RegisterSpec for EVENTS_ERROR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_error::R](R) reader structure"] +impl crate::Readable for EVENTS_ERROR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_error::W](W) writer structure"] +impl crate::Writable for EVENTS_ERROR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_ERROR to value 0"] +impl crate::Resettable for EVENTS_ERROR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twim0/events_lastrx.rs b/src/twim0/events_lastrx.rs new file mode 100644 index 0000000..585809c --- /dev/null +++ b/src/twim0/events_lastrx.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_LASTRX` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_LASTRX` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Byte boundary, starting to receive the last byte\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_lastrx](index.html) module"] +pub struct EVENTS_LASTRX_SPEC; +impl crate::RegisterSpec for EVENTS_LASTRX_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_lastrx::R](R) reader structure"] +impl crate::Readable for EVENTS_LASTRX_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_lastrx::W](W) writer structure"] +impl crate::Writable for EVENTS_LASTRX_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_LASTRX to value 0"] +impl crate::Resettable for EVENTS_LASTRX_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twim0/events_lasttx.rs b/src/twim0/events_lasttx.rs new file mode 100644 index 0000000..c721b6c --- /dev/null +++ b/src/twim0/events_lasttx.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_LASTTX` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_LASTTX` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Byte boundary, starting to transmit the last byte\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_lasttx](index.html) module"] +pub struct EVENTS_LASTTX_SPEC; +impl crate::RegisterSpec for EVENTS_LASTTX_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_lasttx::R](R) reader structure"] +impl crate::Readable for EVENTS_LASTTX_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_lasttx::W](W) writer structure"] +impl crate::Writable for EVENTS_LASTTX_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_LASTTX to value 0"] +impl crate::Resettable for EVENTS_LASTTX_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twim0/events_rxstarted.rs b/src/twim0/events_rxstarted.rs new file mode 100644 index 0000000..01f4b97 --- /dev/null +++ b/src/twim0/events_rxstarted.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_RXSTARTED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_RXSTARTED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Receive sequence started\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_rxstarted](index.html) module"] +pub struct EVENTS_RXSTARTED_SPEC; +impl crate::RegisterSpec for EVENTS_RXSTARTED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_rxstarted::R](R) reader structure"] +impl crate::Readable for EVENTS_RXSTARTED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_rxstarted::W](W) writer structure"] +impl crate::Writable for EVENTS_RXSTARTED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_RXSTARTED to value 0"] +impl crate::Resettable for EVENTS_RXSTARTED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twim0/events_stopped.rs b/src/twim0/events_stopped.rs new file mode 100644 index 0000000..44f8ec4 --- /dev/null +++ b/src/twim0/events_stopped.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_STOPPED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_STOPPED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "TWI stopped\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_stopped](index.html) module"] +pub struct EVENTS_STOPPED_SPEC; +impl crate::RegisterSpec for EVENTS_STOPPED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_stopped::R](R) reader structure"] +impl crate::Readable for EVENTS_STOPPED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_stopped::W](W) writer structure"] +impl crate::Writable for EVENTS_STOPPED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_STOPPED to value 0"] +impl crate::Resettable for EVENTS_STOPPED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twim0/events_suspended.rs b/src/twim0/events_suspended.rs new file mode 100644 index 0000000..601f6da --- /dev/null +++ b/src/twim0/events_suspended.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_SUSPENDED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_SUSPENDED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Last byte has been sent out after the SUSPEND task has been issued, TWI traffic is now suspended.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_suspended](index.html) module"] +pub struct EVENTS_SUSPENDED_SPEC; +impl crate::RegisterSpec for EVENTS_SUSPENDED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_suspended::R](R) reader structure"] +impl crate::Readable for EVENTS_SUSPENDED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_suspended::W](W) writer structure"] +impl crate::Writable for EVENTS_SUSPENDED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_SUSPENDED to value 0"] +impl crate::Resettable for EVENTS_SUSPENDED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twim0/events_txstarted.rs b/src/twim0/events_txstarted.rs new file mode 100644 index 0000000..dde90a1 --- /dev/null +++ b/src/twim0/events_txstarted.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_TXSTARTED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_TXSTARTED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Transmit sequence started\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_txstarted](index.html) module"] +pub struct EVENTS_TXSTARTED_SPEC; +impl crate::RegisterSpec for EVENTS_TXSTARTED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_txstarted::R](R) reader structure"] +impl crate::Readable for EVENTS_TXSTARTED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_txstarted::W](W) writer structure"] +impl crate::Writable for EVENTS_TXSTARTED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_TXSTARTED to value 0"] +impl crate::Resettable for EVENTS_TXSTARTED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twim0/frequency.rs b/src/twim0/frequency.rs new file mode 100644 index 0000000..ab8dc82 --- /dev/null +++ b/src/twim0/frequency.rs @@ -0,0 +1,164 @@ +#[doc = "Register `FREQUENCY` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `FREQUENCY` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "TWI master clock frequency\n\nValue on reset: 67108864"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u32)] +pub enum FREQUENCY_A { + #[doc = "26738688: 100 kbps"] + K100 = 26738688, + #[doc = "67108864: 250 kbps"] + K250 = 67108864, + #[doc = "104857600: 400 kbps"] + K400 = 104857600, +} +impl From for u32 { + #[inline(always)] + fn from(variant: FREQUENCY_A) -> Self { + variant as _ + } +} +#[doc = "Field `FREQUENCY` reader - TWI master clock frequency"] +pub struct FREQUENCY_R(crate::FieldReader); +impl FREQUENCY_R { + pub(crate) fn new(bits: u32) -> Self { + FREQUENCY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 26738688 => Some(FREQUENCY_A::K100), + 67108864 => Some(FREQUENCY_A::K250), + 104857600 => Some(FREQUENCY_A::K400), + _ => None, + } + } + #[doc = "Checks if the value of the field is `K100`"] + #[inline(always)] + pub fn is_k100(&self) -> bool { + **self == FREQUENCY_A::K100 + } + #[doc = "Checks if the value of the field is `K250`"] + #[inline(always)] + pub fn is_k250(&self) -> bool { + **self == FREQUENCY_A::K250 + } + #[doc = "Checks if the value of the field is `K400`"] + #[inline(always)] + pub fn is_k400(&self) -> bool { + **self == FREQUENCY_A::K400 + } +} +impl core::ops::Deref for FREQUENCY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FREQUENCY` writer - TWI master clock frequency"] +pub struct FREQUENCY_W<'a> { + w: &'a mut W, +} +impl<'a> FREQUENCY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: FREQUENCY_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "100 kbps"] + #[inline(always)] + pub fn k100(self) -> &'a mut W { + self.variant(FREQUENCY_A::K100) + } + #[doc = "250 kbps"] + #[inline(always)] + pub fn k250(self) -> &'a mut W { + self.variant(FREQUENCY_A::K250) + } + #[doc = "400 kbps"] + #[inline(always)] + pub fn k400(self) -> &'a mut W { + self.variant(FREQUENCY_A::K400) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - TWI master clock frequency"] + #[inline(always)] + pub fn frequency(&self) -> FREQUENCY_R { + FREQUENCY_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - TWI master clock frequency"] + #[inline(always)] + pub fn frequency(&mut self) -> FREQUENCY_W { + FREQUENCY_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "TWI frequency\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [frequency](index.html) module"] +pub struct FREQUENCY_SPEC; +impl crate::RegisterSpec for FREQUENCY_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [frequency::R](R) reader structure"] +impl crate::Readable for FREQUENCY_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [frequency::W](W) writer structure"] +impl crate::Writable for FREQUENCY_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets FREQUENCY to value 0x0400_0000"] +impl crate::Resettable for FREQUENCY_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0400_0000 + } +} diff --git a/src/twim0/inten.rs b/src/twim0/inten.rs new file mode 100644 index 0000000..d894ddd --- /dev/null +++ b/src/twim0/inten.rs @@ -0,0 +1,717 @@ +#[doc = "Register `INTEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` reader - Enable or disable interrupt for STOPPED event"] +pub struct STOPPED_R(crate::FieldReader); +impl STOPPED_R { + pub(crate) fn new(bits: bool) -> Self { + STOPPED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STOPPED_A { + match self.bits { + false => STOPPED_A::DISABLED, + true => STOPPED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STOPPED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STOPPED_A::ENABLED + } +} +impl core::ops::Deref for STOPPED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STOPPED` writer - Enable or disable interrupt for STOPPED event"] +pub struct STOPPED_W<'a> { + w: &'a mut W, +} +impl<'a> STOPPED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STOPPED_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(STOPPED_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(STOPPED_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Enable or disable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` reader - Enable or disable interrupt for ERROR event"] +pub struct ERROR_R(crate::FieldReader); +impl ERROR_R { + pub(crate) fn new(bits: bool) -> Self { + ERROR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ERROR_A { + match self.bits { + false => ERROR_A::DISABLED, + true => ERROR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ERROR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ERROR_A::ENABLED + } +} +impl core::ops::Deref for ERROR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ERROR` writer - Enable or disable interrupt for ERROR event"] +pub struct ERROR_W<'a> { + w: &'a mut W, +} +impl<'a> ERROR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ERROR_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ERROR_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ERROR_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Enable or disable interrupt for SUSPENDED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SUSPENDED_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SUSPENDED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SUSPENDED` reader - Enable or disable interrupt for SUSPENDED event"] +pub struct SUSPENDED_R(crate::FieldReader); +impl SUSPENDED_R { + pub(crate) fn new(bits: bool) -> Self { + SUSPENDED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SUSPENDED_A { + match self.bits { + false => SUSPENDED_A::DISABLED, + true => SUSPENDED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SUSPENDED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SUSPENDED_A::ENABLED + } +} +impl core::ops::Deref for SUSPENDED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SUSPENDED` writer - Enable or disable interrupt for SUSPENDED event"] +pub struct SUSPENDED_W<'a> { + w: &'a mut W, +} +impl<'a> SUSPENDED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SUSPENDED_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(SUSPENDED_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(SUSPENDED_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Enable or disable interrupt for RXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXSTARTED_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXSTARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXSTARTED` reader - Enable or disable interrupt for RXSTARTED event"] +pub struct RXSTARTED_R(crate::FieldReader); +impl RXSTARTED_R { + pub(crate) fn new(bits: bool) -> Self { + RXSTARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXSTARTED_A { + match self.bits { + false => RXSTARTED_A::DISABLED, + true => RXSTARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXSTARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXSTARTED_A::ENABLED + } +} +impl core::ops::Deref for RXSTARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RXSTARTED` writer - Enable or disable interrupt for RXSTARTED event"] +pub struct RXSTARTED_W<'a> { + w: &'a mut W, +} +impl<'a> RXSTARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXSTARTED_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(RXSTARTED_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(RXSTARTED_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Enable or disable interrupt for TXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXSTARTED_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXSTARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXSTARTED` reader - Enable or disable interrupt for TXSTARTED event"] +pub struct TXSTARTED_R(crate::FieldReader); +impl TXSTARTED_R { + pub(crate) fn new(bits: bool) -> Self { + TXSTARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXSTARTED_A { + match self.bits { + false => TXSTARTED_A::DISABLED, + true => TXSTARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXSTARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXSTARTED_A::ENABLED + } +} +impl core::ops::Deref for TXSTARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TXSTARTED` writer - Enable or disable interrupt for TXSTARTED event"] +pub struct TXSTARTED_W<'a> { + w: &'a mut W, +} +impl<'a> TXSTARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXSTARTED_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(TXSTARTED_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(TXSTARTED_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Enable or disable interrupt for LASTRX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LASTRX_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LASTRX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LASTRX` reader - Enable or disable interrupt for LASTRX event"] +pub struct LASTRX_R(crate::FieldReader); +impl LASTRX_R { + pub(crate) fn new(bits: bool) -> Self { + LASTRX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> LASTRX_A { + match self.bits { + false => LASTRX_A::DISABLED, + true => LASTRX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == LASTRX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == LASTRX_A::ENABLED + } +} +impl core::ops::Deref for LASTRX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LASTRX` writer - Enable or disable interrupt for LASTRX event"] +pub struct LASTRX_W<'a> { + w: &'a mut W, +} +impl<'a> LASTRX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LASTRX_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(LASTRX_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(LASTRX_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); + self.w + } +} +#[doc = "Enable or disable interrupt for LASTTX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LASTTX_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LASTTX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LASTTX` reader - Enable or disable interrupt for LASTTX event"] +pub struct LASTTX_R(crate::FieldReader); +impl LASTTX_R { + pub(crate) fn new(bits: bool) -> Self { + LASTTX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> LASTTX_A { + match self.bits { + false => LASTTX_A::DISABLED, + true => LASTTX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == LASTTX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == LASTTX_A::ENABLED + } +} +impl core::ops::Deref for LASTTX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LASTTX` writer - Enable or disable interrupt for LASTTX event"] +pub struct LASTTX_W<'a> { + w: &'a mut W, +} +impl<'a> LASTTX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LASTTX_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(LASTTX_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(LASTTX_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +impl R { + #[doc = "Bit 1 - Enable or disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&self) -> STOPPED_R { + STOPPED_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 9 - Enable or disable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&self) -> ERROR_R { + ERROR_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 18 - Enable or disable interrupt for SUSPENDED event"] + #[inline(always)] + pub fn suspended(&self) -> SUSPENDED_R { + SUSPENDED_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Enable or disable interrupt for RXSTARTED event"] + #[inline(always)] + pub fn rxstarted(&self) -> RXSTARTED_R { + RXSTARTED_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Enable or disable interrupt for TXSTARTED event"] + #[inline(always)] + pub fn txstarted(&self) -> TXSTARTED_R { + TXSTARTED_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 23 - Enable or disable interrupt for LASTRX event"] + #[inline(always)] + pub fn lastrx(&self) -> LASTRX_R { + LASTRX_R::new(((self.bits >> 23) & 0x01) != 0) + } + #[doc = "Bit 24 - Enable or disable interrupt for LASTTX event"] + #[inline(always)] + pub fn lasttx(&self) -> LASTTX_R { + LASTTX_R::new(((self.bits >> 24) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 1 - Enable or disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&mut self) -> STOPPED_W { + STOPPED_W { w: self } + } + #[doc = "Bit 9 - Enable or disable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&mut self) -> ERROR_W { + ERROR_W { w: self } + } + #[doc = "Bit 18 - Enable or disable interrupt for SUSPENDED event"] + #[inline(always)] + pub fn suspended(&mut self) -> SUSPENDED_W { + SUSPENDED_W { w: self } + } + #[doc = "Bit 19 - Enable or disable interrupt for RXSTARTED event"] + #[inline(always)] + pub fn rxstarted(&mut self) -> RXSTARTED_W { + RXSTARTED_W { w: self } + } + #[doc = "Bit 20 - Enable or disable interrupt for TXSTARTED event"] + #[inline(always)] + pub fn txstarted(&mut self) -> TXSTARTED_W { + TXSTARTED_W { w: self } + } + #[doc = "Bit 23 - Enable or disable interrupt for LASTRX event"] + #[inline(always)] + pub fn lastrx(&mut self) -> LASTRX_W { + LASTRX_W { w: self } + } + #[doc = "Bit 24 - Enable or disable interrupt for LASTTX event"] + #[inline(always)] + pub fn lasttx(&mut self) -> LASTTX_W { + LASTTX_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable or disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [inten](index.html) module"] +pub struct INTEN_SPEC; +impl crate::RegisterSpec for INTEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [inten::R](R) reader structure"] +impl crate::Readable for INTEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [inten::W](W) writer structure"] +impl crate::Writable for INTEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTEN to value 0"] +impl crate::Resettable for INTEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twim0/intenclr.rs b/src/twim0/intenclr.rs new file mode 100644 index 0000000..f26ac26 --- /dev/null +++ b/src/twim0/intenclr.rs @@ -0,0 +1,766 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` reader - Write '1' to Disable interrupt for STOPPED event"] +pub struct STOPPED_R(crate::FieldReader); +impl STOPPED_R { + pub(crate) fn new(bits: bool) -> Self { + STOPPED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STOPPED_A { + match self.bits { + false => STOPPED_A::DISABLED, + true => STOPPED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STOPPED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STOPPED_A::ENABLED + } +} +impl core::ops::Deref for STOPPED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` writer - Write '1' to Disable interrupt for STOPPED event"] +pub struct STOPPED_W<'a> { + w: &'a mut W, +} +impl<'a> STOPPED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STOPPED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(STOPPED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` reader - Write '1' to Disable interrupt for ERROR event"] +pub struct ERROR_R(crate::FieldReader); +impl ERROR_R { + pub(crate) fn new(bits: bool) -> Self { + ERROR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ERROR_A { + match self.bits { + false => ERROR_A::DISABLED, + true => ERROR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ERROR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ERROR_A::ENABLED + } +} +impl core::ops::Deref for ERROR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` writer - Write '1' to Disable interrupt for ERROR event"] +pub struct ERROR_W<'a> { + w: &'a mut W, +} +impl<'a> ERROR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ERROR_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(ERROR_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for SUSPENDED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SUSPENDED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SUSPENDED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SUSPENDED` reader - Write '1' to Disable interrupt for SUSPENDED event"] +pub struct SUSPENDED_R(crate::FieldReader); +impl SUSPENDED_R { + pub(crate) fn new(bits: bool) -> Self { + SUSPENDED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SUSPENDED_A { + match self.bits { + false => SUSPENDED_A::DISABLED, + true => SUSPENDED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SUSPENDED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SUSPENDED_A::ENABLED + } +} +impl core::ops::Deref for SUSPENDED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for SUSPENDED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SUSPENDED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SUSPENDED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SUSPENDED` writer - Write '1' to Disable interrupt for SUSPENDED event"] +pub struct SUSPENDED_W<'a> { + w: &'a mut W, +} +impl<'a> SUSPENDED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SUSPENDED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(SUSPENDED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for RXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXSTARTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXSTARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXSTARTED` reader - Write '1' to Disable interrupt for RXSTARTED event"] +pub struct RXSTARTED_R(crate::FieldReader); +impl RXSTARTED_R { + pub(crate) fn new(bits: bool) -> Self { + RXSTARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXSTARTED_A { + match self.bits { + false => RXSTARTED_A::DISABLED, + true => RXSTARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXSTARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXSTARTED_A::ENABLED + } +} +impl core::ops::Deref for RXSTARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for RXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXSTARTED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXSTARTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXSTARTED` writer - Write '1' to Disable interrupt for RXSTARTED event"] +pub struct RXSTARTED_W<'a> { + w: &'a mut W, +} +impl<'a> RXSTARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXSTARTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(RXSTARTED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for TXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXSTARTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXSTARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXSTARTED` reader - Write '1' to Disable interrupt for TXSTARTED event"] +pub struct TXSTARTED_R(crate::FieldReader); +impl TXSTARTED_R { + pub(crate) fn new(bits: bool) -> Self { + TXSTARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXSTARTED_A { + match self.bits { + false => TXSTARTED_A::DISABLED, + true => TXSTARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXSTARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXSTARTED_A::ENABLED + } +} +impl core::ops::Deref for TXSTARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXSTARTED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXSTARTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXSTARTED` writer - Write '1' to Disable interrupt for TXSTARTED event"] +pub struct TXSTARTED_W<'a> { + w: &'a mut W, +} +impl<'a> TXSTARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXSTARTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TXSTARTED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for LASTRX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LASTRX_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LASTRX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LASTRX` reader - Write '1' to Disable interrupt for LASTRX event"] +pub struct LASTRX_R(crate::FieldReader); +impl LASTRX_R { + pub(crate) fn new(bits: bool) -> Self { + LASTRX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> LASTRX_A { + match self.bits { + false => LASTRX_A::DISABLED, + true => LASTRX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == LASTRX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == LASTRX_A::ENABLED + } +} +impl core::ops::Deref for LASTRX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for LASTRX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LASTRX_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LASTRX_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LASTRX` writer - Write '1' to Disable interrupt for LASTRX event"] +pub struct LASTRX_W<'a> { + w: &'a mut W, +} +impl<'a> LASTRX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LASTRX_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(LASTRX_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for LASTTX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LASTTX_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LASTTX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LASTTX` reader - Write '1' to Disable interrupt for LASTTX event"] +pub struct LASTTX_R(crate::FieldReader); +impl LASTTX_R { + pub(crate) fn new(bits: bool) -> Self { + LASTTX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> LASTTX_A { + match self.bits { + false => LASTTX_A::DISABLED, + true => LASTTX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == LASTTX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == LASTTX_A::ENABLED + } +} +impl core::ops::Deref for LASTTX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for LASTTX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LASTTX_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LASTTX_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LASTTX` writer - Write '1' to Disable interrupt for LASTTX event"] +pub struct LASTTX_W<'a> { + w: &'a mut W, +} +impl<'a> LASTTX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LASTTX_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(LASTTX_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +impl R { + #[doc = "Bit 1 - Write '1' to Disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&self) -> STOPPED_R { + STOPPED_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 9 - Write '1' to Disable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&self) -> ERROR_R { + ERROR_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 18 - Write '1' to Disable interrupt for SUSPENDED event"] + #[inline(always)] + pub fn suspended(&self) -> SUSPENDED_R { + SUSPENDED_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Write '1' to Disable interrupt for RXSTARTED event"] + #[inline(always)] + pub fn rxstarted(&self) -> RXSTARTED_R { + RXSTARTED_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Write '1' to Disable interrupt for TXSTARTED event"] + #[inline(always)] + pub fn txstarted(&self) -> TXSTARTED_R { + TXSTARTED_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 23 - Write '1' to Disable interrupt for LASTRX event"] + #[inline(always)] + pub fn lastrx(&self) -> LASTRX_R { + LASTRX_R::new(((self.bits >> 23) & 0x01) != 0) + } + #[doc = "Bit 24 - Write '1' to Disable interrupt for LASTTX event"] + #[inline(always)] + pub fn lasttx(&self) -> LASTTX_R { + LASTTX_R::new(((self.bits >> 24) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 1 - Write '1' to Disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&mut self) -> STOPPED_W { + STOPPED_W { w: self } + } + #[doc = "Bit 9 - Write '1' to Disable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&mut self) -> ERROR_W { + ERROR_W { w: self } + } + #[doc = "Bit 18 - Write '1' to Disable interrupt for SUSPENDED event"] + #[inline(always)] + pub fn suspended(&mut self) -> SUSPENDED_W { + SUSPENDED_W { w: self } + } + #[doc = "Bit 19 - Write '1' to Disable interrupt for RXSTARTED event"] + #[inline(always)] + pub fn rxstarted(&mut self) -> RXSTARTED_W { + RXSTARTED_W { w: self } + } + #[doc = "Bit 20 - Write '1' to Disable interrupt for TXSTARTED event"] + #[inline(always)] + pub fn txstarted(&mut self) -> TXSTARTED_W { + TXSTARTED_W { w: self } + } + #[doc = "Bit 23 - Write '1' to Disable interrupt for LASTRX event"] + #[inline(always)] + pub fn lastrx(&mut self) -> LASTRX_W { + LASTRX_W { w: self } + } + #[doc = "Bit 24 - Write '1' to Disable interrupt for LASTTX event"] + #[inline(always)] + pub fn lasttx(&mut self) -> LASTTX_W { + LASTTX_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twim0/intenset.rs b/src/twim0/intenset.rs new file mode 100644 index 0000000..1909ef6 --- /dev/null +++ b/src/twim0/intenset.rs @@ -0,0 +1,766 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` reader - Write '1' to Enable interrupt for STOPPED event"] +pub struct STOPPED_R(crate::FieldReader); +impl STOPPED_R { + pub(crate) fn new(bits: bool) -> Self { + STOPPED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STOPPED_A { + match self.bits { + false => STOPPED_A::DISABLED, + true => STOPPED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STOPPED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STOPPED_A::ENABLED + } +} +impl core::ops::Deref for STOPPED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` writer - Write '1' to Enable interrupt for STOPPED event"] +pub struct STOPPED_W<'a> { + w: &'a mut W, +} +impl<'a> STOPPED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STOPPED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(STOPPED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` reader - Write '1' to Enable interrupt for ERROR event"] +pub struct ERROR_R(crate::FieldReader); +impl ERROR_R { + pub(crate) fn new(bits: bool) -> Self { + ERROR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ERROR_A { + match self.bits { + false => ERROR_A::DISABLED, + true => ERROR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ERROR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ERROR_A::ENABLED + } +} +impl core::ops::Deref for ERROR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` writer - Write '1' to Enable interrupt for ERROR event"] +pub struct ERROR_W<'a> { + w: &'a mut W, +} +impl<'a> ERROR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ERROR_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(ERROR_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for SUSPENDED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SUSPENDED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SUSPENDED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SUSPENDED` reader - Write '1' to Enable interrupt for SUSPENDED event"] +pub struct SUSPENDED_R(crate::FieldReader); +impl SUSPENDED_R { + pub(crate) fn new(bits: bool) -> Self { + SUSPENDED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SUSPENDED_A { + match self.bits { + false => SUSPENDED_A::DISABLED, + true => SUSPENDED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == SUSPENDED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == SUSPENDED_A::ENABLED + } +} +impl core::ops::Deref for SUSPENDED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for SUSPENDED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SUSPENDED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SUSPENDED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SUSPENDED` writer - Write '1' to Enable interrupt for SUSPENDED event"] +pub struct SUSPENDED_W<'a> { + w: &'a mut W, +} +impl<'a> SUSPENDED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SUSPENDED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(SUSPENDED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 18)) | ((value as u32 & 0x01) << 18); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for RXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXSTARTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXSTARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXSTARTED` reader - Write '1' to Enable interrupt for RXSTARTED event"] +pub struct RXSTARTED_R(crate::FieldReader); +impl RXSTARTED_R { + pub(crate) fn new(bits: bool) -> Self { + RXSTARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXSTARTED_A { + match self.bits { + false => RXSTARTED_A::DISABLED, + true => RXSTARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXSTARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXSTARTED_A::ENABLED + } +} +impl core::ops::Deref for RXSTARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for RXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXSTARTED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXSTARTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXSTARTED` writer - Write '1' to Enable interrupt for RXSTARTED event"] +pub struct RXSTARTED_W<'a> { + w: &'a mut W, +} +impl<'a> RXSTARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXSTARTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(RXSTARTED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for TXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXSTARTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXSTARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXSTARTED` reader - Write '1' to Enable interrupt for TXSTARTED event"] +pub struct TXSTARTED_R(crate::FieldReader); +impl TXSTARTED_R { + pub(crate) fn new(bits: bool) -> Self { + TXSTARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXSTARTED_A { + match self.bits { + false => TXSTARTED_A::DISABLED, + true => TXSTARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXSTARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXSTARTED_A::ENABLED + } +} +impl core::ops::Deref for TXSTARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXSTARTED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXSTARTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXSTARTED` writer - Write '1' to Enable interrupt for TXSTARTED event"] +pub struct TXSTARTED_W<'a> { + w: &'a mut W, +} +impl<'a> TXSTARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXSTARTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TXSTARTED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for LASTRX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LASTRX_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LASTRX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LASTRX` reader - Write '1' to Enable interrupt for LASTRX event"] +pub struct LASTRX_R(crate::FieldReader); +impl LASTRX_R { + pub(crate) fn new(bits: bool) -> Self { + LASTRX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> LASTRX_A { + match self.bits { + false => LASTRX_A::DISABLED, + true => LASTRX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == LASTRX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == LASTRX_A::ENABLED + } +} +impl core::ops::Deref for LASTRX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for LASTRX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LASTRX_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LASTRX_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LASTRX` writer - Write '1' to Enable interrupt for LASTRX event"] +pub struct LASTRX_W<'a> { + w: &'a mut W, +} +impl<'a> LASTRX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LASTRX_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(LASTRX_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 23)) | ((value as u32 & 0x01) << 23); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for LASTTX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LASTTX_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LASTTX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LASTTX` reader - Write '1' to Enable interrupt for LASTTX event"] +pub struct LASTTX_R(crate::FieldReader); +impl LASTTX_R { + pub(crate) fn new(bits: bool) -> Self { + LASTTX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> LASTTX_A { + match self.bits { + false => LASTTX_A::DISABLED, + true => LASTTX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == LASTTX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == LASTTX_A::ENABLED + } +} +impl core::ops::Deref for LASTTX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for LASTTX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LASTTX_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LASTTX_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LASTTX` writer - Write '1' to Enable interrupt for LASTTX event"] +pub struct LASTTX_W<'a> { + w: &'a mut W, +} +impl<'a> LASTTX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LASTTX_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(LASTTX_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 24)) | ((value as u32 & 0x01) << 24); + self.w + } +} +impl R { + #[doc = "Bit 1 - Write '1' to Enable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&self) -> STOPPED_R { + STOPPED_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 9 - Write '1' to Enable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&self) -> ERROR_R { + ERROR_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 18 - Write '1' to Enable interrupt for SUSPENDED event"] + #[inline(always)] + pub fn suspended(&self) -> SUSPENDED_R { + SUSPENDED_R::new(((self.bits >> 18) & 0x01) != 0) + } + #[doc = "Bit 19 - Write '1' to Enable interrupt for RXSTARTED event"] + #[inline(always)] + pub fn rxstarted(&self) -> RXSTARTED_R { + RXSTARTED_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Write '1' to Enable interrupt for TXSTARTED event"] + #[inline(always)] + pub fn txstarted(&self) -> TXSTARTED_R { + TXSTARTED_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 23 - Write '1' to Enable interrupt for LASTRX event"] + #[inline(always)] + pub fn lastrx(&self) -> LASTRX_R { + LASTRX_R::new(((self.bits >> 23) & 0x01) != 0) + } + #[doc = "Bit 24 - Write '1' to Enable interrupt for LASTTX event"] + #[inline(always)] + pub fn lasttx(&self) -> LASTTX_R { + LASTTX_R::new(((self.bits >> 24) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 1 - Write '1' to Enable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&mut self) -> STOPPED_W { + STOPPED_W { w: self } + } + #[doc = "Bit 9 - Write '1' to Enable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&mut self) -> ERROR_W { + ERROR_W { w: self } + } + #[doc = "Bit 18 - Write '1' to Enable interrupt for SUSPENDED event"] + #[inline(always)] + pub fn suspended(&mut self) -> SUSPENDED_W { + SUSPENDED_W { w: self } + } + #[doc = "Bit 19 - Write '1' to Enable interrupt for RXSTARTED event"] + #[inline(always)] + pub fn rxstarted(&mut self) -> RXSTARTED_W { + RXSTARTED_W { w: self } + } + #[doc = "Bit 20 - Write '1' to Enable interrupt for TXSTARTED event"] + #[inline(always)] + pub fn txstarted(&mut self) -> TXSTARTED_W { + TXSTARTED_W { w: self } + } + #[doc = "Bit 23 - Write '1' to Enable interrupt for LASTRX event"] + #[inline(always)] + pub fn lastrx(&mut self) -> LASTRX_W { + LASTRX_W { w: self } + } + #[doc = "Bit 24 - Write '1' to Enable interrupt for LASTTX event"] + #[inline(always)] + pub fn lasttx(&mut self) -> LASTTX_W { + LASTTX_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twim0/psel.rs b/src/twim0/psel.rs new file mode 100644 index 0000000..fb6fab2 --- /dev/null +++ b/src/twim0/psel.rs @@ -0,0 +1,8 @@ +#[doc = "SCL register accessor: an alias for `Reg`"] +pub type SCL = crate::Reg; +#[doc = "Pin select for SCL signal"] +pub mod scl; +#[doc = "SDA register accessor: an alias for `Reg`"] +pub type SDA = crate::Reg; +#[doc = "Pin select for SDA signal"] +pub mod sda; diff --git a/src/twim0/psel/scl.rs b/src/twim0/psel/scl.rs new file mode 100644 index 0000000..270c22f --- /dev/null +++ b/src/twim0/psel/scl.rs @@ -0,0 +1,195 @@ +#[doc = "Register `SCL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SCL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PIN` reader - Pin number"] +pub struct PIN_R(crate::FieldReader); +impl PIN_R { + pub(crate) fn new(bits: u8) -> Self { + PIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN` writer - Pin number"] +pub struct PIN_W<'a> { + w: &'a mut W, +} +impl<'a> PIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Connection\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CONNECT_A { + #[doc = "1: Disconnect"] + DISCONNECTED = 1, + #[doc = "0: Connect"] + CONNECTED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: CONNECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CONNECT` reader - Connection"] +pub struct CONNECT_R(crate::FieldReader); +impl CONNECT_R { + pub(crate) fn new(bits: bool) -> Self { + CONNECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CONNECT_A { + match self.bits { + true => CONNECT_A::DISCONNECTED, + false => CONNECT_A::CONNECTED, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == CONNECT_A::DISCONNECTED + } + #[doc = "Checks if the value of the field is `CONNECTED`"] + #[inline(always)] + pub fn is_connected(&self) -> bool { + **self == CONNECT_A::CONNECTED + } +} +impl core::ops::Deref for CONNECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONNECT` writer - Connection"] +pub struct CONNECT_W<'a> { + w: &'a mut W, +} +impl<'a> CONNECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CONNECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(CONNECT_A::DISCONNECTED) + } + #[doc = "Connect"] + #[inline(always)] + pub fn connected(self) -> &'a mut W { + self.variant(CONNECT_A::CONNECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&self) -> PIN_R { + PIN_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&self) -> CONNECT_R { + CONNECT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&mut self) -> PIN_W { + PIN_W { w: self } + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&mut self) -> CONNECT_W { + CONNECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for SCL signal\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [scl](index.html) module"] +pub struct SCL_SPEC; +impl crate::RegisterSpec for SCL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [scl::R](R) reader structure"] +impl crate::Readable for SCL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [scl::W](W) writer structure"] +impl crate::Writable for SCL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SCL to value 0xffff_ffff"] +impl crate::Resettable for SCL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/twim0/psel/sda.rs b/src/twim0/psel/sda.rs new file mode 100644 index 0000000..2b4914b --- /dev/null +++ b/src/twim0/psel/sda.rs @@ -0,0 +1,195 @@ +#[doc = "Register `SDA` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SDA` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PIN` reader - Pin number"] +pub struct PIN_R(crate::FieldReader); +impl PIN_R { + pub(crate) fn new(bits: u8) -> Self { + PIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN` writer - Pin number"] +pub struct PIN_W<'a> { + w: &'a mut W, +} +impl<'a> PIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Connection\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CONNECT_A { + #[doc = "1: Disconnect"] + DISCONNECTED = 1, + #[doc = "0: Connect"] + CONNECTED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: CONNECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CONNECT` reader - Connection"] +pub struct CONNECT_R(crate::FieldReader); +impl CONNECT_R { + pub(crate) fn new(bits: bool) -> Self { + CONNECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CONNECT_A { + match self.bits { + true => CONNECT_A::DISCONNECTED, + false => CONNECT_A::CONNECTED, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == CONNECT_A::DISCONNECTED + } + #[doc = "Checks if the value of the field is `CONNECTED`"] + #[inline(always)] + pub fn is_connected(&self) -> bool { + **self == CONNECT_A::CONNECTED + } +} +impl core::ops::Deref for CONNECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONNECT` writer - Connection"] +pub struct CONNECT_W<'a> { + w: &'a mut W, +} +impl<'a> CONNECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CONNECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(CONNECT_A::DISCONNECTED) + } + #[doc = "Connect"] + #[inline(always)] + pub fn connected(self) -> &'a mut W { + self.variant(CONNECT_A::CONNECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&self) -> PIN_R { + PIN_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&self) -> CONNECT_R { + CONNECT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&mut self) -> PIN_W { + PIN_W { w: self } + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&mut self) -> CONNECT_W { + CONNECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for SDA signal\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sda](index.html) module"] +pub struct SDA_SPEC; +impl crate::RegisterSpec for SDA_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sda::R](R) reader structure"] +impl crate::Readable for SDA_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sda::W](W) writer structure"] +impl crate::Writable for SDA_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SDA to value 0xffff_ffff"] +impl crate::Resettable for SDA_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/twim0/rxd.rs b/src/twim0/rxd.rs new file mode 100644 index 0000000..aa82022 --- /dev/null +++ b/src/twim0/rxd.rs @@ -0,0 +1,16 @@ +#[doc = "PTR register accessor: an alias for `Reg`"] +pub type PTR = crate::Reg; +#[doc = "Data pointer"] +pub mod ptr; +#[doc = "MAXCNT register accessor: an alias for `Reg`"] +pub type MAXCNT = crate::Reg; +#[doc = "Maximum number of bytes in receive buffer"] +pub mod maxcnt; +#[doc = "AMOUNT register accessor: an alias for `Reg`"] +pub type AMOUNT = crate::Reg; +#[doc = "Number of bytes transferred in the last transaction"] +pub mod amount; +#[doc = "LIST register accessor: an alias for `Reg`"] +pub type LIST = crate::Reg; +#[doc = "EasyDMA list type"] +pub mod list; diff --git a/src/twim0/rxd/amount.rs b/src/twim0/rxd/amount.rs new file mode 100644 index 0000000..155cc12 --- /dev/null +++ b/src/twim0/rxd/amount.rs @@ -0,0 +1,52 @@ +#[doc = "Register `AMOUNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `AMOUNT` reader - Number of bytes transferred in the last transaction. In case of NACK error, includes the NACK'ed byte."] +pub struct AMOUNT_R(crate::FieldReader); +impl AMOUNT_R { + pub(crate) fn new(bits: u8) -> Self { + AMOUNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AMOUNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:7 - Number of bytes transferred in the last transaction. In case of NACK error, includes the NACK'ed byte."] + #[inline(always)] + pub fn amount(&self) -> AMOUNT_R { + AMOUNT_R::new((self.bits & 0xff) as u8) + } +} +#[doc = "Number of bytes transferred in the last transaction\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 [amount](index.html) module"] +pub struct AMOUNT_SPEC; +impl crate::RegisterSpec for AMOUNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [amount::R](R) reader structure"] +impl crate::Readable for AMOUNT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets AMOUNT to value 0"] +impl crate::Resettable for AMOUNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twim0/rxd/list.rs b/src/twim0/rxd/list.rs new file mode 100644 index 0000000..0483340 --- /dev/null +++ b/src/twim0/rxd/list.rs @@ -0,0 +1,151 @@ +#[doc = "Register `LIST` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `LIST` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "List type\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum LIST_A { + #[doc = "0: Disable EasyDMA list"] + DISABLED = 0, + #[doc = "1: Use array list"] + ARRAYLIST = 1, +} +impl From for u8 { + #[inline(always)] + fn from(variant: LIST_A) -> Self { + variant as _ + } +} +#[doc = "Field `LIST` reader - List type"] +pub struct LIST_R(crate::FieldReader); +impl LIST_R { + pub(crate) fn new(bits: u8) -> Self { + LIST_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(LIST_A::DISABLED), + 1 => Some(LIST_A::ARRAYLIST), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == LIST_A::DISABLED + } + #[doc = "Checks if the value of the field is `ARRAYLIST`"] + #[inline(always)] + pub fn is_array_list(&self) -> bool { + **self == LIST_A::ARRAYLIST + } +} +impl core::ops::Deref for LIST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LIST` writer - List type"] +pub struct LIST_W<'a> { + w: &'a mut W, +} +impl<'a> LIST_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LIST_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Disable EasyDMA list"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(LIST_A::DISABLED) + } + #[doc = "Use array list"] + #[inline(always)] + pub fn array_list(self) -> &'a mut W { + self.variant(LIST_A::ARRAYLIST) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); + self.w + } +} +impl R { + #[doc = "Bits 0:2 - List type"] + #[inline(always)] + pub fn list(&self) -> LIST_R { + LIST_R::new((self.bits & 0x07) as u8) + } +} +impl W { + #[doc = "Bits 0:2 - List type"] + #[inline(always)] + pub fn list(&mut self) -> LIST_W { + LIST_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "EasyDMA list type\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [list](index.html) module"] +pub struct LIST_SPEC; +impl crate::RegisterSpec for LIST_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [list::R](R) reader structure"] +impl crate::Readable for LIST_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [list::W](W) writer structure"] +impl crate::Writable for LIST_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LIST to value 0"] +impl crate::Resettable for LIST_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twim0/rxd/maxcnt.rs b/src/twim0/rxd/maxcnt.rs new file mode 100644 index 0000000..b005494 --- /dev/null +++ b/src/twim0/rxd/maxcnt.rs @@ -0,0 +1,102 @@ +#[doc = "Register `MAXCNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MAXCNT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `MAXCNT` reader - Maximum number of bytes in receive buffer"] +pub struct MAXCNT_R(crate::FieldReader); +impl MAXCNT_R { + pub(crate) fn new(bits: u8) -> Self { + MAXCNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MAXCNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MAXCNT` writer - Maximum number of bytes in receive buffer"] +pub struct MAXCNT_W<'a> { + w: &'a mut W, +} +impl<'a> MAXCNT_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - Maximum number of bytes in receive buffer"] + #[inline(always)] + pub fn maxcnt(&self) -> MAXCNT_R { + MAXCNT_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - Maximum number of bytes in receive buffer"] + #[inline(always)] + pub fn maxcnt(&mut self) -> MAXCNT_W { + MAXCNT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Maximum number of bytes in receive buffer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [maxcnt](index.html) module"] +pub struct MAXCNT_SPEC; +impl crate::RegisterSpec for MAXCNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [maxcnt::R](R) reader structure"] +impl crate::Readable for MAXCNT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [maxcnt::W](W) writer structure"] +impl crate::Writable for MAXCNT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MAXCNT to value 0"] +impl crate::Resettable for MAXCNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twim0/rxd/ptr.rs b/src/twim0/rxd/ptr.rs new file mode 100644 index 0000000..681f382 --- /dev/null +++ b/src/twim0/rxd/ptr.rs @@ -0,0 +1,102 @@ +#[doc = "Register `PTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PTR` reader - Data pointer"] +pub struct PTR_R(crate::FieldReader); +impl PTR_R { + pub(crate) fn new(bits: u32) -> Self { + PTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PTR` writer - Data pointer"] +pub struct PTR_W<'a> { + w: &'a mut W, +} +impl<'a> PTR_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Data pointer"] + #[inline(always)] + pub fn ptr(&self) -> PTR_R { + PTR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Data pointer"] + #[inline(always)] + pub fn ptr(&mut self) -> PTR_W { + PTR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Data pointer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ptr](index.html) module"] +pub struct PTR_SPEC; +impl crate::RegisterSpec for PTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ptr::R](R) reader structure"] +impl crate::Readable for PTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ptr::W](W) writer structure"] +impl crate::Writable for PTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PTR to value 0"] +impl crate::Resettable for PTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twim0/shorts.rs b/src/twim0/shorts.rs new file mode 100644 index 0000000..aa14f9a --- /dev/null +++ b/src/twim0/shorts.rs @@ -0,0 +1,531 @@ +#[doc = "Register `SHORTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SHORTS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Shortcut between LASTTX event and STARTRX task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LASTTX_STARTRX_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LASTTX_STARTRX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LASTTX_STARTRX` reader - Shortcut between LASTTX event and STARTRX task"] +pub struct LASTTX_STARTRX_R(crate::FieldReader); +impl LASTTX_STARTRX_R { + pub(crate) fn new(bits: bool) -> Self { + LASTTX_STARTRX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> LASTTX_STARTRX_A { + match self.bits { + false => LASTTX_STARTRX_A::DISABLED, + true => LASTTX_STARTRX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == LASTTX_STARTRX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == LASTTX_STARTRX_A::ENABLED + } +} +impl core::ops::Deref for LASTTX_STARTRX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LASTTX_STARTRX` writer - Shortcut between LASTTX event and STARTRX task"] +pub struct LASTTX_STARTRX_W<'a> { + w: &'a mut W, +} +impl<'a> LASTTX_STARTRX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LASTTX_STARTRX_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(LASTTX_STARTRX_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(LASTTX_STARTRX_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Shortcut between LASTTX event and SUSPEND task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LASTTX_SUSPEND_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LASTTX_SUSPEND_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LASTTX_SUSPEND` reader - Shortcut between LASTTX event and SUSPEND task"] +pub struct LASTTX_SUSPEND_R(crate::FieldReader); +impl LASTTX_SUSPEND_R { + pub(crate) fn new(bits: bool) -> Self { + LASTTX_SUSPEND_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> LASTTX_SUSPEND_A { + match self.bits { + false => LASTTX_SUSPEND_A::DISABLED, + true => LASTTX_SUSPEND_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == LASTTX_SUSPEND_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == LASTTX_SUSPEND_A::ENABLED + } +} +impl core::ops::Deref for LASTTX_SUSPEND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LASTTX_SUSPEND` writer - Shortcut between LASTTX event and SUSPEND task"] +pub struct LASTTX_SUSPEND_W<'a> { + w: &'a mut W, +} +impl<'a> LASTTX_SUSPEND_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LASTTX_SUSPEND_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(LASTTX_SUSPEND_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(LASTTX_SUSPEND_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Shortcut between LASTTX event and STOP task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LASTTX_STOP_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LASTTX_STOP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LASTTX_STOP` reader - Shortcut between LASTTX event and STOP task"] +pub struct LASTTX_STOP_R(crate::FieldReader); +impl LASTTX_STOP_R { + pub(crate) fn new(bits: bool) -> Self { + LASTTX_STOP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> LASTTX_STOP_A { + match self.bits { + false => LASTTX_STOP_A::DISABLED, + true => LASTTX_STOP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == LASTTX_STOP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == LASTTX_STOP_A::ENABLED + } +} +impl core::ops::Deref for LASTTX_STOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LASTTX_STOP` writer - Shortcut between LASTTX event and STOP task"] +pub struct LASTTX_STOP_W<'a> { + w: &'a mut W, +} +impl<'a> LASTTX_STOP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LASTTX_STOP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(LASTTX_STOP_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(LASTTX_STOP_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Shortcut between LASTRX event and STARTTX task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LASTRX_STARTTX_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LASTRX_STARTTX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LASTRX_STARTTX` reader - Shortcut between LASTRX event and STARTTX task"] +pub struct LASTRX_STARTTX_R(crate::FieldReader); +impl LASTRX_STARTTX_R { + pub(crate) fn new(bits: bool) -> Self { + LASTRX_STARTTX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> LASTRX_STARTTX_A { + match self.bits { + false => LASTRX_STARTTX_A::DISABLED, + true => LASTRX_STARTTX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == LASTRX_STARTTX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == LASTRX_STARTTX_A::ENABLED + } +} +impl core::ops::Deref for LASTRX_STARTTX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LASTRX_STARTTX` writer - Shortcut between LASTRX event and STARTTX task"] +pub struct LASTRX_STARTTX_W<'a> { + w: &'a mut W, +} +impl<'a> LASTRX_STARTTX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LASTRX_STARTTX_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(LASTRX_STARTTX_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(LASTRX_STARTTX_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10); + self.w + } +} +#[doc = "Shortcut between LASTRX event and STOP task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum LASTRX_STOP_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: LASTRX_STOP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `LASTRX_STOP` reader - Shortcut between LASTRX event and STOP task"] +pub struct LASTRX_STOP_R(crate::FieldReader); +impl LASTRX_STOP_R { + pub(crate) fn new(bits: bool) -> Self { + LASTRX_STOP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> LASTRX_STOP_A { + match self.bits { + false => LASTRX_STOP_A::DISABLED, + true => LASTRX_STOP_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == LASTRX_STOP_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == LASTRX_STOP_A::ENABLED + } +} +impl core::ops::Deref for LASTRX_STOP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LASTRX_STOP` writer - Shortcut between LASTRX event and STOP task"] +pub struct LASTRX_STOP_W<'a> { + w: &'a mut W, +} +impl<'a> LASTRX_STOP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LASTRX_STOP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(LASTRX_STOP_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(LASTRX_STOP_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12); + self.w + } +} +impl R { + #[doc = "Bit 7 - Shortcut between LASTTX event and STARTRX task"] + #[inline(always)] + pub fn lasttx_startrx(&self) -> LASTTX_STARTRX_R { + LASTTX_STARTRX_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Shortcut between LASTTX event and SUSPEND task"] + #[inline(always)] + pub fn lasttx_suspend(&self) -> LASTTX_SUSPEND_R { + LASTTX_SUSPEND_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Shortcut between LASTTX event and STOP task"] + #[inline(always)] + pub fn lasttx_stop(&self) -> LASTTX_STOP_R { + LASTTX_STOP_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 10 - Shortcut between LASTRX event and STARTTX task"] + #[inline(always)] + pub fn lastrx_starttx(&self) -> LASTRX_STARTTX_R { + LASTRX_STARTTX_R::new(((self.bits >> 10) & 0x01) != 0) + } + #[doc = "Bit 12 - Shortcut between LASTRX event and STOP task"] + #[inline(always)] + pub fn lastrx_stop(&self) -> LASTRX_STOP_R { + LASTRX_STOP_R::new(((self.bits >> 12) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 7 - Shortcut between LASTTX event and STARTRX task"] + #[inline(always)] + pub fn lasttx_startrx(&mut self) -> LASTTX_STARTRX_W { + LASTTX_STARTRX_W { w: self } + } + #[doc = "Bit 8 - Shortcut between LASTTX event and SUSPEND task"] + #[inline(always)] + pub fn lasttx_suspend(&mut self) -> LASTTX_SUSPEND_W { + LASTTX_SUSPEND_W { w: self } + } + #[doc = "Bit 9 - Shortcut between LASTTX event and STOP task"] + #[inline(always)] + pub fn lasttx_stop(&mut self) -> LASTTX_STOP_W { + LASTTX_STOP_W { w: self } + } + #[doc = "Bit 10 - Shortcut between LASTRX event and STARTTX task"] + #[inline(always)] + pub fn lastrx_starttx(&mut self) -> LASTRX_STARTTX_W { + LASTRX_STARTTX_W { w: self } + } + #[doc = "Bit 12 - Shortcut between LASTRX event and STOP task"] + #[inline(always)] + pub fn lastrx_stop(&mut self) -> LASTRX_STOP_W { + LASTRX_STOP_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Shortcut register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [shorts](index.html) module"] +pub struct SHORTS_SPEC; +impl crate::RegisterSpec for SHORTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [shorts::R](R) reader structure"] +impl crate::Readable for SHORTS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [shorts::W](W) writer structure"] +impl crate::Writable for SHORTS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SHORTS to value 0"] +impl crate::Resettable for SHORTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twim0/tasks_resume.rs b/src/twim0/tasks_resume.rs new file mode 100644 index 0000000..ef482eb --- /dev/null +++ b/src/twim0/tasks_resume.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_RESUME` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Resume TWI transaction\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_resume](index.html) module"] +pub struct TASKS_RESUME_SPEC; +impl crate::RegisterSpec for TASKS_RESUME_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_resume::W](W) writer structure"] +impl crate::Writable for TASKS_RESUME_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_RESUME to value 0"] +impl crate::Resettable for TASKS_RESUME_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twim0/tasks_startrx.rs b/src/twim0/tasks_startrx.rs new file mode 100644 index 0000000..cadc869 --- /dev/null +++ b/src/twim0/tasks_startrx.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STARTRX` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start TWI receive sequence\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_startrx](index.html) module"] +pub struct TASKS_STARTRX_SPEC; +impl crate::RegisterSpec for TASKS_STARTRX_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_startrx::W](W) writer structure"] +impl crate::Writable for TASKS_STARTRX_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STARTRX to value 0"] +impl crate::Resettable for TASKS_STARTRX_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twim0/tasks_starttx.rs b/src/twim0/tasks_starttx.rs new file mode 100644 index 0000000..9901ac3 --- /dev/null +++ b/src/twim0/tasks_starttx.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STARTTX` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start TWI transmit sequence\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_starttx](index.html) module"] +pub struct TASKS_STARTTX_SPEC; +impl crate::RegisterSpec for TASKS_STARTTX_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_starttx::W](W) writer structure"] +impl crate::Writable for TASKS_STARTTX_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STARTTX to value 0"] +impl crate::Resettable for TASKS_STARTTX_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twim0/tasks_stop.rs b/src/twim0/tasks_stop.rs new file mode 100644 index 0000000..4be718d --- /dev/null +++ b/src/twim0/tasks_stop.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STOP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Stop TWI transaction. Must be issued while the TWI master is not suspended.\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_stop](index.html) module"] +pub struct TASKS_STOP_SPEC; +impl crate::RegisterSpec for TASKS_STOP_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_stop::W](W) writer structure"] +impl crate::Writable for TASKS_STOP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STOP to value 0"] +impl crate::Resettable for TASKS_STOP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twim0/tasks_suspend.rs b/src/twim0/tasks_suspend.rs new file mode 100644 index 0000000..33397ec --- /dev/null +++ b/src/twim0/tasks_suspend.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_SUSPEND` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Suspend TWI transaction\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_suspend](index.html) module"] +pub struct TASKS_SUSPEND_SPEC; +impl crate::RegisterSpec for TASKS_SUSPEND_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_suspend::W](W) writer structure"] +impl crate::Writable for TASKS_SUSPEND_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_SUSPEND to value 0"] +impl crate::Resettable for TASKS_SUSPEND_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twim0/txd.rs b/src/twim0/txd.rs new file mode 100644 index 0000000..7dafa96 --- /dev/null +++ b/src/twim0/txd.rs @@ -0,0 +1,16 @@ +#[doc = "PTR register accessor: an alias for `Reg`"] +pub type PTR = crate::Reg; +#[doc = "Data pointer"] +pub mod ptr; +#[doc = "MAXCNT register accessor: an alias for `Reg`"] +pub type MAXCNT = crate::Reg; +#[doc = "Maximum number of bytes in transmit buffer"] +pub mod maxcnt; +#[doc = "AMOUNT register accessor: an alias for `Reg`"] +pub type AMOUNT = crate::Reg; +#[doc = "Number of bytes transferred in the last transaction"] +pub mod amount; +#[doc = "LIST register accessor: an alias for `Reg`"] +pub type LIST = crate::Reg; +#[doc = "EasyDMA list type"] +pub mod list; diff --git a/src/twim0/txd/amount.rs b/src/twim0/txd/amount.rs new file mode 100644 index 0000000..155cc12 --- /dev/null +++ b/src/twim0/txd/amount.rs @@ -0,0 +1,52 @@ +#[doc = "Register `AMOUNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `AMOUNT` reader - Number of bytes transferred in the last transaction. In case of NACK error, includes the NACK'ed byte."] +pub struct AMOUNT_R(crate::FieldReader); +impl AMOUNT_R { + pub(crate) fn new(bits: u8) -> Self { + AMOUNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AMOUNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:7 - Number of bytes transferred in the last transaction. In case of NACK error, includes the NACK'ed byte."] + #[inline(always)] + pub fn amount(&self) -> AMOUNT_R { + AMOUNT_R::new((self.bits & 0xff) as u8) + } +} +#[doc = "Number of bytes transferred in the last transaction\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 [amount](index.html) module"] +pub struct AMOUNT_SPEC; +impl crate::RegisterSpec for AMOUNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [amount::R](R) reader structure"] +impl crate::Readable for AMOUNT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets AMOUNT to value 0"] +impl crate::Resettable for AMOUNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twim0/txd/list.rs b/src/twim0/txd/list.rs new file mode 100644 index 0000000..0483340 --- /dev/null +++ b/src/twim0/txd/list.rs @@ -0,0 +1,151 @@ +#[doc = "Register `LIST` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `LIST` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "List type\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum LIST_A { + #[doc = "0: Disable EasyDMA list"] + DISABLED = 0, + #[doc = "1: Use array list"] + ARRAYLIST = 1, +} +impl From for u8 { + #[inline(always)] + fn from(variant: LIST_A) -> Self { + variant as _ + } +} +#[doc = "Field `LIST` reader - List type"] +pub struct LIST_R(crate::FieldReader); +impl LIST_R { + pub(crate) fn new(bits: u8) -> Self { + LIST_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(LIST_A::DISABLED), + 1 => Some(LIST_A::ARRAYLIST), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == LIST_A::DISABLED + } + #[doc = "Checks if the value of the field is `ARRAYLIST`"] + #[inline(always)] + pub fn is_array_list(&self) -> bool { + **self == LIST_A::ARRAYLIST + } +} +impl core::ops::Deref for LIST_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `LIST` writer - List type"] +pub struct LIST_W<'a> { + w: &'a mut W, +} +impl<'a> LIST_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: LIST_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Disable EasyDMA list"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(LIST_A::DISABLED) + } + #[doc = "Use array list"] + #[inline(always)] + pub fn array_list(self) -> &'a mut W { + self.variant(LIST_A::ARRAYLIST) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07); + self.w + } +} +impl R { + #[doc = "Bits 0:2 - List type"] + #[inline(always)] + pub fn list(&self) -> LIST_R { + LIST_R::new((self.bits & 0x07) as u8) + } +} +impl W { + #[doc = "Bits 0:2 - List type"] + #[inline(always)] + pub fn list(&mut self) -> LIST_W { + LIST_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "EasyDMA list type\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [list](index.html) module"] +pub struct LIST_SPEC; +impl crate::RegisterSpec for LIST_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [list::R](R) reader structure"] +impl crate::Readable for LIST_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [list::W](W) writer structure"] +impl crate::Writable for LIST_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets LIST to value 0"] +impl crate::Resettable for LIST_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twim0/txd/maxcnt.rs b/src/twim0/txd/maxcnt.rs new file mode 100644 index 0000000..c9a377b --- /dev/null +++ b/src/twim0/txd/maxcnt.rs @@ -0,0 +1,102 @@ +#[doc = "Register `MAXCNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MAXCNT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `MAXCNT` reader - Maximum number of bytes in transmit buffer"] +pub struct MAXCNT_R(crate::FieldReader); +impl MAXCNT_R { + pub(crate) fn new(bits: u8) -> Self { + MAXCNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MAXCNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MAXCNT` writer - Maximum number of bytes in transmit buffer"] +pub struct MAXCNT_W<'a> { + w: &'a mut W, +} +impl<'a> MAXCNT_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - Maximum number of bytes in transmit buffer"] + #[inline(always)] + pub fn maxcnt(&self) -> MAXCNT_R { + MAXCNT_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - Maximum number of bytes in transmit buffer"] + #[inline(always)] + pub fn maxcnt(&mut self) -> MAXCNT_W { + MAXCNT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Maximum number of bytes in transmit buffer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [maxcnt](index.html) module"] +pub struct MAXCNT_SPEC; +impl crate::RegisterSpec for MAXCNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [maxcnt::R](R) reader structure"] +impl crate::Readable for MAXCNT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [maxcnt::W](W) writer structure"] +impl crate::Writable for MAXCNT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MAXCNT to value 0"] +impl crate::Resettable for MAXCNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twim0/txd/ptr.rs b/src/twim0/txd/ptr.rs new file mode 100644 index 0000000..681f382 --- /dev/null +++ b/src/twim0/txd/ptr.rs @@ -0,0 +1,102 @@ +#[doc = "Register `PTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PTR` reader - Data pointer"] +pub struct PTR_R(crate::FieldReader); +impl PTR_R { + pub(crate) fn new(bits: u32) -> Self { + PTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PTR` writer - Data pointer"] +pub struct PTR_W<'a> { + w: &'a mut W, +} +impl<'a> PTR_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Data pointer"] + #[inline(always)] + pub fn ptr(&self) -> PTR_R { + PTR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Data pointer"] + #[inline(always)] + pub fn ptr(&mut self) -> PTR_W { + PTR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Data pointer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ptr](index.html) module"] +pub struct PTR_SPEC; +impl crate::RegisterSpec for PTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ptr::R](R) reader structure"] +impl crate::Readable for PTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ptr::W](W) writer structure"] +impl crate::Writable for PTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PTR to value 0"] +impl crate::Resettable for PTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twis0.rs b/src/twis0.rs new file mode 100644 index 0000000..16f3a13 --- /dev/null +++ b/src/twis0.rs @@ -0,0 +1,190 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + _reserved0: [u8; 0x14], + #[doc = "0x14 - Stop TWI transaction"] + pub tasks_stop: crate::Reg, + _reserved1: [u8; 0x04], + #[doc = "0x1c - Suspend TWI transaction"] + pub tasks_suspend: crate::Reg, + #[doc = "0x20 - Resume TWI transaction"] + pub tasks_resume: crate::Reg, + _reserved3: [u8; 0x0c], + #[doc = "0x30 - Prepare the TWI slave to respond to a write command"] + pub tasks_preparerx: crate::Reg, + #[doc = "0x34 - Prepare the TWI slave to respond to a read command"] + pub tasks_preparetx: crate::Reg, + _reserved5: [u8; 0xcc], + #[doc = "0x104 - TWI stopped"] + pub events_stopped: crate::Reg, + _reserved6: [u8; 0x1c], + #[doc = "0x124 - TWI error"] + pub events_error: crate::Reg, + _reserved7: [u8; 0x24], + #[doc = "0x14c - Receive sequence started"] + pub events_rxstarted: crate::Reg, + #[doc = "0x150 - Transmit sequence started"] + pub events_txstarted: crate::Reg, + _reserved9: [u8; 0x10], + #[doc = "0x164 - Write command received"] + pub events_write: crate::Reg, + #[doc = "0x168 - Read command received"] + pub events_read: crate::Reg, + _reserved11: [u8; 0x94], + #[doc = "0x200 - Shortcut register"] + pub shorts: crate::Reg, + _reserved12: [u8; 0xfc], + #[doc = "0x300 - Enable or disable interrupt"] + pub inten: crate::Reg, + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved15: [u8; 0x01c4], + #[doc = "0x4d0 - Error source"] + pub errorsrc: crate::Reg, + #[doc = "0x4d4 - Status register indicating which address had a match"] + pub match_: crate::Reg, + _reserved17: [u8; 0x28], + #[doc = "0x500 - Enable TWIS"] + pub enable: crate::Reg, + _reserved18: [u8; 0x04], + #[doc = "0x508..0x510 - Unspecified"] + pub psel: PSEL, + _reserved19: [u8; 0x24], + #[doc = "0x534..0x540 - RXD EasyDMA channel"] + pub rxd: RXD, + _reserved20: [u8; 0x04], + #[doc = "0x544..0x550 - TXD EasyDMA channel"] + pub txd: TXD, + _reserved21: [u8; 0x38], + #[doc = "0x588..0x590 - Description collection\\[0\\]: TWI slave address 0"] + pub address: [crate::Reg; 2], + _reserved22: [u8; 0x04], + #[doc = "0x594 - Configuration register for the address match mechanism"] + pub config: crate::Reg, + _reserved23: [u8; 0x28], + #[doc = "0x5c0 - Over-read character. Character sent out in case of an over-read of the transmit buffer."] + pub orc: crate::Reg, +} +#[doc = r"Register block"] +#[repr(C)] +pub struct PSEL { + #[doc = "0x00 - Pin select for SCL signal"] + pub scl: crate::Reg, + #[doc = "0x04 - Pin select for SDA signal"] + pub sda: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod psel; +#[doc = r"Register block"] +#[repr(C)] +pub struct RXD { + #[doc = "0x00 - RXD Data pointer"] + pub ptr: crate::Reg, + #[doc = "0x04 - Maximum number of bytes in RXD buffer"] + pub maxcnt: crate::Reg, + #[doc = "0x08 - Number of bytes transferred in the last RXD transaction"] + pub amount: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "RXD EasyDMA channel"] +pub mod rxd; +#[doc = r"Register block"] +#[repr(C)] +pub struct TXD { + #[doc = "0x00 - TXD Data pointer"] + pub ptr: crate::Reg, + #[doc = "0x04 - Maximum number of bytes in TXD buffer"] + pub maxcnt: crate::Reg, + #[doc = "0x08 - Number of bytes transferred in the last TXD transaction"] + pub amount: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "TXD EasyDMA channel"] +pub mod txd; +#[doc = "TASKS_STOP register accessor: an alias for `Reg`"] +pub type TASKS_STOP = crate::Reg; +#[doc = "Stop TWI transaction"] +pub mod tasks_stop; +#[doc = "TASKS_SUSPEND register accessor: an alias for `Reg`"] +pub type TASKS_SUSPEND = crate::Reg; +#[doc = "Suspend TWI transaction"] +pub mod tasks_suspend; +#[doc = "TASKS_RESUME register accessor: an alias for `Reg`"] +pub type TASKS_RESUME = crate::Reg; +#[doc = "Resume TWI transaction"] +pub mod tasks_resume; +#[doc = "TASKS_PREPARERX register accessor: an alias for `Reg`"] +pub type TASKS_PREPARERX = crate::Reg; +#[doc = "Prepare the TWI slave to respond to a write command"] +pub mod tasks_preparerx; +#[doc = "TASKS_PREPARETX register accessor: an alias for `Reg`"] +pub type TASKS_PREPARETX = crate::Reg; +#[doc = "Prepare the TWI slave to respond to a read command"] +pub mod tasks_preparetx; +#[doc = "EVENTS_STOPPED register accessor: an alias for `Reg`"] +pub type EVENTS_STOPPED = crate::Reg; +#[doc = "TWI stopped"] +pub mod events_stopped; +#[doc = "EVENTS_ERROR register accessor: an alias for `Reg`"] +pub type EVENTS_ERROR = crate::Reg; +#[doc = "TWI error"] +pub mod events_error; +#[doc = "EVENTS_RXSTARTED register accessor: an alias for `Reg`"] +pub type EVENTS_RXSTARTED = crate::Reg; +#[doc = "Receive sequence started"] +pub mod events_rxstarted; +#[doc = "EVENTS_TXSTARTED register accessor: an alias for `Reg`"] +pub type EVENTS_TXSTARTED = crate::Reg; +#[doc = "Transmit sequence started"] +pub mod events_txstarted; +#[doc = "EVENTS_WRITE register accessor: an alias for `Reg`"] +pub type EVENTS_WRITE = crate::Reg; +#[doc = "Write command received"] +pub mod events_write; +#[doc = "EVENTS_READ register accessor: an alias for `Reg`"] +pub type EVENTS_READ = crate::Reg; +#[doc = "Read command received"] +pub mod events_read; +#[doc = "SHORTS register accessor: an alias for `Reg`"] +pub type SHORTS = crate::Reg; +#[doc = "Shortcut register"] +pub mod shorts; +#[doc = "INTEN register accessor: an alias for `Reg`"] +pub type INTEN = crate::Reg; +#[doc = "Enable or disable interrupt"] +pub mod inten; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "ERRORSRC register accessor: an alias for `Reg`"] +pub type ERRORSRC = crate::Reg; +#[doc = "Error source"] +pub mod errorsrc; +#[doc = "MATCH register accessor: an alias for `Reg`"] +pub type MATCH = crate::Reg; +#[doc = "Status register indicating which address had a match"] +pub mod match_; +#[doc = "ENABLE register accessor: an alias for `Reg`"] +pub type ENABLE = crate::Reg; +#[doc = "Enable TWIS"] +pub mod enable; +#[doc = "ADDRESS register accessor: an alias for `Reg`"] +pub type ADDRESS = crate::Reg; +#[doc = "Description collection\\[0\\]: TWI slave address 0"] +pub mod address; +#[doc = "CONFIG register accessor: an alias for `Reg`"] +pub type CONFIG = crate::Reg; +#[doc = "Configuration register for the address match mechanism"] +pub mod config; +#[doc = "ORC register accessor: an alias for `Reg`"] +pub type ORC = crate::Reg; +#[doc = "Over-read character. Character sent out in case of an over-read of the transmit buffer."] +pub mod orc; diff --git a/src/twis0/address.rs b/src/twis0/address.rs new file mode 100644 index 0000000..1680933 --- /dev/null +++ b/src/twis0/address.rs @@ -0,0 +1,103 @@ +#[doc = "Register `ADDRESS[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ADDRESS[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `ADDRESS` reader - TWI slave address"] +pub struct ADDRESS_R(crate::FieldReader); +impl ADDRESS_R { + pub(crate) fn new(bits: u8) -> Self { + ADDRESS_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ADDRESS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ADDRESS` writer - TWI slave address"] +pub struct ADDRESS_W<'a> { + w: &'a mut W, +} +impl<'a> ADDRESS_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x7f) | (value as u32 & 0x7f); + self.w + } +} +impl R { + #[doc = "Bits 0:6 - TWI slave address"] + #[inline(always)] + pub fn address(&self) -> ADDRESS_R { + ADDRESS_R::new((self.bits & 0x7f) as u8) + } +} +impl W { + #[doc = "Bits 0:6 - TWI slave address"] + #[inline(always)] + pub fn address(&mut self) -> ADDRESS_W { + ADDRESS_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description collection\\[0\\]: TWI slave address 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [address](index.html) module"] +pub struct ADDRESS_SPEC; +impl crate::RegisterSpec for ADDRESS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [address::R](R) reader structure"] +impl crate::Readable for ADDRESS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [address::W](W) writer structure"] +impl crate::Writable for ADDRESS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ADDRESS[%s] +to value 0"] +impl crate::Resettable for ADDRESS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twis0/config.rs b/src/twis0/config.rs new file mode 100644 index 0000000..aab6c46 --- /dev/null +++ b/src/twis0/config.rs @@ -0,0 +1,252 @@ +#[doc = "Register `CONFIG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CONFIG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable address matching on ADDRESS\\[0\\]\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ADDRESS0_A { + #[doc = "0: Disabled"] + DISABLED = 0, + #[doc = "1: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ADDRESS0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ADDRESS0` reader - Enable or disable address matching on ADDRESS\\[0\\]"] +pub struct ADDRESS0_R(crate::FieldReader); +impl ADDRESS0_R { + pub(crate) fn new(bits: bool) -> Self { + ADDRESS0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ADDRESS0_A { + match self.bits { + false => ADDRESS0_A::DISABLED, + true => ADDRESS0_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ADDRESS0_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ADDRESS0_A::ENABLED + } +} +impl core::ops::Deref for ADDRESS0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ADDRESS0` writer - Enable or disable address matching on ADDRESS\\[0\\]"] +pub struct ADDRESS0_W<'a> { + w: &'a mut W, +} +impl<'a> ADDRESS0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ADDRESS0_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ADDRESS0_A::DISABLED) + } + #[doc = "Enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ADDRESS0_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Enable or disable address matching on ADDRESS\\[1\\]\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ADDRESS1_A { + #[doc = "0: Disabled"] + DISABLED = 0, + #[doc = "1: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ADDRESS1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ADDRESS1` reader - Enable or disable address matching on ADDRESS\\[1\\]"] +pub struct ADDRESS1_R(crate::FieldReader); +impl ADDRESS1_R { + pub(crate) fn new(bits: bool) -> Self { + ADDRESS1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ADDRESS1_A { + match self.bits { + false => ADDRESS1_A::DISABLED, + true => ADDRESS1_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ADDRESS1_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ADDRESS1_A::ENABLED + } +} +impl core::ops::Deref for ADDRESS1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ADDRESS1` writer - Enable or disable address matching on ADDRESS\\[1\\]"] +pub struct ADDRESS1_W<'a> { + w: &'a mut W, +} +impl<'a> ADDRESS1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ADDRESS1_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ADDRESS1_A::DISABLED) + } + #[doc = "Enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ADDRESS1_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable or disable address matching on ADDRESS\\[0\\]"] + #[inline(always)] + pub fn address0(&self) -> ADDRESS0_R { + ADDRESS0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Enable or disable address matching on ADDRESS\\[1\\]"] + #[inline(always)] + pub fn address1(&self) -> ADDRESS1_R { + ADDRESS1_R::new(((self.bits >> 1) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Enable or disable address matching on ADDRESS\\[0\\]"] + #[inline(always)] + pub fn address0(&mut self) -> ADDRESS0_W { + ADDRESS0_W { w: self } + } + #[doc = "Bit 1 - Enable or disable address matching on ADDRESS\\[1\\]"] + #[inline(always)] + pub fn address1(&mut self) -> ADDRESS1_W { + ADDRESS1_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Configuration register for the address match mechanism\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [config](index.html) module"] +pub struct CONFIG_SPEC; +impl crate::RegisterSpec for CONFIG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [config::R](R) reader structure"] +impl crate::Readable for CONFIG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [config::W](W) writer structure"] +impl crate::Writable for CONFIG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CONFIG to value 0x01"] +impl crate::Resettable for CONFIG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x01 + } +} diff --git a/src/twis0/enable.rs b/src/twis0/enable.rs new file mode 100644 index 0000000..a0edb17 --- /dev/null +++ b/src/twis0/enable.rs @@ -0,0 +1,151 @@ +#[doc = "Register `ENABLE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ENABLE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable TWIS\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum ENABLE_A { + #[doc = "0: Disable TWIS"] + DISABLED = 0, + #[doc = "9: Enable TWIS"] + ENABLED = 9, +} +impl From for u8 { + #[inline(always)] + fn from(variant: ENABLE_A) -> Self { + variant as _ + } +} +#[doc = "Field `ENABLE` reader - Enable or disable TWIS"] +pub struct ENABLE_R(crate::FieldReader); +impl ENABLE_R { + pub(crate) fn new(bits: u8) -> Self { + ENABLE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(ENABLE_A::DISABLED), + 9 => Some(ENABLE_A::ENABLED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENABLE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENABLE_A::ENABLED + } +} +impl core::ops::Deref for ENABLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENABLE` writer - Enable or disable TWIS"] +pub struct ENABLE_W<'a> { + w: &'a mut W, +} +impl<'a> ENABLE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENABLE_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Disable TWIS"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENABLE_A::DISABLED) + } + #[doc = "Enable TWIS"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENABLE_A::ENABLED) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); + self.w + } +} +impl R { + #[doc = "Bits 0:3 - Enable or disable TWIS"] + #[inline(always)] + pub fn enable(&self) -> ENABLE_R { + ENABLE_R::new((self.bits & 0x0f) as u8) + } +} +impl W { + #[doc = "Bits 0:3 - Enable or disable TWIS"] + #[inline(always)] + pub fn enable(&mut self) -> ENABLE_W { + ENABLE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable TWIS\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [enable](index.html) module"] +pub struct ENABLE_SPEC; +impl crate::RegisterSpec for ENABLE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [enable::R](R) reader structure"] +impl crate::Readable for ENABLE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [enable::W](W) writer structure"] +impl crate::Writable for ENABLE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ENABLE to value 0"] +impl crate::Resettable for ENABLE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twis0/errorsrc.rs b/src/twis0/errorsrc.rs new file mode 100644 index 0000000..047103a --- /dev/null +++ b/src/twis0/errorsrc.rs @@ -0,0 +1,345 @@ +#[doc = "Register `ERRORSRC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ERRORSRC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "RX buffer overflow detected, and prevented\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OVERFLOW_A { + #[doc = "0: Error did not occur"] + NOTDETECTED = 0, + #[doc = "1: Error occurred"] + DETECTED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OVERFLOW_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OVERFLOW` reader - RX buffer overflow detected, and prevented"] +pub struct OVERFLOW_R(crate::FieldReader); +impl OVERFLOW_R { + pub(crate) fn new(bits: bool) -> Self { + OVERFLOW_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> OVERFLOW_A { + match self.bits { + false => OVERFLOW_A::NOTDETECTED, + true => OVERFLOW_A::DETECTED, + } + } + #[doc = "Checks if the value of the field is `NOTDETECTED`"] + #[inline(always)] + pub fn is_not_detected(&self) -> bool { + **self == OVERFLOW_A::NOTDETECTED + } + #[doc = "Checks if the value of the field is `DETECTED`"] + #[inline(always)] + pub fn is_detected(&self) -> bool { + **self == OVERFLOW_A::DETECTED + } +} +impl core::ops::Deref for OVERFLOW_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OVERFLOW` writer - RX buffer overflow detected, and prevented"] +pub struct OVERFLOW_W<'a> { + w: &'a mut W, +} +impl<'a> OVERFLOW_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: OVERFLOW_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Error did not occur"] + #[inline(always)] + pub fn not_detected(self) -> &'a mut W { + self.variant(OVERFLOW_A::NOTDETECTED) + } + #[doc = "Error occurred"] + #[inline(always)] + pub fn detected(self) -> &'a mut W { + self.variant(OVERFLOW_A::DETECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "NACK sent after receiving a data byte\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum DNACK_A { + #[doc = "0: Error did not occur"] + NOTRECEIVED = 0, + #[doc = "1: Error occurred"] + RECEIVED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: DNACK_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `DNACK` reader - NACK sent after receiving a data byte"] +pub struct DNACK_R(crate::FieldReader); +impl DNACK_R { + pub(crate) fn new(bits: bool) -> Self { + DNACK_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> DNACK_A { + match self.bits { + false => DNACK_A::NOTRECEIVED, + true => DNACK_A::RECEIVED, + } + } + #[doc = "Checks if the value of the field is `NOTRECEIVED`"] + #[inline(always)] + pub fn is_not_received(&self) -> bool { + **self == DNACK_A::NOTRECEIVED + } + #[doc = "Checks if the value of the field is `RECEIVED`"] + #[inline(always)] + pub fn is_received(&self) -> bool { + **self == DNACK_A::RECEIVED + } +} +impl core::ops::Deref for DNACK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `DNACK` writer - NACK sent after receiving a data byte"] +pub struct DNACK_W<'a> { + w: &'a mut W, +} +impl<'a> DNACK_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: DNACK_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Error did not occur"] + #[inline(always)] + pub fn not_received(self) -> &'a mut W { + self.variant(DNACK_A::NOTRECEIVED) + } + #[doc = "Error occurred"] + #[inline(always)] + pub fn received(self) -> &'a mut W { + self.variant(DNACK_A::RECEIVED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "TX buffer over-read detected, and prevented\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OVERREAD_A { + #[doc = "0: Error did not occur"] + NOTDETECTED = 0, + #[doc = "1: Error occurred"] + DETECTED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OVERREAD_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OVERREAD` reader - TX buffer over-read detected, and prevented"] +pub struct OVERREAD_R(crate::FieldReader); +impl OVERREAD_R { + pub(crate) fn new(bits: bool) -> Self { + OVERREAD_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> OVERREAD_A { + match self.bits { + false => OVERREAD_A::NOTDETECTED, + true => OVERREAD_A::DETECTED, + } + } + #[doc = "Checks if the value of the field is `NOTDETECTED`"] + #[inline(always)] + pub fn is_not_detected(&self) -> bool { + **self == OVERREAD_A::NOTDETECTED + } + #[doc = "Checks if the value of the field is `DETECTED`"] + #[inline(always)] + pub fn is_detected(&self) -> bool { + **self == OVERREAD_A::DETECTED + } +} +impl core::ops::Deref for OVERREAD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OVERREAD` writer - TX buffer over-read detected, and prevented"] +pub struct OVERREAD_W<'a> { + w: &'a mut W, +} +impl<'a> OVERREAD_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: OVERREAD_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Error did not occur"] + #[inline(always)] + pub fn not_detected(self) -> &'a mut W { + self.variant(OVERREAD_A::NOTDETECTED) + } + #[doc = "Error occurred"] + #[inline(always)] + pub fn detected(self) -> &'a mut W { + self.variant(OVERREAD_A::DETECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +impl R { + #[doc = "Bit 0 - RX buffer overflow detected, and prevented"] + #[inline(always)] + pub fn overflow(&self) -> OVERFLOW_R { + OVERFLOW_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 2 - NACK sent after receiving a data byte"] + #[inline(always)] + pub fn dnack(&self) -> DNACK_R { + DNACK_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - TX buffer over-read detected, and prevented"] + #[inline(always)] + pub fn overread(&self) -> OVERREAD_R { + OVERREAD_R::new(((self.bits >> 3) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - RX buffer overflow detected, and prevented"] + #[inline(always)] + pub fn overflow(&mut self) -> OVERFLOW_W { + OVERFLOW_W { w: self } + } + #[doc = "Bit 2 - NACK sent after receiving a data byte"] + #[inline(always)] + pub fn dnack(&mut self) -> DNACK_W { + DNACK_W { w: self } + } + #[doc = "Bit 3 - TX buffer over-read detected, and prevented"] + #[inline(always)] + pub fn overread(&mut self) -> OVERREAD_W { + OVERREAD_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Error source\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [errorsrc](index.html) module"] +pub struct ERRORSRC_SPEC; +impl crate::RegisterSpec for ERRORSRC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [errorsrc::R](R) reader structure"] +impl crate::Readable for ERRORSRC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [errorsrc::W](W) writer structure"] +impl crate::Writable for ERRORSRC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ERRORSRC to value 0"] +impl crate::Resettable for ERRORSRC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twis0/events_error.rs b/src/twis0/events_error.rs new file mode 100644 index 0000000..0fbf806 --- /dev/null +++ b/src/twis0/events_error.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_ERROR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_ERROR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "TWI error\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_error](index.html) module"] +pub struct EVENTS_ERROR_SPEC; +impl crate::RegisterSpec for EVENTS_ERROR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_error::R](R) reader structure"] +impl crate::Readable for EVENTS_ERROR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_error::W](W) writer structure"] +impl crate::Writable for EVENTS_ERROR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_ERROR to value 0"] +impl crate::Resettable for EVENTS_ERROR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twis0/events_read.rs b/src/twis0/events_read.rs new file mode 100644 index 0000000..a0bf09b --- /dev/null +++ b/src/twis0/events_read.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_READ` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_READ` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Read command received\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_read](index.html) module"] +pub struct EVENTS_READ_SPEC; +impl crate::RegisterSpec for EVENTS_READ_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_read::R](R) reader structure"] +impl crate::Readable for EVENTS_READ_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_read::W](W) writer structure"] +impl crate::Writable for EVENTS_READ_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_READ to value 0"] +impl crate::Resettable for EVENTS_READ_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twis0/events_rxstarted.rs b/src/twis0/events_rxstarted.rs new file mode 100644 index 0000000..01f4b97 --- /dev/null +++ b/src/twis0/events_rxstarted.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_RXSTARTED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_RXSTARTED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Receive sequence started\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_rxstarted](index.html) module"] +pub struct EVENTS_RXSTARTED_SPEC; +impl crate::RegisterSpec for EVENTS_RXSTARTED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_rxstarted::R](R) reader structure"] +impl crate::Readable for EVENTS_RXSTARTED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_rxstarted::W](W) writer structure"] +impl crate::Writable for EVENTS_RXSTARTED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_RXSTARTED to value 0"] +impl crate::Resettable for EVENTS_RXSTARTED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twis0/events_stopped.rs b/src/twis0/events_stopped.rs new file mode 100644 index 0000000..44f8ec4 --- /dev/null +++ b/src/twis0/events_stopped.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_STOPPED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_STOPPED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "TWI stopped\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_stopped](index.html) module"] +pub struct EVENTS_STOPPED_SPEC; +impl crate::RegisterSpec for EVENTS_STOPPED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_stopped::R](R) reader structure"] +impl crate::Readable for EVENTS_STOPPED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_stopped::W](W) writer structure"] +impl crate::Writable for EVENTS_STOPPED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_STOPPED to value 0"] +impl crate::Resettable for EVENTS_STOPPED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twis0/events_txstarted.rs b/src/twis0/events_txstarted.rs new file mode 100644 index 0000000..dde90a1 --- /dev/null +++ b/src/twis0/events_txstarted.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_TXSTARTED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_TXSTARTED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Transmit sequence started\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_txstarted](index.html) module"] +pub struct EVENTS_TXSTARTED_SPEC; +impl crate::RegisterSpec for EVENTS_TXSTARTED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_txstarted::R](R) reader structure"] +impl crate::Readable for EVENTS_TXSTARTED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_txstarted::W](W) writer structure"] +impl crate::Writable for EVENTS_TXSTARTED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_TXSTARTED to value 0"] +impl crate::Resettable for EVENTS_TXSTARTED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twis0/events_write.rs b/src/twis0/events_write.rs new file mode 100644 index 0000000..10d9627 --- /dev/null +++ b/src/twis0/events_write.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_WRITE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_WRITE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Write command received\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_write](index.html) module"] +pub struct EVENTS_WRITE_SPEC; +impl crate::RegisterSpec for EVENTS_WRITE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_write::R](R) reader structure"] +impl crate::Readable for EVENTS_WRITE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_write::W](W) writer structure"] +impl crate::Writable for EVENTS_WRITE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_WRITE to value 0"] +impl crate::Resettable for EVENTS_WRITE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twis0/inten.rs b/src/twis0/inten.rs new file mode 100644 index 0000000..fb1c83b --- /dev/null +++ b/src/twis0/inten.rs @@ -0,0 +1,624 @@ +#[doc = "Register `INTEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` reader - Enable or disable interrupt for STOPPED event"] +pub struct STOPPED_R(crate::FieldReader); +impl STOPPED_R { + pub(crate) fn new(bits: bool) -> Self { + STOPPED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STOPPED_A { + match self.bits { + false => STOPPED_A::DISABLED, + true => STOPPED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STOPPED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STOPPED_A::ENABLED + } +} +impl core::ops::Deref for STOPPED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `STOPPED` writer - Enable or disable interrupt for STOPPED event"] +pub struct STOPPED_W<'a> { + w: &'a mut W, +} +impl<'a> STOPPED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STOPPED_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(STOPPED_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(STOPPED_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Enable or disable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` reader - Enable or disable interrupt for ERROR event"] +pub struct ERROR_R(crate::FieldReader); +impl ERROR_R { + pub(crate) fn new(bits: bool) -> Self { + ERROR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ERROR_A { + match self.bits { + false => ERROR_A::DISABLED, + true => ERROR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ERROR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ERROR_A::ENABLED + } +} +impl core::ops::Deref for ERROR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ERROR` writer - Enable or disable interrupt for ERROR event"] +pub struct ERROR_W<'a> { + w: &'a mut W, +} +impl<'a> ERROR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ERROR_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ERROR_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ERROR_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Enable or disable interrupt for RXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXSTARTED_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXSTARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXSTARTED` reader - Enable or disable interrupt for RXSTARTED event"] +pub struct RXSTARTED_R(crate::FieldReader); +impl RXSTARTED_R { + pub(crate) fn new(bits: bool) -> Self { + RXSTARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXSTARTED_A { + match self.bits { + false => RXSTARTED_A::DISABLED, + true => RXSTARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXSTARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXSTARTED_A::ENABLED + } +} +impl core::ops::Deref for RXSTARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RXSTARTED` writer - Enable or disable interrupt for RXSTARTED event"] +pub struct RXSTARTED_W<'a> { + w: &'a mut W, +} +impl<'a> RXSTARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXSTARTED_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(RXSTARTED_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(RXSTARTED_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Enable or disable interrupt for TXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXSTARTED_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXSTARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXSTARTED` reader - Enable or disable interrupt for TXSTARTED event"] +pub struct TXSTARTED_R(crate::FieldReader); +impl TXSTARTED_R { + pub(crate) fn new(bits: bool) -> Self { + TXSTARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXSTARTED_A { + match self.bits { + false => TXSTARTED_A::DISABLED, + true => TXSTARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXSTARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXSTARTED_A::ENABLED + } +} +impl core::ops::Deref for TXSTARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TXSTARTED` writer - Enable or disable interrupt for TXSTARTED event"] +pub struct TXSTARTED_W<'a> { + w: &'a mut W, +} +impl<'a> TXSTARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXSTARTED_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(TXSTARTED_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(TXSTARTED_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Enable or disable interrupt for WRITE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum WRITE_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: WRITE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `WRITE` reader - Enable or disable interrupt for WRITE event"] +pub struct WRITE_R(crate::FieldReader); +impl WRITE_R { + pub(crate) fn new(bits: bool) -> Self { + WRITE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> WRITE_A { + match self.bits { + false => WRITE_A::DISABLED, + true => WRITE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == WRITE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == WRITE_A::ENABLED + } +} +impl core::ops::Deref for WRITE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `WRITE` writer - Enable or disable interrupt for WRITE event"] +pub struct WRITE_W<'a> { + w: &'a mut W, +} +impl<'a> WRITE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: WRITE_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(WRITE_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(WRITE_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Enable or disable interrupt for READ event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READ_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READ_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READ` reader - Enable or disable interrupt for READ event"] +pub struct READ_R(crate::FieldReader); +impl READ_R { + pub(crate) fn new(bits: bool) -> Self { + READ_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> READ_A { + match self.bits { + false => READ_A::DISABLED, + true => READ_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == READ_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == READ_A::ENABLED + } +} +impl core::ops::Deref for READ_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `READ` writer - Enable or disable interrupt for READ event"] +pub struct READ_W<'a> { + w: &'a mut W, +} +impl<'a> READ_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: READ_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(READ_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(READ_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +impl R { + #[doc = "Bit 1 - Enable or disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&self) -> STOPPED_R { + STOPPED_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 9 - Enable or disable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&self) -> ERROR_R { + ERROR_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 19 - Enable or disable interrupt for RXSTARTED event"] + #[inline(always)] + pub fn rxstarted(&self) -> RXSTARTED_R { + RXSTARTED_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Enable or disable interrupt for TXSTARTED event"] + #[inline(always)] + pub fn txstarted(&self) -> TXSTARTED_R { + TXSTARTED_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 25 - Enable or disable interrupt for WRITE event"] + #[inline(always)] + pub fn write(&self) -> WRITE_R { + WRITE_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Enable or disable interrupt for READ event"] + #[inline(always)] + pub fn read(&self) -> READ_R { + READ_R::new(((self.bits >> 26) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 1 - Enable or disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&mut self) -> STOPPED_W { + STOPPED_W { w: self } + } + #[doc = "Bit 9 - Enable or disable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&mut self) -> ERROR_W { + ERROR_W { w: self } + } + #[doc = "Bit 19 - Enable or disable interrupt for RXSTARTED event"] + #[inline(always)] + pub fn rxstarted(&mut self) -> RXSTARTED_W { + RXSTARTED_W { w: self } + } + #[doc = "Bit 20 - Enable or disable interrupt for TXSTARTED event"] + #[inline(always)] + pub fn txstarted(&mut self) -> TXSTARTED_W { + TXSTARTED_W { w: self } + } + #[doc = "Bit 25 - Enable or disable interrupt for WRITE event"] + #[inline(always)] + pub fn write(&mut self) -> WRITE_W { + WRITE_W { w: self } + } + #[doc = "Bit 26 - Enable or disable interrupt for READ event"] + #[inline(always)] + pub fn read(&mut self) -> READ_W { + READ_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable or disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [inten](index.html) module"] +pub struct INTEN_SPEC; +impl crate::RegisterSpec for INTEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [inten::R](R) reader structure"] +impl crate::Readable for INTEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [inten::W](W) writer structure"] +impl crate::Writable for INTEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTEN to value 0"] +impl crate::Resettable for INTEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twis0/intenclr.rs b/src/twis0/intenclr.rs new file mode 100644 index 0000000..3e04f41 --- /dev/null +++ b/src/twis0/intenclr.rs @@ -0,0 +1,666 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` reader - Write '1' to Disable interrupt for STOPPED event"] +pub struct STOPPED_R(crate::FieldReader); +impl STOPPED_R { + pub(crate) fn new(bits: bool) -> Self { + STOPPED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STOPPED_A { + match self.bits { + false => STOPPED_A::DISABLED, + true => STOPPED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STOPPED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STOPPED_A::ENABLED + } +} +impl core::ops::Deref for STOPPED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` writer - Write '1' to Disable interrupt for STOPPED event"] +pub struct STOPPED_W<'a> { + w: &'a mut W, +} +impl<'a> STOPPED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STOPPED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(STOPPED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` reader - Write '1' to Disable interrupt for ERROR event"] +pub struct ERROR_R(crate::FieldReader); +impl ERROR_R { + pub(crate) fn new(bits: bool) -> Self { + ERROR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ERROR_A { + match self.bits { + false => ERROR_A::DISABLED, + true => ERROR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ERROR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ERROR_A::ENABLED + } +} +impl core::ops::Deref for ERROR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` writer - Write '1' to Disable interrupt for ERROR event"] +pub struct ERROR_W<'a> { + w: &'a mut W, +} +impl<'a> ERROR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ERROR_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(ERROR_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for RXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXSTARTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXSTARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXSTARTED` reader - Write '1' to Disable interrupt for RXSTARTED event"] +pub struct RXSTARTED_R(crate::FieldReader); +impl RXSTARTED_R { + pub(crate) fn new(bits: bool) -> Self { + RXSTARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXSTARTED_A { + match self.bits { + false => RXSTARTED_A::DISABLED, + true => RXSTARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXSTARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXSTARTED_A::ENABLED + } +} +impl core::ops::Deref for RXSTARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for RXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXSTARTED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXSTARTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXSTARTED` writer - Write '1' to Disable interrupt for RXSTARTED event"] +pub struct RXSTARTED_W<'a> { + w: &'a mut W, +} +impl<'a> RXSTARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXSTARTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(RXSTARTED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for TXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXSTARTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXSTARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXSTARTED` reader - Write '1' to Disable interrupt for TXSTARTED event"] +pub struct TXSTARTED_R(crate::FieldReader); +impl TXSTARTED_R { + pub(crate) fn new(bits: bool) -> Self { + TXSTARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXSTARTED_A { + match self.bits { + false => TXSTARTED_A::DISABLED, + true => TXSTARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXSTARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXSTARTED_A::ENABLED + } +} +impl core::ops::Deref for TXSTARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXSTARTED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXSTARTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXSTARTED` writer - Write '1' to Disable interrupt for TXSTARTED event"] +pub struct TXSTARTED_W<'a> { + w: &'a mut W, +} +impl<'a> TXSTARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXSTARTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TXSTARTED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for WRITE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum WRITE_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: WRITE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `WRITE` reader - Write '1' to Disable interrupt for WRITE event"] +pub struct WRITE_R(crate::FieldReader); +impl WRITE_R { + pub(crate) fn new(bits: bool) -> Self { + WRITE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> WRITE_A { + match self.bits { + false => WRITE_A::DISABLED, + true => WRITE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == WRITE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == WRITE_A::ENABLED + } +} +impl core::ops::Deref for WRITE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for WRITE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum WRITE_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: WRITE_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `WRITE` writer - Write '1' to Disable interrupt for WRITE event"] +pub struct WRITE_W<'a> { + w: &'a mut W, +} +impl<'a> WRITE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: WRITE_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(WRITE_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for READ event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READ_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READ_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READ` reader - Write '1' to Disable interrupt for READ event"] +pub struct READ_R(crate::FieldReader); +impl READ_R { + pub(crate) fn new(bits: bool) -> Self { + READ_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> READ_A { + match self.bits { + false => READ_A::DISABLED, + true => READ_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == READ_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == READ_A::ENABLED + } +} +impl core::ops::Deref for READ_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for READ event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READ_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READ_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READ` writer - Write '1' to Disable interrupt for READ event"] +pub struct READ_W<'a> { + w: &'a mut W, +} +impl<'a> READ_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: READ_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(READ_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +impl R { + #[doc = "Bit 1 - Write '1' to Disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&self) -> STOPPED_R { + STOPPED_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 9 - Write '1' to Disable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&self) -> ERROR_R { + ERROR_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 19 - Write '1' to Disable interrupt for RXSTARTED event"] + #[inline(always)] + pub fn rxstarted(&self) -> RXSTARTED_R { + RXSTARTED_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Write '1' to Disable interrupt for TXSTARTED event"] + #[inline(always)] + pub fn txstarted(&self) -> TXSTARTED_R { + TXSTARTED_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 25 - Write '1' to Disable interrupt for WRITE event"] + #[inline(always)] + pub fn write(&self) -> WRITE_R { + WRITE_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Write '1' to Disable interrupt for READ event"] + #[inline(always)] + pub fn read(&self) -> READ_R { + READ_R::new(((self.bits >> 26) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 1 - Write '1' to Disable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&mut self) -> STOPPED_W { + STOPPED_W { w: self } + } + #[doc = "Bit 9 - Write '1' to Disable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&mut self) -> ERROR_W { + ERROR_W { w: self } + } + #[doc = "Bit 19 - Write '1' to Disable interrupt for RXSTARTED event"] + #[inline(always)] + pub fn rxstarted(&mut self) -> RXSTARTED_W { + RXSTARTED_W { w: self } + } + #[doc = "Bit 20 - Write '1' to Disable interrupt for TXSTARTED event"] + #[inline(always)] + pub fn txstarted(&mut self) -> TXSTARTED_W { + TXSTARTED_W { w: self } + } + #[doc = "Bit 25 - Write '1' to Disable interrupt for WRITE event"] + #[inline(always)] + pub fn write(&mut self) -> WRITE_W { + WRITE_W { w: self } + } + #[doc = "Bit 26 - Write '1' to Disable interrupt for READ event"] + #[inline(always)] + pub fn read(&mut self) -> READ_W { + READ_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twis0/intenset.rs b/src/twis0/intenset.rs new file mode 100644 index 0000000..48c3347 --- /dev/null +++ b/src/twis0/intenset.rs @@ -0,0 +1,666 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` reader - Write '1' to Enable interrupt for STOPPED event"] +pub struct STOPPED_R(crate::FieldReader); +impl STOPPED_R { + pub(crate) fn new(bits: bool) -> Self { + STOPPED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> STOPPED_A { + match self.bits { + false => STOPPED_A::DISABLED, + true => STOPPED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == STOPPED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == STOPPED_A::ENABLED + } +} +impl core::ops::Deref for STOPPED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for STOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum STOPPED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: STOPPED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `STOPPED` writer - Write '1' to Enable interrupt for STOPPED event"] +pub struct STOPPED_W<'a> { + w: &'a mut W, +} +impl<'a> STOPPED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: STOPPED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(STOPPED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` reader - Write '1' to Enable interrupt for ERROR event"] +pub struct ERROR_R(crate::FieldReader); +impl ERROR_R { + pub(crate) fn new(bits: bool) -> Self { + ERROR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ERROR_A { + match self.bits { + false => ERROR_A::DISABLED, + true => ERROR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ERROR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ERROR_A::ENABLED + } +} +impl core::ops::Deref for ERROR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` writer - Write '1' to Enable interrupt for ERROR event"] +pub struct ERROR_W<'a> { + w: &'a mut W, +} +impl<'a> ERROR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ERROR_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(ERROR_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for RXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXSTARTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXSTARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXSTARTED` reader - Write '1' to Enable interrupt for RXSTARTED event"] +pub struct RXSTARTED_R(crate::FieldReader); +impl RXSTARTED_R { + pub(crate) fn new(bits: bool) -> Self { + RXSTARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXSTARTED_A { + match self.bits { + false => RXSTARTED_A::DISABLED, + true => RXSTARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXSTARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXSTARTED_A::ENABLED + } +} +impl core::ops::Deref for RXSTARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for RXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXSTARTED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXSTARTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXSTARTED` writer - Write '1' to Enable interrupt for RXSTARTED event"] +pub struct RXSTARTED_W<'a> { + w: &'a mut W, +} +impl<'a> RXSTARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXSTARTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(RXSTARTED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for TXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXSTARTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXSTARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXSTARTED` reader - Write '1' to Enable interrupt for TXSTARTED event"] +pub struct TXSTARTED_R(crate::FieldReader); +impl TXSTARTED_R { + pub(crate) fn new(bits: bool) -> Self { + TXSTARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXSTARTED_A { + match self.bits { + false => TXSTARTED_A::DISABLED, + true => TXSTARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXSTARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXSTARTED_A::ENABLED + } +} +impl core::ops::Deref for TXSTARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXSTARTED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXSTARTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXSTARTED` writer - Write '1' to Enable interrupt for TXSTARTED event"] +pub struct TXSTARTED_W<'a> { + w: &'a mut W, +} +impl<'a> TXSTARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXSTARTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TXSTARTED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for WRITE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum WRITE_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: WRITE_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `WRITE` reader - Write '1' to Enable interrupt for WRITE event"] +pub struct WRITE_R(crate::FieldReader); +impl WRITE_R { + pub(crate) fn new(bits: bool) -> Self { + WRITE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> WRITE_A { + match self.bits { + false => WRITE_A::DISABLED, + true => WRITE_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == WRITE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == WRITE_A::ENABLED + } +} +impl core::ops::Deref for WRITE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for WRITE event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum WRITE_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: WRITE_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `WRITE` writer - Write '1' to Enable interrupt for WRITE event"] +pub struct WRITE_W<'a> { + w: &'a mut W, +} +impl<'a> WRITE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: WRITE_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(WRITE_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 25)) | ((value as u32 & 0x01) << 25); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for READ event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READ_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READ_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READ` reader - Write '1' to Enable interrupt for READ event"] +pub struct READ_R(crate::FieldReader); +impl READ_R { + pub(crate) fn new(bits: bool) -> Self { + READ_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> READ_A { + match self.bits { + false => READ_A::DISABLED, + true => READ_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == READ_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == READ_A::ENABLED + } +} +impl core::ops::Deref for READ_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for READ event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READ_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READ_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READ` writer - Write '1' to Enable interrupt for READ event"] +pub struct READ_W<'a> { + w: &'a mut W, +} +impl<'a> READ_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: READ_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(READ_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 26)) | ((value as u32 & 0x01) << 26); + self.w + } +} +impl R { + #[doc = "Bit 1 - Write '1' to Enable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&self) -> STOPPED_R { + STOPPED_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 9 - Write '1' to Enable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&self) -> ERROR_R { + ERROR_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 19 - Write '1' to Enable interrupt for RXSTARTED event"] + #[inline(always)] + pub fn rxstarted(&self) -> RXSTARTED_R { + RXSTARTED_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Write '1' to Enable interrupt for TXSTARTED event"] + #[inline(always)] + pub fn txstarted(&self) -> TXSTARTED_R { + TXSTARTED_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 25 - Write '1' to Enable interrupt for WRITE event"] + #[inline(always)] + pub fn write(&self) -> WRITE_R { + WRITE_R::new(((self.bits >> 25) & 0x01) != 0) + } + #[doc = "Bit 26 - Write '1' to Enable interrupt for READ event"] + #[inline(always)] + pub fn read(&self) -> READ_R { + READ_R::new(((self.bits >> 26) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 1 - Write '1' to Enable interrupt for STOPPED event"] + #[inline(always)] + pub fn stopped(&mut self) -> STOPPED_W { + STOPPED_W { w: self } + } + #[doc = "Bit 9 - Write '1' to Enable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&mut self) -> ERROR_W { + ERROR_W { w: self } + } + #[doc = "Bit 19 - Write '1' to Enable interrupt for RXSTARTED event"] + #[inline(always)] + pub fn rxstarted(&mut self) -> RXSTARTED_W { + RXSTARTED_W { w: self } + } + #[doc = "Bit 20 - Write '1' to Enable interrupt for TXSTARTED event"] + #[inline(always)] + pub fn txstarted(&mut self) -> TXSTARTED_W { + TXSTARTED_W { w: self } + } + #[doc = "Bit 25 - Write '1' to Enable interrupt for WRITE event"] + #[inline(always)] + pub fn write(&mut self) -> WRITE_W { + WRITE_W { w: self } + } + #[doc = "Bit 26 - Write '1' to Enable interrupt for READ event"] + #[inline(always)] + pub fn read(&mut self) -> READ_W { + READ_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twis0/match_.rs b/src/twis0/match_.rs new file mode 100644 index 0000000..d98ea72 --- /dev/null +++ b/src/twis0/match_.rs @@ -0,0 +1,52 @@ +#[doc = "Register `MATCH` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `MATCH` reader - Which of the addresses in {ADDRESS} matched the incoming address"] +pub struct MATCH_R(crate::FieldReader); +impl MATCH_R { + pub(crate) fn new(bits: bool) -> Self { + MATCH_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MATCH_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bit 0 - Which of the addresses in {ADDRESS} matched the incoming address"] + #[inline(always)] + pub fn match_(&self) -> MATCH_R { + MATCH_R::new((self.bits & 0x01) != 0) + } +} +#[doc = "Status register indicating which address had a match\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 [match_](index.html) module"] +pub struct MATCH_SPEC; +impl crate::RegisterSpec for MATCH_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [match_::R](R) reader structure"] +impl crate::Readable for MATCH_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets MATCH to value 0"] +impl crate::Resettable for MATCH_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twis0/orc.rs b/src/twis0/orc.rs new file mode 100644 index 0000000..dbcb776 --- /dev/null +++ b/src/twis0/orc.rs @@ -0,0 +1,102 @@ +#[doc = "Register `ORC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ORC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `ORC` reader - Over-read character. Character sent out in case of an over-read of the transmit buffer."] +pub struct ORC_R(crate::FieldReader); +impl ORC_R { + pub(crate) fn new(bits: u8) -> Self { + ORC_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for ORC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ORC` writer - Over-read character. Character sent out in case of an over-read of the transmit buffer."] +pub struct ORC_W<'a> { + w: &'a mut W, +} +impl<'a> ORC_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - Over-read character. Character sent out in case of an over-read of the transmit buffer."] + #[inline(always)] + pub fn orc(&self) -> ORC_R { + ORC_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - Over-read character. Character sent out in case of an over-read of the transmit buffer."] + #[inline(always)] + pub fn orc(&mut self) -> ORC_W { + ORC_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Over-read character. Character sent out in case of an over-read of the transmit buffer.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [orc](index.html) module"] +pub struct ORC_SPEC; +impl crate::RegisterSpec for ORC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [orc::R](R) reader structure"] +impl crate::Readable for ORC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [orc::W](W) writer structure"] +impl crate::Writable for ORC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ORC to value 0"] +impl crate::Resettable for ORC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twis0/psel.rs b/src/twis0/psel.rs new file mode 100644 index 0000000..fb6fab2 --- /dev/null +++ b/src/twis0/psel.rs @@ -0,0 +1,8 @@ +#[doc = "SCL register accessor: an alias for `Reg`"] +pub type SCL = crate::Reg; +#[doc = "Pin select for SCL signal"] +pub mod scl; +#[doc = "SDA register accessor: an alias for `Reg`"] +pub type SDA = crate::Reg; +#[doc = "Pin select for SDA signal"] +pub mod sda; diff --git a/src/twis0/psel/scl.rs b/src/twis0/psel/scl.rs new file mode 100644 index 0000000..270c22f --- /dev/null +++ b/src/twis0/psel/scl.rs @@ -0,0 +1,195 @@ +#[doc = "Register `SCL` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SCL` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PIN` reader - Pin number"] +pub struct PIN_R(crate::FieldReader); +impl PIN_R { + pub(crate) fn new(bits: u8) -> Self { + PIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN` writer - Pin number"] +pub struct PIN_W<'a> { + w: &'a mut W, +} +impl<'a> PIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Connection\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CONNECT_A { + #[doc = "1: Disconnect"] + DISCONNECTED = 1, + #[doc = "0: Connect"] + CONNECTED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: CONNECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CONNECT` reader - Connection"] +pub struct CONNECT_R(crate::FieldReader); +impl CONNECT_R { + pub(crate) fn new(bits: bool) -> Self { + CONNECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CONNECT_A { + match self.bits { + true => CONNECT_A::DISCONNECTED, + false => CONNECT_A::CONNECTED, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == CONNECT_A::DISCONNECTED + } + #[doc = "Checks if the value of the field is `CONNECTED`"] + #[inline(always)] + pub fn is_connected(&self) -> bool { + **self == CONNECT_A::CONNECTED + } +} +impl core::ops::Deref for CONNECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONNECT` writer - Connection"] +pub struct CONNECT_W<'a> { + w: &'a mut W, +} +impl<'a> CONNECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CONNECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(CONNECT_A::DISCONNECTED) + } + #[doc = "Connect"] + #[inline(always)] + pub fn connected(self) -> &'a mut W { + self.variant(CONNECT_A::CONNECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&self) -> PIN_R { + PIN_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&self) -> CONNECT_R { + CONNECT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&mut self) -> PIN_W { + PIN_W { w: self } + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&mut self) -> CONNECT_W { + CONNECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for SCL signal\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [scl](index.html) module"] +pub struct SCL_SPEC; +impl crate::RegisterSpec for SCL_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [scl::R](R) reader structure"] +impl crate::Readable for SCL_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [scl::W](W) writer structure"] +impl crate::Writable for SCL_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SCL to value 0xffff_ffff"] +impl crate::Resettable for SCL_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/twis0/psel/sda.rs b/src/twis0/psel/sda.rs new file mode 100644 index 0000000..2b4914b --- /dev/null +++ b/src/twis0/psel/sda.rs @@ -0,0 +1,195 @@ +#[doc = "Register `SDA` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SDA` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PIN` reader - Pin number"] +pub struct PIN_R(crate::FieldReader); +impl PIN_R { + pub(crate) fn new(bits: u8) -> Self { + PIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN` writer - Pin number"] +pub struct PIN_W<'a> { + w: &'a mut W, +} +impl<'a> PIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Connection\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CONNECT_A { + #[doc = "1: Disconnect"] + DISCONNECTED = 1, + #[doc = "0: Connect"] + CONNECTED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: CONNECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CONNECT` reader - Connection"] +pub struct CONNECT_R(crate::FieldReader); +impl CONNECT_R { + pub(crate) fn new(bits: bool) -> Self { + CONNECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CONNECT_A { + match self.bits { + true => CONNECT_A::DISCONNECTED, + false => CONNECT_A::CONNECTED, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == CONNECT_A::DISCONNECTED + } + #[doc = "Checks if the value of the field is `CONNECTED`"] + #[inline(always)] + pub fn is_connected(&self) -> bool { + **self == CONNECT_A::CONNECTED + } +} +impl core::ops::Deref for CONNECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONNECT` writer - Connection"] +pub struct CONNECT_W<'a> { + w: &'a mut W, +} +impl<'a> CONNECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CONNECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(CONNECT_A::DISCONNECTED) + } + #[doc = "Connect"] + #[inline(always)] + pub fn connected(self) -> &'a mut W { + self.variant(CONNECT_A::CONNECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&self) -> PIN_R { + PIN_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&self) -> CONNECT_R { + CONNECT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&mut self) -> PIN_W { + PIN_W { w: self } + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&mut self) -> CONNECT_W { + CONNECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for SDA signal\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sda](index.html) module"] +pub struct SDA_SPEC; +impl crate::RegisterSpec for SDA_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [sda::R](R) reader structure"] +impl crate::Readable for SDA_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [sda::W](W) writer structure"] +impl crate::Writable for SDA_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SDA to value 0xffff_ffff"] +impl crate::Resettable for SDA_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/twis0/rxd.rs b/src/twis0/rxd.rs new file mode 100644 index 0000000..feaeb5b --- /dev/null +++ b/src/twis0/rxd.rs @@ -0,0 +1,12 @@ +#[doc = "PTR register accessor: an alias for `Reg`"] +pub type PTR = crate::Reg; +#[doc = "RXD Data pointer"] +pub mod ptr; +#[doc = "MAXCNT register accessor: an alias for `Reg`"] +pub type MAXCNT = crate::Reg; +#[doc = "Maximum number of bytes in RXD buffer"] +pub mod maxcnt; +#[doc = "AMOUNT register accessor: an alias for `Reg`"] +pub type AMOUNT = crate::Reg; +#[doc = "Number of bytes transferred in the last RXD transaction"] +pub mod amount; diff --git a/src/twis0/rxd/amount.rs b/src/twis0/rxd/amount.rs new file mode 100644 index 0000000..7d1755e --- /dev/null +++ b/src/twis0/rxd/amount.rs @@ -0,0 +1,52 @@ +#[doc = "Register `AMOUNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `AMOUNT` reader - Number of bytes transferred in the last RXD transaction"] +pub struct AMOUNT_R(crate::FieldReader); +impl AMOUNT_R { + pub(crate) fn new(bits: u8) -> Self { + AMOUNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AMOUNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:7 - Number of bytes transferred in the last RXD transaction"] + #[inline(always)] + pub fn amount(&self) -> AMOUNT_R { + AMOUNT_R::new((self.bits & 0xff) as u8) + } +} +#[doc = "Number of bytes transferred in the last RXD transaction\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 [amount](index.html) module"] +pub struct AMOUNT_SPEC; +impl crate::RegisterSpec for AMOUNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [amount::R](R) reader structure"] +impl crate::Readable for AMOUNT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets AMOUNT to value 0"] +impl crate::Resettable for AMOUNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twis0/rxd/maxcnt.rs b/src/twis0/rxd/maxcnt.rs new file mode 100644 index 0000000..5f31649 --- /dev/null +++ b/src/twis0/rxd/maxcnt.rs @@ -0,0 +1,102 @@ +#[doc = "Register `MAXCNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MAXCNT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `MAXCNT` reader - Maximum number of bytes in RXD buffer"] +pub struct MAXCNT_R(crate::FieldReader); +impl MAXCNT_R { + pub(crate) fn new(bits: u8) -> Self { + MAXCNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MAXCNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MAXCNT` writer - Maximum number of bytes in RXD buffer"] +pub struct MAXCNT_W<'a> { + w: &'a mut W, +} +impl<'a> MAXCNT_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - Maximum number of bytes in RXD buffer"] + #[inline(always)] + pub fn maxcnt(&self) -> MAXCNT_R { + MAXCNT_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - Maximum number of bytes in RXD buffer"] + #[inline(always)] + pub fn maxcnt(&mut self) -> MAXCNT_W { + MAXCNT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Maximum number of bytes in RXD buffer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [maxcnt](index.html) module"] +pub struct MAXCNT_SPEC; +impl crate::RegisterSpec for MAXCNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [maxcnt::R](R) reader structure"] +impl crate::Readable for MAXCNT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [maxcnt::W](W) writer structure"] +impl crate::Writable for MAXCNT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MAXCNT to value 0"] +impl crate::Resettable for MAXCNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twis0/rxd/ptr.rs b/src/twis0/rxd/ptr.rs new file mode 100644 index 0000000..baca635 --- /dev/null +++ b/src/twis0/rxd/ptr.rs @@ -0,0 +1,102 @@ +#[doc = "Register `PTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PTR` reader - RXD Data pointer"] +pub struct PTR_R(crate::FieldReader); +impl PTR_R { + pub(crate) fn new(bits: u32) -> Self { + PTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PTR` writer - RXD Data pointer"] +pub struct PTR_W<'a> { + w: &'a mut W, +} +impl<'a> PTR_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - RXD Data pointer"] + #[inline(always)] + pub fn ptr(&self) -> PTR_R { + PTR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - RXD Data pointer"] + #[inline(always)] + pub fn ptr(&mut self) -> PTR_W { + PTR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "RXD Data pointer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ptr](index.html) module"] +pub struct PTR_SPEC; +impl crate::RegisterSpec for PTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ptr::R](R) reader structure"] +impl crate::Readable for PTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ptr::W](W) writer structure"] +impl crate::Writable for PTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PTR to value 0"] +impl crate::Resettable for PTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twis0/shorts.rs b/src/twis0/shorts.rs new file mode 100644 index 0000000..e573362 --- /dev/null +++ b/src/twis0/shorts.rs @@ -0,0 +1,252 @@ +#[doc = "Register `SHORTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SHORTS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Shortcut between WRITE event and SUSPEND task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum WRITE_SUSPEND_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: WRITE_SUSPEND_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `WRITE_SUSPEND` reader - Shortcut between WRITE event and SUSPEND task"] +pub struct WRITE_SUSPEND_R(crate::FieldReader); +impl WRITE_SUSPEND_R { + pub(crate) fn new(bits: bool) -> Self { + WRITE_SUSPEND_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> WRITE_SUSPEND_A { + match self.bits { + false => WRITE_SUSPEND_A::DISABLED, + true => WRITE_SUSPEND_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == WRITE_SUSPEND_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == WRITE_SUSPEND_A::ENABLED + } +} +impl core::ops::Deref for WRITE_SUSPEND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `WRITE_SUSPEND` writer - Shortcut between WRITE event and SUSPEND task"] +pub struct WRITE_SUSPEND_W<'a> { + w: &'a mut W, +} +impl<'a> WRITE_SUSPEND_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: WRITE_SUSPEND_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(WRITE_SUSPEND_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(WRITE_SUSPEND_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 13)) | ((value as u32 & 0x01) << 13); + self.w + } +} +#[doc = "Shortcut between READ event and SUSPEND task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum READ_SUSPEND_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: READ_SUSPEND_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `READ_SUSPEND` reader - Shortcut between READ event and SUSPEND task"] +pub struct READ_SUSPEND_R(crate::FieldReader); +impl READ_SUSPEND_R { + pub(crate) fn new(bits: bool) -> Self { + READ_SUSPEND_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> READ_SUSPEND_A { + match self.bits { + false => READ_SUSPEND_A::DISABLED, + true => READ_SUSPEND_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == READ_SUSPEND_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == READ_SUSPEND_A::ENABLED + } +} +impl core::ops::Deref for READ_SUSPEND_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `READ_SUSPEND` writer - Shortcut between READ event and SUSPEND task"] +pub struct READ_SUSPEND_W<'a> { + w: &'a mut W, +} +impl<'a> READ_SUSPEND_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: READ_SUSPEND_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(READ_SUSPEND_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(READ_SUSPEND_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 14)) | ((value as u32 & 0x01) << 14); + self.w + } +} +impl R { + #[doc = "Bit 13 - Shortcut between WRITE event and SUSPEND task"] + #[inline(always)] + pub fn write_suspend(&self) -> WRITE_SUSPEND_R { + WRITE_SUSPEND_R::new(((self.bits >> 13) & 0x01) != 0) + } + #[doc = "Bit 14 - Shortcut between READ event and SUSPEND task"] + #[inline(always)] + pub fn read_suspend(&self) -> READ_SUSPEND_R { + READ_SUSPEND_R::new(((self.bits >> 14) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 13 - Shortcut between WRITE event and SUSPEND task"] + #[inline(always)] + pub fn write_suspend(&mut self) -> WRITE_SUSPEND_W { + WRITE_SUSPEND_W { w: self } + } + #[doc = "Bit 14 - Shortcut between READ event and SUSPEND task"] + #[inline(always)] + pub fn read_suspend(&mut self) -> READ_SUSPEND_W { + READ_SUSPEND_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Shortcut register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [shorts](index.html) module"] +pub struct SHORTS_SPEC; +impl crate::RegisterSpec for SHORTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [shorts::R](R) reader structure"] +impl crate::Readable for SHORTS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [shorts::W](W) writer structure"] +impl crate::Writable for SHORTS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SHORTS to value 0"] +impl crate::Resettable for SHORTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twis0/tasks_preparerx.rs b/src/twis0/tasks_preparerx.rs new file mode 100644 index 0000000..d226b37 --- /dev/null +++ b/src/twis0/tasks_preparerx.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_PREPARERX` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Prepare the TWI slave to respond to a write command\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_preparerx](index.html) module"] +pub struct TASKS_PREPARERX_SPEC; +impl crate::RegisterSpec for TASKS_PREPARERX_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_preparerx::W](W) writer structure"] +impl crate::Writable for TASKS_PREPARERX_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_PREPARERX to value 0"] +impl crate::Resettable for TASKS_PREPARERX_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twis0/tasks_preparetx.rs b/src/twis0/tasks_preparetx.rs new file mode 100644 index 0000000..c1a7b73 --- /dev/null +++ b/src/twis0/tasks_preparetx.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_PREPARETX` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Prepare the TWI slave to respond to a read command\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_preparetx](index.html) module"] +pub struct TASKS_PREPARETX_SPEC; +impl crate::RegisterSpec for TASKS_PREPARETX_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_preparetx::W](W) writer structure"] +impl crate::Writable for TASKS_PREPARETX_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_PREPARETX to value 0"] +impl crate::Resettable for TASKS_PREPARETX_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twis0/tasks_resume.rs b/src/twis0/tasks_resume.rs new file mode 100644 index 0000000..ef482eb --- /dev/null +++ b/src/twis0/tasks_resume.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_RESUME` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Resume TWI transaction\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_resume](index.html) module"] +pub struct TASKS_RESUME_SPEC; +impl crate::RegisterSpec for TASKS_RESUME_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_resume::W](W) writer structure"] +impl crate::Writable for TASKS_RESUME_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_RESUME to value 0"] +impl crate::Resettable for TASKS_RESUME_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twis0/tasks_stop.rs b/src/twis0/tasks_stop.rs new file mode 100644 index 0000000..db1d287 --- /dev/null +++ b/src/twis0/tasks_stop.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STOP` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Stop TWI transaction\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_stop](index.html) module"] +pub struct TASKS_STOP_SPEC; +impl crate::RegisterSpec for TASKS_STOP_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_stop::W](W) writer structure"] +impl crate::Writable for TASKS_STOP_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STOP to value 0"] +impl crate::Resettable for TASKS_STOP_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twis0/tasks_suspend.rs b/src/twis0/tasks_suspend.rs new file mode 100644 index 0000000..33397ec --- /dev/null +++ b/src/twis0/tasks_suspend.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_SUSPEND` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Suspend TWI transaction\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_suspend](index.html) module"] +pub struct TASKS_SUSPEND_SPEC; +impl crate::RegisterSpec for TASKS_SUSPEND_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_suspend::W](W) writer structure"] +impl crate::Writable for TASKS_SUSPEND_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_SUSPEND to value 0"] +impl crate::Resettable for TASKS_SUSPEND_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twis0/txd.rs b/src/twis0/txd.rs new file mode 100644 index 0000000..872ed94 --- /dev/null +++ b/src/twis0/txd.rs @@ -0,0 +1,12 @@ +#[doc = "PTR register accessor: an alias for `Reg`"] +pub type PTR = crate::Reg; +#[doc = "TXD Data pointer"] +pub mod ptr; +#[doc = "MAXCNT register accessor: an alias for `Reg`"] +pub type MAXCNT = crate::Reg; +#[doc = "Maximum number of bytes in TXD buffer"] +pub mod maxcnt; +#[doc = "AMOUNT register accessor: an alias for `Reg`"] +pub type AMOUNT = crate::Reg; +#[doc = "Number of bytes transferred in the last TXD transaction"] +pub mod amount; diff --git a/src/twis0/txd/amount.rs b/src/twis0/txd/amount.rs new file mode 100644 index 0000000..d9280e3 --- /dev/null +++ b/src/twis0/txd/amount.rs @@ -0,0 +1,52 @@ +#[doc = "Register `AMOUNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `AMOUNT` reader - Number of bytes transferred in the last TXD transaction"] +pub struct AMOUNT_R(crate::FieldReader); +impl AMOUNT_R { + pub(crate) fn new(bits: u8) -> Self { + AMOUNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AMOUNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:7 - Number of bytes transferred in the last TXD transaction"] + #[inline(always)] + pub fn amount(&self) -> AMOUNT_R { + AMOUNT_R::new((self.bits & 0xff) as u8) + } +} +#[doc = "Number of bytes transferred in the last TXD transaction\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 [amount](index.html) module"] +pub struct AMOUNT_SPEC; +impl crate::RegisterSpec for AMOUNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [amount::R](R) reader structure"] +impl crate::Readable for AMOUNT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets AMOUNT to value 0"] +impl crate::Resettable for AMOUNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twis0/txd/maxcnt.rs b/src/twis0/txd/maxcnt.rs new file mode 100644 index 0000000..3bde3fd --- /dev/null +++ b/src/twis0/txd/maxcnt.rs @@ -0,0 +1,102 @@ +#[doc = "Register `MAXCNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MAXCNT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `MAXCNT` reader - Maximum number of bytes in TXD buffer"] +pub struct MAXCNT_R(crate::FieldReader); +impl MAXCNT_R { + pub(crate) fn new(bits: u8) -> Self { + MAXCNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MAXCNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MAXCNT` writer - Maximum number of bytes in TXD buffer"] +pub struct MAXCNT_W<'a> { + w: &'a mut W, +} +impl<'a> MAXCNT_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - Maximum number of bytes in TXD buffer"] + #[inline(always)] + pub fn maxcnt(&self) -> MAXCNT_R { + MAXCNT_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - Maximum number of bytes in TXD buffer"] + #[inline(always)] + pub fn maxcnt(&mut self) -> MAXCNT_W { + MAXCNT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Maximum number of bytes in TXD buffer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [maxcnt](index.html) module"] +pub struct MAXCNT_SPEC; +impl crate::RegisterSpec for MAXCNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [maxcnt::R](R) reader structure"] +impl crate::Readable for MAXCNT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [maxcnt::W](W) writer structure"] +impl crate::Writable for MAXCNT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MAXCNT to value 0"] +impl crate::Resettable for MAXCNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/twis0/txd/ptr.rs b/src/twis0/txd/ptr.rs new file mode 100644 index 0000000..6ba5427 --- /dev/null +++ b/src/twis0/txd/ptr.rs @@ -0,0 +1,102 @@ +#[doc = "Register `PTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PTR` reader - TXD Data pointer"] +pub struct PTR_R(crate::FieldReader); +impl PTR_R { + pub(crate) fn new(bits: u32) -> Self { + PTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PTR` writer - TXD Data pointer"] +pub struct PTR_W<'a> { + w: &'a mut W, +} +impl<'a> PTR_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - TXD Data pointer"] + #[inline(always)] + pub fn ptr(&self) -> PTR_R { + PTR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - TXD Data pointer"] + #[inline(always)] + pub fn ptr(&mut self) -> PTR_W { + PTR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "TXD Data pointer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ptr](index.html) module"] +pub struct PTR_SPEC; +impl crate::RegisterSpec for PTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ptr::R](R) reader structure"] +impl crate::Readable for PTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ptr::W](W) writer structure"] +impl crate::Writable for PTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PTR to value 0"] +impl crate::Resettable for PTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uart0.rs b/src/uart0.rs new file mode 100644 index 0000000..47894f9 --- /dev/null +++ b/src/uart0.rs @@ -0,0 +1,160 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "0x00 - Start UART receiver"] + pub tasks_startrx: crate::Reg, + #[doc = "0x04 - Stop UART receiver"] + pub tasks_stoprx: crate::Reg, + #[doc = "0x08 - Start UART transmitter"] + pub tasks_starttx: crate::Reg, + #[doc = "0x0c - Stop UART transmitter"] + pub tasks_stoptx: crate::Reg, + _reserved4: [u8; 0x0c], + #[doc = "0x1c - Suspend UART"] + pub tasks_suspend: crate::Reg, + _reserved5: [u8; 0xe0], + #[doc = "0x100 - CTS is activated (set low). Clear To Send."] + pub events_cts: crate::Reg, + #[doc = "0x104 - CTS is deactivated (set high). Not Clear To Send."] + pub events_ncts: crate::Reg, + #[doc = "0x108 - Data received in RXD"] + pub events_rxdrdy: crate::Reg, + _reserved8: [u8; 0x10], + #[doc = "0x11c - Data sent from TXD"] + pub events_txdrdy: crate::Reg, + _reserved9: [u8; 0x04], + #[doc = "0x124 - Error detected"] + pub events_error: crate::Reg, + _reserved10: [u8; 0x1c], + #[doc = "0x144 - Receiver timeout"] + pub events_rxto: crate::Reg, + _reserved11: [u8; 0xb8], + #[doc = "0x200 - Shortcut register"] + pub shorts: crate::Reg, + _reserved12: [u8; 0x0100], + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved14: [u8; 0x0174], + #[doc = "0x480 - Error source"] + pub errorsrc: crate::Reg, + _reserved15: [u8; 0x7c], + #[doc = "0x500 - Enable UART"] + pub enable: crate::Reg, + _reserved16: [u8; 0x04], + #[doc = "0x508 - Pin select for RTS"] + pub pselrts: crate::Reg, + #[doc = "0x50c - Pin select for TXD"] + pub pseltxd: crate::Reg, + #[doc = "0x510 - Pin select for CTS"] + pub pselcts: crate::Reg, + #[doc = "0x514 - Pin select for RXD"] + pub pselrxd: crate::Reg, + #[doc = "0x518 - RXD register"] + pub rxd: crate::Reg, + #[doc = "0x51c - TXD register"] + pub txd: crate::Reg, + _reserved22: [u8; 0x04], + #[doc = "0x524 - Baud rate"] + pub baudrate: crate::Reg, + _reserved23: [u8; 0x44], + #[doc = "0x56c - Configuration of parity and hardware flow control"] + pub config: crate::Reg, +} +#[doc = "TASKS_STARTRX register accessor: an alias for `Reg`"] +pub type TASKS_STARTRX = crate::Reg; +#[doc = "Start UART receiver"] +pub mod tasks_startrx; +#[doc = "TASKS_STOPRX register accessor: an alias for `Reg`"] +pub type TASKS_STOPRX = crate::Reg; +#[doc = "Stop UART receiver"] +pub mod tasks_stoprx; +#[doc = "TASKS_STARTTX register accessor: an alias for `Reg`"] +pub type TASKS_STARTTX = crate::Reg; +#[doc = "Start UART transmitter"] +pub mod tasks_starttx; +#[doc = "TASKS_STOPTX register accessor: an alias for `Reg`"] +pub type TASKS_STOPTX = crate::Reg; +#[doc = "Stop UART transmitter"] +pub mod tasks_stoptx; +#[doc = "TASKS_SUSPEND register accessor: an alias for `Reg`"] +pub type TASKS_SUSPEND = crate::Reg; +#[doc = "Suspend UART"] +pub mod tasks_suspend; +#[doc = "EVENTS_CTS register accessor: an alias for `Reg`"] +pub type EVENTS_CTS = crate::Reg; +#[doc = "CTS is activated (set low). Clear To Send."] +pub mod events_cts; +#[doc = "EVENTS_NCTS register accessor: an alias for `Reg`"] +pub type EVENTS_NCTS = crate::Reg; +#[doc = "CTS is deactivated (set high). Not Clear To Send."] +pub mod events_ncts; +#[doc = "EVENTS_RXDRDY register accessor: an alias for `Reg`"] +pub type EVENTS_RXDRDY = crate::Reg; +#[doc = "Data received in RXD"] +pub mod events_rxdrdy; +#[doc = "EVENTS_TXDRDY register accessor: an alias for `Reg`"] +pub type EVENTS_TXDRDY = crate::Reg; +#[doc = "Data sent from TXD"] +pub mod events_txdrdy; +#[doc = "EVENTS_ERROR register accessor: an alias for `Reg`"] +pub type EVENTS_ERROR = crate::Reg; +#[doc = "Error detected"] +pub mod events_error; +#[doc = "EVENTS_RXTO register accessor: an alias for `Reg`"] +pub type EVENTS_RXTO = crate::Reg; +#[doc = "Receiver timeout"] +pub mod events_rxto; +#[doc = "SHORTS register accessor: an alias for `Reg`"] +pub type SHORTS = crate::Reg; +#[doc = "Shortcut register"] +pub mod shorts; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "ERRORSRC register accessor: an alias for `Reg`"] +pub type ERRORSRC = crate::Reg; +#[doc = "Error source"] +pub mod errorsrc; +#[doc = "ENABLE register accessor: an alias for `Reg`"] +pub type ENABLE = crate::Reg; +#[doc = "Enable UART"] +pub mod enable; +#[doc = "PSELRTS register accessor: an alias for `Reg`"] +pub type PSELRTS = crate::Reg; +#[doc = "Pin select for RTS"] +pub mod pselrts; +#[doc = "PSELTXD register accessor: an alias for `Reg`"] +pub type PSELTXD = crate::Reg; +#[doc = "Pin select for TXD"] +pub mod pseltxd; +#[doc = "PSELCTS register accessor: an alias for `Reg`"] +pub type PSELCTS = crate::Reg; +#[doc = "Pin select for CTS"] +pub mod pselcts; +#[doc = "PSELRXD register accessor: an alias for `Reg`"] +pub type PSELRXD = crate::Reg; +#[doc = "Pin select for RXD"] +pub mod pselrxd; +#[doc = "RXD register accessor: an alias for `Reg`"] +pub type RXD = crate::Reg; +#[doc = "RXD register"] +pub mod rxd; +#[doc = "TXD register accessor: an alias for `Reg`"] +pub type TXD = crate::Reg; +#[doc = "TXD register"] +pub mod txd; +#[doc = "BAUDRATE register accessor: an alias for `Reg`"] +pub type BAUDRATE = crate::Reg; +#[doc = "Baud rate"] +pub mod baudrate; +#[doc = "CONFIG register accessor: an alias for `Reg`"] +pub type CONFIG = crate::Reg; +#[doc = "Configuration of parity and hardware flow control"] +pub mod config; diff --git a/src/uart0/baudrate.rs b/src/uart0/baudrate.rs new file mode 100644 index 0000000..0fbd26b --- /dev/null +++ b/src/uart0/baudrate.rs @@ -0,0 +1,359 @@ +#[doc = "Register `BAUDRATE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `BAUDRATE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Baud rate\n\nValue on reset: 67108864"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u32)] +pub enum BAUDRATE_A { + #[doc = "323584: 1200 baud (actual rate: 1205)"] + BAUD1200 = 323584, + #[doc = "643072: 2400 baud (actual rate: 2396)"] + BAUD2400 = 643072, + #[doc = "1290240: 4800 baud (actual rate: 4808)"] + BAUD4800 = 1290240, + #[doc = "2576384: 9600 baud (actual rate: 9598)"] + BAUD9600 = 2576384, + #[doc = "3866624: 14400 baud (actual rate: 14414)"] + BAUD14400 = 3866624, + #[doc = "5152768: 19200 baud (actual rate: 19208)"] + BAUD19200 = 5152768, + #[doc = "7729152: 28800 baud (actual rate: 28829)"] + BAUD28800 = 7729152, + #[doc = "8388608: 31250 baud"] + BAUD31250 = 8388608, + #[doc = "10309632: 38400 baud (actual rate: 38462)"] + BAUD38400 = 10309632, + #[doc = "15007744: 56000 baud (actual rate: 55944)"] + BAUD56000 = 15007744, + #[doc = "15462400: 57600 baud (actual rate: 57762)"] + BAUD57600 = 15462400, + #[doc = "20615168: 76800 baud (actual rate: 76923)"] + BAUD76800 = 20615168, + #[doc = "30924800: 115200 baud (actual rate: 115942)"] + BAUD115200 = 30924800, + #[doc = "61845504: 230400 baud (actual rate: 231884)"] + BAUD230400 = 61845504, + #[doc = "67108864: 250000 baud"] + BAUD250000 = 67108864, + #[doc = "123695104: 460800 baud (actual rate: 470588)"] + BAUD460800 = 123695104, + #[doc = "247386112: 921600 baud (actual rate: 941176)"] + BAUD921600 = 247386112, + #[doc = "268435456: 1Mega baud"] + BAUD1M = 268435456, +} +impl From for u32 { + #[inline(always)] + fn from(variant: BAUDRATE_A) -> Self { + variant as _ + } +} +#[doc = "Field `BAUDRATE` reader - Baud rate"] +pub struct BAUDRATE_R(crate::FieldReader); +impl BAUDRATE_R { + pub(crate) fn new(bits: u32) -> Self { + BAUDRATE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 323584 => Some(BAUDRATE_A::BAUD1200), + 643072 => Some(BAUDRATE_A::BAUD2400), + 1290240 => Some(BAUDRATE_A::BAUD4800), + 2576384 => Some(BAUDRATE_A::BAUD9600), + 3866624 => Some(BAUDRATE_A::BAUD14400), + 5152768 => Some(BAUDRATE_A::BAUD19200), + 7729152 => Some(BAUDRATE_A::BAUD28800), + 8388608 => Some(BAUDRATE_A::BAUD31250), + 10309632 => Some(BAUDRATE_A::BAUD38400), + 15007744 => Some(BAUDRATE_A::BAUD56000), + 15462400 => Some(BAUDRATE_A::BAUD57600), + 20615168 => Some(BAUDRATE_A::BAUD76800), + 30924800 => Some(BAUDRATE_A::BAUD115200), + 61845504 => Some(BAUDRATE_A::BAUD230400), + 67108864 => Some(BAUDRATE_A::BAUD250000), + 123695104 => Some(BAUDRATE_A::BAUD460800), + 247386112 => Some(BAUDRATE_A::BAUD921600), + 268435456 => Some(BAUDRATE_A::BAUD1M), + _ => None, + } + } + #[doc = "Checks if the value of the field is `BAUD1200`"] + #[inline(always)] + pub fn is_baud1200(&self) -> bool { + **self == BAUDRATE_A::BAUD1200 + } + #[doc = "Checks if the value of the field is `BAUD2400`"] + #[inline(always)] + pub fn is_baud2400(&self) -> bool { + **self == BAUDRATE_A::BAUD2400 + } + #[doc = "Checks if the value of the field is `BAUD4800`"] + #[inline(always)] + pub fn is_baud4800(&self) -> bool { + **self == BAUDRATE_A::BAUD4800 + } + #[doc = "Checks if the value of the field is `BAUD9600`"] + #[inline(always)] + pub fn is_baud9600(&self) -> bool { + **self == BAUDRATE_A::BAUD9600 + } + #[doc = "Checks if the value of the field is `BAUD14400`"] + #[inline(always)] + pub fn is_baud14400(&self) -> bool { + **self == BAUDRATE_A::BAUD14400 + } + #[doc = "Checks if the value of the field is `BAUD19200`"] + #[inline(always)] + pub fn is_baud19200(&self) -> bool { + **self == BAUDRATE_A::BAUD19200 + } + #[doc = "Checks if the value of the field is `BAUD28800`"] + #[inline(always)] + pub fn is_baud28800(&self) -> bool { + **self == BAUDRATE_A::BAUD28800 + } + #[doc = "Checks if the value of the field is `BAUD31250`"] + #[inline(always)] + pub fn is_baud31250(&self) -> bool { + **self == BAUDRATE_A::BAUD31250 + } + #[doc = "Checks if the value of the field is `BAUD38400`"] + #[inline(always)] + pub fn is_baud38400(&self) -> bool { + **self == BAUDRATE_A::BAUD38400 + } + #[doc = "Checks if the value of the field is `BAUD56000`"] + #[inline(always)] + pub fn is_baud56000(&self) -> bool { + **self == BAUDRATE_A::BAUD56000 + } + #[doc = "Checks if the value of the field is `BAUD57600`"] + #[inline(always)] + pub fn is_baud57600(&self) -> bool { + **self == BAUDRATE_A::BAUD57600 + } + #[doc = "Checks if the value of the field is `BAUD76800`"] + #[inline(always)] + pub fn is_baud76800(&self) -> bool { + **self == BAUDRATE_A::BAUD76800 + } + #[doc = "Checks if the value of the field is `BAUD115200`"] + #[inline(always)] + pub fn is_baud115200(&self) -> bool { + **self == BAUDRATE_A::BAUD115200 + } + #[doc = "Checks if the value of the field is `BAUD230400`"] + #[inline(always)] + pub fn is_baud230400(&self) -> bool { + **self == BAUDRATE_A::BAUD230400 + } + #[doc = "Checks if the value of the field is `BAUD250000`"] + #[inline(always)] + pub fn is_baud250000(&self) -> bool { + **self == BAUDRATE_A::BAUD250000 + } + #[doc = "Checks if the value of the field is `BAUD460800`"] + #[inline(always)] + pub fn is_baud460800(&self) -> bool { + **self == BAUDRATE_A::BAUD460800 + } + #[doc = "Checks if the value of the field is `BAUD921600`"] + #[inline(always)] + pub fn is_baud921600(&self) -> bool { + **self == BAUDRATE_A::BAUD921600 + } + #[doc = "Checks if the value of the field is `BAUD1M`"] + #[inline(always)] + pub fn is_baud1m(&self) -> bool { + **self == BAUDRATE_A::BAUD1M + } +} +impl core::ops::Deref for BAUDRATE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BAUDRATE` writer - Baud rate"] +pub struct BAUDRATE_W<'a> { + w: &'a mut W, +} +impl<'a> BAUDRATE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: BAUDRATE_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "1200 baud (actual rate: 1205)"] + #[inline(always)] + pub fn baud1200(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD1200) + } + #[doc = "2400 baud (actual rate: 2396)"] + #[inline(always)] + pub fn baud2400(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD2400) + } + #[doc = "4800 baud (actual rate: 4808)"] + #[inline(always)] + pub fn baud4800(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD4800) + } + #[doc = "9600 baud (actual rate: 9598)"] + #[inline(always)] + pub fn baud9600(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD9600) + } + #[doc = "14400 baud (actual rate: 14414)"] + #[inline(always)] + pub fn baud14400(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD14400) + } + #[doc = "19200 baud (actual rate: 19208)"] + #[inline(always)] + pub fn baud19200(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD19200) + } + #[doc = "28800 baud (actual rate: 28829)"] + #[inline(always)] + pub fn baud28800(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD28800) + } + #[doc = "31250 baud"] + #[inline(always)] + pub fn baud31250(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD31250) + } + #[doc = "38400 baud (actual rate: 38462)"] + #[inline(always)] + pub fn baud38400(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD38400) + } + #[doc = "56000 baud (actual rate: 55944)"] + #[inline(always)] + pub fn baud56000(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD56000) + } + #[doc = "57600 baud (actual rate: 57762)"] + #[inline(always)] + pub fn baud57600(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD57600) + } + #[doc = "76800 baud (actual rate: 76923)"] + #[inline(always)] + pub fn baud76800(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD76800) + } + #[doc = "115200 baud (actual rate: 115942)"] + #[inline(always)] + pub fn baud115200(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD115200) + } + #[doc = "230400 baud (actual rate: 231884)"] + #[inline(always)] + pub fn baud230400(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD230400) + } + #[doc = "250000 baud"] + #[inline(always)] + pub fn baud250000(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD250000) + } + #[doc = "460800 baud (actual rate: 470588)"] + #[inline(always)] + pub fn baud460800(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD460800) + } + #[doc = "921600 baud (actual rate: 941176)"] + #[inline(always)] + pub fn baud921600(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD921600) + } + #[doc = "1Mega baud"] + #[inline(always)] + pub fn baud1m(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD1M) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Baud rate"] + #[inline(always)] + pub fn baudrate(&self) -> BAUDRATE_R { + BAUDRATE_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Baud rate"] + #[inline(always)] + pub fn baudrate(&mut self) -> BAUDRATE_W { + BAUDRATE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Baud rate\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [baudrate](index.html) module"] +pub struct BAUDRATE_SPEC; +impl crate::RegisterSpec for BAUDRATE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [baudrate::R](R) reader structure"] +impl crate::Readable for BAUDRATE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [baudrate::W](W) writer structure"] +impl crate::Writable for BAUDRATE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets BAUDRATE to value 0x0400_0000"] +impl crate::Resettable for BAUDRATE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0400_0000 + } +} diff --git a/src/uart0/config.rs b/src/uart0/config.rs new file mode 100644 index 0000000..8fccfaa --- /dev/null +++ b/src/uart0/config.rs @@ -0,0 +1,244 @@ +#[doc = "Register `CONFIG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CONFIG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Hardware flow control\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum HWFC_A { + #[doc = "0: Disabled"] + DISABLED = 0, + #[doc = "1: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: HWFC_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `HWFC` reader - Hardware flow control"] +pub struct HWFC_R(crate::FieldReader); +impl HWFC_R { + pub(crate) fn new(bits: bool) -> Self { + HWFC_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> HWFC_A { + match self.bits { + false => HWFC_A::DISABLED, + true => HWFC_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == HWFC_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == HWFC_A::ENABLED + } +} +impl core::ops::Deref for HWFC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HWFC` writer - Hardware flow control"] +pub struct HWFC_W<'a> { + w: &'a mut W, +} +impl<'a> HWFC_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: HWFC_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(HWFC_A::DISABLED) + } + #[doc = "Enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(HWFC_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Parity\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum PARITY_A { + #[doc = "0: Exclude parity bit"] + EXCLUDED = 0, + #[doc = "7: Include parity bit"] + INCLUDED = 7, +} +impl From for u8 { + #[inline(always)] + fn from(variant: PARITY_A) -> Self { + variant as _ + } +} +#[doc = "Field `PARITY` reader - Parity"] +pub struct PARITY_R(crate::FieldReader); +impl PARITY_R { + pub(crate) fn new(bits: u8) -> Self { + PARITY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(PARITY_A::EXCLUDED), + 7 => Some(PARITY_A::INCLUDED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == PARITY_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == PARITY_A::INCLUDED + } +} +impl core::ops::Deref for PARITY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PARITY` writer - Parity"] +pub struct PARITY_W<'a> { + w: &'a mut W, +} +impl<'a> PARITY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PARITY_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Exclude parity bit"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(PARITY_A::EXCLUDED) + } + #[doc = "Include parity bit"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(PARITY_A::INCLUDED) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x07 << 1)) | ((value as u32 & 0x07) << 1); + self.w + } +} +impl R { + #[doc = "Bit 0 - Hardware flow control"] + #[inline(always)] + pub fn hwfc(&self) -> HWFC_R { + HWFC_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bits 1:3 - Parity"] + #[inline(always)] + pub fn parity(&self) -> PARITY_R { + PARITY_R::new(((self.bits >> 1) & 0x07) as u8) + } +} +impl W { + #[doc = "Bit 0 - Hardware flow control"] + #[inline(always)] + pub fn hwfc(&mut self) -> HWFC_W { + HWFC_W { w: self } + } + #[doc = "Bits 1:3 - Parity"] + #[inline(always)] + pub fn parity(&mut self) -> PARITY_W { + PARITY_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Configuration of parity and hardware flow control\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [config](index.html) module"] +pub struct CONFIG_SPEC; +impl crate::RegisterSpec for CONFIG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [config::R](R) reader structure"] +impl crate::Readable for CONFIG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [config::W](W) writer structure"] +impl crate::Writable for CONFIG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CONFIG to value 0"] +impl crate::Resettable for CONFIG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uart0/enable.rs b/src/uart0/enable.rs new file mode 100644 index 0000000..b7b047c --- /dev/null +++ b/src/uart0/enable.rs @@ -0,0 +1,151 @@ +#[doc = "Register `ENABLE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ENABLE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable UART\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum ENABLE_A { + #[doc = "0: Disable UART"] + DISABLED = 0, + #[doc = "4: Enable UART"] + ENABLED = 4, +} +impl From for u8 { + #[inline(always)] + fn from(variant: ENABLE_A) -> Self { + variant as _ + } +} +#[doc = "Field `ENABLE` reader - Enable or disable UART"] +pub struct ENABLE_R(crate::FieldReader); +impl ENABLE_R { + pub(crate) fn new(bits: u8) -> Self { + ENABLE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(ENABLE_A::DISABLED), + 4 => Some(ENABLE_A::ENABLED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENABLE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENABLE_A::ENABLED + } +} +impl core::ops::Deref for ENABLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENABLE` writer - Enable or disable UART"] +pub struct ENABLE_W<'a> { + w: &'a mut W, +} +impl<'a> ENABLE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENABLE_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Disable UART"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENABLE_A::DISABLED) + } + #[doc = "Enable UART"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENABLE_A::ENABLED) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); + self.w + } +} +impl R { + #[doc = "Bits 0:3 - Enable or disable UART"] + #[inline(always)] + pub fn enable(&self) -> ENABLE_R { + ENABLE_R::new((self.bits & 0x0f) as u8) + } +} +impl W { + #[doc = "Bits 0:3 - Enable or disable UART"] + #[inline(always)] + pub fn enable(&mut self) -> ENABLE_W { + ENABLE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable UART\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [enable](index.html) module"] +pub struct ENABLE_SPEC; +impl crate::RegisterSpec for ENABLE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [enable::R](R) reader structure"] +impl crate::Readable for ENABLE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [enable::W](W) writer structure"] +impl crate::Writable for ENABLE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ENABLE to value 0"] +impl crate::Resettable for ENABLE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uart0/errorsrc.rs b/src/uart0/errorsrc.rs new file mode 100644 index 0000000..4a422f4 --- /dev/null +++ b/src/uart0/errorsrc.rs @@ -0,0 +1,438 @@ +#[doc = "Register `ERRORSRC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ERRORSRC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Overrun error\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OVERRUN_A { + #[doc = "0: Read: error not present"] + NOTPRESENT = 0, + #[doc = "1: Read: error present"] + PRESENT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OVERRUN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OVERRUN` reader - Overrun error"] +pub struct OVERRUN_R(crate::FieldReader); +impl OVERRUN_R { + pub(crate) fn new(bits: bool) -> Self { + OVERRUN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> OVERRUN_A { + match self.bits { + false => OVERRUN_A::NOTPRESENT, + true => OVERRUN_A::PRESENT, + } + } + #[doc = "Checks if the value of the field is `NOTPRESENT`"] + #[inline(always)] + pub fn is_not_present(&self) -> bool { + **self == OVERRUN_A::NOTPRESENT + } + #[doc = "Checks if the value of the field is `PRESENT`"] + #[inline(always)] + pub fn is_present(&self) -> bool { + **self == OVERRUN_A::PRESENT + } +} +impl core::ops::Deref for OVERRUN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OVERRUN` writer - Overrun error"] +pub struct OVERRUN_W<'a> { + w: &'a mut W, +} +impl<'a> OVERRUN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: OVERRUN_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Read: error not present"] + #[inline(always)] + pub fn not_present(self) -> &'a mut W { + self.variant(OVERRUN_A::NOTPRESENT) + } + #[doc = "Read: error present"] + #[inline(always)] + pub fn present(self) -> &'a mut W { + self.variant(OVERRUN_A::PRESENT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Parity error\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PARITY_A { + #[doc = "0: Read: error not present"] + NOTPRESENT = 0, + #[doc = "1: Read: error present"] + PRESENT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PARITY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PARITY` reader - Parity error"] +pub struct PARITY_R(crate::FieldReader); +impl PARITY_R { + pub(crate) fn new(bits: bool) -> Self { + PARITY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PARITY_A { + match self.bits { + false => PARITY_A::NOTPRESENT, + true => PARITY_A::PRESENT, + } + } + #[doc = "Checks if the value of the field is `NOTPRESENT`"] + #[inline(always)] + pub fn is_not_present(&self) -> bool { + **self == PARITY_A::NOTPRESENT + } + #[doc = "Checks if the value of the field is `PRESENT`"] + #[inline(always)] + pub fn is_present(&self) -> bool { + **self == PARITY_A::PRESENT + } +} +impl core::ops::Deref for PARITY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PARITY` writer - Parity error"] +pub struct PARITY_W<'a> { + w: &'a mut W, +} +impl<'a> PARITY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PARITY_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Read: error not present"] + #[inline(always)] + pub fn not_present(self) -> &'a mut W { + self.variant(PARITY_A::NOTPRESENT) + } + #[doc = "Read: error present"] + #[inline(always)] + pub fn present(self) -> &'a mut W { + self.variant(PARITY_A::PRESENT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Framing error occurred\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum FRAMING_A { + #[doc = "0: Read: error not present"] + NOTPRESENT = 0, + #[doc = "1: Read: error present"] + PRESENT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: FRAMING_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `FRAMING` reader - Framing error occurred"] +pub struct FRAMING_R(crate::FieldReader); +impl FRAMING_R { + pub(crate) fn new(bits: bool) -> Self { + FRAMING_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> FRAMING_A { + match self.bits { + false => FRAMING_A::NOTPRESENT, + true => FRAMING_A::PRESENT, + } + } + #[doc = "Checks if the value of the field is `NOTPRESENT`"] + #[inline(always)] + pub fn is_not_present(&self) -> bool { + **self == FRAMING_A::NOTPRESENT + } + #[doc = "Checks if the value of the field is `PRESENT`"] + #[inline(always)] + pub fn is_present(&self) -> bool { + **self == FRAMING_A::PRESENT + } +} +impl core::ops::Deref for FRAMING_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FRAMING` writer - Framing error occurred"] +pub struct FRAMING_W<'a> { + w: &'a mut W, +} +impl<'a> FRAMING_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: FRAMING_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Read: error not present"] + #[inline(always)] + pub fn not_present(self) -> &'a mut W { + self.variant(FRAMING_A::NOTPRESENT) + } + #[doc = "Read: error present"] + #[inline(always)] + pub fn present(self) -> &'a mut W { + self.variant(FRAMING_A::PRESENT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Break condition\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum BREAK_A { + #[doc = "0: Read: error not present"] + NOTPRESENT = 0, + #[doc = "1: Read: error present"] + PRESENT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: BREAK_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `BREAK` reader - Break condition"] +pub struct BREAK_R(crate::FieldReader); +impl BREAK_R { + pub(crate) fn new(bits: bool) -> Self { + BREAK_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> BREAK_A { + match self.bits { + false => BREAK_A::NOTPRESENT, + true => BREAK_A::PRESENT, + } + } + #[doc = "Checks if the value of the field is `NOTPRESENT`"] + #[inline(always)] + pub fn is_not_present(&self) -> bool { + **self == BREAK_A::NOTPRESENT + } + #[doc = "Checks if the value of the field is `PRESENT`"] + #[inline(always)] + pub fn is_present(&self) -> bool { + **self == BREAK_A::PRESENT + } +} +impl core::ops::Deref for BREAK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BREAK` writer - Break condition"] +pub struct BREAK_W<'a> { + w: &'a mut W, +} +impl<'a> BREAK_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: BREAK_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Read: error not present"] + #[inline(always)] + pub fn not_present(self) -> &'a mut W { + self.variant(BREAK_A::NOTPRESENT) + } + #[doc = "Read: error present"] + #[inline(always)] + pub fn present(self) -> &'a mut W { + self.variant(BREAK_A::PRESENT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +impl R { + #[doc = "Bit 0 - Overrun error"] + #[inline(always)] + pub fn overrun(&self) -> OVERRUN_R { + OVERRUN_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Parity error"] + #[inline(always)] + pub fn parity(&self) -> PARITY_R { + PARITY_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Framing error occurred"] + #[inline(always)] + pub fn framing(&self) -> FRAMING_R { + FRAMING_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Break condition"] + #[inline(always)] + pub fn break_(&self) -> BREAK_R { + BREAK_R::new(((self.bits >> 3) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Overrun error"] + #[inline(always)] + pub fn overrun(&mut self) -> OVERRUN_W { + OVERRUN_W { w: self } + } + #[doc = "Bit 1 - Parity error"] + #[inline(always)] + pub fn parity(&mut self) -> PARITY_W { + PARITY_W { w: self } + } + #[doc = "Bit 2 - Framing error occurred"] + #[inline(always)] + pub fn framing(&mut self) -> FRAMING_W { + FRAMING_W { w: self } + } + #[doc = "Bit 3 - Break condition"] + #[inline(always)] + pub fn break_(&mut self) -> BREAK_W { + BREAK_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Error source\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [errorsrc](index.html) module"] +pub struct ERRORSRC_SPEC; +impl crate::RegisterSpec for ERRORSRC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [errorsrc::R](R) reader structure"] +impl crate::Readable for ERRORSRC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [errorsrc::W](W) writer structure"] +impl crate::Writable for ERRORSRC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ERRORSRC to value 0"] +impl crate::Resettable for ERRORSRC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uart0/events_cts.rs b/src/uart0/events_cts.rs new file mode 100644 index 0000000..e63852d --- /dev/null +++ b/src/uart0/events_cts.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_CTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_CTS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "CTS is activated (set low). Clear To Send.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_cts](index.html) module"] +pub struct EVENTS_CTS_SPEC; +impl crate::RegisterSpec for EVENTS_CTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_cts::R](R) reader structure"] +impl crate::Readable for EVENTS_CTS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_cts::W](W) writer structure"] +impl crate::Writable for EVENTS_CTS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_CTS to value 0"] +impl crate::Resettable for EVENTS_CTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uart0/events_error.rs b/src/uart0/events_error.rs new file mode 100644 index 0000000..616708c --- /dev/null +++ b/src/uart0/events_error.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_ERROR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_ERROR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Error detected\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_error](index.html) module"] +pub struct EVENTS_ERROR_SPEC; +impl crate::RegisterSpec for EVENTS_ERROR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_error::R](R) reader structure"] +impl crate::Readable for EVENTS_ERROR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_error::W](W) writer structure"] +impl crate::Writable for EVENTS_ERROR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_ERROR to value 0"] +impl crate::Resettable for EVENTS_ERROR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uart0/events_ncts.rs b/src/uart0/events_ncts.rs new file mode 100644 index 0000000..de19bdd --- /dev/null +++ b/src/uart0/events_ncts.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_NCTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_NCTS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "CTS is deactivated (set high). Not Clear To Send.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_ncts](index.html) module"] +pub struct EVENTS_NCTS_SPEC; +impl crate::RegisterSpec for EVENTS_NCTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_ncts::R](R) reader structure"] +impl crate::Readable for EVENTS_NCTS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_ncts::W](W) writer structure"] +impl crate::Writable for EVENTS_NCTS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_NCTS to value 0"] +impl crate::Resettable for EVENTS_NCTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uart0/events_rxdrdy.rs b/src/uart0/events_rxdrdy.rs new file mode 100644 index 0000000..b37ec3d --- /dev/null +++ b/src/uart0/events_rxdrdy.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_RXDRDY` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_RXDRDY` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Data received in RXD\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_rxdrdy](index.html) module"] +pub struct EVENTS_RXDRDY_SPEC; +impl crate::RegisterSpec for EVENTS_RXDRDY_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_rxdrdy::R](R) reader structure"] +impl crate::Readable for EVENTS_RXDRDY_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_rxdrdy::W](W) writer structure"] +impl crate::Writable for EVENTS_RXDRDY_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_RXDRDY to value 0"] +impl crate::Resettable for EVENTS_RXDRDY_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uart0/events_rxto.rs b/src/uart0/events_rxto.rs new file mode 100644 index 0000000..c618ee4 --- /dev/null +++ b/src/uart0/events_rxto.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_RXTO` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_RXTO` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Receiver timeout\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_rxto](index.html) module"] +pub struct EVENTS_RXTO_SPEC; +impl crate::RegisterSpec for EVENTS_RXTO_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_rxto::R](R) reader structure"] +impl crate::Readable for EVENTS_RXTO_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_rxto::W](W) writer structure"] +impl crate::Writable for EVENTS_RXTO_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_RXTO to value 0"] +impl crate::Resettable for EVENTS_RXTO_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uart0/events_txdrdy.rs b/src/uart0/events_txdrdy.rs new file mode 100644 index 0000000..797352c --- /dev/null +++ b/src/uart0/events_txdrdy.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_TXDRDY` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_TXDRDY` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Data sent from TXD\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_txdrdy](index.html) module"] +pub struct EVENTS_TXDRDY_SPEC; +impl crate::RegisterSpec for EVENTS_TXDRDY_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_txdrdy::R](R) reader structure"] +impl crate::Readable for EVENTS_TXDRDY_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_txdrdy::W](W) writer structure"] +impl crate::Writable for EVENTS_TXDRDY_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_TXDRDY to value 0"] +impl crate::Resettable for EVENTS_TXDRDY_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uart0/intenclr.rs b/src/uart0/intenclr.rs new file mode 100644 index 0000000..86f8e1a --- /dev/null +++ b/src/uart0/intenclr.rs @@ -0,0 +1,666 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for CTS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CTS_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CTS_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CTS` reader - Write '1' to Disable interrupt for CTS event"] +pub struct CTS_R(crate::FieldReader); +impl CTS_R { + pub(crate) fn new(bits: bool) -> Self { + CTS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CTS_A { + match self.bits { + false => CTS_A::DISABLED, + true => CTS_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CTS_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CTS_A::ENABLED + } +} +impl core::ops::Deref for CTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for CTS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CTS_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CTS_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CTS` writer - Write '1' to Disable interrupt for CTS event"] +pub struct CTS_W<'a> { + w: &'a mut W, +} +impl<'a> CTS_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CTS_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CTS_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for NCTS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum NCTS_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: NCTS_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `NCTS` reader - Write '1' to Disable interrupt for NCTS event"] +pub struct NCTS_R(crate::FieldReader); +impl NCTS_R { + pub(crate) fn new(bits: bool) -> Self { + NCTS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> NCTS_A { + match self.bits { + false => NCTS_A::DISABLED, + true => NCTS_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == NCTS_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == NCTS_A::ENABLED + } +} +impl core::ops::Deref for NCTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for NCTS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum NCTS_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: NCTS_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `NCTS` writer - Write '1' to Disable interrupt for NCTS event"] +pub struct NCTS_W<'a> { + w: &'a mut W, +} +impl<'a> NCTS_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: NCTS_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(NCTS_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for RXDRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXDRDY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXDRDY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXDRDY` reader - Write '1' to Disable interrupt for RXDRDY event"] +pub struct RXDRDY_R(crate::FieldReader); +impl RXDRDY_R { + pub(crate) fn new(bits: bool) -> Self { + RXDRDY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXDRDY_A { + match self.bits { + false => RXDRDY_A::DISABLED, + true => RXDRDY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXDRDY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXDRDY_A::ENABLED + } +} +impl core::ops::Deref for RXDRDY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for RXDRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXDRDY_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXDRDY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXDRDY` writer - Write '1' to Disable interrupt for RXDRDY event"] +pub struct RXDRDY_W<'a> { + w: &'a mut W, +} +impl<'a> RXDRDY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXDRDY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(RXDRDY_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for TXDRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXDRDY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXDRDY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXDRDY` reader - Write '1' to Disable interrupt for TXDRDY event"] +pub struct TXDRDY_R(crate::FieldReader); +impl TXDRDY_R { + pub(crate) fn new(bits: bool) -> Self { + TXDRDY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXDRDY_A { + match self.bits { + false => TXDRDY_A::DISABLED, + true => TXDRDY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXDRDY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXDRDY_A::ENABLED + } +} +impl core::ops::Deref for TXDRDY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TXDRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXDRDY_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXDRDY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXDRDY` writer - Write '1' to Disable interrupt for TXDRDY event"] +pub struct TXDRDY_W<'a> { + w: &'a mut W, +} +impl<'a> TXDRDY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXDRDY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TXDRDY_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` reader - Write '1' to Disable interrupt for ERROR event"] +pub struct ERROR_R(crate::FieldReader); +impl ERROR_R { + pub(crate) fn new(bits: bool) -> Self { + ERROR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ERROR_A { + match self.bits { + false => ERROR_A::DISABLED, + true => ERROR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ERROR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ERROR_A::ENABLED + } +} +impl core::ops::Deref for ERROR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` writer - Write '1' to Disable interrupt for ERROR event"] +pub struct ERROR_W<'a> { + w: &'a mut W, +} +impl<'a> ERROR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ERROR_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(ERROR_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for RXTO event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXTO_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXTO_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXTO` reader - Write '1' to Disable interrupt for RXTO event"] +pub struct RXTO_R(crate::FieldReader); +impl RXTO_R { + pub(crate) fn new(bits: bool) -> Self { + RXTO_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXTO_A { + match self.bits { + false => RXTO_A::DISABLED, + true => RXTO_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXTO_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXTO_A::ENABLED + } +} +impl core::ops::Deref for RXTO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for RXTO event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXTO_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXTO_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXTO` writer - Write '1' to Disable interrupt for RXTO event"] +pub struct RXTO_W<'a> { + w: &'a mut W, +} +impl<'a> RXTO_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXTO_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(RXTO_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Disable interrupt for CTS event"] + #[inline(always)] + pub fn cts(&self) -> CTS_R { + CTS_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for NCTS event"] + #[inline(always)] + pub fn ncts(&self) -> NCTS_R { + NCTS_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for RXDRDY event"] + #[inline(always)] + pub fn rxdrdy(&self) -> RXDRDY_R { + RXDRDY_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 7 - Write '1' to Disable interrupt for TXDRDY event"] + #[inline(always)] + pub fn txdrdy(&self) -> TXDRDY_R { + TXDRDY_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 9 - Write '1' to Disable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&self) -> ERROR_R { + ERROR_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 17 - Write '1' to Disable interrupt for RXTO event"] + #[inline(always)] + pub fn rxto(&self) -> RXTO_R { + RXTO_R::new(((self.bits >> 17) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Disable interrupt for CTS event"] + #[inline(always)] + pub fn cts(&mut self) -> CTS_W { + CTS_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for NCTS event"] + #[inline(always)] + pub fn ncts(&mut self) -> NCTS_W { + NCTS_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for RXDRDY event"] + #[inline(always)] + pub fn rxdrdy(&mut self) -> RXDRDY_W { + RXDRDY_W { w: self } + } + #[doc = "Bit 7 - Write '1' to Disable interrupt for TXDRDY event"] + #[inline(always)] + pub fn txdrdy(&mut self) -> TXDRDY_W { + TXDRDY_W { w: self } + } + #[doc = "Bit 9 - Write '1' to Disable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&mut self) -> ERROR_W { + ERROR_W { w: self } + } + #[doc = "Bit 17 - Write '1' to Disable interrupt for RXTO event"] + #[inline(always)] + pub fn rxto(&mut self) -> RXTO_W { + RXTO_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uart0/intenset.rs b/src/uart0/intenset.rs new file mode 100644 index 0000000..e3c7aee --- /dev/null +++ b/src/uart0/intenset.rs @@ -0,0 +1,666 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for CTS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CTS_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CTS_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CTS` reader - Write '1' to Enable interrupt for CTS event"] +pub struct CTS_R(crate::FieldReader); +impl CTS_R { + pub(crate) fn new(bits: bool) -> Self { + CTS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CTS_A { + match self.bits { + false => CTS_A::DISABLED, + true => CTS_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CTS_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CTS_A::ENABLED + } +} +impl core::ops::Deref for CTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for CTS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CTS_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CTS_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CTS` writer - Write '1' to Enable interrupt for CTS event"] +pub struct CTS_W<'a> { + w: &'a mut W, +} +impl<'a> CTS_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CTS_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CTS_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for NCTS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum NCTS_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: NCTS_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `NCTS` reader - Write '1' to Enable interrupt for NCTS event"] +pub struct NCTS_R(crate::FieldReader); +impl NCTS_R { + pub(crate) fn new(bits: bool) -> Self { + NCTS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> NCTS_A { + match self.bits { + false => NCTS_A::DISABLED, + true => NCTS_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == NCTS_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == NCTS_A::ENABLED + } +} +impl core::ops::Deref for NCTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for NCTS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum NCTS_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: NCTS_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `NCTS` writer - Write '1' to Enable interrupt for NCTS event"] +pub struct NCTS_W<'a> { + w: &'a mut W, +} +impl<'a> NCTS_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: NCTS_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(NCTS_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for RXDRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXDRDY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXDRDY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXDRDY` reader - Write '1' to Enable interrupt for RXDRDY event"] +pub struct RXDRDY_R(crate::FieldReader); +impl RXDRDY_R { + pub(crate) fn new(bits: bool) -> Self { + RXDRDY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXDRDY_A { + match self.bits { + false => RXDRDY_A::DISABLED, + true => RXDRDY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXDRDY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXDRDY_A::ENABLED + } +} +impl core::ops::Deref for RXDRDY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for RXDRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXDRDY_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXDRDY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXDRDY` writer - Write '1' to Enable interrupt for RXDRDY event"] +pub struct RXDRDY_W<'a> { + w: &'a mut W, +} +impl<'a> RXDRDY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXDRDY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(RXDRDY_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for TXDRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXDRDY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXDRDY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXDRDY` reader - Write '1' to Enable interrupt for TXDRDY event"] +pub struct TXDRDY_R(crate::FieldReader); +impl TXDRDY_R { + pub(crate) fn new(bits: bool) -> Self { + TXDRDY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXDRDY_A { + match self.bits { + false => TXDRDY_A::DISABLED, + true => TXDRDY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXDRDY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXDRDY_A::ENABLED + } +} +impl core::ops::Deref for TXDRDY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TXDRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXDRDY_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXDRDY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXDRDY` writer - Write '1' to Enable interrupt for TXDRDY event"] +pub struct TXDRDY_W<'a> { + w: &'a mut W, +} +impl<'a> TXDRDY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXDRDY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TXDRDY_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` reader - Write '1' to Enable interrupt for ERROR event"] +pub struct ERROR_R(crate::FieldReader); +impl ERROR_R { + pub(crate) fn new(bits: bool) -> Self { + ERROR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ERROR_A { + match self.bits { + false => ERROR_A::DISABLED, + true => ERROR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ERROR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ERROR_A::ENABLED + } +} +impl core::ops::Deref for ERROR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` writer - Write '1' to Enable interrupt for ERROR event"] +pub struct ERROR_W<'a> { + w: &'a mut W, +} +impl<'a> ERROR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ERROR_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(ERROR_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for RXTO event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXTO_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXTO_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXTO` reader - Write '1' to Enable interrupt for RXTO event"] +pub struct RXTO_R(crate::FieldReader); +impl RXTO_R { + pub(crate) fn new(bits: bool) -> Self { + RXTO_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXTO_A { + match self.bits { + false => RXTO_A::DISABLED, + true => RXTO_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXTO_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXTO_A::ENABLED + } +} +impl core::ops::Deref for RXTO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for RXTO event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXTO_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXTO_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXTO` writer - Write '1' to Enable interrupt for RXTO event"] +pub struct RXTO_W<'a> { + w: &'a mut W, +} +impl<'a> RXTO_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXTO_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(RXTO_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Enable interrupt for CTS event"] + #[inline(always)] + pub fn cts(&self) -> CTS_R { + CTS_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for NCTS event"] + #[inline(always)] + pub fn ncts(&self) -> NCTS_R { + NCTS_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for RXDRDY event"] + #[inline(always)] + pub fn rxdrdy(&self) -> RXDRDY_R { + RXDRDY_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 7 - Write '1' to Enable interrupt for TXDRDY event"] + #[inline(always)] + pub fn txdrdy(&self) -> TXDRDY_R { + TXDRDY_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 9 - Write '1' to Enable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&self) -> ERROR_R { + ERROR_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 17 - Write '1' to Enable interrupt for RXTO event"] + #[inline(always)] + pub fn rxto(&self) -> RXTO_R { + RXTO_R::new(((self.bits >> 17) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Enable interrupt for CTS event"] + #[inline(always)] + pub fn cts(&mut self) -> CTS_W { + CTS_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for NCTS event"] + #[inline(always)] + pub fn ncts(&mut self) -> NCTS_W { + NCTS_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for RXDRDY event"] + #[inline(always)] + pub fn rxdrdy(&mut self) -> RXDRDY_W { + RXDRDY_W { w: self } + } + #[doc = "Bit 7 - Write '1' to Enable interrupt for TXDRDY event"] + #[inline(always)] + pub fn txdrdy(&mut self) -> TXDRDY_W { + TXDRDY_W { w: self } + } + #[doc = "Bit 9 - Write '1' to Enable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&mut self) -> ERROR_W { + ERROR_W { w: self } + } + #[doc = "Bit 17 - Write '1' to Enable interrupt for RXTO event"] + #[inline(always)] + pub fn rxto(&mut self) -> RXTO_W { + RXTO_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uart0/pselcts.rs b/src/uart0/pselcts.rs new file mode 100644 index 0000000..29fc058 --- /dev/null +++ b/src/uart0/pselcts.rs @@ -0,0 +1,138 @@ +#[doc = "Register `PSELCTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PSELCTS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Pin number configuration for UART CTS signal\n\nValue on reset: 4294967295"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u32)] +pub enum PSELCTS_A { + #[doc = "4294967295: Disconnect"] + DISCONNECTED = 4294967295, +} +impl From for u32 { + #[inline(always)] + fn from(variant: PSELCTS_A) -> Self { + variant as _ + } +} +#[doc = "Field `PSELCTS` reader - Pin number configuration for UART CTS signal"] +pub struct PSELCTS_R(crate::FieldReader); +impl PSELCTS_R { + pub(crate) fn new(bits: u32) -> Self { + PSELCTS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 4294967295 => Some(PSELCTS_A::DISCONNECTED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == PSELCTS_A::DISCONNECTED + } +} +impl core::ops::Deref for PSELCTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PSELCTS` writer - Pin number configuration for UART CTS signal"] +pub struct PSELCTS_W<'a> { + w: &'a mut W, +} +impl<'a> PSELCTS_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PSELCTS_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(PSELCTS_A::DISCONNECTED) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Pin number configuration for UART CTS signal"] + #[inline(always)] + pub fn pselcts(&self) -> PSELCTS_R { + PSELCTS_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Pin number configuration for UART CTS signal"] + #[inline(always)] + pub fn pselcts(&mut self) -> PSELCTS_W { + PSELCTS_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for CTS\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pselcts](index.html) module"] +pub struct PSELCTS_SPEC; +impl crate::RegisterSpec for PSELCTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pselcts::R](R) reader structure"] +impl crate::Readable for PSELCTS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pselcts::W](W) writer structure"] +impl crate::Writable for PSELCTS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PSELCTS to value 0xffff_ffff"] +impl crate::Resettable for PSELCTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/uart0/pselrts.rs b/src/uart0/pselrts.rs new file mode 100644 index 0000000..d080a02 --- /dev/null +++ b/src/uart0/pselrts.rs @@ -0,0 +1,138 @@ +#[doc = "Register `PSELRTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PSELRTS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Pin number configuration for UART RTS signal\n\nValue on reset: 4294967295"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u32)] +pub enum PSELRTS_A { + #[doc = "4294967295: Disconnect"] + DISCONNECTED = 4294967295, +} +impl From for u32 { + #[inline(always)] + fn from(variant: PSELRTS_A) -> Self { + variant as _ + } +} +#[doc = "Field `PSELRTS` reader - Pin number configuration for UART RTS signal"] +pub struct PSELRTS_R(crate::FieldReader); +impl PSELRTS_R { + pub(crate) fn new(bits: u32) -> Self { + PSELRTS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 4294967295 => Some(PSELRTS_A::DISCONNECTED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == PSELRTS_A::DISCONNECTED + } +} +impl core::ops::Deref for PSELRTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PSELRTS` writer - Pin number configuration for UART RTS signal"] +pub struct PSELRTS_W<'a> { + w: &'a mut W, +} +impl<'a> PSELRTS_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PSELRTS_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(PSELRTS_A::DISCONNECTED) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Pin number configuration for UART RTS signal"] + #[inline(always)] + pub fn pselrts(&self) -> PSELRTS_R { + PSELRTS_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Pin number configuration for UART RTS signal"] + #[inline(always)] + pub fn pselrts(&mut self) -> PSELRTS_W { + PSELRTS_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for RTS\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pselrts](index.html) module"] +pub struct PSELRTS_SPEC; +impl crate::RegisterSpec for PSELRTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pselrts::R](R) reader structure"] +impl crate::Readable for PSELRTS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pselrts::W](W) writer structure"] +impl crate::Writable for PSELRTS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PSELRTS to value 0xffff_ffff"] +impl crate::Resettable for PSELRTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/uart0/pselrxd.rs b/src/uart0/pselrxd.rs new file mode 100644 index 0000000..55b4da9 --- /dev/null +++ b/src/uart0/pselrxd.rs @@ -0,0 +1,138 @@ +#[doc = "Register `PSELRXD` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PSELRXD` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Pin number configuration for UART RXD signal\n\nValue on reset: 4294967295"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u32)] +pub enum PSELRXD_A { + #[doc = "4294967295: Disconnect"] + DISCONNECTED = 4294967295, +} +impl From for u32 { + #[inline(always)] + fn from(variant: PSELRXD_A) -> Self { + variant as _ + } +} +#[doc = "Field `PSELRXD` reader - Pin number configuration for UART RXD signal"] +pub struct PSELRXD_R(crate::FieldReader); +impl PSELRXD_R { + pub(crate) fn new(bits: u32) -> Self { + PSELRXD_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 4294967295 => Some(PSELRXD_A::DISCONNECTED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == PSELRXD_A::DISCONNECTED + } +} +impl core::ops::Deref for PSELRXD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PSELRXD` writer - Pin number configuration for UART RXD signal"] +pub struct PSELRXD_W<'a> { + w: &'a mut W, +} +impl<'a> PSELRXD_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PSELRXD_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(PSELRXD_A::DISCONNECTED) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Pin number configuration for UART RXD signal"] + #[inline(always)] + pub fn pselrxd(&self) -> PSELRXD_R { + PSELRXD_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Pin number configuration for UART RXD signal"] + #[inline(always)] + pub fn pselrxd(&mut self) -> PSELRXD_W { + PSELRXD_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for RXD\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pselrxd](index.html) module"] +pub struct PSELRXD_SPEC; +impl crate::RegisterSpec for PSELRXD_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pselrxd::R](R) reader structure"] +impl crate::Readable for PSELRXD_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pselrxd::W](W) writer structure"] +impl crate::Writable for PSELRXD_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PSELRXD to value 0xffff_ffff"] +impl crate::Resettable for PSELRXD_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/uart0/pseltxd.rs b/src/uart0/pseltxd.rs new file mode 100644 index 0000000..b597fac --- /dev/null +++ b/src/uart0/pseltxd.rs @@ -0,0 +1,138 @@ +#[doc = "Register `PSELTXD` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PSELTXD` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Pin number configuration for UART TXD signal\n\nValue on reset: 4294967295"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u32)] +pub enum PSELTXD_A { + #[doc = "4294967295: Disconnect"] + DISCONNECTED = 4294967295, +} +impl From for u32 { + #[inline(always)] + fn from(variant: PSELTXD_A) -> Self { + variant as _ + } +} +#[doc = "Field `PSELTXD` reader - Pin number configuration for UART TXD signal"] +pub struct PSELTXD_R(crate::FieldReader); +impl PSELTXD_R { + pub(crate) fn new(bits: u32) -> Self { + PSELTXD_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 4294967295 => Some(PSELTXD_A::DISCONNECTED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == PSELTXD_A::DISCONNECTED + } +} +impl core::ops::Deref for PSELTXD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PSELTXD` writer - Pin number configuration for UART TXD signal"] +pub struct PSELTXD_W<'a> { + w: &'a mut W, +} +impl<'a> PSELTXD_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PSELTXD_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(PSELTXD_A::DISCONNECTED) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Pin number configuration for UART TXD signal"] + #[inline(always)] + pub fn pseltxd(&self) -> PSELTXD_R { + PSELTXD_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Pin number configuration for UART TXD signal"] + #[inline(always)] + pub fn pseltxd(&mut self) -> PSELTXD_W { + PSELTXD_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for TXD\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pseltxd](index.html) module"] +pub struct PSELTXD_SPEC; +impl crate::RegisterSpec for PSELTXD_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pseltxd::R](R) reader structure"] +impl crate::Readable for PSELTXD_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pseltxd::W](W) writer structure"] +impl crate::Writable for PSELTXD_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PSELTXD to value 0xffff_ffff"] +impl crate::Resettable for PSELTXD_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/uart0/rxd.rs b/src/uart0/rxd.rs new file mode 100644 index 0000000..2deb13d --- /dev/null +++ b/src/uart0/rxd.rs @@ -0,0 +1,52 @@ +#[doc = "Register `RXD` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `RXD` reader - RX data received in previous transfers, double buffered"] +pub struct RXD_R(crate::FieldReader); +impl RXD_R { + pub(crate) fn new(bits: u8) -> Self { + RXD_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for RXD_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:7 - RX data received in previous transfers, double buffered"] + #[inline(always)] + pub fn rxd(&self) -> RXD_R { + RXD_R::new((self.bits & 0xff) as u8) + } +} +#[doc = "RXD register\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 [rxd](index.html) module"] +pub struct RXD_SPEC; +impl crate::RegisterSpec for RXD_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rxd::R](R) reader structure"] +impl crate::Readable for RXD_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets RXD to value 0"] +impl crate::Resettable for RXD_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uart0/shorts.rs b/src/uart0/shorts.rs new file mode 100644 index 0000000..9abced3 --- /dev/null +++ b/src/uart0/shorts.rs @@ -0,0 +1,252 @@ +#[doc = "Register `SHORTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SHORTS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Shortcut between CTS event and STARTRX task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CTS_STARTRX_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CTS_STARTRX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CTS_STARTRX` reader - Shortcut between CTS event and STARTRX task"] +pub struct CTS_STARTRX_R(crate::FieldReader); +impl CTS_STARTRX_R { + pub(crate) fn new(bits: bool) -> Self { + CTS_STARTRX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CTS_STARTRX_A { + match self.bits { + false => CTS_STARTRX_A::DISABLED, + true => CTS_STARTRX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CTS_STARTRX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CTS_STARTRX_A::ENABLED + } +} +impl core::ops::Deref for CTS_STARTRX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTS_STARTRX` writer - Shortcut between CTS event and STARTRX task"] +pub struct CTS_STARTRX_W<'a> { + w: &'a mut W, +} +impl<'a> CTS_STARTRX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CTS_STARTRX_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CTS_STARTRX_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CTS_STARTRX_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Shortcut between NCTS event and STOPRX task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum NCTS_STOPRX_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: NCTS_STOPRX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `NCTS_STOPRX` reader - Shortcut between NCTS event and STOPRX task"] +pub struct NCTS_STOPRX_R(crate::FieldReader); +impl NCTS_STOPRX_R { + pub(crate) fn new(bits: bool) -> Self { + NCTS_STOPRX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> NCTS_STOPRX_A { + match self.bits { + false => NCTS_STOPRX_A::DISABLED, + true => NCTS_STOPRX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == NCTS_STOPRX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == NCTS_STOPRX_A::ENABLED + } +} +impl core::ops::Deref for NCTS_STOPRX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NCTS_STOPRX` writer - Shortcut between NCTS event and STOPRX task"] +pub struct NCTS_STOPRX_W<'a> { + w: &'a mut W, +} +impl<'a> NCTS_STOPRX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: NCTS_STOPRX_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(NCTS_STOPRX_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(NCTS_STOPRX_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +impl R { + #[doc = "Bit 3 - Shortcut between CTS event and STARTRX task"] + #[inline(always)] + pub fn cts_startrx(&self) -> CTS_STARTRX_R { + CTS_STARTRX_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Shortcut between NCTS event and STOPRX task"] + #[inline(always)] + pub fn ncts_stoprx(&self) -> NCTS_STOPRX_R { + NCTS_STOPRX_R::new(((self.bits >> 4) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 3 - Shortcut between CTS event and STARTRX task"] + #[inline(always)] + pub fn cts_startrx(&mut self) -> CTS_STARTRX_W { + CTS_STARTRX_W { w: self } + } + #[doc = "Bit 4 - Shortcut between NCTS event and STOPRX task"] + #[inline(always)] + pub fn ncts_stoprx(&mut self) -> NCTS_STOPRX_W { + NCTS_STOPRX_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Shortcut register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [shorts](index.html) module"] +pub struct SHORTS_SPEC; +impl crate::RegisterSpec for SHORTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [shorts::R](R) reader structure"] +impl crate::Readable for SHORTS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [shorts::W](W) writer structure"] +impl crate::Writable for SHORTS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SHORTS to value 0"] +impl crate::Resettable for SHORTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uart0/tasks_startrx.rs b/src/uart0/tasks_startrx.rs new file mode 100644 index 0000000..39502a8 --- /dev/null +++ b/src/uart0/tasks_startrx.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STARTRX` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start UART receiver\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_startrx](index.html) module"] +pub struct TASKS_STARTRX_SPEC; +impl crate::RegisterSpec for TASKS_STARTRX_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_startrx::W](W) writer structure"] +impl crate::Writable for TASKS_STARTRX_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STARTRX to value 0"] +impl crate::Resettable for TASKS_STARTRX_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uart0/tasks_starttx.rs b/src/uart0/tasks_starttx.rs new file mode 100644 index 0000000..6e0e5b3 --- /dev/null +++ b/src/uart0/tasks_starttx.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STARTTX` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start UART transmitter\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_starttx](index.html) module"] +pub struct TASKS_STARTTX_SPEC; +impl crate::RegisterSpec for TASKS_STARTTX_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_starttx::W](W) writer structure"] +impl crate::Writable for TASKS_STARTTX_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STARTTX to value 0"] +impl crate::Resettable for TASKS_STARTTX_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uart0/tasks_stoprx.rs b/src/uart0/tasks_stoprx.rs new file mode 100644 index 0000000..84910c8 --- /dev/null +++ b/src/uart0/tasks_stoprx.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STOPRX` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Stop UART receiver\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_stoprx](index.html) module"] +pub struct TASKS_STOPRX_SPEC; +impl crate::RegisterSpec for TASKS_STOPRX_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_stoprx::W](W) writer structure"] +impl crate::Writable for TASKS_STOPRX_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STOPRX to value 0"] +impl crate::Resettable for TASKS_STOPRX_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uart0/tasks_stoptx.rs b/src/uart0/tasks_stoptx.rs new file mode 100644 index 0000000..8075a66 --- /dev/null +++ b/src/uart0/tasks_stoptx.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STOPTX` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Stop UART transmitter\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_stoptx](index.html) module"] +pub struct TASKS_STOPTX_SPEC; +impl crate::RegisterSpec for TASKS_STOPTX_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_stoptx::W](W) writer structure"] +impl crate::Writable for TASKS_STOPTX_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STOPTX to value 0"] +impl crate::Resettable for TASKS_STOPTX_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uart0/tasks_suspend.rs b/src/uart0/tasks_suspend.rs new file mode 100644 index 0000000..9d38736 --- /dev/null +++ b/src/uart0/tasks_suspend.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_SUSPEND` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Suspend UART\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_suspend](index.html) module"] +pub struct TASKS_SUSPEND_SPEC; +impl crate::RegisterSpec for TASKS_SUSPEND_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_suspend::W](W) writer structure"] +impl crate::Writable for TASKS_SUSPEND_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_SUSPEND to value 0"] +impl crate::Resettable for TASKS_SUSPEND_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uart0/txd.rs b/src/uart0/txd.rs new file mode 100644 index 0000000..872a3a4 --- /dev/null +++ b/src/uart0/txd.rs @@ -0,0 +1,62 @@ +#[doc = "Register `TXD` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `TXD` writer - TX data to be transferred"] +pub struct TXD_W<'a> { + w: &'a mut W, +} +impl<'a> TXD_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl W { + #[doc = "Bits 0:7 - TX data to be transferred"] + #[inline(always)] + pub fn txd(&mut self) -> TXD_W { + TXD_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "TXD register\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [txd](index.html) module"] +pub struct TXD_SPEC; +impl crate::RegisterSpec for TXD_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [txd::W](W) writer structure"] +impl crate::Writable for TXD_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TXD to value 0"] +impl crate::Resettable for TXD_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0.rs b/src/uarte0.rs new file mode 100644 index 0000000..48f6287 --- /dev/null +++ b/src/uarte0.rs @@ -0,0 +1,211 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "0x00 - Start UART receiver"] + pub tasks_startrx: crate::Reg, + #[doc = "0x04 - Stop UART receiver"] + pub tasks_stoprx: crate::Reg, + #[doc = "0x08 - Start UART transmitter"] + pub tasks_starttx: crate::Reg, + #[doc = "0x0c - Stop UART transmitter"] + pub tasks_stoptx: crate::Reg, + _reserved4: [u8; 0x1c], + #[doc = "0x2c - Flush RX FIFO into RX buffer"] + pub tasks_flushrx: crate::Reg, + _reserved5: [u8; 0xd0], + #[doc = "0x100 - CTS is activated (set low). Clear To Send."] + pub events_cts: crate::Reg, + #[doc = "0x104 - CTS is deactivated (set high). Not Clear To Send."] + pub events_ncts: crate::Reg, + #[doc = "0x108 - Data received in RXD (but potentially not yet transferred to Data RAM)"] + pub events_rxdrdy: crate::Reg, + _reserved8: [u8; 0x04], + #[doc = "0x110 - Receive buffer is filled up"] + pub events_endrx: crate::Reg, + _reserved9: [u8; 0x08], + #[doc = "0x11c - Data sent from TXD"] + pub events_txdrdy: crate::Reg, + #[doc = "0x120 - Last TX byte transmitted"] + pub events_endtx: crate::Reg, + #[doc = "0x124 - Error detected"] + pub events_error: crate::Reg, + _reserved12: [u8; 0x1c], + #[doc = "0x144 - Receiver timeout"] + pub events_rxto: crate::Reg, + _reserved13: [u8; 0x04], + #[doc = "0x14c - UART receiver has started"] + pub events_rxstarted: crate::Reg, + #[doc = "0x150 - UART transmitter has started"] + pub events_txstarted: crate::Reg, + _reserved15: [u8; 0x04], + #[doc = "0x158 - Transmitter stopped"] + pub events_txstopped: crate::Reg, + _reserved16: [u8; 0xa4], + #[doc = "0x200 - Shortcut register"] + pub shorts: crate::Reg, + _reserved17: [u8; 0xfc], + #[doc = "0x300 - Enable or disable interrupt"] + pub inten: crate::Reg, + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved20: [u8; 0x0174], + #[doc = "0x480 - Error source"] + pub errorsrc: crate::Reg, + _reserved21: [u8; 0x7c], + #[doc = "0x500 - Enable UART"] + pub enable: crate::Reg, + _reserved22: [u8; 0x04], + #[doc = "0x508..0x518 - Unspecified"] + pub psel: PSEL, + _reserved23: [u8; 0x0c], + #[doc = "0x524 - Baud rate. Accuracy depends on the HFCLK source selected."] + pub baudrate: crate::Reg, + _reserved24: [u8; 0x0c], + #[doc = "0x534..0x540 - RXD EasyDMA channel"] + pub rxd: RXD, + _reserved25: [u8; 0x04], + #[doc = "0x544..0x550 - TXD EasyDMA channel"] + pub txd: TXD, + _reserved26: [u8; 0x1c], + #[doc = "0x56c - Configuration of parity and hardware flow control"] + pub config: crate::Reg, +} +#[doc = r"Register block"] +#[repr(C)] +pub struct PSEL { + #[doc = "0x00 - Pin select for RTS signal"] + pub rts: crate::Reg, + #[doc = "0x04 - Pin select for TXD signal"] + pub txd: crate::Reg, + #[doc = "0x08 - Pin select for CTS signal"] + pub cts: crate::Reg, + #[doc = "0x0c - Pin select for RXD signal"] + pub rxd: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "Unspecified"] +pub mod psel; +#[doc = r"Register block"] +#[repr(C)] +pub struct RXD { + #[doc = "0x00 - Data pointer"] + pub ptr: crate::Reg, + #[doc = "0x04 - Maximum number of bytes in receive buffer"] + pub maxcnt: crate::Reg, + #[doc = "0x08 - Number of bytes transferred in the last transaction"] + pub amount: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "RXD EasyDMA channel"] +pub mod rxd; +#[doc = r"Register block"] +#[repr(C)] +pub struct TXD { + #[doc = "0x00 - Data pointer"] + pub ptr: crate::Reg, + #[doc = "0x04 - Maximum number of bytes in transmit buffer"] + pub maxcnt: crate::Reg, + #[doc = "0x08 - Number of bytes transferred in the last transaction"] + pub amount: crate::Reg, +} +#[doc = r"Register block"] +#[doc = "TXD EasyDMA channel"] +pub mod txd; +#[doc = "TASKS_STARTRX register accessor: an alias for `Reg`"] +pub type TASKS_STARTRX = crate::Reg; +#[doc = "Start UART receiver"] +pub mod tasks_startrx; +#[doc = "TASKS_STOPRX register accessor: an alias for `Reg`"] +pub type TASKS_STOPRX = crate::Reg; +#[doc = "Stop UART receiver"] +pub mod tasks_stoprx; +#[doc = "TASKS_STARTTX register accessor: an alias for `Reg`"] +pub type TASKS_STARTTX = crate::Reg; +#[doc = "Start UART transmitter"] +pub mod tasks_starttx; +#[doc = "TASKS_STOPTX register accessor: an alias for `Reg`"] +pub type TASKS_STOPTX = crate::Reg; +#[doc = "Stop UART transmitter"] +pub mod tasks_stoptx; +#[doc = "TASKS_FLUSHRX register accessor: an alias for `Reg`"] +pub type TASKS_FLUSHRX = crate::Reg; +#[doc = "Flush RX FIFO into RX buffer"] +pub mod tasks_flushrx; +#[doc = "EVENTS_CTS register accessor: an alias for `Reg`"] +pub type EVENTS_CTS = crate::Reg; +#[doc = "CTS is activated (set low). Clear To Send."] +pub mod events_cts; +#[doc = "EVENTS_NCTS register accessor: an alias for `Reg`"] +pub type EVENTS_NCTS = crate::Reg; +#[doc = "CTS is deactivated (set high). Not Clear To Send."] +pub mod events_ncts; +#[doc = "EVENTS_RXDRDY register accessor: an alias for `Reg`"] +pub type EVENTS_RXDRDY = crate::Reg; +#[doc = "Data received in RXD (but potentially not yet transferred to Data RAM)"] +pub mod events_rxdrdy; +#[doc = "EVENTS_ENDRX register accessor: an alias for `Reg`"] +pub type EVENTS_ENDRX = crate::Reg; +#[doc = "Receive buffer is filled up"] +pub mod events_endrx; +#[doc = "EVENTS_TXDRDY register accessor: an alias for `Reg`"] +pub type EVENTS_TXDRDY = crate::Reg; +#[doc = "Data sent from TXD"] +pub mod events_txdrdy; +#[doc = "EVENTS_ENDTX register accessor: an alias for `Reg`"] +pub type EVENTS_ENDTX = crate::Reg; +#[doc = "Last TX byte transmitted"] +pub mod events_endtx; +#[doc = "EVENTS_ERROR register accessor: an alias for `Reg`"] +pub type EVENTS_ERROR = crate::Reg; +#[doc = "Error detected"] +pub mod events_error; +#[doc = "EVENTS_RXTO register accessor: an alias for `Reg`"] +pub type EVENTS_RXTO = crate::Reg; +#[doc = "Receiver timeout"] +pub mod events_rxto; +#[doc = "EVENTS_RXSTARTED register accessor: an alias for `Reg`"] +pub type EVENTS_RXSTARTED = crate::Reg; +#[doc = "UART receiver has started"] +pub mod events_rxstarted; +#[doc = "EVENTS_TXSTARTED register accessor: an alias for `Reg`"] +pub type EVENTS_TXSTARTED = crate::Reg; +#[doc = "UART transmitter has started"] +pub mod events_txstarted; +#[doc = "EVENTS_TXSTOPPED register accessor: an alias for `Reg`"] +pub type EVENTS_TXSTOPPED = crate::Reg; +#[doc = "Transmitter stopped"] +pub mod events_txstopped; +#[doc = "SHORTS register accessor: an alias for `Reg`"] +pub type SHORTS = crate::Reg; +#[doc = "Shortcut register"] +pub mod shorts; +#[doc = "INTEN register accessor: an alias for `Reg`"] +pub type INTEN = crate::Reg; +#[doc = "Enable or disable interrupt"] +pub mod inten; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "ERRORSRC register accessor: an alias for `Reg`"] +pub type ERRORSRC = crate::Reg; +#[doc = "Error source"] +pub mod errorsrc; +#[doc = "ENABLE register accessor: an alias for `Reg`"] +pub type ENABLE = crate::Reg; +#[doc = "Enable UART"] +pub mod enable; +#[doc = "BAUDRATE register accessor: an alias for `Reg`"] +pub type BAUDRATE = crate::Reg; +#[doc = "Baud rate. Accuracy depends on the HFCLK source selected."] +pub mod baudrate; +#[doc = "CONFIG register accessor: an alias for `Reg`"] +pub type CONFIG = crate::Reg; +#[doc = "Configuration of parity and hardware flow control"] +pub mod config; diff --git a/src/uarte0/baudrate.rs b/src/uarte0/baudrate.rs new file mode 100644 index 0000000..28ae66e --- /dev/null +++ b/src/uarte0/baudrate.rs @@ -0,0 +1,359 @@ +#[doc = "Register `BAUDRATE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `BAUDRATE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Baud rate\n\nValue on reset: 67108864"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u32)] +pub enum BAUDRATE_A { + #[doc = "323584: 1200 baud (actual rate: 1205)"] + BAUD1200 = 323584, + #[doc = "643072: 2400 baud (actual rate: 2396)"] + BAUD2400 = 643072, + #[doc = "1290240: 4800 baud (actual rate: 4808)"] + BAUD4800 = 1290240, + #[doc = "2576384: 9600 baud (actual rate: 9598)"] + BAUD9600 = 2576384, + #[doc = "3862528: 14400 baud (actual rate: 14401)"] + BAUD14400 = 3862528, + #[doc = "5152768: 19200 baud (actual rate: 19208)"] + BAUD19200 = 5152768, + #[doc = "7716864: 28800 baud (actual rate: 28777)"] + BAUD28800 = 7716864, + #[doc = "8388608: 31250 baud"] + BAUD31250 = 8388608, + #[doc = "10289152: 38400 baud (actual rate: 38369)"] + BAUD38400 = 10289152, + #[doc = "15007744: 56000 baud (actual rate: 55944)"] + BAUD56000 = 15007744, + #[doc = "15400960: 57600 baud (actual rate: 57554)"] + BAUD57600 = 15400960, + #[doc = "20615168: 76800 baud (actual rate: 76923)"] + BAUD76800 = 20615168, + #[doc = "30801920: 115200 baud (actual rate: 115108)"] + BAUD115200 = 30801920, + #[doc = "61865984: 230400 baud (actual rate: 231884)"] + BAUD230400 = 61865984, + #[doc = "67108864: 250000 baud"] + BAUD250000 = 67108864, + #[doc = "121634816: 460800 baud (actual rate: 457143)"] + BAUD460800 = 121634816, + #[doc = "251658240: 921600 baud (actual rate: 941176)"] + BAUD921600 = 251658240, + #[doc = "268435456: 1Mega baud"] + BAUD1M = 268435456, +} +impl From for u32 { + #[inline(always)] + fn from(variant: BAUDRATE_A) -> Self { + variant as _ + } +} +#[doc = "Field `BAUDRATE` reader - Baud rate"] +pub struct BAUDRATE_R(crate::FieldReader); +impl BAUDRATE_R { + pub(crate) fn new(bits: u32) -> Self { + BAUDRATE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 323584 => Some(BAUDRATE_A::BAUD1200), + 643072 => Some(BAUDRATE_A::BAUD2400), + 1290240 => Some(BAUDRATE_A::BAUD4800), + 2576384 => Some(BAUDRATE_A::BAUD9600), + 3862528 => Some(BAUDRATE_A::BAUD14400), + 5152768 => Some(BAUDRATE_A::BAUD19200), + 7716864 => Some(BAUDRATE_A::BAUD28800), + 8388608 => Some(BAUDRATE_A::BAUD31250), + 10289152 => Some(BAUDRATE_A::BAUD38400), + 15007744 => Some(BAUDRATE_A::BAUD56000), + 15400960 => Some(BAUDRATE_A::BAUD57600), + 20615168 => Some(BAUDRATE_A::BAUD76800), + 30801920 => Some(BAUDRATE_A::BAUD115200), + 61865984 => Some(BAUDRATE_A::BAUD230400), + 67108864 => Some(BAUDRATE_A::BAUD250000), + 121634816 => Some(BAUDRATE_A::BAUD460800), + 251658240 => Some(BAUDRATE_A::BAUD921600), + 268435456 => Some(BAUDRATE_A::BAUD1M), + _ => None, + } + } + #[doc = "Checks if the value of the field is `BAUD1200`"] + #[inline(always)] + pub fn is_baud1200(&self) -> bool { + **self == BAUDRATE_A::BAUD1200 + } + #[doc = "Checks if the value of the field is `BAUD2400`"] + #[inline(always)] + pub fn is_baud2400(&self) -> bool { + **self == BAUDRATE_A::BAUD2400 + } + #[doc = "Checks if the value of the field is `BAUD4800`"] + #[inline(always)] + pub fn is_baud4800(&self) -> bool { + **self == BAUDRATE_A::BAUD4800 + } + #[doc = "Checks if the value of the field is `BAUD9600`"] + #[inline(always)] + pub fn is_baud9600(&self) -> bool { + **self == BAUDRATE_A::BAUD9600 + } + #[doc = "Checks if the value of the field is `BAUD14400`"] + #[inline(always)] + pub fn is_baud14400(&self) -> bool { + **self == BAUDRATE_A::BAUD14400 + } + #[doc = "Checks if the value of the field is `BAUD19200`"] + #[inline(always)] + pub fn is_baud19200(&self) -> bool { + **self == BAUDRATE_A::BAUD19200 + } + #[doc = "Checks if the value of the field is `BAUD28800`"] + #[inline(always)] + pub fn is_baud28800(&self) -> bool { + **self == BAUDRATE_A::BAUD28800 + } + #[doc = "Checks if the value of the field is `BAUD31250`"] + #[inline(always)] + pub fn is_baud31250(&self) -> bool { + **self == BAUDRATE_A::BAUD31250 + } + #[doc = "Checks if the value of the field is `BAUD38400`"] + #[inline(always)] + pub fn is_baud38400(&self) -> bool { + **self == BAUDRATE_A::BAUD38400 + } + #[doc = "Checks if the value of the field is `BAUD56000`"] + #[inline(always)] + pub fn is_baud56000(&self) -> bool { + **self == BAUDRATE_A::BAUD56000 + } + #[doc = "Checks if the value of the field is `BAUD57600`"] + #[inline(always)] + pub fn is_baud57600(&self) -> bool { + **self == BAUDRATE_A::BAUD57600 + } + #[doc = "Checks if the value of the field is `BAUD76800`"] + #[inline(always)] + pub fn is_baud76800(&self) -> bool { + **self == BAUDRATE_A::BAUD76800 + } + #[doc = "Checks if the value of the field is `BAUD115200`"] + #[inline(always)] + pub fn is_baud115200(&self) -> bool { + **self == BAUDRATE_A::BAUD115200 + } + #[doc = "Checks if the value of the field is `BAUD230400`"] + #[inline(always)] + pub fn is_baud230400(&self) -> bool { + **self == BAUDRATE_A::BAUD230400 + } + #[doc = "Checks if the value of the field is `BAUD250000`"] + #[inline(always)] + pub fn is_baud250000(&self) -> bool { + **self == BAUDRATE_A::BAUD250000 + } + #[doc = "Checks if the value of the field is `BAUD460800`"] + #[inline(always)] + pub fn is_baud460800(&self) -> bool { + **self == BAUDRATE_A::BAUD460800 + } + #[doc = "Checks if the value of the field is `BAUD921600`"] + #[inline(always)] + pub fn is_baud921600(&self) -> bool { + **self == BAUDRATE_A::BAUD921600 + } + #[doc = "Checks if the value of the field is `BAUD1M`"] + #[inline(always)] + pub fn is_baud1m(&self) -> bool { + **self == BAUDRATE_A::BAUD1M + } +} +impl core::ops::Deref for BAUDRATE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BAUDRATE` writer - Baud rate"] +pub struct BAUDRATE_W<'a> { + w: &'a mut W, +} +impl<'a> BAUDRATE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: BAUDRATE_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "1200 baud (actual rate: 1205)"] + #[inline(always)] + pub fn baud1200(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD1200) + } + #[doc = "2400 baud (actual rate: 2396)"] + #[inline(always)] + pub fn baud2400(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD2400) + } + #[doc = "4800 baud (actual rate: 4808)"] + #[inline(always)] + pub fn baud4800(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD4800) + } + #[doc = "9600 baud (actual rate: 9598)"] + #[inline(always)] + pub fn baud9600(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD9600) + } + #[doc = "14400 baud (actual rate: 14401)"] + #[inline(always)] + pub fn baud14400(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD14400) + } + #[doc = "19200 baud (actual rate: 19208)"] + #[inline(always)] + pub fn baud19200(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD19200) + } + #[doc = "28800 baud (actual rate: 28777)"] + #[inline(always)] + pub fn baud28800(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD28800) + } + #[doc = "31250 baud"] + #[inline(always)] + pub fn baud31250(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD31250) + } + #[doc = "38400 baud (actual rate: 38369)"] + #[inline(always)] + pub fn baud38400(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD38400) + } + #[doc = "56000 baud (actual rate: 55944)"] + #[inline(always)] + pub fn baud56000(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD56000) + } + #[doc = "57600 baud (actual rate: 57554)"] + #[inline(always)] + pub fn baud57600(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD57600) + } + #[doc = "76800 baud (actual rate: 76923)"] + #[inline(always)] + pub fn baud76800(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD76800) + } + #[doc = "115200 baud (actual rate: 115108)"] + #[inline(always)] + pub fn baud115200(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD115200) + } + #[doc = "230400 baud (actual rate: 231884)"] + #[inline(always)] + pub fn baud230400(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD230400) + } + #[doc = "250000 baud"] + #[inline(always)] + pub fn baud250000(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD250000) + } + #[doc = "460800 baud (actual rate: 457143)"] + #[inline(always)] + pub fn baud460800(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD460800) + } + #[doc = "921600 baud (actual rate: 941176)"] + #[inline(always)] + pub fn baud921600(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD921600) + } + #[doc = "1Mega baud"] + #[inline(always)] + pub fn baud1m(self) -> &'a mut W { + self.variant(BAUDRATE_A::BAUD1M) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Baud rate"] + #[inline(always)] + pub fn baudrate(&self) -> BAUDRATE_R { + BAUDRATE_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Baud rate"] + #[inline(always)] + pub fn baudrate(&mut self) -> BAUDRATE_W { + BAUDRATE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Baud rate. Accuracy depends on the HFCLK source selected.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [baudrate](index.html) module"] +pub struct BAUDRATE_SPEC; +impl crate::RegisterSpec for BAUDRATE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [baudrate::R](R) reader structure"] +impl crate::Readable for BAUDRATE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [baudrate::W](W) writer structure"] +impl crate::Writable for BAUDRATE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets BAUDRATE to value 0x0400_0000"] +impl crate::Resettable for BAUDRATE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x0400_0000 + } +} diff --git a/src/uarte0/config.rs b/src/uarte0/config.rs new file mode 100644 index 0000000..8fccfaa --- /dev/null +++ b/src/uarte0/config.rs @@ -0,0 +1,244 @@ +#[doc = "Register `CONFIG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CONFIG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Hardware flow control\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum HWFC_A { + #[doc = "0: Disabled"] + DISABLED = 0, + #[doc = "1: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: HWFC_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `HWFC` reader - Hardware flow control"] +pub struct HWFC_R(crate::FieldReader); +impl HWFC_R { + pub(crate) fn new(bits: bool) -> Self { + HWFC_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> HWFC_A { + match self.bits { + false => HWFC_A::DISABLED, + true => HWFC_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == HWFC_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == HWFC_A::ENABLED + } +} +impl core::ops::Deref for HWFC_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HWFC` writer - Hardware flow control"] +pub struct HWFC_W<'a> { + w: &'a mut W, +} +impl<'a> HWFC_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: HWFC_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disabled"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(HWFC_A::DISABLED) + } + #[doc = "Enabled"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(HWFC_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Parity\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum PARITY_A { + #[doc = "0: Exclude parity bit"] + EXCLUDED = 0, + #[doc = "7: Include parity bit"] + INCLUDED = 7, +} +impl From for u8 { + #[inline(always)] + fn from(variant: PARITY_A) -> Self { + variant as _ + } +} +#[doc = "Field `PARITY` reader - Parity"] +pub struct PARITY_R(crate::FieldReader); +impl PARITY_R { + pub(crate) fn new(bits: u8) -> Self { + PARITY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(PARITY_A::EXCLUDED), + 7 => Some(PARITY_A::INCLUDED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `EXCLUDED`"] + #[inline(always)] + pub fn is_excluded(&self) -> bool { + **self == PARITY_A::EXCLUDED + } + #[doc = "Checks if the value of the field is `INCLUDED`"] + #[inline(always)] + pub fn is_included(&self) -> bool { + **self == PARITY_A::INCLUDED + } +} +impl core::ops::Deref for PARITY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PARITY` writer - Parity"] +pub struct PARITY_W<'a> { + w: &'a mut W, +} +impl<'a> PARITY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PARITY_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Exclude parity bit"] + #[inline(always)] + pub fn excluded(self) -> &'a mut W { + self.variant(PARITY_A::EXCLUDED) + } + #[doc = "Include parity bit"] + #[inline(always)] + pub fn included(self) -> &'a mut W { + self.variant(PARITY_A::INCLUDED) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x07 << 1)) | ((value as u32 & 0x07) << 1); + self.w + } +} +impl R { + #[doc = "Bit 0 - Hardware flow control"] + #[inline(always)] + pub fn hwfc(&self) -> HWFC_R { + HWFC_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bits 1:3 - Parity"] + #[inline(always)] + pub fn parity(&self) -> PARITY_R { + PARITY_R::new(((self.bits >> 1) & 0x07) as u8) + } +} +impl W { + #[doc = "Bit 0 - Hardware flow control"] + #[inline(always)] + pub fn hwfc(&mut self) -> HWFC_W { + HWFC_W { w: self } + } + #[doc = "Bits 1:3 - Parity"] + #[inline(always)] + pub fn parity(&mut self) -> PARITY_W { + PARITY_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Configuration of parity and hardware flow control\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [config](index.html) module"] +pub struct CONFIG_SPEC; +impl crate::RegisterSpec for CONFIG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [config::R](R) reader structure"] +impl crate::Readable for CONFIG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [config::W](W) writer structure"] +impl crate::Writable for CONFIG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CONFIG to value 0"] +impl crate::Resettable for CONFIG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/enable.rs b/src/uarte0/enable.rs new file mode 100644 index 0000000..ec3dafa --- /dev/null +++ b/src/uarte0/enable.rs @@ -0,0 +1,151 @@ +#[doc = "Register `ENABLE` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ENABLE` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable UARTE\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum ENABLE_A { + #[doc = "0: Disable UARTE"] + DISABLED = 0, + #[doc = "8: Enable UARTE"] + ENABLED = 8, +} +impl From for u8 { + #[inline(always)] + fn from(variant: ENABLE_A) -> Self { + variant as _ + } +} +#[doc = "Field `ENABLE` reader - Enable or disable UARTE"] +pub struct ENABLE_R(crate::FieldReader); +impl ENABLE_R { + pub(crate) fn new(bits: u8) -> Self { + ENABLE_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 0 => Some(ENABLE_A::DISABLED), + 8 => Some(ENABLE_A::ENABLED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENABLE_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENABLE_A::ENABLED + } +} +impl core::ops::Deref for ENABLE_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENABLE` writer - Enable or disable UARTE"] +pub struct ENABLE_W<'a> { + w: &'a mut W, +} +impl<'a> ENABLE_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENABLE_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Disable UARTE"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENABLE_A::DISABLED) + } + #[doc = "Enable UARTE"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENABLE_A::ENABLED) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x0f) | (value as u32 & 0x0f); + self.w + } +} +impl R { + #[doc = "Bits 0:3 - Enable or disable UARTE"] + #[inline(always)] + pub fn enable(&self) -> ENABLE_R { + ENABLE_R::new((self.bits & 0x0f) as u8) + } +} +impl W { + #[doc = "Bits 0:3 - Enable or disable UARTE"] + #[inline(always)] + pub fn enable(&mut self) -> ENABLE_W { + ENABLE_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable UART\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [enable](index.html) module"] +pub struct ENABLE_SPEC; +impl crate::RegisterSpec for ENABLE_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [enable::R](R) reader structure"] +impl crate::Readable for ENABLE_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [enable::W](W) writer structure"] +impl crate::Writable for ENABLE_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ENABLE to value 0"] +impl crate::Resettable for ENABLE_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/errorsrc.rs b/src/uarte0/errorsrc.rs new file mode 100644 index 0000000..4a422f4 --- /dev/null +++ b/src/uarte0/errorsrc.rs @@ -0,0 +1,438 @@ +#[doc = "Register `ERRORSRC` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `ERRORSRC` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Overrun error\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum OVERRUN_A { + #[doc = "0: Read: error not present"] + NOTPRESENT = 0, + #[doc = "1: Read: error present"] + PRESENT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: OVERRUN_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `OVERRUN` reader - Overrun error"] +pub struct OVERRUN_R(crate::FieldReader); +impl OVERRUN_R { + pub(crate) fn new(bits: bool) -> Self { + OVERRUN_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> OVERRUN_A { + match self.bits { + false => OVERRUN_A::NOTPRESENT, + true => OVERRUN_A::PRESENT, + } + } + #[doc = "Checks if the value of the field is `NOTPRESENT`"] + #[inline(always)] + pub fn is_not_present(&self) -> bool { + **self == OVERRUN_A::NOTPRESENT + } + #[doc = "Checks if the value of the field is `PRESENT`"] + #[inline(always)] + pub fn is_present(&self) -> bool { + **self == OVERRUN_A::PRESENT + } +} +impl core::ops::Deref for OVERRUN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `OVERRUN` writer - Overrun error"] +pub struct OVERRUN_W<'a> { + w: &'a mut W, +} +impl<'a> OVERRUN_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: OVERRUN_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Read: error not present"] + #[inline(always)] + pub fn not_present(self) -> &'a mut W { + self.variant(OVERRUN_A::NOTPRESENT) + } + #[doc = "Read: error present"] + #[inline(always)] + pub fn present(self) -> &'a mut W { + self.variant(OVERRUN_A::PRESENT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Parity error\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PARITY_A { + #[doc = "0: Read: error not present"] + NOTPRESENT = 0, + #[doc = "1: Read: error present"] + PRESENT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PARITY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PARITY` reader - Parity error"] +pub struct PARITY_R(crate::FieldReader); +impl PARITY_R { + pub(crate) fn new(bits: bool) -> Self { + PARITY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PARITY_A { + match self.bits { + false => PARITY_A::NOTPRESENT, + true => PARITY_A::PRESENT, + } + } + #[doc = "Checks if the value of the field is `NOTPRESENT`"] + #[inline(always)] + pub fn is_not_present(&self) -> bool { + **self == PARITY_A::NOTPRESENT + } + #[doc = "Checks if the value of the field is `PRESENT`"] + #[inline(always)] + pub fn is_present(&self) -> bool { + **self == PARITY_A::PRESENT + } +} +impl core::ops::Deref for PARITY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PARITY` writer - Parity error"] +pub struct PARITY_W<'a> { + w: &'a mut W, +} +impl<'a> PARITY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PARITY_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Read: error not present"] + #[inline(always)] + pub fn not_present(self) -> &'a mut W { + self.variant(PARITY_A::NOTPRESENT) + } + #[doc = "Read: error present"] + #[inline(always)] + pub fn present(self) -> &'a mut W { + self.variant(PARITY_A::PRESENT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Framing error occurred\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum FRAMING_A { + #[doc = "0: Read: error not present"] + NOTPRESENT = 0, + #[doc = "1: Read: error present"] + PRESENT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: FRAMING_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `FRAMING` reader - Framing error occurred"] +pub struct FRAMING_R(crate::FieldReader); +impl FRAMING_R { + pub(crate) fn new(bits: bool) -> Self { + FRAMING_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> FRAMING_A { + match self.bits { + false => FRAMING_A::NOTPRESENT, + true => FRAMING_A::PRESENT, + } + } + #[doc = "Checks if the value of the field is `NOTPRESENT`"] + #[inline(always)] + pub fn is_not_present(&self) -> bool { + **self == FRAMING_A::NOTPRESENT + } + #[doc = "Checks if the value of the field is `PRESENT`"] + #[inline(always)] + pub fn is_present(&self) -> bool { + **self == FRAMING_A::PRESENT + } +} +impl core::ops::Deref for FRAMING_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `FRAMING` writer - Framing error occurred"] +pub struct FRAMING_W<'a> { + w: &'a mut W, +} +impl<'a> FRAMING_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: FRAMING_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Read: error not present"] + #[inline(always)] + pub fn not_present(self) -> &'a mut W { + self.variant(FRAMING_A::NOTPRESENT) + } + #[doc = "Read: error present"] + #[inline(always)] + pub fn present(self) -> &'a mut W { + self.variant(FRAMING_A::PRESENT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Break condition\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum BREAK_A { + #[doc = "0: Read: error not present"] + NOTPRESENT = 0, + #[doc = "1: Read: error present"] + PRESENT = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: BREAK_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `BREAK` reader - Break condition"] +pub struct BREAK_R(crate::FieldReader); +impl BREAK_R { + pub(crate) fn new(bits: bool) -> Self { + BREAK_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> BREAK_A { + match self.bits { + false => BREAK_A::NOTPRESENT, + true => BREAK_A::PRESENT, + } + } + #[doc = "Checks if the value of the field is `NOTPRESENT`"] + #[inline(always)] + pub fn is_not_present(&self) -> bool { + **self == BREAK_A::NOTPRESENT + } + #[doc = "Checks if the value of the field is `PRESENT`"] + #[inline(always)] + pub fn is_present(&self) -> bool { + **self == BREAK_A::PRESENT + } +} +impl core::ops::Deref for BREAK_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `BREAK` writer - Break condition"] +pub struct BREAK_W<'a> { + w: &'a mut W, +} +impl<'a> BREAK_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: BREAK_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Read: error not present"] + #[inline(always)] + pub fn not_present(self) -> &'a mut W { + self.variant(BREAK_A::NOTPRESENT) + } + #[doc = "Read: error present"] + #[inline(always)] + pub fn present(self) -> &'a mut W { + self.variant(BREAK_A::PRESENT) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +impl R { + #[doc = "Bit 0 - Overrun error"] + #[inline(always)] + pub fn overrun(&self) -> OVERRUN_R { + OVERRUN_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Parity error"] + #[inline(always)] + pub fn parity(&self) -> PARITY_R { + PARITY_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Framing error occurred"] + #[inline(always)] + pub fn framing(&self) -> FRAMING_R { + FRAMING_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Break condition"] + #[inline(always)] + pub fn break_(&self) -> BREAK_R { + BREAK_R::new(((self.bits >> 3) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Overrun error"] + #[inline(always)] + pub fn overrun(&mut self) -> OVERRUN_W { + OVERRUN_W { w: self } + } + #[doc = "Bit 1 - Parity error"] + #[inline(always)] + pub fn parity(&mut self) -> PARITY_W { + PARITY_W { w: self } + } + #[doc = "Bit 2 - Framing error occurred"] + #[inline(always)] + pub fn framing(&mut self) -> FRAMING_W { + FRAMING_W { w: self } + } + #[doc = "Bit 3 - Break condition"] + #[inline(always)] + pub fn break_(&mut self) -> BREAK_W { + BREAK_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Error source\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [errorsrc](index.html) module"] +pub struct ERRORSRC_SPEC; +impl crate::RegisterSpec for ERRORSRC_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [errorsrc::R](R) reader structure"] +impl crate::Readable for ERRORSRC_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [errorsrc::W](W) writer structure"] +impl crate::Writable for ERRORSRC_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets ERRORSRC to value 0"] +impl crate::Resettable for ERRORSRC_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/events_cts.rs b/src/uarte0/events_cts.rs new file mode 100644 index 0000000..e63852d --- /dev/null +++ b/src/uarte0/events_cts.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_CTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_CTS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "CTS is activated (set low). Clear To Send.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_cts](index.html) module"] +pub struct EVENTS_CTS_SPEC; +impl crate::RegisterSpec for EVENTS_CTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_cts::R](R) reader structure"] +impl crate::Readable for EVENTS_CTS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_cts::W](W) writer structure"] +impl crate::Writable for EVENTS_CTS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_CTS to value 0"] +impl crate::Resettable for EVENTS_CTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/events_endrx.rs b/src/uarte0/events_endrx.rs new file mode 100644 index 0000000..e7cd0e3 --- /dev/null +++ b/src/uarte0/events_endrx.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_ENDRX` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_ENDRX` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Receive buffer is filled up\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_endrx](index.html) module"] +pub struct EVENTS_ENDRX_SPEC; +impl crate::RegisterSpec for EVENTS_ENDRX_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_endrx::R](R) reader structure"] +impl crate::Readable for EVENTS_ENDRX_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_endrx::W](W) writer structure"] +impl crate::Writable for EVENTS_ENDRX_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_ENDRX to value 0"] +impl crate::Resettable for EVENTS_ENDRX_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/events_endtx.rs b/src/uarte0/events_endtx.rs new file mode 100644 index 0000000..59cf6ea --- /dev/null +++ b/src/uarte0/events_endtx.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_ENDTX` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_ENDTX` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Last TX byte transmitted\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_endtx](index.html) module"] +pub struct EVENTS_ENDTX_SPEC; +impl crate::RegisterSpec for EVENTS_ENDTX_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_endtx::R](R) reader structure"] +impl crate::Readable for EVENTS_ENDTX_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_endtx::W](W) writer structure"] +impl crate::Writable for EVENTS_ENDTX_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_ENDTX to value 0"] +impl crate::Resettable for EVENTS_ENDTX_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/events_error.rs b/src/uarte0/events_error.rs new file mode 100644 index 0000000..616708c --- /dev/null +++ b/src/uarte0/events_error.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_ERROR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_ERROR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Error detected\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_error](index.html) module"] +pub struct EVENTS_ERROR_SPEC; +impl crate::RegisterSpec for EVENTS_ERROR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_error::R](R) reader structure"] +impl crate::Readable for EVENTS_ERROR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_error::W](W) writer structure"] +impl crate::Writable for EVENTS_ERROR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_ERROR to value 0"] +impl crate::Resettable for EVENTS_ERROR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/events_ncts.rs b/src/uarte0/events_ncts.rs new file mode 100644 index 0000000..de19bdd --- /dev/null +++ b/src/uarte0/events_ncts.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_NCTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_NCTS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "CTS is deactivated (set high). Not Clear To Send.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_ncts](index.html) module"] +pub struct EVENTS_NCTS_SPEC; +impl crate::RegisterSpec for EVENTS_NCTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_ncts::R](R) reader structure"] +impl crate::Readable for EVENTS_NCTS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_ncts::W](W) writer structure"] +impl crate::Writable for EVENTS_NCTS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_NCTS to value 0"] +impl crate::Resettable for EVENTS_NCTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/events_rxdrdy.rs b/src/uarte0/events_rxdrdy.rs new file mode 100644 index 0000000..157af5d --- /dev/null +++ b/src/uarte0/events_rxdrdy.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_RXDRDY` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_RXDRDY` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Data received in RXD (but potentially not yet transferred to Data RAM)\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_rxdrdy](index.html) module"] +pub struct EVENTS_RXDRDY_SPEC; +impl crate::RegisterSpec for EVENTS_RXDRDY_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_rxdrdy::R](R) reader structure"] +impl crate::Readable for EVENTS_RXDRDY_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_rxdrdy::W](W) writer structure"] +impl crate::Writable for EVENTS_RXDRDY_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_RXDRDY to value 0"] +impl crate::Resettable for EVENTS_RXDRDY_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/events_rxstarted.rs b/src/uarte0/events_rxstarted.rs new file mode 100644 index 0000000..f93dfc6 --- /dev/null +++ b/src/uarte0/events_rxstarted.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_RXSTARTED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_RXSTARTED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "UART receiver has started\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_rxstarted](index.html) module"] +pub struct EVENTS_RXSTARTED_SPEC; +impl crate::RegisterSpec for EVENTS_RXSTARTED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_rxstarted::R](R) reader structure"] +impl crate::Readable for EVENTS_RXSTARTED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_rxstarted::W](W) writer structure"] +impl crate::Writable for EVENTS_RXSTARTED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_RXSTARTED to value 0"] +impl crate::Resettable for EVENTS_RXSTARTED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/events_rxto.rs b/src/uarte0/events_rxto.rs new file mode 100644 index 0000000..c618ee4 --- /dev/null +++ b/src/uarte0/events_rxto.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_RXTO` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_RXTO` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Receiver timeout\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_rxto](index.html) module"] +pub struct EVENTS_RXTO_SPEC; +impl crate::RegisterSpec for EVENTS_RXTO_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_rxto::R](R) reader structure"] +impl crate::Readable for EVENTS_RXTO_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_rxto::W](W) writer structure"] +impl crate::Writable for EVENTS_RXTO_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_RXTO to value 0"] +impl crate::Resettable for EVENTS_RXTO_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/events_txdrdy.rs b/src/uarte0/events_txdrdy.rs new file mode 100644 index 0000000..797352c --- /dev/null +++ b/src/uarte0/events_txdrdy.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_TXDRDY` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_TXDRDY` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Data sent from TXD\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_txdrdy](index.html) module"] +pub struct EVENTS_TXDRDY_SPEC; +impl crate::RegisterSpec for EVENTS_TXDRDY_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_txdrdy::R](R) reader structure"] +impl crate::Readable for EVENTS_TXDRDY_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_txdrdy::W](W) writer structure"] +impl crate::Writable for EVENTS_TXDRDY_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_TXDRDY to value 0"] +impl crate::Resettable for EVENTS_TXDRDY_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/events_txstarted.rs b/src/uarte0/events_txstarted.rs new file mode 100644 index 0000000..8ed37da --- /dev/null +++ b/src/uarte0/events_txstarted.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_TXSTARTED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_TXSTARTED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "UART transmitter has started\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_txstarted](index.html) module"] +pub struct EVENTS_TXSTARTED_SPEC; +impl crate::RegisterSpec for EVENTS_TXSTARTED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_txstarted::R](R) reader structure"] +impl crate::Readable for EVENTS_TXSTARTED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_txstarted::W](W) writer structure"] +impl crate::Writable for EVENTS_TXSTARTED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_TXSTARTED to value 0"] +impl crate::Resettable for EVENTS_TXSTARTED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/events_txstopped.rs b/src/uarte0/events_txstopped.rs new file mode 100644 index 0000000..f1a3f1b --- /dev/null +++ b/src/uarte0/events_txstopped.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_TXSTOPPED` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_TXSTOPPED` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Transmitter stopped\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_txstopped](index.html) module"] +pub struct EVENTS_TXSTOPPED_SPEC; +impl crate::RegisterSpec for EVENTS_TXSTOPPED_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_txstopped::R](R) reader structure"] +impl crate::Readable for EVENTS_TXSTOPPED_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_txstopped::W](W) writer structure"] +impl crate::Writable for EVENTS_TXSTOPPED_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_TXSTOPPED to value 0"] +impl crate::Resettable for EVENTS_TXSTOPPED_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/inten.rs b/src/uarte0/inten.rs new file mode 100644 index 0000000..7c8d07e --- /dev/null +++ b/src/uarte0/inten.rs @@ -0,0 +1,1089 @@ +#[doc = "Register `INTEN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTEN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable interrupt for CTS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CTS_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CTS_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CTS` reader - Enable or disable interrupt for CTS event"] +pub struct CTS_R(crate::FieldReader); +impl CTS_R { + pub(crate) fn new(bits: bool) -> Self { + CTS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CTS_A { + match self.bits { + false => CTS_A::DISABLED, + true => CTS_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CTS_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CTS_A::ENABLED + } +} +impl core::ops::Deref for CTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CTS` writer - Enable or disable interrupt for CTS event"] +pub struct CTS_W<'a> { + w: &'a mut W, +} +impl<'a> CTS_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CTS_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(CTS_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(CTS_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Enable or disable interrupt for NCTS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum NCTS_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: NCTS_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `NCTS` reader - Enable or disable interrupt for NCTS event"] +pub struct NCTS_R(crate::FieldReader); +impl NCTS_R { + pub(crate) fn new(bits: bool) -> Self { + NCTS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> NCTS_A { + match self.bits { + false => NCTS_A::DISABLED, + true => NCTS_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == NCTS_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == NCTS_A::ENABLED + } +} +impl core::ops::Deref for NCTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NCTS` writer - Enable or disable interrupt for NCTS event"] +pub struct NCTS_W<'a> { + w: &'a mut W, +} +impl<'a> NCTS_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: NCTS_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(NCTS_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(NCTS_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Enable or disable interrupt for RXDRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXDRDY_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXDRDY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXDRDY` reader - Enable or disable interrupt for RXDRDY event"] +pub struct RXDRDY_R(crate::FieldReader); +impl RXDRDY_R { + pub(crate) fn new(bits: bool) -> Self { + RXDRDY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXDRDY_A { + match self.bits { + false => RXDRDY_A::DISABLED, + true => RXDRDY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXDRDY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXDRDY_A::ENABLED + } +} +impl core::ops::Deref for RXDRDY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RXDRDY` writer - Enable or disable interrupt for RXDRDY event"] +pub struct RXDRDY_W<'a> { + w: &'a mut W, +} +impl<'a> RXDRDY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXDRDY_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(RXDRDY_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(RXDRDY_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Enable or disable interrupt for ENDRX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDRX_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDRX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDRX` reader - Enable or disable interrupt for ENDRX event"] +pub struct ENDRX_R(crate::FieldReader); +impl ENDRX_R { + pub(crate) fn new(bits: bool) -> Self { + ENDRX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDRX_A { + match self.bits { + false => ENDRX_A::DISABLED, + true => ENDRX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENDRX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENDRX_A::ENABLED + } +} +impl core::ops::Deref for ENDRX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENDRX` writer - Enable or disable interrupt for ENDRX event"] +pub struct ENDRX_W<'a> { + w: &'a mut W, +} +impl<'a> ENDRX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDRX_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENDRX_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENDRX_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Enable or disable interrupt for TXDRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXDRDY_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXDRDY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXDRDY` reader - Enable or disable interrupt for TXDRDY event"] +pub struct TXDRDY_R(crate::FieldReader); +impl TXDRDY_R { + pub(crate) fn new(bits: bool) -> Self { + TXDRDY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXDRDY_A { + match self.bits { + false => TXDRDY_A::DISABLED, + true => TXDRDY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXDRDY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXDRDY_A::ENABLED + } +} +impl core::ops::Deref for TXDRDY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TXDRDY` writer - Enable or disable interrupt for TXDRDY event"] +pub struct TXDRDY_W<'a> { + w: &'a mut W, +} +impl<'a> TXDRDY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXDRDY_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(TXDRDY_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(TXDRDY_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Enable or disable interrupt for ENDTX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDTX_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDTX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDTX` reader - Enable or disable interrupt for ENDTX event"] +pub struct ENDTX_R(crate::FieldReader); +impl ENDTX_R { + pub(crate) fn new(bits: bool) -> Self { + ENDTX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDTX_A { + match self.bits { + false => ENDTX_A::DISABLED, + true => ENDTX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENDTX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENDTX_A::ENABLED + } +} +impl core::ops::Deref for ENDTX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENDTX` writer - Enable or disable interrupt for ENDTX event"] +pub struct ENDTX_W<'a> { + w: &'a mut W, +} +impl<'a> ENDTX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDTX_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENDTX_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENDTX_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Enable or disable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` reader - Enable or disable interrupt for ERROR event"] +pub struct ERROR_R(crate::FieldReader); +impl ERROR_R { + pub(crate) fn new(bits: bool) -> Self { + ERROR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ERROR_A { + match self.bits { + false => ERROR_A::DISABLED, + true => ERROR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ERROR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ERROR_A::ENABLED + } +} +impl core::ops::Deref for ERROR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ERROR` writer - Enable or disable interrupt for ERROR event"] +pub struct ERROR_W<'a> { + w: &'a mut W, +} +impl<'a> ERROR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ERROR_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ERROR_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ERROR_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Enable or disable interrupt for RXTO event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXTO_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXTO_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXTO` reader - Enable or disable interrupt for RXTO event"] +pub struct RXTO_R(crate::FieldReader); +impl RXTO_R { + pub(crate) fn new(bits: bool) -> Self { + RXTO_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXTO_A { + match self.bits { + false => RXTO_A::DISABLED, + true => RXTO_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXTO_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXTO_A::ENABLED + } +} +impl core::ops::Deref for RXTO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RXTO` writer - Enable or disable interrupt for RXTO event"] +pub struct RXTO_W<'a> { + w: &'a mut W, +} +impl<'a> RXTO_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXTO_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(RXTO_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(RXTO_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Enable or disable interrupt for RXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXSTARTED_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXSTARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXSTARTED` reader - Enable or disable interrupt for RXSTARTED event"] +pub struct RXSTARTED_R(crate::FieldReader); +impl RXSTARTED_R { + pub(crate) fn new(bits: bool) -> Self { + RXSTARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXSTARTED_A { + match self.bits { + false => RXSTARTED_A::DISABLED, + true => RXSTARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXSTARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXSTARTED_A::ENABLED + } +} +impl core::ops::Deref for RXSTARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RXSTARTED` writer - Enable or disable interrupt for RXSTARTED event"] +pub struct RXSTARTED_W<'a> { + w: &'a mut W, +} +impl<'a> RXSTARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXSTARTED_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(RXSTARTED_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(RXSTARTED_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Enable or disable interrupt for TXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXSTARTED_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXSTARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXSTARTED` reader - Enable or disable interrupt for TXSTARTED event"] +pub struct TXSTARTED_R(crate::FieldReader); +impl TXSTARTED_R { + pub(crate) fn new(bits: bool) -> Self { + TXSTARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXSTARTED_A { + match self.bits { + false => TXSTARTED_A::DISABLED, + true => TXSTARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXSTARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXSTARTED_A::ENABLED + } +} +impl core::ops::Deref for TXSTARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TXSTARTED` writer - Enable or disable interrupt for TXSTARTED event"] +pub struct TXSTARTED_W<'a> { + w: &'a mut W, +} +impl<'a> TXSTARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXSTARTED_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(TXSTARTED_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(TXSTARTED_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Enable or disable interrupt for TXSTOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXSTOPPED_A { + #[doc = "0: Disable"] + DISABLED = 0, + #[doc = "1: Enable"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXSTOPPED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXSTOPPED` reader - Enable or disable interrupt for TXSTOPPED event"] +pub struct TXSTOPPED_R(crate::FieldReader); +impl TXSTOPPED_R { + pub(crate) fn new(bits: bool) -> Self { + TXSTOPPED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXSTOPPED_A { + match self.bits { + false => TXSTOPPED_A::DISABLED, + true => TXSTOPPED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXSTOPPED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXSTOPPED_A::ENABLED + } +} +impl core::ops::Deref for TXSTOPPED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `TXSTOPPED` writer - Enable or disable interrupt for TXSTOPPED event"] +pub struct TXSTOPPED_W<'a> { + w: &'a mut W, +} +impl<'a> TXSTOPPED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXSTOPPED_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(TXSTOPPED_A::DISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(TXSTOPPED_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable or disable interrupt for CTS event"] + #[inline(always)] + pub fn cts(&self) -> CTS_R { + CTS_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Enable or disable interrupt for NCTS event"] + #[inline(always)] + pub fn ncts(&self) -> NCTS_R { + NCTS_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Enable or disable interrupt for RXDRDY event"] + #[inline(always)] + pub fn rxdrdy(&self) -> RXDRDY_R { + RXDRDY_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 4 - Enable or disable interrupt for ENDRX event"] + #[inline(always)] + pub fn endrx(&self) -> ENDRX_R { + ENDRX_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 7 - Enable or disable interrupt for TXDRDY event"] + #[inline(always)] + pub fn txdrdy(&self) -> TXDRDY_R { + TXDRDY_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Enable or disable interrupt for ENDTX event"] + #[inline(always)] + pub fn endtx(&self) -> ENDTX_R { + ENDTX_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Enable or disable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&self) -> ERROR_R { + ERROR_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 17 - Enable or disable interrupt for RXTO event"] + #[inline(always)] + pub fn rxto(&self) -> RXTO_R { + RXTO_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 19 - Enable or disable interrupt for RXSTARTED event"] + #[inline(always)] + pub fn rxstarted(&self) -> RXSTARTED_R { + RXSTARTED_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Enable or disable interrupt for TXSTARTED event"] + #[inline(always)] + pub fn txstarted(&self) -> TXSTARTED_R { + TXSTARTED_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 22 - Enable or disable interrupt for TXSTOPPED event"] + #[inline(always)] + pub fn txstopped(&self) -> TXSTOPPED_R { + TXSTOPPED_R::new(((self.bits >> 22) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Enable or disable interrupt for CTS event"] + #[inline(always)] + pub fn cts(&mut self) -> CTS_W { + CTS_W { w: self } + } + #[doc = "Bit 1 - Enable or disable interrupt for NCTS event"] + #[inline(always)] + pub fn ncts(&mut self) -> NCTS_W { + NCTS_W { w: self } + } + #[doc = "Bit 2 - Enable or disable interrupt for RXDRDY event"] + #[inline(always)] + pub fn rxdrdy(&mut self) -> RXDRDY_W { + RXDRDY_W { w: self } + } + #[doc = "Bit 4 - Enable or disable interrupt for ENDRX event"] + #[inline(always)] + pub fn endrx(&mut self) -> ENDRX_W { + ENDRX_W { w: self } + } + #[doc = "Bit 7 - Enable or disable interrupt for TXDRDY event"] + #[inline(always)] + pub fn txdrdy(&mut self) -> TXDRDY_W { + TXDRDY_W { w: self } + } + #[doc = "Bit 8 - Enable or disable interrupt for ENDTX event"] + #[inline(always)] + pub fn endtx(&mut self) -> ENDTX_W { + ENDTX_W { w: self } + } + #[doc = "Bit 9 - Enable or disable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&mut self) -> ERROR_W { + ERROR_W { w: self } + } + #[doc = "Bit 17 - Enable or disable interrupt for RXTO event"] + #[inline(always)] + pub fn rxto(&mut self) -> RXTO_W { + RXTO_W { w: self } + } + #[doc = "Bit 19 - Enable or disable interrupt for RXSTARTED event"] + #[inline(always)] + pub fn rxstarted(&mut self) -> RXSTARTED_W { + RXSTARTED_W { w: self } + } + #[doc = "Bit 20 - Enable or disable interrupt for TXSTARTED event"] + #[inline(always)] + pub fn txstarted(&mut self) -> TXSTARTED_W { + TXSTARTED_W { w: self } + } + #[doc = "Bit 22 - Enable or disable interrupt for TXSTOPPED event"] + #[inline(always)] + pub fn txstopped(&mut self) -> TXSTOPPED_W { + TXSTOPPED_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable or disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [inten](index.html) module"] +pub struct INTEN_SPEC; +impl crate::RegisterSpec for INTEN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [inten::R](R) reader structure"] +impl crate::Readable for INTEN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [inten::W](W) writer structure"] +impl crate::Writable for INTEN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTEN to value 0"] +impl crate::Resettable for INTEN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/intenclr.rs b/src/uarte0/intenclr.rs new file mode 100644 index 0000000..687a884 --- /dev/null +++ b/src/uarte0/intenclr.rs @@ -0,0 +1,1166 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for CTS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CTS_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CTS_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CTS` reader - Write '1' to Disable interrupt for CTS event"] +pub struct CTS_R(crate::FieldReader); +impl CTS_R { + pub(crate) fn new(bits: bool) -> Self { + CTS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CTS_A { + match self.bits { + false => CTS_A::DISABLED, + true => CTS_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CTS_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CTS_A::ENABLED + } +} +impl core::ops::Deref for CTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for CTS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CTS_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CTS_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CTS` writer - Write '1' to Disable interrupt for CTS event"] +pub struct CTS_W<'a> { + w: &'a mut W, +} +impl<'a> CTS_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CTS_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(CTS_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for NCTS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum NCTS_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: NCTS_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `NCTS` reader - Write '1' to Disable interrupt for NCTS event"] +pub struct NCTS_R(crate::FieldReader); +impl NCTS_R { + pub(crate) fn new(bits: bool) -> Self { + NCTS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> NCTS_A { + match self.bits { + false => NCTS_A::DISABLED, + true => NCTS_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == NCTS_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == NCTS_A::ENABLED + } +} +impl core::ops::Deref for NCTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for NCTS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum NCTS_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: NCTS_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `NCTS` writer - Write '1' to Disable interrupt for NCTS event"] +pub struct NCTS_W<'a> { + w: &'a mut W, +} +impl<'a> NCTS_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: NCTS_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(NCTS_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for RXDRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXDRDY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXDRDY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXDRDY` reader - Write '1' to Disable interrupt for RXDRDY event"] +pub struct RXDRDY_R(crate::FieldReader); +impl RXDRDY_R { + pub(crate) fn new(bits: bool) -> Self { + RXDRDY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXDRDY_A { + match self.bits { + false => RXDRDY_A::DISABLED, + true => RXDRDY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXDRDY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXDRDY_A::ENABLED + } +} +impl core::ops::Deref for RXDRDY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for RXDRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXDRDY_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXDRDY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXDRDY` writer - Write '1' to Disable interrupt for RXDRDY event"] +pub struct RXDRDY_W<'a> { + w: &'a mut W, +} +impl<'a> RXDRDY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXDRDY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(RXDRDY_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for ENDRX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDRX_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDRX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDRX` reader - Write '1' to Disable interrupt for ENDRX event"] +pub struct ENDRX_R(crate::FieldReader); +impl ENDRX_R { + pub(crate) fn new(bits: bool) -> Self { + ENDRX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDRX_A { + match self.bits { + false => ENDRX_A::DISABLED, + true => ENDRX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENDRX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENDRX_A::ENABLED + } +} +impl core::ops::Deref for ENDRX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for ENDRX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDRX_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDRX_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDRX` writer - Write '1' to Disable interrupt for ENDRX event"] +pub struct ENDRX_W<'a> { + w: &'a mut W, +} +impl<'a> ENDRX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDRX_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(ENDRX_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for TXDRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXDRDY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXDRDY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXDRDY` reader - Write '1' to Disable interrupt for TXDRDY event"] +pub struct TXDRDY_R(crate::FieldReader); +impl TXDRDY_R { + pub(crate) fn new(bits: bool) -> Self { + TXDRDY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXDRDY_A { + match self.bits { + false => TXDRDY_A::DISABLED, + true => TXDRDY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXDRDY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXDRDY_A::ENABLED + } +} +impl core::ops::Deref for TXDRDY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TXDRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXDRDY_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXDRDY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXDRDY` writer - Write '1' to Disable interrupt for TXDRDY event"] +pub struct TXDRDY_W<'a> { + w: &'a mut W, +} +impl<'a> TXDRDY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXDRDY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TXDRDY_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for ENDTX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDTX_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDTX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDTX` reader - Write '1' to Disable interrupt for ENDTX event"] +pub struct ENDTX_R(crate::FieldReader); +impl ENDTX_R { + pub(crate) fn new(bits: bool) -> Self { + ENDTX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDTX_A { + match self.bits { + false => ENDTX_A::DISABLED, + true => ENDTX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENDTX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENDTX_A::ENABLED + } +} +impl core::ops::Deref for ENDTX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for ENDTX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDTX_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDTX_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDTX` writer - Write '1' to Disable interrupt for ENDTX event"] +pub struct ENDTX_W<'a> { + w: &'a mut W, +} +impl<'a> ENDTX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDTX_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(ENDTX_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` reader - Write '1' to Disable interrupt for ERROR event"] +pub struct ERROR_R(crate::FieldReader); +impl ERROR_R { + pub(crate) fn new(bits: bool) -> Self { + ERROR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ERROR_A { + match self.bits { + false => ERROR_A::DISABLED, + true => ERROR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ERROR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ERROR_A::ENABLED + } +} +impl core::ops::Deref for ERROR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` writer - Write '1' to Disable interrupt for ERROR event"] +pub struct ERROR_W<'a> { + w: &'a mut W, +} +impl<'a> ERROR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ERROR_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(ERROR_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for RXTO event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXTO_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXTO_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXTO` reader - Write '1' to Disable interrupt for RXTO event"] +pub struct RXTO_R(crate::FieldReader); +impl RXTO_R { + pub(crate) fn new(bits: bool) -> Self { + RXTO_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXTO_A { + match self.bits { + false => RXTO_A::DISABLED, + true => RXTO_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXTO_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXTO_A::ENABLED + } +} +impl core::ops::Deref for RXTO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for RXTO event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXTO_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXTO_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXTO` writer - Write '1' to Disable interrupt for RXTO event"] +pub struct RXTO_W<'a> { + w: &'a mut W, +} +impl<'a> RXTO_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXTO_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(RXTO_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for RXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXSTARTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXSTARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXSTARTED` reader - Write '1' to Disable interrupt for RXSTARTED event"] +pub struct RXSTARTED_R(crate::FieldReader); +impl RXSTARTED_R { + pub(crate) fn new(bits: bool) -> Self { + RXSTARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXSTARTED_A { + match self.bits { + false => RXSTARTED_A::DISABLED, + true => RXSTARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXSTARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXSTARTED_A::ENABLED + } +} +impl core::ops::Deref for RXSTARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for RXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXSTARTED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXSTARTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXSTARTED` writer - Write '1' to Disable interrupt for RXSTARTED event"] +pub struct RXSTARTED_W<'a> { + w: &'a mut W, +} +impl<'a> RXSTARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXSTARTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(RXSTARTED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for TXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXSTARTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXSTARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXSTARTED` reader - Write '1' to Disable interrupt for TXSTARTED event"] +pub struct TXSTARTED_R(crate::FieldReader); +impl TXSTARTED_R { + pub(crate) fn new(bits: bool) -> Self { + TXSTARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXSTARTED_A { + match self.bits { + false => TXSTARTED_A::DISABLED, + true => TXSTARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXSTARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXSTARTED_A::ENABLED + } +} +impl core::ops::Deref for TXSTARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXSTARTED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXSTARTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXSTARTED` writer - Write '1' to Disable interrupt for TXSTARTED event"] +pub struct TXSTARTED_W<'a> { + w: &'a mut W, +} +impl<'a> TXSTARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXSTARTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TXSTARTED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Write '1' to Disable interrupt for TXSTOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXSTOPPED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXSTOPPED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXSTOPPED` reader - Write '1' to Disable interrupt for TXSTOPPED event"] +pub struct TXSTOPPED_R(crate::FieldReader); +impl TXSTOPPED_R { + pub(crate) fn new(bits: bool) -> Self { + TXSTOPPED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXSTOPPED_A { + match self.bits { + false => TXSTOPPED_A::DISABLED, + true => TXSTOPPED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXSTOPPED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXSTOPPED_A::ENABLED + } +} +impl core::ops::Deref for TXSTOPPED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TXSTOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXSTOPPED_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXSTOPPED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXSTOPPED` writer - Write '1' to Disable interrupt for TXSTOPPED event"] +pub struct TXSTOPPED_W<'a> { + w: &'a mut W, +} +impl<'a> TXSTOPPED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXSTOPPED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TXSTOPPED_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Disable interrupt for CTS event"] + #[inline(always)] + pub fn cts(&self) -> CTS_R { + CTS_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for NCTS event"] + #[inline(always)] + pub fn ncts(&self) -> NCTS_R { + NCTS_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for RXDRDY event"] + #[inline(always)] + pub fn rxdrdy(&self) -> RXDRDY_R { + RXDRDY_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 4 - Write '1' to Disable interrupt for ENDRX event"] + #[inline(always)] + pub fn endrx(&self) -> ENDRX_R { + ENDRX_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 7 - Write '1' to Disable interrupt for TXDRDY event"] + #[inline(always)] + pub fn txdrdy(&self) -> TXDRDY_R { + TXDRDY_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Write '1' to Disable interrupt for ENDTX event"] + #[inline(always)] + pub fn endtx(&self) -> ENDTX_R { + ENDTX_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Write '1' to Disable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&self) -> ERROR_R { + ERROR_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 17 - Write '1' to Disable interrupt for RXTO event"] + #[inline(always)] + pub fn rxto(&self) -> RXTO_R { + RXTO_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 19 - Write '1' to Disable interrupt for RXSTARTED event"] + #[inline(always)] + pub fn rxstarted(&self) -> RXSTARTED_R { + RXSTARTED_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Write '1' to Disable interrupt for TXSTARTED event"] + #[inline(always)] + pub fn txstarted(&self) -> TXSTARTED_R { + TXSTARTED_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 22 - Write '1' to Disable interrupt for TXSTOPPED event"] + #[inline(always)] + pub fn txstopped(&self) -> TXSTOPPED_R { + TXSTOPPED_R::new(((self.bits >> 22) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Disable interrupt for CTS event"] + #[inline(always)] + pub fn cts(&mut self) -> CTS_W { + CTS_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Disable interrupt for NCTS event"] + #[inline(always)] + pub fn ncts(&mut self) -> NCTS_W { + NCTS_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Disable interrupt for RXDRDY event"] + #[inline(always)] + pub fn rxdrdy(&mut self) -> RXDRDY_W { + RXDRDY_W { w: self } + } + #[doc = "Bit 4 - Write '1' to Disable interrupt for ENDRX event"] + #[inline(always)] + pub fn endrx(&mut self) -> ENDRX_W { + ENDRX_W { w: self } + } + #[doc = "Bit 7 - Write '1' to Disable interrupt for TXDRDY event"] + #[inline(always)] + pub fn txdrdy(&mut self) -> TXDRDY_W { + TXDRDY_W { w: self } + } + #[doc = "Bit 8 - Write '1' to Disable interrupt for ENDTX event"] + #[inline(always)] + pub fn endtx(&mut self) -> ENDTX_W { + ENDTX_W { w: self } + } + #[doc = "Bit 9 - Write '1' to Disable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&mut self) -> ERROR_W { + ERROR_W { w: self } + } + #[doc = "Bit 17 - Write '1' to Disable interrupt for RXTO event"] + #[inline(always)] + pub fn rxto(&mut self) -> RXTO_W { + RXTO_W { w: self } + } + #[doc = "Bit 19 - Write '1' to Disable interrupt for RXSTARTED event"] + #[inline(always)] + pub fn rxstarted(&mut self) -> RXSTARTED_W { + RXSTARTED_W { w: self } + } + #[doc = "Bit 20 - Write '1' to Disable interrupt for TXSTARTED event"] + #[inline(always)] + pub fn txstarted(&mut self) -> TXSTARTED_W { + TXSTARTED_W { w: self } + } + #[doc = "Bit 22 - Write '1' to Disable interrupt for TXSTOPPED event"] + #[inline(always)] + pub fn txstopped(&mut self) -> TXSTOPPED_W { + TXSTOPPED_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/intenset.rs b/src/uarte0/intenset.rs new file mode 100644 index 0000000..d581b85 --- /dev/null +++ b/src/uarte0/intenset.rs @@ -0,0 +1,1166 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for CTS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CTS_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CTS_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CTS` reader - Write '1' to Enable interrupt for CTS event"] +pub struct CTS_R(crate::FieldReader); +impl CTS_R { + pub(crate) fn new(bits: bool) -> Self { + CTS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CTS_A { + match self.bits { + false => CTS_A::DISABLED, + true => CTS_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == CTS_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == CTS_A::ENABLED + } +} +impl core::ops::Deref for CTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for CTS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CTS_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: CTS_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CTS` writer - Write '1' to Enable interrupt for CTS event"] +pub struct CTS_W<'a> { + w: &'a mut W, +} +impl<'a> CTS_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CTS_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(CTS_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for NCTS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum NCTS_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: NCTS_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `NCTS` reader - Write '1' to Enable interrupt for NCTS event"] +pub struct NCTS_R(crate::FieldReader); +impl NCTS_R { + pub(crate) fn new(bits: bool) -> Self { + NCTS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> NCTS_A { + match self.bits { + false => NCTS_A::DISABLED, + true => NCTS_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == NCTS_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == NCTS_A::ENABLED + } +} +impl core::ops::Deref for NCTS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for NCTS event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum NCTS_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: NCTS_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `NCTS` writer - Write '1' to Enable interrupt for NCTS event"] +pub struct NCTS_W<'a> { + w: &'a mut W, +} +impl<'a> NCTS_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: NCTS_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(NCTS_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for RXDRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXDRDY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXDRDY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXDRDY` reader - Write '1' to Enable interrupt for RXDRDY event"] +pub struct RXDRDY_R(crate::FieldReader); +impl RXDRDY_R { + pub(crate) fn new(bits: bool) -> Self { + RXDRDY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXDRDY_A { + match self.bits { + false => RXDRDY_A::DISABLED, + true => RXDRDY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXDRDY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXDRDY_A::ENABLED + } +} +impl core::ops::Deref for RXDRDY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for RXDRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXDRDY_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXDRDY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXDRDY` writer - Write '1' to Enable interrupt for RXDRDY event"] +pub struct RXDRDY_W<'a> { + w: &'a mut W, +} +impl<'a> RXDRDY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXDRDY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(RXDRDY_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for ENDRX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDRX_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDRX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDRX` reader - Write '1' to Enable interrupt for ENDRX event"] +pub struct ENDRX_R(crate::FieldReader); +impl ENDRX_R { + pub(crate) fn new(bits: bool) -> Self { + ENDRX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDRX_A { + match self.bits { + false => ENDRX_A::DISABLED, + true => ENDRX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENDRX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENDRX_A::ENABLED + } +} +impl core::ops::Deref for ENDRX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for ENDRX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDRX_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDRX_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDRX` writer - Write '1' to Enable interrupt for ENDRX event"] +pub struct ENDRX_W<'a> { + w: &'a mut W, +} +impl<'a> ENDRX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDRX_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(ENDRX_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for TXDRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXDRDY_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXDRDY_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXDRDY` reader - Write '1' to Enable interrupt for TXDRDY event"] +pub struct TXDRDY_R(crate::FieldReader); +impl TXDRDY_R { + pub(crate) fn new(bits: bool) -> Self { + TXDRDY_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXDRDY_A { + match self.bits { + false => TXDRDY_A::DISABLED, + true => TXDRDY_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXDRDY_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXDRDY_A::ENABLED + } +} +impl core::ops::Deref for TXDRDY_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TXDRDY event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXDRDY_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXDRDY_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXDRDY` writer - Write '1' to Enable interrupt for TXDRDY event"] +pub struct TXDRDY_W<'a> { + w: &'a mut W, +} +impl<'a> TXDRDY_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXDRDY_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TXDRDY_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for ENDTX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDTX_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDTX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDTX` reader - Write '1' to Enable interrupt for ENDTX event"] +pub struct ENDTX_R(crate::FieldReader); +impl ENDTX_R { + pub(crate) fn new(bits: bool) -> Self { + ENDTX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDTX_A { + match self.bits { + false => ENDTX_A::DISABLED, + true => ENDTX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENDTX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENDTX_A::ENABLED + } +} +impl core::ops::Deref for ENDTX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for ENDTX event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDTX_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDTX_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDTX` writer - Write '1' to Enable interrupt for ENDTX event"] +pub struct ENDTX_W<'a> { + w: &'a mut W, +} +impl<'a> ENDTX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDTX_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(ENDTX_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 8)) | ((value as u32 & 0x01) << 8); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` reader - Write '1' to Enable interrupt for ERROR event"] +pub struct ERROR_R(crate::FieldReader); +impl ERROR_R { + pub(crate) fn new(bits: bool) -> Self { + ERROR_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ERROR_A { + match self.bits { + false => ERROR_A::DISABLED, + true => ERROR_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ERROR_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ERROR_A::ENABLED + } +} +impl core::ops::Deref for ERROR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for ERROR event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ERROR_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ERROR_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ERROR` writer - Write '1' to Enable interrupt for ERROR event"] +pub struct ERROR_W<'a> { + w: &'a mut W, +} +impl<'a> ERROR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ERROR_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(ERROR_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 9)) | ((value as u32 & 0x01) << 9); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for RXTO event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXTO_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXTO_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXTO` reader - Write '1' to Enable interrupt for RXTO event"] +pub struct RXTO_R(crate::FieldReader); +impl RXTO_R { + pub(crate) fn new(bits: bool) -> Self { + RXTO_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXTO_A { + match self.bits { + false => RXTO_A::DISABLED, + true => RXTO_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXTO_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXTO_A::ENABLED + } +} +impl core::ops::Deref for RXTO_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for RXTO event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXTO_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXTO_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXTO` writer - Write '1' to Enable interrupt for RXTO event"] +pub struct RXTO_W<'a> { + w: &'a mut W, +} +impl<'a> RXTO_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXTO_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(RXTO_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 17)) | ((value as u32 & 0x01) << 17); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for RXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXSTARTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXSTARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXSTARTED` reader - Write '1' to Enable interrupt for RXSTARTED event"] +pub struct RXSTARTED_R(crate::FieldReader); +impl RXSTARTED_R { + pub(crate) fn new(bits: bool) -> Self { + RXSTARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RXSTARTED_A { + match self.bits { + false => RXSTARTED_A::DISABLED, + true => RXSTARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RXSTARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RXSTARTED_A::ENABLED + } +} +impl core::ops::Deref for RXSTARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for RXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RXSTARTED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RXSTARTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RXSTARTED` writer - Write '1' to Enable interrupt for RXSTARTED event"] +pub struct RXSTARTED_W<'a> { + w: &'a mut W, +} +impl<'a> RXSTARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RXSTARTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(RXSTARTED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 19)) | ((value as u32 & 0x01) << 19); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for TXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXSTARTED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXSTARTED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXSTARTED` reader - Write '1' to Enable interrupt for TXSTARTED event"] +pub struct TXSTARTED_R(crate::FieldReader); +impl TXSTARTED_R { + pub(crate) fn new(bits: bool) -> Self { + TXSTARTED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXSTARTED_A { + match self.bits { + false => TXSTARTED_A::DISABLED, + true => TXSTARTED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXSTARTED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXSTARTED_A::ENABLED + } +} +impl core::ops::Deref for TXSTARTED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TXSTARTED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXSTARTED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXSTARTED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXSTARTED` writer - Write '1' to Enable interrupt for TXSTARTED event"] +pub struct TXSTARTED_W<'a> { + w: &'a mut W, +} +impl<'a> TXSTARTED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXSTARTED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TXSTARTED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20); + self.w + } +} +#[doc = "Write '1' to Enable interrupt for TXSTOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXSTOPPED_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXSTOPPED_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXSTOPPED` reader - Write '1' to Enable interrupt for TXSTOPPED event"] +pub struct TXSTOPPED_R(crate::FieldReader); +impl TXSTOPPED_R { + pub(crate) fn new(bits: bool) -> Self { + TXSTOPPED_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TXSTOPPED_A { + match self.bits { + false => TXSTOPPED_A::DISABLED, + true => TXSTOPPED_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TXSTOPPED_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TXSTOPPED_A::ENABLED + } +} +impl core::ops::Deref for TXSTOPPED_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TXSTOPPED event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TXSTOPPED_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TXSTOPPED_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TXSTOPPED` writer - Write '1' to Enable interrupt for TXSTOPPED event"] +pub struct TXSTOPPED_W<'a> { + w: &'a mut W, +} +impl<'a> TXSTOPPED_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TXSTOPPED_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TXSTOPPED_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 22)) | ((value as u32 & 0x01) << 22); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Enable interrupt for CTS event"] + #[inline(always)] + pub fn cts(&self) -> CTS_R { + CTS_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for NCTS event"] + #[inline(always)] + pub fn ncts(&self) -> NCTS_R { + NCTS_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for RXDRDY event"] + #[inline(always)] + pub fn rxdrdy(&self) -> RXDRDY_R { + RXDRDY_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 4 - Write '1' to Enable interrupt for ENDRX event"] + #[inline(always)] + pub fn endrx(&self) -> ENDRX_R { + ENDRX_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 7 - Write '1' to Enable interrupt for TXDRDY event"] + #[inline(always)] + pub fn txdrdy(&self) -> TXDRDY_R { + TXDRDY_R::new(((self.bits >> 7) & 0x01) != 0) + } + #[doc = "Bit 8 - Write '1' to Enable interrupt for ENDTX event"] + #[inline(always)] + pub fn endtx(&self) -> ENDTX_R { + ENDTX_R::new(((self.bits >> 8) & 0x01) != 0) + } + #[doc = "Bit 9 - Write '1' to Enable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&self) -> ERROR_R { + ERROR_R::new(((self.bits >> 9) & 0x01) != 0) + } + #[doc = "Bit 17 - Write '1' to Enable interrupt for RXTO event"] + #[inline(always)] + pub fn rxto(&self) -> RXTO_R { + RXTO_R::new(((self.bits >> 17) & 0x01) != 0) + } + #[doc = "Bit 19 - Write '1' to Enable interrupt for RXSTARTED event"] + #[inline(always)] + pub fn rxstarted(&self) -> RXSTARTED_R { + RXSTARTED_R::new(((self.bits >> 19) & 0x01) != 0) + } + #[doc = "Bit 20 - Write '1' to Enable interrupt for TXSTARTED event"] + #[inline(always)] + pub fn txstarted(&self) -> TXSTARTED_R { + TXSTARTED_R::new(((self.bits >> 20) & 0x01) != 0) + } + #[doc = "Bit 22 - Write '1' to Enable interrupt for TXSTOPPED event"] + #[inline(always)] + pub fn txstopped(&self) -> TXSTOPPED_R { + TXSTOPPED_R::new(((self.bits >> 22) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Enable interrupt for CTS event"] + #[inline(always)] + pub fn cts(&mut self) -> CTS_W { + CTS_W { w: self } + } + #[doc = "Bit 1 - Write '1' to Enable interrupt for NCTS event"] + #[inline(always)] + pub fn ncts(&mut self) -> NCTS_W { + NCTS_W { w: self } + } + #[doc = "Bit 2 - Write '1' to Enable interrupt for RXDRDY event"] + #[inline(always)] + pub fn rxdrdy(&mut self) -> RXDRDY_W { + RXDRDY_W { w: self } + } + #[doc = "Bit 4 - Write '1' to Enable interrupt for ENDRX event"] + #[inline(always)] + pub fn endrx(&mut self) -> ENDRX_W { + ENDRX_W { w: self } + } + #[doc = "Bit 7 - Write '1' to Enable interrupt for TXDRDY event"] + #[inline(always)] + pub fn txdrdy(&mut self) -> TXDRDY_W { + TXDRDY_W { w: self } + } + #[doc = "Bit 8 - Write '1' to Enable interrupt for ENDTX event"] + #[inline(always)] + pub fn endtx(&mut self) -> ENDTX_W { + ENDTX_W { w: self } + } + #[doc = "Bit 9 - Write '1' to Enable interrupt for ERROR event"] + #[inline(always)] + pub fn error(&mut self) -> ERROR_W { + ERROR_W { w: self } + } + #[doc = "Bit 17 - Write '1' to Enable interrupt for RXTO event"] + #[inline(always)] + pub fn rxto(&mut self) -> RXTO_W { + RXTO_W { w: self } + } + #[doc = "Bit 19 - Write '1' to Enable interrupt for RXSTARTED event"] + #[inline(always)] + pub fn rxstarted(&mut self) -> RXSTARTED_W { + RXSTARTED_W { w: self } + } + #[doc = "Bit 20 - Write '1' to Enable interrupt for TXSTARTED event"] + #[inline(always)] + pub fn txstarted(&mut self) -> TXSTARTED_W { + TXSTARTED_W { w: self } + } + #[doc = "Bit 22 - Write '1' to Enable interrupt for TXSTOPPED event"] + #[inline(always)] + pub fn txstopped(&mut self) -> TXSTOPPED_W { + TXSTOPPED_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/psel.rs b/src/uarte0/psel.rs new file mode 100644 index 0000000..76a0970 --- /dev/null +++ b/src/uarte0/psel.rs @@ -0,0 +1,16 @@ +#[doc = "RTS register accessor: an alias for `Reg`"] +pub type RTS = crate::Reg; +#[doc = "Pin select for RTS signal"] +pub mod rts; +#[doc = "TXD register accessor: an alias for `Reg`"] +pub type TXD = crate::Reg; +#[doc = "Pin select for TXD signal"] +pub mod txd; +#[doc = "CTS register accessor: an alias for `Reg`"] +pub type CTS = crate::Reg; +#[doc = "Pin select for CTS signal"] +pub mod cts; +#[doc = "RXD register accessor: an alias for `Reg`"] +pub type RXD = crate::Reg; +#[doc = "Pin select for RXD signal"] +pub mod rxd; diff --git a/src/uarte0/psel/cts.rs b/src/uarte0/psel/cts.rs new file mode 100644 index 0000000..9bef641 --- /dev/null +++ b/src/uarte0/psel/cts.rs @@ -0,0 +1,195 @@ +#[doc = "Register `CTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CTS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PIN` reader - Pin number"] +pub struct PIN_R(crate::FieldReader); +impl PIN_R { + pub(crate) fn new(bits: u8) -> Self { + PIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN` writer - Pin number"] +pub struct PIN_W<'a> { + w: &'a mut W, +} +impl<'a> PIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Connection\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CONNECT_A { + #[doc = "1: Disconnect"] + DISCONNECTED = 1, + #[doc = "0: Connect"] + CONNECTED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: CONNECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CONNECT` reader - Connection"] +pub struct CONNECT_R(crate::FieldReader); +impl CONNECT_R { + pub(crate) fn new(bits: bool) -> Self { + CONNECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CONNECT_A { + match self.bits { + true => CONNECT_A::DISCONNECTED, + false => CONNECT_A::CONNECTED, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == CONNECT_A::DISCONNECTED + } + #[doc = "Checks if the value of the field is `CONNECTED`"] + #[inline(always)] + pub fn is_connected(&self) -> bool { + **self == CONNECT_A::CONNECTED + } +} +impl core::ops::Deref for CONNECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONNECT` writer - Connection"] +pub struct CONNECT_W<'a> { + w: &'a mut W, +} +impl<'a> CONNECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CONNECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(CONNECT_A::DISCONNECTED) + } + #[doc = "Connect"] + #[inline(always)] + pub fn connected(self) -> &'a mut W { + self.variant(CONNECT_A::CONNECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&self) -> PIN_R { + PIN_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&self) -> CONNECT_R { + CONNECT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&mut self) -> PIN_W { + PIN_W { w: self } + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&mut self) -> CONNECT_W { + CONNECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for CTS signal\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cts](index.html) module"] +pub struct CTS_SPEC; +impl crate::RegisterSpec for CTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [cts::R](R) reader structure"] +impl crate::Readable for CTS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [cts::W](W) writer structure"] +impl crate::Writable for CTS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CTS to value 0xffff_ffff"] +impl crate::Resettable for CTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/uarte0/psel/rts.rs b/src/uarte0/psel/rts.rs new file mode 100644 index 0000000..61b3e7a --- /dev/null +++ b/src/uarte0/psel/rts.rs @@ -0,0 +1,195 @@ +#[doc = "Register `RTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `RTS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PIN` reader - Pin number"] +pub struct PIN_R(crate::FieldReader); +impl PIN_R { + pub(crate) fn new(bits: u8) -> Self { + PIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN` writer - Pin number"] +pub struct PIN_W<'a> { + w: &'a mut W, +} +impl<'a> PIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Connection\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CONNECT_A { + #[doc = "1: Disconnect"] + DISCONNECTED = 1, + #[doc = "0: Connect"] + CONNECTED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: CONNECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CONNECT` reader - Connection"] +pub struct CONNECT_R(crate::FieldReader); +impl CONNECT_R { + pub(crate) fn new(bits: bool) -> Self { + CONNECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CONNECT_A { + match self.bits { + true => CONNECT_A::DISCONNECTED, + false => CONNECT_A::CONNECTED, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == CONNECT_A::DISCONNECTED + } + #[doc = "Checks if the value of the field is `CONNECTED`"] + #[inline(always)] + pub fn is_connected(&self) -> bool { + **self == CONNECT_A::CONNECTED + } +} +impl core::ops::Deref for CONNECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONNECT` writer - Connection"] +pub struct CONNECT_W<'a> { + w: &'a mut W, +} +impl<'a> CONNECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CONNECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(CONNECT_A::DISCONNECTED) + } + #[doc = "Connect"] + #[inline(always)] + pub fn connected(self) -> &'a mut W { + self.variant(CONNECT_A::CONNECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&self) -> PIN_R { + PIN_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&self) -> CONNECT_R { + CONNECT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&mut self) -> PIN_W { + PIN_W { w: self } + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&mut self) -> CONNECT_W { + CONNECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for RTS signal\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rts](index.html) module"] +pub struct RTS_SPEC; +impl crate::RegisterSpec for RTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rts::R](R) reader structure"] +impl crate::Readable for RTS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [rts::W](W) writer structure"] +impl crate::Writable for RTS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets RTS to value 0xffff_ffff"] +impl crate::Resettable for RTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/uarte0/psel/rxd.rs b/src/uarte0/psel/rxd.rs new file mode 100644 index 0000000..e51482a --- /dev/null +++ b/src/uarte0/psel/rxd.rs @@ -0,0 +1,195 @@ +#[doc = "Register `RXD` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `RXD` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PIN` reader - Pin number"] +pub struct PIN_R(crate::FieldReader); +impl PIN_R { + pub(crate) fn new(bits: u8) -> Self { + PIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN` writer - Pin number"] +pub struct PIN_W<'a> { + w: &'a mut W, +} +impl<'a> PIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Connection\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CONNECT_A { + #[doc = "1: Disconnect"] + DISCONNECTED = 1, + #[doc = "0: Connect"] + CONNECTED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: CONNECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CONNECT` reader - Connection"] +pub struct CONNECT_R(crate::FieldReader); +impl CONNECT_R { + pub(crate) fn new(bits: bool) -> Self { + CONNECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CONNECT_A { + match self.bits { + true => CONNECT_A::DISCONNECTED, + false => CONNECT_A::CONNECTED, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == CONNECT_A::DISCONNECTED + } + #[doc = "Checks if the value of the field is `CONNECTED`"] + #[inline(always)] + pub fn is_connected(&self) -> bool { + **self == CONNECT_A::CONNECTED + } +} +impl core::ops::Deref for CONNECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONNECT` writer - Connection"] +pub struct CONNECT_W<'a> { + w: &'a mut W, +} +impl<'a> CONNECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CONNECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(CONNECT_A::DISCONNECTED) + } + #[doc = "Connect"] + #[inline(always)] + pub fn connected(self) -> &'a mut W { + self.variant(CONNECT_A::CONNECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&self) -> PIN_R { + PIN_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&self) -> CONNECT_R { + CONNECT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&mut self) -> PIN_W { + PIN_W { w: self } + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&mut self) -> CONNECT_W { + CONNECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for RXD signal\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rxd](index.html) module"] +pub struct RXD_SPEC; +impl crate::RegisterSpec for RXD_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rxd::R](R) reader structure"] +impl crate::Readable for RXD_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [rxd::W](W) writer structure"] +impl crate::Writable for RXD_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets RXD to value 0xffff_ffff"] +impl crate::Resettable for RXD_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/uarte0/psel/txd.rs b/src/uarte0/psel/txd.rs new file mode 100644 index 0000000..844467a --- /dev/null +++ b/src/uarte0/psel/txd.rs @@ -0,0 +1,195 @@ +#[doc = "Register `TXD` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `TXD` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PIN` reader - Pin number"] +pub struct PIN_R(crate::FieldReader); +impl PIN_R { + pub(crate) fn new(bits: u8) -> Self { + PIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN` writer - Pin number"] +pub struct PIN_W<'a> { + w: &'a mut W, +} +impl<'a> PIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x1f) | (value as u32 & 0x1f); + self.w + } +} +#[doc = "Connection\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CONNECT_A { + #[doc = "1: Disconnect"] + DISCONNECTED = 1, + #[doc = "0: Connect"] + CONNECTED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: CONNECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CONNECT` reader - Connection"] +pub struct CONNECT_R(crate::FieldReader); +impl CONNECT_R { + pub(crate) fn new(bits: bool) -> Self { + CONNECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CONNECT_A { + match self.bits { + true => CONNECT_A::DISCONNECTED, + false => CONNECT_A::CONNECTED, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == CONNECT_A::DISCONNECTED + } + #[doc = "Checks if the value of the field is `CONNECTED`"] + #[inline(always)] + pub fn is_connected(&self) -> bool { + **self == CONNECT_A::CONNECTED + } +} +impl core::ops::Deref for CONNECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONNECT` writer - Connection"] +pub struct CONNECT_W<'a> { + w: &'a mut W, +} +impl<'a> CONNECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CONNECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(CONNECT_A::DISCONNECTED) + } + #[doc = "Connect"] + #[inline(always)] + pub fn connected(self) -> &'a mut W { + self.variant(CONNECT_A::CONNECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&self) -> PIN_R { + PIN_R::new((self.bits & 0x1f) as u8) + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&self) -> CONNECT_R { + CONNECT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:4 - Pin number"] + #[inline(always)] + pub fn pin(&mut self) -> PIN_W { + PIN_W { w: self } + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&mut self) -> CONNECT_W { + CONNECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Pin select for TXD signal\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [txd](index.html) module"] +pub struct TXD_SPEC; +impl crate::RegisterSpec for TXD_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [txd::R](R) reader structure"] +impl crate::Readable for TXD_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [txd::W](W) writer structure"] +impl crate::Writable for TXD_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TXD to value 0xffff_ffff"] +impl crate::Resettable for TXD_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/uarte0/rxd.rs b/src/uarte0/rxd.rs new file mode 100644 index 0000000..aeef5f8 --- /dev/null +++ b/src/uarte0/rxd.rs @@ -0,0 +1,12 @@ +#[doc = "PTR register accessor: an alias for `Reg`"] +pub type PTR = crate::Reg; +#[doc = "Data pointer"] +pub mod ptr; +#[doc = "MAXCNT register accessor: an alias for `Reg`"] +pub type MAXCNT = crate::Reg; +#[doc = "Maximum number of bytes in receive buffer"] +pub mod maxcnt; +#[doc = "AMOUNT register accessor: an alias for `Reg`"] +pub type AMOUNT = crate::Reg; +#[doc = "Number of bytes transferred in the last transaction"] +pub mod amount; diff --git a/src/uarte0/rxd/amount.rs b/src/uarte0/rxd/amount.rs new file mode 100644 index 0000000..6e7cc9c --- /dev/null +++ b/src/uarte0/rxd/amount.rs @@ -0,0 +1,52 @@ +#[doc = "Register `AMOUNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `AMOUNT` reader - Number of bytes transferred in the last transaction"] +pub struct AMOUNT_R(crate::FieldReader); +impl AMOUNT_R { + pub(crate) fn new(bits: u8) -> Self { + AMOUNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AMOUNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:7 - Number of bytes transferred in the last transaction"] + #[inline(always)] + pub fn amount(&self) -> AMOUNT_R { + AMOUNT_R::new((self.bits & 0xff) as u8) + } +} +#[doc = "Number of bytes transferred in the last transaction\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 [amount](index.html) module"] +pub struct AMOUNT_SPEC; +impl crate::RegisterSpec for AMOUNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [amount::R](R) reader structure"] +impl crate::Readable for AMOUNT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets AMOUNT to value 0"] +impl crate::Resettable for AMOUNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/rxd/maxcnt.rs b/src/uarte0/rxd/maxcnt.rs new file mode 100644 index 0000000..b005494 --- /dev/null +++ b/src/uarte0/rxd/maxcnt.rs @@ -0,0 +1,102 @@ +#[doc = "Register `MAXCNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MAXCNT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `MAXCNT` reader - Maximum number of bytes in receive buffer"] +pub struct MAXCNT_R(crate::FieldReader); +impl MAXCNT_R { + pub(crate) fn new(bits: u8) -> Self { + MAXCNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MAXCNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MAXCNT` writer - Maximum number of bytes in receive buffer"] +pub struct MAXCNT_W<'a> { + w: &'a mut W, +} +impl<'a> MAXCNT_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - Maximum number of bytes in receive buffer"] + #[inline(always)] + pub fn maxcnt(&self) -> MAXCNT_R { + MAXCNT_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - Maximum number of bytes in receive buffer"] + #[inline(always)] + pub fn maxcnt(&mut self) -> MAXCNT_W { + MAXCNT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Maximum number of bytes in receive buffer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [maxcnt](index.html) module"] +pub struct MAXCNT_SPEC; +impl crate::RegisterSpec for MAXCNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [maxcnt::R](R) reader structure"] +impl crate::Readable for MAXCNT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [maxcnt::W](W) writer structure"] +impl crate::Writable for MAXCNT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MAXCNT to value 0"] +impl crate::Resettable for MAXCNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/rxd/ptr.rs b/src/uarte0/rxd/ptr.rs new file mode 100644 index 0000000..681f382 --- /dev/null +++ b/src/uarte0/rxd/ptr.rs @@ -0,0 +1,102 @@ +#[doc = "Register `PTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PTR` reader - Data pointer"] +pub struct PTR_R(crate::FieldReader); +impl PTR_R { + pub(crate) fn new(bits: u32) -> Self { + PTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PTR` writer - Data pointer"] +pub struct PTR_W<'a> { + w: &'a mut W, +} +impl<'a> PTR_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Data pointer"] + #[inline(always)] + pub fn ptr(&self) -> PTR_R { + PTR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Data pointer"] + #[inline(always)] + pub fn ptr(&mut self) -> PTR_W { + PTR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Data pointer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ptr](index.html) module"] +pub struct PTR_SPEC; +impl crate::RegisterSpec for PTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ptr::R](R) reader structure"] +impl crate::Readable for PTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ptr::W](W) writer structure"] +impl crate::Writable for PTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PTR to value 0"] +impl crate::Resettable for PTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/shorts.rs b/src/uarte0/shorts.rs new file mode 100644 index 0000000..a7adbd7 --- /dev/null +++ b/src/uarte0/shorts.rs @@ -0,0 +1,252 @@ +#[doc = "Register `SHORTS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `SHORTS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Shortcut between ENDRX event and STARTRX task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDRX_STARTRX_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDRX_STARTRX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDRX_STARTRX` reader - Shortcut between ENDRX event and STARTRX task"] +pub struct ENDRX_STARTRX_R(crate::FieldReader); +impl ENDRX_STARTRX_R { + pub(crate) fn new(bits: bool) -> Self { + ENDRX_STARTRX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDRX_STARTRX_A { + match self.bits { + false => ENDRX_STARTRX_A::DISABLED, + true => ENDRX_STARTRX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENDRX_STARTRX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENDRX_STARTRX_A::ENABLED + } +} +impl core::ops::Deref for ENDRX_STARTRX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENDRX_STARTRX` writer - Shortcut between ENDRX event and STARTRX task"] +pub struct ENDRX_STARTRX_W<'a> { + w: &'a mut W, +} +impl<'a> ENDRX_STARTRX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDRX_STARTRX_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENDRX_STARTRX_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENDRX_STARTRX_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Shortcut between ENDRX event and STOPRX task\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum ENDRX_STOPRX_A { + #[doc = "0: Disable shortcut"] + DISABLED = 0, + #[doc = "1: Enable shortcut"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: ENDRX_STOPRX_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `ENDRX_STOPRX` reader - Shortcut between ENDRX event and STOPRX task"] +pub struct ENDRX_STOPRX_R(crate::FieldReader); +impl ENDRX_STOPRX_R { + pub(crate) fn new(bits: bool) -> Self { + ENDRX_STOPRX_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> ENDRX_STOPRX_A { + match self.bits { + false => ENDRX_STOPRX_A::DISABLED, + true => ENDRX_STOPRX_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == ENDRX_STOPRX_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == ENDRX_STOPRX_A::ENABLED + } +} +impl core::ops::Deref for ENDRX_STOPRX_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `ENDRX_STOPRX` writer - Shortcut between ENDRX event and STOPRX task"] +pub struct ENDRX_STOPRX_W<'a> { + w: &'a mut W, +} +impl<'a> ENDRX_STOPRX_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: ENDRX_STOPRX_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable shortcut"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(ENDRX_STOPRX_A::DISABLED) + } + #[doc = "Enable shortcut"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(ENDRX_STOPRX_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +impl R { + #[doc = "Bit 5 - Shortcut between ENDRX event and STARTRX task"] + #[inline(always)] + pub fn endrx_startrx(&self) -> ENDRX_STARTRX_R { + ENDRX_STARTRX_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Shortcut between ENDRX event and STOPRX task"] + #[inline(always)] + pub fn endrx_stoprx(&self) -> ENDRX_STOPRX_R { + ENDRX_STOPRX_R::new(((self.bits >> 6) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 5 - Shortcut between ENDRX event and STARTRX task"] + #[inline(always)] + pub fn endrx_startrx(&mut self) -> ENDRX_STARTRX_W { + ENDRX_STARTRX_W { w: self } + } + #[doc = "Bit 6 - Shortcut between ENDRX event and STOPRX task"] + #[inline(always)] + pub fn endrx_stoprx(&mut self) -> ENDRX_STOPRX_W { + ENDRX_STOPRX_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Shortcut register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [shorts](index.html) module"] +pub struct SHORTS_SPEC; +impl crate::RegisterSpec for SHORTS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [shorts::R](R) reader structure"] +impl crate::Readable for SHORTS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [shorts::W](W) writer structure"] +impl crate::Writable for SHORTS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets SHORTS to value 0"] +impl crate::Resettable for SHORTS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/tasks_flushrx.rs b/src/uarte0/tasks_flushrx.rs new file mode 100644 index 0000000..5ea6a16 --- /dev/null +++ b/src/uarte0/tasks_flushrx.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_FLUSHRX` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Flush RX FIFO into RX buffer\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_flushrx](index.html) module"] +pub struct TASKS_FLUSHRX_SPEC; +impl crate::RegisterSpec for TASKS_FLUSHRX_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_flushrx::W](W) writer structure"] +impl crate::Writable for TASKS_FLUSHRX_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_FLUSHRX to value 0"] +impl crate::Resettable for TASKS_FLUSHRX_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/tasks_startrx.rs b/src/uarte0/tasks_startrx.rs new file mode 100644 index 0000000..39502a8 --- /dev/null +++ b/src/uarte0/tasks_startrx.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STARTRX` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start UART receiver\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_startrx](index.html) module"] +pub struct TASKS_STARTRX_SPEC; +impl crate::RegisterSpec for TASKS_STARTRX_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_startrx::W](W) writer structure"] +impl crate::Writable for TASKS_STARTRX_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STARTRX to value 0"] +impl crate::Resettable for TASKS_STARTRX_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/tasks_starttx.rs b/src/uarte0/tasks_starttx.rs new file mode 100644 index 0000000..6e0e5b3 --- /dev/null +++ b/src/uarte0/tasks_starttx.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STARTTX` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start UART transmitter\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_starttx](index.html) module"] +pub struct TASKS_STARTTX_SPEC; +impl crate::RegisterSpec for TASKS_STARTTX_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_starttx::W](W) writer structure"] +impl crate::Writable for TASKS_STARTTX_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STARTTX to value 0"] +impl crate::Resettable for TASKS_STARTTX_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/tasks_stoprx.rs b/src/uarte0/tasks_stoprx.rs new file mode 100644 index 0000000..84910c8 --- /dev/null +++ b/src/uarte0/tasks_stoprx.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STOPRX` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Stop UART receiver\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_stoprx](index.html) module"] +pub struct TASKS_STOPRX_SPEC; +impl crate::RegisterSpec for TASKS_STOPRX_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_stoprx::W](W) writer structure"] +impl crate::Writable for TASKS_STOPRX_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STOPRX to value 0"] +impl crate::Resettable for TASKS_STOPRX_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/tasks_stoptx.rs b/src/uarte0/tasks_stoptx.rs new file mode 100644 index 0000000..8075a66 --- /dev/null +++ b/src/uarte0/tasks_stoptx.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_STOPTX` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Stop UART transmitter\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_stoptx](index.html) module"] +pub struct TASKS_STOPTX_SPEC; +impl crate::RegisterSpec for TASKS_STOPTX_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_stoptx::W](W) writer structure"] +impl crate::Writable for TASKS_STOPTX_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_STOPTX to value 0"] +impl crate::Resettable for TASKS_STOPTX_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/txd.rs b/src/uarte0/txd.rs new file mode 100644 index 0000000..60fd20c --- /dev/null +++ b/src/uarte0/txd.rs @@ -0,0 +1,12 @@ +#[doc = "PTR register accessor: an alias for `Reg`"] +pub type PTR = crate::Reg; +#[doc = "Data pointer"] +pub mod ptr; +#[doc = "MAXCNT register accessor: an alias for `Reg`"] +pub type MAXCNT = crate::Reg; +#[doc = "Maximum number of bytes in transmit buffer"] +pub mod maxcnt; +#[doc = "AMOUNT register accessor: an alias for `Reg`"] +pub type AMOUNT = crate::Reg; +#[doc = "Number of bytes transferred in the last transaction"] +pub mod amount; diff --git a/src/uarte0/txd/amount.rs b/src/uarte0/txd/amount.rs new file mode 100644 index 0000000..6e7cc9c --- /dev/null +++ b/src/uarte0/txd/amount.rs @@ -0,0 +1,52 @@ +#[doc = "Register `AMOUNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Field `AMOUNT` reader - Number of bytes transferred in the last transaction"] +pub struct AMOUNT_R(crate::FieldReader); +impl AMOUNT_R { + pub(crate) fn new(bits: u8) -> Self { + AMOUNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for AMOUNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bits 0:7 - Number of bytes transferred in the last transaction"] + #[inline(always)] + pub fn amount(&self) -> AMOUNT_R { + AMOUNT_R::new((self.bits & 0xff) as u8) + } +} +#[doc = "Number of bytes transferred in the last transaction\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 [amount](index.html) module"] +pub struct AMOUNT_SPEC; +impl crate::RegisterSpec for AMOUNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [amount::R](R) reader structure"] +impl crate::Readable for AMOUNT_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets AMOUNT to value 0"] +impl crate::Resettable for AMOUNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/txd/maxcnt.rs b/src/uarte0/txd/maxcnt.rs new file mode 100644 index 0000000..c9a377b --- /dev/null +++ b/src/uarte0/txd/maxcnt.rs @@ -0,0 +1,102 @@ +#[doc = "Register `MAXCNT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `MAXCNT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `MAXCNT` reader - Maximum number of bytes in transmit buffer"] +pub struct MAXCNT_R(crate::FieldReader); +impl MAXCNT_R { + pub(crate) fn new(bits: u8) -> Self { + MAXCNT_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for MAXCNT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `MAXCNT` writer - Maximum number of bytes in transmit buffer"] +pub struct MAXCNT_W<'a> { + w: &'a mut W, +} +impl<'a> MAXCNT_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - Maximum number of bytes in transmit buffer"] + #[inline(always)] + pub fn maxcnt(&self) -> MAXCNT_R { + MAXCNT_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - Maximum number of bytes in transmit buffer"] + #[inline(always)] + pub fn maxcnt(&mut self) -> MAXCNT_W { + MAXCNT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Maximum number of bytes in transmit buffer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [maxcnt](index.html) module"] +pub struct MAXCNT_SPEC; +impl crate::RegisterSpec for MAXCNT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [maxcnt::R](R) reader structure"] +impl crate::Readable for MAXCNT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [maxcnt::W](W) writer structure"] +impl crate::Writable for MAXCNT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets MAXCNT to value 0"] +impl crate::Resettable for MAXCNT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uarte0/txd/ptr.rs b/src/uarte0/txd/ptr.rs new file mode 100644 index 0000000..681f382 --- /dev/null +++ b/src/uarte0/txd/ptr.rs @@ -0,0 +1,102 @@ +#[doc = "Register `PTR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PTR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PTR` reader - Data pointer"] +pub struct PTR_R(crate::FieldReader); +impl PTR_R { + pub(crate) fn new(bits: u32) -> Self { + PTR_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PTR_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PTR` writer - Data pointer"] +pub struct PTR_W<'a> { + w: &'a mut W, +} +impl<'a> PTR_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Data pointer"] + #[inline(always)] + pub fn ptr(&self) -> PTR_R { + PTR_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Data pointer"] + #[inline(always)] + pub fn ptr(&mut self) -> PTR_W { + PTR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Data pointer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ptr](index.html) module"] +pub struct PTR_SPEC; +impl crate::RegisterSpec for PTR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [ptr::R](R) reader structure"] +impl crate::Readable for PTR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [ptr::W](W) writer structure"] +impl crate::Writable for PTR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PTR to value 0"] +impl crate::Resettable for PTR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uicr.rs b/src/uicr.rs new file mode 100644 index 0000000..a0024a5 --- /dev/null +++ b/src/uicr.rs @@ -0,0 +1,66 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "0x00 - Unspecified"] + pub unused0: crate::Reg, + #[doc = "0x04 - Unspecified"] + pub unused1: crate::Reg, + #[doc = "0x08 - Unspecified"] + pub unused2: crate::Reg, + _reserved3: [u8; 0x04], + #[doc = "0x10 - Unspecified"] + pub unused3: crate::Reg, + #[doc = "0x14..0x50 - Description collection\\[0\\]: Reserved for Nordic firmware design"] + pub nrffw: [crate::Reg; 15], + #[doc = "0x50..0x80 - Description collection\\[0\\]: Reserved for Nordic hardware design"] + pub nrfhw: [crate::Reg; 12], + #[doc = "0x80..0x100 - Description collection\\[0\\]: Reserved for customer"] + pub customer: [crate::Reg; 32], + _reserved7: [u8; 0x0100], + #[doc = "0x200..0x208 - Description collection\\[0\\]: Mapping of the nRESET function (see POWER chapter for details)"] + pub pselreset: [crate::Reg; 2], + #[doc = "0x208 - Access port protection"] + pub approtect: crate::Reg, + #[doc = "0x20c - Setting of pins dedicated to NFC functionality: NFC antenna or GPIO"] + pub nfcpins: crate::Reg, +} +#[doc = "UNUSED0 register accessor: an alias for `Reg`"] +pub type UNUSED0 = crate::Reg; +#[doc = "Unspecified"] +pub mod unused0; +#[doc = "UNUSED1 register accessor: an alias for `Reg`"] +pub type UNUSED1 = crate::Reg; +#[doc = "Unspecified"] +pub mod unused1; +#[doc = "UNUSED2 register accessor: an alias for `Reg`"] +pub type UNUSED2 = crate::Reg; +#[doc = "Unspecified"] +pub mod unused2; +#[doc = "UNUSED3 register accessor: an alias for `Reg`"] +pub type UNUSED3 = crate::Reg; +#[doc = "Unspecified"] +pub mod unused3; +#[doc = "NRFFW register accessor: an alias for `Reg`"] +pub type NRFFW = crate::Reg; +#[doc = "Description collection\\[0\\]: Reserved for Nordic firmware design"] +pub mod nrffw; +#[doc = "NRFHW register accessor: an alias for `Reg`"] +pub type NRFHW = crate::Reg; +#[doc = "Description collection\\[0\\]: Reserved for Nordic hardware design"] +pub mod nrfhw; +#[doc = "CUSTOMER register accessor: an alias for `Reg`"] +pub type CUSTOMER = crate::Reg; +#[doc = "Description collection\\[0\\]: Reserved for customer"] +pub mod customer; +#[doc = "PSELRESET register accessor: an alias for `Reg`"] +pub type PSELRESET = crate::Reg; +#[doc = "Description collection\\[0\\]: Mapping of the nRESET function (see POWER chapter for details)"] +pub mod pselreset; +#[doc = "APPROTECT register accessor: an alias for `Reg`"] +pub type APPROTECT = crate::Reg; +#[doc = "Access port protection"] +pub mod approtect; +#[doc = "NFCPINS register accessor: an alias for `Reg`"] +pub type NFCPINS = crate::Reg; +#[doc = "Setting of pins dedicated to NFC functionality: NFC antenna or GPIO"] +pub mod nfcpins; diff --git a/src/uicr/approtect.rs b/src/uicr/approtect.rs new file mode 100644 index 0000000..2724438 --- /dev/null +++ b/src/uicr/approtect.rs @@ -0,0 +1,164 @@ +#[doc = "Register `APPROTECT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `APPROTECT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable access port protection.\n\nValue on reset: 255"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u8)] +pub enum PALL_A { + #[doc = "255: Hardware disable of access port protection for devices where access port protection is controlled by hardware"] + DISABLED = 255, + #[doc = "90: Hardware disable of access port protection for devices where access port protection is controlled by hardware and software"] + HWDISABLED = 90, + #[doc = "0: Enable"] + ENABLED = 0, +} +impl From for u8 { + #[inline(always)] + fn from(variant: PALL_A) -> Self { + variant as _ + } +} +#[doc = "Field `PALL` reader - Enable or disable access port protection."] +pub struct PALL_R(crate::FieldReader); +impl PALL_R { + pub(crate) fn new(bits: u8) -> Self { + PALL_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> Option { + match self.bits { + 255 => Some(PALL_A::DISABLED), + 90 => Some(PALL_A::HWDISABLED), + 0 => Some(PALL_A::ENABLED), + _ => None, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PALL_A::DISABLED + } + #[doc = "Checks if the value of the field is `HWDISABLED`"] + #[inline(always)] + pub fn is_hw_disabled(&self) -> bool { + **self == PALL_A::HWDISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == PALL_A::ENABLED + } +} +impl core::ops::Deref for PALL_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PALL` writer - Enable or disable access port protection."] +pub struct PALL_W<'a> { + w: &'a mut W, +} +impl<'a> PALL_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PALL_A) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Hardware disable of access port protection for devices where access port protection is controlled by hardware"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(PALL_A::DISABLED) + } + #[doc = "Hardware disable of access port protection for devices where access port protection is controlled by hardware and software"] + #[inline(always)] + pub fn hw_disabled(self) -> &'a mut W { + self.variant(PALL_A::HWDISABLED) + } + #[doc = "Enable"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(PALL_A::ENABLED) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0xff) | (value as u32 & 0xff); + self.w + } +} +impl R { + #[doc = "Bits 0:7 - Enable or disable access port protection."] + #[inline(always)] + pub fn pall(&self) -> PALL_R { + PALL_R::new((self.bits & 0xff) as u8) + } +} +impl W { + #[doc = "Bits 0:7 - Enable or disable access port protection."] + #[inline(always)] + pub fn pall(&mut self) -> PALL_W { + PALL_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Access port protection\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [approtect](index.html) module"] +pub struct APPROTECT_SPEC; +impl crate::RegisterSpec for APPROTECT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [approtect::R](R) reader structure"] +impl crate::Readable for APPROTECT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [approtect::W](W) writer structure"] +impl crate::Writable for APPROTECT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets APPROTECT to value 0xffff_ffff"] +impl crate::Resettable for APPROTECT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/uicr/customer.rs b/src/uicr/customer.rs new file mode 100644 index 0000000..555f2a1 --- /dev/null +++ b/src/uicr/customer.rs @@ -0,0 +1,103 @@ +#[doc = "Register `CUSTOMER[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CUSTOMER[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CUSTOMER` reader - Reserved for customer"] +pub struct CUSTOMER_R(crate::FieldReader); +impl CUSTOMER_R { + pub(crate) fn new(bits: u32) -> Self { + CUSTOMER_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CUSTOMER_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CUSTOMER` writer - Reserved for customer"] +pub struct CUSTOMER_W<'a> { + w: &'a mut W, +} +impl<'a> CUSTOMER_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Reserved for customer"] + #[inline(always)] + pub fn customer(&self) -> CUSTOMER_R { + CUSTOMER_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Reserved for customer"] + #[inline(always)] + pub fn customer(&mut self) -> CUSTOMER_W { + CUSTOMER_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description collection\\[0\\]: Reserved for customer\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [customer](index.html) module"] +pub struct CUSTOMER_SPEC; +impl crate::RegisterSpec for CUSTOMER_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [customer::R](R) reader structure"] +impl crate::Readable for CUSTOMER_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [customer::W](W) writer structure"] +impl crate::Writable for CUSTOMER_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CUSTOMER[%s] +to value 0xffff_ffff"] +impl crate::Resettable for CUSTOMER_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/uicr/nfcpins.rs b/src/uicr/nfcpins.rs new file mode 100644 index 0000000..7e36122 --- /dev/null +++ b/src/uicr/nfcpins.rs @@ -0,0 +1,159 @@ +#[doc = "Register `NFCPINS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NFCPINS` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Setting of pins dedicated to NFC functionality\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum PROTECT_A { + #[doc = "0: Operation as GPIO pins. Same protection as normal GPIO pins."] + DISABLED = 0, + #[doc = "1: Operation as NFC antenna pins. Configures the protection for NFC operation."] + NFC = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: PROTECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `PROTECT` reader - Setting of pins dedicated to NFC functionality"] +pub struct PROTECT_R(crate::FieldReader); +impl PROTECT_R { + pub(crate) fn new(bits: bool) -> Self { + PROTECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> PROTECT_A { + match self.bits { + false => PROTECT_A::DISABLED, + true => PROTECT_A::NFC, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == PROTECT_A::DISABLED + } + #[doc = "Checks if the value of the field is `NFC`"] + #[inline(always)] + pub fn is_nfc(&self) -> bool { + **self == PROTECT_A::NFC + } +} +impl core::ops::Deref for PROTECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PROTECT` writer - Setting of pins dedicated to NFC functionality"] +pub struct PROTECT_W<'a> { + w: &'a mut W, +} +impl<'a> PROTECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: PROTECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Operation as GPIO pins. Same protection as normal GPIO pins."] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(PROTECT_A::DISABLED) + } + #[doc = "Operation as NFC antenna pins. Configures the protection for NFC operation."] + #[inline(always)] + pub fn nfc(self) -> &'a mut W { + self.variant(PROTECT_A::NFC) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Setting of pins dedicated to NFC functionality"] + #[inline(always)] + pub fn protect(&self) -> PROTECT_R { + PROTECT_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Setting of pins dedicated to NFC functionality"] + #[inline(always)] + pub fn protect(&mut self) -> PROTECT_W { + PROTECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Setting of pins dedicated to NFC functionality: NFC antenna or GPIO\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nfcpins](index.html) module"] +pub struct NFCPINS_SPEC; +impl crate::RegisterSpec for NFCPINS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nfcpins::R](R) reader structure"] +impl crate::Readable for NFCPINS_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nfcpins::W](W) writer structure"] +impl crate::Writable for NFCPINS_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NFCPINS to value 0xffff_ffff"] +impl crate::Resettable for NFCPINS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/uicr/nrffw.rs b/src/uicr/nrffw.rs new file mode 100644 index 0000000..e239da7 --- /dev/null +++ b/src/uicr/nrffw.rs @@ -0,0 +1,103 @@ +#[doc = "Register `NRFFW[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NRFFW[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `NRFFW` reader - Reserved for Nordic firmware design"] +pub struct NRFFW_R(crate::FieldReader); +impl NRFFW_R { + pub(crate) fn new(bits: u32) -> Self { + NRFFW_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NRFFW_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NRFFW` writer - Reserved for Nordic firmware design"] +pub struct NRFFW_W<'a> { + w: &'a mut W, +} +impl<'a> NRFFW_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Reserved for Nordic firmware design"] + #[inline(always)] + pub fn nrffw(&self) -> NRFFW_R { + NRFFW_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Reserved for Nordic firmware design"] + #[inline(always)] + pub fn nrffw(&mut self) -> NRFFW_W { + NRFFW_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description collection\\[0\\]: Reserved for Nordic firmware design\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nrffw](index.html) module"] +pub struct NRFFW_SPEC; +impl crate::RegisterSpec for NRFFW_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nrffw::R](R) reader structure"] +impl crate::Readable for NRFFW_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nrffw::W](W) writer structure"] +impl crate::Writable for NRFFW_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NRFFW[%s] +to value 0xffff_ffff"] +impl crate::Resettable for NRFFW_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/uicr/nrfhw.rs b/src/uicr/nrfhw.rs new file mode 100644 index 0000000..2a73d31 --- /dev/null +++ b/src/uicr/nrfhw.rs @@ -0,0 +1,103 @@ +#[doc = "Register `NRFHW[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `NRFHW[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `NRFHW` reader - Reserved for Nordic hardware design"] +pub struct NRFHW_R(crate::FieldReader); +impl NRFHW_R { + pub(crate) fn new(bits: u32) -> Self { + NRFHW_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for NRFHW_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `NRFHW` writer - Reserved for Nordic hardware design"] +pub struct NRFHW_W<'a> { + w: &'a mut W, +} +impl<'a> NRFHW_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Reserved for Nordic hardware design"] + #[inline(always)] + pub fn nrfhw(&self) -> NRFHW_R { + NRFHW_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Reserved for Nordic hardware design"] + #[inline(always)] + pub fn nrfhw(&mut self) -> NRFHW_W { + NRFHW_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description collection\\[0\\]: Reserved for Nordic hardware design\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [nrfhw](index.html) module"] +pub struct NRFHW_SPEC; +impl crate::RegisterSpec for NRFHW_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [nrfhw::R](R) reader structure"] +impl crate::Readable for NRFHW_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [nrfhw::W](W) writer structure"] +impl crate::Writable for NRFHW_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets NRFHW[%s] +to value 0xffff_ffff"] +impl crate::Resettable for NRFHW_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/uicr/pselreset.rs b/src/uicr/pselreset.rs new file mode 100644 index 0000000..62cbb05 --- /dev/null +++ b/src/uicr/pselreset.rs @@ -0,0 +1,196 @@ +#[doc = "Register `PSELRESET[%s]` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `PSELRESET[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `PIN` reader - GPIO number P0.n onto which Reset is exposed"] +pub struct PIN_R(crate::FieldReader); +impl PIN_R { + pub(crate) fn new(bits: u8) -> Self { + PIN_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for PIN_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `PIN` writer - GPIO number P0.n onto which Reset is exposed"] +pub struct PIN_W<'a> { + w: &'a mut W, +} +impl<'a> PIN_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u8) -> &'a mut W { + self.w.bits = (self.w.bits & !0x3f) | (value as u32 & 0x3f); + self.w + } +} +#[doc = "Connection\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum CONNECT_A { + #[doc = "1: Disconnect"] + DISCONNECTED = 1, + #[doc = "0: Connect"] + CONNECTED = 0, +} +impl From for bool { + #[inline(always)] + fn from(variant: CONNECT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `CONNECT` reader - Connection"] +pub struct CONNECT_R(crate::FieldReader); +impl CONNECT_R { + pub(crate) fn new(bits: bool) -> Self { + CONNECT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> CONNECT_A { + match self.bits { + true => CONNECT_A::DISCONNECTED, + false => CONNECT_A::CONNECTED, + } + } + #[doc = "Checks if the value of the field is `DISCONNECTED`"] + #[inline(always)] + pub fn is_disconnected(&self) -> bool { + **self == CONNECT_A::DISCONNECTED + } + #[doc = "Checks if the value of the field is `CONNECTED`"] + #[inline(always)] + pub fn is_connected(&self) -> bool { + **self == CONNECT_A::CONNECTED + } +} +impl core::ops::Deref for CONNECT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CONNECT` writer - Connection"] +pub struct CONNECT_W<'a> { + w: &'a mut W, +} +impl<'a> CONNECT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: CONNECT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disconnect"] + #[inline(always)] + pub fn disconnected(self) -> &'a mut W { + self.variant(CONNECT_A::DISCONNECTED) + } + #[doc = "Connect"] + #[inline(always)] + pub fn connected(self) -> &'a mut W { + self.variant(CONNECT_A::CONNECTED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 31)) | ((value as u32 & 0x01) << 31); + self.w + } +} +impl R { + #[doc = "Bits 0:5 - GPIO number P0.n onto which Reset is exposed"] + #[inline(always)] + pub fn pin(&self) -> PIN_R { + PIN_R::new((self.bits & 0x3f) as u8) + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&self) -> CONNECT_R { + CONNECT_R::new(((self.bits >> 31) & 0x01) != 0) + } +} +impl W { + #[doc = "Bits 0:5 - GPIO number P0.n onto which Reset is exposed"] + #[inline(always)] + pub fn pin(&mut self) -> PIN_W { + PIN_W { w: self } + } + #[doc = "Bit 31 - Connection"] + #[inline(always)] + pub fn connect(&mut self) -> CONNECT_W { + CONNECT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description collection\\[0\\]: Mapping of the nRESET function (see POWER chapter for details)\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pselreset](index.html) module"] +pub struct PSELRESET_SPEC; +impl crate::RegisterSpec for PSELRESET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [pselreset::R](R) reader structure"] +impl crate::Readable for PSELRESET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [pselreset::W](W) writer structure"] +impl crate::Writable for PSELRESET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets PSELRESET[%s] +to value 0xffff_ffff"] +impl crate::Resettable for PSELRESET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/uicr/unused0.rs b/src/uicr/unused0.rs new file mode 100644 index 0000000..c1af181 --- /dev/null +++ b/src/uicr/unused0.rs @@ -0,0 +1,64 @@ +#[doc = "Register `UNUSED0` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `UNUSED0` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Unspecified\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [unused0](index.html) module"] +pub struct UNUSED0_SPEC; +impl crate::RegisterSpec for UNUSED0_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [unused0::R](R) reader structure"] +impl crate::Readable for UNUSED0_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [unused0::W](W) writer structure"] +impl crate::Writable for UNUSED0_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets UNUSED0 to value 0"] +impl crate::Resettable for UNUSED0_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uicr/unused1.rs b/src/uicr/unused1.rs new file mode 100644 index 0000000..52b81e6 --- /dev/null +++ b/src/uicr/unused1.rs @@ -0,0 +1,64 @@ +#[doc = "Register `UNUSED1` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `UNUSED1` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Unspecified\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [unused1](index.html) module"] +pub struct UNUSED1_SPEC; +impl crate::RegisterSpec for UNUSED1_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [unused1::R](R) reader structure"] +impl crate::Readable for UNUSED1_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [unused1::W](W) writer structure"] +impl crate::Writable for UNUSED1_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets UNUSED1 to value 0"] +impl crate::Resettable for UNUSED1_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uicr/unused2.rs b/src/uicr/unused2.rs new file mode 100644 index 0000000..5c730eb --- /dev/null +++ b/src/uicr/unused2.rs @@ -0,0 +1,64 @@ +#[doc = "Register `UNUSED2` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `UNUSED2` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Unspecified\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [unused2](index.html) module"] +pub struct UNUSED2_SPEC; +impl crate::RegisterSpec for UNUSED2_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [unused2::R](R) reader structure"] +impl crate::Readable for UNUSED2_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [unused2::W](W) writer structure"] +impl crate::Writable for UNUSED2_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets UNUSED2 to value 0"] +impl crate::Resettable for UNUSED2_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/uicr/unused3.rs b/src/uicr/unused3.rs new file mode 100644 index 0000000..6a18962 --- /dev/null +++ b/src/uicr/unused3.rs @@ -0,0 +1,64 @@ +#[doc = "Register `UNUSED3` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `UNUSED3` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Unspecified\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [unused3](index.html) module"] +pub struct UNUSED3_SPEC; +impl crate::RegisterSpec for UNUSED3_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [unused3::R](R) reader structure"] +impl crate::Readable for UNUSED3_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [unused3::W](W) writer structure"] +impl crate::Writable for UNUSED3_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets UNUSED3 to value 0"] +impl crate::Resettable for UNUSED3_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/wdt.rs b/src/wdt.rs new file mode 100644 index 0000000..1734b91 --- /dev/null +++ b/src/wdt.rs @@ -0,0 +1,69 @@ +#[doc = r"Register block"] +#[repr(C)] +pub struct RegisterBlock { + #[doc = "0x00 - Start the watchdog"] + pub tasks_start: crate::Reg, + _reserved1: [u8; 0xfc], + #[doc = "0x100 - Watchdog timeout"] + pub events_timeout: crate::Reg, + _reserved2: [u8; 0x0200], + #[doc = "0x304 - Enable interrupt"] + pub intenset: crate::Reg, + #[doc = "0x308 - Disable interrupt"] + pub intenclr: crate::Reg, + _reserved4: [u8; 0xf4], + #[doc = "0x400 - Run status"] + pub runstatus: crate::Reg, + #[doc = "0x404 - Request status"] + pub reqstatus: crate::Reg, + _reserved6: [u8; 0xfc], + #[doc = "0x504 - Counter reload value"] + pub crv: crate::Reg, + #[doc = "0x508 - Enable register for reload request registers"] + pub rren: crate::Reg, + #[doc = "0x50c - Configuration register"] + pub config: crate::Reg, + _reserved9: [u8; 0xf0], + #[doc = "0x600..0x620 - Description collection\\[0\\]: Reload request 0"] + pub rr: [crate::Reg; 8], +} +#[doc = "TASKS_START register accessor: an alias for `Reg`"] +pub type TASKS_START = crate::Reg; +#[doc = "Start the watchdog"] +pub mod tasks_start; +#[doc = "EVENTS_TIMEOUT register accessor: an alias for `Reg`"] +pub type EVENTS_TIMEOUT = crate::Reg; +#[doc = "Watchdog timeout"] +pub mod events_timeout; +#[doc = "INTENSET register accessor: an alias for `Reg`"] +pub type INTENSET = crate::Reg; +#[doc = "Enable interrupt"] +pub mod intenset; +#[doc = "INTENCLR register accessor: an alias for `Reg`"] +pub type INTENCLR = crate::Reg; +#[doc = "Disable interrupt"] +pub mod intenclr; +#[doc = "RUNSTATUS register accessor: an alias for `Reg`"] +pub type RUNSTATUS = crate::Reg; +#[doc = "Run status"] +pub mod runstatus; +#[doc = "REQSTATUS register accessor: an alias for `Reg`"] +pub type REQSTATUS = crate::Reg; +#[doc = "Request status"] +pub mod reqstatus; +#[doc = "CRV register accessor: an alias for `Reg`"] +pub type CRV = crate::Reg; +#[doc = "Counter reload value"] +pub mod crv; +#[doc = "RREN register accessor: an alias for `Reg`"] +pub type RREN = crate::Reg; +#[doc = "Enable register for reload request registers"] +pub mod rren; +#[doc = "CONFIG register accessor: an alias for `Reg`"] +pub type CONFIG = crate::Reg; +#[doc = "Configuration register"] +pub mod config; +#[doc = "RR register accessor: an alias for `Reg`"] +pub type RR = crate::Reg; +#[doc = "Description collection\\[0\\]: Reload request 0"] +pub mod rr; diff --git a/src/wdt/config.rs b/src/wdt/config.rs new file mode 100644 index 0000000..7480fa6 --- /dev/null +++ b/src/wdt/config.rs @@ -0,0 +1,252 @@ +#[doc = "Register `CONFIG` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CONFIG` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Configure the watchdog to either be paused, or kept running, while the CPU is sleeping\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum SLEEP_A { + #[doc = "0: Pause watchdog while the CPU is sleeping"] + PAUSE = 0, + #[doc = "1: Keep the watchdog running while the CPU is sleeping"] + RUN = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: SLEEP_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `SLEEP` reader - Configure the watchdog to either be paused, or kept running, while the CPU is sleeping"] +pub struct SLEEP_R(crate::FieldReader); +impl SLEEP_R { + pub(crate) fn new(bits: bool) -> Self { + SLEEP_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> SLEEP_A { + match self.bits { + false => SLEEP_A::PAUSE, + true => SLEEP_A::RUN, + } + } + #[doc = "Checks if the value of the field is `PAUSE`"] + #[inline(always)] + pub fn is_pause(&self) -> bool { + **self == SLEEP_A::PAUSE + } + #[doc = "Checks if the value of the field is `RUN`"] + #[inline(always)] + pub fn is_run(&self) -> bool { + **self == SLEEP_A::RUN + } +} +impl core::ops::Deref for SLEEP_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `SLEEP` writer - Configure the watchdog to either be paused, or kept running, while the CPU is sleeping"] +pub struct SLEEP_W<'a> { + w: &'a mut W, +} +impl<'a> SLEEP_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: SLEEP_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pause watchdog while the CPU is sleeping"] + #[inline(always)] + pub fn pause(self) -> &'a mut W { + self.variant(SLEEP_A::PAUSE) + } + #[doc = "Keep the watchdog running while the CPU is sleeping"] + #[inline(always)] + pub fn run(self) -> &'a mut W { + self.variant(SLEEP_A::RUN) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Configure the watchdog to either be paused, or kept running, while the CPU is halted by the debugger\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum HALT_A { + #[doc = "0: Pause watchdog while the CPU is halted by the debugger"] + PAUSE = 0, + #[doc = "1: Keep the watchdog running while the CPU is halted by the debugger"] + RUN = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: HALT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `HALT` reader - Configure the watchdog to either be paused, or kept running, while the CPU is halted by the debugger"] +pub struct HALT_R(crate::FieldReader); +impl HALT_R { + pub(crate) fn new(bits: bool) -> Self { + HALT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> HALT_A { + match self.bits { + false => HALT_A::PAUSE, + true => HALT_A::RUN, + } + } + #[doc = "Checks if the value of the field is `PAUSE`"] + #[inline(always)] + pub fn is_pause(&self) -> bool { + **self == HALT_A::PAUSE + } + #[doc = "Checks if the value of the field is `RUN`"] + #[inline(always)] + pub fn is_run(&self) -> bool { + **self == HALT_A::RUN + } +} +impl core::ops::Deref for HALT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `HALT` writer - Configure the watchdog to either be paused, or kept running, while the CPU is halted by the debugger"] +pub struct HALT_W<'a> { + w: &'a mut W, +} +impl<'a> HALT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: HALT_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Pause watchdog while the CPU is halted by the debugger"] + #[inline(always)] + pub fn pause(self) -> &'a mut W { + self.variant(HALT_A::PAUSE) + } + #[doc = "Keep the watchdog running while the CPU is halted by the debugger"] + #[inline(always)] + pub fn run(self) -> &'a mut W { + self.variant(HALT_A::RUN) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +impl R { + #[doc = "Bit 0 - Configure the watchdog to either be paused, or kept running, while the CPU is sleeping"] + #[inline(always)] + pub fn sleep(&self) -> SLEEP_R { + SLEEP_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 3 - Configure the watchdog to either be paused, or kept running, while the CPU is halted by the debugger"] + #[inline(always)] + pub fn halt(&self) -> HALT_R { + HALT_R::new(((self.bits >> 3) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Configure the watchdog to either be paused, or kept running, while the CPU is sleeping"] + #[inline(always)] + pub fn sleep(&mut self) -> SLEEP_W { + SLEEP_W { w: self } + } + #[doc = "Bit 3 - Configure the watchdog to either be paused, or kept running, while the CPU is halted by the debugger"] + #[inline(always)] + pub fn halt(&mut self) -> HALT_W { + HALT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Configuration register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [config](index.html) module"] +pub struct CONFIG_SPEC; +impl crate::RegisterSpec for CONFIG_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [config::R](R) reader structure"] +impl crate::Readable for CONFIG_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [config::W](W) writer structure"] +impl crate::Writable for CONFIG_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CONFIG to value 0x01"] +impl crate::Resettable for CONFIG_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x01 + } +} diff --git a/src/wdt/crv.rs b/src/wdt/crv.rs new file mode 100644 index 0000000..bc457f6 --- /dev/null +++ b/src/wdt/crv.rs @@ -0,0 +1,102 @@ +#[doc = "Register `CRV` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `CRV` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Field `CRV` reader - Counter reload value in number of cycles of the 32.768 kHz clock"] +pub struct CRV_R(crate::FieldReader); +impl CRV_R { + pub(crate) fn new(bits: u32) -> Self { + CRV_R(crate::FieldReader::new(bits)) + } +} +impl core::ops::Deref for CRV_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `CRV` writer - Counter reload value in number of cycles of the 32.768 kHz clock"] +pub struct CRV_W<'a> { + w: &'a mut W, +} +impl<'a> CRV_W<'a> { + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl R { + #[doc = "Bits 0:31 - Counter reload value in number of cycles of the 32.768 kHz clock"] + #[inline(always)] + pub fn crv(&self) -> CRV_R { + CRV_R::new((self.bits & 0xffff_ffff) as u32) + } +} +impl W { + #[doc = "Bits 0:31 - Counter reload value in number of cycles of the 32.768 kHz clock"] + #[inline(always)] + pub fn crv(&mut self) -> CRV_W { + CRV_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Counter reload value\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [crv](index.html) module"] +pub struct CRV_SPEC; +impl crate::RegisterSpec for CRV_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [crv::R](R) reader structure"] +impl crate::Readable for CRV_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [crv::W](W) writer structure"] +impl crate::Writable for CRV_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets CRV to value 0xffff_ffff"] +impl crate::Resettable for CRV_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0xffff_ffff + } +} diff --git a/src/wdt/events_timeout.rs b/src/wdt/events_timeout.rs new file mode 100644 index 0000000..ccb157b --- /dev/null +++ b/src/wdt/events_timeout.rs @@ -0,0 +1,64 @@ +#[doc = "Register `EVENTS_TIMEOUT` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `EVENTS_TIMEOUT` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Watchdog timeout\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_timeout](index.html) module"] +pub struct EVENTS_TIMEOUT_SPEC; +impl crate::RegisterSpec for EVENTS_TIMEOUT_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [events_timeout::R](R) reader structure"] +impl crate::Readable for EVENTS_TIMEOUT_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [events_timeout::W](W) writer structure"] +impl crate::Writable for EVENTS_TIMEOUT_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets EVENTS_TIMEOUT to value 0"] +impl crate::Resettable for EVENTS_TIMEOUT_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/wdt/intenclr.rs b/src/wdt/intenclr.rs new file mode 100644 index 0000000..422ba81 --- /dev/null +++ b/src/wdt/intenclr.rs @@ -0,0 +1,166 @@ +#[doc = "Register `INTENCLR` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENCLR` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Disable interrupt for TIMEOUT event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TIMEOUT_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TIMEOUT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TIMEOUT` reader - Write '1' to Disable interrupt for TIMEOUT event"] +pub struct TIMEOUT_R(crate::FieldReader); +impl TIMEOUT_R { + pub(crate) fn new(bits: bool) -> Self { + TIMEOUT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TIMEOUT_A { + match self.bits { + false => TIMEOUT_A::DISABLED, + true => TIMEOUT_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TIMEOUT_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TIMEOUT_A::ENABLED + } +} +impl core::ops::Deref for TIMEOUT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Disable interrupt for TIMEOUT event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TIMEOUT_AW { + #[doc = "1: Disable"] + CLEAR = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TIMEOUT_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TIMEOUT` writer - Write '1' to Disable interrupt for TIMEOUT event"] +pub struct TIMEOUT_W<'a> { + w: &'a mut W, +} +impl<'a> TIMEOUT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TIMEOUT_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable"] + #[inline(always)] + pub fn clear(self) -> &'a mut W { + self.variant(TIMEOUT_AW::CLEAR) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Disable interrupt for TIMEOUT event"] + #[inline(always)] + pub fn timeout(&self) -> TIMEOUT_R { + TIMEOUT_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Disable interrupt for TIMEOUT event"] + #[inline(always)] + pub fn timeout(&mut self) -> TIMEOUT_W { + TIMEOUT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"] +pub struct INTENCLR_SPEC; +impl crate::RegisterSpec for INTENCLR_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenclr::R](R) reader structure"] +impl crate::Readable for INTENCLR_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"] +impl crate::Writable for INTENCLR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENCLR to value 0"] +impl crate::Resettable for INTENCLR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/wdt/intenset.rs b/src/wdt/intenset.rs new file mode 100644 index 0000000..a428f9d --- /dev/null +++ b/src/wdt/intenset.rs @@ -0,0 +1,166 @@ +#[doc = "Register `INTENSET` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `INTENSET` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Write '1' to Enable interrupt for TIMEOUT event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TIMEOUT_A { + #[doc = "0: Read: Disabled"] + DISABLED = 0, + #[doc = "1: Read: Enabled"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TIMEOUT_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TIMEOUT` reader - Write '1' to Enable interrupt for TIMEOUT event"] +pub struct TIMEOUT_R(crate::FieldReader); +impl TIMEOUT_R { + pub(crate) fn new(bits: bool) -> Self { + TIMEOUT_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> TIMEOUT_A { + match self.bits { + false => TIMEOUT_A::DISABLED, + true => TIMEOUT_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == TIMEOUT_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == TIMEOUT_A::ENABLED + } +} +impl core::ops::Deref for TIMEOUT_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Write '1' to Enable interrupt for TIMEOUT event\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum TIMEOUT_AW { + #[doc = "1: Enable"] + SET = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: TIMEOUT_AW) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `TIMEOUT` writer - Write '1' to Enable interrupt for TIMEOUT event"] +pub struct TIMEOUT_W<'a> { + w: &'a mut W, +} +impl<'a> TIMEOUT_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: TIMEOUT_AW) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Enable"] + #[inline(always)] + pub fn set(self) -> &'a mut W { + self.variant(TIMEOUT_AW::SET) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +impl R { + #[doc = "Bit 0 - Write '1' to Enable interrupt for TIMEOUT event"] + #[inline(always)] + pub fn timeout(&self) -> TIMEOUT_R { + TIMEOUT_R::new((self.bits & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Write '1' to Enable interrupt for TIMEOUT event"] + #[inline(always)] + pub fn timeout(&mut self) -> TIMEOUT_W { + TIMEOUT_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"] +pub struct INTENSET_SPEC; +impl crate::RegisterSpec for INTENSET_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [intenset::R](R) reader structure"] +impl crate::Readable for INTENSET_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"] +impl crate::Writable for INTENSET_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets INTENSET to value 0"] +impl crate::Resettable for INTENSET_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/wdt/reqstatus.rs b/src/wdt/reqstatus.rs new file mode 100644 index 0000000..70bc2c8 --- /dev/null +++ b/src/wdt/reqstatus.rs @@ -0,0 +1,481 @@ +#[doc = "Register `REQSTATUS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Request status for RR\\[0\\] +register\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RR0_A { + #[doc = "0: RR\\[0\\] +register is not enabled, or are already requesting reload"] + DISABLEDORREQUESTED = 0, + #[doc = "1: RR\\[0\\] +register is enabled, and are not yet requesting reload"] + ENABLEDANDUNREQUESTED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RR0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RR0` reader - Request status for RR\\[0\\] +register"] +pub struct RR0_R(crate::FieldReader); +impl RR0_R { + pub(crate) fn new(bits: bool) -> Self { + RR0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RR0_A { + match self.bits { + false => RR0_A::DISABLEDORREQUESTED, + true => RR0_A::ENABLEDANDUNREQUESTED, + } + } + #[doc = "Checks if the value of the field is `DISABLEDORREQUESTED`"] + #[inline(always)] + pub fn is_disabled_or_requested(&self) -> bool { + **self == RR0_A::DISABLEDORREQUESTED + } + #[doc = "Checks if the value of the field is `ENABLEDANDUNREQUESTED`"] + #[inline(always)] + pub fn is_enabled_and_unrequested(&self) -> bool { + **self == RR0_A::ENABLEDANDUNREQUESTED + } +} +impl core::ops::Deref for RR0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Request status for RR\\[1\\] +register\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RR1_A { + #[doc = "0: RR\\[1\\] +register is not enabled, or are already requesting reload"] + DISABLEDORREQUESTED = 0, + #[doc = "1: RR\\[1\\] +register is enabled, and are not yet requesting reload"] + ENABLEDANDUNREQUESTED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RR1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RR1` reader - Request status for RR\\[1\\] +register"] +pub struct RR1_R(crate::FieldReader); +impl RR1_R { + pub(crate) fn new(bits: bool) -> Self { + RR1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RR1_A { + match self.bits { + false => RR1_A::DISABLEDORREQUESTED, + true => RR1_A::ENABLEDANDUNREQUESTED, + } + } + #[doc = "Checks if the value of the field is `DISABLEDORREQUESTED`"] + #[inline(always)] + pub fn is_disabled_or_requested(&self) -> bool { + **self == RR1_A::DISABLEDORREQUESTED + } + #[doc = "Checks if the value of the field is `ENABLEDANDUNREQUESTED`"] + #[inline(always)] + pub fn is_enabled_and_unrequested(&self) -> bool { + **self == RR1_A::ENABLEDANDUNREQUESTED + } +} +impl core::ops::Deref for RR1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Request status for RR\\[2\\] +register\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RR2_A { + #[doc = "0: RR\\[2\\] +register is not enabled, or are already requesting reload"] + DISABLEDORREQUESTED = 0, + #[doc = "1: RR\\[2\\] +register is enabled, and are not yet requesting reload"] + ENABLEDANDUNREQUESTED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RR2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RR2` reader - Request status for RR\\[2\\] +register"] +pub struct RR2_R(crate::FieldReader); +impl RR2_R { + pub(crate) fn new(bits: bool) -> Self { + RR2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RR2_A { + match self.bits { + false => RR2_A::DISABLEDORREQUESTED, + true => RR2_A::ENABLEDANDUNREQUESTED, + } + } + #[doc = "Checks if the value of the field is `DISABLEDORREQUESTED`"] + #[inline(always)] + pub fn is_disabled_or_requested(&self) -> bool { + **self == RR2_A::DISABLEDORREQUESTED + } + #[doc = "Checks if the value of the field is `ENABLEDANDUNREQUESTED`"] + #[inline(always)] + pub fn is_enabled_and_unrequested(&self) -> bool { + **self == RR2_A::ENABLEDANDUNREQUESTED + } +} +impl core::ops::Deref for RR2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Request status for RR\\[3\\] +register\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RR3_A { + #[doc = "0: RR\\[3\\] +register is not enabled, or are already requesting reload"] + DISABLEDORREQUESTED = 0, + #[doc = "1: RR\\[3\\] +register is enabled, and are not yet requesting reload"] + ENABLEDANDUNREQUESTED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RR3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RR3` reader - Request status for RR\\[3\\] +register"] +pub struct RR3_R(crate::FieldReader); +impl RR3_R { + pub(crate) fn new(bits: bool) -> Self { + RR3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RR3_A { + match self.bits { + false => RR3_A::DISABLEDORREQUESTED, + true => RR3_A::ENABLEDANDUNREQUESTED, + } + } + #[doc = "Checks if the value of the field is `DISABLEDORREQUESTED`"] + #[inline(always)] + pub fn is_disabled_or_requested(&self) -> bool { + **self == RR3_A::DISABLEDORREQUESTED + } + #[doc = "Checks if the value of the field is `ENABLEDANDUNREQUESTED`"] + #[inline(always)] + pub fn is_enabled_and_unrequested(&self) -> bool { + **self == RR3_A::ENABLEDANDUNREQUESTED + } +} +impl core::ops::Deref for RR3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Request status for RR\\[4\\] +register\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RR4_A { + #[doc = "0: RR\\[4\\] +register is not enabled, or are already requesting reload"] + DISABLEDORREQUESTED = 0, + #[doc = "1: RR\\[4\\] +register is enabled, and are not yet requesting reload"] + ENABLEDANDUNREQUESTED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RR4_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RR4` reader - Request status for RR\\[4\\] +register"] +pub struct RR4_R(crate::FieldReader); +impl RR4_R { + pub(crate) fn new(bits: bool) -> Self { + RR4_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RR4_A { + match self.bits { + false => RR4_A::DISABLEDORREQUESTED, + true => RR4_A::ENABLEDANDUNREQUESTED, + } + } + #[doc = "Checks if the value of the field is `DISABLEDORREQUESTED`"] + #[inline(always)] + pub fn is_disabled_or_requested(&self) -> bool { + **self == RR4_A::DISABLEDORREQUESTED + } + #[doc = "Checks if the value of the field is `ENABLEDANDUNREQUESTED`"] + #[inline(always)] + pub fn is_enabled_and_unrequested(&self) -> bool { + **self == RR4_A::ENABLEDANDUNREQUESTED + } +} +impl core::ops::Deref for RR4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Request status for RR\\[5\\] +register\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RR5_A { + #[doc = "0: RR\\[5\\] +register is not enabled, or are already requesting reload"] + DISABLEDORREQUESTED = 0, + #[doc = "1: RR\\[5\\] +register is enabled, and are not yet requesting reload"] + ENABLEDANDUNREQUESTED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RR5_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RR5` reader - Request status for RR\\[5\\] +register"] +pub struct RR5_R(crate::FieldReader); +impl RR5_R { + pub(crate) fn new(bits: bool) -> Self { + RR5_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RR5_A { + match self.bits { + false => RR5_A::DISABLEDORREQUESTED, + true => RR5_A::ENABLEDANDUNREQUESTED, + } + } + #[doc = "Checks if the value of the field is `DISABLEDORREQUESTED`"] + #[inline(always)] + pub fn is_disabled_or_requested(&self) -> bool { + **self == RR5_A::DISABLEDORREQUESTED + } + #[doc = "Checks if the value of the field is `ENABLEDANDUNREQUESTED`"] + #[inline(always)] + pub fn is_enabled_and_unrequested(&self) -> bool { + **self == RR5_A::ENABLEDANDUNREQUESTED + } +} +impl core::ops::Deref for RR5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Request status for RR\\[6\\] +register\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RR6_A { + #[doc = "0: RR\\[6\\] +register is not enabled, or are already requesting reload"] + DISABLEDORREQUESTED = 0, + #[doc = "1: RR\\[6\\] +register is enabled, and are not yet requesting reload"] + ENABLEDANDUNREQUESTED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RR6_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RR6` reader - Request status for RR\\[6\\] +register"] +pub struct RR6_R(crate::FieldReader); +impl RR6_R { + pub(crate) fn new(bits: bool) -> Self { + RR6_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RR6_A { + match self.bits { + false => RR6_A::DISABLEDORREQUESTED, + true => RR6_A::ENABLEDANDUNREQUESTED, + } + } + #[doc = "Checks if the value of the field is `DISABLEDORREQUESTED`"] + #[inline(always)] + pub fn is_disabled_or_requested(&self) -> bool { + **self == RR6_A::DISABLEDORREQUESTED + } + #[doc = "Checks if the value of the field is `ENABLEDANDUNREQUESTED`"] + #[inline(always)] + pub fn is_enabled_and_unrequested(&self) -> bool { + **self == RR6_A::ENABLEDANDUNREQUESTED + } +} +impl core::ops::Deref for RR6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Request status for RR\\[7\\] +register\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RR7_A { + #[doc = "0: RR\\[7\\] +register is not enabled, or are already requesting reload"] + DISABLEDORREQUESTED = 0, + #[doc = "1: RR\\[7\\] +register is enabled, and are not yet requesting reload"] + ENABLEDANDUNREQUESTED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RR7_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RR7` reader - Request status for RR\\[7\\] +register"] +pub struct RR7_R(crate::FieldReader); +impl RR7_R { + pub(crate) fn new(bits: bool) -> Self { + RR7_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RR7_A { + match self.bits { + false => RR7_A::DISABLEDORREQUESTED, + true => RR7_A::ENABLEDANDUNREQUESTED, + } + } + #[doc = "Checks if the value of the field is `DISABLEDORREQUESTED`"] + #[inline(always)] + pub fn is_disabled_or_requested(&self) -> bool { + **self == RR7_A::DISABLEDORREQUESTED + } + #[doc = "Checks if the value of the field is `ENABLEDANDUNREQUESTED`"] + #[inline(always)] + pub fn is_enabled_and_unrequested(&self) -> bool { + **self == RR7_A::ENABLEDANDUNREQUESTED + } +} +impl core::ops::Deref for RR7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bit 0 - Request status for RR\\[0\\] +register"] + #[inline(always)] + pub fn rr0(&self) -> RR0_R { + RR0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Request status for RR\\[1\\] +register"] + #[inline(always)] + pub fn rr1(&self) -> RR1_R { + RR1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Request status for RR\\[2\\] +register"] + #[inline(always)] + pub fn rr2(&self) -> RR2_R { + RR2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Request status for RR\\[3\\] +register"] + #[inline(always)] + pub fn rr3(&self) -> RR3_R { + RR3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Request status for RR\\[4\\] +register"] + #[inline(always)] + pub fn rr4(&self) -> RR4_R { + RR4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Request status for RR\\[5\\] +register"] + #[inline(always)] + pub fn rr5(&self) -> RR5_R { + RR5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Request status for RR\\[6\\] +register"] + #[inline(always)] + pub fn rr6(&self) -> RR6_R { + RR6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Request status for RR\\[7\\] +register"] + #[inline(always)] + pub fn rr7(&self) -> RR7_R { + RR7_R::new(((self.bits >> 7) & 0x01) != 0) + } +} +#[doc = "Request status\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 [reqstatus](index.html) module"] +pub struct REQSTATUS_SPEC; +impl crate::RegisterSpec for REQSTATUS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [reqstatus::R](R) reader structure"] +impl crate::Readable for REQSTATUS_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets REQSTATUS to value 0x01"] +impl crate::Resettable for REQSTATUS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x01 + } +} diff --git a/src/wdt/rr.rs b/src/wdt/rr.rs new file mode 100644 index 0000000..a438874 --- /dev/null +++ b/src/wdt/rr.rs @@ -0,0 +1,86 @@ +#[doc = "Register `RR[%s]` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Reload request register\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +#[repr(u32)] +pub enum RR_AW { + #[doc = "1850885685: Value to request a reload of the watchdog timer"] + RELOAD = 1850885685, +} +impl From for u32 { + #[inline(always)] + fn from(variant: RR_AW) -> Self { + variant as _ + } +} +#[doc = "Field `RR` writer - Reload request register"] +pub struct RR_W<'a> { + w: &'a mut W, +} +impl<'a> RR_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RR_AW) -> &'a mut W { + unsafe { self.bits(variant.into()) } + } + #[doc = "Value to request a reload of the watchdog timer"] + #[inline(always)] + pub fn reload(self) -> &'a mut W { + self.variant(RR_AW::RELOAD) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub unsafe fn bits(self, value: u32) -> &'a mut W { + self.w.bits = (self.w.bits & !0xffff_ffff) | (value as u32 & 0xffff_ffff); + self.w + } +} +impl W { + #[doc = "Bits 0:31 - Reload request register"] + #[inline(always)] + pub fn rr(&mut self) -> RR_W { + RR_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Description collection\\[0\\]: Reload request 0\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rr](index.html) module"] +pub struct RR_SPEC; +impl crate::RegisterSpec for RR_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [rr::W](W) writer structure"] +impl crate::Writable for RR_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets RR[%s] +to value 0"] +impl crate::Resettable for RR_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/wdt/rren.rs b/src/wdt/rren.rs new file mode 100644 index 0000000..69846a8 --- /dev/null +++ b/src/wdt/rren.rs @@ -0,0 +1,882 @@ +#[doc = "Register `RREN` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Register `RREN` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +#[doc = "Enable or disable RR\\[0\\] +register\n\nValue on reset: 1"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RR0_A { + #[doc = "0: Disable RR\\[0\\] +register"] + DISABLED = 0, + #[doc = "1: Enable RR\\[0\\] +register"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RR0_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RR0` reader - Enable or disable RR\\[0\\] +register"] +pub struct RR0_R(crate::FieldReader); +impl RR0_R { + pub(crate) fn new(bits: bool) -> Self { + RR0_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RR0_A { + match self.bits { + false => RR0_A::DISABLED, + true => RR0_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RR0_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RR0_A::ENABLED + } +} +impl core::ops::Deref for RR0_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RR0` writer - Enable or disable RR\\[0\\] +register"] +pub struct RR0_W<'a> { + w: &'a mut W, +} +impl<'a> RR0_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RR0_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable RR\\[0\\] +register"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(RR0_A::DISABLED) + } + #[doc = "Enable RR\\[0\\] +register"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(RR0_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); + self.w + } +} +#[doc = "Enable or disable RR\\[1\\] +register\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RR1_A { + #[doc = "0: Disable RR\\[1\\] +register"] + DISABLED = 0, + #[doc = "1: Enable RR\\[1\\] +register"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RR1_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RR1` reader - Enable or disable RR\\[1\\] +register"] +pub struct RR1_R(crate::FieldReader); +impl RR1_R { + pub(crate) fn new(bits: bool) -> Self { + RR1_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RR1_A { + match self.bits { + false => RR1_A::DISABLED, + true => RR1_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RR1_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RR1_A::ENABLED + } +} +impl core::ops::Deref for RR1_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RR1` writer - Enable or disable RR\\[1\\] +register"] +pub struct RR1_W<'a> { + w: &'a mut W, +} +impl<'a> RR1_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RR1_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable RR\\[1\\] +register"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(RR1_A::DISABLED) + } + #[doc = "Enable RR\\[1\\] +register"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(RR1_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1); + self.w + } +} +#[doc = "Enable or disable RR\\[2\\] +register\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RR2_A { + #[doc = "0: Disable RR\\[2\\] +register"] + DISABLED = 0, + #[doc = "1: Enable RR\\[2\\] +register"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RR2_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RR2` reader - Enable or disable RR\\[2\\] +register"] +pub struct RR2_R(crate::FieldReader); +impl RR2_R { + pub(crate) fn new(bits: bool) -> Self { + RR2_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RR2_A { + match self.bits { + false => RR2_A::DISABLED, + true => RR2_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RR2_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RR2_A::ENABLED + } +} +impl core::ops::Deref for RR2_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RR2` writer - Enable or disable RR\\[2\\] +register"] +pub struct RR2_W<'a> { + w: &'a mut W, +} +impl<'a> RR2_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RR2_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable RR\\[2\\] +register"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(RR2_A::DISABLED) + } + #[doc = "Enable RR\\[2\\] +register"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(RR2_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2); + self.w + } +} +#[doc = "Enable or disable RR\\[3\\] +register\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RR3_A { + #[doc = "0: Disable RR\\[3\\] +register"] + DISABLED = 0, + #[doc = "1: Enable RR\\[3\\] +register"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RR3_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RR3` reader - Enable or disable RR\\[3\\] +register"] +pub struct RR3_R(crate::FieldReader); +impl RR3_R { + pub(crate) fn new(bits: bool) -> Self { + RR3_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RR3_A { + match self.bits { + false => RR3_A::DISABLED, + true => RR3_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RR3_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RR3_A::ENABLED + } +} +impl core::ops::Deref for RR3_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RR3` writer - Enable or disable RR\\[3\\] +register"] +pub struct RR3_W<'a> { + w: &'a mut W, +} +impl<'a> RR3_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RR3_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable RR\\[3\\] +register"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(RR3_A::DISABLED) + } + #[doc = "Enable RR\\[3\\] +register"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(RR3_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3); + self.w + } +} +#[doc = "Enable or disable RR\\[4\\] +register\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RR4_A { + #[doc = "0: Disable RR\\[4\\] +register"] + DISABLED = 0, + #[doc = "1: Enable RR\\[4\\] +register"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RR4_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RR4` reader - Enable or disable RR\\[4\\] +register"] +pub struct RR4_R(crate::FieldReader); +impl RR4_R { + pub(crate) fn new(bits: bool) -> Self { + RR4_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RR4_A { + match self.bits { + false => RR4_A::DISABLED, + true => RR4_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RR4_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RR4_A::ENABLED + } +} +impl core::ops::Deref for RR4_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RR4` writer - Enable or disable RR\\[4\\] +register"] +pub struct RR4_W<'a> { + w: &'a mut W, +} +impl<'a> RR4_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RR4_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable RR\\[4\\] +register"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(RR4_A::DISABLED) + } + #[doc = "Enable RR\\[4\\] +register"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(RR4_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4); + self.w + } +} +#[doc = "Enable or disable RR\\[5\\] +register\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RR5_A { + #[doc = "0: Disable RR\\[5\\] +register"] + DISABLED = 0, + #[doc = "1: Enable RR\\[5\\] +register"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RR5_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RR5` reader - Enable or disable RR\\[5\\] +register"] +pub struct RR5_R(crate::FieldReader); +impl RR5_R { + pub(crate) fn new(bits: bool) -> Self { + RR5_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RR5_A { + match self.bits { + false => RR5_A::DISABLED, + true => RR5_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RR5_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RR5_A::ENABLED + } +} +impl core::ops::Deref for RR5_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RR5` writer - Enable or disable RR\\[5\\] +register"] +pub struct RR5_W<'a> { + w: &'a mut W, +} +impl<'a> RR5_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RR5_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable RR\\[5\\] +register"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(RR5_A::DISABLED) + } + #[doc = "Enable RR\\[5\\] +register"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(RR5_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5); + self.w + } +} +#[doc = "Enable or disable RR\\[6\\] +register\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RR6_A { + #[doc = "0: Disable RR\\[6\\] +register"] + DISABLED = 0, + #[doc = "1: Enable RR\\[6\\] +register"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RR6_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RR6` reader - Enable or disable RR\\[6\\] +register"] +pub struct RR6_R(crate::FieldReader); +impl RR6_R { + pub(crate) fn new(bits: bool) -> Self { + RR6_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RR6_A { + match self.bits { + false => RR6_A::DISABLED, + true => RR6_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RR6_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RR6_A::ENABLED + } +} +impl core::ops::Deref for RR6_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RR6` writer - Enable or disable RR\\[6\\] +register"] +pub struct RR6_W<'a> { + w: &'a mut W, +} +impl<'a> RR6_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RR6_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable RR\\[6\\] +register"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(RR6_A::DISABLED) + } + #[doc = "Enable RR\\[6\\] +register"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(RR6_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6); + self.w + } +} +#[doc = "Enable or disable RR\\[7\\] +register\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RR7_A { + #[doc = "0: Disable RR\\[7\\] +register"] + DISABLED = 0, + #[doc = "1: Enable RR\\[7\\] +register"] + ENABLED = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RR7_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RR7` reader - Enable or disable RR\\[7\\] +register"] +pub struct RR7_R(crate::FieldReader); +impl RR7_R { + pub(crate) fn new(bits: bool) -> Self { + RR7_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RR7_A { + match self.bits { + false => RR7_A::DISABLED, + true => RR7_A::ENABLED, + } + } + #[doc = "Checks if the value of the field is `DISABLED`"] + #[inline(always)] + pub fn is_disabled(&self) -> bool { + **self == RR7_A::DISABLED + } + #[doc = "Checks if the value of the field is `ENABLED`"] + #[inline(always)] + pub fn is_enabled(&self) -> bool { + **self == RR7_A::ENABLED + } +} +impl core::ops::Deref for RR7_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +#[doc = "Field `RR7` writer - Enable or disable RR\\[7\\] +register"] +pub struct RR7_W<'a> { + w: &'a mut W, +} +impl<'a> RR7_W<'a> { + #[doc = r"Writes `variant` to the field"] + #[inline(always)] + pub fn variant(self, variant: RR7_A) -> &'a mut W { + self.bit(variant.into()) + } + #[doc = "Disable RR\\[7\\] +register"] + #[inline(always)] + pub fn disabled(self) -> &'a mut W { + self.variant(RR7_A::DISABLED) + } + #[doc = "Enable RR\\[7\\] +register"] + #[inline(always)] + pub fn enabled(self) -> &'a mut W { + self.variant(RR7_A::ENABLED) + } + #[doc = r"Sets the field bit"] + #[inline(always)] + pub fn set_bit(self) -> &'a mut W { + self.bit(true) + } + #[doc = r"Clears the field bit"] + #[inline(always)] + pub fn clear_bit(self) -> &'a mut W { + self.bit(false) + } + #[doc = r"Writes raw bits to the field"] + #[inline(always)] + pub fn bit(self, value: bool) -> &'a mut W { + self.w.bits = (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7); + self.w + } +} +impl R { + #[doc = "Bit 0 - Enable or disable RR\\[0\\] +register"] + #[inline(always)] + pub fn rr0(&self) -> RR0_R { + RR0_R::new((self.bits & 0x01) != 0) + } + #[doc = "Bit 1 - Enable or disable RR\\[1\\] +register"] + #[inline(always)] + pub fn rr1(&self) -> RR1_R { + RR1_R::new(((self.bits >> 1) & 0x01) != 0) + } + #[doc = "Bit 2 - Enable or disable RR\\[2\\] +register"] + #[inline(always)] + pub fn rr2(&self) -> RR2_R { + RR2_R::new(((self.bits >> 2) & 0x01) != 0) + } + #[doc = "Bit 3 - Enable or disable RR\\[3\\] +register"] + #[inline(always)] + pub fn rr3(&self) -> RR3_R { + RR3_R::new(((self.bits >> 3) & 0x01) != 0) + } + #[doc = "Bit 4 - Enable or disable RR\\[4\\] +register"] + #[inline(always)] + pub fn rr4(&self) -> RR4_R { + RR4_R::new(((self.bits >> 4) & 0x01) != 0) + } + #[doc = "Bit 5 - Enable or disable RR\\[5\\] +register"] + #[inline(always)] + pub fn rr5(&self) -> RR5_R { + RR5_R::new(((self.bits >> 5) & 0x01) != 0) + } + #[doc = "Bit 6 - Enable or disable RR\\[6\\] +register"] + #[inline(always)] + pub fn rr6(&self) -> RR6_R { + RR6_R::new(((self.bits >> 6) & 0x01) != 0) + } + #[doc = "Bit 7 - Enable or disable RR\\[7\\] +register"] + #[inline(always)] + pub fn rr7(&self) -> RR7_R { + RR7_R::new(((self.bits >> 7) & 0x01) != 0) + } +} +impl W { + #[doc = "Bit 0 - Enable or disable RR\\[0\\] +register"] + #[inline(always)] + pub fn rr0(&mut self) -> RR0_W { + RR0_W { w: self } + } + #[doc = "Bit 1 - Enable or disable RR\\[1\\] +register"] + #[inline(always)] + pub fn rr1(&mut self) -> RR1_W { + RR1_W { w: self } + } + #[doc = "Bit 2 - Enable or disable RR\\[2\\] +register"] + #[inline(always)] + pub fn rr2(&mut self) -> RR2_W { + RR2_W { w: self } + } + #[doc = "Bit 3 - Enable or disable RR\\[3\\] +register"] + #[inline(always)] + pub fn rr3(&mut self) -> RR3_W { + RR3_W { w: self } + } + #[doc = "Bit 4 - Enable or disable RR\\[4\\] +register"] + #[inline(always)] + pub fn rr4(&mut self) -> RR4_W { + RR4_W { w: self } + } + #[doc = "Bit 5 - Enable or disable RR\\[5\\] +register"] + #[inline(always)] + pub fn rr5(&mut self) -> RR5_W { + RR5_W { w: self } + } + #[doc = "Bit 6 - Enable or disable RR\\[6\\] +register"] + #[inline(always)] + pub fn rr6(&mut self) -> RR6_W { + RR6_W { w: self } + } + #[doc = "Bit 7 - Enable or disable RR\\[7\\] +register"] + #[inline(always)] + pub fn rr7(&mut self) -> RR7_W { + RR7_W { w: self } + } + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Enable register for reload request registers\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [rren](index.html) module"] +pub struct RREN_SPEC; +impl crate::RegisterSpec for RREN_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [rren::R](R) reader structure"] +impl crate::Readable for RREN_SPEC { + type Reader = R; +} +#[doc = "`write(|w| ..)` method takes [rren::W](W) writer structure"] +impl crate::Writable for RREN_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets RREN to value 0x01"] +impl crate::Resettable for RREN_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0x01 + } +} diff --git a/src/wdt/runstatus.rs b/src/wdt/runstatus.rs new file mode 100644 index 0000000..1fa2c08 --- /dev/null +++ b/src/wdt/runstatus.rs @@ -0,0 +1,84 @@ +#[doc = "Register `RUNSTATUS` reader"] +pub struct R(crate::R); +impl core::ops::Deref for R { + type Target = crate::R; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl From> for R { + #[inline(always)] + fn from(reader: crate::R) -> Self { + R(reader) + } +} +#[doc = "Indicates whether or not the watchdog is running\n\nValue on reset: 0"] +#[derive(Clone, Copy, Debug, PartialEq)] +pub enum RUNSTATUS_A { + #[doc = "0: Watchdog not running"] + NOTRUNNING = 0, + #[doc = "1: Watchdog is running"] + RUNNING = 1, +} +impl From for bool { + #[inline(always)] + fn from(variant: RUNSTATUS_A) -> Self { + variant as u8 != 0 + } +} +#[doc = "Field `RUNSTATUS` reader - Indicates whether or not the watchdog is running"] +pub struct RUNSTATUS_R(crate::FieldReader); +impl RUNSTATUS_R { + pub(crate) fn new(bits: bool) -> Self { + RUNSTATUS_R(crate::FieldReader::new(bits)) + } + #[doc = r"Get enumerated values variant"] + #[inline(always)] + pub fn variant(&self) -> RUNSTATUS_A { + match self.bits { + false => RUNSTATUS_A::NOTRUNNING, + true => RUNSTATUS_A::RUNNING, + } + } + #[doc = "Checks if the value of the field is `NOTRUNNING`"] + #[inline(always)] + pub fn is_not_running(&self) -> bool { + **self == RUNSTATUS_A::NOTRUNNING + } + #[doc = "Checks if the value of the field is `RUNNING`"] + #[inline(always)] + pub fn is_running(&self) -> bool { + **self == RUNSTATUS_A::RUNNING + } +} +impl core::ops::Deref for RUNSTATUS_R { + type Target = crate::FieldReader; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl R { + #[doc = "Bit 0 - Indicates whether or not the watchdog is running"] + #[inline(always)] + pub fn runstatus(&self) -> RUNSTATUS_R { + RUNSTATUS_R::new((self.bits & 0x01) != 0) + } +} +#[doc = "Run status\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 [runstatus](index.html) module"] +pub struct RUNSTATUS_SPEC; +impl crate::RegisterSpec for RUNSTATUS_SPEC { + type Ux = u32; +} +#[doc = "`read()` method returns [runstatus::R](R) reader structure"] +impl crate::Readable for RUNSTATUS_SPEC { + type Reader = R; +} +#[doc = "`reset()` method sets RUNSTATUS to value 0"] +impl crate::Resettable for RUNSTATUS_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +} diff --git a/src/wdt/tasks_start.rs b/src/wdt/tasks_start.rs new file mode 100644 index 0000000..c8a5f49 --- /dev/null +++ b/src/wdt/tasks_start.rs @@ -0,0 +1,45 @@ +#[doc = "Register `TASKS_START` writer"] +pub struct W(crate::W); +impl core::ops::Deref for W { + type Target = crate::W; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl core::ops::DerefMut for W { + #[inline(always)] + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} +impl From> for W { + #[inline(always)] + fn from(writer: crate::W) -> Self { + W(writer) + } +} +impl W { + #[doc = "Writes raw bits to the register."] + #[inline(always)] + pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { + self.0.bits(bits); + self + } +} +#[doc = "Start the watchdog\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_start](index.html) module"] +pub struct TASKS_START_SPEC; +impl crate::RegisterSpec for TASKS_START_SPEC { + type Ux = u32; +} +#[doc = "`write(|w| ..)` method takes [tasks_start::W](W) writer structure"] +impl crate::Writable for TASKS_START_SPEC { + type Writer = W; +} +#[doc = "`reset()` method sets TASKS_START to value 0"] +impl crate::Resettable for TASKS_START_SPEC { + #[inline(always)] + fn reset_value() -> Self::Ux { + 0 + } +}