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

+154
View File
@@ -0,0 +1,154 @@
#[doc = "Register `CONFIG` reader"]
pub struct R(crate::R<CONFIG_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<CONFIG_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<CONFIG_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<CONFIG_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `CONFIG` writer"]
pub struct W(crate::W<CONFIG_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<CONFIG_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<CONFIG_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<CONFIG_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `WEN` reader - Program memory access mode. It is strongly recommended to only activate erase and write modes when they are actively used."]
pub type WEN_R = crate::FieldReader<u8, WEN_A>;
#[doc = "Program memory access mode. It is strongly recommended to only activate erase and write modes when they are actively used.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum WEN_A {
#[doc = "0: Read only access"]
REN = 0,
#[doc = "1: Write enabled"]
WEN = 1,
#[doc = "2: Erase enabled"]
EEN = 2,
#[doc = "4: Partial erase enabled"]
PEEN = 4,
}
impl From<WEN_A> for u8 {
#[inline(always)]
fn from(variant: WEN_A) -> Self {
variant as _
}
}
impl WEN_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> Option<WEN_A> {
match self.bits {
0 => Some(WEN_A::REN),
1 => Some(WEN_A::WEN),
2 => Some(WEN_A::EEN),
4 => Some(WEN_A::PEEN),
_ => None,
}
}
#[doc = "Checks if the value of the field is `REN`"]
#[inline(always)]
pub fn is_ren(&self) -> bool {
*self == WEN_A::REN
}
#[doc = "Checks if the value of the field is `WEN`"]
#[inline(always)]
pub fn is_wen(&self) -> bool {
*self == WEN_A::WEN
}
#[doc = "Checks if the value of the field is `EEN`"]
#[inline(always)]
pub fn is_een(&self) -> bool {
*self == WEN_A::EEN
}
#[doc = "Checks if the value of the field is `PEEN`"]
#[inline(always)]
pub fn is_peen(&self) -> bool {
*self == WEN_A::PEEN
}
}
#[doc = "Field `WEN` writer - Program memory access mode. It is strongly recommended to only activate erase and write modes when they are actively used."]
pub type WEN_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CONFIG_SPEC, u8, WEN_A, 3, O>;
impl<'a, const O: u8> WEN_W<'a, O> {
#[doc = "Read only access"]
#[inline(always)]
pub fn ren(self) -> &'a mut W {
self.variant(WEN_A::REN)
}
#[doc = "Write enabled"]
#[inline(always)]
pub fn wen(self) -> &'a mut W {
self.variant(WEN_A::WEN)
}
#[doc = "Erase enabled"]
#[inline(always)]
pub fn een(self) -> &'a mut W {
self.variant(WEN_A::EEN)
}
#[doc = "Partial erase enabled"]
#[inline(always)]
pub fn peen(self) -> &'a mut W {
self.variant(WEN_A::PEEN)
}
}
impl R {
#[doc = "Bits 0:2 - Program memory access mode. It is strongly recommended to only activate erase and write modes when they are actively used."]
#[inline(always)]
pub fn wen(&self) -> WEN_R {
WEN_R::new((self.bits & 7) as u8)
}
}
impl W {
#[doc = "Bits 0:2 - Program memory access mode. It is strongly recommended to only activate erase and write modes when they are actively used."]
#[inline(always)]
pub fn wen(&mut self) -> WEN_W<0> {
WEN_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 = "Configuration register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [config](index.html) module"]
pub struct CONFIG_SPEC;
impl crate::RegisterSpec for CONFIG_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [config::R](R) reader structure"]
impl crate::Readable for CONFIG_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [config::W](W) writer structure"]
impl crate::Writable for CONFIG_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets CONFIG to value 0"]
impl crate::Resettable for CONFIG_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+141
View File
@@ -0,0 +1,141 @@
#[doc = "Register `CONFIGNS` reader"]
pub struct R(crate::R<CONFIGNS_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<CONFIGNS_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<CONFIGNS_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<CONFIGNS_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `CONFIGNS` writer"]
pub struct W(crate::W<CONFIGNS_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<CONFIGNS_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<CONFIGNS_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<CONFIGNS_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `WEN` reader - Program memory access mode. It is strongly recommended to only activate erase and write modes when they are actively used."]
pub type WEN_R = crate::FieldReader<u8, WEN_A>;
#[doc = "Program memory access mode. It is strongly recommended to only activate erase and write modes when they are actively used.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum WEN_A {
#[doc = "0: Read only access"]
REN = 0,
#[doc = "1: Write enabled"]
WEN = 1,
#[doc = "2: Erase enabled"]
EEN = 2,
}
impl From<WEN_A> for u8 {
#[inline(always)]
fn from(variant: WEN_A) -> Self {
variant as _
}
}
impl WEN_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> Option<WEN_A> {
match self.bits {
0 => Some(WEN_A::REN),
1 => Some(WEN_A::WEN),
2 => Some(WEN_A::EEN),
_ => None,
}
}
#[doc = "Checks if the value of the field is `REN`"]
#[inline(always)]
pub fn is_ren(&self) -> bool {
*self == WEN_A::REN
}
#[doc = "Checks if the value of the field is `WEN`"]
#[inline(always)]
pub fn is_wen(&self) -> bool {
*self == WEN_A::WEN
}
#[doc = "Checks if the value of the field is `EEN`"]
#[inline(always)]
pub fn is_een(&self) -> bool {
*self == WEN_A::EEN
}
}
#[doc = "Field `WEN` writer - Program memory access mode. It is strongly recommended to only activate erase and write modes when they are actively used."]
pub type WEN_W<'a, const O: u8> = crate::FieldWriter<'a, u32, CONFIGNS_SPEC, u8, WEN_A, 2, O>;
impl<'a, const O: u8> WEN_W<'a, O> {
#[doc = "Read only access"]
#[inline(always)]
pub fn ren(self) -> &'a mut W {
self.variant(WEN_A::REN)
}
#[doc = "Write enabled"]
#[inline(always)]
pub fn wen(self) -> &'a mut W {
self.variant(WEN_A::WEN)
}
#[doc = "Erase enabled"]
#[inline(always)]
pub fn een(self) -> &'a mut W {
self.variant(WEN_A::EEN)
}
}
impl R {
#[doc = "Bits 0:1 - Program memory access mode. It is strongly recommended to only activate erase and write modes when they are actively used."]
#[inline(always)]
pub fn wen(&self) -> WEN_R {
WEN_R::new((self.bits & 3) as u8)
}
}
impl W {
#[doc = "Bits 0:1 - Program memory access mode. It is strongly recommended to only activate erase and write modes when they are actively used."]
#[inline(always)]
pub fn wen(&mut self) -> WEN_W<0> {
WEN_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 = "Non-secure configuration register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [configns](index.html) module"]
pub struct CONFIGNS_SPEC;
impl crate::RegisterSpec for CONFIGNS_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [configns::R](R) reader structure"]
impl crate::Readable for CONFIGNS_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [configns::W](W) writer structure"]
impl crate::Writable for CONFIGNS_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets CONFIGNS to value 0"]
impl crate::Resettable for CONFIGNS_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+78
View File
@@ -0,0 +1,78 @@
#[doc = "Register `ERASEALL` writer"]
pub struct W(crate::W<ERASEALL_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<ERASEALL_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<ERASEALL_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<ERASEALL_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Erase all non-volatile memory including UICR registers. Before the non-volatile memory can be erased, erasing must be enabled by setting CONFIG.WEN=Een.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ERASEALL_AW {
#[doc = "0: No operation"]
NO_OPERATION = 0,
#[doc = "1: Start chip erase"]
ERASE = 1,
}
impl From<ERASEALL_AW> for bool {
#[inline(always)]
fn from(variant: ERASEALL_AW) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `ERASEALL` writer - Erase all non-volatile memory including UICR registers. Before the non-volatile memory can be erased, erasing must be enabled by setting CONFIG.WEN=Een."]
pub type ERASEALL_W<'a, const O: u8> = crate::BitWriter<'a, u32, ERASEALL_SPEC, ERASEALL_AW, O>;
impl<'a, const O: u8> ERASEALL_W<'a, O> {
#[doc = "No operation"]
#[inline(always)]
pub fn no_operation(self) -> &'a mut W {
self.variant(ERASEALL_AW::NO_OPERATION)
}
#[doc = "Start chip erase"]
#[inline(always)]
pub fn erase(self) -> &'a mut W {
self.variant(ERASEALL_AW::ERASE)
}
}
impl W {
#[doc = "Bit 0 - Erase all non-volatile memory including UICR registers. Before the non-volatile memory can be erased, erasing must be enabled by setting CONFIG.WEN=Een."]
#[inline(always)]
pub fn eraseall(&mut self) -> ERASEALL_W<0> {
ERASEALL_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 = "Register for erasing all non-volatile user memory\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 [eraseall](index.html) module"]
pub struct ERASEALL_SPEC;
impl crate::RegisterSpec for ERASEALL_SPEC {
type Ux = u32;
}
#[doc = "`write(|w| ..)` method takes [eraseall::W](W) writer structure"]
impl crate::Writable for ERASEALL_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets ERASEALL to value 0"]
impl crate::Resettable for ERASEALL_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
@@ -0,0 +1,81 @@
#[doc = "Register `ERASEPAGEPARTIALCFG` reader"]
pub struct R(crate::R<ERASEPAGEPARTIALCFG_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<ERASEPAGEPARTIALCFG_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<ERASEPAGEPARTIALCFG_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<ERASEPAGEPARTIALCFG_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `ERASEPAGEPARTIALCFG` writer"]
pub struct W(crate::W<ERASEPAGEPARTIALCFG_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<ERASEPAGEPARTIALCFG_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<ERASEPAGEPARTIALCFG_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<ERASEPAGEPARTIALCFG_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `DURATION` reader - Duration of the partial erase in milliseconds"]
pub type DURATION_R = crate::FieldReader<u8, u8>;
#[doc = "Field `DURATION` writer - Duration of the partial erase in milliseconds"]
pub type DURATION_W<'a, const O: u8> =
crate::FieldWriter<'a, u32, ERASEPAGEPARTIALCFG_SPEC, u8, u8, 7, O>;
impl R {
#[doc = "Bits 0:6 - Duration of the partial erase in milliseconds"]
#[inline(always)]
pub fn duration(&self) -> DURATION_R {
DURATION_R::new((self.bits & 0x7f) as u8)
}
}
impl W {
#[doc = "Bits 0:6 - Duration of the partial erase in milliseconds"]
#[inline(always)]
pub fn duration(&mut self) -> DURATION_W<0> {
DURATION_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 = "Register for partial erase 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 [erasepagepartialcfg](index.html) module"]
pub struct ERASEPAGEPARTIALCFG_SPEC;
impl crate::RegisterSpec for ERASEPAGEPARTIALCFG_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [erasepagepartialcfg::R](R) reader structure"]
impl crate::Readable for ERASEPAGEPARTIALCFG_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [erasepagepartialcfg::W](W) writer structure"]
impl crate::Writable for ERASEPAGEPARTIALCFG_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets ERASEPAGEPARTIALCFG to value 0x0a"]
impl crate::Resettable for ERASEPAGEPARTIALCFG_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0x0a
}
}
+74
View File
@@ -0,0 +1,74 @@
#[doc = "Register `READY` reader"]
pub struct R(crate::R<READY_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<READY_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<READY_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<READY_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Field `READY` reader - NVMC is ready or busy"]
pub type READY_R = crate::BitReader<READY_A>;
#[doc = "NVMC is ready or busy\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum READY_A {
#[doc = "0: NVMC is busy (ongoing write or erase operation)"]
BUSY = 0,
#[doc = "1: NVMC is ready"]
READY = 1,
}
impl From<READY_A> for bool {
#[inline(always)]
fn from(variant: READY_A) -> Self {
variant as u8 != 0
}
}
impl READY_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> READY_A {
match self.bits {
false => READY_A::BUSY,
true => READY_A::READY,
}
}
#[doc = "Checks if the value of the field is `BUSY`"]
#[inline(always)]
pub fn is_busy(&self) -> bool {
*self == READY_A::BUSY
}
#[doc = "Checks if the value of the field is `READY`"]
#[inline(always)]
pub fn is_ready(&self) -> bool {
*self == READY_A::READY
}
}
impl R {
#[doc = "Bit 0 - NVMC is ready or busy"]
#[inline(always)]
pub fn ready(&self) -> READY_R {
READY_R::new((self.bits & 1) != 0)
}
}
#[doc = "Ready flag\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ready](index.html) module"]
pub struct READY_SPEC;
impl crate::RegisterSpec for READY_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [ready::R](R) reader structure"]
impl crate::Readable for READY_SPEC {
type Reader = R;
}
#[doc = "`reset()` method sets READY to value 0x01"]
impl crate::Resettable for READY_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0x01
}
}
+74
View File
@@ -0,0 +1,74 @@
#[doc = "Register `READYNEXT` reader"]
pub struct R(crate::R<READYNEXT_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<READYNEXT_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<READYNEXT_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<READYNEXT_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Field `READYNEXT` reader - NVMC can accept a new write operation"]
pub type READYNEXT_R = crate::BitReader<READYNEXT_A>;
#[doc = "NVMC can accept a new write operation\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum READYNEXT_A {
#[doc = "0: NVMC cannot accept any write operation"]
BUSY = 0,
#[doc = "1: NVMC is ready"]
READY = 1,
}
impl From<READYNEXT_A> for bool {
#[inline(always)]
fn from(variant: READYNEXT_A) -> Self {
variant as u8 != 0
}
}
impl READYNEXT_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> READYNEXT_A {
match self.bits {
false => READYNEXT_A::BUSY,
true => READYNEXT_A::READY,
}
}
#[doc = "Checks if the value of the field is `BUSY`"]
#[inline(always)]
pub fn is_busy(&self) -> bool {
*self == READYNEXT_A::BUSY
}
#[doc = "Checks if the value of the field is `READY`"]
#[inline(always)]
pub fn is_ready(&self) -> bool {
*self == READYNEXT_A::READY
}
}
impl R {
#[doc = "Bit 0 - NVMC can accept a new write operation"]
#[inline(always)]
pub fn readynext(&self) -> READYNEXT_R {
READYNEXT_R::new((self.bits & 1) != 0)
}
}
#[doc = "Ready flag\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [readynext](index.html) module"]
pub struct READYNEXT_SPEC;
impl crate::RegisterSpec for READYNEXT_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [readynext::R](R) reader structure"]
impl crate::Readable for READYNEXT_SPEC {
type Reader = R;
}
#[doc = "`reset()` method sets READYNEXT to value 0x01"]
impl crate::Resettable for READYNEXT_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0x01
}
}
+98
View File
@@ -0,0 +1,98 @@
#[doc = "Register `WRITEUICRNS` writer"]
pub struct W(crate::W<WRITEUICRNS_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<WRITEUICRNS_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<WRITEUICRNS_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<WRITEUICRNS_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Allow non-secure code to set APPROTECT\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum SET_AW {
#[doc = "1: Set value"]
SET = 1,
}
impl From<SET_AW> for bool {
#[inline(always)]
fn from(variant: SET_AW) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `SET` writer - Allow non-secure code to set APPROTECT"]
pub type SET_W<'a, const O: u8> = crate::BitWriter<'a, u32, WRITEUICRNS_SPEC, SET_AW, O>;
impl<'a, const O: u8> SET_W<'a, O> {
#[doc = "Set value"]
#[inline(always)]
pub fn set(self) -> &'a mut W {
self.variant(SET_AW::SET)
}
}
#[doc = "Key to write in order to validate the write operation\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u32)]
pub enum KEY_AW {
#[doc = "184280487: Key value"]
KEYVALID = 184280487,
}
impl From<KEY_AW> for u32 {
#[inline(always)]
fn from(variant: KEY_AW) -> Self {
variant as _
}
}
#[doc = "Field `KEY` writer - Key to write in order to validate the write operation"]
pub type KEY_W<'a, const O: u8> = crate::FieldWriter<'a, u32, WRITEUICRNS_SPEC, u32, KEY_AW, 28, O>;
impl<'a, const O: u8> KEY_W<'a, O> {
#[doc = "Key value"]
#[inline(always)]
pub fn keyvalid(self) -> &'a mut W {
self.variant(KEY_AW::KEYVALID)
}
}
impl W {
#[doc = "Bit 0 - Allow non-secure code to set APPROTECT"]
#[inline(always)]
pub fn set(&mut self) -> SET_W<0> {
SET_W::new(self)
}
#[doc = "Bits 4:31 - Key to write in order to validate the write operation"]
#[inline(always)]
pub fn key(&mut self) -> KEY_W<4> {
KEY_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 = "Non-secure APPROTECT enable 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 [writeuicrns](index.html) module"]
pub struct WRITEUICRNS_SPEC;
impl crate::RegisterSpec for WRITEUICRNS_SPEC {
type Ux = u32;
}
#[doc = "`write(|w| ..)` method takes [writeuicrns::W](W) writer structure"]
impl crate::Writable for WRITEUICRNS_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets WRITEUICRNS to value 0"]
impl crate::Resettable for WRITEUICRNS_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}