feat: add display UI with splash screen, dashboard, and RSSI sparkline

Implement full SSD1306 OLED display support:
- Splash screen on boot (1.5s) with project name, version, board
- Dashboard showing radio state, config, counters, RSSI/SNR
- RSSI history sparkline (64-sample ring buffer, 2px-wide bars)
- DisplayOn/DisplayOff host commands routed via dedicated channel
- Pure render functions against generic DrawTarget (no hardware coupling)
- Display on/off control bypasses radio task entirely

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Opus 4.6 committed 2026-03-29 20:42:54 -06:00
1 parent 7064110293
commit 3102fc747a
17624 files changed
+4564928 -38

No files matched your search

+126
View File
@@ -0,0 +1,126 @@
#[doc = "Register `DCDCEN` reader"]
pub struct R(crate::R<DCDCEN_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<DCDCEN_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<DCDCEN_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<DCDCEN_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `DCDCEN` writer"]
pub struct W(crate::W<DCDCEN_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<DCDCEN_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<DCDCEN_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<DCDCEN_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `DCDCEN` reader - Enable or disable DC/DC converter"]
pub type DCDCEN_R = crate::BitReader<DCDCEN_A>;
#[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<DCDCEN_A> for bool {
#[inline(always)]
fn from(variant: DCDCEN_A) -> Self {
variant as u8 != 0
}
}
impl DCDCEN_R {
#[doc = "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
}
}
#[doc = "Field `DCDCEN` writer - Enable or disable DC/DC converter"]
pub type DCDCEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DCDCEN_SPEC, DCDCEN_A, O>;
impl<'a, const O: u8> DCDCEN_W<'a, O> {
#[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)
}
}
impl R {
#[doc = "Bit 0 - Enable or disable DC/DC converter"]
#[inline(always)]
pub fn dcdcen(&self) -> DCDCEN_R {
DCDCEN_R::new((self.bits & 1) != 0)
}
}
impl W {
#[doc = "Bit 0 - Enable or disable DC/DC converter"]
#[inline(always)]
pub fn dcdcen(&mut self) -> DCDCEN_W<0> {
DCDCEN_W::new(self)
}
#[doc = "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
}
}
+64
View File
@@ -0,0 +1,64 @@
#[doc = "Register `EVENTS_POFWARN` reader"]
pub struct R(crate::R<EVENTS_POFWARN_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<EVENTS_POFWARN_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<EVENTS_POFWARN_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<EVENTS_POFWARN_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `EVENTS_POFWARN` writer"]
pub struct W(crate::W<EVENTS_POFWARN_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<EVENTS_POFWARN_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<EVENTS_POFWARN_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EVENTS_POFWARN_SPEC>) -> 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
}
}
+64
View File
@@ -0,0 +1,64 @@
#[doc = "Register `EVENTS_SLEEPENTER` reader"]
pub struct R(crate::R<EVENTS_SLEEPENTER_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<EVENTS_SLEEPENTER_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<EVENTS_SLEEPENTER_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<EVENTS_SLEEPENTER_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `EVENTS_SLEEPENTER` writer"]
pub struct W(crate::W<EVENTS_SLEEPENTER_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<EVENTS_SLEEPENTER_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<EVENTS_SLEEPENTER_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EVENTS_SLEEPENTER_SPEC>) -> 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
}
}
+64
View File
@@ -0,0 +1,64 @@
#[doc = "Register `EVENTS_SLEEPEXIT` reader"]
pub struct R(crate::R<EVENTS_SLEEPEXIT_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<EVENTS_SLEEPEXIT_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<EVENTS_SLEEPEXIT_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<EVENTS_SLEEPEXIT_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `EVENTS_SLEEPEXIT` writer"]
pub struct W(crate::W<EVENTS_SLEEPEXIT_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<EVENTS_SLEEPEXIT_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<EVENTS_SLEEPEXIT_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EVENTS_SLEEPEXIT_SPEC>) -> 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
}
}
+80
View File
@@ -0,0 +1,80 @@
#[doc = "Register `GPREGRET` reader"]
pub struct R(crate::R<GPREGRET_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<GPREGRET_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<GPREGRET_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<GPREGRET_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `GPREGRET` writer"]
pub struct W(crate::W<GPREGRET_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<GPREGRET_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<GPREGRET_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<GPREGRET_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `GPREGRET` reader - General purpose retention register"]
pub type GPREGRET_R = crate::FieldReader<u8, u8>;
#[doc = "Field `GPREGRET` writer - General purpose retention register"]
pub type GPREGRET_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GPREGRET_SPEC, u8, u8, 8, O>;
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<0> {
GPREGRET_W::new(self)
}
#[doc = "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
}
}
+80
View File
@@ -0,0 +1,80 @@
#[doc = "Register `GPREGRET2` reader"]
pub struct R(crate::R<GPREGRET2_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<GPREGRET2_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<GPREGRET2_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<GPREGRET2_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `GPREGRET2` writer"]
pub struct W(crate::W<GPREGRET2_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<GPREGRET2_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<GPREGRET2_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<GPREGRET2_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `GPREGRET` reader - General purpose retention register"]
pub type GPREGRET_R = crate::FieldReader<u8, u8>;
#[doc = "Field `GPREGRET` writer - General purpose retention register"]
pub type GPREGRET_W<'a, const O: u8> = crate::FieldWriter<'a, u32, GPREGRET2_SPEC, u8, u8, 8, O>;
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<0> {
GPREGRET_W::new(self)
}
#[doc = "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
}
}
+267
View File
@@ -0,0 +1,267 @@
#[doc = "Register `INTENCLR` reader"]
pub struct R(crate::R<INTENCLR_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<INTENCLR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<INTENCLR_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<INTENCLR_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `INTENCLR` writer"]
pub struct W(crate::W<INTENCLR_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<INTENCLR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<INTENCLR_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<INTENCLR_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `POFWARN` reader - Write '1' to Disable interrupt for POFWARN event"]
pub type POFWARN_R = crate::BitReader<POFWARN_A>;
#[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<POFWARN_A> for bool {
#[inline(always)]
fn from(variant: POFWARN_A) -> Self {
variant as u8 != 0
}
}
impl POFWARN_R {
#[doc = "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
}
}
#[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<POFWARN_AW> 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 type POFWARN_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENCLR_SPEC, POFWARN_AW, O>;
impl<'a, const O: u8> POFWARN_W<'a, O> {
#[doc = "Disable"]
#[inline(always)]
pub fn clear(self) -> &'a mut W {
self.variant(POFWARN_AW::CLEAR)
}
}
#[doc = "Field `SLEEPENTER` reader - Write '1' to Disable interrupt for SLEEPENTER event"]
pub type SLEEPENTER_R = crate::BitReader<SLEEPENTER_A>;
#[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<SLEEPENTER_A> for bool {
#[inline(always)]
fn from(variant: SLEEPENTER_A) -> Self {
variant as u8 != 0
}
}
impl SLEEPENTER_R {
#[doc = "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
}
}
#[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<SLEEPENTER_AW> 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 type SLEEPENTER_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENCLR_SPEC, SLEEPENTER_AW, O>;
impl<'a, const O: u8> SLEEPENTER_W<'a, O> {
#[doc = "Disable"]
#[inline(always)]
pub fn clear(self) -> &'a mut W {
self.variant(SLEEPENTER_AW::CLEAR)
}
}
#[doc = "Field `SLEEPEXIT` reader - Write '1' to Disable interrupt for SLEEPEXIT event"]
pub type SLEEPEXIT_R = crate::BitReader<SLEEPEXIT_A>;
#[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<SLEEPEXIT_A> for bool {
#[inline(always)]
fn from(variant: SLEEPEXIT_A) -> Self {
variant as u8 != 0
}
}
impl SLEEPEXIT_R {
#[doc = "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
}
}
#[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<SLEEPEXIT_AW> 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 type SLEEPEXIT_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENCLR_SPEC, SLEEPEXIT_AW, O>;
impl<'a, const O: u8> SLEEPEXIT_W<'a, O> {
#[doc = "Disable"]
#[inline(always)]
pub fn clear(self) -> &'a mut W {
self.variant(SLEEPEXIT_AW::CLEAR)
}
}
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) & 1) != 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) & 1) != 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) & 1) != 0)
}
}
impl W {
#[doc = "Bit 2 - Write '1' to Disable interrupt for POFWARN event"]
#[inline(always)]
pub fn pofwarn(&mut self) -> POFWARN_W<2> {
POFWARN_W::new(self)
}
#[doc = "Bit 5 - Write '1' to Disable interrupt for SLEEPENTER event"]
#[inline(always)]
pub fn sleepenter(&mut self) -> SLEEPENTER_W<5> {
SLEEPENTER_W::new(self)
}
#[doc = "Bit 6 - Write '1' to Disable interrupt for SLEEPEXIT event"]
#[inline(always)]
pub fn sleepexit(&mut self) -> SLEEPEXIT_W<6> {
SLEEPEXIT_W::new(self)
}
#[doc = "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
}
}
+267
View File
@@ -0,0 +1,267 @@
#[doc = "Register `INTENSET` reader"]
pub struct R(crate::R<INTENSET_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<INTENSET_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<INTENSET_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<INTENSET_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `INTENSET` writer"]
pub struct W(crate::W<INTENSET_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<INTENSET_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<INTENSET_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<INTENSET_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `POFWARN` reader - Write '1' to Enable interrupt for POFWARN event"]
pub type POFWARN_R = crate::BitReader<POFWARN_A>;
#[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<POFWARN_A> for bool {
#[inline(always)]
fn from(variant: POFWARN_A) -> Self {
variant as u8 != 0
}
}
impl POFWARN_R {
#[doc = "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
}
}
#[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<POFWARN_AW> 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 type POFWARN_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENSET_SPEC, POFWARN_AW, O>;
impl<'a, const O: u8> POFWARN_W<'a, O> {
#[doc = "Enable"]
#[inline(always)]
pub fn set(self) -> &'a mut W {
self.variant(POFWARN_AW::SET)
}
}
#[doc = "Field `SLEEPENTER` reader - Write '1' to Enable interrupt for SLEEPENTER event"]
pub type SLEEPENTER_R = crate::BitReader<SLEEPENTER_A>;
#[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<SLEEPENTER_A> for bool {
#[inline(always)]
fn from(variant: SLEEPENTER_A) -> Self {
variant as u8 != 0
}
}
impl SLEEPENTER_R {
#[doc = "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
}
}
#[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<SLEEPENTER_AW> 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 type SLEEPENTER_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENSET_SPEC, SLEEPENTER_AW, O>;
impl<'a, const O: u8> SLEEPENTER_W<'a, O> {
#[doc = "Enable"]
#[inline(always)]
pub fn set(self) -> &'a mut W {
self.variant(SLEEPENTER_AW::SET)
}
}
#[doc = "Field `SLEEPEXIT` reader - Write '1' to Enable interrupt for SLEEPEXIT event"]
pub type SLEEPEXIT_R = crate::BitReader<SLEEPEXIT_A>;
#[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<SLEEPEXIT_A> for bool {
#[inline(always)]
fn from(variant: SLEEPEXIT_A) -> Self {
variant as u8 != 0
}
}
impl SLEEPEXIT_R {
#[doc = "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
}
}
#[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<SLEEPEXIT_AW> 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 type SLEEPEXIT_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENSET_SPEC, SLEEPEXIT_AW, O>;
impl<'a, const O: u8> SLEEPEXIT_W<'a, O> {
#[doc = "Enable"]
#[inline(always)]
pub fn set(self) -> &'a mut W {
self.variant(SLEEPEXIT_AW::SET)
}
}
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) & 1) != 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) & 1) != 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) & 1) != 0)
}
}
impl W {
#[doc = "Bit 2 - Write '1' to Enable interrupt for POFWARN event"]
#[inline(always)]
pub fn pofwarn(&mut self) -> POFWARN_W<2> {
POFWARN_W::new(self)
}
#[doc = "Bit 5 - Write '1' to Enable interrupt for SLEEPENTER event"]
#[inline(always)]
pub fn sleepenter(&mut self) -> SLEEPENTER_W<5> {
SLEEPENTER_W::new(self)
}
#[doc = "Bit 6 - Write '1' to Enable interrupt for SLEEPEXIT event"]
#[inline(always)]
pub fn sleepexit(&mut self) -> SLEEPEXIT_W<6> {
SLEEPEXIT_W::new(self)
}
#[doc = "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
}
}
+319
View File
@@ -0,0 +1,319 @@
#[doc = "Register `POFCON` reader"]
pub struct R(crate::R<POFCON_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<POFCON_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<POFCON_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<POFCON_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `POFCON` writer"]
pub struct W(crate::W<POFCON_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<POFCON_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<POFCON_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<POFCON_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `POF` reader - Enable or disable power failure comparator"]
pub type POF_R = crate::BitReader<POF_A>;
#[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<POF_A> for bool {
#[inline(always)]
fn from(variant: POF_A) -> Self {
variant as u8 != 0
}
}
impl POF_R {
#[doc = "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
}
}
#[doc = "Field `POF` writer - Enable or disable power failure comparator"]
pub type POF_W<'a, const O: u8> = crate::BitWriter<'a, u32, POFCON_SPEC, POF_A, O>;
impl<'a, const O: u8> POF_W<'a, O> {
#[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 = "Field `THRESHOLD` reader - Power failure comparator threshold setting"]
pub type THRESHOLD_R = crate::FieldReader<u8, THRESHOLD_A>;
#[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<THRESHOLD_A> for u8 {
#[inline(always)]
fn from(variant: THRESHOLD_A) -> Self {
variant as _
}
}
impl THRESHOLD_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> Option<THRESHOLD_A> {
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
}
}
#[doc = "Field `THRESHOLD` writer - Power failure comparator threshold setting"]
pub type THRESHOLD_W<'a, const O: u8> =
crate::FieldWriter<'a, u32, POFCON_SPEC, u8, THRESHOLD_A, 4, O>;
impl<'a, const O: u8> THRESHOLD_W<'a, O> {
#[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)
}
}
impl R {
#[doc = "Bit 0 - Enable or disable power failure comparator"]
#[inline(always)]
pub fn pof(&self) -> POF_R {
POF_R::new((self.bits & 1) != 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<0> {
POF_W::new(self)
}
#[doc = "Bits 1:4 - Power failure comparator threshold setting"]
#[inline(always)]
pub fn threshold(&mut self) -> THRESHOLD_W<1> {
THRESHOLD_W::new(self)
}
#[doc = "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
}
}
+22
View File
@@ -0,0 +1,22 @@
#[doc = r"Register block"]
#[repr(C)]
pub struct RAM {
#[doc = "0x00 - Description cluster\\[0\\]: RAM0 power control register"]
pub power: POWER,
#[doc = "0x04 - Description cluster\\[0\\]: RAM0 power control set register"]
pub powerset: POWERSET,
#[doc = "0x08 - Description cluster\\[0\\]: RAM0 power control clear register"]
pub powerclr: POWERCLR,
}
#[doc = "POWER (rw) register accessor: an alias for `Reg<POWER_SPEC>`"]
pub type POWER = crate::Reg<power::POWER_SPEC>;
#[doc = "Description cluster\\[0\\]: RAM0 power control register"]
pub mod power;
#[doc = "POWERSET (w) register accessor: an alias for `Reg<POWERSET_SPEC>`"]
pub type POWERSET = crate::Reg<powerset::POWERSET_SPEC>;
#[doc = "Description cluster\\[0\\]: RAM0 power control set register"]
pub mod powerset;
#[doc = "POWERCLR (w) register accessor: an alias for `Reg<POWERCLR_SPEC>`"]
pub type POWERCLR = crate::Reg<powerclr::POWERCLR_SPEC>;
#[doc = "Description cluster\\[0\\]: RAM0 power control clear register"]
pub mod powerclr;
+306
View File
@@ -0,0 +1,306 @@
#[doc = "Register `POWER` reader"]
pub struct R(crate::R<POWER_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<POWER_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<POWER_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<POWER_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `POWER` writer"]
pub struct W(crate::W<POWER_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<POWER_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<POWER_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<POWER_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `S0POWER` reader - Keep RAM section S0 ON or OFF in System ON mode."]
pub type S0POWER_R = crate::BitReader<S0POWER_A>;
#[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<S0POWER_A> for bool {
#[inline(always)]
fn from(variant: S0POWER_A) -> Self {
variant as u8 != 0
}
}
impl S0POWER_R {
#[doc = "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
}
}
#[doc = "Field `S0POWER` writer - Keep RAM section S0 ON or OFF in System ON mode."]
pub type S0POWER_W<'a, const O: u8> = crate::BitWriter<'a, u32, POWER_SPEC, S0POWER_A, O>;
impl<'a, const O: u8> S0POWER_W<'a, O> {
#[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 = "Field `S1POWER` reader - Keep RAM section S1 ON or OFF in System ON mode."]
pub type S1POWER_R = crate::BitReader<S1POWER_A>;
#[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<S1POWER_A> for bool {
#[inline(always)]
fn from(variant: S1POWER_A) -> Self {
variant as u8 != 0
}
}
impl S1POWER_R {
#[doc = "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
}
}
#[doc = "Field `S1POWER` writer - Keep RAM section S1 ON or OFF in System ON mode."]
pub type S1POWER_W<'a, const O: u8> = crate::BitWriter<'a, u32, POWER_SPEC, S1POWER_A, O>;
impl<'a, const O: u8> S1POWER_W<'a, O> {
#[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 = "Field `S0RETENTION` reader - Keep retention on RAM section S0 when RAM section is in OFF"]
pub type S0RETENTION_R = crate::BitReader<S0RETENTION_A>;
#[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<S0RETENTION_A> for bool {
#[inline(always)]
fn from(variant: S0RETENTION_A) -> Self {
variant as u8 != 0
}
}
impl S0RETENTION_R {
#[doc = "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
}
}
#[doc = "Field `S0RETENTION` writer - Keep retention on RAM section S0 when RAM section is in OFF"]
pub type S0RETENTION_W<'a, const O: u8> = crate::BitWriter<'a, u32, POWER_SPEC, S0RETENTION_A, O>;
impl<'a, const O: u8> S0RETENTION_W<'a, O> {
#[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 = "Field `S1RETENTION` reader - Keep retention on RAM section S1 when RAM section is in OFF"]
pub type S1RETENTION_R = crate::BitReader<S1RETENTION_A>;
#[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<S1RETENTION_A> for bool {
#[inline(always)]
fn from(variant: S1RETENTION_A) -> Self {
variant as u8 != 0
}
}
impl S1RETENTION_R {
#[doc = "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
}
}
#[doc = "Field `S1RETENTION` writer - Keep retention on RAM section S1 when RAM section is in OFF"]
pub type S1RETENTION_W<'a, const O: u8> = crate::BitWriter<'a, u32, POWER_SPEC, S1RETENTION_A, O>;
impl<'a, const O: u8> S1RETENTION_W<'a, O> {
#[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)
}
}
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 & 1) != 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) & 1) != 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) & 1) != 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) & 1) != 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<0> {
S0POWER_W::new(self)
}
#[doc = "Bit 1 - Keep RAM section S1 ON or OFF in System ON mode."]
#[inline(always)]
pub fn s1power(&mut self) -> S1POWER_W<1> {
S1POWER_W::new(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<16> {
S0RETENTION_W::new(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<17> {
S1RETENTION_W::new(self)
}
#[doc = "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
}
}
+151
View File
@@ -0,0 +1,151 @@
#[doc = "Register `POWERCLR` writer"]
pub struct W(crate::W<POWERCLR_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<POWERCLR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<POWERCLR_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<POWERCLR_SPEC>) -> 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<S0POWER_AW> 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 type S0POWER_W<'a, const O: u8> = crate::BitWriter<'a, u32, POWERCLR_SPEC, S0POWER_AW, O>;
impl<'a, const O: u8> S0POWER_W<'a, O> {
#[doc = "Off"]
#[inline(always)]
pub fn off(self) -> &'a mut W {
self.variant(S0POWER_AW::OFF)
}
}
#[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<S1POWER_AW> 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 type S1POWER_W<'a, const O: u8> = crate::BitWriter<'a, u32, POWERCLR_SPEC, S1POWER_AW, O>;
impl<'a, const O: u8> S1POWER_W<'a, O> {
#[doc = "Off"]
#[inline(always)]
pub fn off(self) -> &'a mut W {
self.variant(S1POWER_AW::OFF)
}
}
#[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<S0RETENTION_AW> 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 type S0RETENTION_W<'a, const O: u8> =
crate::BitWriter<'a, u32, POWERCLR_SPEC, S0RETENTION_AW, O>;
impl<'a, const O: u8> S0RETENTION_W<'a, O> {
#[doc = "Off"]
#[inline(always)]
pub fn off(self) -> &'a mut W {
self.variant(S0RETENTION_AW::OFF)
}
}
#[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<S1RETENTION_AW> 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 type S1RETENTION_W<'a, const O: u8> =
crate::BitWriter<'a, u32, POWERCLR_SPEC, S1RETENTION_AW, O>;
impl<'a, const O: u8> S1RETENTION_W<'a, O> {
#[doc = "Off"]
#[inline(always)]
pub fn off(self) -> &'a mut W {
self.variant(S1RETENTION_AW::OFF)
}
}
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<0> {
S0POWER_W::new(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<1> {
S1POWER_W::new(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<16> {
S0RETENTION_W::new(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<17> {
S1RETENTION_W::new(self)
}
#[doc = "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
}
}
+151
View File
@@ -0,0 +1,151 @@
#[doc = "Register `POWERSET` writer"]
pub struct W(crate::W<POWERSET_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<POWERSET_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<POWERSET_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<POWERSET_SPEC>) -> 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<S0POWER_AW> 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 type S0POWER_W<'a, const O: u8> = crate::BitWriter<'a, u32, POWERSET_SPEC, S0POWER_AW, O>;
impl<'a, const O: u8> S0POWER_W<'a, O> {
#[doc = "On"]
#[inline(always)]
pub fn on(self) -> &'a mut W {
self.variant(S0POWER_AW::ON)
}
}
#[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<S1POWER_AW> 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 type S1POWER_W<'a, const O: u8> = crate::BitWriter<'a, u32, POWERSET_SPEC, S1POWER_AW, O>;
impl<'a, const O: u8> S1POWER_W<'a, O> {
#[doc = "On"]
#[inline(always)]
pub fn on(self) -> &'a mut W {
self.variant(S1POWER_AW::ON)
}
}
#[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<S0RETENTION_AW> 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 type S0RETENTION_W<'a, const O: u8> =
crate::BitWriter<'a, u32, POWERSET_SPEC, S0RETENTION_AW, O>;
impl<'a, const O: u8> S0RETENTION_W<'a, O> {
#[doc = "On"]
#[inline(always)]
pub fn on(self) -> &'a mut W {
self.variant(S0RETENTION_AW::ON)
}
}
#[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<S1RETENTION_AW> 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 type S1RETENTION_W<'a, const O: u8> =
crate::BitWriter<'a, u32, POWERSET_SPEC, S1RETENTION_AW, O>;
impl<'a, const O: u8> S1RETENTION_W<'a, O> {
#[doc = "On"]
#[inline(always)]
pub fn on(self) -> &'a mut W {
self.variant(S1RETENTION_AW::ON)
}
}
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<0> {
S0POWER_W::new(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<1> {
S1POWER_W::new(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<16> {
S0RETENTION_W::new(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<17> {
S1RETENTION_W::new(self)
}
#[doc = "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
}
}
+306
View File
@@ -0,0 +1,306 @@
#[doc = "Register `RAMON` reader"]
pub struct R(crate::R<RAMON_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<RAMON_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<RAMON_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<RAMON_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `RAMON` writer"]
pub struct W(crate::W<RAMON_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<RAMON_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<RAMON_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<RAMON_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `ONRAM0` reader - Keep RAM block 0 on or off in system ON Mode"]
pub type ONRAM0_R = crate::BitReader<ONRAM0_A>;
#[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<ONRAM0_A> for bool {
#[inline(always)]
fn from(variant: ONRAM0_A) -> Self {
variant as u8 != 0
}
}
impl ONRAM0_R {
#[doc = "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
}
}
#[doc = "Field `ONRAM0` writer - Keep RAM block 0 on or off in system ON Mode"]
pub type ONRAM0_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAMON_SPEC, ONRAM0_A, O>;
impl<'a, const O: u8> ONRAM0_W<'a, O> {
#[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 = "Field `ONRAM1` reader - Keep RAM block 1 on or off in system ON Mode"]
pub type ONRAM1_R = crate::BitReader<ONRAM1_A>;
#[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<ONRAM1_A> for bool {
#[inline(always)]
fn from(variant: ONRAM1_A) -> Self {
variant as u8 != 0
}
}
impl ONRAM1_R {
#[doc = "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
}
}
#[doc = "Field `ONRAM1` writer - Keep RAM block 1 on or off in system ON Mode"]
pub type ONRAM1_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAMON_SPEC, ONRAM1_A, O>;
impl<'a, const O: u8> ONRAM1_W<'a, O> {
#[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 = "Field `OFFRAM0` reader - Keep retention on RAM block 0 when RAM block is switched off"]
pub type OFFRAM0_R = crate::BitReader<OFFRAM0_A>;
#[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<OFFRAM0_A> for bool {
#[inline(always)]
fn from(variant: OFFRAM0_A) -> Self {
variant as u8 != 0
}
}
impl OFFRAM0_R {
#[doc = "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
}
}
#[doc = "Field `OFFRAM0` writer - Keep retention on RAM block 0 when RAM block is switched off"]
pub type OFFRAM0_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAMON_SPEC, OFFRAM0_A, O>;
impl<'a, const O: u8> OFFRAM0_W<'a, O> {
#[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 = "Field `OFFRAM1` reader - Keep retention on RAM block 1 when RAM block is switched off"]
pub type OFFRAM1_R = crate::BitReader<OFFRAM1_A>;
#[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<OFFRAM1_A> for bool {
#[inline(always)]
fn from(variant: OFFRAM1_A) -> Self {
variant as u8 != 0
}
}
impl OFFRAM1_R {
#[doc = "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
}
}
#[doc = "Field `OFFRAM1` writer - Keep retention on RAM block 1 when RAM block is switched off"]
pub type OFFRAM1_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAMON_SPEC, OFFRAM1_A, O>;
impl<'a, const O: u8> OFFRAM1_W<'a, O> {
#[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)
}
}
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 & 1) != 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) & 1) != 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) & 1) != 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) & 1) != 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<0> {
ONRAM0_W::new(self)
}
#[doc = "Bit 1 - Keep RAM block 1 on or off in system ON Mode"]
#[inline(always)]
pub fn onram1(&mut self) -> ONRAM1_W<1> {
ONRAM1_W::new(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<16> {
OFFRAM0_W::new(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<17> {
OFFRAM1_W::new(self)
}
#[doc = "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
}
}
+306
View File
@@ -0,0 +1,306 @@
#[doc = "Register `RAMONB` reader"]
pub struct R(crate::R<RAMONB_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<RAMONB_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<RAMONB_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<RAMONB_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `RAMONB` writer"]
pub struct W(crate::W<RAMONB_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<RAMONB_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<RAMONB_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<RAMONB_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `ONRAM2` reader - Keep RAM block 2 on or off in system ON Mode"]
pub type ONRAM2_R = crate::BitReader<ONRAM2_A>;
#[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<ONRAM2_A> for bool {
#[inline(always)]
fn from(variant: ONRAM2_A) -> Self {
variant as u8 != 0
}
}
impl ONRAM2_R {
#[doc = "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
}
}
#[doc = "Field `ONRAM2` writer - Keep RAM block 2 on or off in system ON Mode"]
pub type ONRAM2_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAMONB_SPEC, ONRAM2_A, O>;
impl<'a, const O: u8> ONRAM2_W<'a, O> {
#[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 = "Field `ONRAM3` reader - Keep RAM block 3 on or off in system ON Mode"]
pub type ONRAM3_R = crate::BitReader<ONRAM3_A>;
#[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<ONRAM3_A> for bool {
#[inline(always)]
fn from(variant: ONRAM3_A) -> Self {
variant as u8 != 0
}
}
impl ONRAM3_R {
#[doc = "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
}
}
#[doc = "Field `ONRAM3` writer - Keep RAM block 3 on or off in system ON Mode"]
pub type ONRAM3_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAMONB_SPEC, ONRAM3_A, O>;
impl<'a, const O: u8> ONRAM3_W<'a, O> {
#[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 = "Field `OFFRAM2` reader - Keep retention on RAM block 2 when RAM block is switched off"]
pub type OFFRAM2_R = crate::BitReader<OFFRAM2_A>;
#[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<OFFRAM2_A> for bool {
#[inline(always)]
fn from(variant: OFFRAM2_A) -> Self {
variant as u8 != 0
}
}
impl OFFRAM2_R {
#[doc = "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
}
}
#[doc = "Field `OFFRAM2` writer - Keep retention on RAM block 2 when RAM block is switched off"]
pub type OFFRAM2_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAMONB_SPEC, OFFRAM2_A, O>;
impl<'a, const O: u8> OFFRAM2_W<'a, O> {
#[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 = "Field `OFFRAM3` reader - Keep retention on RAM block 3 when RAM block is switched off"]
pub type OFFRAM3_R = crate::BitReader<OFFRAM3_A>;
#[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<OFFRAM3_A> for bool {
#[inline(always)]
fn from(variant: OFFRAM3_A) -> Self {
variant as u8 != 0
}
}
impl OFFRAM3_R {
#[doc = "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
}
}
#[doc = "Field `OFFRAM3` writer - Keep retention on RAM block 3 when RAM block is switched off"]
pub type OFFRAM3_W<'a, const O: u8> = crate::BitWriter<'a, u32, RAMONB_SPEC, OFFRAM3_A, O>;
impl<'a, const O: u8> OFFRAM3_W<'a, O> {
#[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)
}
}
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 & 1) != 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) & 1) != 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) & 1) != 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) & 1) != 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<0> {
ONRAM2_W::new(self)
}
#[doc = "Bit 1 - Keep RAM block 3 on or off in system ON Mode"]
#[inline(always)]
pub fn onram3(&mut self) -> ONRAM3_W<1> {
ONRAM3_W::new(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<16> {
OFFRAM2_W::new(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<17> {
OFFRAM3_W::new(self)
}
#[doc = "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
}
}
+197
View File
@@ -0,0 +1,197 @@
#[doc = "Register `RAMSTATUS` reader"]
pub struct R(crate::R<RAMSTATUS_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<RAMSTATUS_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<RAMSTATUS_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<RAMSTATUS_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Field `RAMBLOCK0` reader - RAM block 0 is on or off/powering up"]
pub type RAMBLOCK0_R = crate::BitReader<RAMBLOCK0_A>;
#[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<RAMBLOCK0_A> for bool {
#[inline(always)]
fn from(variant: RAMBLOCK0_A) -> Self {
variant as u8 != 0
}
}
impl RAMBLOCK0_R {
#[doc = "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
}
}
#[doc = "Field `RAMBLOCK1` reader - RAM block 1 is on or off/powering up"]
pub type RAMBLOCK1_R = crate::BitReader<RAMBLOCK1_A>;
#[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<RAMBLOCK1_A> for bool {
#[inline(always)]
fn from(variant: RAMBLOCK1_A) -> Self {
variant as u8 != 0
}
}
impl RAMBLOCK1_R {
#[doc = "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
}
}
#[doc = "Field `RAMBLOCK2` reader - RAM block 2 is on or off/powering up"]
pub type RAMBLOCK2_R = crate::BitReader<RAMBLOCK2_A>;
#[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<RAMBLOCK2_A> for bool {
#[inline(always)]
fn from(variant: RAMBLOCK2_A) -> Self {
variant as u8 != 0
}
}
impl RAMBLOCK2_R {
#[doc = "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
}
}
#[doc = "Field `RAMBLOCK3` reader - RAM block 3 is on or off/powering up"]
pub type RAMBLOCK3_R = crate::BitReader<RAMBLOCK3_A>;
#[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<RAMBLOCK3_A> for bool {
#[inline(always)]
fn from(variant: RAMBLOCK3_A) -> Self {
variant as u8 != 0
}
}
impl RAMBLOCK3_R {
#[doc = "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 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 & 1) != 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) & 1) != 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) & 1) != 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) & 1) != 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
}
}
+546
View File
@@ -0,0 +1,546 @@
#[doc = "Register `RESETREAS` reader"]
pub struct R(crate::R<RESETREAS_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<RESETREAS_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<RESETREAS_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<RESETREAS_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `RESETREAS` writer"]
pub struct W(crate::W<RESETREAS_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<RESETREAS_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<RESETREAS_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<RESETREAS_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `RESETPIN` reader - Reset from pin-reset detected"]
pub type RESETPIN_R = crate::BitReader<RESETPIN_A>;
#[doc = "Reset from pin-reset detected\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RESETPIN_A {
#[doc = "0: Not detected"]
NOT_DETECTED = 0,
#[doc = "1: Detected"]
DETECTED = 1,
}
impl From<RESETPIN_A> for bool {
#[inline(always)]
fn from(variant: RESETPIN_A) -> Self {
variant as u8 != 0
}
}
impl RESETPIN_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> RESETPIN_A {
match self.bits {
false => RESETPIN_A::NOT_DETECTED,
true => RESETPIN_A::DETECTED,
}
}
#[doc = "Checks if the value of the field is `NOT_DETECTED`"]
#[inline(always)]
pub fn is_not_detected(&self) -> bool {
*self == RESETPIN_A::NOT_DETECTED
}
#[doc = "Checks if the value of the field is `DETECTED`"]
#[inline(always)]
pub fn is_detected(&self) -> bool {
*self == RESETPIN_A::DETECTED
}
}
#[doc = "Field `RESETPIN` writer - Reset from pin-reset detected"]
pub type RESETPIN_W<'a, const O: u8> = crate::BitWriter<'a, u32, RESETREAS_SPEC, RESETPIN_A, O>;
impl<'a, const O: u8> RESETPIN_W<'a, O> {
#[doc = "Not detected"]
#[inline(always)]
pub fn not_detected(self) -> &'a mut W {
self.variant(RESETPIN_A::NOT_DETECTED)
}
#[doc = "Detected"]
#[inline(always)]
pub fn detected(self) -> &'a mut W {
self.variant(RESETPIN_A::DETECTED)
}
}
#[doc = "Field `DOG` reader - Reset from watchdog detected"]
pub type DOG_R = crate::BitReader<DOG_A>;
#[doc = "Reset from watchdog detected\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum DOG_A {
#[doc = "0: Not detected"]
NOT_DETECTED = 0,
#[doc = "1: Detected"]
DETECTED = 1,
}
impl From<DOG_A> for bool {
#[inline(always)]
fn from(variant: DOG_A) -> Self {
variant as u8 != 0
}
}
impl DOG_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> DOG_A {
match self.bits {
false => DOG_A::NOT_DETECTED,
true => DOG_A::DETECTED,
}
}
#[doc = "Checks if the value of the field is `NOT_DETECTED`"]
#[inline(always)]
pub fn is_not_detected(&self) -> bool {
*self == DOG_A::NOT_DETECTED
}
#[doc = "Checks if the value of the field is `DETECTED`"]
#[inline(always)]
pub fn is_detected(&self) -> bool {
*self == DOG_A::DETECTED
}
}
#[doc = "Field `DOG` writer - Reset from watchdog detected"]
pub type DOG_W<'a, const O: u8> = crate::BitWriter<'a, u32, RESETREAS_SPEC, DOG_A, O>;
impl<'a, const O: u8> DOG_W<'a, O> {
#[doc = "Not detected"]
#[inline(always)]
pub fn not_detected(self) -> &'a mut W {
self.variant(DOG_A::NOT_DETECTED)
}
#[doc = "Detected"]
#[inline(always)]
pub fn detected(self) -> &'a mut W {
self.variant(DOG_A::DETECTED)
}
}
#[doc = "Field `SREQ` reader - Reset from soft reset detected"]
pub type SREQ_R = crate::BitReader<SREQ_A>;
#[doc = "Reset from soft reset detected\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum SREQ_A {
#[doc = "0: Not detected"]
NOT_DETECTED = 0,
#[doc = "1: Detected"]
DETECTED = 1,
}
impl From<SREQ_A> for bool {
#[inline(always)]
fn from(variant: SREQ_A) -> Self {
variant as u8 != 0
}
}
impl SREQ_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> SREQ_A {
match self.bits {
false => SREQ_A::NOT_DETECTED,
true => SREQ_A::DETECTED,
}
}
#[doc = "Checks if the value of the field is `NOT_DETECTED`"]
#[inline(always)]
pub fn is_not_detected(&self) -> bool {
*self == SREQ_A::NOT_DETECTED
}
#[doc = "Checks if the value of the field is `DETECTED`"]
#[inline(always)]
pub fn is_detected(&self) -> bool {
*self == SREQ_A::DETECTED
}
}
#[doc = "Field `SREQ` writer - Reset from soft reset detected"]
pub type SREQ_W<'a, const O: u8> = crate::BitWriter<'a, u32, RESETREAS_SPEC, SREQ_A, O>;
impl<'a, const O: u8> SREQ_W<'a, O> {
#[doc = "Not detected"]
#[inline(always)]
pub fn not_detected(self) -> &'a mut W {
self.variant(SREQ_A::NOT_DETECTED)
}
#[doc = "Detected"]
#[inline(always)]
pub fn detected(self) -> &'a mut W {
self.variant(SREQ_A::DETECTED)
}
}
#[doc = "Field `LOCKUP` reader - Reset from CPU lock-up detected"]
pub type LOCKUP_R = crate::BitReader<LOCKUP_A>;
#[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"]
NOT_DETECTED = 0,
#[doc = "1: Detected"]
DETECTED = 1,
}
impl From<LOCKUP_A> for bool {
#[inline(always)]
fn from(variant: LOCKUP_A) -> Self {
variant as u8 != 0
}
}
impl LOCKUP_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> LOCKUP_A {
match self.bits {
false => LOCKUP_A::NOT_DETECTED,
true => LOCKUP_A::DETECTED,
}
}
#[doc = "Checks if the value of the field is `NOT_DETECTED`"]
#[inline(always)]
pub fn is_not_detected(&self) -> bool {
*self == LOCKUP_A::NOT_DETECTED
}
#[doc = "Checks if the value of the field is `DETECTED`"]
#[inline(always)]
pub fn is_detected(&self) -> bool {
*self == LOCKUP_A::DETECTED
}
}
#[doc = "Field `LOCKUP` writer - Reset from CPU lock-up detected"]
pub type LOCKUP_W<'a, const O: u8> = crate::BitWriter<'a, u32, RESETREAS_SPEC, LOCKUP_A, O>;
impl<'a, const O: u8> LOCKUP_W<'a, O> {
#[doc = "Not detected"]
#[inline(always)]
pub fn not_detected(self) -> &'a mut W {
self.variant(LOCKUP_A::NOT_DETECTED)
}
#[doc = "Detected"]
#[inline(always)]
pub fn detected(self) -> &'a mut W {
self.variant(LOCKUP_A::DETECTED)
}
}
#[doc = "Field `OFF` reader - Reset due to wake up from System OFF mode when wakeup is triggered from DETECT signal from GPIO"]
pub type OFF_R = crate::BitReader<OFF_A>;
#[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"]
NOT_DETECTED = 0,
#[doc = "1: Detected"]
DETECTED = 1,
}
impl From<OFF_A> for bool {
#[inline(always)]
fn from(variant: OFF_A) -> Self {
variant as u8 != 0
}
}
impl OFF_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> OFF_A {
match self.bits {
false => OFF_A::NOT_DETECTED,
true => OFF_A::DETECTED,
}
}
#[doc = "Checks if the value of the field is `NOT_DETECTED`"]
#[inline(always)]
pub fn is_not_detected(&self) -> bool {
*self == OFF_A::NOT_DETECTED
}
#[doc = "Checks if the value of the field is `DETECTED`"]
#[inline(always)]
pub fn is_detected(&self) -> bool {
*self == OFF_A::DETECTED
}
}
#[doc = "Field `OFF` writer - Reset due to wake up from System OFF mode when wakeup is triggered from DETECT signal from GPIO"]
pub type OFF_W<'a, const O: u8> = crate::BitWriter<'a, u32, RESETREAS_SPEC, OFF_A, O>;
impl<'a, const O: u8> OFF_W<'a, O> {
#[doc = "Not detected"]
#[inline(always)]
pub fn not_detected(self) -> &'a mut W {
self.variant(OFF_A::NOT_DETECTED)
}
#[doc = "Detected"]
#[inline(always)]
pub fn detected(self) -> &'a mut W {
self.variant(OFF_A::DETECTED)
}
}
#[doc = "Field `LPCOMP` reader - Reset due to wake up from System OFF mode when wakeup is triggered from ANADETECT signal from LPCOMP"]
pub type LPCOMP_R = crate::BitReader<LPCOMP_A>;
#[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"]
NOT_DETECTED = 0,
#[doc = "1: Detected"]
DETECTED = 1,
}
impl From<LPCOMP_A> for bool {
#[inline(always)]
fn from(variant: LPCOMP_A) -> Self {
variant as u8 != 0
}
}
impl LPCOMP_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> LPCOMP_A {
match self.bits {
false => LPCOMP_A::NOT_DETECTED,
true => LPCOMP_A::DETECTED,
}
}
#[doc = "Checks if the value of the field is `NOT_DETECTED`"]
#[inline(always)]
pub fn is_not_detected(&self) -> bool {
*self == LPCOMP_A::NOT_DETECTED
}
#[doc = "Checks if the value of the field is `DETECTED`"]
#[inline(always)]
pub fn is_detected(&self) -> bool {
*self == LPCOMP_A::DETECTED
}
}
#[doc = "Field `LPCOMP` writer - Reset due to wake up from System OFF mode when wakeup is triggered from ANADETECT signal from LPCOMP"]
pub type LPCOMP_W<'a, const O: u8> = crate::BitWriter<'a, u32, RESETREAS_SPEC, LPCOMP_A, O>;
impl<'a, const O: u8> LPCOMP_W<'a, O> {
#[doc = "Not detected"]
#[inline(always)]
pub fn not_detected(self) -> &'a mut W {
self.variant(LPCOMP_A::NOT_DETECTED)
}
#[doc = "Detected"]
#[inline(always)]
pub fn detected(self) -> &'a mut W {
self.variant(LPCOMP_A::DETECTED)
}
}
#[doc = "Field `DIF` reader - Reset due to wake up from System OFF mode when wakeup is triggered from entering into debug interface mode"]
pub type DIF_R = crate::BitReader<DIF_A>;
#[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"]
NOT_DETECTED = 0,
#[doc = "1: Detected"]
DETECTED = 1,
}
impl From<DIF_A> for bool {
#[inline(always)]
fn from(variant: DIF_A) -> Self {
variant as u8 != 0
}
}
impl DIF_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> DIF_A {
match self.bits {
false => DIF_A::NOT_DETECTED,
true => DIF_A::DETECTED,
}
}
#[doc = "Checks if the value of the field is `NOT_DETECTED`"]
#[inline(always)]
pub fn is_not_detected(&self) -> bool {
*self == DIF_A::NOT_DETECTED
}
#[doc = "Checks if the value of the field is `DETECTED`"]
#[inline(always)]
pub fn is_detected(&self) -> bool {
*self == DIF_A::DETECTED
}
}
#[doc = "Field `DIF` writer - Reset due to wake up from System OFF mode when wakeup is triggered from entering into debug interface mode"]
pub type DIF_W<'a, const O: u8> = crate::BitWriter<'a, u32, RESETREAS_SPEC, DIF_A, O>;
impl<'a, const O: u8> DIF_W<'a, O> {
#[doc = "Not detected"]
#[inline(always)]
pub fn not_detected(self) -> &'a mut W {
self.variant(DIF_A::NOT_DETECTED)
}
#[doc = "Detected"]
#[inline(always)]
pub fn detected(self) -> &'a mut W {
self.variant(DIF_A::DETECTED)
}
}
#[doc = "Field `NFC` reader - Reset due to wake up from System OFF mode by NFC field detect"]
pub type NFC_R = crate::BitReader<NFC_A>;
#[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"]
NOT_DETECTED = 0,
#[doc = "1: Detected"]
DETECTED = 1,
}
impl From<NFC_A> for bool {
#[inline(always)]
fn from(variant: NFC_A) -> Self {
variant as u8 != 0
}
}
impl NFC_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> NFC_A {
match self.bits {
false => NFC_A::NOT_DETECTED,
true => NFC_A::DETECTED,
}
}
#[doc = "Checks if the value of the field is `NOT_DETECTED`"]
#[inline(always)]
pub fn is_not_detected(&self) -> bool {
*self == NFC_A::NOT_DETECTED
}
#[doc = "Checks if the value of the field is `DETECTED`"]
#[inline(always)]
pub fn is_detected(&self) -> bool {
*self == NFC_A::DETECTED
}
}
#[doc = "Field `NFC` writer - Reset due to wake up from System OFF mode by NFC field detect"]
pub type NFC_W<'a, const O: u8> = crate::BitWriter<'a, u32, RESETREAS_SPEC, NFC_A, O>;
impl<'a, const O: u8> NFC_W<'a, O> {
#[doc = "Not detected"]
#[inline(always)]
pub fn not_detected(self) -> &'a mut W {
self.variant(NFC_A::NOT_DETECTED)
}
#[doc = "Detected"]
#[inline(always)]
pub fn detected(self) -> &'a mut W {
self.variant(NFC_A::DETECTED)
}
}
impl R {
#[doc = "Bit 0 - Reset from pin-reset detected"]
#[inline(always)]
pub fn resetpin(&self) -> RESETPIN_R {
RESETPIN_R::new((self.bits & 1) != 0)
}
#[doc = "Bit 1 - Reset from watchdog detected"]
#[inline(always)]
pub fn dog(&self) -> DOG_R {
DOG_R::new(((self.bits >> 1) & 1) != 0)
}
#[doc = "Bit 2 - Reset from soft reset detected"]
#[inline(always)]
pub fn sreq(&self) -> SREQ_R {
SREQ_R::new(((self.bits >> 2) & 1) != 0)
}
#[doc = "Bit 3 - Reset from CPU lock-up detected"]
#[inline(always)]
pub fn lockup(&self) -> LOCKUP_R {
LOCKUP_R::new(((self.bits >> 3) & 1) != 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) & 1) != 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) & 1) != 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) & 1) != 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) & 1) != 0)
}
}
impl W {
#[doc = "Bit 0 - Reset from pin-reset detected"]
#[inline(always)]
pub fn resetpin(&mut self) -> RESETPIN_W<0> {
RESETPIN_W::new(self)
}
#[doc = "Bit 1 - Reset from watchdog detected"]
#[inline(always)]
pub fn dog(&mut self) -> DOG_W<1> {
DOG_W::new(self)
}
#[doc = "Bit 2 - Reset from soft reset detected"]
#[inline(always)]
pub fn sreq(&mut self) -> SREQ_W<2> {
SREQ_W::new(self)
}
#[doc = "Bit 3 - Reset from CPU lock-up detected"]
#[inline(always)]
pub fn lockup(&mut self) -> LOCKUP_W<3> {
LOCKUP_W::new(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<16> {
OFF_W::new(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<17> {
LPCOMP_W::new(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<18> {
DIF_W::new(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<19> {
NFC_W::new(self)
}
#[doc = "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
}
}
+71
View File
@@ -0,0 +1,71 @@
#[doc = "Register `SYSTEMOFF` writer"]
pub struct W(crate::W<SYSTEMOFF_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<SYSTEMOFF_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<SYSTEMOFF_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<SYSTEMOFF_SPEC>) -> 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<SYSTEMOFF_AW> for bool {
#[inline(always)]
fn from(variant: SYSTEMOFF_AW) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `SYSTEMOFF` writer - Enable System OFF mode"]
pub type SYSTEMOFF_W<'a, const O: u8> = crate::BitWriter<'a, u32, SYSTEMOFF_SPEC, SYSTEMOFF_AW, O>;
impl<'a, const O: u8> SYSTEMOFF_W<'a, O> {
#[doc = "Enable System OFF mode"]
#[inline(always)]
pub fn enter(self) -> &'a mut W {
self.variant(SYSTEMOFF_AW::ENTER)
}
}
impl W {
#[doc = "Bit 0 - Enable System OFF mode"]
#[inline(always)]
pub fn systemoff(&mut self) -> SYSTEMOFF_W<0> {
SYSTEMOFF_W::new(self)
}
#[doc = "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
}
}
+45
View File
@@ -0,0 +1,45 @@
#[doc = "Register `TASKS_CONSTLAT` writer"]
pub struct W(crate::W<TASKS_CONSTLAT_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<TASKS_CONSTLAT_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<TASKS_CONSTLAT_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<TASKS_CONSTLAT_SPEC>) -> 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
}
}
+45
View File
@@ -0,0 +1,45 @@
#[doc = "Register `TASKS_LOWPWR` writer"]
pub struct W(crate::W<TASKS_LOWPWR_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<TASKS_LOWPWR_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<TASKS_LOWPWR_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<TASKS_LOWPWR_SPEC>) -> 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
}
}