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:
17624 files changed
+4564928
-38
No files matched your search
+128
@@ -0,0 +1,128 @@
|
||||
#[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 COMP"]
|
||||
pub type ENABLE_R = crate::FieldReader<u8, ENABLE_A>;
|
||||
#[doc = "Enable or disable COMP\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[repr(u8)]
|
||||
pub enum ENABLE_A {
|
||||
#[doc = "0: Disable"]
|
||||
DISABLED = 0,
|
||||
#[doc = "2: Enable"]
|
||||
ENABLED = 2,
|
||||
}
|
||||
impl From<ENABLE_A> for u8 {
|
||||
#[inline(always)]
|
||||
fn from(variant: ENABLE_A) -> Self {
|
||||
variant as _
|
||||
}
|
||||
}
|
||||
impl ENABLE_R {
|
||||
#[doc = "Get enumerated values variant"]
|
||||
#[inline(always)]
|
||||
pub fn variant(&self) -> Option<ENABLE_A> {
|
||||
match self.bits {
|
||||
0 => Some(ENABLE_A::DISABLED),
|
||||
2 => Some(ENABLE_A::ENABLED),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `DISABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_disabled(&self) -> bool {
|
||||
*self == ENABLE_A::DISABLED
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ENABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_enabled(&self) -> bool {
|
||||
*self == ENABLE_A::ENABLED
|
||||
}
|
||||
}
|
||||
#[doc = "Field `ENABLE` writer - Enable or disable COMP"]
|
||||
pub type ENABLE_W<'a, const O: u8> = crate::FieldWriter<'a, u32, ENABLE_SPEC, u8, ENABLE_A, 2, O>;
|
||||
impl<'a, const O: u8> ENABLE_W<'a, O> {
|
||||
#[doc = "Disable"]
|
||||
#[inline(always)]
|
||||
pub fn disabled(self) -> &'a mut W {
|
||||
self.variant(ENABLE_A::DISABLED)
|
||||
}
|
||||
#[doc = "Enable"]
|
||||
#[inline(always)]
|
||||
pub fn enabled(self) -> &'a mut W {
|
||||
self.variant(ENABLE_A::ENABLED)
|
||||
}
|
||||
}
|
||||
impl R {
|
||||
#[doc = "Bits 0:1 - Enable or disable COMP"]
|
||||
#[inline(always)]
|
||||
pub fn enable(&self) -> ENABLE_R {
|
||||
ENABLE_R::new((self.bits & 3) as u8)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bits 0:1 - Enable or disable COMP"]
|
||||
#[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 = "COMP enable\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [enable](index.html) module"]
|
||||
pub struct ENABLE_SPEC;
|
||||
impl crate::RegisterSpec for ENABLE_SPEC {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [enable::R](R) reader structure"]
|
||||
impl crate::Readable for ENABLE_SPEC {
|
||||
type Reader = R;
|
||||
}
|
||||
#[doc = "`write(|w| ..)` method takes [enable::W](W) writer structure"]
|
||||
impl crate::Writable for ENABLE_SPEC {
|
||||
type Writer = W;
|
||||
}
|
||||
#[doc = "`reset()` method sets ENABLE to value 0"]
|
||||
impl crate::Resettable for ENABLE_SPEC {
|
||||
#[inline(always)]
|
||||
fn reset_value() -> Self::Ux {
|
||||
0
|
||||
}
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
#[doc = "Register `EVENTS_CROSS` reader"]
|
||||
pub struct R(crate::R<EVENTS_CROSS_SPEC>);
|
||||
impl core::ops::Deref for R {
|
||||
type Target = crate::R<EVENTS_CROSS_SPEC>;
|
||||
#[inline(always)]
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
impl From<crate::R<EVENTS_CROSS_SPEC>> for R {
|
||||
#[inline(always)]
|
||||
fn from(reader: crate::R<EVENTS_CROSS_SPEC>) -> Self {
|
||||
R(reader)
|
||||
}
|
||||
}
|
||||
#[doc = "Register `EVENTS_CROSS` writer"]
|
||||
pub struct W(crate::W<EVENTS_CROSS_SPEC>);
|
||||
impl core::ops::Deref for W {
|
||||
type Target = crate::W<EVENTS_CROSS_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_CROSS_SPEC>> for W {
|
||||
#[inline(always)]
|
||||
fn from(writer: crate::W<EVENTS_CROSS_SPEC>) -> Self {
|
||||
W(writer)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `EVENTS_CROSS` reader - "]
|
||||
pub type EVENTS_CROSS_R = crate::BitReader<bool>;
|
||||
#[doc = "Field `EVENTS_CROSS` writer - "]
|
||||
pub type EVENTS_CROSS_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVENTS_CROSS_SPEC, bool, O>;
|
||||
impl R {
|
||||
#[doc = "Bit 0"]
|
||||
#[inline(always)]
|
||||
pub fn events_cross(&self) -> EVENTS_CROSS_R {
|
||||
EVENTS_CROSS_R::new((self.bits & 1) != 0)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bit 0"]
|
||||
#[inline(always)]
|
||||
pub fn events_cross(&mut self) -> EVENTS_CROSS_W<0> {
|
||||
EVENTS_CROSS_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 = "Downward or upward crossing\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_cross](index.html) module"]
|
||||
pub struct EVENTS_CROSS_SPEC;
|
||||
impl crate::RegisterSpec for EVENTS_CROSS_SPEC {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [events_cross::R](R) reader structure"]
|
||||
impl crate::Readable for EVENTS_CROSS_SPEC {
|
||||
type Reader = R;
|
||||
}
|
||||
#[doc = "`write(|w| ..)` method takes [events_cross::W](W) writer structure"]
|
||||
impl crate::Writable for EVENTS_CROSS_SPEC {
|
||||
type Writer = W;
|
||||
}
|
||||
#[doc = "`reset()` method sets EVENTS_CROSS to value 0"]
|
||||
impl crate::Resettable for EVENTS_CROSS_SPEC {
|
||||
#[inline(always)]
|
||||
fn reset_value() -> Self::Ux {
|
||||
0
|
||||
}
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
#[doc = "Register `EVENTS_DOWN` reader"]
|
||||
pub struct R(crate::R<EVENTS_DOWN_SPEC>);
|
||||
impl core::ops::Deref for R {
|
||||
type Target = crate::R<EVENTS_DOWN_SPEC>;
|
||||
#[inline(always)]
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
impl From<crate::R<EVENTS_DOWN_SPEC>> for R {
|
||||
#[inline(always)]
|
||||
fn from(reader: crate::R<EVENTS_DOWN_SPEC>) -> Self {
|
||||
R(reader)
|
||||
}
|
||||
}
|
||||
#[doc = "Register `EVENTS_DOWN` writer"]
|
||||
pub struct W(crate::W<EVENTS_DOWN_SPEC>);
|
||||
impl core::ops::Deref for W {
|
||||
type Target = crate::W<EVENTS_DOWN_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_DOWN_SPEC>> for W {
|
||||
#[inline(always)]
|
||||
fn from(writer: crate::W<EVENTS_DOWN_SPEC>) -> Self {
|
||||
W(writer)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `EVENTS_DOWN` reader - "]
|
||||
pub type EVENTS_DOWN_R = crate::BitReader<bool>;
|
||||
#[doc = "Field `EVENTS_DOWN` writer - "]
|
||||
pub type EVENTS_DOWN_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVENTS_DOWN_SPEC, bool, O>;
|
||||
impl R {
|
||||
#[doc = "Bit 0"]
|
||||
#[inline(always)]
|
||||
pub fn events_down(&self) -> EVENTS_DOWN_R {
|
||||
EVENTS_DOWN_R::new((self.bits & 1) != 0)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bit 0"]
|
||||
#[inline(always)]
|
||||
pub fn events_down(&mut self) -> EVENTS_DOWN_W<0> {
|
||||
EVENTS_DOWN_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 = "Downward crossing\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_down](index.html) module"]
|
||||
pub struct EVENTS_DOWN_SPEC;
|
||||
impl crate::RegisterSpec for EVENTS_DOWN_SPEC {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [events_down::R](R) reader structure"]
|
||||
impl crate::Readable for EVENTS_DOWN_SPEC {
|
||||
type Reader = R;
|
||||
}
|
||||
#[doc = "`write(|w| ..)` method takes [events_down::W](W) writer structure"]
|
||||
impl crate::Writable for EVENTS_DOWN_SPEC {
|
||||
type Writer = W;
|
||||
}
|
||||
#[doc = "`reset()` method sets EVENTS_DOWN to value 0"]
|
||||
impl crate::Resettable for EVENTS_DOWN_SPEC {
|
||||
#[inline(always)]
|
||||
fn reset_value() -> Self::Ux {
|
||||
0
|
||||
}
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
#[doc = "Register `EVENTS_READY` reader"]
|
||||
pub struct R(crate::R<EVENTS_READY_SPEC>);
|
||||
impl core::ops::Deref for R {
|
||||
type Target = crate::R<EVENTS_READY_SPEC>;
|
||||
#[inline(always)]
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
impl From<crate::R<EVENTS_READY_SPEC>> for R {
|
||||
#[inline(always)]
|
||||
fn from(reader: crate::R<EVENTS_READY_SPEC>) -> Self {
|
||||
R(reader)
|
||||
}
|
||||
}
|
||||
#[doc = "Register `EVENTS_READY` writer"]
|
||||
pub struct W(crate::W<EVENTS_READY_SPEC>);
|
||||
impl core::ops::Deref for W {
|
||||
type Target = crate::W<EVENTS_READY_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_READY_SPEC>> for W {
|
||||
#[inline(always)]
|
||||
fn from(writer: crate::W<EVENTS_READY_SPEC>) -> Self {
|
||||
W(writer)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `EVENTS_READY` reader - "]
|
||||
pub type EVENTS_READY_R = crate::BitReader<bool>;
|
||||
#[doc = "Field `EVENTS_READY` writer - "]
|
||||
pub type EVENTS_READY_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVENTS_READY_SPEC, bool, O>;
|
||||
impl R {
|
||||
#[doc = "Bit 0"]
|
||||
#[inline(always)]
|
||||
pub fn events_ready(&self) -> EVENTS_READY_R {
|
||||
EVENTS_READY_R::new((self.bits & 1) != 0)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bit 0"]
|
||||
#[inline(always)]
|
||||
pub fn events_ready(&mut self) -> EVENTS_READY_W<0> {
|
||||
EVENTS_READY_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 = "COMP is ready and output is valid\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_ready](index.html) module"]
|
||||
pub struct EVENTS_READY_SPEC;
|
||||
impl crate::RegisterSpec for EVENTS_READY_SPEC {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [events_ready::R](R) reader structure"]
|
||||
impl crate::Readable for EVENTS_READY_SPEC {
|
||||
type Reader = R;
|
||||
}
|
||||
#[doc = "`write(|w| ..)` method takes [events_ready::W](W) writer structure"]
|
||||
impl crate::Writable for EVENTS_READY_SPEC {
|
||||
type Writer = W;
|
||||
}
|
||||
#[doc = "`reset()` method sets EVENTS_READY to value 0"]
|
||||
impl crate::Resettable for EVENTS_READY_SPEC {
|
||||
#[inline(always)]
|
||||
fn reset_value() -> Self::Ux {
|
||||
0
|
||||
}
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
#[doc = "Register `EVENTS_UP` reader"]
|
||||
pub struct R(crate::R<EVENTS_UP_SPEC>);
|
||||
impl core::ops::Deref for R {
|
||||
type Target = crate::R<EVENTS_UP_SPEC>;
|
||||
#[inline(always)]
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
impl From<crate::R<EVENTS_UP_SPEC>> for R {
|
||||
#[inline(always)]
|
||||
fn from(reader: crate::R<EVENTS_UP_SPEC>) -> Self {
|
||||
R(reader)
|
||||
}
|
||||
}
|
||||
#[doc = "Register `EVENTS_UP` writer"]
|
||||
pub struct W(crate::W<EVENTS_UP_SPEC>);
|
||||
impl core::ops::Deref for W {
|
||||
type Target = crate::W<EVENTS_UP_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_UP_SPEC>> for W {
|
||||
#[inline(always)]
|
||||
fn from(writer: crate::W<EVENTS_UP_SPEC>) -> Self {
|
||||
W(writer)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `EVENTS_UP` reader - "]
|
||||
pub type EVENTS_UP_R = crate::BitReader<bool>;
|
||||
#[doc = "Field `EVENTS_UP` writer - "]
|
||||
pub type EVENTS_UP_W<'a, const O: u8> = crate::BitWriter<'a, u32, EVENTS_UP_SPEC, bool, O>;
|
||||
impl R {
|
||||
#[doc = "Bit 0"]
|
||||
#[inline(always)]
|
||||
pub fn events_up(&self) -> EVENTS_UP_R {
|
||||
EVENTS_UP_R::new((self.bits & 1) != 0)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bit 0"]
|
||||
#[inline(always)]
|
||||
pub fn events_up(&mut self) -> EVENTS_UP_W<0> {
|
||||
EVENTS_UP_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 = "Upward crossing\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [events_up](index.html) module"]
|
||||
pub struct EVENTS_UP_SPEC;
|
||||
impl crate::RegisterSpec for EVENTS_UP_SPEC {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [events_up::R](R) reader structure"]
|
||||
impl crate::Readable for EVENTS_UP_SPEC {
|
||||
type Reader = R;
|
||||
}
|
||||
#[doc = "`write(|w| ..)` method takes [events_up::W](W) writer structure"]
|
||||
impl crate::Writable for EVENTS_UP_SPEC {
|
||||
type Writer = W;
|
||||
}
|
||||
#[doc = "`reset()` method sets EVENTS_UP to value 0"]
|
||||
impl crate::Resettable for EVENTS_UP_SPEC {
|
||||
#[inline(always)]
|
||||
fn reset_value() -> Self::Ux {
|
||||
0
|
||||
}
|
||||
}
|
||||
+207
@@ -0,0 +1,207 @@
|
||||
#[doc = "Register `EXTREFSEL` reader"]
|
||||
pub struct R(crate::R<EXTREFSEL_SPEC>);
|
||||
impl core::ops::Deref for R {
|
||||
type Target = crate::R<EXTREFSEL_SPEC>;
|
||||
#[inline(always)]
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
impl From<crate::R<EXTREFSEL_SPEC>> for R {
|
||||
#[inline(always)]
|
||||
fn from(reader: crate::R<EXTREFSEL_SPEC>) -> Self {
|
||||
R(reader)
|
||||
}
|
||||
}
|
||||
#[doc = "Register `EXTREFSEL` writer"]
|
||||
pub struct W(crate::W<EXTREFSEL_SPEC>);
|
||||
impl core::ops::Deref for W {
|
||||
type Target = crate::W<EXTREFSEL_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<EXTREFSEL_SPEC>> for W {
|
||||
#[inline(always)]
|
||||
fn from(writer: crate::W<EXTREFSEL_SPEC>) -> Self {
|
||||
W(writer)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `EXTREFSEL` reader - External analog reference select"]
|
||||
pub type EXTREFSEL_R = crate::FieldReader<u8, EXTREFSEL_A>;
|
||||
#[doc = "External analog reference select\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[repr(u8)]
|
||||
pub enum EXTREFSEL_A {
|
||||
#[doc = "0: Use AIN0 as external analog reference"]
|
||||
ANALOG_REFERENCE0 = 0,
|
||||
#[doc = "1: Use AIN1 as external analog reference"]
|
||||
ANALOG_REFERENCE1 = 1,
|
||||
#[doc = "2: Use AIN2 as external analog reference"]
|
||||
ANALOG_REFERENCE2 = 2,
|
||||
#[doc = "3: Use AIN3 as external analog reference"]
|
||||
ANALOG_REFERENCE3 = 3,
|
||||
#[doc = "4: Use AIN4 as external analog reference"]
|
||||
ANALOG_REFERENCE4 = 4,
|
||||
#[doc = "5: Use AIN5 as external analog reference"]
|
||||
ANALOG_REFERENCE5 = 5,
|
||||
#[doc = "6: Use AIN6 as external analog reference"]
|
||||
ANALOG_REFERENCE6 = 6,
|
||||
#[doc = "7: Use AIN7 as external analog reference"]
|
||||
ANALOG_REFERENCE7 = 7,
|
||||
}
|
||||
impl From<EXTREFSEL_A> for u8 {
|
||||
#[inline(always)]
|
||||
fn from(variant: EXTREFSEL_A) -> Self {
|
||||
variant as _
|
||||
}
|
||||
}
|
||||
impl EXTREFSEL_R {
|
||||
#[doc = "Get enumerated values variant"]
|
||||
#[inline(always)]
|
||||
pub fn variant(&self) -> EXTREFSEL_A {
|
||||
match self.bits {
|
||||
0 => EXTREFSEL_A::ANALOG_REFERENCE0,
|
||||
1 => EXTREFSEL_A::ANALOG_REFERENCE1,
|
||||
2 => EXTREFSEL_A::ANALOG_REFERENCE2,
|
||||
3 => EXTREFSEL_A::ANALOG_REFERENCE3,
|
||||
4 => EXTREFSEL_A::ANALOG_REFERENCE4,
|
||||
5 => EXTREFSEL_A::ANALOG_REFERENCE5,
|
||||
6 => EXTREFSEL_A::ANALOG_REFERENCE6,
|
||||
7 => EXTREFSEL_A::ANALOG_REFERENCE7,
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ANALOG_REFERENCE0`"]
|
||||
#[inline(always)]
|
||||
pub fn is_analog_reference0(&self) -> bool {
|
||||
*self == EXTREFSEL_A::ANALOG_REFERENCE0
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ANALOG_REFERENCE1`"]
|
||||
#[inline(always)]
|
||||
pub fn is_analog_reference1(&self) -> bool {
|
||||
*self == EXTREFSEL_A::ANALOG_REFERENCE1
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ANALOG_REFERENCE2`"]
|
||||
#[inline(always)]
|
||||
pub fn is_analog_reference2(&self) -> bool {
|
||||
*self == EXTREFSEL_A::ANALOG_REFERENCE2
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ANALOG_REFERENCE3`"]
|
||||
#[inline(always)]
|
||||
pub fn is_analog_reference3(&self) -> bool {
|
||||
*self == EXTREFSEL_A::ANALOG_REFERENCE3
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ANALOG_REFERENCE4`"]
|
||||
#[inline(always)]
|
||||
pub fn is_analog_reference4(&self) -> bool {
|
||||
*self == EXTREFSEL_A::ANALOG_REFERENCE4
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ANALOG_REFERENCE5`"]
|
||||
#[inline(always)]
|
||||
pub fn is_analog_reference5(&self) -> bool {
|
||||
*self == EXTREFSEL_A::ANALOG_REFERENCE5
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ANALOG_REFERENCE6`"]
|
||||
#[inline(always)]
|
||||
pub fn is_analog_reference6(&self) -> bool {
|
||||
*self == EXTREFSEL_A::ANALOG_REFERENCE6
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ANALOG_REFERENCE7`"]
|
||||
#[inline(always)]
|
||||
pub fn is_analog_reference7(&self) -> bool {
|
||||
*self == EXTREFSEL_A::ANALOG_REFERENCE7
|
||||
}
|
||||
}
|
||||
#[doc = "Field `EXTREFSEL` writer - External analog reference select"]
|
||||
pub type EXTREFSEL_W<'a, const O: u8> =
|
||||
crate::FieldWriterSafe<'a, u32, EXTREFSEL_SPEC, u8, EXTREFSEL_A, 3, O>;
|
||||
impl<'a, const O: u8> EXTREFSEL_W<'a, O> {
|
||||
#[doc = "Use AIN0 as external analog reference"]
|
||||
#[inline(always)]
|
||||
pub fn analog_reference0(self) -> &'a mut W {
|
||||
self.variant(EXTREFSEL_A::ANALOG_REFERENCE0)
|
||||
}
|
||||
#[doc = "Use AIN1 as external analog reference"]
|
||||
#[inline(always)]
|
||||
pub fn analog_reference1(self) -> &'a mut W {
|
||||
self.variant(EXTREFSEL_A::ANALOG_REFERENCE1)
|
||||
}
|
||||
#[doc = "Use AIN2 as external analog reference"]
|
||||
#[inline(always)]
|
||||
pub fn analog_reference2(self) -> &'a mut W {
|
||||
self.variant(EXTREFSEL_A::ANALOG_REFERENCE2)
|
||||
}
|
||||
#[doc = "Use AIN3 as external analog reference"]
|
||||
#[inline(always)]
|
||||
pub fn analog_reference3(self) -> &'a mut W {
|
||||
self.variant(EXTREFSEL_A::ANALOG_REFERENCE3)
|
||||
}
|
||||
#[doc = "Use AIN4 as external analog reference"]
|
||||
#[inline(always)]
|
||||
pub fn analog_reference4(self) -> &'a mut W {
|
||||
self.variant(EXTREFSEL_A::ANALOG_REFERENCE4)
|
||||
}
|
||||
#[doc = "Use AIN5 as external analog reference"]
|
||||
#[inline(always)]
|
||||
pub fn analog_reference5(self) -> &'a mut W {
|
||||
self.variant(EXTREFSEL_A::ANALOG_REFERENCE5)
|
||||
}
|
||||
#[doc = "Use AIN6 as external analog reference"]
|
||||
#[inline(always)]
|
||||
pub fn analog_reference6(self) -> &'a mut W {
|
||||
self.variant(EXTREFSEL_A::ANALOG_REFERENCE6)
|
||||
}
|
||||
#[doc = "Use AIN7 as external analog reference"]
|
||||
#[inline(always)]
|
||||
pub fn analog_reference7(self) -> &'a mut W {
|
||||
self.variant(EXTREFSEL_A::ANALOG_REFERENCE7)
|
||||
}
|
||||
}
|
||||
impl R {
|
||||
#[doc = "Bits 0:2 - External analog reference select"]
|
||||
#[inline(always)]
|
||||
pub fn extrefsel(&self) -> EXTREFSEL_R {
|
||||
EXTREFSEL_R::new((self.bits & 7) as u8)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bits 0:2 - External analog reference select"]
|
||||
#[inline(always)]
|
||||
pub fn extrefsel(&mut self) -> EXTREFSEL_W<0> {
|
||||
EXTREFSEL_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 = "External reference select\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [extrefsel](index.html) module"]
|
||||
pub struct EXTREFSEL_SPEC;
|
||||
impl crate::RegisterSpec for EXTREFSEL_SPEC {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [extrefsel::R](R) reader structure"]
|
||||
impl crate::Readable for EXTREFSEL_SPEC {
|
||||
type Reader = R;
|
||||
}
|
||||
#[doc = "`write(|w| ..)` method takes [extrefsel::W](W) writer structure"]
|
||||
impl crate::Writable for EXTREFSEL_SPEC {
|
||||
type Writer = W;
|
||||
}
|
||||
#[doc = "`reset()` method sets EXTREFSEL to value 0"]
|
||||
impl crate::Resettable for EXTREFSEL_SPEC {
|
||||
#[inline(always)]
|
||||
fn reset_value() -> Self::Ux {
|
||||
0
|
||||
}
|
||||
}
|
||||
Vendored
+126
@@ -0,0 +1,126 @@
|
||||
#[doc = "Register `HYST` reader"]
|
||||
pub struct R(crate::R<HYST_SPEC>);
|
||||
impl core::ops::Deref for R {
|
||||
type Target = crate::R<HYST_SPEC>;
|
||||
#[inline(always)]
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
impl From<crate::R<HYST_SPEC>> for R {
|
||||
#[inline(always)]
|
||||
fn from(reader: crate::R<HYST_SPEC>) -> Self {
|
||||
R(reader)
|
||||
}
|
||||
}
|
||||
#[doc = "Register `HYST` writer"]
|
||||
pub struct W(crate::W<HYST_SPEC>);
|
||||
impl core::ops::Deref for W {
|
||||
type Target = crate::W<HYST_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<HYST_SPEC>> for W {
|
||||
#[inline(always)]
|
||||
fn from(writer: crate::W<HYST_SPEC>) -> Self {
|
||||
W(writer)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `HYST` reader - Comparator hysteresis"]
|
||||
pub type HYST_R = crate::BitReader<HYST_A>;
|
||||
#[doc = "Comparator hysteresis\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum HYST_A {
|
||||
#[doc = "0: Comparator hysteresis disabled"]
|
||||
NO_HYST = 0,
|
||||
#[doc = "1: Comparator hysteresis enabled"]
|
||||
HYST50M_V = 1,
|
||||
}
|
||||
impl From<HYST_A> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: HYST_A) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
impl HYST_R {
|
||||
#[doc = "Get enumerated values variant"]
|
||||
#[inline(always)]
|
||||
pub fn variant(&self) -> HYST_A {
|
||||
match self.bits {
|
||||
false => HYST_A::NO_HYST,
|
||||
true => HYST_A::HYST50M_V,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `NO_HYST`"]
|
||||
#[inline(always)]
|
||||
pub fn is_no_hyst(&self) -> bool {
|
||||
*self == HYST_A::NO_HYST
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `HYST50M_V`"]
|
||||
#[inline(always)]
|
||||
pub fn is_hyst50m_v(&self) -> bool {
|
||||
*self == HYST_A::HYST50M_V
|
||||
}
|
||||
}
|
||||
#[doc = "Field `HYST` writer - Comparator hysteresis"]
|
||||
pub type HYST_W<'a, const O: u8> = crate::BitWriter<'a, u32, HYST_SPEC, HYST_A, O>;
|
||||
impl<'a, const O: u8> HYST_W<'a, O> {
|
||||
#[doc = "Comparator hysteresis disabled"]
|
||||
#[inline(always)]
|
||||
pub fn no_hyst(self) -> &'a mut W {
|
||||
self.variant(HYST_A::NO_HYST)
|
||||
}
|
||||
#[doc = "Comparator hysteresis enabled"]
|
||||
#[inline(always)]
|
||||
pub fn hyst50m_v(self) -> &'a mut W {
|
||||
self.variant(HYST_A::HYST50M_V)
|
||||
}
|
||||
}
|
||||
impl R {
|
||||
#[doc = "Bit 0 - Comparator hysteresis"]
|
||||
#[inline(always)]
|
||||
pub fn hyst(&self) -> HYST_R {
|
||||
HYST_R::new((self.bits & 1) != 0)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bit 0 - Comparator hysteresis"]
|
||||
#[inline(always)]
|
||||
pub fn hyst(&mut self) -> HYST_W<0> {
|
||||
HYST_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 = "Comparator hysteresis enable\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [hyst](index.html) module"]
|
||||
pub struct HYST_SPEC;
|
||||
impl crate::RegisterSpec for HYST_SPEC {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [hyst::R](R) reader structure"]
|
||||
impl crate::Readable for HYST_SPEC {
|
||||
type Reader = R;
|
||||
}
|
||||
#[doc = "`write(|w| ..)` method takes [hyst::W](W) writer structure"]
|
||||
impl crate::Writable for HYST_SPEC {
|
||||
type Writer = W;
|
||||
}
|
||||
#[doc = "`reset()` method sets HYST to value 0"]
|
||||
impl crate::Resettable for HYST_SPEC {
|
||||
#[inline(always)]
|
||||
fn reset_value() -> Self::Ux {
|
||||
0
|
||||
}
|
||||
}
|
||||
+306
@@ -0,0 +1,306 @@
|
||||
#[doc = "Register `INTEN` reader"]
|
||||
pub struct R(crate::R<INTEN_SPEC>);
|
||||
impl core::ops::Deref for R {
|
||||
type Target = crate::R<INTEN_SPEC>;
|
||||
#[inline(always)]
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
impl From<crate::R<INTEN_SPEC>> for R {
|
||||
#[inline(always)]
|
||||
fn from(reader: crate::R<INTEN_SPEC>) -> Self {
|
||||
R(reader)
|
||||
}
|
||||
}
|
||||
#[doc = "Register `INTEN` writer"]
|
||||
pub struct W(crate::W<INTEN_SPEC>);
|
||||
impl core::ops::Deref for W {
|
||||
type Target = crate::W<INTEN_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<INTEN_SPEC>> for W {
|
||||
#[inline(always)]
|
||||
fn from(writer: crate::W<INTEN_SPEC>) -> Self {
|
||||
W(writer)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `READY` reader - Enable or disable interrupt for READY event"]
|
||||
pub type READY_R = crate::BitReader<READY_A>;
|
||||
#[doc = "Enable or disable interrupt for READY event\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum READY_A {
|
||||
#[doc = "0: Disable"]
|
||||
DISABLED = 0,
|
||||
#[doc = "1: Enable"]
|
||||
ENABLED = 1,
|
||||
}
|
||||
impl From<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::DISABLED,
|
||||
true => READY_A::ENABLED,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `DISABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_disabled(&self) -> bool {
|
||||
*self == READY_A::DISABLED
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ENABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_enabled(&self) -> bool {
|
||||
*self == READY_A::ENABLED
|
||||
}
|
||||
}
|
||||
#[doc = "Field `READY` writer - Enable or disable interrupt for READY event"]
|
||||
pub type READY_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTEN_SPEC, READY_A, O>;
|
||||
impl<'a, const O: u8> READY_W<'a, O> {
|
||||
#[doc = "Disable"]
|
||||
#[inline(always)]
|
||||
pub fn disabled(self) -> &'a mut W {
|
||||
self.variant(READY_A::DISABLED)
|
||||
}
|
||||
#[doc = "Enable"]
|
||||
#[inline(always)]
|
||||
pub fn enabled(self) -> &'a mut W {
|
||||
self.variant(READY_A::ENABLED)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `DOWN` reader - Enable or disable interrupt for DOWN event"]
|
||||
pub type DOWN_R = crate::BitReader<DOWN_A>;
|
||||
#[doc = "Enable or disable interrupt for DOWN event\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum DOWN_A {
|
||||
#[doc = "0: Disable"]
|
||||
DISABLED = 0,
|
||||
#[doc = "1: Enable"]
|
||||
ENABLED = 1,
|
||||
}
|
||||
impl From<DOWN_A> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: DOWN_A) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
impl DOWN_R {
|
||||
#[doc = "Get enumerated values variant"]
|
||||
#[inline(always)]
|
||||
pub fn variant(&self) -> DOWN_A {
|
||||
match self.bits {
|
||||
false => DOWN_A::DISABLED,
|
||||
true => DOWN_A::ENABLED,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `DISABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_disabled(&self) -> bool {
|
||||
*self == DOWN_A::DISABLED
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ENABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_enabled(&self) -> bool {
|
||||
*self == DOWN_A::ENABLED
|
||||
}
|
||||
}
|
||||
#[doc = "Field `DOWN` writer - Enable or disable interrupt for DOWN event"]
|
||||
pub type DOWN_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTEN_SPEC, DOWN_A, O>;
|
||||
impl<'a, const O: u8> DOWN_W<'a, O> {
|
||||
#[doc = "Disable"]
|
||||
#[inline(always)]
|
||||
pub fn disabled(self) -> &'a mut W {
|
||||
self.variant(DOWN_A::DISABLED)
|
||||
}
|
||||
#[doc = "Enable"]
|
||||
#[inline(always)]
|
||||
pub fn enabled(self) -> &'a mut W {
|
||||
self.variant(DOWN_A::ENABLED)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `UP` reader - Enable or disable interrupt for UP event"]
|
||||
pub type UP_R = crate::BitReader<UP_A>;
|
||||
#[doc = "Enable or disable interrupt for UP event\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum UP_A {
|
||||
#[doc = "0: Disable"]
|
||||
DISABLED = 0,
|
||||
#[doc = "1: Enable"]
|
||||
ENABLED = 1,
|
||||
}
|
||||
impl From<UP_A> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: UP_A) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
impl UP_R {
|
||||
#[doc = "Get enumerated values variant"]
|
||||
#[inline(always)]
|
||||
pub fn variant(&self) -> UP_A {
|
||||
match self.bits {
|
||||
false => UP_A::DISABLED,
|
||||
true => UP_A::ENABLED,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `DISABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_disabled(&self) -> bool {
|
||||
*self == UP_A::DISABLED
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ENABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_enabled(&self) -> bool {
|
||||
*self == UP_A::ENABLED
|
||||
}
|
||||
}
|
||||
#[doc = "Field `UP` writer - Enable or disable interrupt for UP event"]
|
||||
pub type UP_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTEN_SPEC, UP_A, O>;
|
||||
impl<'a, const O: u8> UP_W<'a, O> {
|
||||
#[doc = "Disable"]
|
||||
#[inline(always)]
|
||||
pub fn disabled(self) -> &'a mut W {
|
||||
self.variant(UP_A::DISABLED)
|
||||
}
|
||||
#[doc = "Enable"]
|
||||
#[inline(always)]
|
||||
pub fn enabled(self) -> &'a mut W {
|
||||
self.variant(UP_A::ENABLED)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `CROSS` reader - Enable or disable interrupt for CROSS event"]
|
||||
pub type CROSS_R = crate::BitReader<CROSS_A>;
|
||||
#[doc = "Enable or disable interrupt for CROSS event\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum CROSS_A {
|
||||
#[doc = "0: Disable"]
|
||||
DISABLED = 0,
|
||||
#[doc = "1: Enable"]
|
||||
ENABLED = 1,
|
||||
}
|
||||
impl From<CROSS_A> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: CROSS_A) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
impl CROSS_R {
|
||||
#[doc = "Get enumerated values variant"]
|
||||
#[inline(always)]
|
||||
pub fn variant(&self) -> CROSS_A {
|
||||
match self.bits {
|
||||
false => CROSS_A::DISABLED,
|
||||
true => CROSS_A::ENABLED,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `DISABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_disabled(&self) -> bool {
|
||||
*self == CROSS_A::DISABLED
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ENABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_enabled(&self) -> bool {
|
||||
*self == CROSS_A::ENABLED
|
||||
}
|
||||
}
|
||||
#[doc = "Field `CROSS` writer - Enable or disable interrupt for CROSS event"]
|
||||
pub type CROSS_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTEN_SPEC, CROSS_A, O>;
|
||||
impl<'a, const O: u8> CROSS_W<'a, O> {
|
||||
#[doc = "Disable"]
|
||||
#[inline(always)]
|
||||
pub fn disabled(self) -> &'a mut W {
|
||||
self.variant(CROSS_A::DISABLED)
|
||||
}
|
||||
#[doc = "Enable"]
|
||||
#[inline(always)]
|
||||
pub fn enabled(self) -> &'a mut W {
|
||||
self.variant(CROSS_A::ENABLED)
|
||||
}
|
||||
}
|
||||
impl R {
|
||||
#[doc = "Bit 0 - Enable or disable interrupt for READY event"]
|
||||
#[inline(always)]
|
||||
pub fn ready(&self) -> READY_R {
|
||||
READY_R::new((self.bits & 1) != 0)
|
||||
}
|
||||
#[doc = "Bit 1 - Enable or disable interrupt for DOWN event"]
|
||||
#[inline(always)]
|
||||
pub fn down(&self) -> DOWN_R {
|
||||
DOWN_R::new(((self.bits >> 1) & 1) != 0)
|
||||
}
|
||||
#[doc = "Bit 2 - Enable or disable interrupt for UP event"]
|
||||
#[inline(always)]
|
||||
pub fn up(&self) -> UP_R {
|
||||
UP_R::new(((self.bits >> 2) & 1) != 0)
|
||||
}
|
||||
#[doc = "Bit 3 - Enable or disable interrupt for CROSS event"]
|
||||
#[inline(always)]
|
||||
pub fn cross(&self) -> CROSS_R {
|
||||
CROSS_R::new(((self.bits >> 3) & 1) != 0)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bit 0 - Enable or disable interrupt for READY event"]
|
||||
#[inline(always)]
|
||||
pub fn ready(&mut self) -> READY_W<0> {
|
||||
READY_W::new(self)
|
||||
}
|
||||
#[doc = "Bit 1 - Enable or disable interrupt for DOWN event"]
|
||||
#[inline(always)]
|
||||
pub fn down(&mut self) -> DOWN_W<1> {
|
||||
DOWN_W::new(self)
|
||||
}
|
||||
#[doc = "Bit 2 - Enable or disable interrupt for UP event"]
|
||||
#[inline(always)]
|
||||
pub fn up(&mut self) -> UP_W<2> {
|
||||
UP_W::new(self)
|
||||
}
|
||||
#[doc = "Bit 3 - Enable or disable interrupt for CROSS event"]
|
||||
#[inline(always)]
|
||||
pub fn cross(&mut self) -> CROSS_W<3> {
|
||||
CROSS_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 or disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [inten](index.html) module"]
|
||||
pub struct INTEN_SPEC;
|
||||
impl crate::RegisterSpec for INTEN_SPEC {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [inten::R](R) reader structure"]
|
||||
impl crate::Readable for INTEN_SPEC {
|
||||
type Reader = R;
|
||||
}
|
||||
#[doc = "`write(|w| ..)` method takes [inten::W](W) writer structure"]
|
||||
impl crate::Writable for INTEN_SPEC {
|
||||
type Writer = W;
|
||||
}
|
||||
#[doc = "`reset()` method sets INTEN to value 0"]
|
||||
impl crate::Resettable for INTEN_SPEC {
|
||||
#[inline(always)]
|
||||
fn reset_value() -> Self::Ux {
|
||||
0
|
||||
}
|
||||
}
|
||||
+334
@@ -0,0 +1,334 @@
|
||||
#[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 `READY` reader - Write '1' to disable interrupt for READY event"]
|
||||
pub type READY_R = crate::BitReader<READY_A>;
|
||||
#[doc = "Write '1' to disable interrupt for READY event\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum READY_A {
|
||||
#[doc = "0: Read: Disabled"]
|
||||
DISABLED = 0,
|
||||
#[doc = "1: Read: Enabled"]
|
||||
ENABLED = 1,
|
||||
}
|
||||
impl From<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::DISABLED,
|
||||
true => READY_A::ENABLED,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `DISABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_disabled(&self) -> bool {
|
||||
*self == READY_A::DISABLED
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ENABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_enabled(&self) -> bool {
|
||||
*self == READY_A::ENABLED
|
||||
}
|
||||
}
|
||||
#[doc = "Write '1' to disable interrupt for READY event\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum READY_AW {
|
||||
#[doc = "1: Disable"]
|
||||
CLEAR = 1,
|
||||
}
|
||||
impl From<READY_AW> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: READY_AW) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
#[doc = "Field `READY` writer - Write '1' to disable interrupt for READY event"]
|
||||
pub type READY_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENCLR_SPEC, READY_AW, O>;
|
||||
impl<'a, const O: u8> READY_W<'a, O> {
|
||||
#[doc = "Disable"]
|
||||
#[inline(always)]
|
||||
pub fn clear(self) -> &'a mut W {
|
||||
self.variant(READY_AW::CLEAR)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `DOWN` reader - Write '1' to disable interrupt for DOWN event"]
|
||||
pub type DOWN_R = crate::BitReader<DOWN_A>;
|
||||
#[doc = "Write '1' to disable interrupt for DOWN event\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum DOWN_A {
|
||||
#[doc = "0: Read: Disabled"]
|
||||
DISABLED = 0,
|
||||
#[doc = "1: Read: Enabled"]
|
||||
ENABLED = 1,
|
||||
}
|
||||
impl From<DOWN_A> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: DOWN_A) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
impl DOWN_R {
|
||||
#[doc = "Get enumerated values variant"]
|
||||
#[inline(always)]
|
||||
pub fn variant(&self) -> DOWN_A {
|
||||
match self.bits {
|
||||
false => DOWN_A::DISABLED,
|
||||
true => DOWN_A::ENABLED,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `DISABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_disabled(&self) -> bool {
|
||||
*self == DOWN_A::DISABLED
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ENABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_enabled(&self) -> bool {
|
||||
*self == DOWN_A::ENABLED
|
||||
}
|
||||
}
|
||||
#[doc = "Write '1' to disable interrupt for DOWN event\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum DOWN_AW {
|
||||
#[doc = "1: Disable"]
|
||||
CLEAR = 1,
|
||||
}
|
||||
impl From<DOWN_AW> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: DOWN_AW) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
#[doc = "Field `DOWN` writer - Write '1' to disable interrupt for DOWN event"]
|
||||
pub type DOWN_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENCLR_SPEC, DOWN_AW, O>;
|
||||
impl<'a, const O: u8> DOWN_W<'a, O> {
|
||||
#[doc = "Disable"]
|
||||
#[inline(always)]
|
||||
pub fn clear(self) -> &'a mut W {
|
||||
self.variant(DOWN_AW::CLEAR)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `UP` reader - Write '1' to disable interrupt for UP event"]
|
||||
pub type UP_R = crate::BitReader<UP_A>;
|
||||
#[doc = "Write '1' to disable interrupt for UP event\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum UP_A {
|
||||
#[doc = "0: Read: Disabled"]
|
||||
DISABLED = 0,
|
||||
#[doc = "1: Read: Enabled"]
|
||||
ENABLED = 1,
|
||||
}
|
||||
impl From<UP_A> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: UP_A) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
impl UP_R {
|
||||
#[doc = "Get enumerated values variant"]
|
||||
#[inline(always)]
|
||||
pub fn variant(&self) -> UP_A {
|
||||
match self.bits {
|
||||
false => UP_A::DISABLED,
|
||||
true => UP_A::ENABLED,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `DISABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_disabled(&self) -> bool {
|
||||
*self == UP_A::DISABLED
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ENABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_enabled(&self) -> bool {
|
||||
*self == UP_A::ENABLED
|
||||
}
|
||||
}
|
||||
#[doc = "Write '1' to disable interrupt for UP event\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum UP_AW {
|
||||
#[doc = "1: Disable"]
|
||||
CLEAR = 1,
|
||||
}
|
||||
impl From<UP_AW> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: UP_AW) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
#[doc = "Field `UP` writer - Write '1' to disable interrupt for UP event"]
|
||||
pub type UP_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENCLR_SPEC, UP_AW, O>;
|
||||
impl<'a, const O: u8> UP_W<'a, O> {
|
||||
#[doc = "Disable"]
|
||||
#[inline(always)]
|
||||
pub fn clear(self) -> &'a mut W {
|
||||
self.variant(UP_AW::CLEAR)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `CROSS` reader - Write '1' to disable interrupt for CROSS event"]
|
||||
pub type CROSS_R = crate::BitReader<CROSS_A>;
|
||||
#[doc = "Write '1' to disable interrupt for CROSS event\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum CROSS_A {
|
||||
#[doc = "0: Read: Disabled"]
|
||||
DISABLED = 0,
|
||||
#[doc = "1: Read: Enabled"]
|
||||
ENABLED = 1,
|
||||
}
|
||||
impl From<CROSS_A> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: CROSS_A) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
impl CROSS_R {
|
||||
#[doc = "Get enumerated values variant"]
|
||||
#[inline(always)]
|
||||
pub fn variant(&self) -> CROSS_A {
|
||||
match self.bits {
|
||||
false => CROSS_A::DISABLED,
|
||||
true => CROSS_A::ENABLED,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `DISABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_disabled(&self) -> bool {
|
||||
*self == CROSS_A::DISABLED
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ENABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_enabled(&self) -> bool {
|
||||
*self == CROSS_A::ENABLED
|
||||
}
|
||||
}
|
||||
#[doc = "Write '1' to disable interrupt for CROSS event\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum CROSS_AW {
|
||||
#[doc = "1: Disable"]
|
||||
CLEAR = 1,
|
||||
}
|
||||
impl From<CROSS_AW> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: CROSS_AW) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
#[doc = "Field `CROSS` writer - Write '1' to disable interrupt for CROSS event"]
|
||||
pub type CROSS_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENCLR_SPEC, CROSS_AW, O>;
|
||||
impl<'a, const O: u8> CROSS_W<'a, O> {
|
||||
#[doc = "Disable"]
|
||||
#[inline(always)]
|
||||
pub fn clear(self) -> &'a mut W {
|
||||
self.variant(CROSS_AW::CLEAR)
|
||||
}
|
||||
}
|
||||
impl R {
|
||||
#[doc = "Bit 0 - Write '1' to disable interrupt for READY event"]
|
||||
#[inline(always)]
|
||||
pub fn ready(&self) -> READY_R {
|
||||
READY_R::new((self.bits & 1) != 0)
|
||||
}
|
||||
#[doc = "Bit 1 - Write '1' to disable interrupt for DOWN event"]
|
||||
#[inline(always)]
|
||||
pub fn down(&self) -> DOWN_R {
|
||||
DOWN_R::new(((self.bits >> 1) & 1) != 0)
|
||||
}
|
||||
#[doc = "Bit 2 - Write '1' to disable interrupt for UP event"]
|
||||
#[inline(always)]
|
||||
pub fn up(&self) -> UP_R {
|
||||
UP_R::new(((self.bits >> 2) & 1) != 0)
|
||||
}
|
||||
#[doc = "Bit 3 - Write '1' to disable interrupt for CROSS event"]
|
||||
#[inline(always)]
|
||||
pub fn cross(&self) -> CROSS_R {
|
||||
CROSS_R::new(((self.bits >> 3) & 1) != 0)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bit 0 - Write '1' to disable interrupt for READY event"]
|
||||
#[inline(always)]
|
||||
pub fn ready(&mut self) -> READY_W<0> {
|
||||
READY_W::new(self)
|
||||
}
|
||||
#[doc = "Bit 1 - Write '1' to disable interrupt for DOWN event"]
|
||||
#[inline(always)]
|
||||
pub fn down(&mut self) -> DOWN_W<1> {
|
||||
DOWN_W::new(self)
|
||||
}
|
||||
#[doc = "Bit 2 - Write '1' to disable interrupt for UP event"]
|
||||
#[inline(always)]
|
||||
pub fn up(&mut self) -> UP_W<2> {
|
||||
UP_W::new(self)
|
||||
}
|
||||
#[doc = "Bit 3 - Write '1' to disable interrupt for CROSS event"]
|
||||
#[inline(always)]
|
||||
pub fn cross(&mut self) -> CROSS_W<3> {
|
||||
CROSS_W::new(self)
|
||||
}
|
||||
#[doc = "Writes raw bits to the register."]
|
||||
#[inline(always)]
|
||||
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
|
||||
self.0.bits(bits);
|
||||
self
|
||||
}
|
||||
}
|
||||
#[doc = "Disable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenclr](index.html) module"]
|
||||
pub struct INTENCLR_SPEC;
|
||||
impl crate::RegisterSpec for INTENCLR_SPEC {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [intenclr::R](R) reader structure"]
|
||||
impl crate::Readable for INTENCLR_SPEC {
|
||||
type Reader = R;
|
||||
}
|
||||
#[doc = "`write(|w| ..)` method takes [intenclr::W](W) writer structure"]
|
||||
impl crate::Writable for INTENCLR_SPEC {
|
||||
type Writer = W;
|
||||
}
|
||||
#[doc = "`reset()` method sets INTENCLR to value 0"]
|
||||
impl crate::Resettable for INTENCLR_SPEC {
|
||||
#[inline(always)]
|
||||
fn reset_value() -> Self::Ux {
|
||||
0
|
||||
}
|
||||
}
|
||||
+334
@@ -0,0 +1,334 @@
|
||||
#[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 `READY` reader - Write '1' to enable interrupt for READY event"]
|
||||
pub type READY_R = crate::BitReader<READY_A>;
|
||||
#[doc = "Write '1' to enable interrupt for READY event\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum READY_A {
|
||||
#[doc = "0: Read: Disabled"]
|
||||
DISABLED = 0,
|
||||
#[doc = "1: Read: Enabled"]
|
||||
ENABLED = 1,
|
||||
}
|
||||
impl From<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::DISABLED,
|
||||
true => READY_A::ENABLED,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `DISABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_disabled(&self) -> bool {
|
||||
*self == READY_A::DISABLED
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ENABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_enabled(&self) -> bool {
|
||||
*self == READY_A::ENABLED
|
||||
}
|
||||
}
|
||||
#[doc = "Write '1' to enable interrupt for READY event\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum READY_AW {
|
||||
#[doc = "1: Enable"]
|
||||
SET = 1,
|
||||
}
|
||||
impl From<READY_AW> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: READY_AW) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
#[doc = "Field `READY` writer - Write '1' to enable interrupt for READY event"]
|
||||
pub type READY_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENSET_SPEC, READY_AW, O>;
|
||||
impl<'a, const O: u8> READY_W<'a, O> {
|
||||
#[doc = "Enable"]
|
||||
#[inline(always)]
|
||||
pub fn set(self) -> &'a mut W {
|
||||
self.variant(READY_AW::SET)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `DOWN` reader - Write '1' to enable interrupt for DOWN event"]
|
||||
pub type DOWN_R = crate::BitReader<DOWN_A>;
|
||||
#[doc = "Write '1' to enable interrupt for DOWN event\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum DOWN_A {
|
||||
#[doc = "0: Read: Disabled"]
|
||||
DISABLED = 0,
|
||||
#[doc = "1: Read: Enabled"]
|
||||
ENABLED = 1,
|
||||
}
|
||||
impl From<DOWN_A> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: DOWN_A) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
impl DOWN_R {
|
||||
#[doc = "Get enumerated values variant"]
|
||||
#[inline(always)]
|
||||
pub fn variant(&self) -> DOWN_A {
|
||||
match self.bits {
|
||||
false => DOWN_A::DISABLED,
|
||||
true => DOWN_A::ENABLED,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `DISABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_disabled(&self) -> bool {
|
||||
*self == DOWN_A::DISABLED
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ENABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_enabled(&self) -> bool {
|
||||
*self == DOWN_A::ENABLED
|
||||
}
|
||||
}
|
||||
#[doc = "Write '1' to enable interrupt for DOWN event\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum DOWN_AW {
|
||||
#[doc = "1: Enable"]
|
||||
SET = 1,
|
||||
}
|
||||
impl From<DOWN_AW> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: DOWN_AW) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
#[doc = "Field `DOWN` writer - Write '1' to enable interrupt for DOWN event"]
|
||||
pub type DOWN_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENSET_SPEC, DOWN_AW, O>;
|
||||
impl<'a, const O: u8> DOWN_W<'a, O> {
|
||||
#[doc = "Enable"]
|
||||
#[inline(always)]
|
||||
pub fn set(self) -> &'a mut W {
|
||||
self.variant(DOWN_AW::SET)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `UP` reader - Write '1' to enable interrupt for UP event"]
|
||||
pub type UP_R = crate::BitReader<UP_A>;
|
||||
#[doc = "Write '1' to enable interrupt for UP event\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum UP_A {
|
||||
#[doc = "0: Read: Disabled"]
|
||||
DISABLED = 0,
|
||||
#[doc = "1: Read: Enabled"]
|
||||
ENABLED = 1,
|
||||
}
|
||||
impl From<UP_A> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: UP_A) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
impl UP_R {
|
||||
#[doc = "Get enumerated values variant"]
|
||||
#[inline(always)]
|
||||
pub fn variant(&self) -> UP_A {
|
||||
match self.bits {
|
||||
false => UP_A::DISABLED,
|
||||
true => UP_A::ENABLED,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `DISABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_disabled(&self) -> bool {
|
||||
*self == UP_A::DISABLED
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ENABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_enabled(&self) -> bool {
|
||||
*self == UP_A::ENABLED
|
||||
}
|
||||
}
|
||||
#[doc = "Write '1' to enable interrupt for UP event\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum UP_AW {
|
||||
#[doc = "1: Enable"]
|
||||
SET = 1,
|
||||
}
|
||||
impl From<UP_AW> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: UP_AW) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
#[doc = "Field `UP` writer - Write '1' to enable interrupt for UP event"]
|
||||
pub type UP_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENSET_SPEC, UP_AW, O>;
|
||||
impl<'a, const O: u8> UP_W<'a, O> {
|
||||
#[doc = "Enable"]
|
||||
#[inline(always)]
|
||||
pub fn set(self) -> &'a mut W {
|
||||
self.variant(UP_AW::SET)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `CROSS` reader - Write '1' to enable interrupt for CROSS event"]
|
||||
pub type CROSS_R = crate::BitReader<CROSS_A>;
|
||||
#[doc = "Write '1' to enable interrupt for CROSS event\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum CROSS_A {
|
||||
#[doc = "0: Read: Disabled"]
|
||||
DISABLED = 0,
|
||||
#[doc = "1: Read: Enabled"]
|
||||
ENABLED = 1,
|
||||
}
|
||||
impl From<CROSS_A> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: CROSS_A) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
impl CROSS_R {
|
||||
#[doc = "Get enumerated values variant"]
|
||||
#[inline(always)]
|
||||
pub fn variant(&self) -> CROSS_A {
|
||||
match self.bits {
|
||||
false => CROSS_A::DISABLED,
|
||||
true => CROSS_A::ENABLED,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `DISABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_disabled(&self) -> bool {
|
||||
*self == CROSS_A::DISABLED
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ENABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_enabled(&self) -> bool {
|
||||
*self == CROSS_A::ENABLED
|
||||
}
|
||||
}
|
||||
#[doc = "Write '1' to enable interrupt for CROSS event\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum CROSS_AW {
|
||||
#[doc = "1: Enable"]
|
||||
SET = 1,
|
||||
}
|
||||
impl From<CROSS_AW> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: CROSS_AW) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
#[doc = "Field `CROSS` writer - Write '1' to enable interrupt for CROSS event"]
|
||||
pub type CROSS_W<'a, const O: u8> = crate::BitWriter<'a, u32, INTENSET_SPEC, CROSS_AW, O>;
|
||||
impl<'a, const O: u8> CROSS_W<'a, O> {
|
||||
#[doc = "Enable"]
|
||||
#[inline(always)]
|
||||
pub fn set(self) -> &'a mut W {
|
||||
self.variant(CROSS_AW::SET)
|
||||
}
|
||||
}
|
||||
impl R {
|
||||
#[doc = "Bit 0 - Write '1' to enable interrupt for READY event"]
|
||||
#[inline(always)]
|
||||
pub fn ready(&self) -> READY_R {
|
||||
READY_R::new((self.bits & 1) != 0)
|
||||
}
|
||||
#[doc = "Bit 1 - Write '1' to enable interrupt for DOWN event"]
|
||||
#[inline(always)]
|
||||
pub fn down(&self) -> DOWN_R {
|
||||
DOWN_R::new(((self.bits >> 1) & 1) != 0)
|
||||
}
|
||||
#[doc = "Bit 2 - Write '1' to enable interrupt for UP event"]
|
||||
#[inline(always)]
|
||||
pub fn up(&self) -> UP_R {
|
||||
UP_R::new(((self.bits >> 2) & 1) != 0)
|
||||
}
|
||||
#[doc = "Bit 3 - Write '1' to enable interrupt for CROSS event"]
|
||||
#[inline(always)]
|
||||
pub fn cross(&self) -> CROSS_R {
|
||||
CROSS_R::new(((self.bits >> 3) & 1) != 0)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bit 0 - Write '1' to enable interrupt for READY event"]
|
||||
#[inline(always)]
|
||||
pub fn ready(&mut self) -> READY_W<0> {
|
||||
READY_W::new(self)
|
||||
}
|
||||
#[doc = "Bit 1 - Write '1' to enable interrupt for DOWN event"]
|
||||
#[inline(always)]
|
||||
pub fn down(&mut self) -> DOWN_W<1> {
|
||||
DOWN_W::new(self)
|
||||
}
|
||||
#[doc = "Bit 2 - Write '1' to enable interrupt for UP event"]
|
||||
#[inline(always)]
|
||||
pub fn up(&mut self) -> UP_W<2> {
|
||||
UP_W::new(self)
|
||||
}
|
||||
#[doc = "Bit 3 - Write '1' to enable interrupt for CROSS event"]
|
||||
#[inline(always)]
|
||||
pub fn cross(&mut self) -> CROSS_W<3> {
|
||||
CROSS_W::new(self)
|
||||
}
|
||||
#[doc = "Writes raw bits to the register."]
|
||||
#[inline(always)]
|
||||
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
|
||||
self.0.bits(bits);
|
||||
self
|
||||
}
|
||||
}
|
||||
#[doc = "Enable interrupt\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [intenset](index.html) module"]
|
||||
pub struct INTENSET_SPEC;
|
||||
impl crate::RegisterSpec for INTENSET_SPEC {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [intenset::R](R) reader structure"]
|
||||
impl crate::Readable for INTENSET_SPEC {
|
||||
type Reader = R;
|
||||
}
|
||||
#[doc = "`write(|w| ..)` method takes [intenset::W](W) writer structure"]
|
||||
impl crate::Writable for INTENSET_SPEC {
|
||||
type Writer = W;
|
||||
}
|
||||
#[doc = "`reset()` method sets INTENSET to value 0"]
|
||||
impl crate::Resettable for INTENSET_SPEC {
|
||||
#[inline(always)]
|
||||
fn reset_value() -> Self::Ux {
|
||||
0
|
||||
}
|
||||
}
|
||||
Vendored
+201
@@ -0,0 +1,201 @@
|
||||
#[doc = "Register `MODE` reader"]
|
||||
pub struct R(crate::R<MODE_SPEC>);
|
||||
impl core::ops::Deref for R {
|
||||
type Target = crate::R<MODE_SPEC>;
|
||||
#[inline(always)]
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
impl From<crate::R<MODE_SPEC>> for R {
|
||||
#[inline(always)]
|
||||
fn from(reader: crate::R<MODE_SPEC>) -> Self {
|
||||
R(reader)
|
||||
}
|
||||
}
|
||||
#[doc = "Register `MODE` writer"]
|
||||
pub struct W(crate::W<MODE_SPEC>);
|
||||
impl core::ops::Deref for W {
|
||||
type Target = crate::W<MODE_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<MODE_SPEC>> for W {
|
||||
#[inline(always)]
|
||||
fn from(writer: crate::W<MODE_SPEC>) -> Self {
|
||||
W(writer)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `SP` reader - Speed and power modes"]
|
||||
pub type SP_R = crate::FieldReader<u8, SP_A>;
|
||||
#[doc = "Speed and power modes\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[repr(u8)]
|
||||
pub enum SP_A {
|
||||
#[doc = "0: Low-power mode"]
|
||||
LOW = 0,
|
||||
#[doc = "1: Normal mode"]
|
||||
NORMAL = 1,
|
||||
#[doc = "2: High-speed mode"]
|
||||
HIGH = 2,
|
||||
}
|
||||
impl From<SP_A> for u8 {
|
||||
#[inline(always)]
|
||||
fn from(variant: SP_A) -> Self {
|
||||
variant as _
|
||||
}
|
||||
}
|
||||
impl SP_R {
|
||||
#[doc = "Get enumerated values variant"]
|
||||
#[inline(always)]
|
||||
pub fn variant(&self) -> Option<SP_A> {
|
||||
match self.bits {
|
||||
0 => Some(SP_A::LOW),
|
||||
1 => Some(SP_A::NORMAL),
|
||||
2 => Some(SP_A::HIGH),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `LOW`"]
|
||||
#[inline(always)]
|
||||
pub fn is_low(&self) -> bool {
|
||||
*self == SP_A::LOW
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `NORMAL`"]
|
||||
#[inline(always)]
|
||||
pub fn is_normal(&self) -> bool {
|
||||
*self == SP_A::NORMAL
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `HIGH`"]
|
||||
#[inline(always)]
|
||||
pub fn is_high(&self) -> bool {
|
||||
*self == SP_A::HIGH
|
||||
}
|
||||
}
|
||||
#[doc = "Field `SP` writer - Speed and power modes"]
|
||||
pub type SP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, MODE_SPEC, u8, SP_A, 2, O>;
|
||||
impl<'a, const O: u8> SP_W<'a, O> {
|
||||
#[doc = "Low-power mode"]
|
||||
#[inline(always)]
|
||||
pub fn low(self) -> &'a mut W {
|
||||
self.variant(SP_A::LOW)
|
||||
}
|
||||
#[doc = "Normal mode"]
|
||||
#[inline(always)]
|
||||
pub fn normal(self) -> &'a mut W {
|
||||
self.variant(SP_A::NORMAL)
|
||||
}
|
||||
#[doc = "High-speed mode"]
|
||||
#[inline(always)]
|
||||
pub fn high(self) -> &'a mut W {
|
||||
self.variant(SP_A::HIGH)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `MAIN` reader - Main operation modes"]
|
||||
pub type MAIN_R = crate::BitReader<MAIN_A>;
|
||||
#[doc = "Main operation modes\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum MAIN_A {
|
||||
#[doc = "0: Single-ended mode"]
|
||||
SE = 0,
|
||||
#[doc = "1: Differential mode"]
|
||||
DIFF = 1,
|
||||
}
|
||||
impl From<MAIN_A> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: MAIN_A) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
impl MAIN_R {
|
||||
#[doc = "Get enumerated values variant"]
|
||||
#[inline(always)]
|
||||
pub fn variant(&self) -> MAIN_A {
|
||||
match self.bits {
|
||||
false => MAIN_A::SE,
|
||||
true => MAIN_A::DIFF,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `SE`"]
|
||||
#[inline(always)]
|
||||
pub fn is_se(&self) -> bool {
|
||||
*self == MAIN_A::SE
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `DIFF`"]
|
||||
#[inline(always)]
|
||||
pub fn is_diff(&self) -> bool {
|
||||
*self == MAIN_A::DIFF
|
||||
}
|
||||
}
|
||||
#[doc = "Field `MAIN` writer - Main operation modes"]
|
||||
pub type MAIN_W<'a, const O: u8> = crate::BitWriter<'a, u32, MODE_SPEC, MAIN_A, O>;
|
||||
impl<'a, const O: u8> MAIN_W<'a, O> {
|
||||
#[doc = "Single-ended mode"]
|
||||
#[inline(always)]
|
||||
pub fn se(self) -> &'a mut W {
|
||||
self.variant(MAIN_A::SE)
|
||||
}
|
||||
#[doc = "Differential mode"]
|
||||
#[inline(always)]
|
||||
pub fn diff(self) -> &'a mut W {
|
||||
self.variant(MAIN_A::DIFF)
|
||||
}
|
||||
}
|
||||
impl R {
|
||||
#[doc = "Bits 0:1 - Speed and power modes"]
|
||||
#[inline(always)]
|
||||
pub fn sp(&self) -> SP_R {
|
||||
SP_R::new((self.bits & 3) as u8)
|
||||
}
|
||||
#[doc = "Bit 8 - Main operation modes"]
|
||||
#[inline(always)]
|
||||
pub fn main(&self) -> MAIN_R {
|
||||
MAIN_R::new(((self.bits >> 8) & 1) != 0)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bits 0:1 - Speed and power modes"]
|
||||
#[inline(always)]
|
||||
pub fn sp(&mut self) -> SP_W<0> {
|
||||
SP_W::new(self)
|
||||
}
|
||||
#[doc = "Bit 8 - Main operation modes"]
|
||||
#[inline(always)]
|
||||
pub fn main(&mut self) -> MAIN_W<8> {
|
||||
MAIN_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 = "Mode configuration\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [mode](index.html) module"]
|
||||
pub struct MODE_SPEC;
|
||||
impl crate::RegisterSpec for MODE_SPEC {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [mode::R](R) reader structure"]
|
||||
impl crate::Readable for MODE_SPEC {
|
||||
type Reader = R;
|
||||
}
|
||||
#[doc = "`write(|w| ..)` method takes [mode::W](W) writer structure"]
|
||||
impl crate::Writable for MODE_SPEC {
|
||||
type Writer = W;
|
||||
}
|
||||
#[doc = "`reset()` method sets MODE to value 0"]
|
||||
impl crate::Resettable for MODE_SPEC {
|
||||
#[inline(always)]
|
||||
fn reset_value() -> Self::Ux {
|
||||
0
|
||||
}
|
||||
}
|
||||
Vendored
+206
@@ -0,0 +1,206 @@
|
||||
#[doc = "Register `PSEL` reader"]
|
||||
pub struct R(crate::R<PSEL_SPEC>);
|
||||
impl core::ops::Deref for R {
|
||||
type Target = crate::R<PSEL_SPEC>;
|
||||
#[inline(always)]
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
impl From<crate::R<PSEL_SPEC>> for R {
|
||||
#[inline(always)]
|
||||
fn from(reader: crate::R<PSEL_SPEC>) -> Self {
|
||||
R(reader)
|
||||
}
|
||||
}
|
||||
#[doc = "Register `PSEL` writer"]
|
||||
pub struct W(crate::W<PSEL_SPEC>);
|
||||
impl core::ops::Deref for W {
|
||||
type Target = crate::W<PSEL_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<PSEL_SPEC>> for W {
|
||||
#[inline(always)]
|
||||
fn from(writer: crate::W<PSEL_SPEC>) -> Self {
|
||||
W(writer)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `PSEL` reader - Analog pin select"]
|
||||
pub type PSEL_R = crate::FieldReader<u8, PSEL_A>;
|
||||
#[doc = "Analog pin select\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[repr(u8)]
|
||||
pub enum PSEL_A {
|
||||
#[doc = "0: AIN0 selected as analog input"]
|
||||
ANALOG_INPUT0 = 0,
|
||||
#[doc = "1: AIN1 selected as analog input"]
|
||||
ANALOG_INPUT1 = 1,
|
||||
#[doc = "2: AIN2 selected as analog input"]
|
||||
ANALOG_INPUT2 = 2,
|
||||
#[doc = "3: AIN3 selected as analog input"]
|
||||
ANALOG_INPUT3 = 3,
|
||||
#[doc = "4: AIN4 selected as analog input"]
|
||||
ANALOG_INPUT4 = 4,
|
||||
#[doc = "5: AIN5 selected as analog input"]
|
||||
ANALOG_INPUT5 = 5,
|
||||
#[doc = "6: AIN6 selected as analog input"]
|
||||
ANALOG_INPUT6 = 6,
|
||||
#[doc = "7: AIN7 selected as analog input"]
|
||||
ANALOG_INPUT7 = 7,
|
||||
}
|
||||
impl From<PSEL_A> for u8 {
|
||||
#[inline(always)]
|
||||
fn from(variant: PSEL_A) -> Self {
|
||||
variant as _
|
||||
}
|
||||
}
|
||||
impl PSEL_R {
|
||||
#[doc = "Get enumerated values variant"]
|
||||
#[inline(always)]
|
||||
pub fn variant(&self) -> PSEL_A {
|
||||
match self.bits {
|
||||
0 => PSEL_A::ANALOG_INPUT0,
|
||||
1 => PSEL_A::ANALOG_INPUT1,
|
||||
2 => PSEL_A::ANALOG_INPUT2,
|
||||
3 => PSEL_A::ANALOG_INPUT3,
|
||||
4 => PSEL_A::ANALOG_INPUT4,
|
||||
5 => PSEL_A::ANALOG_INPUT5,
|
||||
6 => PSEL_A::ANALOG_INPUT6,
|
||||
7 => PSEL_A::ANALOG_INPUT7,
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ANALOG_INPUT0`"]
|
||||
#[inline(always)]
|
||||
pub fn is_analog_input0(&self) -> bool {
|
||||
*self == PSEL_A::ANALOG_INPUT0
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ANALOG_INPUT1`"]
|
||||
#[inline(always)]
|
||||
pub fn is_analog_input1(&self) -> bool {
|
||||
*self == PSEL_A::ANALOG_INPUT1
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ANALOG_INPUT2`"]
|
||||
#[inline(always)]
|
||||
pub fn is_analog_input2(&self) -> bool {
|
||||
*self == PSEL_A::ANALOG_INPUT2
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ANALOG_INPUT3`"]
|
||||
#[inline(always)]
|
||||
pub fn is_analog_input3(&self) -> bool {
|
||||
*self == PSEL_A::ANALOG_INPUT3
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ANALOG_INPUT4`"]
|
||||
#[inline(always)]
|
||||
pub fn is_analog_input4(&self) -> bool {
|
||||
*self == PSEL_A::ANALOG_INPUT4
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ANALOG_INPUT5`"]
|
||||
#[inline(always)]
|
||||
pub fn is_analog_input5(&self) -> bool {
|
||||
*self == PSEL_A::ANALOG_INPUT5
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ANALOG_INPUT6`"]
|
||||
#[inline(always)]
|
||||
pub fn is_analog_input6(&self) -> bool {
|
||||
*self == PSEL_A::ANALOG_INPUT6
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ANALOG_INPUT7`"]
|
||||
#[inline(always)]
|
||||
pub fn is_analog_input7(&self) -> bool {
|
||||
*self == PSEL_A::ANALOG_INPUT7
|
||||
}
|
||||
}
|
||||
#[doc = "Field `PSEL` writer - Analog pin select"]
|
||||
pub type PSEL_W<'a, const O: u8> = crate::FieldWriterSafe<'a, u32, PSEL_SPEC, u8, PSEL_A, 3, O>;
|
||||
impl<'a, const O: u8> PSEL_W<'a, O> {
|
||||
#[doc = "AIN0 selected as analog input"]
|
||||
#[inline(always)]
|
||||
pub fn analog_input0(self) -> &'a mut W {
|
||||
self.variant(PSEL_A::ANALOG_INPUT0)
|
||||
}
|
||||
#[doc = "AIN1 selected as analog input"]
|
||||
#[inline(always)]
|
||||
pub fn analog_input1(self) -> &'a mut W {
|
||||
self.variant(PSEL_A::ANALOG_INPUT1)
|
||||
}
|
||||
#[doc = "AIN2 selected as analog input"]
|
||||
#[inline(always)]
|
||||
pub fn analog_input2(self) -> &'a mut W {
|
||||
self.variant(PSEL_A::ANALOG_INPUT2)
|
||||
}
|
||||
#[doc = "AIN3 selected as analog input"]
|
||||
#[inline(always)]
|
||||
pub fn analog_input3(self) -> &'a mut W {
|
||||
self.variant(PSEL_A::ANALOG_INPUT3)
|
||||
}
|
||||
#[doc = "AIN4 selected as analog input"]
|
||||
#[inline(always)]
|
||||
pub fn analog_input4(self) -> &'a mut W {
|
||||
self.variant(PSEL_A::ANALOG_INPUT4)
|
||||
}
|
||||
#[doc = "AIN5 selected as analog input"]
|
||||
#[inline(always)]
|
||||
pub fn analog_input5(self) -> &'a mut W {
|
||||
self.variant(PSEL_A::ANALOG_INPUT5)
|
||||
}
|
||||
#[doc = "AIN6 selected as analog input"]
|
||||
#[inline(always)]
|
||||
pub fn analog_input6(self) -> &'a mut W {
|
||||
self.variant(PSEL_A::ANALOG_INPUT6)
|
||||
}
|
||||
#[doc = "AIN7 selected as analog input"]
|
||||
#[inline(always)]
|
||||
pub fn analog_input7(self) -> &'a mut W {
|
||||
self.variant(PSEL_A::ANALOG_INPUT7)
|
||||
}
|
||||
}
|
||||
impl R {
|
||||
#[doc = "Bits 0:2 - Analog pin select"]
|
||||
#[inline(always)]
|
||||
pub fn psel(&self) -> PSEL_R {
|
||||
PSEL_R::new((self.bits & 7) as u8)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bits 0:2 - Analog pin select"]
|
||||
#[inline(always)]
|
||||
pub fn psel(&mut self) -> PSEL_W<0> {
|
||||
PSEL_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 = "Pin select\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [psel](index.html) module"]
|
||||
pub struct PSEL_SPEC;
|
||||
impl crate::RegisterSpec for PSEL_SPEC {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [psel::R](R) reader structure"]
|
||||
impl crate::Readable for PSEL_SPEC {
|
||||
type Reader = R;
|
||||
}
|
||||
#[doc = "`write(|w| ..)` method takes [psel::W](W) writer structure"]
|
||||
impl crate::Writable for PSEL_SPEC {
|
||||
type Writer = W;
|
||||
}
|
||||
#[doc = "`reset()` method sets PSEL to value 0"]
|
||||
impl crate::Resettable for PSEL_SPEC {
|
||||
#[inline(always)]
|
||||
fn reset_value() -> Self::Ux {
|
||||
0
|
||||
}
|
||||
}
|
||||
+167
@@ -0,0 +1,167 @@
|
||||
#[doc = "Register `REFSEL` reader"]
|
||||
pub struct R(crate::R<REFSEL_SPEC>);
|
||||
impl core::ops::Deref for R {
|
||||
type Target = crate::R<REFSEL_SPEC>;
|
||||
#[inline(always)]
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
impl From<crate::R<REFSEL_SPEC>> for R {
|
||||
#[inline(always)]
|
||||
fn from(reader: crate::R<REFSEL_SPEC>) -> Self {
|
||||
R(reader)
|
||||
}
|
||||
}
|
||||
#[doc = "Register `REFSEL` writer"]
|
||||
pub struct W(crate::W<REFSEL_SPEC>);
|
||||
impl core::ops::Deref for W {
|
||||
type Target = crate::W<REFSEL_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<REFSEL_SPEC>> for W {
|
||||
#[inline(always)]
|
||||
fn from(writer: crate::W<REFSEL_SPEC>) -> Self {
|
||||
W(writer)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `REFSEL` reader - Reference select"]
|
||||
pub type REFSEL_R = crate::FieldReader<u8, REFSEL_A>;
|
||||
#[doc = "Reference select\n\nValue on reset: 4"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
#[repr(u8)]
|
||||
pub enum REFSEL_A {
|
||||
#[doc = "0: VREF = internal 1.2 V reference (VDD >= 1.7 V)"]
|
||||
INT1V2 = 0,
|
||||
#[doc = "1: VREF = internal 1.8 V reference (VDD >= VREF + 0.2 V)"]
|
||||
INT1V8 = 1,
|
||||
#[doc = "2: VREF = internal 2.4 V reference (VDD >= VREF + 0.2 V)"]
|
||||
INT2V4 = 2,
|
||||
#[doc = "4: VREF = VDD"]
|
||||
VDD = 4,
|
||||
#[doc = "5: VREF = AREF (VDD >= VREF >= AREFMIN)"]
|
||||
AREF = 5,
|
||||
}
|
||||
impl From<REFSEL_A> for u8 {
|
||||
#[inline(always)]
|
||||
fn from(variant: REFSEL_A) -> Self {
|
||||
variant as _
|
||||
}
|
||||
}
|
||||
impl REFSEL_R {
|
||||
#[doc = "Get enumerated values variant"]
|
||||
#[inline(always)]
|
||||
pub fn variant(&self) -> Option<REFSEL_A> {
|
||||
match self.bits {
|
||||
0 => Some(REFSEL_A::INT1V2),
|
||||
1 => Some(REFSEL_A::INT1V8),
|
||||
2 => Some(REFSEL_A::INT2V4),
|
||||
4 => Some(REFSEL_A::VDD),
|
||||
5 => Some(REFSEL_A::AREF),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `INT1V2`"]
|
||||
#[inline(always)]
|
||||
pub fn is_int1v2(&self) -> bool {
|
||||
*self == REFSEL_A::INT1V2
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `INT1V8`"]
|
||||
#[inline(always)]
|
||||
pub fn is_int1v8(&self) -> bool {
|
||||
*self == REFSEL_A::INT1V8
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `INT2V4`"]
|
||||
#[inline(always)]
|
||||
pub fn is_int2v4(&self) -> bool {
|
||||
*self == REFSEL_A::INT2V4
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `VDD`"]
|
||||
#[inline(always)]
|
||||
pub fn is_vdd(&self) -> bool {
|
||||
*self == REFSEL_A::VDD
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `AREF`"]
|
||||
#[inline(always)]
|
||||
pub fn is_aref(&self) -> bool {
|
||||
*self == REFSEL_A::AREF
|
||||
}
|
||||
}
|
||||
#[doc = "Field `REFSEL` writer - Reference select"]
|
||||
pub type REFSEL_W<'a, const O: u8> = crate::FieldWriter<'a, u32, REFSEL_SPEC, u8, REFSEL_A, 3, O>;
|
||||
impl<'a, const O: u8> REFSEL_W<'a, O> {
|
||||
#[doc = "VREF = internal 1.2 V reference (VDD >= 1.7 V)"]
|
||||
#[inline(always)]
|
||||
pub fn int1v2(self) -> &'a mut W {
|
||||
self.variant(REFSEL_A::INT1V2)
|
||||
}
|
||||
#[doc = "VREF = internal 1.8 V reference (VDD >= VREF + 0.2 V)"]
|
||||
#[inline(always)]
|
||||
pub fn int1v8(self) -> &'a mut W {
|
||||
self.variant(REFSEL_A::INT1V8)
|
||||
}
|
||||
#[doc = "VREF = internal 2.4 V reference (VDD >= VREF + 0.2 V)"]
|
||||
#[inline(always)]
|
||||
pub fn int2v4(self) -> &'a mut W {
|
||||
self.variant(REFSEL_A::INT2V4)
|
||||
}
|
||||
#[doc = "VREF = VDD"]
|
||||
#[inline(always)]
|
||||
pub fn vdd(self) -> &'a mut W {
|
||||
self.variant(REFSEL_A::VDD)
|
||||
}
|
||||
#[doc = "VREF = AREF (VDD >= VREF >= AREFMIN)"]
|
||||
#[inline(always)]
|
||||
pub fn aref(self) -> &'a mut W {
|
||||
self.variant(REFSEL_A::AREF)
|
||||
}
|
||||
}
|
||||
impl R {
|
||||
#[doc = "Bits 0:2 - Reference select"]
|
||||
#[inline(always)]
|
||||
pub fn refsel(&self) -> REFSEL_R {
|
||||
REFSEL_R::new((self.bits & 7) as u8)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bits 0:2 - Reference select"]
|
||||
#[inline(always)]
|
||||
pub fn refsel(&mut self) -> REFSEL_W<0> {
|
||||
REFSEL_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 = "Reference source select for single-ended mode\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [refsel](index.html) module"]
|
||||
pub struct REFSEL_SPEC;
|
||||
impl crate::RegisterSpec for REFSEL_SPEC {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [refsel::R](R) reader structure"]
|
||||
impl crate::Readable for REFSEL_SPEC {
|
||||
type Reader = R;
|
||||
}
|
||||
#[doc = "`write(|w| ..)` method takes [refsel::W](W) writer structure"]
|
||||
impl crate::Writable for REFSEL_SPEC {
|
||||
type Writer = W;
|
||||
}
|
||||
#[doc = "`reset()` method sets REFSEL to value 0x04"]
|
||||
impl crate::Resettable for REFSEL_SPEC {
|
||||
#[inline(always)]
|
||||
fn reset_value() -> Self::Ux {
|
||||
0x04
|
||||
}
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
#[doc = "Register `RESULT` reader"]
|
||||
pub struct R(crate::R<RESULT_SPEC>);
|
||||
impl core::ops::Deref for R {
|
||||
type Target = crate::R<RESULT_SPEC>;
|
||||
#[inline(always)]
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
impl From<crate::R<RESULT_SPEC>> for R {
|
||||
#[inline(always)]
|
||||
fn from(reader: crate::R<RESULT_SPEC>) -> Self {
|
||||
R(reader)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `RESULT` reader - Result of last compare. Decision point SAMPLE task."]
|
||||
pub type RESULT_R = crate::BitReader<RESULT_A>;
|
||||
#[doc = "Result of last compare. Decision point SAMPLE task.\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum RESULT_A {
|
||||
#[doc = "0: Input voltage is below the threshold (VIN+ < VIN-)"]
|
||||
BELOW = 0,
|
||||
#[doc = "1: Input voltage is above the threshold (VIN+ > VIN-)"]
|
||||
ABOVE = 1,
|
||||
}
|
||||
impl From<RESULT_A> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: RESULT_A) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
impl RESULT_R {
|
||||
#[doc = "Get enumerated values variant"]
|
||||
#[inline(always)]
|
||||
pub fn variant(&self) -> RESULT_A {
|
||||
match self.bits {
|
||||
false => RESULT_A::BELOW,
|
||||
true => RESULT_A::ABOVE,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `BELOW`"]
|
||||
#[inline(always)]
|
||||
pub fn is_below(&self) -> bool {
|
||||
*self == RESULT_A::BELOW
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ABOVE`"]
|
||||
#[inline(always)]
|
||||
pub fn is_above(&self) -> bool {
|
||||
*self == RESULT_A::ABOVE
|
||||
}
|
||||
}
|
||||
impl R {
|
||||
#[doc = "Bit 0 - Result of last compare. Decision point SAMPLE task."]
|
||||
#[inline(always)]
|
||||
pub fn result(&self) -> RESULT_R {
|
||||
RESULT_R::new((self.bits & 1) != 0)
|
||||
}
|
||||
}
|
||||
#[doc = "Compare result\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [result](index.html) module"]
|
||||
pub struct RESULT_SPEC;
|
||||
impl crate::RegisterSpec for RESULT_SPEC {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [result::R](R) reader structure"]
|
||||
impl crate::Readable for RESULT_SPEC {
|
||||
type Reader = R;
|
||||
}
|
||||
#[doc = "`reset()` method sets RESULT to value 0"]
|
||||
impl crate::Resettable for RESULT_SPEC {
|
||||
#[inline(always)]
|
||||
fn reset_value() -> Self::Ux {
|
||||
0
|
||||
}
|
||||
}
|
||||
+367
@@ -0,0 +1,367 @@
|
||||
#[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 `READY_SAMPLE` reader - Shortcut between READY event and SAMPLE task"]
|
||||
pub type READY_SAMPLE_R = crate::BitReader<READY_SAMPLE_A>;
|
||||
#[doc = "Shortcut between READY event and SAMPLE task\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum READY_SAMPLE_A {
|
||||
#[doc = "0: Disable shortcut"]
|
||||
DISABLED = 0,
|
||||
#[doc = "1: Enable shortcut"]
|
||||
ENABLED = 1,
|
||||
}
|
||||
impl From<READY_SAMPLE_A> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: READY_SAMPLE_A) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
impl READY_SAMPLE_R {
|
||||
#[doc = "Get enumerated values variant"]
|
||||
#[inline(always)]
|
||||
pub fn variant(&self) -> READY_SAMPLE_A {
|
||||
match self.bits {
|
||||
false => READY_SAMPLE_A::DISABLED,
|
||||
true => READY_SAMPLE_A::ENABLED,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `DISABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_disabled(&self) -> bool {
|
||||
*self == READY_SAMPLE_A::DISABLED
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ENABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_enabled(&self) -> bool {
|
||||
*self == READY_SAMPLE_A::ENABLED
|
||||
}
|
||||
}
|
||||
#[doc = "Field `READY_SAMPLE` writer - Shortcut between READY event and SAMPLE task"]
|
||||
pub type READY_SAMPLE_W<'a, const O: u8> =
|
||||
crate::BitWriter<'a, u32, SHORTS_SPEC, READY_SAMPLE_A, O>;
|
||||
impl<'a, const O: u8> READY_SAMPLE_W<'a, O> {
|
||||
#[doc = "Disable shortcut"]
|
||||
#[inline(always)]
|
||||
pub fn disabled(self) -> &'a mut W {
|
||||
self.variant(READY_SAMPLE_A::DISABLED)
|
||||
}
|
||||
#[doc = "Enable shortcut"]
|
||||
#[inline(always)]
|
||||
pub fn enabled(self) -> &'a mut W {
|
||||
self.variant(READY_SAMPLE_A::ENABLED)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `READY_STOP` reader - Shortcut between READY event and STOP task"]
|
||||
pub type READY_STOP_R = crate::BitReader<READY_STOP_A>;
|
||||
#[doc = "Shortcut between READY event and STOP task\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum READY_STOP_A {
|
||||
#[doc = "0: Disable shortcut"]
|
||||
DISABLED = 0,
|
||||
#[doc = "1: Enable shortcut"]
|
||||
ENABLED = 1,
|
||||
}
|
||||
impl From<READY_STOP_A> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: READY_STOP_A) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
impl READY_STOP_R {
|
||||
#[doc = "Get enumerated values variant"]
|
||||
#[inline(always)]
|
||||
pub fn variant(&self) -> READY_STOP_A {
|
||||
match self.bits {
|
||||
false => READY_STOP_A::DISABLED,
|
||||
true => READY_STOP_A::ENABLED,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `DISABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_disabled(&self) -> bool {
|
||||
*self == READY_STOP_A::DISABLED
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ENABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_enabled(&self) -> bool {
|
||||
*self == READY_STOP_A::ENABLED
|
||||
}
|
||||
}
|
||||
#[doc = "Field `READY_STOP` writer - Shortcut between READY event and STOP task"]
|
||||
pub type READY_STOP_W<'a, const O: u8> = crate::BitWriter<'a, u32, SHORTS_SPEC, READY_STOP_A, O>;
|
||||
impl<'a, const O: u8> READY_STOP_W<'a, O> {
|
||||
#[doc = "Disable shortcut"]
|
||||
#[inline(always)]
|
||||
pub fn disabled(self) -> &'a mut W {
|
||||
self.variant(READY_STOP_A::DISABLED)
|
||||
}
|
||||
#[doc = "Enable shortcut"]
|
||||
#[inline(always)]
|
||||
pub fn enabled(self) -> &'a mut W {
|
||||
self.variant(READY_STOP_A::ENABLED)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `DOWN_STOP` reader - Shortcut between DOWN event and STOP task"]
|
||||
pub type DOWN_STOP_R = crate::BitReader<DOWN_STOP_A>;
|
||||
#[doc = "Shortcut between DOWN event and STOP task\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum DOWN_STOP_A {
|
||||
#[doc = "0: Disable shortcut"]
|
||||
DISABLED = 0,
|
||||
#[doc = "1: Enable shortcut"]
|
||||
ENABLED = 1,
|
||||
}
|
||||
impl From<DOWN_STOP_A> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: DOWN_STOP_A) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
impl DOWN_STOP_R {
|
||||
#[doc = "Get enumerated values variant"]
|
||||
#[inline(always)]
|
||||
pub fn variant(&self) -> DOWN_STOP_A {
|
||||
match self.bits {
|
||||
false => DOWN_STOP_A::DISABLED,
|
||||
true => DOWN_STOP_A::ENABLED,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `DISABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_disabled(&self) -> bool {
|
||||
*self == DOWN_STOP_A::DISABLED
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ENABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_enabled(&self) -> bool {
|
||||
*self == DOWN_STOP_A::ENABLED
|
||||
}
|
||||
}
|
||||
#[doc = "Field `DOWN_STOP` writer - Shortcut between DOWN event and STOP task"]
|
||||
pub type DOWN_STOP_W<'a, const O: u8> = crate::BitWriter<'a, u32, SHORTS_SPEC, DOWN_STOP_A, O>;
|
||||
impl<'a, const O: u8> DOWN_STOP_W<'a, O> {
|
||||
#[doc = "Disable shortcut"]
|
||||
#[inline(always)]
|
||||
pub fn disabled(self) -> &'a mut W {
|
||||
self.variant(DOWN_STOP_A::DISABLED)
|
||||
}
|
||||
#[doc = "Enable shortcut"]
|
||||
#[inline(always)]
|
||||
pub fn enabled(self) -> &'a mut W {
|
||||
self.variant(DOWN_STOP_A::ENABLED)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `UP_STOP` reader - Shortcut between UP event and STOP task"]
|
||||
pub type UP_STOP_R = crate::BitReader<UP_STOP_A>;
|
||||
#[doc = "Shortcut between UP event and STOP task\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum UP_STOP_A {
|
||||
#[doc = "0: Disable shortcut"]
|
||||
DISABLED = 0,
|
||||
#[doc = "1: Enable shortcut"]
|
||||
ENABLED = 1,
|
||||
}
|
||||
impl From<UP_STOP_A> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: UP_STOP_A) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
impl UP_STOP_R {
|
||||
#[doc = "Get enumerated values variant"]
|
||||
#[inline(always)]
|
||||
pub fn variant(&self) -> UP_STOP_A {
|
||||
match self.bits {
|
||||
false => UP_STOP_A::DISABLED,
|
||||
true => UP_STOP_A::ENABLED,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `DISABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_disabled(&self) -> bool {
|
||||
*self == UP_STOP_A::DISABLED
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ENABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_enabled(&self) -> bool {
|
||||
*self == UP_STOP_A::ENABLED
|
||||
}
|
||||
}
|
||||
#[doc = "Field `UP_STOP` writer - Shortcut between UP event and STOP task"]
|
||||
pub type UP_STOP_W<'a, const O: u8> = crate::BitWriter<'a, u32, SHORTS_SPEC, UP_STOP_A, O>;
|
||||
impl<'a, const O: u8> UP_STOP_W<'a, O> {
|
||||
#[doc = "Disable shortcut"]
|
||||
#[inline(always)]
|
||||
pub fn disabled(self) -> &'a mut W {
|
||||
self.variant(UP_STOP_A::DISABLED)
|
||||
}
|
||||
#[doc = "Enable shortcut"]
|
||||
#[inline(always)]
|
||||
pub fn enabled(self) -> &'a mut W {
|
||||
self.variant(UP_STOP_A::ENABLED)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `CROSS_STOP` reader - Shortcut between CROSS event and STOP task"]
|
||||
pub type CROSS_STOP_R = crate::BitReader<CROSS_STOP_A>;
|
||||
#[doc = "Shortcut between CROSS event and STOP task\n\nValue on reset: 0"]
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
pub enum CROSS_STOP_A {
|
||||
#[doc = "0: Disable shortcut"]
|
||||
DISABLED = 0,
|
||||
#[doc = "1: Enable shortcut"]
|
||||
ENABLED = 1,
|
||||
}
|
||||
impl From<CROSS_STOP_A> for bool {
|
||||
#[inline(always)]
|
||||
fn from(variant: CROSS_STOP_A) -> Self {
|
||||
variant as u8 != 0
|
||||
}
|
||||
}
|
||||
impl CROSS_STOP_R {
|
||||
#[doc = "Get enumerated values variant"]
|
||||
#[inline(always)]
|
||||
pub fn variant(&self) -> CROSS_STOP_A {
|
||||
match self.bits {
|
||||
false => CROSS_STOP_A::DISABLED,
|
||||
true => CROSS_STOP_A::ENABLED,
|
||||
}
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `DISABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_disabled(&self) -> bool {
|
||||
*self == CROSS_STOP_A::DISABLED
|
||||
}
|
||||
#[doc = "Checks if the value of the field is `ENABLED`"]
|
||||
#[inline(always)]
|
||||
pub fn is_enabled(&self) -> bool {
|
||||
*self == CROSS_STOP_A::ENABLED
|
||||
}
|
||||
}
|
||||
#[doc = "Field `CROSS_STOP` writer - Shortcut between CROSS event and STOP task"]
|
||||
pub type CROSS_STOP_W<'a, const O: u8> = crate::BitWriter<'a, u32, SHORTS_SPEC, CROSS_STOP_A, O>;
|
||||
impl<'a, const O: u8> CROSS_STOP_W<'a, O> {
|
||||
#[doc = "Disable shortcut"]
|
||||
#[inline(always)]
|
||||
pub fn disabled(self) -> &'a mut W {
|
||||
self.variant(CROSS_STOP_A::DISABLED)
|
||||
}
|
||||
#[doc = "Enable shortcut"]
|
||||
#[inline(always)]
|
||||
pub fn enabled(self) -> &'a mut W {
|
||||
self.variant(CROSS_STOP_A::ENABLED)
|
||||
}
|
||||
}
|
||||
impl R {
|
||||
#[doc = "Bit 0 - Shortcut between READY event and SAMPLE task"]
|
||||
#[inline(always)]
|
||||
pub fn ready_sample(&self) -> READY_SAMPLE_R {
|
||||
READY_SAMPLE_R::new((self.bits & 1) != 0)
|
||||
}
|
||||
#[doc = "Bit 1 - Shortcut between READY event and STOP task"]
|
||||
#[inline(always)]
|
||||
pub fn ready_stop(&self) -> READY_STOP_R {
|
||||
READY_STOP_R::new(((self.bits >> 1) & 1) != 0)
|
||||
}
|
||||
#[doc = "Bit 2 - Shortcut between DOWN event and STOP task"]
|
||||
#[inline(always)]
|
||||
pub fn down_stop(&self) -> DOWN_STOP_R {
|
||||
DOWN_STOP_R::new(((self.bits >> 2) & 1) != 0)
|
||||
}
|
||||
#[doc = "Bit 3 - Shortcut between UP event and STOP task"]
|
||||
#[inline(always)]
|
||||
pub fn up_stop(&self) -> UP_STOP_R {
|
||||
UP_STOP_R::new(((self.bits >> 3) & 1) != 0)
|
||||
}
|
||||
#[doc = "Bit 4 - Shortcut between CROSS event and STOP task"]
|
||||
#[inline(always)]
|
||||
pub fn cross_stop(&self) -> CROSS_STOP_R {
|
||||
CROSS_STOP_R::new(((self.bits >> 4) & 1) != 0)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bit 0 - Shortcut between READY event and SAMPLE task"]
|
||||
#[inline(always)]
|
||||
pub fn ready_sample(&mut self) -> READY_SAMPLE_W<0> {
|
||||
READY_SAMPLE_W::new(self)
|
||||
}
|
||||
#[doc = "Bit 1 - Shortcut between READY event and STOP task"]
|
||||
#[inline(always)]
|
||||
pub fn ready_stop(&mut self) -> READY_STOP_W<1> {
|
||||
READY_STOP_W::new(self)
|
||||
}
|
||||
#[doc = "Bit 2 - Shortcut between DOWN event and STOP task"]
|
||||
#[inline(always)]
|
||||
pub fn down_stop(&mut self) -> DOWN_STOP_W<2> {
|
||||
DOWN_STOP_W::new(self)
|
||||
}
|
||||
#[doc = "Bit 3 - Shortcut between UP event and STOP task"]
|
||||
#[inline(always)]
|
||||
pub fn up_stop(&mut self) -> UP_STOP_W<3> {
|
||||
UP_STOP_W::new(self)
|
||||
}
|
||||
#[doc = "Bit 4 - Shortcut between CROSS event and STOP task"]
|
||||
#[inline(always)]
|
||||
pub fn cross_stop(&mut self) -> CROSS_STOP_W<4> {
|
||||
CROSS_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 = "Shortcut register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [shorts](index.html) module"]
|
||||
pub struct SHORTS_SPEC;
|
||||
impl crate::RegisterSpec for SHORTS_SPEC {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [shorts::R](R) reader structure"]
|
||||
impl crate::Readable for SHORTS_SPEC {
|
||||
type Reader = R;
|
||||
}
|
||||
#[doc = "`write(|w| ..)` method takes [shorts::W](W) writer structure"]
|
||||
impl crate::Writable for SHORTS_SPEC {
|
||||
type Writer = W;
|
||||
}
|
||||
#[doc = "`reset()` method sets SHORTS to value 0"]
|
||||
impl crate::Resettable for SHORTS_SPEC {
|
||||
#[inline(always)]
|
||||
fn reset_value() -> Self::Ux {
|
||||
0
|
||||
}
|
||||
}
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
#[doc = "Register `TASKS_SAMPLE` writer"]
|
||||
pub struct W(crate::W<TASKS_SAMPLE_SPEC>);
|
||||
impl core::ops::Deref for W {
|
||||
type Target = crate::W<TASKS_SAMPLE_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_SAMPLE_SPEC>> for W {
|
||||
#[inline(always)]
|
||||
fn from(writer: crate::W<TASKS_SAMPLE_SPEC>) -> Self {
|
||||
W(writer)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `TASKS_SAMPLE` writer - "]
|
||||
pub type TASKS_SAMPLE_W<'a, const O: u8> = crate::BitWriter<'a, u32, TASKS_SAMPLE_SPEC, bool, O>;
|
||||
impl W {
|
||||
#[doc = "Bit 0"]
|
||||
#[inline(always)]
|
||||
pub fn tasks_sample(&mut self) -> TASKS_SAMPLE_W<0> {
|
||||
TASKS_SAMPLE_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 comparator value\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_sample](index.html) module"]
|
||||
pub struct TASKS_SAMPLE_SPEC;
|
||||
impl crate::RegisterSpec for TASKS_SAMPLE_SPEC {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`write(|w| ..)` method takes [tasks_sample::W](W) writer structure"]
|
||||
impl crate::Writable for TASKS_SAMPLE_SPEC {
|
||||
type Writer = W;
|
||||
}
|
||||
#[doc = "`reset()` method sets TASKS_SAMPLE to value 0"]
|
||||
impl crate::Resettable for TASKS_SAMPLE_SPEC {
|
||||
#[inline(always)]
|
||||
fn reset_value() -> Self::Ux {
|
||||
0
|
||||
}
|
||||
}
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
#[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)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `TASKS_START` writer - "]
|
||||
pub type TASKS_START_W<'a, const O: u8> = crate::BitWriter<'a, u32, TASKS_START_SPEC, bool, O>;
|
||||
impl W {
|
||||
#[doc = "Bit 0"]
|
||||
#[inline(always)]
|
||||
pub fn tasks_start(&mut self) -> TASKS_START_W<0> {
|
||||
TASKS_START_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 = "Start comparator\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_start](index.html) module"]
|
||||
pub struct TASKS_START_SPEC;
|
||||
impl crate::RegisterSpec for TASKS_START_SPEC {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`write(|w| ..)` method takes [tasks_start::W](W) writer structure"]
|
||||
impl crate::Writable for TASKS_START_SPEC {
|
||||
type Writer = W;
|
||||
}
|
||||
#[doc = "`reset()` method sets TASKS_START to value 0"]
|
||||
impl crate::Resettable for TASKS_START_SPEC {
|
||||
#[inline(always)]
|
||||
fn reset_value() -> Self::Ux {
|
||||
0
|
||||
}
|
||||
}
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
#[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)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `TASKS_STOP` writer - "]
|
||||
pub type TASKS_STOP_W<'a, const O: u8> = crate::BitWriter<'a, u32, TASKS_STOP_SPEC, bool, O>;
|
||||
impl W {
|
||||
#[doc = "Bit 0"]
|
||||
#[inline(always)]
|
||||
pub fn tasks_stop(&mut self) -> TASKS_STOP_W<0> {
|
||||
TASKS_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 = "Stop comparator\n\nThis register you can [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [tasks_stop](index.html) module"]
|
||||
pub struct TASKS_STOP_SPEC;
|
||||
impl crate::RegisterSpec for TASKS_STOP_SPEC {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`write(|w| ..)` method takes [tasks_stop::W](W) writer structure"]
|
||||
impl crate::Writable for TASKS_STOP_SPEC {
|
||||
type Writer = W;
|
||||
}
|
||||
#[doc = "`reset()` method sets TASKS_STOP to value 0"]
|
||||
impl crate::Resettable for TASKS_STOP_SPEC {
|
||||
#[inline(always)]
|
||||
fn reset_value() -> Self::Ux {
|
||||
0
|
||||
}
|
||||
}
|
||||
Vendored
+94
@@ -0,0 +1,94 @@
|
||||
#[doc = "Register `TH` reader"]
|
||||
pub struct R(crate::R<TH_SPEC>);
|
||||
impl core::ops::Deref for R {
|
||||
type Target = crate::R<TH_SPEC>;
|
||||
#[inline(always)]
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
impl From<crate::R<TH_SPEC>> for R {
|
||||
#[inline(always)]
|
||||
fn from(reader: crate::R<TH_SPEC>) -> Self {
|
||||
R(reader)
|
||||
}
|
||||
}
|
||||
#[doc = "Register `TH` writer"]
|
||||
pub struct W(crate::W<TH_SPEC>);
|
||||
impl core::ops::Deref for W {
|
||||
type Target = crate::W<TH_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<TH_SPEC>> for W {
|
||||
#[inline(always)]
|
||||
fn from(writer: crate::W<TH_SPEC>) -> Self {
|
||||
W(writer)
|
||||
}
|
||||
}
|
||||
#[doc = "Field `THDOWN` reader - VDOWN = (THDOWN+1)/64*VREF"]
|
||||
pub type THDOWN_R = crate::FieldReader<u8, u8>;
|
||||
#[doc = "Field `THDOWN` writer - VDOWN = (THDOWN+1)/64*VREF"]
|
||||
pub type THDOWN_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TH_SPEC, u8, u8, 6, O>;
|
||||
#[doc = "Field `THUP` reader - VUP = (THUP+1)/64*VREF"]
|
||||
pub type THUP_R = crate::FieldReader<u8, u8>;
|
||||
#[doc = "Field `THUP` writer - VUP = (THUP+1)/64*VREF"]
|
||||
pub type THUP_W<'a, const O: u8> = crate::FieldWriter<'a, u32, TH_SPEC, u8, u8, 6, O>;
|
||||
impl R {
|
||||
#[doc = "Bits 0:5 - VDOWN = (THDOWN+1)/64*VREF"]
|
||||
#[inline(always)]
|
||||
pub fn thdown(&self) -> THDOWN_R {
|
||||
THDOWN_R::new((self.bits & 0x3f) as u8)
|
||||
}
|
||||
#[doc = "Bits 8:13 - VUP = (THUP+1)/64*VREF"]
|
||||
#[inline(always)]
|
||||
pub fn thup(&self) -> THUP_R {
|
||||
THUP_R::new(((self.bits >> 8) & 0x3f) as u8)
|
||||
}
|
||||
}
|
||||
impl W {
|
||||
#[doc = "Bits 0:5 - VDOWN = (THDOWN+1)/64*VREF"]
|
||||
#[inline(always)]
|
||||
pub fn thdown(&mut self) -> THDOWN_W<0> {
|
||||
THDOWN_W::new(self)
|
||||
}
|
||||
#[doc = "Bits 8:13 - VUP = (THUP+1)/64*VREF"]
|
||||
#[inline(always)]
|
||||
pub fn thup(&mut self) -> THUP_W<8> {
|
||||
THUP_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 = "Threshold configuration for hysteresis unit\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [th](index.html) module"]
|
||||
pub struct TH_SPEC;
|
||||
impl crate::RegisterSpec for TH_SPEC {
|
||||
type Ux = u32;
|
||||
}
|
||||
#[doc = "`read()` method returns [th::R](R) reader structure"]
|
||||
impl crate::Readable for TH_SPEC {
|
||||
type Reader = R;
|
||||
}
|
||||
#[doc = "`write(|w| ..)` method takes [th::W](W) writer structure"]
|
||||
impl crate::Writable for TH_SPEC {
|
||||
type Writer = W;
|
||||
}
|
||||
#[doc = "`reset()` method sets TH to value 0"]
|
||||
impl crate::Resettable for TH_SPEC {
|
||||
#[inline(always)]
|
||||
fn reset_value() -> Self::Ux {
|
||||
0
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user