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

+31
View File
@@ -0,0 +1,31 @@
#[doc = "Register `ACC` reader"]
pub struct R(crate::R<ACC_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<ACC_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<ACC_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<ACC_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Accumulated valid transitions 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 [acc](index.html) module"]
pub struct ACC_SPEC;
impl crate::RegisterSpec for ACC_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [acc::R](R) reader structure"]
impl crate::Readable for ACC_SPEC {
type Reader = R;
}
#[doc = "`reset()` method sets ACC to value 0"]
impl crate::Resettable for ACC_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+40
View File
@@ -0,0 +1,40 @@
#[doc = "Register `ACCDBL` reader"]
pub struct R(crate::R<ACCDBL_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<ACCDBL_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<ACCDBL_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<ACCDBL_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Field `ACCDBL` reader - Accumulated double (error) transitions."]
pub type ACCDBL_R = crate::FieldReader<u8, u8>;
impl R {
#[doc = "Bits 0:3 - Accumulated double (error) transitions."]
#[inline(always)]
pub fn accdbl(&self) -> ACCDBL_R {
ACCDBL_R::new((self.bits & 0x0f) as u8)
}
}
#[doc = "Accumulated double (error) transitions 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 [accdbl](index.html) module"]
pub struct ACCDBL_SPEC;
impl crate::RegisterSpec for ACCDBL_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [accdbl::R](R) reader structure"]
impl crate::Readable for ACCDBL_SPEC {
type Reader = R;
}
#[doc = "`reset()` method sets ACCDBL to value 0"]
impl crate::Resettable for ACCDBL_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+40
View File
@@ -0,0 +1,40 @@
#[doc = "Register `ACCDBLREAD` reader"]
pub struct R(crate::R<ACCDBLREAD_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<ACCDBLREAD_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<ACCDBLREAD_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<ACCDBLREAD_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Field `ACCDBLREAD` reader - Snapshot of accumulated double (error) transitions."]
pub type ACCDBLREAD_R = crate::FieldReader<u8, u8>;
impl R {
#[doc = "Bits 0:3 - Snapshot of accumulated double (error) transitions."]
#[inline(always)]
pub fn accdblread(&self) -> ACCDBLREAD_R {
ACCDBLREAD_R::new((self.bits & 0x0f) as u8)
}
}
#[doc = "Snapshot of ACCDBL register. Value generated by the TASKS_READCLEACC task.\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [accdblread](index.html) module"]
pub struct ACCDBLREAD_SPEC;
impl crate::RegisterSpec for ACCDBLREAD_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [accdblread::R](R) reader structure"]
impl crate::Readable for ACCDBLREAD_SPEC {
type Reader = R;
}
#[doc = "`reset()` method sets ACCDBLREAD to value 0"]
impl crate::Resettable for ACCDBLREAD_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+31
View File
@@ -0,0 +1,31 @@
#[doc = "Register `ACCREAD` reader"]
pub struct R(crate::R<ACCREAD_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<ACCREAD_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<ACCREAD_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<ACCREAD_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Snapshot of ACC register. Value generated by the TASKS_READCLEACC task.\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [accread](index.html) module"]
pub struct ACCREAD_SPEC;
impl crate::RegisterSpec for ACCREAD_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [accread::R](R) reader structure"]
impl crate::Readable for ACCREAD_SPEC {
type Reader = R;
}
#[doc = "`reset()` method sets ACCREAD to value 0"]
impl crate::Resettable for ACCREAD_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+126
View File
@@ -0,0 +1,126 @@
#[doc = "Register `DBFEN` reader"]
pub struct R(crate::R<DBFEN_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<DBFEN_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<DBFEN_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<DBFEN_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `DBFEN` writer"]
pub struct W(crate::W<DBFEN_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<DBFEN_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<DBFEN_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<DBFEN_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `DBFEN` reader - Enable debounce input filters."]
pub type DBFEN_R = crate::BitReader<DBFEN_A>;
#[doc = "Enable debounce input filters.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum DBFEN_A {
#[doc = "0: Debounce input filters disabled."]
DISABLED = 0,
#[doc = "1: Debounce input filters enabled."]
ENABLED = 1,
}
impl From<DBFEN_A> for bool {
#[inline(always)]
fn from(variant: DBFEN_A) -> Self {
variant as u8 != 0
}
}
impl DBFEN_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> DBFEN_A {
match self.bits {
false => DBFEN_A::DISABLED,
true => DBFEN_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == DBFEN_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == DBFEN_A::ENABLED
}
}
#[doc = "Field `DBFEN` writer - Enable debounce input filters."]
pub type DBFEN_W<'a, const O: u8> = crate::BitWriter<'a, u32, DBFEN_SPEC, DBFEN_A, O>;
impl<'a, const O: u8> DBFEN_W<'a, O> {
#[doc = "Debounce input filters disabled."]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(DBFEN_A::DISABLED)
}
#[doc = "Debounce input filters enabled."]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(DBFEN_A::ENABLED)
}
}
impl R {
#[doc = "Bit 0 - Enable debounce input filters."]
#[inline(always)]
pub fn dbfen(&self) -> DBFEN_R {
DBFEN_R::new((self.bits & 1) != 0)
}
}
impl W {
#[doc = "Bit 0 - Enable debounce input filters."]
#[inline(always)]
pub fn dbfen(&mut self) -> DBFEN_W<0> {
DBFEN_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 debouncer input filters.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dbfen](index.html) module"]
pub struct DBFEN_SPEC;
impl crate::RegisterSpec for DBFEN_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [dbfen::R](R) reader structure"]
impl crate::Readable for DBFEN_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [dbfen::W](W) writer structure"]
impl crate::Writable for DBFEN_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets DBFEN to value 0"]
impl crate::Resettable for DBFEN_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+126
View File
@@ -0,0 +1,126 @@
#[doc = "Register `ENABLE` reader"]
pub struct R(crate::R<ENABLE_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<ENABLE_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<ENABLE_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<ENABLE_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `ENABLE` writer"]
pub struct W(crate::W<ENABLE_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<ENABLE_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<ENABLE_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<ENABLE_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `ENABLE` reader - Enable or disable QDEC."]
pub type ENABLE_R = crate::BitReader<ENABLE_A>;
#[doc = "Enable or disable QDEC.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ENABLE_A {
#[doc = "0: Disabled QDEC."]
DISABLED = 0,
#[doc = "1: Enable QDEC."]
ENABLED = 1,
}
impl From<ENABLE_A> for bool {
#[inline(always)]
fn from(variant: ENABLE_A) -> Self {
variant as u8 != 0
}
}
impl ENABLE_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> ENABLE_A {
match self.bits {
false => ENABLE_A::DISABLED,
true => ENABLE_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ENABLE_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ENABLE_A::ENABLED
}
}
#[doc = "Field `ENABLE` writer - Enable or disable QDEC."]
pub type ENABLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, ENABLE_SPEC, ENABLE_A, O>;
impl<'a, const O: u8> ENABLE_W<'a, O> {
#[doc = "Disabled QDEC."]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(ENABLE_A::DISABLED)
}
#[doc = "Enable QDEC."]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(ENABLE_A::ENABLED)
}
}
impl R {
#[doc = "Bit 0 - Enable or disable QDEC."]
#[inline(always)]
pub fn enable(&self) -> ENABLE_R {
ENABLE_R::new((self.bits & 1) != 0)
}
}
impl W {
#[doc = "Bit 0 - Enable or disable QDEC."]
#[inline(always)]
pub fn enable(&mut self) -> ENABLE_W<0> {
ENABLE_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 the QDEC.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [enable](index.html) module"]
pub struct ENABLE_SPEC;
impl crate::RegisterSpec for ENABLE_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [enable::R](R) reader structure"]
impl crate::Readable for ENABLE_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [enable::W](W) writer structure"]
impl crate::Writable for ENABLE_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets ENABLE to value 0"]
impl crate::Resettable for ENABLE_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+64
View File
@@ -0,0 +1,64 @@
#[doc = "Register `EVENTS_ACCOF` reader"]
pub struct R(crate::R<EVENTS_ACCOF_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<EVENTS_ACCOF_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<EVENTS_ACCOF_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<EVENTS_ACCOF_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `EVENTS_ACCOF` writer"]
pub struct W(crate::W<EVENTS_ACCOF_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<EVENTS_ACCOF_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_ACCOF_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EVENTS_ACCOF_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 = "ACC or ACCDBL register overflow.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_accof](index.html) module"]
pub struct EVENTS_ACCOF_SPEC;
impl crate::RegisterSpec for EVENTS_ACCOF_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [events_accof::R](R) reader structure"]
impl crate::Readable for EVENTS_ACCOF_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [events_accof::W](W) writer structure"]
impl crate::Writable for EVENTS_ACCOF_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets EVENTS_ACCOF to value 0"]
impl crate::Resettable for EVENTS_ACCOF_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+64
View File
@@ -0,0 +1,64 @@
#[doc = "Register `EVENTS_REPORTRDY` reader"]
pub struct R(crate::R<EVENTS_REPORTRDY_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<EVENTS_REPORTRDY_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<EVENTS_REPORTRDY_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<EVENTS_REPORTRDY_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `EVENTS_REPORTRDY` writer"]
pub struct W(crate::W<EVENTS_REPORTRDY_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<EVENTS_REPORTRDY_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_REPORTRDY_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EVENTS_REPORTRDY_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 = "REPORTPER number of samples accumulated in ACC register, and ACC register different than zero.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_reportrdy](index.html) module"]
pub struct EVENTS_REPORTRDY_SPEC;
impl crate::RegisterSpec for EVENTS_REPORTRDY_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [events_reportrdy::R](R) reader structure"]
impl crate::Readable for EVENTS_REPORTRDY_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [events_reportrdy::W](W) writer structure"]
impl crate::Writable for EVENTS_REPORTRDY_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets EVENTS_REPORTRDY to value 0"]
impl crate::Resettable for EVENTS_REPORTRDY_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+64
View File
@@ -0,0 +1,64 @@
#[doc = "Register `EVENTS_SAMPLERDY` reader"]
pub struct R(crate::R<EVENTS_SAMPLERDY_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<EVENTS_SAMPLERDY_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<EVENTS_SAMPLERDY_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<EVENTS_SAMPLERDY_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `EVENTS_SAMPLERDY` writer"]
pub struct W(crate::W<EVENTS_SAMPLERDY_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<EVENTS_SAMPLERDY_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_SAMPLERDY_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EVENTS_SAMPLERDY_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 = "A new sample is written to the sample register.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_samplerdy](index.html) module"]
pub struct EVENTS_SAMPLERDY_SPEC;
impl crate::RegisterSpec for EVENTS_SAMPLERDY_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [events_samplerdy::R](R) reader structure"]
impl crate::Readable for EVENTS_SAMPLERDY_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [events_samplerdy::W](W) writer structure"]
impl crate::Writable for EVENTS_SAMPLERDY_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets EVENTS_SAMPLERDY to value 0"]
impl crate::Resettable for EVENTS_SAMPLERDY_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+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 `SAMPLERDY` reader - Disable interrupt on SAMPLERDY event."]
pub type SAMPLERDY_R = crate::BitReader<SAMPLERDY_A>;
#[doc = "Disable interrupt on SAMPLERDY event.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum SAMPLERDY_A {
#[doc = "0: Interrupt disabled."]
DISABLED = 0,
#[doc = "1: Interrupt enabled."]
ENABLED = 1,
}
impl From<SAMPLERDY_A> for bool {
#[inline(always)]
fn from(variant: SAMPLERDY_A) -> Self {
variant as u8 != 0
}
}
impl SAMPLERDY_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> SAMPLERDY_A {
match self.bits {
false => SAMPLERDY_A::DISABLED,
true => SAMPLERDY_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == SAMPLERDY_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == SAMPLERDY_A::ENABLED
}
}
#[doc = "Disable interrupt on SAMPLERDY event.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum SAMPLERDY_AW {
#[doc = "1: Disable interrupt on write."]
CLEAR = 1,
}
impl From<SAMPLERDY_AW> for bool {
#[inline(always)]
fn from(variant: SAMPLERDY_AW) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `SAMPLERDY` writer - Disable interrupt on SAMPLERDY event."]
pub type SAMPLERDY_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENCLR_SPEC, SAMPLERDY_AW, O>;
impl<'a, const O: u8> SAMPLERDY_W<'a, O> {
#[doc = "Disable interrupt on write."]
#[inline(always)]
pub fn clear(self) -> &'a mut W {
self.variant(SAMPLERDY_AW::CLEAR)
}
}
#[doc = "Field `REPORTRDY` reader - Disable interrupt on REPORTRDY event."]
pub type REPORTRDY_R = crate::BitReader<REPORTRDY_A>;
#[doc = "Disable interrupt on REPORTRDY event.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum REPORTRDY_A {
#[doc = "0: Interrupt disabled."]
DISABLED = 0,
#[doc = "1: Interrupt enabled."]
ENABLED = 1,
}
impl From<REPORTRDY_A> for bool {
#[inline(always)]
fn from(variant: REPORTRDY_A) -> Self {
variant as u8 != 0
}
}
impl REPORTRDY_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> REPORTRDY_A {
match self.bits {
false => REPORTRDY_A::DISABLED,
true => REPORTRDY_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == REPORTRDY_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == REPORTRDY_A::ENABLED
}
}
#[doc = "Disable interrupt on REPORTRDY event.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum REPORTRDY_AW {
#[doc = "1: Disable interrupt on write."]
CLEAR = 1,
}
impl From<REPORTRDY_AW> for bool {
#[inline(always)]
fn from(variant: REPORTRDY_AW) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `REPORTRDY` writer - Disable interrupt on REPORTRDY event."]
pub type REPORTRDY_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENCLR_SPEC, REPORTRDY_AW, O>;
impl<'a, const O: u8> REPORTRDY_W<'a, O> {
#[doc = "Disable interrupt on write."]
#[inline(always)]
pub fn clear(self) -> &'a mut W {
self.variant(REPORTRDY_AW::CLEAR)
}
}
#[doc = "Field `ACCOF` reader - Disable interrupt on ACCOF event."]
pub type ACCOF_R = crate::BitReader<ACCOF_A>;
#[doc = "Disable interrupt on ACCOF event.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ACCOF_A {
#[doc = "0: Interrupt disabled."]
DISABLED = 0,
#[doc = "1: Interrupt enabled."]
ENABLED = 1,
}
impl From<ACCOF_A> for bool {
#[inline(always)]
fn from(variant: ACCOF_A) -> Self {
variant as u8 != 0
}
}
impl ACCOF_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> ACCOF_A {
match self.bits {
false => ACCOF_A::DISABLED,
true => ACCOF_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ACCOF_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ACCOF_A::ENABLED
}
}
#[doc = "Disable interrupt on ACCOF event.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ACCOF_AW {
#[doc = "1: Disable interrupt on write."]
CLEAR = 1,
}
impl From<ACCOF_AW> for bool {
#[inline(always)]
fn from(variant: ACCOF_AW) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `ACCOF` writer - Disable interrupt on ACCOF event."]
pub type ACCOF_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENCLR_SPEC, ACCOF_AW, O>;
impl<'a, const O: u8> ACCOF_W<'a, O> {
#[doc = "Disable interrupt on write."]
#[inline(always)]
pub fn clear(self) -> &'a mut W {
self.variant(ACCOF_AW::CLEAR)
}
}
impl R {
#[doc = "Bit 0 - Disable interrupt on SAMPLERDY event."]
#[inline(always)]
pub fn samplerdy(&self) -> SAMPLERDY_R {
SAMPLERDY_R::new((self.bits & 1) != 0)
}
#[doc = "Bit 1 - Disable interrupt on REPORTRDY event."]
#[inline(always)]
pub fn reportrdy(&self) -> REPORTRDY_R {
REPORTRDY_R::new(((self.bits >> 1) & 1) != 0)
}
#[doc = "Bit 2 - Disable interrupt on ACCOF event."]
#[inline(always)]
pub fn accof(&self) -> ACCOF_R {
ACCOF_R::new(((self.bits >> 2) & 1) != 0)
}
}
impl W {
#[doc = "Bit 0 - Disable interrupt on SAMPLERDY event."]
#[inline(always)]
pub fn samplerdy(&mut self) -> SAMPLERDY_W<0> {
SAMPLERDY_W::new(self)
}
#[doc = "Bit 1 - Disable interrupt on REPORTRDY event."]
#[inline(always)]
pub fn reportrdy(&mut self) -> REPORTRDY_W<1> {
REPORTRDY_W::new(self)
}
#[doc = "Bit 2 - Disable interrupt on ACCOF event."]
#[inline(always)]
pub fn accof(&mut self) -> ACCOF_W<2> {
ACCOF_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 = "Interrupt enable clear register.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [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 `SAMPLERDY` reader - Enable interrupt on SAMPLERDY event."]
pub type SAMPLERDY_R = crate::BitReader<SAMPLERDY_A>;
#[doc = "Enable interrupt on SAMPLERDY event.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum SAMPLERDY_A {
#[doc = "0: Interrupt disabled."]
DISABLED = 0,
#[doc = "1: Interrupt enabled."]
ENABLED = 1,
}
impl From<SAMPLERDY_A> for bool {
#[inline(always)]
fn from(variant: SAMPLERDY_A) -> Self {
variant as u8 != 0
}
}
impl SAMPLERDY_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> SAMPLERDY_A {
match self.bits {
false => SAMPLERDY_A::DISABLED,
true => SAMPLERDY_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == SAMPLERDY_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == SAMPLERDY_A::ENABLED
}
}
#[doc = "Enable interrupt on SAMPLERDY event.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum SAMPLERDY_AW {
#[doc = "1: Enable interrupt on write."]
SET = 1,
}
impl From<SAMPLERDY_AW> for bool {
#[inline(always)]
fn from(variant: SAMPLERDY_AW) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `SAMPLERDY` writer - Enable interrupt on SAMPLERDY event."]
pub type SAMPLERDY_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENSET_SPEC, SAMPLERDY_AW, O>;
impl<'a, const O: u8> SAMPLERDY_W<'a, O> {
#[doc = "Enable interrupt on write."]
#[inline(always)]
pub fn set(self) -> &'a mut W {
self.variant(SAMPLERDY_AW::SET)
}
}
#[doc = "Field `REPORTRDY` reader - Enable interrupt on REPORTRDY event."]
pub type REPORTRDY_R = crate::BitReader<REPORTRDY_A>;
#[doc = "Enable interrupt on REPORTRDY event.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum REPORTRDY_A {
#[doc = "0: Interrupt disabled."]
DISABLED = 0,
#[doc = "1: Interrupt enabled."]
ENABLED = 1,
}
impl From<REPORTRDY_A> for bool {
#[inline(always)]
fn from(variant: REPORTRDY_A) -> Self {
variant as u8 != 0
}
}
impl REPORTRDY_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> REPORTRDY_A {
match self.bits {
false => REPORTRDY_A::DISABLED,
true => REPORTRDY_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == REPORTRDY_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == REPORTRDY_A::ENABLED
}
}
#[doc = "Enable interrupt on REPORTRDY event.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum REPORTRDY_AW {
#[doc = "1: Enable interrupt on write."]
SET = 1,
}
impl From<REPORTRDY_AW> for bool {
#[inline(always)]
fn from(variant: REPORTRDY_AW) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `REPORTRDY` writer - Enable interrupt on REPORTRDY event."]
pub type REPORTRDY_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENSET_SPEC, REPORTRDY_AW, O>;
impl<'a, const O: u8> REPORTRDY_W<'a, O> {
#[doc = "Enable interrupt on write."]
#[inline(always)]
pub fn set(self) -> &'a mut W {
self.variant(REPORTRDY_AW::SET)
}
}
#[doc = "Field `ACCOF` reader - Enable interrupt on ACCOF event."]
pub type ACCOF_R = crate::BitReader<ACCOF_A>;
#[doc = "Enable interrupt on ACCOF event.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ACCOF_A {
#[doc = "0: Interrupt disabled."]
DISABLED = 0,
#[doc = "1: Interrupt enabled."]
ENABLED = 1,
}
impl From<ACCOF_A> for bool {
#[inline(always)]
fn from(variant: ACCOF_A) -> Self {
variant as u8 != 0
}
}
impl ACCOF_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> ACCOF_A {
match self.bits {
false => ACCOF_A::DISABLED,
true => ACCOF_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == ACCOF_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == ACCOF_A::ENABLED
}
}
#[doc = "Enable interrupt on ACCOF event.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ACCOF_AW {
#[doc = "1: Enable interrupt on write."]
SET = 1,
}
impl From<ACCOF_AW> for bool {
#[inline(always)]
fn from(variant: ACCOF_AW) -> Self {
variant as u8 != 0
}
}
#[doc = "Field `ACCOF` writer - Enable interrupt on ACCOF event."]
pub type ACCOF_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENSET_SPEC, ACCOF_AW, O>;
impl<'a, const O: u8> ACCOF_W<'a, O> {
#[doc = "Enable interrupt on write."]
#[inline(always)]
pub fn set(self) -> &'a mut W {
self.variant(ACCOF_AW::SET)
}
}
impl R {
#[doc = "Bit 0 - Enable interrupt on SAMPLERDY event."]
#[inline(always)]
pub fn samplerdy(&self) -> SAMPLERDY_R {
SAMPLERDY_R::new((self.bits & 1) != 0)
}
#[doc = "Bit 1 - Enable interrupt on REPORTRDY event."]
#[inline(always)]
pub fn reportrdy(&self) -> REPORTRDY_R {
REPORTRDY_R::new(((self.bits >> 1) & 1) != 0)
}
#[doc = "Bit 2 - Enable interrupt on ACCOF event."]
#[inline(always)]
pub fn accof(&self) -> ACCOF_R {
ACCOF_R::new(((self.bits >> 2) & 1) != 0)
}
}
impl W {
#[doc = "Bit 0 - Enable interrupt on SAMPLERDY event."]
#[inline(always)]
pub fn samplerdy(&mut self) -> SAMPLERDY_W<0> {
SAMPLERDY_W::new(self)
}
#[doc = "Bit 1 - Enable interrupt on REPORTRDY event."]
#[inline(always)]
pub fn reportrdy(&mut self) -> REPORTRDY_W<1> {
REPORTRDY_W::new(self)
}
#[doc = "Bit 2 - Enable interrupt on ACCOF event."]
#[inline(always)]
pub fn accof(&mut self) -> ACCOF_W<2> {
ACCOF_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 = "Interrupt enable set register.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [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
}
}
+126
View File
@@ -0,0 +1,126 @@
#[doc = "Register `LEDPOL` reader"]
pub struct R(crate::R<LEDPOL_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<LEDPOL_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<LEDPOL_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<LEDPOL_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `LEDPOL` writer"]
pub struct W(crate::W<LEDPOL_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<LEDPOL_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<LEDPOL_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<LEDPOL_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `LEDPOL` reader - LED output pin polarity."]
pub type LEDPOL_R = crate::BitReader<LEDPOL_A>;
#[doc = "LED output pin polarity.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum LEDPOL_A {
#[doc = "0: LED output is active low."]
ACTIVE_LOW = 0,
#[doc = "1: LED output is active high."]
ACTIVE_HIGH = 1,
}
impl From<LEDPOL_A> for bool {
#[inline(always)]
fn from(variant: LEDPOL_A) -> Self {
variant as u8 != 0
}
}
impl LEDPOL_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> LEDPOL_A {
match self.bits {
false => LEDPOL_A::ACTIVE_LOW,
true => LEDPOL_A::ACTIVE_HIGH,
}
}
#[doc = "Checks if the value of the field is `ACTIVE_LOW`"]
#[inline(always)]
pub fn is_active_low(&self) -> bool {
*self == LEDPOL_A::ACTIVE_LOW
}
#[doc = "Checks if the value of the field is `ACTIVE_HIGH`"]
#[inline(always)]
pub fn is_active_high(&self) -> bool {
*self == LEDPOL_A::ACTIVE_HIGH
}
}
#[doc = "Field `LEDPOL` writer - LED output pin polarity."]
pub type LEDPOL_W<'a, const O: u8> = crate::BitWriter<'a, u32, LEDPOL_SPEC, LEDPOL_A, O>;
impl<'a, const O: u8> LEDPOL_W<'a, O> {
#[doc = "LED output is active low."]
#[inline(always)]
pub fn active_low(self) -> &'a mut W {
self.variant(LEDPOL_A::ACTIVE_LOW)
}
#[doc = "LED output is active high."]
#[inline(always)]
pub fn active_high(self) -> &'a mut W {
self.variant(LEDPOL_A::ACTIVE_HIGH)
}
}
impl R {
#[doc = "Bit 0 - LED output pin polarity."]
#[inline(always)]
pub fn ledpol(&self) -> LEDPOL_R {
LEDPOL_R::new((self.bits & 1) != 0)
}
}
impl W {
#[doc = "Bit 0 - LED output pin polarity."]
#[inline(always)]
pub fn ledpol(&mut self) -> LEDPOL_W<0> {
LEDPOL_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 = "LED output pin polarity.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ledpol](index.html) module"]
pub struct LEDPOL_SPEC;
impl crate::RegisterSpec for LEDPOL_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [ledpol::R](R) reader structure"]
impl crate::Readable for LEDPOL_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [ledpol::W](W) writer structure"]
impl crate::Writable for LEDPOL_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets LEDPOL to value 0"]
impl crate::Resettable for LEDPOL_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+80
View File
@@ -0,0 +1,80 @@
#[doc = "Register `LEDPRE` reader"]
pub struct R(crate::R<LEDPRE_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<LEDPRE_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<LEDPRE_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<LEDPRE_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `LEDPRE` writer"]
pub struct W(crate::W<LEDPRE_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<LEDPRE_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<LEDPRE_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<LEDPRE_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `LEDPRE` reader - Period in us the LED in switched on prior to sampling."]
pub type LEDPRE_R = crate::FieldReader<u16, u16>;
#[doc = "Field `LEDPRE` writer - Period in us the LED in switched on prior to sampling."]
pub type LEDPRE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, LEDPRE_SPEC, u16, u16, 9, O>;
impl R {
#[doc = "Bits 0:8 - Period in us the LED in switched on prior to sampling."]
#[inline(always)]
pub fn ledpre(&self) -> LEDPRE_R {
LEDPRE_R::new((self.bits & 0x01ff) as u16)
}
}
impl W {
#[doc = "Bits 0:8 - Period in us the LED in switched on prior to sampling."]
#[inline(always)]
pub fn ledpre(&mut self) -> LEDPRE_W<0> {
LEDPRE_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 = "Time LED is switched ON before the sample.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ledpre](index.html) module"]
pub struct LEDPRE_SPEC;
impl crate::RegisterSpec for LEDPRE_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [ledpre::R](R) reader structure"]
impl crate::Readable for LEDPRE_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [ledpre::W](W) writer structure"]
impl crate::Writable for LEDPRE_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets LEDPRE to value 0x10"]
impl crate::Resettable for LEDPRE_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0x10
}
}
+126
View File
@@ -0,0 +1,126 @@
#[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 `POWER` reader - Peripheral power control."]
pub type POWER_R = crate::BitReader<POWER_A>;
#[doc = "Peripheral power control.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum POWER_A {
#[doc = "0: Module power disabled."]
DISABLED = 0,
#[doc = "1: Module power enabled."]
ENABLED = 1,
}
impl From<POWER_A> for bool {
#[inline(always)]
fn from(variant: POWER_A) -> Self {
variant as u8 != 0
}
}
impl POWER_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> POWER_A {
match self.bits {
false => POWER_A::DISABLED,
true => POWER_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == POWER_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == POWER_A::ENABLED
}
}
#[doc = "Field `POWER` writer - Peripheral power control."]
pub type POWER_W<'a, const O: u8> = crate::BitWriter<'a, u32, POWER_SPEC, POWER_A, O>;
impl<'a, const O: u8> POWER_W<'a, O> {
#[doc = "Module power disabled."]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(POWER_A::DISABLED)
}
#[doc = "Module power enabled."]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(POWER_A::ENABLED)
}
}
impl R {
#[doc = "Bit 0 - Peripheral power control."]
#[inline(always)]
pub fn power(&self) -> POWER_R {
POWER_R::new((self.bits & 1) != 0)
}
}
impl W {
#[doc = "Bit 0 - Peripheral power control."]
#[inline(always)]
pub fn power(&mut self) -> POWER_W<0> {
POWER_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 = "Peripheral power control.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [power](index.html) module"]
pub struct POWER_SPEC;
impl crate::RegisterSpec for POWER_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [power::R](R) reader structure"]
impl crate::Readable for POWER_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [power::W](W) writer structure"]
impl crate::Writable for POWER_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets POWER to value 0"]
impl crate::Resettable for POWER_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+64
View File
@@ -0,0 +1,64 @@
#[doc = "Register `PSELA` reader"]
pub struct R(crate::R<PSELA_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<PSELA_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<PSELA_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<PSELA_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `PSELA` writer"]
pub struct W(crate::W<PSELA_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<PSELA_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<PSELA_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<PSELA_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 = "Pin select for phase A input.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [psela](index.html) module"]
pub struct PSELA_SPEC;
impl crate::RegisterSpec for PSELA_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [psela::R](R) reader structure"]
impl crate::Readable for PSELA_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [psela::W](W) writer structure"]
impl crate::Writable for PSELA_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets PSELA to value 0xffff_ffff"]
impl crate::Resettable for PSELA_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0xffff_ffff
}
}
+64
View File
@@ -0,0 +1,64 @@
#[doc = "Register `PSELB` reader"]
pub struct R(crate::R<PSELB_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<PSELB_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<PSELB_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<PSELB_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `PSELB` writer"]
pub struct W(crate::W<PSELB_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<PSELB_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<PSELB_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<PSELB_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 = "Pin select for phase B input.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pselb](index.html) module"]
pub struct PSELB_SPEC;
impl crate::RegisterSpec for PSELB_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [pselb::R](R) reader structure"]
impl crate::Readable for PSELB_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [pselb::W](W) writer structure"]
impl crate::Writable for PSELB_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets PSELB to value 0xffff_ffff"]
impl crate::Resettable for PSELB_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0xffff_ffff
}
}
+64
View File
@@ -0,0 +1,64 @@
#[doc = "Register `PSELLED` reader"]
pub struct R(crate::R<PSELLED_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<PSELLED_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<PSELLED_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<PSELLED_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `PSELLED` writer"]
pub struct W(crate::W<PSELLED_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<PSELLED_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<PSELLED_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<PSELLED_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 = "Pin select for LED output.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pselled](index.html) module"]
pub struct PSELLED_SPEC;
impl crate::RegisterSpec for PSELLED_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [pselled::R](R) reader structure"]
impl crate::Readable for PSELLED_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [pselled::W](W) writer structure"]
impl crate::Writable for PSELLED_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets PSELLED to value 0xffff_ffff"]
impl crate::Resettable for PSELLED_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0xffff_ffff
}
}
+207
View File
@@ -0,0 +1,207 @@
#[doc = "Register `REPORTPER` reader"]
pub struct R(crate::R<REPORTPER_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<REPORTPER_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<REPORTPER_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<REPORTPER_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `REPORTPER` writer"]
pub struct W(crate::W<REPORTPER_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<REPORTPER_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<REPORTPER_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<REPORTPER_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `REPORTPER` reader - Number of samples to generate an EVENT_REPORTRDY."]
pub type REPORTPER_R = crate::FieldReader<u8, REPORTPER_A>;
#[doc = "Number of samples to generate an EVENT_REPORTRDY.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum REPORTPER_A {
#[doc = "0: 10 samples per report."]
_10SMPL = 0,
#[doc = "1: 40 samples per report."]
_40SMPL = 1,
#[doc = "2: 80 samples per report."]
_80SMPL = 2,
#[doc = "3: 120 samples per report."]
_120SMPL = 3,
#[doc = "4: 160 samples per report."]
_160SMPL = 4,
#[doc = "5: 200 samples per report."]
_200SMPL = 5,
#[doc = "6: 240 samples per report."]
_240SMPL = 6,
#[doc = "7: 280 samples per report."]
_280SMPL = 7,
}
impl From<REPORTPER_A> for u8 {
#[inline(always)]
fn from(variant: REPORTPER_A) -> Self {
variant as _
}
}
impl REPORTPER_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> REPORTPER_A {
match self.bits {
0 => REPORTPER_A::_10SMPL,
1 => REPORTPER_A::_40SMPL,
2 => REPORTPER_A::_80SMPL,
3 => REPORTPER_A::_120SMPL,
4 => REPORTPER_A::_160SMPL,
5 => REPORTPER_A::_200SMPL,
6 => REPORTPER_A::_240SMPL,
7 => REPORTPER_A::_280SMPL,
_ => unreachable!(),
}
}
#[doc = "Checks if the value of the field is `_10SMPL`"]
#[inline(always)]
pub fn is_10smpl(&self) -> bool {
*self == REPORTPER_A::_10SMPL
}
#[doc = "Checks if the value of the field is `_40SMPL`"]
#[inline(always)]
pub fn is_40smpl(&self) -> bool {
*self == REPORTPER_A::_40SMPL
}
#[doc = "Checks if the value of the field is `_80SMPL`"]
#[inline(always)]
pub fn is_80smpl(&self) -> bool {
*self == REPORTPER_A::_80SMPL
}
#[doc = "Checks if the value of the field is `_120SMPL`"]
#[inline(always)]
pub fn is_120smpl(&self) -> bool {
*self == REPORTPER_A::_120SMPL
}
#[doc = "Checks if the value of the field is `_160SMPL`"]
#[inline(always)]
pub fn is_160smpl(&self) -> bool {
*self == REPORTPER_A::_160SMPL
}
#[doc = "Checks if the value of the field is `_200SMPL`"]
#[inline(always)]
pub fn is_200smpl(&self) -> bool {
*self == REPORTPER_A::_200SMPL
}
#[doc = "Checks if the value of the field is `_240SMPL`"]
#[inline(always)]
pub fn is_240smpl(&self) -> bool {
*self == REPORTPER_A::_240SMPL
}
#[doc = "Checks if the value of the field is `_280SMPL`"]
#[inline(always)]
pub fn is_280smpl(&self) -> bool {
*self == REPORTPER_A::_280SMPL
}
}
#[doc = "Field `REPORTPER` writer - Number of samples to generate an EVENT_REPORTRDY."]
pub type REPORTPER_W<'a, const O: u8> =
crate::FieldWriterSafe<'a, u32, REPORTPER_SPEC, u8, REPORTPER_A, 3, O>;
impl<'a, const O: u8> REPORTPER_W<'a, O> {
#[doc = "10 samples per report."]
#[inline(always)]
pub fn _10smpl(self) -> &'a mut W {
self.variant(REPORTPER_A::_10SMPL)
}
#[doc = "40 samples per report."]
#[inline(always)]
pub fn _40smpl(self) -> &'a mut W {
self.variant(REPORTPER_A::_40SMPL)
}
#[doc = "80 samples per report."]
#[inline(always)]
pub fn _80smpl(self) -> &'a mut W {
self.variant(REPORTPER_A::_80SMPL)
}
#[doc = "120 samples per report."]
#[inline(always)]
pub fn _120smpl(self) -> &'a mut W {
self.variant(REPORTPER_A::_120SMPL)
}
#[doc = "160 samples per report."]
#[inline(always)]
pub fn _160smpl(self) -> &'a mut W {
self.variant(REPORTPER_A::_160SMPL)
}
#[doc = "200 samples per report."]
#[inline(always)]
pub fn _200smpl(self) -> &'a mut W {
self.variant(REPORTPER_A::_200SMPL)
}
#[doc = "240 samples per report."]
#[inline(always)]
pub fn _240smpl(self) -> &'a mut W {
self.variant(REPORTPER_A::_240SMPL)
}
#[doc = "280 samples per report."]
#[inline(always)]
pub fn _280smpl(self) -> &'a mut W {
self.variant(REPORTPER_A::_280SMPL)
}
}
impl R {
#[doc = "Bits 0:2 - Number of samples to generate an EVENT_REPORTRDY."]
#[inline(always)]
pub fn reportper(&self) -> REPORTPER_R {
REPORTPER_R::new((self.bits & 7) as u8)
}
}
impl W {
#[doc = "Bits 0:2 - Number of samples to generate an EVENT_REPORTRDY."]
#[inline(always)]
pub fn reportper(&mut self) -> REPORTPER_W<0> {
REPORTPER_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 = "Number of samples to generate an EVENT_REPORTRDY.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [reportper](index.html) module"]
pub struct REPORTPER_SPEC;
impl crate::RegisterSpec for REPORTPER_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [reportper::R](R) reader structure"]
impl crate::Readable for REPORTPER_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [reportper::W](W) writer structure"]
impl crate::Writable for REPORTPER_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets REPORTPER to value 0"]
impl crate::Resettable for REPORTPER_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+40
View File
@@ -0,0 +1,40 @@
#[doc = "Register `SAMPLE` reader"]
pub struct R(crate::R<SAMPLE_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<SAMPLE_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<SAMPLE_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<SAMPLE_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Field `SAMPLE` reader - Last sample taken in compliment to 2."]
pub type SAMPLE_R = crate::FieldReader<u32, u32>;
impl R {
#[doc = "Bits 0:31 - Last sample taken in compliment to 2."]
#[inline(always)]
pub fn sample(&self) -> SAMPLE_R {
SAMPLE_R::new(self.bits)
}
}
#[doc = "Motion sample value.\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sample](index.html) module"]
pub struct SAMPLE_SPEC;
impl crate::RegisterSpec for SAMPLE_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [sample::R](R) reader structure"]
impl crate::Readable for SAMPLE_SPEC {
type Reader = R;
}
#[doc = "`reset()` method sets SAMPLE to value 0"]
impl crate::Resettable for SAMPLE_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+207
View File
@@ -0,0 +1,207 @@
#[doc = "Register `SAMPLEPER` reader"]
pub struct R(crate::R<SAMPLEPER_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<SAMPLEPER_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<SAMPLEPER_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<SAMPLEPER_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `SAMPLEPER` writer"]
pub struct W(crate::W<SAMPLEPER_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<SAMPLEPER_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<SAMPLEPER_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<SAMPLEPER_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `SAMPLEPER` reader - Sample period."]
pub type SAMPLEPER_R = crate::FieldReader<u8, SAMPLEPER_A>;
#[doc = "Sample period.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum SAMPLEPER_A {
#[doc = "0: 128us sample period."]
_128US = 0,
#[doc = "1: 256us sample period."]
_256US = 1,
#[doc = "2: 512us sample period."]
_512US = 2,
#[doc = "3: 1024us sample period."]
_1024US = 3,
#[doc = "4: 2048us sample period."]
_2048US = 4,
#[doc = "5: 4096us sample period."]
_4096US = 5,
#[doc = "6: 8192us sample period."]
_8192US = 6,
#[doc = "7: 16384us sample period."]
_16384US = 7,
}
impl From<SAMPLEPER_A> for u8 {
#[inline(always)]
fn from(variant: SAMPLEPER_A) -> Self {
variant as _
}
}
impl SAMPLEPER_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> SAMPLEPER_A {
match self.bits {
0 => SAMPLEPER_A::_128US,
1 => SAMPLEPER_A::_256US,
2 => SAMPLEPER_A::_512US,
3 => SAMPLEPER_A::_1024US,
4 => SAMPLEPER_A::_2048US,
5 => SAMPLEPER_A::_4096US,
6 => SAMPLEPER_A::_8192US,
7 => SAMPLEPER_A::_16384US,
_ => unreachable!(),
}
}
#[doc = "Checks if the value of the field is `_128US`"]
#[inline(always)]
pub fn is_128us(&self) -> bool {
*self == SAMPLEPER_A::_128US
}
#[doc = "Checks if the value of the field is `_256US`"]
#[inline(always)]
pub fn is_256us(&self) -> bool {
*self == SAMPLEPER_A::_256US
}
#[doc = "Checks if the value of the field is `_512US`"]
#[inline(always)]
pub fn is_512us(&self) -> bool {
*self == SAMPLEPER_A::_512US
}
#[doc = "Checks if the value of the field is `_1024US`"]
#[inline(always)]
pub fn is_1024us(&self) -> bool {
*self == SAMPLEPER_A::_1024US
}
#[doc = "Checks if the value of the field is `_2048US`"]
#[inline(always)]
pub fn is_2048us(&self) -> bool {
*self == SAMPLEPER_A::_2048US
}
#[doc = "Checks if the value of the field is `_4096US`"]
#[inline(always)]
pub fn is_4096us(&self) -> bool {
*self == SAMPLEPER_A::_4096US
}
#[doc = "Checks if the value of the field is `_8192US`"]
#[inline(always)]
pub fn is_8192us(&self) -> bool {
*self == SAMPLEPER_A::_8192US
}
#[doc = "Checks if the value of the field is `_16384US`"]
#[inline(always)]
pub fn is_16384us(&self) -> bool {
*self == SAMPLEPER_A::_16384US
}
}
#[doc = "Field `SAMPLEPER` writer - Sample period."]
pub type SAMPLEPER_W<'a, const O: u8> =
crate::FieldWriterSafe<'a, u32, SAMPLEPER_SPEC, u8, SAMPLEPER_A, 3, O>;
impl<'a, const O: u8> SAMPLEPER_W<'a, O> {
#[doc = "128us sample period."]
#[inline(always)]
pub fn _128us(self) -> &'a mut W {
self.variant(SAMPLEPER_A::_128US)
}
#[doc = "256us sample period."]
#[inline(always)]
pub fn _256us(self) -> &'a mut W {
self.variant(SAMPLEPER_A::_256US)
}
#[doc = "512us sample period."]
#[inline(always)]
pub fn _512us(self) -> &'a mut W {
self.variant(SAMPLEPER_A::_512US)
}
#[doc = "1024us sample period."]
#[inline(always)]
pub fn _1024us(self) -> &'a mut W {
self.variant(SAMPLEPER_A::_1024US)
}
#[doc = "2048us sample period."]
#[inline(always)]
pub fn _2048us(self) -> &'a mut W {
self.variant(SAMPLEPER_A::_2048US)
}
#[doc = "4096us sample period."]
#[inline(always)]
pub fn _4096us(self) -> &'a mut W {
self.variant(SAMPLEPER_A::_4096US)
}
#[doc = "8192us sample period."]
#[inline(always)]
pub fn _8192us(self) -> &'a mut W {
self.variant(SAMPLEPER_A::_8192US)
}
#[doc = "16384us sample period."]
#[inline(always)]
pub fn _16384us(self) -> &'a mut W {
self.variant(SAMPLEPER_A::_16384US)
}
}
impl R {
#[doc = "Bits 0:2 - Sample period."]
#[inline(always)]
pub fn sampleper(&self) -> SAMPLEPER_R {
SAMPLEPER_R::new((self.bits & 7) as u8)
}
}
impl W {
#[doc = "Bits 0:2 - Sample period."]
#[inline(always)]
pub fn sampleper(&mut self) -> SAMPLEPER_W<0> {
SAMPLEPER_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 = "Sample period.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sampleper](index.html) module"]
pub struct SAMPLEPER_SPEC;
impl crate::RegisterSpec for SAMPLEPER_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [sampleper::R](R) reader structure"]
impl crate::Readable for SAMPLEPER_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [sampleper::W](W) writer structure"]
impl crate::Writable for SAMPLEPER_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets SAMPLEPER to value 0"]
impl crate::Resettable for SAMPLEPER_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+188
View File
@@ -0,0 +1,188 @@
#[doc = "Register `SHORTS` reader"]
pub struct R(crate::R<SHORTS_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<SHORTS_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<SHORTS_SPEC>> for R {
#[inline(always)]
fn from(reader: crate::R<SHORTS_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `SHORTS` writer"]
pub struct W(crate::W<SHORTS_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<SHORTS_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<SHORTS_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<SHORTS_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `REPORTRDY_READCLRACC` reader - Shortcut between REPORTRDY event and READCLRACC task."]
pub type REPORTRDY_READCLRACC_R = crate::BitReader<REPORTRDY_READCLRACC_A>;
#[doc = "Shortcut between REPORTRDY event and READCLRACC task.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum REPORTRDY_READCLRACC_A {
#[doc = "0: Shortcut disabled."]
DISABLED = 0,
#[doc = "1: Shortcut enabled."]
ENABLED = 1,
}
impl From<REPORTRDY_READCLRACC_A> for bool {
#[inline(always)]
fn from(variant: REPORTRDY_READCLRACC_A) -> Self {
variant as u8 != 0
}
}
impl REPORTRDY_READCLRACC_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> REPORTRDY_READCLRACC_A {
match self.bits {
false => REPORTRDY_READCLRACC_A::DISABLED,
true => REPORTRDY_READCLRACC_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == REPORTRDY_READCLRACC_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == REPORTRDY_READCLRACC_A::ENABLED
}
}
#[doc = "Field `REPORTRDY_READCLRACC` writer - Shortcut between REPORTRDY event and READCLRACC task."]
pub type REPORTRDY_READCLRACC_W<'a, const O: u8> =
crate::BitWriter<'a, u32, SHORTS_SPEC, REPORTRDY_READCLRACC_A, O>;
impl<'a, const O: u8> REPORTRDY_READCLRACC_W<'a, O> {
#[doc = "Shortcut disabled."]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(REPORTRDY_READCLRACC_A::DISABLED)
}
#[doc = "Shortcut enabled."]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(REPORTRDY_READCLRACC_A::ENABLED)
}
}
#[doc = "Field `SAMPLERDY_STOP` reader - Shortcut between SAMPLERDY event and STOP task."]
pub type SAMPLERDY_STOP_R = crate::BitReader<SAMPLERDY_STOP_A>;
#[doc = "Shortcut between SAMPLERDY event and STOP task.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum SAMPLERDY_STOP_A {
#[doc = "0: Shortcut disabled."]
DISABLED = 0,
#[doc = "1: Shortcut enabled."]
ENABLED = 1,
}
impl From<SAMPLERDY_STOP_A> for bool {
#[inline(always)]
fn from(variant: SAMPLERDY_STOP_A) -> Self {
variant as u8 != 0
}
}
impl SAMPLERDY_STOP_R {
#[doc = "Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> SAMPLERDY_STOP_A {
match self.bits {
false => SAMPLERDY_STOP_A::DISABLED,
true => SAMPLERDY_STOP_A::ENABLED,
}
}
#[doc = "Checks if the value of the field is `DISABLED`"]
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == SAMPLERDY_STOP_A::DISABLED
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
*self == SAMPLERDY_STOP_A::ENABLED
}
}
#[doc = "Field `SAMPLERDY_STOP` writer - Shortcut between SAMPLERDY event and STOP task."]
pub type SAMPLERDY_STOP_W<'a, const O: u8> =
crate::BitWriter<'a, u32, SHORTS_SPEC, SAMPLERDY_STOP_A, O>;
impl<'a, const O: u8> SAMPLERDY_STOP_W<'a, O> {
#[doc = "Shortcut disabled."]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(SAMPLERDY_STOP_A::DISABLED)
}
#[doc = "Shortcut enabled."]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
self.variant(SAMPLERDY_STOP_A::ENABLED)
}
}
impl R {
#[doc = "Bit 0 - Shortcut between REPORTRDY event and READCLRACC task."]
#[inline(always)]
pub fn reportrdy_readclracc(&self) -> REPORTRDY_READCLRACC_R {
REPORTRDY_READCLRACC_R::new((self.bits & 1) != 0)
}
#[doc = "Bit 1 - Shortcut between SAMPLERDY event and STOP task."]
#[inline(always)]
pub fn samplerdy_stop(&self) -> SAMPLERDY_STOP_R {
SAMPLERDY_STOP_R::new(((self.bits >> 1) & 1) != 0)
}
}
impl W {
#[doc = "Bit 0 - Shortcut between REPORTRDY event and READCLRACC task."]
#[inline(always)]
pub fn reportrdy_readclracc(&mut self) -> REPORTRDY_READCLRACC_W<0> {
REPORTRDY_READCLRACC_W::new(self)
}
#[doc = "Bit 1 - Shortcut between SAMPLERDY event and STOP task."]
#[inline(always)]
pub fn samplerdy_stop(&mut self) -> SAMPLERDY_STOP_W<1> {
SAMPLERDY_STOP_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 = "Shortcuts for the QDEC.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [shorts](index.html) module"]
pub struct SHORTS_SPEC;
impl crate::RegisterSpec for SHORTS_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [shorts::R](R) reader structure"]
impl crate::Readable for SHORTS_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [shorts::W](W) writer structure"]
impl crate::Writable for SHORTS_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets SHORTS to value 0"]
impl crate::Resettable for SHORTS_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+45
View File
@@ -0,0 +1,45 @@
#[doc = "Register `TASKS_READCLRACC` writer"]
pub struct W(crate::W<TASKS_READCLRACC_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<TASKS_READCLRACC_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_READCLRACC_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<TASKS_READCLRACC_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 = "Transfers the content from ACC registers to ACCREAD registers, and clears the ACC registers.\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_readclracc](index.html) module"]
pub struct TASKS_READCLRACC_SPEC;
impl crate::RegisterSpec for TASKS_READCLRACC_SPEC {
type Ux = u32;
}
#[doc = "`write(|w| ..)` method takes [tasks_readclracc::W](W) writer structure"]
impl crate::Writable for TASKS_READCLRACC_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets TASKS_READCLRACC to value 0"]
impl crate::Resettable for TASKS_READCLRACC_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+45
View File
@@ -0,0 +1,45 @@
#[doc = "Register `TASKS_START` writer"]
pub struct W(crate::W<TASKS_START_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<TASKS_START_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_START_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<TASKS_START_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 = "Start the quadrature decoder.\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_start](index.html) module"]
pub struct TASKS_START_SPEC;
impl crate::RegisterSpec for TASKS_START_SPEC {
type Ux = u32;
}
#[doc = "`write(|w| ..)` method takes [tasks_start::W](W) writer structure"]
impl crate::Writable for TASKS_START_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets TASKS_START to value 0"]
impl crate::Resettable for TASKS_START_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
+45
View File
@@ -0,0 +1,45 @@
#[doc = "Register `TASKS_STOP` writer"]
pub struct W(crate::W<TASKS_STOP_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<TASKS_STOP_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_STOP_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<TASKS_STOP_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 = "Stop the quadrature decoder.\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_stop](index.html) module"]
pub struct TASKS_STOP_SPEC;
impl crate::RegisterSpec for TASKS_STOP_SPEC {
type Ux = u32;
}
#[doc = "`write(|w| ..)` method takes [tasks_stop::W](W) writer structure"]
impl crate::Writable for TASKS_STOP_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets TASKS_STOP to value 0"]
impl crate::Resettable for TASKS_STOP_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}